Chapter 1 Flashcards
3 types of lamda calculus terms
a variable
a function applied to an argument
a lambda term - function with input parameter and function body
Meaning of lambda term
t0 t1
function t0 applied to argument t1
Function application is what associative
left associative
t1 t2 t3 = (t1 t2) t3
Higher order function
A function that can accept other functions
A variable name is free in an expression if 1 of the following three cases hold:
is free in
is free in E1 E2 if is free in E1 or it is free in E2
is free in lambda. if != AND is free in
A variable is bound in two cases:
is bound in lamdba . if the identifer = or if is bound in
is bound in E1 E2 if is bound in E1 or bound in E2
Can the same identifier occur free and bound in the same expression?
Yes
FV(x) = ?
FV(x) = {x}
FV(t0 t1) = ?
FV(t0) U FV(t1)
FV(lambda x, t) = ?
FV(lambda x, t) = FV(t) - {x}
BD(t) = ?
var(t) - FV(t)
bound variable
defined by the closest lambda operator
lexical (static) scoping
the variable’s scope is defined by the text of the program
What does lexical in lexical scoping mean?
It is possible to determine the scope before the program runs by inspecting the program text
a term is closed if
all variables are bound