Merge pull request #819 from GaloisInc/test-updates

Test updates
This commit is contained in:
robdockins 2020-07-14 12:45:46 -07:00 committed by GitHub
commit bf2258b5d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 71 additions and 3 deletions

View File

@ -0,0 +1,26 @@
:set prover-stats = off
:set show-examples = off
:set ignore-safety = off
:prove (\ (x:Integer) -> 0 < x ==> x < 4 ==> [3,2,1]@x == 3-x)
:prove (\ (x:[8]) -> x < 4 ==> [3,2,1]@x == 3-x)
:prove (\ (x:Integer) y -> (y == 0) || (y*(x/y) + x%y == x))
:prove (\ (x:[8]) y -> (y == 0) || (y*(x/y) + x%y == x))
:prove (\ (x:Integer) -> [0,0,0]@x == 0 )
:prove (\ (x:Integer) -> []@x == 0 )
:prove (\ (x:[8]) -> [0,0,0]@x == 0 )
:set ignore-safety = on
:prove (\ (x:Integer) -> 0 < x ==> x < 4 ==> [3,2,1]@x == 3-x)
:prove (\ (x:[8]) -> x < 4 ==> [3,2,1]@x == 3-x)
:prove (\ (x:Integer) y -> (y == 0) || (y*(x/y) + x%y == x))
:prove (\ (x:[8]) y -> (y == 0) || (y*(x/y) + x%y == x))
:prove (\ (x:Integer) -> [0,0,0]@x == 0 )
:prove (\ (x:Integer) -> []@x == 0 )
:prove (\ (x:[8]) -> [0,0,0]@x == 0 )

View File

@ -0,0 +1,15 @@
Loading module Cryptol
Counterexample
Counterexample
Counterexample
Counterexample
Counterexample
Counterexample
Counterexample
Q.E.D.
Q.E.D.
Q.E.D.
Q.E.D.
Q.E.D.
Q.E.D.
Q.E.D.

View File

@ -1,3 +1,5 @@
module superclass where
zeroRing : {a} (Ring a) => a zeroRing : {a} (Ring a) => a
zeroRing = zero zeroRing = zero
@ -27,3 +29,6 @@ recipRound x = trunc (recip x)
compareRound : {a} (Round a) => a -> a -> Bit compareRound : {a} (Round a) => a -> a -> Bit
compareRound x y = x < y compareRound x y = x < y
eqCmp : {a} (Cmp a) => a -> a -> Bit
eqCmp x y = x == y

View File

@ -1,8 +1,11 @@
:l superclass.cry :m superclass
:browse superclass
:t (fromInteger 42 + zero) :t (fromInteger 42 + zero)
:t (trunc (recip (fromInteger 5))) :t (trunc (recip (fromInteger 5)))
:t (\x -> x < fromInteger (floor (recip x))) :t (\x -> x < fromInteger (floor (recip x)))
:t (\x -> x == zero /. x) :t (\x -> x == zero /. x)
:t (zero == ~zero) :t (zero == ~zero)
:t (\x -> toInteger (x + zero)) :t (\x -> toInteger (x + zero))
:t (\x y -> x < y \/ x == y)

View File

@ -1,6 +1,24 @@
Loading module Cryptol Loading module Cryptol
Loading module Cryptol Loading module Cryptol
Loading module Main Loading module superclass
Symbols
=======
Public
------
compareRound : {a} (Round a) => a -> a -> Bit
eqCmp : {a} (Cmp a) => a -> a -> Bit
fromIntField : {a} (Field a) => a
fromIntIntegral : {a} (Integral a) => a
fromIntRound : {a} (Round a) => a
recipRound : {a} (Round a) => a -> Integer
zeroField : {a} (Field a) => a
zeroIntegral : {a} (Integral a) => a
zeroLogic : {a} (Logic a) => a
zeroRing : {a} (Ring a) => a
zeroRound : {a} (Round a) => a
(fromInteger 42 + zero) : {a} (Ring a) => a (fromInteger 42 + zero) : {a} (Ring a) => a
(trunc (recip (fromInteger 5))) : {a} (Round a) => Integer (trunc (recip (fromInteger 5))) : {a} (Round a) => Integer
(\x -> x < fromInteger (floor (recip x))) : {a} (Round a) => (\x -> x < fromInteger (floor (recip x))) : {a} (Round a) =>
@ -8,3 +26,4 @@ Loading module Main
(\x -> x == zero /. x) : {a} (Eq a, Field a) => a -> Bit (\x -> x == zero /. x) : {a} (Eq a, Field a) => a -> Bit
(zero == ~zero) : {a} (Eq a, Logic a) => Bit (zero == ~zero) : {a} (Eq a, Logic a) => Bit
(\x -> toInteger (x + zero)) : {a} (Integral a) => a -> Integer (\x -> toInteger (x + zero)) : {a} (Integral a) => a -> Integer
(\x y -> x < y \/ x == y) : {a} (Cmp a) => a -> a -> Bit