Errata for “Concepts, Techniques, and Models of Computer Programming”
(fourth printing)
“Nothing that Man creates should be too perfect,
lest it make the gods jealous and bring down their wrath.”
This page lists all known errors and their corrections
for the most recent (fourth or higher) printings of the book.
The errors in the first printing are given
here
and the errors in the second and third printings are given
here.
If you find any new errors,
please notify one of the authors.
We use the following notation for the corrections:
positive line numbers start counting from the top of the text body (including section titles);
negative line numbers start counting from the bottom (including section titles and footnote text).
The authors wish to thank the following people
for their help in finding errors in the book since the first printing:
Hassan Aït-Kaci,
Stefan Andrei,
Cosmin Arad,
Shannon Behrens,
Christopher Campbell,
Raphaël Collet,
Arnaud Dagnelies,
Olivier Danvy,
Juan Francisco Diaz,
Isabelle Dony,
Robert Godfroid,
Faraz Hussain,
Jeff Jackson,
John Johnson,
Kent Johnson,
Harish Karnick,
Lyle Kopnicky,
Alexandre Kühn,
Waclaw Kusnierczyk,
Irene Langkilde-Geary,
Erick Lavoie,
Gary T. Leavens,
Mark S. Miller,
David R. Musser,
Konstantin Popov,
Chris Rathman,
Fred Spiessens,
Tony Tanami Vågenes,
Ralf Treinen,
and
Valentin Vansteenberghe.
- Page 65, line -9: "E|{<z>1,...,<z>n}"
should be
"E|{<z>1,...,<z>k}".
- Page 73, lines 6, 9, 12, 15, 18: All seven environments on the five lines
mentioned should add the link
"Loop10 → l" where the store σ contains variable l
bound to the definition of procedure Loop10.
- Page 81, table 2.4:
Add the case "<expression> <consBinOp> <expression>" to the definition
of <expression> and
add the rule "<consBinOp> ::= '#' | '|'".
This ensures that the table defines the syntax of all the section's examples.
- Page 100, line 2:
"Any two partial values can be unified." should be
"Any two compatible partial values can be unified."
- Page 103, line -5: "at least one of them is unbound" should be
"at least one of them is unbound and there are no pairwise incompatible nodes elsewhere".
- Page 104, line -6: "(1917-)" should be "(1917-2008)".
- Page 107, line -14: "If a function body has an" should
be "If a function returns a result through an".
- Page 176, line 3: "18" should be "24".
- Page 176, line 7: "two years" should be "18 months".
- Page 191, line -21: "fun {$ T T}: <bool>"
should be "fun {$ T}: <bool>".
- Page 226, line -12: "S1 ?Sn" should be "?S1 Sn".
- Page 232, line 9: "section 3.4.4" should be "section 3.4.5".
- Page 249, line -12: "Y" should be "Xs".
- Page 249, line -7: "Remark" should be "We remark".
- Page 275, line 4: "has its has its" should be "has its".
- Page 325, line -3: "A insecure" should be "An insecure".
- Page 373, figure 5.11: replace both occurrences of
"/=" by "\=".
- Page 394, figure 5.23:
The semantics in figure 5.23 is wrong since it only looks at the first message.
The correct semantics is as follows:
T(receive ... end Sin Sout) ≡
local
fun {Loop S T#E Sout}
if {IsDet S} then
case S of M|S1 then
case M
of T(Pattern1) then E=S1 T(Body1 T Sout)
...
[] T(PatternN) then E=S1 T(BodyN T Sout)
else E1 in E=M|E1 {Loop S1 T#E1 Sout} end
end
else E=S T(BodyT T Sout) end
end T
in
{Loop Sin T#T Sout}
end
The loop is needed since the message removed from the mailbox
is not necessarily the first.
- Page 400, lines 1-2: "{Call Ping ping(0)}" should be
"{Call pingobj ping(0)}"
and "{Call Pong pong(10000000)}"
should be
"{Call pongobj pong(10000000)}".
- Page 402, line -7: "A=B" should be "A==B".
- Page 428, line 3: "{C1 union(C2)}" should be
"{C1.union C2}".
- Page 429, line 5: "{C union(D)}" should be
"{C.union D}".
- Page 431:
The Call by value example is better written as:
procedure sqr(a:integer);
begin
a:=a*a;
end;
var c:integer;
c:=25;
sqr(c);
browse(c); /* value of c unchanged */
with Oz translation:
proc {Sqr D}
A={NewCell D}
in
A:=@A*@A
end
local
C={NewCell 0}
in
C:=25
{Sqr @C}
{Browse @C} /* content of C unchanged */
end
This gives a more reasonable definition of sqr
and shows how to pass variables by value.
- Page 458, line -11: "This" should be "This is".
- Page 471, line -6: "implemented" should be "implemented with".
- Page 472, line -9: "IncWords" should be "IncWord".
- Pages 559-560: The short-circuit protocol can be greatly
simplified by relying on the FIFO property of port objects.
The methods newsucc and newpred are not needed.
The method kill(X S) can be replaced by:
meth kill(X S)
if @alive then
if S==1 then @last=@ident
elseif X mod @step==0 then
alive:=false
{@pred setSucc(@succ)}
{@succ setPred(@pred)}
{@succ kill(X+1 S-1)}
else
{@succ kill(X+1 S)}
end
else {@succ kill(X S)} end
end
This works because the FIFO property guarantees
that the setSucc and setPred
messages arrive at their destinations before the kill messages.
- Page 586, figure 8.9: "meth init"
should be "meth init X in".
- Page 615, line 5: add the phrase "The queue must contain an entry
with priority P.".
- Page 752, line -3: "equation" should be "equations".
- Page 853, line 5: Insert the following bibliography entries:
- Hassan Aït-Kaci.
An Introduction to LIFE—Programming with Logic,
Inheritance, Functions, and Equations.
In Logic Programming, Proceedings of the 1993 International Symposium,
pages 52-68, Vancouver, British Columbia, October 1993. MIT Press.
- Hassan Aït-Kaci and Andreas Podelski.
Towards a Meaning of LIFE.
Journal of Logic Programming, 16(3): 195-234, 1993.
- Hassan Aït-Kaci and Roger Nasr.
LOGIN: A Logic Programming Language with Built-In Inheritance.
Journal of Logic Programming, 3(3): 185-215, 1986.
Back to the book