35^{o}C 3 + 4 · 5 ,

\sqrt{A}

A^{B} π 3.14 · r^{2} .

3.14 · 5^{2} = 3.14 · 25 = 78.5 .

\frac{n}{3} + 2

n^{2} + 10 \frac{1}{2} · n^{2} + 20 2 − \frac{1}{n} 12 · h .

Phase  Goal  Activity

Contract Header & Purpose to name the program, to specify its inputs & outputs, to describe its purpose, to formulate a program header choose a name that fits the problem • study the problem for clues on how many numbers the function consumes

• pick one variable per input; if possible, use names that are mentioned for unknown “givens” in the problem statement

• describe what the function should produce using the chosen variables names

• formulate the contract & header: ;; name : number … → number ;; Purpose: to compute … x1 … (define (name x1 …) …)

Examples to characterize the inputoutput relationship via examples search the problem for examples • add examples to function (input(s), output) • validate the examples using the problem statement, if possible

Body to define the program formulate how the function computes its results • develop a Scheme expression that uses Scheme’s primitive operations, other functions, and the variables • translate the mathematical expressions in the problem statement, if possible

Test to expose mistakes (“typos” and logic) apply the function to the inputs of the examples • check that the outputs are as predicted above

English  metric
1 inch  = 2.54 cm
1 foot  = 12 in.
1 yard  = 3 ft.
1 rod  = 5\frac{1}{2} yd.
1 furlong = 40 rd.
1 mile  = 8 fl.

g · t x = y and x < y and x > y x = y or x < y or x > y x = y or x < y .

0  ^{5}  ^{10} ( )

