Line: 1 to 1  

Changed:  
< <  Assignment 1  
> >  Assignment 2  

Line: 1 to 1  

Added:  
> >  Assignment 1
1. Draw the syntax tree for the following lambda expression.
For callbyvalue and callbyname semantics, give the complete
content of the environment at the time when subexpressions
((lambda (a) ((lambda(x) ((lambda (a) (x a)) (+ 2 1))) (lambda(y) (+ a a)))) (+ 1 1)) 2. Recursion construction using lambda calculus (455 only) By recursion we mean a function is defined in terms of itself. Unfortunately lambda calculus does not allow this. However, a function can call some special function and then regenerate itself. By this means, we can achieve recursion using lambda calculus. An instance of this powerful function is defined as
Y := (lambda (y) ((lambda (x) (y x x)) (lambda (x) (y x x))))
It's easy to verify that for any function
F(n) = 1, if n == 0; else n*F(n1)
Since we can't use
F := (lambda (f n) (if (zero n) 1 (* n (f ( n 1)))))
Apply
Now you need to define a recursive function that counts the number
of elements from a list. You may use
which means if TESTEXPR is evaluated true then evaluate TRUEEXPR,
o/w evaluate FALSEEXPR. You may also use
To answer this question, you need to put down your  XiaomingGu  14 Apr 2008 