-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Civl] Added explicit gates to atomic actions (#911)
This PR allows gates of atomic actions to be explicitly specified. The convention is as follows: var {:layer 0,1} x: int; yield invariant YieldInv(); invariant ... atomic action Foo() requires x > 0; // gate (must be sufficient to prove absence of failures in atomic action) requires call YieldInv(); // precondition used only in special circumstances { assert x != 0; } --------- Co-authored-by: Shaz Qadeer <[email protected]>
- Loading branch information
1 parent
282ec5c
commit eb568e6
Showing
11 changed files
with
68 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
assert-layers.bpl(5,0): Error: expected layers | ||
assert-layers.bpl(6,0): Error: expected layers | ||
assert-layers.bpl(8,2): Error: expected layers | ||
assert-layers.bpl(12,0): Error: expected layers | ||
4 name resolution errors detected in assert-layers.bpl | ||
3 name resolution errors detected in assert-layers.bpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: %parallel-boogie "%s" > "%t" | ||
// RUN: %diff "%s.expect" "%t" | ||
|
||
var {:layer 0,1} x: int; | ||
|
||
atomic action {:layer 1} Foo() | ||
requires x > 0; | ||
{ | ||
assert x != 0; | ||
} |
2 changes: 2 additions & 0 deletions
2
Test/civl/regression-tests/gate-sufficiency-checker.bpl.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
Boogie program verifier finished with 1 verified, 0 errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
yield-pre-post.bpl(7,20): Error: global variable must be accessed inside old expression: g | ||
yield-pre-post.bpl(8,19): Error: global variable must be accessed inside old expression: g | ||
yield-pre-post.bpl(12,20): Error: global variable must be accessed inside old expression: g | ||
3 type checking errors detected in yield-pre-post.bpl | ||
yield-pre-post.bpl(16,9): Error: global variable must be available across all layers ([2, 2]) of action B: g | ||
3 type checking errors detected in yield-pre-post.bpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
|
||
Boogie program verifier finished with 33 verified, 0 errors | ||
Boogie program verifier finished with 34 verified, 0 errors |