-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add composition support to
prove_bisim
(#1972)
This change enables the reuse of proofs in `prove_bisim`. `prove_bisim` now returns a `BisimTheorem` that can be passed in to future `prove_bisim` commands to facilitate compositional proofs. To support this, `prove_bisim` now also requires an additional relation over states. For a detailed description of how this all works, see the module level doc comment in `SAWScript.Bisimulation`.
- Loading branch information
Showing
12 changed files
with
902 additions
and
177 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
Binary file not shown.
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 |
---|---|---|
@@ -1,13 +1,29 @@ | ||
/* Test the prove_bisim command with a compositional circuit. At the moment, | ||
* prove_bisim does not have any notion of compositionality, but this example | ||
* is simple enough to work as-is */ | ||
/* Test the prove_bisim command with a compositional circuit */ | ||
|
||
import "Comp.cry"; | ||
|
||
enable_experimental; | ||
|
||
res <- prove_bisim z3 {{ andRel }} {{ andImp }} {{ andSpec }}; | ||
print res; | ||
// Prove 'andImp' and 'andSpec' simulate each other | ||
and_res <- prove_bisim z3 | ||
[] | ||
{{ andStateRel }} | ||
{{ andOutputRel }} | ||
{{ andImp }} | ||
{{ andSpec }}; | ||
|
||
res2 <- prove_bisim z3 {{ nandRel }} {{ nandImp }} {{ nandSpec }}; | ||
print res2; | ||
// Prove 'nandImp' and 'nandSpec' simulate each other, using 'and_res' in the | ||
// process. | ||
nand_res <- prove_bisim (do { | ||
unfolding ["nandImp", "nandSpec"]; | ||
w4_unint_z3 ["andImp", "andSpec" ]; | ||
}) | ||
[and_res] {{ \x -> nandStateRel x }} {{ \x -> nandOutputRel x }} {{ nandImp }} {{ nandSpec }}; | ||
|
||
// Test using theorem that doesn't apply | ||
prove_bisim z3 | ||
[nand_res] | ||
{{ andStateRel }} | ||
{{ andOutputRel }} | ||
{{ andImp }} | ||
{{ andSpec }}; |
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
Oops, something went wrong.