-
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.
Fixed #19; added preconditions to witness functions when multiple wit…
…nesses found
- Loading branch information
1 parent
9edb727
commit 2bc2172
Showing
3 changed files
with
82 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module Agree = Library.Agree[Library.RefType] | ||
|
||
func f1(l: Ref) returns (ret: Bool) {true} | ||
func f2(l: Ref) returns (ret: Bool) {true} | ||
|
||
|
||
field lock: Ref | ||
ghost field agr: Agree | ||
|
||
pred is_list(n: Ref) { | ||
exists l: Ref :: | ||
(f1(l) ==> own(n.lock, l, 1.0)) && | ||
(f2(l) ==> own(n.agr, Agree.agree(l))) | ||
} | ||
|
||
proc create_buggy() | ||
{ | ||
var r := new(lock: null, agr: Agree.agree(null)); | ||
|
||
var l: Ref; | ||
assume l != null; | ||
r.lock := l; | ||
assert own(r.lock, l, 1.0); | ||
|
||
// The following fails, as it should: | ||
fold is_list(r); | ||
} |
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,6 @@ | ||
$ dune exec -- raven --shh multiple_witness_soundness_fix.rav | ||
[Error] File "multiple_witness_soundness_fix.rav", line 26, columns 4-20: | ||
26 | fold is_list(r); | ||
^^^^^^^^^^^^^^^^ | ||
Verification Error: Failed to fold predicate. The body of the predicate may not hold at this point. | ||
[1] |