-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print definition axioms for functions and constants. (#765)
When a function / constant has a definition axiom, in generated Boogie files, these axioms were not printed inside `uses` clauses of that function / constant. They were instead printed as top level declarations. This caused issues when using that printed file with the "/prune" option since some of these axioms could now be pruned. This PR attempts to fix this issue such that axioms that define a constant / function are now (only) printed inside `uses` clauses of the function / constant they are defining.
- Loading branch information
1 parent
70d739b
commit 0b1e684
Showing
5 changed files
with
63 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// RUN: %parallel-boogie /print:"%t" /errorTrace:0 "%s" | ||
// RUN: %OutputCheck "%s" --file-to-check="%t" | ||
// UNSUPPORTED: batch_mode | ||
|
||
const unique four: int; | ||
|
||
const unique ProducerConst: bool uses { | ||
axiom four == 4; | ||
} | ||
// CHECK-L: uses { | ||
// CHECK-L: axiom four == 4 | ||
// CHECK-L: } | ||
|
||
function ProducerFunc(x: int): bool uses { | ||
axiom (forall x: int :: ConsumerFunc(x) == 3); | ||
} | ||
// CHECK-L: uses { | ||
// CHECK-L: axiom (forall x: int :: ConsumerFunc(x) == 3) | ||
// CHECK-L: } | ||
|
||
procedure hasAxioms() | ||
requires ProducerFunc(2); | ||
requires ProducerConst; | ||
ensures four == 4; | ||
{ | ||
|
||
} |