forked from Mattriplex/silver
-
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.
Merged viperproject/silver into default
- Loading branch information
Showing
3 changed files
with
75 additions
and
45 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,16 @@ | ||
predicate outer(r: Ref) {inner(r)} | ||
predicate inner(r: Ref) {true} | ||
|
||
function req(r: Ref): Bool | ||
|
||
function actual(r: Ref): Int | ||
requires req(r) | ||
|
||
method m(r: Ref) | ||
requires outer(r) | ||
requires unfolding acc(outer(r), 1/2) in req(r) // remove 1/2 here to make it work | ||
{ | ||
unfold acc(outer(r), 1/2) | ||
//:: UnexpectedOutput(application.precondition:assertion.false, /carbon/issue/181/) | ||
var i: Int := actual(r) // fails | ||
} |
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 @@ | ||
field v: Int | ||
|
||
predicate vperm (r: Ref) {acc(r.v)} | ||
|
||
function func(r: Ref): Bool | ||
requires vperm(r) | ||
ensures result | ||
{ | ||
let v1 == (unfolding vperm(r) in r.v) in (unfolding vperm(r) in v1 == r.v) | ||
} |