The Lumenary · Advanced undergraduate
The λ-calculus
Name: ______________________
Date: ______________________
You will learn to
- Reduce λ-terms using capture-avoiding substitution, and encode booleans, pairs and natural numbers (Church numerals)
- Use a fixed-point combinator to define recursive functions, and explain why untyped terms need not terminate
- Prove the Church–Rosser theorem by parallel reduction and deduce that a term has at most one normal form
- Prove that every simply typed λ-term has a normal form, and say what this costs in expressive power
- State the equivalence of λ-definability with computability and the undecidability of β-equality
- 1.
List the free variables of the term . Enter each variable name once.
- 2.
What does reduce to in one β-step (with free)?
- A.
- B.
- C.
- D.
- 3.
With Church numerals , the term (the numeral applied to the numeral ) β-reduces to a Church numeral . What is ?
- 4.
Which of these terms have no normal form? Here , , . Choose all that apply.
- A.
- B.
- C.
- D.
- 5.
Why does the proof of the Church–Rosser theorem go through parallel reduction instead of showing directly that one-step reduction has the diamond property?
- A.Because does not have the diamond property: contracting a redex can duplicate another redex, so joining may need several steps on one side.
- B.Because is not terminating.
- C.Because is terminating while is not.
- D.Because the diamond property for is true but too hard to prove.
- 6.
In Turing's proof of weak normalisation we contract a redex of maximal degree chosen so that contains no redex of degree . Which part of the argument needs this choice?
- A.Redexes inside may be copied many times by the substitution ; the choice ensures all the copies have degree less than .
- B.It ensures that no new redexes are created.
- C.It ensures that the redexes inside survive.
- D.It ensures the term is typable after the step.
- 7.
Which of these terms has a type in the simply typed λ-calculus (for suitable types on the bound variables)?
- A.
- B.
- C.
- D.
- 8.
In the lesson's Lean file,
Step t uis one β-step andReflTransGen Step t uis . Which statement is the Church–Rosser theorem, as proved there?- A.
∀ {t u v}, ReflTransGen Step t u → ReflTransGen Step t v → ∃ w, ReflTransGen Step u w ∧ ReflTransGen Step v w - B.
Diamond Step - C.
∀ t, ∃ u, ReflTransGen Step t u ∧ Normal u - D.
∀ {t u v}, Step t u → Step t v → u = v
- A.
- 9.
Python's
lambdacan run Church numerals directly. Withchurch(n)andto_intbelow, definetimes(m, n)andexp(m, n)returning the Church numerals for and , using only application andlambda(no conversion tointinside them).Computational — Practice