-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into coverage-trace
- Loading branch information
Showing
8 changed files
with
219 additions
and
23 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
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,39 @@ | ||
// RUN: %parallel-boogie /prune /errorTrace:0 /printPruned:"%t" "%s" > "%t" | ||
// RUN: %OutputCheck "%s" --file-to-check="%t-after-monomorphicSplit.bpl" | ||
|
||
// The following checks are a bit simplistic, but this is | ||
// on purpose to reduce brittleness. We assume there would now be two uses clauses | ||
// with one axiom each, and those axioms should not be a conjunction of | ||
// the instantiations of the original axiom. | ||
// | ||
// Last CHECK-NOT is for ensuring definition axioms are not printed outside | ||
// uses clauses when using /printPruned. | ||
|
||
// CHECK-L: uses | ||
// CHECK-NEXT-L: axiom | ||
// CHECK-NOT-L: && | ||
// CHECK-L: } | ||
// CHECK-L: uses | ||
// CHECK-NEXT-L: axiom | ||
// CHECK-NOT-L: && | ||
// CHECK-L: } | ||
// CHECK-NOT: axiom | ||
|
||
// Related PR #767. | ||
|
||
function f1 <T> (x: T) : int uses { | ||
axiom (forall <T> x: T :: {f1(x)} f1(x) == 42); | ||
} | ||
|
||
// Both f1 and the axiom will be monomorphized into bool and int instances. | ||
// Automatic edge inference would already ensure that only the monomorphized instances | ||
// are incoming, however we want to test here how the new uses clauses are determined. | ||
// | ||
// After instantiation, each instance of f1 for some T should *only* have | ||
// the T-instantiated axiom as outgoing. | ||
|
||
procedure monomorphicSplit() | ||
ensures f1(true) == 42; | ||
ensures f1(3) == 42; | ||
{ | ||
} |
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,37 @@ | ||
// RUN: %parallel-boogie /prune /trace /errorTrace:0 "%s" > "%t" | ||
// RUN: %OutputCheck "%s" --file-to-check="%t" | ||
|
||
// Related PR #767. | ||
|
||
function f1 (x: int) : int; | ||
function f2 (x: int) : int uses | ||
{ | ||
axiom f1(0) == 1 && f2(0) == 2; | ||
} | ||
|
||
// Above axiom will be split into two during monomorphization into | ||
// axiom f1(0) == 1 and axiom f2(0) == 2. | ||
// Current implementation ensures that f1(0) == 1 is kept as a dependency | ||
// of f1, and f2(0) is moved to be a dependency of f2. If there would be | ||
// other symbols s_0,...,s_n in the axiom, any split axiom containing some | ||
// symbol s_i (with i = 0,...,n) would be added as a dependency to s_i. | ||
|
||
procedure nonMonomorphicSplitPass() | ||
ensures f1(0) == 1 && f2(0) == 2; | ||
{ | ||
} | ||
// CHECK-L: 1 proof obligation] verified | ||
|
||
function f3 (x: int) : int; | ||
function f4 (x: int) : int; | ||
|
||
axiom f3(0) == 1 && f4(0) == 2; | ||
|
||
// This one is expected to fail. We do not want to preserve axioms not inside | ||
// uses clauses automatically, as this weakens pruning. | ||
|
||
procedure nonMonomorphicSplitFail() | ||
ensures f3(0) == 1 && f4(0) == 2; | ||
{ | ||
} | ||
// CHECK-L: 1 proof obligation] error |