Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Main where
  2. import Data.SBV
  3. import Data.SBV.Control
  4. import Control.Monad
  5.  
  6. t :: Symbolic (Int -> SReal)
  7. t = do
  8.     x <- sReal "prob"
  9.     return $ \y -> if y == 2 then x else 1.0
  10.  
  11.  
  12. q :: Symbolic ()
  13. q = do
  14.     f <- t
  15.     query $ do
  16.         cs <- checkSat
  17.         case cs of
  18.           Sat -> do
  19.             v <- getValue (f 1)
  20.             return ()
  21.  
  22.  
  23.  
  24. main :: IO ()
  25. main = do
  26.   runSMTWith z3{verbose=True} q
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement