Created
April 2, 2013 15:35
-
-
Save LeventErkok/5293163 to your computer and use it in GitHub Desktop.
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
import Data.SBV | |
-- generate a model of 9 sInt8's that are always increasing and positive | |
-- I just named a0 below explicitly, but of course you can name any of | |
-- the parameters you want. | |
-- | |
-- also see the functions: free/exists/forall/sBool/sBools/sInt8/sInt8s etc; | |
-- there's a pair (singular and plural) provided for each basic type SBV | |
-- supports. | |
tst = sat $ do as@(a0 : _) <- mapM free ['a' : show i | i <- [0..8]] | |
let increasing [] = true | |
increasing [x] = true | |
increasing (x:y:rs) = x .< y &&& increasing (y:rs) | |
constrain $ a0 .> (0::SInt8) | |
return $ increasing as |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment