-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35707a7
commit 91bb68f
Showing
3 changed files
with
27 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
test/ci/front-end/atomics/atomicity_check_ghost_fields_vars.rav
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,25 @@ | ||
field f1: Int | ||
ghost field g1: Int | ||
|
||
inv inv1() { true } | ||
|
||
proc p1(x: Ref) | ||
requires inv1() | ||
requires exists nn:Int :: own(x, f1, nn, 1.0) | ||
requires exists nn:Int :: own(x, g1, nn, 1.0) | ||
{ | ||
unfold inv1(); | ||
ghost var gv0: Int := 0; | ||
|
||
// This field read is the concrete atomic step | ||
var f: Int := x.f1; | ||
|
||
// The following commands are all allowed before folding the invariant, | ||
// since they are all writes to ghost variables or ghost fields. | ||
x.g1 := 4; | ||
ghost var gv1: Int := 0; | ||
gv0 := 1; | ||
{! x.g1 := 4; gv1 := 2; !} | ||
|
||
fold inv1(); | ||
} |
2 changes: 2 additions & 0 deletions
2
test/ci/front-end/atomics/atomicity_check_ghost_fields_vars.t
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 @@ | ||
$ dune exec -- raven --shh ./atomicity_check_ghost_fields_vars.rav | ||
Verification successful. |