Question
Instruction: Suppose a read takes 123 units of time and the processing 212 units of time, so that reading a block and processing takes 5
Instruction: Suppose a read takes 123 units of time and the processing 212 units of time, so that reading a block and processing takes 5 units of elapsed time. L[3 marks] (ii) Give a function run2diff which can be applied to your answer to part (c)(i). 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] (d) 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). Object n = new Integer(42), o = new String("Whoops"); c) List the terminal images and non-terminal images, and count the creation rules both in the first syntax and in the sentence structure in your response to part (b). Demonstrate the beginning image in the two sentence structures. [2 marks] c) List the terminal images and non-terminal images, and count the creation rules both in the first syntax and in the sentence structure in your response to part (b). Demonstrate the beginning image in the two sentence structures. [2 marks] (d) Define a sort or types (in C, Java, or ML) appropriate for holding a theoretical linguistic structure tree coming about because of your solution to part (b). (e) Give a brief and rudimentary clarification of the standards of how the language coming about because of part (b) may be utilized to make a sentence structure analyser taking a token stream as information (by means of calls to work lex()) and giving as result an theoretical language structure tree relating to part (d). Notice both transcribed also, consequently created grammar analysers. (c) List the terminal images and non-terminal images, and count the creation rules both in the first syntax and in the sentence structure in your response to part (b). Demonstrate the beginning image in the two sentence structures. [2 marks] (d) Define a sort or types (in C, Java, or ML) appropriate for holding a theoretical (d) Define a sort or types appropriate for holding a theoretical linguistic structure tree coming about because of your solution to part (b).[2 marks] (d) Define a sort or types (in C, Java, or ML) appropriate for holding a theoretical linguistic structure tree coming about because of your solution to part (b). (e) Give a brief and rudimentary clarification of the standards of how the language coming about because of part (b) may be utilized to make a sentence structure analyser taking a token stream as information (by means of calls to work lex()) and giving as result an theoretical language structure tree relating to part (d). Notice both transcribed also, consequently created grammar analysers. (c) List the terminal images and non-terminal images, and count the creation rules both in the first syntax and in the sentence structure in your response to part (b). Demonstrate the beginning image in the two sentence structures. [2 marks] (d) Define a sort or types (in C, Java, or ML) appropriate for holding a theoretical (d) Define a sort or types appropriate for holding a theoretical linguistic structure tree coming about because of your solution to part (b). (a) Describe the tasks that should be carried in implementing a front end for this language and any difficulties that might be encountered. [5 marks] (b) Suppose that the target virtual machine is stack-oriented and that the stack elements are integer values, and addresses can be stored as integers. Explain which other features are required in such a virtual machine. Invent a simple language of instructions for such a machine and show how it would be used to implement each of the expressions. [10 marks] (c) Suppose that the following rules are proposed as possible optimizations to be implemented in your compiler. expression simplifies to expression (fst e, snd e) e fst (e1, e2) e1 snd (e1, e2) e2 Describe how you could implement these rules so that the simplifications are made only when the program's semantics is correctly preserved. [5 marks] 5 (TURN OVER) CST.2016.3.6 5 Concepts in Programming Languages (a) Explain what is meant by a monad in a programming language, giving the two fundamental operations of a monad along with their types. 15 Software and Interface Design (a) Define briefly, for each of the following techniques, what its purpose is and how it is conducted.
(i) Regression testing (ii) A/B testing (iii) Unit testing (iv) Load testing [12 marks]
1.Describe how polled I/O works and state its disadvantages. Under what conditions is polling a sensible approach? Describe an alternative approach. (You may find it helpful to provide a few lines of psuedo code.) [4 marks] 2. Although each of these techniques can provide new information of value to a software project, costs can be reduced if information is available earlier in the design cycle. For each of the four techniques in part (a), suggest a method by which some of the resulting information could be obtained earlier in the project. [8 marks] What I'd like is some sort of database of recipes to which I can send queries such as "Find me something that doesn't contain cabbage or tomatoes that takes less than 90 minutes to prepare", or "I've got kohlrabi in the veg box AGAIN, are there any recipes I haven't tried that might make something edible out of it?", or "I've actually got a couple of hours free to cook this weekend, what was that complicated Ottolenghi recipe I flagged two weeks ago to try later?". 3.To what extent does heterogeneity in I/O systems add complexity to an operating system? [2 marks] The database needs to cope with the fact that ingredients can have different names but mean the same thing: e.g. "flour" and "plain sugar" and that "1/4 lb" and "4oz" are the same thing and equal to "100g" (and not 117g). It would be great if once I've chosen this week's menu, it could produce a shopping list I can plug into www.myfavouritesupermarket.com, and it needs to be usable by non-engineers.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started