Csc 4980/6980, Functional Programming (Fall 2026)
Homework 1 (Due: 13 September - Sunday)
sudo handin4980 1 file1 ...For all of these problems, your should try to solve by hand and then use the command-line interpreter and/or the Visualizer to verify your solution. Submit only screenshots of the final solution from the interpreter/visualizer. You may have to convert the lambda-expressions to the text form and include all relevant parentheses (using the rules for missing parentheses from the slides) so that the expressions are accepted by the interpreter/visualizer.
- Draw expression trees for the following λ-expressions:
- λx.(x λy.(y x))
- λx.λy.((λx.y x p)(λz.z x))
- For each of the following terms, identify the free variables in each term and
for each bound variable indicate (by drawing an arrow) to the λ to which it is
bound.
- λs.s z λq.s q
- (λs.s z) λq. w λw.w q z s
- Apply β-reductions to the folowing λ expressions as much as possible:
- (λz.z) (λz.z z) (λz.z q)
- (λs.λq.s q q) (λq.q) q
- ((λs.s s) (λq.q)) (λq.q)
- Consider the following definitions for the booleans "true" and "false" and
logical operator "and":
true = λx.λy.x false = λx.λy.y and = λb1.λb2.(b1 b2 false)
Using β-reductions, show that- (and false true) reduces to false
- (and true true) reduces to true
What to submit? p1.pdf