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

Safe HaskellNone
LanguageHaskell98

Language.SMTLib2.Pipe.Internals

Synopsis

Documentation

data PipeDatatype Source #

Constructors

IsDatatype a => PipeDatatype (Proxy a) 

data SMTPipe Source #

Instances

Backend SMTPipe Source # 

Associated Types

type SMTMonad SMTPipe :: * -> * #

data Expr SMTPipe (a :: Type) :: * #

type Var SMTPipe :: Type -> * #

type QVar SMTPipe :: Type -> * #

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

type FunArg SMTPipe :: Type -> * #

type LVar SMTPipe :: Type -> * #

type ClauseId SMTPipe :: * #

type Model SMTPipe :: * #

type Proof SMTPipe :: * #

Methods

setOption :: SMTOption -> SMTAction SMTPipe () #

getInfo :: SMTInfo i -> SMTAction SMTPipe i #

comment :: String -> SMTAction SMTPipe () #

push :: SMTAction SMTPipe () #

pop :: SMTAction SMTPipe () #

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

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

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

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

declareFun :: List Type Repr arg -> Repr t -> Maybe String -> SMTAction SMTPipe (Fun SMTPipe (([Type], Type) arg t)) #

defineFun :: Maybe String -> List Type (FunArg SMTPipe) arg -> Expr SMTPipe r -> SMTAction SMTPipe (Fun SMTPipe (([Type], Type) arg r)) #

assert :: Expr SMTPipe BoolType -> SMTAction SMTPipe () #

assertId :: Expr SMTPipe BoolType -> SMTAction SMTPipe (ClauseId SMTPipe) #

assertPartition :: Expr SMTPipe BoolType -> Partition -> SMTAction SMTPipe () #

checkSat :: Maybe Tactic -> CheckSatLimits -> SMTAction SMTPipe CheckSatResult #

getUnsatCore :: SMTAction SMTPipe [ClauseId SMTPipe] #

getValue :: Expr SMTPipe t -> SMTAction SMTPipe (Value t) #

getModel :: SMTAction SMTPipe (Model SMTPipe) #

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

getProof :: SMTAction SMTPipe (Proof SMTPipe) #

analyzeProof :: SMTPipe -> Proof SMTPipe -> Proof String (Expr SMTPipe) (Proof SMTPipe) #

simplify :: Expr SMTPipe t -> SMTAction SMTPipe (Expr SMTPipe t) #

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

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

declareDatatypes :: [AnyDatatype] -> SMTAction SMTPipe () #

interpolate :: SMTAction SMTPipe (Expr SMTPipe BoolType) #

exit :: SMTAction SMTPipe () #

GCompare Type (Expr SMTPipe) Source # 

Methods

gcompare :: f a -> f b -> GOrdering (Expr SMTPipe) a b #

GEq Type (Expr SMTPipe) Source # 

Methods

geq :: f a -> f b -> Maybe ((Expr SMTPipe := a) b) #

GShow Type (Expr SMTPipe) Source # 

Methods

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

GetType (Expr SMTPipe) Source # 

Methods

getType :: Expr SMTPipe tp -> Repr tp #

Show (Expr SMTPipe t) Source # 
type Proof SMTPipe Source # 
type Model SMTPipe Source # 
type ClauseId SMTPipe Source # 
type LVar SMTPipe Source # 
type FunArg SMTPipe Source # 
type Fun SMTPipe Source # 
type QVar SMTPipe Source # 
type Var SMTPipe Source # 
data Expr SMTPipe Source # 
type SMTMonad SMTPipe Source # 

data RevVar Source #

Constructors

Var !(Repr t) 
QVar !(Repr t) 
Fun !(List Repr arg) !(Repr t) 
FunArg !(Repr t) 
LVar !(Repr t) 

renderDefineFun :: (GetType e, GetType fv) => (forall t. fv t -> Lisp) -> (forall t. e t -> Lisp) -> Map String Int -> Maybe String -> List fv arg -> e ret -> (Text, Lisp, Map String Int) Source #

data Sort Source #

Constructors

Sort (Repr t) 

data Sorts Source #

Constructors

Sorts (List Repr t) 

data AnyExpr e Source #

Constructors

AnyExpr (e t) 

Instances

GShow Type e => Show (AnyExpr e) Source # 

Methods

