-
Notifications
You must be signed in to change notification settings - Fork 46
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
6ddaa1b
commit 56e5d9a
Showing
1 changed file
with
44 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Any copyright is dedicated to the Public Domain. | ||
// http://creativecommons.org/publicdomain/zero/1.0/ | ||
|
||
predicate p(a: Ref, b: Ref) | ||
|
||
method m(x: Ref, s: Set[Ref], t: Seq[Ref]) { | ||
//:: ExpectedOutput(exhale.failed:qp.not.injective) | ||
//:: ExpectedOutput(exhale.failed:insufficient.permission) | ||
//:: MissingOutput(exhale.failed:insufficient.permission, /silicon/issue/34/) | ||
exhale forall a: Int, b: Ref :: b in s && 0 <= a && a < |t| ==> p(t[a], b) // might not be injective | ||
} | ||
|
||
|
||
method m2(x: Ref, s: Set[Ref], t: Seq[Ref]) { | ||
//:: ExpectedOutput(inhale.failed:qp.not.injective) | ||
inhale forall a: Int, b: Ref :: b in s && 0 <= a && a < |t| ==> p(t[a], b) // might not be injective | ||
} | ||
|
||
field f: Int | ||
|
||
domain Array { | ||
function loc(a: Array, i: Int): Ref | ||
|
||
function loc_inv1(r: Ref): Array | ||
function loc_inv2(r: Ref): Int | ||
|
||
axiom { | ||
forall a: Array, i: Int :: {loc(a, i)} loc_inv2(loc(a, i)) == i | ||
} | ||
} | ||
|
||
method m3(x: Ref, s: Set[Ref], t: Seq[Ref]) { | ||
//:: ExpectedOutput(exhale.failed:qp.not.injective) | ||
//:: ExpectedOutput(exhale.failed:insufficient.permission) | ||
//:: MissingOutput(exhale.failed:insufficient.permission, /silicon/issue/34/) | ||
exhale forall a: Array, i: Int :: i >= 0 && i < 10 ==> acc(loc(a, i).f) | ||
} | ||
|
||
method m4(x: Ref, s: Set[Ref], t: Seq[Ref]) { | ||
//:: ExpectedOutput(inhale.failed:qp.not.injective) | ||
inhale forall a: Array, i: Int :: i >= 0 && i < 10 ==> acc(loc(a, i).f) | ||
} | ||
|
||
|