... use)
Makes the grammar context-sensitive-
(e.g., with EBNF)
Set of extra conditions
Is easy to read and understand-
Defines a superset of the language-
+
Figure 2. 2: The context-free approach to language ... with single-shot channels. Chapters 4 and 5 show other types of
channels (with sequences of messages) and do concurrent composition of processes.
Copyright
c
20 0 1-...
... in
the larger context of component-based programming. Because of message-passing
concurrency we no longer have the limitations of the synchronous “lock-step”
execution of Chapter 4.
We first introduce ... tuples:
area({square, Side}) -& gt;
Side*Side;
area({rectangle, X, Y}) -& gt;
X*Y;
area({circle, Radius}) -& gt;
3.14159*Radius*Radius;
area({triangle, A, B, C}) -& gt;...
... T
1
/σ
1
and T /σ −→ T
2
/σ
2
, there exist two further executions T
1
/σ
1
−→
T
1
/σ
1
and T
2
/σ
2
−→ T
2
/σ
2
such that the configurations T
1
/σ
1
and T
2
/σ
2
are
equivalent with ... For
example, take β ≡ x=y and σ ≡ x=f(x
1
x
2
)∧y=f (y
1
y
2
)∧x
2
=a∧y
2
=b.Thetell
Copyright
c
20 0 1-3 by P. Van Roy and S. Haridi. All rights reserve...
... 81699 23 885 626 67 00490
71596 826 43 81 621 46859 29 638 9 521 7 59999 322 99
15608 94146 39761 56518 28 625 36979 20 827 22 375
825 11 8 521 0 91686 40000 00000 00000 00000 00000
Copyright
c
20 0 1-3 by ... definition of
OpList:
fun {OpList Op L1 L2}
case L1 of H1|T1 then
case L2 of H2|T2 then
{Op H1 H2}|{OpList Op T1 T2}
end
Copyright
c
20 0 1-3 by P. Van Roy and S....
... Programming Techniques
L
L1
L2
S1
S2
S
L11
L 12
L21
L 22 S 22
S21
S 12
S11
Split
Split Merge
Merge
Split Merge
Input
list list
Sorted
Figure 3.9: Sorting with mergesort
call
{LengthL2 foo} is legal (it returns ... removing more and more of the
left-hand part of
T2. Eventually, T2’s left subtree is removed completely and the
right subtree takes its place. Continuing in this way,...
... reserved.
27 6 Declarative Concurrency
proc {Gate X1 X2 Xn Y1 Y2 Ym}
proc {P S1 S2 Sn U1 U2 Um}
case S1#S2# #Sn
of (X1|T1)#(X2|T2)# #(Xn|Tn) then
Y1 Y2 Ym
V1 V2 Vm
in
{GateStep X1 X2 Xn Y1 Y2 Ym}
U1=Y1|V1
U2=Y2|V2
... time.
4 .2. 2 Threads and the browser
The browser is a good example of a program that works well in a concurrent
environment. For example:
thread {Browse 111} end
{Brows...
... Algol-60 and structured
programming [46, 45, 130], which led to Simula-67 and object-oriented program-
ming [137, 1 52] .
2
This book sticks to the traditional usage of declarative as stateless and ... elements of an array:
Copyright
c
20 0 1-3 by P. Van Roy and S. Haridi. All rights reserved.
415
A problem of terminology
Stateless and stateful programming are often...
... class (Section 7 .2. 4).
– Taking advantage of dynamic typing. This gives first-class messages
(Section 7 .2. 5) and first-class attributes (Section 7 .2. 6). This allows
powerful forms of polymorphism ... a
program.
7.1 .2 Encapsulated state and inheritance
The combination of encapsulating explicit state and inheritance has led to the
field of object-oriented programming, which...
... concurrent transactions T1 and T2 where each one uses cells C1 and C2. Let
transaction T1 use C1 and C2, in that order, and transaction T2 use C2 and C1,
in the reverse order. Because of concurrency, it ... in
{self Unlockall(T2 true)}
{self Trans(T2.body T2.result T2.stamp)}
Sync2=halt
[] running then
(T2.state):=probation
[] probation then skip end
end
end
end
Figure 8 .23 : Imp...