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

Safe HaskellNone
LanguageHaskell98

Language.SMTLib2.Internals.Backend

Synopsis

Documentation

type SMTAction b r = b -> SMTMonad b (r, b) Source #

mapAction :: Backend b => (r -> r') -> SMTAction b r -> SMTAction b r' Source #

class (Typeable b, Functor (SMTMonad b), Monad (SMTMonad b), GetType (Expr b), GetType (Var b), GetType (QVar b), GetFunType (Fun b), GetType (FunArg b), GetType (LVar b), Typeable (Expr b), Typeable (Var b), Typeable (QVar b), Typeable (Fun b), Typeable (FunArg b), Typeable (LVar b), Typeable (ClauseId b), GCompare (Expr b), GShow (Expr b), GCompare (Var b), GShow (Var b), GCompare (QVar b), GShow (QVar b), GCompare (Fun b), GShow (Fun b), GCompare (FunArg b), GShow (FunArg b), GCompare (LVar b), GShow (LVar b), Ord (ClauseId b), Show (ClauseId b), Ord (Proof b), Show (Proof b), Show (Model b)) => Backend b where Source #

A backend represents a specific type of SMT solver.

Associated Types

type SMTMonad b :: * -> * Source #

The monad in which the backend executes queries.

data Expr b :: Type -> * Source #

The internal type of expressions.

type Var b :: Type -> * Source #

The internal type of variables.

type QVar b :: Type -> * Source #

The internal type of quantified variables.

type Fun b :: ([Type], Type) -> * Source #

The internal type of user-defined functions.

type FunArg b :: Type -> * Source #

type LVar b :: Type -> * Source #

type ClauseId b :: * Source #

type Model b :: * Source #

type Proof b :: * Source #

Methods

setOption :: SMTOption -> SMTAction b () Source #

getInfo :: SMTInfo i -> SMTAction b i Source #

comment :: String -> SMTAction b () Source #

push :: SMTAction b () Source #

pop :: SMTAction b () Source #

declareVar :: Repr t -> Maybe String -> SMTAction b (Var b t) Source #

createQVar :: Repr t -> Maybe String -> SMTAction b (QVar b t) Source #

createFunArg :: Repr t -> Maybe String -> SMTAction b (FunArg b t) Source #

defineVar :: Maybe String -> Expr b t -> SMTAction b (Var b t) Source #

declareFun :: List Repr arg -> Repr t -> Maybe String -> SMTAction b (Fun b '(arg, t)) Source #

defineFun :: Maybe String -> List (FunArg b) arg -> Expr b r -> SMTAction b (Fun b '(arg, r)) Source #

assert :: Expr b BoolType -> SMTAction b () Source #

assertId :: Expr b BoolType -> SMTAction b (ClauseId b) Source #

assertPartition :: Expr b BoolType -> Partition -> SMTAction b () Source #

checkSat :: Maybe Tactic -> CheckSatLimits -> SMTAction b CheckSatResult Source #

getUnsatCore :: SMTAction b [ClauseId b] Source #

getValue :: Expr b t -> SMTAction b (Value t) Source #

getModel :: SMTAction b (Model b) Source #

modelEvaluate :: Model b -> Expr b t -> SMTAction b (Value t) Source #

getProof :: SMTAction b (Proof b) Source #

analyzeProof :: b -> Proof b -> Proof String (Expr b) (Proof b) Source #

simplify :: Expr b t -> SMTAction b (Expr b t) Source #

toBackend :: Expression (Var b) (QVar b) (Fun b) (FunArg b) (LVar b) (Expr b) t -> SMTAction b (Expr b t) Source #

fromBackend :: b -> Expr b t -> Expression (Var b) (QVar b) (Fun b) (FunArg b) (LVar b) (Expr b) t Source #

declareDatatypes :: [AnyDatatype] -> SMTAction b () Source #

interpolate :: SMTAction b (Expr b BoolType) Source #

exit :: SMTAction b () Source #

data CheckSatLimits Source #

Describe limits on the ressources that an SMT-solver can use

Constructors

CheckSatLimits 

Fields

data Assignment b Source #

Constructors

VarAssignment (Var b t) (Expr b t) 
FunAssignment (Fun b '(arg, t)) (List (FunArg b) arg) (Expr b t) 

Instances

data SMTOption Source #

Options controling the behaviour of the SMT solver

Constructors

PrintSuccess Bool

Whether or not to print "success" after each operation

ProduceModels Bool

Produce a satisfying assignment after each successful checkSat

ProduceProofs Bool

Produce a proof of unsatisfiability after each failed checkSat

ProduceUnsatCores Bool

Enable the querying of unsatisfiable cores after a failed checkSat

ProduceInterpolants Bool

Enable the generation of craig interpolants

SMTLogic String 

data SMTInfo i where Source #

Solver information query type. Used with getInfo.

data UntypedVar v t Source #

Constructors

UntypedVar v (Repr t) 

Instances

Ord v => GCompare Type (UntypedVar v) Source # 

Methods

gcompare :: f a -> f b -> GOrdering (UntypedVar v) a b #

Eq v => GEq Type (UntypedVar v) Source # 

Methods

geq :: f a -> f b -> Maybe ((UntypedVar v := a) b) #

Show v => GShow Type (UntypedVar v) Source # 

Methods

gshowsPrec :: Int -> t a -> ShowS #

GetType (UntypedVar v) Source # 

Methods

getType :: UntypedVar v tp -> Repr tp Source #

Eq v => Eq (UntypedVar v t) Source # 

Methods

(==) :: UntypedVar v t -> UntypedVar v t -> Bool #

(/=) :: UntypedVar v t -> UntypedVar v t -> Bool #

Ord v => Ord (UntypedVar v t) Source # 

Methods

compare :: UntypedVar v t -> UntypedVar v t -> Ordering #

(<) :: UntypedVar v t -> UntypedVar v t -> Bool #

(<=) :: UntypedVar v t -> UntypedVar v t -> Bool #

(>) :: UntypedVar v t -> UntypedVar v t -> Bool #

(>=) :: UntypedVar v t -> UntypedVar v t -> Bool #

max :: UntypedVar v t -> UntypedVar v t -> UntypedVar v t #

min :: UntypedVar v t -> UntypedVar v t -> UntypedVar v t #

Show v => Show (UntypedVar v t) Source # 

Methods

showsPrec :: Int -> UntypedVar v t -> ShowS #

show :: UntypedVar v t -> String #

showList :: [UntypedVar v t] -> ShowS #

data UntypedFun v sig where Source #

Constructors

UntypedFun :: v -> List Repr arg -> Repr ret -> UntypedFun v '(arg, ret) 

Instances

GetFunType (UntypedFun v) Source # 

Methods

getFunType :: UntypedFun v (([Type], Type) arg res) -> (List Type Repr arg, Repr res) Source #

Eq v => Eq (UntypedFun v sig) Source # 

Methods

(==) :: UntypedFun v sig -> UntypedFun v sig -> Bool #

(/=) :: UntypedFun v sig -> UntypedFun v sig -> Bool #

Ord v => Ord (UntypedFun v sig) Source # 

Methods

compare :: UntypedFun v sig -> UntypedFun v sig -> Ordering #

(<) :: UntypedFun v sig -> UntypedFun v sig -> Bool #

(<=) :: UntypedFun v sig -> UntypedFun v sig -> Bool #

(>) :: UntypedFun v sig -> UntypedFun v sig -> Bool #

(>=) :: UntypedFun v sig -> UntypedFun v sig -> Bool #

max :: UntypedFun v sig -> UntypedFun v sig -> UntypedFun v sig #

min :: UntypedFun v sig -> UntypedFun v sig -> UntypedFun v sig #

Show v => Show (UntypedFun v sig) Source # 

Methods

showsPrec :: Int -> UntypedFun v sig -> ShowS #

show :: UntypedFun v sig -> String #

showList :: [UntypedFun v sig] -> ShowS #

Ord v => GCompare ([Type], Type) (UntypedFun v) Source # 

Methods

gcompare :: f a -> f b -> GOrdering (UntypedFun v) a b #

Eq v => GEq ([Type], Type) (UntypedFun v) Source # 

Methods

geq :: f a -> f b -> Maybe ((UntypedFun v := a) b) #

Show v => GShow ([Type], Type) (UntypedFun v) Source # 

Methods

gshowsPrec :: Int -> t a -> ShowS #

data RenderedSubExpr t Source #

Constructors

RenderedSubExpr (Int -> ShowS) 

Instances

GShow k (RenderedSubExpr k) Source # 

Methods

gshowsPrec :: Int -> t a -> ShowS #

showsBackendExpr :: Backend b => b -> Int -> Expr b t -> ShowS Source #