SICP 1 Flashcards

1
Q

What are three mechanisms a programming language has for combining simple ideas to make complex ones?

A

Primitive expressions, means of combination, means of abstraction

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

What are the two elements we deal with in programming?

A

procedures and data

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

What should a powerful programming language be able to describe and have methods for?

A

Describing primitive data and procedures, and methods for combining and abstracting procedures and data

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

What do we focus on in chapter 1 of SICP?

A

Simple numerical data so we can focus on the rules for building procedures.

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

What does an interpreter do when you type an expression?

A

Displays the result of evaluating that expression

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

Name a primitive expression

A

a number

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

What can expressions representing a number be combined with?

A

An expression representing a primitive procedure to form a compound expression that represents the application of the procedure to those numbers

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

What are combinations?

A

Expressions formed by delimiting a list of expressions to denote procedure application.

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

WHat is the leftmost and other expressions called.

A

Operator and operands

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

how is the value of a combination obtained?

A

By applying the procedure specified by the operator to the arguments that are the values of the operands

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

What does a name do?

A

A name identifies a variable whose value is the object

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

Why is define the simplest method of abstraction?

A

It allows us to use simple names

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

Why is abstraction useful?

A

Computational objects may have complex structures and it would be inconvenient to have to remember and repeat their details every time we use them.

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

What is the memory called that contains the name-object pairs?

A

The global environment

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

What is one of our goals for this chapter?

A

To isolate issues about thinking procedurally

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

What is the interpreter doing while evaluating expressions?

A

Following a procedure

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

Describe how to evaluate a combination

A

1 Evaluate the subexpressions of the combination 2 apply the procedure that is the value of the operator to the arguments that are the values of the operands

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

What makes the evaluation rule recursive in nature

A

It includes as one of its steps the need to invoke itself

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

What are exceptions to the general evaluation rule called

A

special forms

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

What are procedure definitions?

A

A much more powerful abstraction technique by which a compound operations can be given a name and then referred to as a unit.

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

What is the aplplication process for compound procedures?

A

To apply a compound procedure to arguments, evaluate the body of the procedure with each formal parameter replaced by the corresponding argument

22
Q

What is the first process for procedure application called?

A

the substitution model for procedure application`

23
Q

What is the fully expand and reduce evaluation method called?

A

Normal order evaluation

24
Q

What is the evaluate the arguments and then apply method called?

A

Applicative order evalation.

25
Q

What is the lisp form for notating a case analysis?

A

cond

26
Q

What are procedures similar to in maths?

A

mathematical functions

27
Q

\What is the contrast between function and procedure?

A

Distinction between declarative(what is) vs imperative (how to) knowledge

28
Q

WHat doi we call it when we see a procedure as a black box?

A

A procedural abstraction

29
Q

What is a formal parameter called that doesnt matter what name the formal parameter has?

A

A bound varibale, and we say the procedure definition binds its formal parameters.

30
Q

If a variable is not bound …?

A

It is free

31
Q

The set of expressions for which a binding defines a name is a ?

A

scope

32
Q

What is nesting of definitions called?

A

Block structure

33
Q

what is lexical scoping

A

When we allow x to be a free variable in the internal defintions.

34
Q

What is a procedure?

A

A patttern for the local evolution of a process.

35
Q

What do we do in 1.2 of |SICP

A

We would like to be able to make statements about the overall or global behaviour or a process whos evoolurtion has been specified by a procedure.

36
Q

What characterises linear recursion>

A

A shape of expansion and contraction. The expansion occurs as the process builds up a chain of derred operations. The contractions happen when the operations are actually performed. Carrying out this process requires that the interpreter keeo track of the operations to be performed later on. The length of the chain of deffered multipolpications and hence the amount od information needed to keep traack of it grows linearly with n.

37
Q

What characterises a linear iterative process?

A

State can be summarised by a number of state varibales together with a fixed rule that describes how the state variables should be updated as the process movfes from state to state.

38
Q

WHen we descibe a procedure as recursive?

A

we are referring to the syntactic fact that the procedure definition refers to the procedure itself.

39
Q

When we describe a process as recursive?

A

We are speaking about how to process evolbes

40
Q

What are procedures in effect?

A

Abstractions that descirbe compound operations on numbers independent of their particular numbers

41
Q

What are higher order procedures?

A

procedures that manipulate procedures

42
Q

What does lambda do?

A

It creates procedures?

43
Q

what does (lambda (x) (+ 4 x)) mean?

A

Create the procedure that returns the number plus 4.

44
Q

What is the difference between lambda and define?

A

No name is specified for the procedure

45
Q

What is let used for?

A

Creating local variables

46
Q

What doies the ability to pass procedures as arguments do?

A

it enhances the expressive power of our programming language.

47
Q

How do we create even more expressive power>

A

By creating procedures whose returned values are themselves procedures.

48
Q

What happens when we express a procedure in terms of these abstractions?

A

The idea becomes clearer

49
Q

WHat should programmers be alert to? (abstractions)

A

Identify the underlying abstractions in our programs and build on them and generalise them to create more powerful abstractions

50
Q

WHat did we do in chapter 1

A

How to use primitve data and operations. How to combine proedures to form compound procedure through composition, conditionals and the use of parameters, and how to abstract procedures using define. WE saw that a procedure can be regarderd as a pattern for the local evolution of a process and we claassified reasoned about and performed simple algorithmic analysis of some common patterns for procedures. We alois saw that higher order procedures enhance the power of our langaugae by enabling us to manipulate and then reaspn in terms of general methods of computation.

51
Q

WHat did we do in chapter 1

A

How to use primitve data and operations. How to combine proedures to form compound procedure through composition, conditionals and the use of parameters, and how to abstract procedures using define. WE saw that a procedure can be regarderd as a pattern for the local evolution of a process and we claassified reasoned about and performed simple algorithmic analysis of some common patterns for procedures. We alois saw that higher order procedures enhance the power of our langaugae by enabling us to manipulate and then reaspn in terms of general methods of computation.