0

I am new to lambda Calculus and wanted to understand the 2 following questions:

1) The term λx.x a b is equivalent to which of the following? 
   a. (λx.x) (a b)
   b. (((λx.x) a) b) 
   c. λx.(x (a b)) d
   d. (λx.((x a) b))

I saw the answer is d and wanted to see why this is true as I was inclined to pick a

The next asks for call by value

(λx.x) 5 + 1

If there are no parenthesis in the values would it get evaluated as 5+1? What if there were parenthesis?

Ran123
  • 3
  • 2
    The conventions for parentheses differ from one book to another. Indeed answer (d) is standard (λ scopes as far as it can, and application associates to the left), but it is just a matter of conventions! – sparusaurata Sep 15 '23 at 18:14
  • 1
    There is a good reason for function application associate to the left; it provides convenient syntax for Curried functions and is used in functional languages like Haskell for a cleaner aesthetic that requires minimal parentheses. – Mark Saving Sep 15 '23 at 18:34
  • So there is no need for the parenthesis around x a for d as that is the part that confuses me. It can be equivalent to (λx.(x a b)) and it would be the same. If not then what does the inner parentheses do as only x is the bound variable. – Ran123 Sep 15 '23 at 19:42

0 Answers0