Chapter 1 Flashcards

1
Q

3 types of lamda calculus terms

A

a variable
a function applied to an argument
a lambda term - function with input parameter and function body

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

Meaning of lambda term

t0 t1

A

function t0 applied to argument t1

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

Function application is what associative

A

left associative

t1 t2 t3 = (t1 t2) t3

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

Higher order function

A

A function that can accept other functions

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

A variable name is free in an expression if 1 of the following three cases hold:

A

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

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

A variable is bound in two cases:

A

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

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

Can the same identifier occur free and bound in the same expression?

A

Yes

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

FV(x) = ?

A

FV(x) = {x}

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

FV(t0 t1) = ?

A

FV(t0) U FV(t1)

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

FV(lambda x, t) = ?

A

FV(lambda x, t) = FV(t) - {x}

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

BD(t) = ?

A

var(t) - FV(t)

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

bound variable

A

defined by the closest lambda operator

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

lexical (static) scoping

A

the variable’s scope is defined by the text of the program

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

What does lexical in lexical scoping mean?

A

It is possible to determine the scope before the program runs by inspecting the program text

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

a term is closed if

A

all variables are bound

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

a term is open if

A

not all variables are bound

17
Q

alpha reduction

A

renaming a bound variable

18
Q

alpha equivalent

A

if a term alpha reduces to another term

19
Q

what is alpha reduction also called alpha renaming?

A

Defines an equivalence relation on the set of terms, but doesn’t make computational progress

20
Q

What does t{y/x} notation mean?

A

substituting all occurences of x in t with y ….y substitutes for x

21
Q

B-reduction

A

main computational rule in lambda calculus; done by capture avoiding substitution

22
Q

steps of B-reduction for (lambd x. t) t’

A
  1. If no free variables in t’ is bound in the function body t (FV(t’) intersects BD(t) = empty set, replace all occurences of x in t with t’
  2. Otherwise, apply alpha-reductions until the first rule applies