showsPrec :: Int -> AnyExpr e -> ShowS #

show :: AnyExpr e -> String #

showList :: [AnyExpr e] -> ShowS #

data LispParser v qv fun fv lv e Source #

Constructors

LispParser 

Fields

createPipe Source #

Arguments

:: String

Path to the binary of the SMT solver

-> [String]

Command line arguments to be passed to the SMT solver

-> IO SMTPipe 

Spawn a new SMT solver process and create a pipe to communicate with it.

createPipeFromHandle Source #

Arguments

:: Handle

Input handle

-> Handle

Output handle

-> IO SMTPipe 

Create a SMT pipe by giving the input and output handle.

lispToExprWith :: (GShow fun, GShow e, GetFunType fun, GetType e) => LispParser v qv fun fv lv e -> Maybe Sort -> Lisp -> (forall t. Expression v qv fun fv lv e t -> LispParse a) -> LispParse a Source #

mkQuant :: LispParser v qv fun fv lv e -> [Lisp] -> (forall arg. LispParser v qv fun fv lv e -> List qv arg -> LispParse a) -> LispParse a Source #

mkLet :: GetType e => LispParser v qv fun fv lv e -> [Lisp] -> (forall arg. LispParser v qv fun fv lv e -> List (LetBinding lv e) arg -> LispParse a) -> LispParse a Source #

withEq :: Repr t -> [b] -> (forall n. Natural n -> List Repr (AllEq t n) -> a) -> a Source #

fullArgs :: Int -> [(Int, Sort)] -> Natural len -> (forall tps. Length tps ~ len => List Repr tps -> a) -> Maybe a Source #

lispToSort :: LispParser v qv fun fv lv e -> Lisp -> LispParse Sort Source #

lispToSorts :: LispParser v qv fun fv lv e -> [Lisp] -> (forall arg. List Repr arg -> LispParse a) -> LispParse a Source #

exprToLispWith Source #

Arguments

:: (Monad m, GetType v, GetType qv, GetType fv, GetType lv, GetFunType fun, GetType e) 
=> (forall t'. v t' -> m Lisp)

variables

-> (forall t'. qv t' -> m Lisp)

quantified variables

-> (forall arg res. fun '(arg, res) -> m Lisp)

functions

-> (forall arg dt. IsDatatype dt => Datatype dt -> Constr dt arg -> m Lisp)

constructor

-> (forall arg dt. IsDatatype dt => Datatype dt -> Constr dt arg -> m Lisp)

constructor tests

-> (forall dt res. IsDatatype dt => Datatype dt -> Field dt res -> m Lisp)

field accesses

-> (forall t. fv t -> m Lisp)

function variables

-> (forall t. lv t -> m Lisp)

let variables

-> (forall t'. e t' -> m Lisp)

sub expressions

-> Expression v qv fun fv lv e t 
-> m Lisp 

valueToLisp :: Monad m => (forall arg tp. IsDatatype tp => Datatype tp -> Constr tp arg -> m Lisp) -> Value t -> m Lisp Source #

functionSymbol Source #

Arguments

:: (Monad m, GetFunType fun) 
=> (forall arg' res'. fun '(arg', res') -> m Lisp)

How to render user functions

-> (forall arg' dt. IsDatatype dt => Datatype dt -> Constr dt arg' -> m Lisp)

How to render constructor applications

-> (forall arg' dt. IsDatatype dt => Datatype dt -> Constr dt arg' -> m Lisp)

How to render constructor tests

-> (forall dt res'. IsDatatype dt => Datatype dt -> Field dt res' -> m Lisp)

How to render field acceses

-> Function fun '(arg, res) 
-> m Lisp 

functionSymbolWithSig Source #

Arguments

:: (Monad m, GetFunType fun) 
=> (forall arg' res'. fun '(arg', res') -> m Lisp)

How to render user functions

-> (forall arg' dt. IsDatatype dt => Datatype dt -> Constr dt arg' -> m Lisp)

How to render constructor applications

-> (forall arg' dt. IsDatatype dt => Datatype dt -> Constr dt arg' -> m Lisp)

How to render constructor tests

-> (forall dt res'. IsDatatype dt => Datatype dt -> Field dt res' -> m Lisp)

How to render field acceses

-> Function fun '(arg, res) 
-> m Lisp