Skip to content

Commit

Permalink
Merge pull request #819 from GaloisInc/test-updates
Browse files Browse the repository at this point in the history
Test updates
  • Loading branch information
robdockins authored Jul 14, 2020
2 parents 42b2ac6 + c2c1ad1 commit bf2258b
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 3 deletions.
26 changes: 26 additions & 0 deletions tests/regression/ignore-safe.icry
Original file line number Diff line number Diff line change
@@ -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 )
15 changes: 15 additions & 0 deletions tests/regression/ignore-safe.icry.stdout
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 5 additions & 0 deletions tests/regression/superclass.cry
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module superclass where

zeroRing : {a} (Ring a) => a
zeroRing = zero

Expand Down Expand Up @@ -27,3 +29,6 @@ recipRound x = trunc (recip x)

compareRound : {a} (Round a) => a -> a -> Bit
compareRound x y = x < y

eqCmp : {a} (Cmp a) => a -> a -> Bit
eqCmp x y = x == y
7 changes: 5 additions & 2 deletions tests/regression/superclass.icry
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
:l superclass.cry
:m superclass

:browse superclass

:t (fromInteger 42 + zero)
:t (trunc (recip (fromInteger 5)))
:t (\x -> x < fromInteger (floor (recip x)))
:t (\x -> x == zero /. x)
:t (zero == ~zero)
:t (\x -> toInteger (x + zero))
:t (\x -> toInteger (x + zero))
:t (\x y -> x < y \/ x == y)
21 changes: 20 additions & 1 deletion tests/regression/superclass.icry.stdout
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
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
(trunc (recip (fromInteger 5))) : {a} (Round a) => Integer
(\x -> x < fromInteger (floor (recip x))) : {a} (Round a) =>
a -> Bit
(\x -> x == zero /. x) : {a} (Eq a, Field a) => a -> Bit
(zero == ~zero) : {a} (Eq a, Logic a) => Bit
(\x -> toInteger (x + zero)) : {a} (Integral a) => a -> Integer
(\x y -> x < y \/ x == y) : {a} (Cmp a) => a -> a -> Bit

0 comments on commit bf2258b

Please sign in to comment.