Structure and Interpretation 2 Flashcards

1
Q

What have we done so far?

A

We have used primitive arithmetic operations, we have combined these operations, and we have abstracted these composite operations by defining them as compound procedures.

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

How can we define a procedure in terms of evolution?

A

A procedure is a pattern for the “local evolution” of a process. It specifies how each stage of a process is built upon the previous stage. We would like to be able to make statements about the overall, or “global” behavior of a process whose local evolution has been specified by a procedure.

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

Where does the word “local” come from?

A

From the Latin “Locus” meaning place.

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

In general, the number of steps required by a tree-recursive process will be proportional to ____.

A

The number of nodes in the tree.

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

In general, the space required by a tree-recursive process will be proportional to _____.

A

the maximum depth of the tree

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

A programming language uses an evaluation strategy to determine ____.

A

when to evaluate the argument or arguments of a function call and what kind of value to pass to the function.

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

Delaying evaluation of procedure arguments until the last possible moment (e.g. until they are required by a________) is called lazy evaluation.

A

primitive operation

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

What is a higher order procedure?

A

A procedure that produces a procedure as its value.

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

In an applicative order language _____ when the procedure is applied.

A

all the arguments are evaluated

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

In a normal order language, ____ until the argument values are needed.

A

evaluations of procedure arguments are delayed

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

What two things does the call mechanism involve?

A

The parameter passing mechanism

The replacement of the call to the function by the body of the function called (without the header)

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

Applicative order evaluates subexpressions _____.

A

when, i.e. just before, the procedure is applied.

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

Normal order evaluates subexpressions as they are, without evaluation, and proceeds with the evaluation only when ____.

A

the corresponding formal parameter is actually itself to be evaluated.

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

evaluate all arguments, then apply operator

A

applicative order evaluation

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

pass unevaluated expressions to function, evaluate only when needed for primitive operation

A

normal order evaluation

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

evaluate completely all subexpressions before we apply the current procedure

A

applicative order evaluation

17
Q

expand all the defined procedures into their bodies until everything is expressed in terms of primitive operations and self-evaluating values

A

normal order evaluation

18
Q

“fully expand and then reduce”

A

normal order

19
Q

“evaluate the arguments and then apply”

A

applicative order

20
Q

The key to understanding complex ideas is ____.

A

knowing what to ignore

21
Q

What is peano arithmetic?

A

Adding by incrementing and decrementing

22
Q

A linear recursion is proportional to _____ in time and space.

A

the order of x

23
Q

Iteration is a system that has ______.

A

all of its state in explicit variables.

24
Q

In recursion, the deferred procedures have ____.

A

implicit, hidden variables