-
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.
Merge pull request #1755 from GaloisInc/feature/cryptol-property-unfo…
…lding Allow use of Cryptol property names as simplification rules
- Loading branch information
Showing
7 changed files
with
62 additions
and
40 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,5 @@ | ||
This tests limited automatic unfolding in `addsimp*`. Rather than manually | ||
unwrap `XorInvolutes` into its functional definition at the `prove*` site in | ||
SAW, we can prove the property by name and include its *immediate* definition as | ||
the rewrite rule. No further unwrapping takes place, since `XorInvolutes` | ||
unfolds to a well-formed simplification rule. |
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,4 @@ | ||
module Test where | ||
|
||
XorInvolutes : [8] -> [8] -> Bit | ||
property XorInvolutes x y = (x ^ y) ^ y == x |
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,13 @@ | ||
import "test.cry"; | ||
|
||
// Existing capability | ||
p1 <- prove_print z3 {{ \(x: [8]) (y: [8]) -> (x ^ y) ^ y == x }}; | ||
let r1 = addsimp p1 empty_ss; | ||
|
||
// New capability | ||
p2 <- prove_print z3 {{ XorInvolutes }}; | ||
let r2 = addsimp p2 empty_ss; | ||
|
||
// New capability | ||
p3 <- prove_print z3 {{ \x y -> XorInvolutes x y }}; | ||
let r3 = addsimp p3 empty_ss; |
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,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
$SAW test.saw |
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