[figure: 0; 5; 10; (; ); []

0  ^{5}  ^{10} (  ]

0  ^{5}  ^{10} [  ]

0  ^{5}  ^{10} [  )

0  ^{5}  ^{10} (  )  (  )

[figure: 0; 5; 10; (; )]

x^{2} + 2 · x + 1 = 0 x^{2} + 2 · x + 1 = (−1)^{2} + 2 · (−1) + 1 = 1 − 2 + 1 = 0 . x^{2} + 2 · x + 1 = (1)^{2} + 2 · (1) + 1 = 1 + 2 + 1 = 4 , x^{2} + 2 · x + 1 = 0 4 · n + 2 = 62 2 · n^{2} = 102 4 · n^{2} + 6 · n + 2 = 462

[figure: 0; 5, 000; 10, 000; [; ]; (; ]; (]

Data Analysis to determine the distinct situations a function deals with inspect the problem statement for distinct situations • enumerate all possible situations

Examples to provide an example per situation choose at least one example per situation • for intervals, the examples must include borderline cases

Body (1) Conditions to formulate a conditional expression write down the skeleton of a cond expression, with one clause per situation • formulate one condition per situation, using the parameters • show that the conditions distinguish the examples appropriately

Body (2) Answers to formulate the body of each cond-line deal with each cond-line separately • assume the condition holds and develop a Scheme expression that computes the appropriate answer 0.25 · 1/100 · 400 1.25 = 0.25 · 1/100 · 500 0.50 · 1/100 · 900 = 4.50 a · x^{2} + b · x + c = 0 .

2 · x^{2} + 4 · x + 2 = 0 1 · x^{2} + 0 · x + (−1) = 0 .

2 · (−1)^{2} + 4 · (−1) + 2 = 2 − 4 + 2 = 0 . b^{2} > 4 · a · c b^{2} = 4 · a · c b^{2} < 4 · a · c \sqrt{x^{2} + y^{2}} .

[figure: y; x; a pixel]

name:  zip:  number: 'PeterLee  15270      606-7771

[figure: the subcollection designated by a data definition; the collection of all Scheme data]

Data Analysis & De- sign to formulate a group of data definitions determine how many pieces of data describe the “interesting” aspects of a typical object mentioned in the problem statement • add a structure definition and a data definition (for each class of problem object)

Contract Header & Purpose to name the program, to specify its inputs & outputs, to describe its purpose, to formulate a program header name the function, its inputs, its output, and specify its purpose: ;; name : in1 in2 … → out ;; Purpose: to compute … x1 … x2 (define (name x1 x2 …) …)

Examples to characterize the inputoutput relationship via examples search the problem for examples • add examples to function (input(s), output) • validate the examples using the problem statement, if possible

Template to formulate an outline for a group of programs for those parameters that stand for compound values, annotate the body with selector expressions • if the function is conditional, annotate all appropriate branches

Body to define the program develop a Scheme expression that uses Scheme’s primitive operations, other functions, selector expressions, and the variables

Test to expose mistakes (“typos” and logic) apply the function to the inputs of the examples • check that the outputs are as predicted above

[figure: 5; 10; 0; 5; center; r; upper left; width; height; A (6,1.5); B (8,6); C (4,4)]

[figure: 5; 10; 0; 5; C; D; E; A; B] Data Analysis & De- sign to formulate a group of data definitions determine how many distinct classes of “objects” make up the collection of inputs • enumerate the alternatives in a data definition • formulate a data definition for each alternative, if it is a from of compound data

Contract Header & Purpose to name the program, to specify its inputs & outputs, to describe its purpose, to formulate a program header name the function, its inputs, its output, and specify its purpose: ;; name : in1 in2 … → out ;; Purpose: to compute … x1 … x2 (define (name x1 x2 …) …)

Examples to characterize the inputoutput relationship via examples create examples of the input-output relationship • make sure there is at least one example per alternative

Template to formulate an outline for a group of programs introduce a cond-expression with one clause per alternative • formulate a condition for each case, using built-in and predefined predicates

Body to define the program develop a Scheme expression (an answer) for each cond-line, assuming that the condition holds

Test to expose mistakes (“typos” and logic) apply the function to the inputs of the examples • check that the outputs are as predicted above |

<var> =  x | area-of-disk | perimeter | . . .

<con> =  true | false

             'a | 'doll | 'sum | . . .
             1 | -1 | 3/5 | 1.22 | . . .

<prm> =  + | - | . . .

<def> =  (define (<var> <var> . . . <var> ) <exp> )
<exp> =  <var>

| <con>
| (<prm> <exp> . . . <exp> )
| (<var> <exp> . . . <exp> )
| (cond (<exp> <exp> ) . . . (<exp> <exp> ))
| (cond (<exp> <exp> ) . . . (else<exp> ))

1. x 2. (=yz) 3. (=(=yz)0)

1. (3+4) 2. empty?(l) 3. (x) Solution

1. (define(fx)x)  2. (define(fx)y)  3. (define(fxy)3)

1. (define(f'x)x)  2. (define(fxyz)(x))  3. (define(f)10) Solution

1. (x) 2. (+1(notx)) 3. (+123)

1. (define(fx)'x)  2. (define(f'x)x)  3. (define(fxy)(+'y(notx)))

<val> = <con>

(fv-1...v-n) = exp with all x-1...x-n replaced by v-1...v-n

(=10)

1 / 0

(/10)

<exp> =  (and <exp> <exp> )

            | (or <exp> <exp> )

<exp-1>

<exp-2>

≡

<def> =  (define <var> <exp> )

<def>

<var0>

<var-1> . . . <var-n>

<val> = (make-c <val> ... <val> )

. . .

<def> =  (define (<var> <var> . . . <var> ) <exp> )

| (define <var> <exp> )
| (define-struct <var0> (<var-1> . . . <var-n> ))

<exp> =  <var>

| <con>
| (<prm> <exp> . . . <exp> )
| (<var> <exp> . . . <exp> )
| (cond (<exp> <exp> ) . . . (<exp> <exp> ))
| (cond (<exp> <exp> ) . . . (else<exp> ))
| (and <exp> <exp> )
| (or <exp> <exp> )

(first(cons10empty))

(rest(cons10empty))

(rest(cons10(cons22empty)))

(first(cons22empty))

Øfi A list of symbols (list-of-symbols) is either Øfi 1.the empty list, empty, or Øfi 2.(consslof) where s is a symbol and lof is a list of symbols .

ØfiØfi (define(fun-for-losa-list-of-symbols) (cond [(empty?a-list-of-symbols)...] [else...(firsta-list-of-symbols)... (resta-list-of-symbols)    ...]))

Data Analysis & De- sign to formulate a group of data definitions develop a data definition for mixed data with at least two alternatives • one alternative must not refer to the definition • explicitly identify all self-references in the data definition

Contract Header & Purpose to name the program, to specify its inputs & outputs, to describe its purpose, to formulate a program header name the function, its inputs, its output, and specify its purpose: ;; name : in1 in2 … → out ;; Purpose: to compute … x1 … x2 (define (name x1 x2 …) …)

Examples to characterize the inputoutput relationship via examples create examples of the input-output relationship • make sure there is at least one example per alternative

Template to formulate an outline for a group of programs develop a cond-expression with one clause per alternative • add selector expressions to each clause • annotate the body with natural recursions • Test: the self-references in this template and the data definition match!

Body to define the program formulate a Scheme expression for each simple cond-line • explain for all other cond-clauses what each natural recursion will compute • formulate the answer, using selector expressions, parameters, etc.

Test to expose mistakes (“typos” and logic) apply the function to the inputs of the examples • check that the outputs are as predicted above 17.05 + 1.22 + 2.59 = 20.86 .

5^{o}C 95^{o}C

\frac{−b}{2 · a} ;

−b + \sqrt{b^{2} − 4 · a · c} 2 · a

\frac{−b − \sqrt{b^{2} − 4 · a · c}}{2 · a} ;

shape  position size(s) color
circle (50,50) 40 red
rectangle (30,20) 5 × 5 blue
rectangle (65,20) 5 × 5 blue
rectangle (40,75) 20 × 10 red
rectangle (45,35) 10 × 30 blue

(hellos0)

(hellos1)

n · (n − 1) · . . . · 2 · 1

\frac{n · (n − 1) · . . . 21 · 20 · . . . 1}{20 · . . . 1} = n·(n−1)·. . .·21· \frac{20 · . . . 1}{20 · . . . 1} = n·(n−1)·. . .·21 .

n · (n − 1) · . . . · 21 · 1 n · (n − 1) · . . . · (limit+ 1) · 1 x^{n} .

[figure: (10, 10); (60, 60); (10, 60)]

ader daer dear dera aedr  eadr edar edra aerd eard  erad erda adre dare drae  drea arde rade rdae rdea  ared raed read reda

<prm>

<val>

Carl (1926) Eyes: green Bettina (1926) Eyes: green

Adam (1950) Eyes: yellow Dave (1955) Eyes: black

Eva (1965) Eyes: blue

[figure] [figure]

Fred (1966) Eyes: pink

Gustav (1988) Eyes: blush

[figure]

[figure]

[figure] [figure]

A child is a structure:

                (make-childfmnadaec)

where f and m are child structures; na and ec are symbols; and da is a number.

Tree A: 10 15 24 29 63 77 89 95 99
Tree B: 87 15 24 29 63 33 89 95 99

Carl (1926) Eyes: green

[figure] [figure]

Bettina (1926) Eyes: green Adam (1950) Eyes: yellow Dave (1955) Eyes: black Eva (1965) Eyes: blue

[figure]

Fred (1966) Eyes: pink

Gustav (1988) Eyes: blush Øfi A parent is a structure:

[figure]

                    (make-parentlocnde)

where loc is a list of children, n and e are symbols, and d is a number. A list of children is either

Øfi 1.empty or

Øfi2.(consploc) where p is a parent and loc is a list of children.

Data Analysis & De- sign to formulate a group of data definitions develop a group of mutually recursive data definitions • at least one definition or one alternative in a definition must refer to basic data • explicitly identify all references among the data definitions

Template to formulate an outline for a group of programs develop as many templates as there are data definitions simultaneously • develop each templates according to the rules for compound and/or mixed data definitions as appropriate • annotate the templates with recursions and cross-applications to match the (cross-)references in the data definitions

Body to define the program formulate a Scheme expression for each template, and for each cond-clause in a template • start by explaining what each expression in each template computes • use additional auxiliary functions where necessary

ØfiØfi (define(fun-parenta-parent) ...(parent-namea-parent)... ...(parent-datea-parent)... ...(parent-eyesa-parent)... ...(fun-children(parent-childrena-parent))...)
ØfiØfi (define(fun-childrenaloc) (cond [(empty?aloc)...] [else...(fun-parent(firstaloc))...(fun-children(restaloc))...]))

[figure: TS (DIR); Text (DIR); part1 (99); part2 (52); part3 (17); Libs (DIR); Code (DIR); hang (8); draw (2); Docs (DIR); read! (19); read! (10)]

⟶

         (empty?alos)    (cons?alos)

(=n1)
(>n1)

(null?alos)                                                                                            (cons?alos)

(=n1) Øfi
(and(=n1)
(null?alos))

Øfi

(and(=n1)
     (cons?alos))
(>n1) Øfi
(and(>n1)
(null?alos))

Øfi

(and(>n1)
     (cons?alos))

alos

(empty?alos)    (cons?alos)
n  (=n1)

(>n1)

5 · x

5 · x +17 · y
5 · x +17 · y + 3 · z

5 · x 5 · x + 17 · y 5 · x + 17 · y + 3 · z

                         (empty?a-list)    (cons?a-list)

(empty?another-list)
(cons?another-list)

<def> =  (define (<var> <var> . . . <var> ) <exp> )

| (define <var> <exp> )

| (define-struct <var> (<var> … <var> ))

<exp> = (local (<def-1> . . . <def-n> ) <exp> )

x

[figure: (define(fx)(+(*xx)25))]

[figure: (define(ez)(f(*zz))); (define(fx)(+(*xx)25)); (define(gy)(+(f(+y1))(f(-y1)))]

(local([figure: (define(ez)(f(*zz))); (define(fx)(+(*xx)25)); (define(gy)(+(f(+y1))(f(-y1)))] . . . (f . . . ) . . . . . . (f . . . ) . . . . . . (f . . . ) . . .

(local([figure: (define(fx)(+(*xx)25))] ...x . . . )

’doll ’car s < > rel-op x^{2} > c n^{2} A list of numbers is either

Øfi 1.empty or Øfi 2.(conssl) where

Øfi (a)s is a number and Øfi (b)l is a list of numbers.

A list of IRs is either Øfi 1.empty or Øfi 2.(conssl) where

Øfi(a)s is an IR and Øfi (b)l is a list of IRs.

<^{ir} <_{ir} an ITEM

an ITEM

<def> =  (define (<var> <var> . . . <var> ) <exp> )

| (define <var> <exp> )
| (define-struct <var> (<var> <var> . . . <var> ))

<exp> =  <var>

| <boo>
| <sym>
| <prm>

| empty

| (<exp> <exp> . . . <exp> )
| (cond (<exp> <exp> ) . . . (<exp> <exp> ))
| (cond (<exp> <exp> ) . . . (else<exp> ))
| (local (<def> . . . <def> ) <exp> )

<var> =  x | area-of-disk | circumference | . . .

<boo> =  true | false

<sym> =  'a | 'doll | 'sum | . . .
<num> =  1 | -1 | 3/5 | 1.22 | . . .
<prm> =  + | - | cons | first | rest | . . .

<exp> =  <var>

| <prm>
| (<exp> <exp> . . . <exp> )

<val> =  <boo> | <sym> | <num> | empty | <lst>

| <var> (names of defined functions)

            | <prm>

<lst> = empty | (cons <val> <lst> )

C->F

IR-name f op1 op2 Interface Program (View)

Core Program (Model)

(draw-messagea-message)
(text-contentsa-text-field)
(call-backan-event)
(make-buttonlabelcall-back)

index 0 1 2 3 4 5 6 7 8 9 …
evens 0 2 4 6 8 10 12 14 16 18 …
odds 1 3 5 7 9 11 13 15 17 19 …

2 · i 2 · i + 1

1, \frac{1}{2}, \frac{1}{4}, \frac{1}{8}, …

1, \frac{1}{2}, \frac{1}{3}, \frac{1}{4}, …

Σ

∑_{i=0}^{i=n} make-even(i)  ∑_{i=0}^{i=n} make-odd(i)

a_{0}, a_{1}, a_{2}, a_{3}, …, a_{n}, a_{n+1}, … a_{n+1} a_{n}

index  0 1 2 3 4 …

arithmetic sequence 8 13 18 23

…

g_{0}, g_{1}, g_{2}, g_{3}, …, g_{n}, g_{n+1}, … g_{n+1} g_{n}

index  0 1 2 3  4 …

geometric sequence 3 15 75 375 1875 …

e^{x} = 1 + \frac{x}{1!} + \frac{x^{2}}{2!} + \frac{x^{3}}{3!} + …

e^{x}

e^{1} = 1 + \frac{1}{1!} + \frac{1^{2}}{2!} + \frac{1^{3}}{3!} + …

\frac{x^{i}}{i!} .

ln(x) = 2 · [(\frac{x − 1}{x + 1}) + \frac{1}{3} · (\frac{x − 1}{x + 1})^{3} + \frac{1}{5} · (\frac{x − 1}{x + 1})^{5} …]

sin(x) = \frac{x}{1!} − \frac{x^{3}}{3!} + \frac{x^{5}}{5!} − \frac{x^{7}}{7!} …

(−1)^{i}

π = 4 · [1 − \frac{1}{3} + \frac{1}{5} − \frac{1}{7} …] .

[a, \frac{a+b}{2}] [\frac{a+b}{2}, b]

width= \frac{(b − a)}{R} .

step = \frac{width}{2} , W · f(a + S) , x_{1} a + W + S , a + 2 · W + S ,

index  0  1  2  …
M  a + S  a + 1 · W + S  a + 2 · W + S  …
f at M f(a + S)  f(a + 1 · W + S)  f(a + 2 · W + S) …
area W · f(a + S) W · f(a + 1 · W + S) W · f(a + 2 · W + S) …

∑_{i=0}^{i=R−1} area-of-rectangle (i) . x − eps x + eps eps (x, f(x − eps))

(x, f(x + eps)) f(x + eps) − f(x − eps)

2 · eps y(x) = a · x + b . y_{1}(x) = x + 4 y_{2}(x) = 4 − x y_{3}(x) = x + 10 y_{4}(x) = 10 − x y_{5}(x) = 12 y_{1} y(x) = x^{2} − 4 · x + 7 . eps> 0 eps/2 eps/4 d dx y(x) = x^{2} − 4 · x + 7

<exp> = (lambda (<var> ... <var> ) <exp> )

λ with all occurrences of x-1...x-n

replaced by val-1...val-n

x

(quick-sort(list5))

3

x^{3} x^{3} = 27 .

6 · x^{2} f(r) = 0 . f(x) = x^{3} − 27

m = \frac{a + b}{2} .

#step left (fleft) right (fright) mid (fmid)
n = 1 3  -1 6.00  8.00 4.5  1.25
n = 2 3  -1 4.25  1.25  ?  ?

(right− left) · \frac{f(right) + f(left)}{2} .

TOLERANCE· (right− left) . r_{i}

t(x) = f′(r0) · (x − r0) + f(r0)
= f′(r0) · x + [f(r0) − f′(r0) · r0]

y(x) = a · x + b

r − \frac{f(r0)}{f′(r0)} .

2 · x + 2 · y + 3 · z = 10
2 · x + 5 · y + 12 · z = 31  (†)
4 · x + 1 · y − 2 · z = 1

2 · 1 + 2 · 1 + 3 · 2 = 10
2 · 1 + 5 · 1 + 12 · 2 = 31
4 · 1 + 1 · 1 − 2 · 2 = 1

(list (list 2 2 3 10)
(list 2 5 12 31)
(list 4 1 −2 1) )

(list (list 2 2 3 10)
(list 0 3 9 21)
(list 4 1 −2 1) )

(list (list 2 2 3 10)
(list 0 3 9 21)
(list 0 −3 −8 −19) )

2 · x + 2 · y + 3 · z = 10
3 · y + 9 · z = 21  (‡)
− 3 · y − 8 · z = −19

(†)

(list (list 2 2 3 10)
(list  3 9 21)
(list  −3 −8 −19) )

(list (list 3 9 21)
(list −3 −8 −19) )

(list (list 3 9 21)
(list  1 2) )

(list (list 2 2 3 10)
(list  3 9 21)  (∗)
(list  1 2)  )

2 · x + 2 · y + 3 · z = 10
3 · y + 9 · z = 21  (∗)
1 · z = 2

(list (list 2 3 3 8)
(list 2 3 −2 3)
(list 4 −2 2 4) )

(list (list 2 3 3  8)
(list  0 −5 −5)
(list  −8 −4 −12) )

(list (list 0 −5 −5)
(list −8 −4 −12) )

(list (list −8 −4 −12)
(list 0 −5 −5) )

(list (list 2 3 3  8)
(list  −8 −4 −12)
(list  −5 −5) )

2 · x + 2 · y + 2 · z = 6
2 · x + 2 · y + 4 · z = 8
2 · x + 2 · y + z · z = 2

3 · y + 9 · 2 = 21 .

(list (list a_{11} . . . . . . b_{1})
(list  a_{21} … b_{2})
(list  ⋮  ⋮ ⋮)
(list  a_{nn} b_{n}) )

a_{ij} b_{i}

\frac{b_{n}}{a_{nn}} .

3 · x + 9 · y = 21 y = 2 , 3 · x + 9 · 2 = 21 .

9 · 2 − 21

[figure]

N / 2

K · \frac{N}{2} = \frac{K}{2} · N

N^{2} N^{2} + N

(max(list123))

original expression

requires 2 evaluations of

(max(list0123))    (max(list123))
(max(list123))      (max(list23))
(max(list23))       (max(list3))

2^{N} 2^{N−1}

2^{N−1} = \frac{1}{2} · 2^{N} ,

2^{N}

[figure: 0; y; x; 1000]

N  1  10  50  100  500  1000
F (1000 · N) 1000 10000 50000 100000 500000 1000000
G (N · N)  1  100 2500 10000 250000 1000000

1000 · N N · N N, N^{2}, or 2^{N} , n ≥ bigEnough f(n) ≤ c · g(n). f(N) = 1000 · N ; g(N) = N^{2} ; n ≥ 1000 f(n) ≤ 1 · g(n) bigEnough = 1000 O(N^{2})

O(2^{N})

2^{10} = 1024 f(n) = n^{2} + n O(n^{2}) f(n) = 2^{n} g(n) = 1000 · n f(n) = n log n g(n) = n^{2}

A B C D E F G
0 1 2 3 4 5 6

n × n

1 0 −1
2 0 9
1 1 1

1 2 1
0 0 1
−1 9 1

if current-color is 50 and we evaluate (next), then current-color is 20

         if current-color is 40 and we evaluate (next), then current-color is 15

                if current-color is 70 and we evaluate (next), then current-color is 30

                            if current-color is 30 and we evaluate (next), then current-color is 10

                                 if current-color is 30 and we evaluate (next), then current-color is 10

0

[figure: 50]

[figure: 90]

[figure: 160]

[figure: 190]

[figure: 220]

N time of evaluation
100  220
200  880
300  2050
400  5090
500  7410
600  10420
700  14070
800  18530

… (first alox) … accumulator … (first alon) … accumulator … n … accumulator

empty

[figure: (make-nodeemptyempty)]

Øfi

(make-node
  (make-node
     empty
     (make-nodeemptyempty))
  empty)

[figure]

… (node-right abt) … accumulator … (node-left abt) … accumulator 1 · 10^{2} + 0 · 10^{1} + 2 · 10^{0} = ((1 · 10 + 0) · 10) + 2 ; 1 · 8^{2} + 0 · 8^{1} + 2 · 8^{0} = ((1 · 8) + 0) · 8) + 2 . plain factorial

accumulator-style factorial

5.760  5.970
5.780  5.940
5.800  5.980
5.820  5.970
5.870  6.690
5.806  6.110

<exp> = <var> | (lambda (<var> ) <exp> ) | (<exp> <exp> )

[figure]

[figure: 1; 2]

[figure]

m · 10^{e} 120 · 10^{1} ; 12 · 10^{2} .

120 · 10^{−1}

\frac{1}{1200} .

0 · 10^{0} , 99 · 10^{99} , 01 · 10^{−99} , 120 · 10^{1} 10 … 0 10^{−99}

1 · 10^{0}

(+ 2 · 10^{0}) / (3 · 10^{0})

55 · 10^{0} 110 · 10^{0} , 11 · 10^{1} .

56 · 10^{0} + 56 · 10^{0} = (56 + 56) · 10^{0} = 112 · 10^{0}

(a · 10^{n}) · (b · 10^{m})

= (a · b) · 10^{n} · 10^{m}
= (a · b) · 10^{(n+m)}

2 · 10^{+4} ∗ 8 · 10^{+10} = 16 · 10^{+14} 99 · 10^{500} 10^{−500} 10^{16} 1.0 · 10^{16} + 1 = 1.00000000000000001 · 10^{16}

[figure: number; name; add entry; phone book; lookup number; name]

[figure: next; current color]

(set!new-knowledgefalse)

(symbol=?status-letter'_)

(set!new-knowledgetrue)

<def> =  (define (<var> <var> . . . <var> ) <exp> )

| (define <var> <exp> )
| (define-struct <var0> (<var-1> . . . <var-n> ))

<exp> =  <var>

| <con>
| <prm>
| (<exp> <exp> . . . <exp> )
| (cond (<exp> <exp> ) . . . (<exp> <exp> ))
| (cond (<exp> <exp> ) . . . (else<exp> ))
| (local (<def> . . . <def> ) <exp> )
| (lambda (<var> . . . <var> ) <exp> )
| (set! <var> <exp> )

| (begin <exp> … <exp> )

(set!xanotherValue)

x

(set!x11)

(+1111)

(make-counter0)

(increment1)

counter1

(+01)

(set!counter11)

(set!x3)

(set!f11)

(set!f10)

(set!f(lambda(x)22))

(begin(void)5)

(g1)

<vdf> =  (define <var> <val> )

| (define-struct <var> (<var> … <var> ))

<val> = <con> | <lst> | <prm> | <fun> | <void>
<lst> = empty | (cons <val> <lst> )
<fun> = (lambda (<var> . . . <var> ) <exp> )

(define(fx)x)

f

f

(set!f(lambda(x)'ouch))

with all replaced by β β_{v}

x:  y: 3          4

[figure: ^{x:  y: 3          4}; 5]

<variable>

<expression>

set

<structure-tag>

<field>

!

(define-structaaa(xxyy))

accumulator

1.10 1.12 1.08 1.09 1.11

1.10 1.12 1.08 1.09 1.11 1.10 ^{\frac{329}{300}} ^{\frac{328}{300}}

from A B C D E F
to  B C E E B F

the node to which orig is connected