lambda calculus Flashcards

1
Q

x is free in (E,F) iff

A

x is free in E or x is free in F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

x is free in (Ly . E) iff

A

x and y are diff var and x is free in E

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

x is bound in (E,F) iff

A

x is bound in E or x is bound in F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

x is bound in (Ly. E) iff

A

x and y are same var and x occurs free in E or x occurs bound in E

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

x [M/x] =

A

M

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

c [M/x] (whr c is any var or constant other than x)= =

A

c

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

(E F) [M/x]

A

= (E [M/x]) (F [M/x])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

(Lx. E) [M/x] (whr y is any var other than x) = two answers

A

= Ly.(E[M/x]) if x does not occur free in E or y does not occur free in M
= Lz.(E[z/y])[M/x] otherwise, whr z is new var and is not free in E or M

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

a-conversion:
if y is not free in E then
(Lx.E) ?

A

(Ly.E[y|x])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

b-conversion:

(Lx.E)M ?

A

E[M|x]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

n-conversion:
if x is not free in E and E denotes a func
(Lx. Ex) ?

A

E

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

define normal form

A

(Lx.xx)(Lx.xx) cannot be reduced ; no redex’s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

define delta-reduction

A

built in constant functions i.e. + or -

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

y combinator:

Yf = ?

A

f (Yf)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

y combinator:

y returns the fixpoint of f; y is expressed in lambda calc as:

A

Y = (Lh. (Lx. h(x x)) (Lx.h(x x)))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

y combinator:

write factorial function FAC =

A

Y (Lfac. Ln. if (= n 0) 1 (* n (fac (- n 1 ))))

17
Q

applicative order reduction

A

leftmost, innermost redex first

18
Q

normal order evaluation

A

leftmost, outermost redex first

19
Q

church-rosser theorem I

A

if E1 E2, then there exists an expression E such that E1 => E; E2 => E;

No expression can be converted to two distinct normal forms (normal forms that are not a-interconvertible)

20
Q

church-rosser theorem ii

A

if E1 => E2 and E2 is in norm form, then there exists a norm reduction seq from E1 to E2