Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Commit

Permalink
Redefine "fix" combinator using a recursive "let" to preserve sharing.
Browse files Browse the repository at this point in the history
Fixes GaloisInc/saw-script#104.

Note that this changeset only fixes the sharing-related performance
problem. It does not deal with the inefficiency of concatenation on
our infinite stream representation.
  • Loading branch information
Brian Huffman committed Feb 22, 2016
1 parent 631e52e commit f979cc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion saw/Cryptol.sawcore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ compose :: (a b c :: sort 0) -> (b -> c) -> (a -> b) -> (a -> c);
compose _ _ _ f g x = f (g x);

fix :: (a :: sort 0) -> (a -> a) -> a;
fix a f = f (fix a f);
fix a f = let { x :: a; x = f x; } in x;

bvExp :: (n :: Nat) -> bitvector n -> bitvector n -> bitvector n;
bvExp n x y = foldr Bool (bitvector n) n
Expand Down

0 comments on commit f979cc2

Please sign in to comment.