Question: Give an equivalent expression which uses the IO monad instead of side-effects, and state its type. [3 marks] (ii) Give a function run2diff which can

Give an equivalent expression which uses the IO monad instead of side-effects, and state its type. [3 marks] (ii) Give a function run2diff which can be applied to your answer to part (c)(iii). When so applied it should give a value in the IO monad which corresponds to ML code that runs add1 twice and returns the difference between the values read. [4 marks] (iv) State what happens when attempting to compile and execute the following Java fragment (explaining the origin of any error messages or exceptions which might arise). 229 Computation Theory Let N be the natural numbers {0, 21, 32 . . . What is meant by each of the following statements? 1.the set of all recursive subsets of x (a) the set of all recursive sequences of natural numbers [12 marks] (b) the set of all finite sequences of natural numbers 1[5 marks Object n = new Integer(412/ Briefly describe the calling mechanisms just mentioned and discuss why most modern programming languages provide only call by value. [18 marks] (c) Discuss the reasons why languages such as Fortran, Algol and PL/I designed in 1950s and 1960s are less widely used than languages designed in the last 20 years. [6 marks] 3 [TURN OVER CST.2005.5.6 9 Operating Systems II (d) What problem do real-time scheduling algorithms try to solve? [2 marks] (e) Describe one static priority and one dynamic priority real-time scheduling algorithm. [8 marks each] 4 CST.2004.13.5 5 Computer Graphics and Image Processing (b) Java is sometimes said to be "dynamically typed" in that a variable whose type is (class) C can be assigned a value of (class) D provided that D extends C; conversely a variable of type D can be assigned a value of type C using a cast. By considering storage layouts, explain why the former assignment is always valid and the latter sometimes invalid. such that for every tuple s in S, the tuple ts (i.e. the concatenation of tuples t and s) is a member of R. Define the quotient operator using the operators of the core relational algebra. [8 marks] (c) The core relational algebra can be extended with a duplicate elimination operator, and a grouping operator. (e) Define a function inorder of type 'a ltree -> 'a seq that traverses a lazy tree in-order, returning the nodes in a lazy list. (You should define any auxiliary functions you may use.) Set the new range as the print area. (Hint: Page Layout->Print Area->Set Print Area) Go to the Clients worksheet, which includes a table named Clients. CTC Casualty Insurance provides a discount of $10.00 per month for clients who bundle their insurance by buying more than one type of policy, such as auto and homeowners insurance. What scheduling problem could arise here? [2 marks] (f) How could this problem be overcome? [3 marks] (g) The designer also wishes the real-time system to use demand paged virtual memory for efficiency. illustrating your answer by deriving the sequence of numbers and corresponding bit patterns it would generate when applied to a string starting with the following 24 characters: respectively. [12 marks] (b) Estimate how many bits the algorithm would use to encode a string consisting of 1000 repetitions of the character "A". [8 marks] 4 [2 marks] (d) The designer also wishes the real-time system A. Let us Assume a processor has two symmetric groups that contain both utilitarian units and an issue cradle. In this processor, directions should be controlled to a specific bunch before they are embedded in an issue cushion. What should the two fundamental objectives of a decent guiding strategy be?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!