Haskell代写代考

CS计算机代考程序代写 Haskell G6021: Comparative Programming

G6021: Comparative Programming Exam Practice 1. Consider the ¦Ë-term t = (¦Ëx.xx)(II), where I = ¦Ëx.x. (a) Give the definition of a ¦Â-reduction graph. (b) Draw the ¦Â-reduction graph of the term t. (c) Which reduction strategy gives the shortest reduction sequence for reducing t to normal form? 2. Give the types of the following: […]

CS计算机代考程序代写 Haskell G6021: Comparative Programming Read More »

CS计算机代考程序代写 Haskell G6021: Comparative Programming

G6021: Comparative Programming Exam Practice 1. Consider the ¦Ë-term t = (¦Ëx.xx)(II), where I = ¦Ëx.x. (a) Give the definition of a ¦Â-reduction graph. Answer: A graph showing all the possible reductions starting from the initial term. (b) Draw the ¦Â-reduction graph of the term t. Answer: (¦Ëx.xx)(II) c (¦Ëx.xx)I E (II)(II) I(II) E II

CS计算机代考程序代写 Haskell G6021: Comparative Programming Read More »

CS计算机代考程序代写 prolog Haskell G6021: Comparative Programming

G6021: Comparative Programming Exam Practice 3 1. Given the ¦Ë-terms: I = ¦Ëx.x, T = ¦Ëx.xIII and U = ¦Ëzy.y(¦Ëx.xz): (a) (b) (c) (d) 2. (a) (b) (c) (d) (e) 3. (a) (b) (c) (d) Write the ¦Ë-term T U out in full (without abbreviations, and including ALL brackets). Draw the ¦Â-reduction graph of the

CS计算机代考程序代写 prolog Haskell G6021: Comparative Programming Read More »

CS计算机代考程序代写 interpreter Haskell G6021: Comparative Programming

G6021: Comparative Programming Exercise Sheet 10 1 Bits of past exam questions The following questions are parts of past exam questions (or very similar to them). You would have to answer these on paper, but for this exercise sheet, try to test your answers with the Haskell interpreter in the labs. 1. Give the output

CS计算机代考程序代写 interpreter Haskell G6021: Comparative Programming Read More »

CS计算机代考程序代写 Haskell Java G6021: Comparative Programming

G6021: Comparative Programming Exam Practice 2 1. (a) Give an example for each of the following: i. a ¦Ë-term that is in normal form but does not have a type. ii. a ¦Ë-term that has a normal form but does not have a type. iii. a ¦Ë-term that has a normal form and does have

CS计算机代考程序代写 Haskell Java G6021: Comparative Programming Read More »

CS计算机代考程序代写 Haskell G6021: Comparative Programming

G6021: Comparative Programming Exercise Sheet 4 1 Data Types In Haskell we can define our own types in two ways: • Renaming old types, for example: type Name = [Char]. • Constructing new types, for example: data MyBool = T | F. (Adding deriving (Show) means that Haskell will print these types.) When constructing new

CS计算机代考程序代写 Haskell G6021: Comparative Programming Read More »

CS计算机代考程序代写 prolog Haskell G6021: Comparative Programming

G6021: Comparative Programming Exam Practice 3 1. Given the λ-terms: I = λx.x, T = λx.xIII and U = λzy.y(λx.xz): (a) Write the λ-term T U out in full (without abbreviations, and including ALL brackets). Answer: ((λx.(((x(λx.x))(λx.x))(λx.x)))(λz.(λy.(y(λx.(xz)))))) (b) Draw the β-reduction graph of the λ-term TU. Answer: There is only one reduction at each step:

CS计算机代考程序代写 prolog Haskell G6021: Comparative Programming Read More »