X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment3_answers.mdwn;h=781649ce504096c76f81ad7a6745eb535c26256b;hp=6aa5d7503467a77a8359fdd7df23ba1c39628f71;hb=422bf1f49096fad4e372d80b7bab3432e4165d60;hpb=8950982eae04ec4ca70862e23122256b526b591b diff --git a/exercises/assignment3_answers.mdwn b/exercises/assignment3_answers.mdwn index 6aa5d750..781649ce 100644 --- a/exercises/assignment3_answers.mdwn +++ b/exercises/assignment3_answers.mdwn @@ -267,6 +267,12 @@ S (S (KS) (S (KK) (S (KS) K))) (KI); this is the B combinator, whi 25. For each of the above translations, how many `I`s are there? Give a rule for describing what each `I` corresponds to in the original lambda term. + This generalization depends on you omitting the translation rule: + + 6. @a(Xa) = X if a is not in X + + > With that shortcut rule omitted, then there turn out to be one `I` in the result corresponding to each occurrence of a bound variable in the original term. + Evaluation strategies in Combinatory Logic ------------------------------------------ @@ -306,8 +312,8 @@ Reduce to beta-normal forms:
  1. (\x. x (\y. y x)) (v w) ~~> v w (\y. y (v w))
  2. (\x. x (\x. y x)) (v w) ~~> v w (\x. y x) -
  3. (\x. x (\y. y x)) (v x) ~~> v w (\y. y (v x)) -
  4. (\x. x (\y. y x)) (v y) ~~> v w (\u. u (v y)) +
  5. (\x. x (\y. y x)) (v x) ~~> v x (\y. y (v x)) +
  6. (\x. x (\y. y x)) (v y) ~~> v y (\u. u (v y))
  7. (\x y. x y y) u v ~~> u v v
  8. (\x y. y x) (u v) z w ~~> z (u v) w