COMS W3261
Computer Science Theory
Homework Assignment #5
November 28, 2012
Due in class 1:10pm, December 5, 2012


Instructions

Problems

  1. Here is an ambiguous grammar G for lambda calculus:
    1. Construct an unambiguous grammar equivalent to G. Have your unambiguous grammar enforce the standard disambiguating conventions for lambda expressions.
    2. Show one parse tree in each grammar for the expression
         (λx. λy. x y) λz. z

  2. Consider the lambda-calculus expression (λx. (λy. x) x) ((λz. z) (λw. (λv.v) w) ).
    1. Identify all redexes in this expression.
    2. Evaluate this expression using normal order evaluation.
    3. Evaluate this expression using applicative order evaluation.

  3. Evaluate the lambda expression (λx.(λy.(x(λx.xy))))y. Describe all the steps in your evaluation.

  4. Let G be the lambda abstraction
  5. Evaluate the lambda expression G G.

  6. Let add, one, and two be the following lambda expressions:
  7. Evaluate (add one two).

aho@cs.columbia.edu