module Hsmtlib.Solver where
import Data.Map
import SMTLib2
data Logic = AUFLIA
| AUFLIRA
| AUFNIRA
| LRA
| QF_ABV
| QF_AUFBV
| QF_AUFLIA
| QF_AX
| QF_BV
| QF_IDL
| QF_LIA
| QF_LRA
| QF_NIA
| QF_NRA
| QF_RDL
| QF_UF
| QF_UFBV
| QF_UFIDL
| QF_UFLIA
| QF_UFLRA
| QF_UFNRA
| UFLRA
| UFNIA
deriving(Show)
data Solvers = Z3 | Cvc4 | Yices | Mathsat | Altergo | Boolector
data GenResult = Success
| Unsupported
| Error String
| GUError String
deriving (Show,Eq)
data SatResult = Sat
| Unsat
| Unknown
| SUError String
deriving (Show)
data GValResult = Res String Value
| VArrays Arrays
| Results [GValResult]
| GVUError String
deriving (Show)
type Arrays = Map String (Map String Integer)
data Value = VInt Integer
| VRatio Rational
| VBool Bool
| VHex String
deriving (Show)
data Mode = Online | Script | Batch
data SolverConfig = Config
{ path :: String
, args :: [String]
}
data Solver = Solver
{ setLogic :: Name -> IO GenResult
, setOption :: Option -> IO GenResult
, setInfo :: Attr -> IO GenResult
, declareType :: Name -> Integer -> IO GenResult
, defineType :: Name -> [Name] -> Type -> IO GenResult
, declareFun :: Name -> [Type] -> Type -> IO GenResult
, defineFun :: Name -> [Binder] -> Type -> Expr -> IO GenResult
, push :: Integer -> IO GenResult
, pop :: Integer -> IO GenResult
, assert :: Expr -> IO GenResult
, checkSat :: IO SatResult
, getAssertions :: IO String
, getValue :: [Expr] -> IO GValResult
, getProof :: IO String
, getUnsatCore :: IO String
, getInfo :: InfoFlag -> IO String
, getOption :: Name -> IO String
, exit :: IO String
}
| BSolver
{ executeBatch :: [Command] -> IO String }