Skip to content

Commit

Permalink
Translate Cryptol (==) using the class dictionary, avoiding `Prelude.…
Browse files Browse the repository at this point in the history
…eq`.

NOTE: The cryptol simpset avoids unfolding the definition of `ecEq`,
to make it easier to recognize equational theorems as such.
The axiom `ecEq_refl` can be used to rewrite goals involving `ecEq`.
  • Loading branch information
Brian Huffman committed Dec 4, 2018
1 parent 385c96a commit 606c2f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion saw/Cryptol.sawcore
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ ecSLt : (a : sort 0) -> PSignedCmp a -> a -> a -> Bool;
ecSLt a pa x y = pa.scmp x y False;

ecEq : (a : sort 0) -> PCmp a -> a -> a -> Bool;
ecEq a _ = eq a;
ecEq a pa = pa.eq;

ecNotEq : (a : sort 0) -> PCmp a -> a -> a -> Bool;
ecNotEq a pa x y = not (ecEq a pa x y);
Expand Down Expand Up @@ -1363,6 +1363,8 @@ ecSle =
--------------------------------------------------------------------------------
-- Rewrite rules

axiom ecEq_refl : (a : sort 0) -> (pa : PCmp a) -> (x : a) -> Eq Bool (ecEq a pa x x) True;

axiom replicate_False : (n : Nat) -> Eq (bitvector n) (replicate n Bool False) (bvNat n 0);

axiom subNat_0 : (n : Nat) -> Eq Nat (subNat n 0) n;
Expand Down
1 change: 1 addition & 0 deletions src/Verifier/SAW/Cryptol/Simpset.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ excludedNames =
, "PLiteral"
, "PLogic"
, "PSignedCmp"
, "ecEq"
]

0 comments on commit 606c2f9

Please sign in to comment.