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

class (Typeable b, Functor (SMTMonad b), Monad (SMTMonad b), GetType (Expr b), GetType (Var b), GetType (QVar b), GetFunType (Fun b), GetConType (Constr b), GetFieldType (Field b), GetType (FunArg b), GetType (LVar b), Typeable (Expr b), Typeable (Var b), Typeable (QVar b), Typeable (Fun b), Typeable (Constr b), Typeable (Field 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 (Constr b), GShow (Constr b), GCompare (Field b), GShow (Field 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

Associated Types

type SMTMonad b :: * -> * Source

type Expr b :: Type -> * Source

type Var b :: Type -> * Source

type QVar b :: Type -> * Source

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

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

type Field b :: (*, Type) -> * Source

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 (Constr b) t) Source

getModel :: SMTAction b (Model b) Source

modelEvaluate :: Model b -> Expr b t -> SMTAction b (Value (Constr b) 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) (Constr b) (Field 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) (Constr b) (Field b) (FunArg b) (LVar b) (Expr b) t Source

declareDatatypes :: TypeCollection sigs -> SMTAction b (BackendTypeCollection (Constr b) (Field b) sigs) Source

interpolate :: SMTAction b (Expr b BoolType) Source

exit :: SMTAction b () Source

type BackendTypeCollection con field sigs = Datatypes (BackendDatatype con field) sigs Source

newtype BackendDatatype con field sig Source

Constructors

BackendDatatype 

Fields

bconstructors :: Constrs (BackendConstr con field) (Fst sig) (Snd sig)
 

data BackendConstr con field sig Source

Constructors

BackendConstr 

Fields

bconName :: String
 
bconRepr :: con sig
 
bconFields :: List (BackendField field (Snd sig)) (Fst sig)
 
bconstruct :: List ConcreteValue (Fst sig) -> Snd sig
 
bconTest :: Snd sig -> Bool
 

data BackendField field dt t Source

Constructors

BackendField 

Fields

bfieldName :: String
 
bfieldRepr :: field `(dt, t)`
 
bfieldType :: Repr t
 
bfieldGet :: dt -> ConcreteValue t
 

data Partition Source

The interpolation partition

Constructors

PartitionA 
PartitionB 

data CheckSatResult Source

The result of a check-sat query

Constructors

Sat

The formula is satisfiable

Unsat

The formula is unsatisfiable

Unknown

The solver cannot determine the satisfiability of a formula

data CheckSatLimits Source

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

Constructors

CheckSatLimits 

Fields

limitTime :: Maybe Integer

A limit on the amount of time the solver can spend on the problem (in milliseconds)

limitMemory :: Maybe Integer

A limit on the amount of memory the solver can use (in megabytes)

newtype AssignmentModel b Source

Constructors

AssignmentModel 

Fields

assignments :: [Assignment b]
 

Instances

data Assignment b Source

Constructors

forall t . VarAssignment (Var b t) (Expr b t) 
forall arg 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 UntypedVar v t Source

Constructors

UntypedVar v (Repr t) 

data UntypedFun v sig where Source

Constructors

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

Instances

data UntypedCon v sig where Source

Constructors

UntypedCon :: IsDatatype dt => v -> List Repr arg -> Proxy dt -> UntypedCon v `(arg, dt)` 

Instances

GetConType (UntypedCon v) Source 
Eq v => Eq (UntypedCon v sig) Source 
Ord v => Ord (UntypedCon v sig) Source 
Show v => Show (UntypedCon v sig) Source 
Ord v => GCompare ((,) [Type] *) (UntypedCon v) Source 
Eq v => GEq ((,) [Type] *) (UntypedCon v) Source 
Show v => GShow ((,) [Type] *) (UntypedCon v) Source 

data UntypedField v sig where Source

Constructors

UntypedField :: IsDatatype dt => v -> Proxy dt -> Repr t -> UntypedField v `(dt, t)` 

data RenderedSubExpr t Source

Constructors

RenderedSubExpr (Int -> ShowS) 

Instances

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