For a lambda expression (x (λx y. x y) z h), I did not understand how free variables x (outer x), z and h can be converted in C code?
Regards,
darkie
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Free variables are a special case in the Lambda Calculus — they cannot be “converted” to anything, so usually they’re taken as just symbols. In your example, and given some fictitious constructors for lambda expressions, you’d translate it to the following (which includes dealing with the implicit currying) C-like expression:
Obviously, you can use
mk_var()for those symbols too, but that would be misleading since they’re not really variables, since they’re not bound. In other words, if you do any alpha conversion on the expression, they will have to stay the same.(BTW, the relevant part here is Barendregt’s free variable assumption.)