smtlib2-1.0: A type-safe interface to communicate with an SMT solver.

Safe HaskellNone
LanguageHaskell98

Language.SMTLib2.Internals.Monad

Synopsis

Documentation

newtype SMT b a Source #

The SMT monad is used to perform communication with the SMT solver. The type of solver is given by the b parameter.

Constructors

SMT 

Fields

Instances

Backend b => Monad (SMT b) Source # 

Methods

(>>=) :: SMT b a -> (a -> SMT b b) -> SMT b b #

(>>) :: SMT b a -> SMT b b -> SMT b b #

return :: a -> SMT b a #

fail :: String -> SMT b a #

Backend b => Functor (SMT b) Source # 

Methods

fmap :: (a -> b) -> SMT b a -> SMT b b #

(<$) :: a -> SMT b b -> SMT b a #

Backend b => Applicative (SMT b) Source # 

Methods

pure :: a -> SMT b a #

(<*>) :: SMT b (a -> b) -> SMT b a -> SMT b b #

(*>) :: SMT b a -> SMT b b -> SMT b b #

(<*) :: SMT b a -> SMT b b -> SMT b a #

(Backend b, MonadIO (SMTMonad b)) => MonadIO (SMT b) Source # 

Methods

liftIO :: IO a -> SMT b a #

Backend b => MonadState (SMTState b) (SMT b) Source # 

Methods

get :: SMT b (SMTState b) #

put :: SMTState b -> SMT b () #

state :: (SMTState b -> (a, SMTState b)) -> SMT b a #

Backend b => Embed (SMT b) (Expr b) Source # 

Associated Types

type EmVar (SMT b :: * -> *) (Expr b :: Type -> *) :: Type -> * Source #

type EmQVar (SMT b :: * -> *) (Expr b :: Type -> *) :: Type -> * Source #

type EmFun (SMT b :: * -> *) (Expr b :: Type -> *) :: ([Type], Type) -> * Source #

type EmFunArg (SMT b :: * -> *) (Expr b :: Type -> *) :: Type -> * Source #

type EmLVar (SMT b :: * -> *) (Expr b :: Type -> *) :: Type -> * Source #

Methods

embed :: SMT b (EmbedExpr (SMT b) (Expr b) tp) -> SMT b (Expr b tp) Source #

embedQuantifier :: Quantifier -> List Type Repr arg -> (forall m e. (Embed m e, Monad m) => List Type (EmQVar m e) arg -> m (e BoolType)) -> SMT b (Expr b BoolType) Source #

embedTypeOf :: SMT b (Expr b tp -> Repr tp) Source #

type EmVar (SMT b) (Expr b) Source # 
type EmVar (SMT b) (Expr b) = Var b
type EmQVar (SMT b) (Expr b) Source # 
type EmQVar (SMT b) (Expr b) = QVar b
type EmFun (SMT b) (Expr b) Source # 
type EmFun (SMT b) (Expr b) = Fun b
type EmFunArg (SMT b) (Expr b) Source # 
type EmFunArg (SMT b) (Expr b) = FunArg b
type EmLVar (SMT b) (Expr b) Source # 
type EmLVar (SMT b) (Expr b) = LVar b

data SMTState b Source #

Constructors

SMTState 

Fields

Instances

Backend b => MonadState (SMTState b) (SMT b) Source # 

Methods

get :: SMT b (SMTState b) #

put :: SMTState b -> SMT b () #

state :: (SMTState b -> (a, SMTState b)) -> SMT b a #

withBackend Source #

Arguments

:: Backend b 
=> SMTMonad b b

An action that creates a fresh backend.

-> SMT b a

The SMT action to perform.

-> SMTMonad b a 

Execute an SMT action on a given backend.

withBackendExitCleanly :: (Backend b, SMTMonad b ~ IO) => IO b -> SMT b a -> IO a Source #

Like withBackend but specialized to the IO monad so exeptions can be handled by gracefully exiting the solver.

liftSMT :: Backend b => SMTMonad b a -> SMT b a Source #

embedSMT :: Backend b => (b -> SMTMonad b (a, b)) -> SMT b a Source #

embedSMT' :: Backend b => (b -> SMTMonad b b) -> SMT b () Source #

defineVar' :: Backend b => Expr b t -> SMT b (Var b t) Source #

defineVarNamed' :: Backend b => String -> Expr b t -> SMT b (Var b t) Source #

declareVar' :: Backend b => Repr t -> SMT b (Var b t) Source #

declareVarNamed' :: Backend b => Repr t -> String -> SMT b (Var b t) Source #