annotate Examples/etc/dekker @ 0:cfb7c6b24319

Initial revision
author kono
date Thu, 30 Aug 2007 14:57:44 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
1 '$define' progress(Cr1,Crit,Conc):-
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
2 #(Cr1=true),Crit
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
3 && @ (#(Cr1=false),Conc).
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
4
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
5 '$define' ( exclusion(Id,Id2,T,Cr1,Cr2,Crit,Conc):- H )
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
6 '$clause' ( H :-
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
7 Cr1=true,
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
8 enter(Id,Id2,T,Cr1,Cr2)
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
9 && progress(Cr1,Crit,Conc)
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
10 && @ H) .
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
11
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
12 enter(Id,Id2,T,Cr1,Cr2) :-
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
13 Cr2=true,T=Id2,@Cr1=false,
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
14 @enter(Id,Id2,T,Cr1,Cr2).
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
15 enter(Id,Id2,T,Cr1,Cr2) :-
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
16 Cr2=true,T=Id,@Cr1=true,@T=Id,
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
17 @trust(Id,Id2,T,Cr1,Cr2).
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
18 enter(Id,Id2,T,Cr1,Cr2) :-
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
19 Cr2=false,@Cr1=true,skip.
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
20
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
21 trust(Id,Id2,T,Cr1,Cr2) :-stable(T),
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
22 Cr2=true,@Cr1=true,
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
23 @trust(Id,Id2,T,Cr1,Cr2).
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
24 trust(Id,Id2,T,Cr1,Cr2) :-
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
25 Cr2=false,@Cr1=true,skip.
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
26
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
27
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
28 dekker:-T=0,Cr1=true,Cr2=true,
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
29 exclusion(0,1,T,Cr1,Cr2,critical(0),concurrent(0)),
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
30 exclusion(1,0,T,Cr2,Cr1,critical(1),concurrent(1)).
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
31
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
32 critical(Id):-length(2),
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
33 keep((write('critical-region'),write(Id),nl)).
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
34
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
35 concurrent(Id):-length(3),
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
36 keep((write('concurrent-region'),write(Id),nl)).
cfb7c6b24319 Initial revision
kono
parents:
diff changeset
37