Computer Science 3675
Fall 2015
Practice Questions for Quiz 12

  1. What is the significance of λ-calculus to the semantics of programming languages? Answer

  2. If you perform a single β-reduction on (λxy.yx)(wz), what do you get?

    Answer

  3. If you perform a single β-reduction on expression (λxy.xxy) (λz.zz), what do you get?

    1. λyz.zz (λz.zz) y
    2. xy.xxy) (λxy.xxy)
    3. λxy.(xxy) (xxy)
    4. λy.(λz.zz) (λz.zz) y

    Answer

  4. For this problem, the following λ-calculus functions are assumed to be predefined, where x and y are Church-numerals and true and false are the standard boolean values.

    Suppose that function k is defined in λ-calculus by k = λfx.cond (isZero(x)) (1) (times (2) (f (pred x))).

    If function g is defined by g = fix k, then which of the following is true of g?

    1. g(0) = 0, g(1) = 1, g(2) = 2.
    2. g(0) = 1, g(1) = 2, g(2) = 4.
    3. g(0) = 1, g(1) = 1, g(2) = 1.
    4. g(x) has no normal form for every Church-numeral x.

    Answer

  5. A combinator is a term of λ-calculus that has no free variables. Which of the following are combinators?

    1. λxy.x
    2. λxyz.xz (yz)
    3. λxy.yzx

    Answer