Skip to content

Commit a1faa69

Browse files
authored
bug fix (boogie-org#529)
1 parent 34b946e commit a1faa69

File tree

3 files changed

+6
-49
lines changed

3 files changed

+6
-49
lines changed

Source/Concurrency/LinearTypeChecker.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ public override Implementation VisitImplementation(Implementation node)
379379
{
380380
if (civlTypeChecker.procToAtomicAction.ContainsKey(node.Proc) ||
381381
civlTypeChecker.procToIntroductionAction.ContainsKey(node.Proc) ||
382+
civlTypeChecker.procToIsAbstraction.ContainsKey(node.Proc) ||
383+
civlTypeChecker.procToIsInvariant.ContainsKey(node.Proc) ||
382384
civlTypeChecker.procToLemmaProc.ContainsKey(node.Proc))
383385
{
384386
return node;

Test/civl/inductive-sequentialization/PingPong.bpl

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -73,49 +73,18 @@ PING' (x:int, {:linear_in "pid"} pid:int)
7373
returns ({:pending_async "PING"} PAs:[PA]int)
7474
modifies ping_channel, pong_channel;
7575
{
76-
assert x > 0;
77-
assert pid == ping_id;
78-
assert (forall m:int :: ping_channel[m] > 0 ==> m == x);
7976
assert (exists {:pool "INV"} m:int :: ping_channel[m] > 0) && (forall m:int :: pong_channel[m] == 0);
77+
call PAs := PING(x, pid);
8078

81-
assume ping_channel[x] > 0;
82-
ping_channel[x] := ping_channel[x] - 1;
83-
84-
if (*)
85-
{
86-
pong_channel[x+1] := pong_channel[x+1] + 1;
87-
PAs := NoPAs()[PING(x+1, pid) := 1];
88-
}
89-
else
90-
{
91-
pong_channel[0] := pong_channel[0] + 1;
92-
PAs := NoPAs();
93-
}
9479
}
9580

9681
procedure {:IS_abstraction}{:layer 2}
9782
PONG' (y:int, {:linear_in "pid"} pid:int)
9883
returns ({:pending_async "PONG"} PAs:[PA]int)
9984
modifies ping_channel, pong_channel;
10085
{
101-
assert y > 0;
102-
assert pid == pong_id;
103-
assert (forall m:int :: pong_channel[m] > 0 ==> m == y || m == 0);
10486
assert (exists {:pool "INV"} m:int :: pong_channel[m] > 0) && (forall m:int :: ping_channel[m] == 0);
105-
106-
if (*)
107-
{
108-
assume pong_channel[y] > 0;
109-
pong_channel[y] := pong_channel[y] - 1;
110-
ping_channel[y] := ping_channel[y] + 1;
111-
PAs := NoPAs()[PONG(y+1, pid) := 1];
112-
}
113-
else
114-
{
115-
assume pong_channel[0] > 0;
116-
pong_channel[0] := pong_channel[0] - 1;
117-
PAs := NoPAs();
118-
}
87+
call PAs := PONG(y, pid);
11988
}
12089

12190
////////////////////////////////////////////////////////////////////////////////

Test/civl/inductive-sequentialization/ProducerConsumer.bpl

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,22 +125,8 @@ CONSUMER' (x:int, {:linear_in "pid"} pid:int)
125125
returns ({:pending_async "CONSUMER"} PAs:[PA]int)
126126
modifies head;
127127
{
128-
var x':int;
129-
130-
assert pid == cons_id;
131-
assert head < tail && (C[head] == x || C[head] == 0);
132-
133-
assume head < tail;
134-
x' := C[head];
135-
head := head + 1;
136-
if (x' != 0)
137-
{
138-
PAs := NoPAs()[CONSUMER(x'+1, pid) := 1];
139-
}
140-
else
141-
{
142-
PAs := NoPAs();
143-
}
128+
assert head < tail;
129+
call PAs := CONSUMER(x, pid);
144130
}
145131

146132
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)