Question: Need to use Coq functional programming language to solve below question: (g) Define the multiplication function mult: Nat -> Nat -> Nat. (3 points) (h)

Need to use Coq functional programming language to solve below question:

Need to use Coq functional programming language to solve below question: (g)

(g) Define the multiplication function mult: Nat -> Nat -> Nat. (3 points)

(h) As unit tests, check the following. (3 points)

(i) mult one one = one

(ii) mult zero (plus three three) = zero

(iii) mult two three = plus three three

Problem 3 (37 points). Alonzo Church has proposed an encoding for natural numbers in pure \-calculus, as follows: A natural number n can be encoded as a higher order function that receives a function f and an argument x, and applies f to x, n number of times, denoted by fx. For example, 04 If.lx.x 14 If..x.fx 24 f. dr.f (f) 34 f.dr.ff (fr)) n A X.X.r.f"c. Extending pure l-calculus with polymorphic data types, gives a polymorphic type equivalent for natural numbers according to this encoding: Nat 4 VX(X + X) + X X, where X is a type variable. Problem 3 (37 points). Alonzo Church has proposed an encoding for natural numbers in pure \-calculus, as follows: A natural number n can be encoded as a higher order function that receives a function f and an argument x, and applies f to x, n number of times, denoted by fx. For example, 04 If.lx.x 14 If..x.fx 24 f. dr.f (f) 34 f.dr.ff (fr)) n A X.X.r.f"c. Extending pure l-calculus with polymorphic data types, gives a polymorphic type equivalent for natural numbers according to this encoding: Nat 4 VX(X + X) + X X, where X is a type variable

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 Databases Questions!