-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move test_funs out of Prelude, add doc to MrSolverEvidence, some reverts
- Loading branch information
Showing
5 changed files
with
85 additions
and
84 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,67 @@ | ||
module test_funs where | ||
|
||
import Prelude; | ||
|
||
test_fun0 : Vec 64 Bool -> SpecM VoidEv emptyFunStack (Vec 64 Bool); | ||
test_fun0 _ = retS VoidEv emptyFunStack (Vec 64 Bool) (bvNat 64 0); | ||
|
||
test_fun1 : Vec 64 Bool -> SpecM VoidEv emptyFunStack (Vec 64 Bool); | ||
test_fun1 _ = retS VoidEv emptyFunStack (Vec 64 Bool) (bvNat 64 1); | ||
|
||
test_fun2 : Vec 64 Bool -> SpecM VoidEv emptyFunStack (Vec 64 Bool); | ||
test_fun2 x = retS VoidEv emptyFunStack (Vec 64 Bool) x; | ||
|
||
-- If x == 0 then x else 0; should be equal to 0 | ||
test_fun3 : Vec 64 Bool -> SpecM VoidEv emptyFunStack (Vec 64 Bool); | ||
test_fun3 x = | ||
ite (SpecM VoidEv emptyFunStack (Vec 64 Bool)) (bvEq 64 x (bvNat 64 0)) | ||
(retS VoidEv emptyFunStack (Vec 64 Bool) x) | ||
(retS VoidEv emptyFunStack (Vec 64 Bool) (bvNat 64 0)); | ||
|
||
{- | ||
-- let rec f x = 0 in f x | ||
test_fun4 : Vec 64 Bool -> CompM (Vec 64 Bool); | ||
test_fun4 x = | ||
letRecM1 | ||
(Vec 64 Bool) (Vec 64 Bool) (Vec 64 Bool) | ||
(\ (f: Vec 64 Bool -> CompM (Vec 64 Bool)) (y:Vec 64 Bool) -> | ||
returnM (Vec 64 Bool) (bvNat 64 0)) | ||
(\ (f: Vec 64 Bool -> CompM (Vec 64 Bool)) -> | ||
f x); | ||
|
||
-- Alternate version of test_fun4 that uses letRecM directly | ||
test_fun4_alt : Vec 64 Bool -> CompM (Vec 64 Bool); | ||
test_fun4_alt x = | ||
letRecM | ||
(LRT_Cons (Vec 64 Bool) (\ (_:Vec 64 Bool) -> LRT_Ret (Vec 64 Bool)) | ||
LRT_Nil) | ||
(Vec 64 Bool) | ||
(\ (f:(Vec 64 Bool -> CompM (Vec 64 Bool))) -> | ||
((\ (y:Vec 64 Bool) -> returnM (Vec 64 Bool) (bvNat 64 0)), ())) | ||
(\ (f:(Vec 64 Bool -> CompM (Vec 64 Bool))) -> f x); | ||
|
||
-- let rec f = f in f x | ||
test_fun5 : Vec 64 Bool -> CompM (Vec 64 Bool); | ||
test_fun5 x = | ||
letRecM1 | ||
(Vec 64 Bool) (Vec 64 Bool) (Vec 64 Bool) | ||
(\ (f: Vec 64 Bool -> CompM (Vec 64 Bool)) -> f) | ||
(\ (f: Vec 64 Bool -> CompM (Vec 64 Bool)) -> f x); | ||
|
||
-- let rec f = g and g = f in f x | ||
test_fun6 : Vec 64 Bool -> CompM (Vec 64 Bool); | ||
test_fun6 x = | ||
letRecM | ||
(LRT_Cons | ||
(LRT_Fun (Vec 64 Bool) (\ (_:Vec 64 Bool) -> LRT_Ret (Vec 64 Bool))) | ||
(LRT_Cons | ||
(LRT_Fun (Vec 64 Bool) (\ (_:Vec 64 Bool) -> LRT_Ret (Vec 64 Bool))) | ||
LRT_Nil)) | ||
(Vec 64 Bool) | ||
(\ (f1:(Vec 64 Bool -> CompM (Vec 64 Bool))) | ||
(f2:(Vec 64 Bool -> CompM (Vec 64 Bool))) -> | ||
(f2, (f1, ()))) | ||
(\ (f1:(Vec 64 Bool -> CompM (Vec 64 Bool))) | ||
(f2:(Vec 64 Bool -> CompM (Vec 64 Bool))) -> | ||
f1 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
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