ez3-0.1.0.0: Z3 bonds with pure interface
Safe HaskellNone
LanguageHaskell2010

Z3.Tagged

Synopsis

Z3 monad

type Z3 s = ReaderT (Z3Env s) (ST s) Source #

module Z3.Opts

data Logic #

Solvers available in Z3.

These are described at http://smtlib.cs.uiowa.edu/logics.html

Constructors

AUFLIA

Closed formulas over the theory of linear integer arithmetic and arrays extended with free sort and function symbols but restricted to arrays with integer indices and values.

AUFLIRA

Closed linear formulas with free sort and function symbols over one- and two-dimentional arrays of integer index and real value.

AUFNIRA

Closed formulas with free function and predicate symbols over a theory of arrays of arrays of integer index and real value.

LRA

Closed linear formulas in linear real arithmetic.

QF_ABV

Closed quantifier-free formulas over the theory of bitvectors and bitvector arrays.

QF_AUFBV

Closed quantifier-free formulas over the theory of bitvectors and bitvector arrays extended with free sort and function symbols.

QF_AUFLIA

Closed quantifier-free linear formulas over the theory of integer arrays extended with free sort and function symbols.

QF_AX

Closed quantifier-free formulas over the theory of arrays with extensionality.

QF_BV

Closed quantifier-free formulas over the theory of fixed-size bitvectors.

QF_IDL

Difference Logic over the integers. In essence, Boolean combinations of inequations of the form x - y < b where x and y are integer variables and b is an integer constant.

QF_LIA

Unquantified linear integer arithmetic. In essence, Boolean combinations of inequations between linear polynomials over integer variables.

QF_LRA

Unquantified linear real arithmetic. In essence, Boolean combinations of inequations between linear polynomials over real variables.

QF_NIA

Quantifier-free integer arithmetic.

QF_NRA

Quantifier-free real arithmetic.

QF_RDL

Difference Logic over the reals. In essence, Boolean combinations of inequations of the form x - y < b where x and y are real variables and b is a rational constant.

QF_UF

Unquantified formulas built over a signature of uninterpreted (i.e., free) sort and function symbols.

QF_UFBV

Unquantified formulas over bitvectors with uninterpreted sort function and symbols.

QF_UFIDL

Difference Logic over the integers (in essence) but with uninterpreted sort and function symbols.

QF_UFLIA

Unquantified linear integer arithmetic with uninterpreted sort and function symbols.

QF_UFLRA

Unquantified linear real arithmetic with uninterpreted sort and function symbols.

QF_UFNRA

Unquantified non-linear real arithmetic with uninterpreted sort and function symbols.

UFLRA

Linear real arithmetic with uninterpreted sort and function symbols.

UFNIA

Non-linear integer arithmetic with uninterpreted sort and function symbols.

Instances

Instances details
Show Logic 
Instance details

Defined in Z3.Base

Methods

showsPrec :: Int -> Logic -> ShowS #

show :: Logic -> String #

showList :: [Logic] -> ShowS #

evalZ3 :: Z3 s a -> ST s a Source #

Eval a Z3 script with default configuration options.

evalZ3With :: Maybe Logic -> Opts -> Z3 s a -> ST s a Source #

Eval a Z3 script.

Z3 enviroments

data Z3Env s Source #

Z3 environment.

newEnv :: Maybe Logic -> Opts -> ST s (Z3Env s) Source #

Create a new Z3 environment.

Types

data Symbol s Source #

Instances

Instances details
Eq (Symbol s) Source # 
Instance details

Defined in Z3.Tagged

Methods

(==) :: Symbol s -> Symbol s -> Bool #

(/=) :: Symbol s -> Symbol s -> Bool #

Ord (Symbol s) Source # 
Instance details

Defined in Z3.Tagged

Methods

compare :: Symbol s -> Symbol s -> Ordering #

(<) :: Symbol s -> Symbol s -> Bool #

(<=) :: Symbol s -> Symbol s -> Bool #

(>) :: Symbol s -> Symbol s -> Bool #

(>=) :: Symbol s -> Symbol s -> Bool #

max :: Symbol s -> Symbol s -> Symbol s #

min :: Symbol s -> Symbol s -> Symbol s #

Show (Symbol s) Source # 
Instance details

Defined in Z3.Tagged

Methods

showsPrec :: Int -> Symbol s -> ShowS #

show :: Symbol s -> String #

showList :: [Symbol s] -> ShowS #

Storable (Symbol s) Source # 
Instance details

Defined in Z3.Tagged

Methods

sizeOf :: Symbol s -> Int #

alignment :: Symbol s -> Int #

peekElemOff :: Ptr (Symbol s) -> Int -> IO (Symbol s) #

pokeElemOff :: Ptr (Symbol s) -> Int -> Symbol s -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Symbol s) #

pokeByteOff :: Ptr b -> Int -> Symbol s -> IO () #

peek :: Ptr (Symbol s) -> IO (Symbol s) #

poke :: Ptr (Symbol s) -> Symbol s -> IO () #

data AST s Source #

Instances

Instances details
Eq (AST s) Source # 
Instance details

Defined in Z3.Tagged

Methods

(==) :: AST s -> AST s -> Bool #

(/=) :: AST s -> AST s -> Bool #

Ord (AST s) Source # 
Instance details

Defined in Z3.Tagged

Methods

compare :: AST s -> AST s -> Ordering #

(<) :: AST s -> AST s -> Bool #

(<=) :: AST s -> AST s -> Bool #

(>) :: AST s -> AST s -> Bool #

(>=) :: AST s -> AST s -> Bool #

max :: AST s -> AST s -> AST s #

min :: AST s -> AST s -> AST s #

Show (AST s) Source # 
Instance details

Defined in Z3.Tagged

Methods

showsPrec :: Int -> AST s -> ShowS #

show :: AST s -> String #

showList :: [AST s] -> ShowS #

data Sort s Source #

Instances

Instances details
Eq (Sort s) Source # 
Instance details

Defined in Z3.Tagged

Methods

(==) :: Sort s -> Sort s -> Bool #

(/=) :: Sort s -> Sort s -> Bool #

Ord (Sort s) Source # 
Instance details

Defined in Z3.Tagged

Methods

compare :: Sort s -> Sort s -> Ordering #

(<) :: Sort s -> Sort s -> Bool #

(<=) :: Sort s -> Sort s -> Bool #

(>) :: Sort s -> Sort s -> Bool #

(>=) :: Sort s -> Sort s -> Bool #

max :: Sort s -> Sort s -> Sort s #

min :: Sort s -> Sort s -> Sort s #

Show (Sort s) Source # 
Instance details

Defined in Z3.Tagged

Methods

showsPrec :: Int -> Sort s -> ShowS #

show :: Sort s -> String #

showList :: [Sort s] -> ShowS #

data FuncDecl s Source #

Instances

Instances details
Eq (FuncDecl s) Source # 
Instance details

Defined in Z3.Tagged

Methods

(==) :: FuncDecl s -> FuncDecl s -> Bool #

(/=) :: FuncDecl s -> FuncDecl s -> Bool #

Ord (FuncDecl s) Source # 
Instance details

Defined in Z3.Tagged

Methods

compare :: FuncDecl s -> FuncDecl s -> Ordering #

(<) :: FuncDecl s -> FuncDecl s -> Bool #

(<=) :: FuncDecl s -> FuncDecl s -> Bool #

(>) :: FuncDecl s -> FuncDecl s -> Bool #

(>=) :: FuncDecl s -> FuncDecl s -> Bool #

max :: FuncDecl s -> FuncDecl s -> FuncDecl s #

min :: FuncDecl s -> FuncDecl s -> FuncDecl s #

Show (FuncDecl s) Source # 
Instance details

Defined in Z3.Tagged

Methods

showsPrec :: Int -> FuncDecl s -> ShowS #

show :: FuncDecl s -> String #

showList :: [FuncDecl s] -> ShowS #

data App s Source #

Instances

Instances details
Eq (App s) Source # 
Instance details

Defined in Z3.Tagged

Methods

(==) :: App s -> App s -> Bool #

(/=) :: App s -> App s -> Bool #

Ord (App s) Source # 
Instance details

Defined in Z3.Tagged

Methods

compare :: App s -> App s -> Ordering #

(<) :: App s -> App s -> Bool #

(<=) :: App s -> App s -> Bool #

(>) :: App s -> App s -> Bool #

(>=) :: App s -> App s -> Bool #

max :: App s -> App s -> App s #

min :: App s -> App s -> App s #

Show (App s) Source # 
Instance details

Defined in Z3.Tagged

Methods

showsPrec :: Int -> App s -> ShowS #

show :: App s -> String #

showList :: [App s] -> ShowS #

data Pattern s Source #

Instances

Instances details
Eq (Pattern s) Source # 
Instance details

Defined in Z3.Tagged

Methods

(==) :: Pattern s -> Pattern s -> Bool #

(/=) :: Pattern s -> Pattern s -> Bool #

Ord (Pattern s) Source # 
Instance details

Defined in Z3.Tagged

Methods

compare :: Pattern s -> Pattern s -> Ordering #

(<) :: Pattern s -> Pattern s -> Bool #

(<=) :: Pattern s -> Pattern s -> Bool #

(>) :: Pattern s -> Pattern s -> Bool #

(>=) :: Pattern s -> Pattern s -> Bool #

max :: Pattern s -> Pattern s -> Pattern s #

min :: Pattern s -> Pattern s -> Pattern s #

Show (Pattern s) Source # 
Instance details

Defined in Z3.Tagged

Methods

showsPrec :: Int -> Pattern s -> ShowS #

show :: Pattern s -> String #

showList :: [Pattern s] -> ShowS #

data Constructor s Source #

Instances

Instances details
Eq (Constructor s) Source # 
Instance details

Defined in Z3.Tagged

Ord (Constructor s) Source # 
Instance details

Defined in Z3.Tagged

Show (Constructor s) Source # 
Instance details

Defined in Z3.Tagged

data Model s Source #

Instances

Instances details
Eq (Model s) Source # 
Instance details

Defined in Z3.Tagged

Methods

(==) :: Model s -> Model s -> Bool #

(/=) :: Model s -> Model s -> Bool #

data Context #

A Z3 logical context.

Instances

Instances details
Eq Context 
Instance details

Defined in Z3.Base

Methods

(==) :: Context -> Context -> Bool #

(/=) :: Context -> Context -> Bool #

data FuncInterp s Source #

Instances

Instances details
Eq (FuncInterp s) Source # 
Instance details

Defined in Z3.Tagged

Methods

(==) :: FuncInterp s -> FuncInterp s -> Bool #

(/=) :: FuncInterp s -> FuncInterp s -> Bool #

data FuncEntry s Source #

Instances

Instances details
Eq (FuncEntry s) Source # 
Instance details

Defined in Z3.Tagged

Methods

(==) :: FuncEntry s -> FuncEntry s -> Bool #

(/=) :: FuncEntry s -> FuncEntry s -> Bool #

data Params s Source #

Instances

Instances details
Eq (Params s) Source # 
Instance details

Defined in Z3.Tagged

Methods

(==) :: Params s -> Params s -> Bool #

(/=) :: Params s -> Params s -> Bool #

data Solver s Source #

Instances

Instances details
Eq (Solver s) Source # 
Instance details

Defined in Z3.Tagged

Methods

(==) :: Solver s -> Solver s -> Bool #

(/=) :: Solver s -> Solver s -> Bool #

data ASTKind #

Different kinds of Z3 AST nodes.

Instances

Instances details
Eq ASTKind 
Instance details

Defined in Z3.Base

Methods

(==) :: ASTKind -> ASTKind -> Bool #

(/=) :: ASTKind -> ASTKind -> Bool #

Show ASTKind 
Instance details

Defined in Z3.Base

Satisfiability result

data Result #

Result of a satisfiability check.

This corresponds to the z3_lbool type in the C API.

Constructors

Sat 
Unsat 
Undef 

Instances

Instances details
Eq Result 
Instance details

Defined in Z3.Base

Methods

(==) :: Result -> Result -> Bool #

(/=) :: Result -> Result -> Bool #

Ord Result 
Instance details

Defined in Z3.Base

Read Result 
Instance details

Defined in Z3.Base

Show Result 
Instance details

Defined in Z3.Base

Marshal Result Z3_lbool 
Instance details

Defined in Z3.Base

Methods

c2h :: Context -> Z3_lbool -> IO Result

h2c :: Result -> (Z3_lbool -> IO r) -> IO r

Parameters

mkParams :: Z3 s (Params s) Source #

Create a Z3 (empty) parameter set.

Starting at Z3 4.0, parameter sets are used to configure many components such as: simplifiers, tactics, solvers, etc.

paramsSetBool :: Params s -> Symbol s -> Bool -> Z3 s () Source #

Add a Boolean parameter k with value v to the parameter set p.

paramsSetUInt :: Params s -> Symbol s -> Word -> Z3 s () Source #

Add a unsigned parameter k with value v to the parameter set p.

paramsSetDouble :: Params s -> Symbol s -> Double -> Z3 s () Source #

Add a double parameter k with value v to the parameter set p.

paramsSetSymbol :: Params s -> Symbol s -> Symbol s -> Z3 s () Source #

Add a symbol parameter k with value v to the parameter set p.

paramsToString :: Params s -> Z3 s String Source #

Convert a parameter set into a string.

This function is mainly used for printing the contents of a parameter set.

Symbols

mkIntSymbol :: forall i s. Integral i => i -> Z3 s (Symbol s) Source #

Create a Z3 symbol using an integer.

mkStringSymbol :: String -> Z3 s (Symbol s) Source #

Create a Z3 symbol using a string.

Reference: s/group__capi.html#gafebb0d3c212927cf7834c3a20a84ecae

Sorts

mkUninterpretedSort :: Symbol s -> Z3 s (Sort s) Source #

Create a free (uninterpreted) type using the given name (symbol).

Reference: s/group__capi.html#ga736e88741af1c178cbebf94c49aa42de

mkBvSort :: forall i s. Integral i => i -> Z3 s (Sort s) Source #

Create a bit-vector type of the given size.

This type can also be seen as a machine integer.

Reference: s/group__capi.html#gaeed000a1bbb84b6ca6fdaac6cf0c1688

mkFiniteDomainSort :: Symbol s -> Word64 -> Z3 s (Sort s) Source #

Create a finite domain type.

mkTupleSort Source #

Arguments

:: Symbol s

Name of the sort

-> [(Symbol s, Sort s)]

Name and sort of each field

-> Z3 s (Sort s, FuncDecl s, [FuncDecl s])

Resulting sort, and function declarations for the constructor and projections.

mkConstructor Source #

Arguments

:: Symbol s

Name of the sonstructor

-> Symbol s

Name of recognizer function

-> [(Symbol s, Maybe (Sort s), Int)]

Name, sort option, and sortRefs

-> Z3 s (Constructor s) 

mkDatatype :: Symbol s -> [Constructor s] -> Z3 s (Sort s) Source #

Create datatype, such as lists, trees, records, enumerations or unions of records. The datatype may be recursive. Return the datatype sort.

Reference s/group__capi.html#gab6809d53327d807da9158abdf75df387

mkDatatypes :: [Symbol s] -> [[Constructor s]] -> Z3 s [Sort s] Source #

Create mutually recursive datatypes, such as a tree and forest.

Returns the datatype sorts

Constants and Applications

mkFuncDecl :: Symbol s -> [Sort s] -> Sort s -> Z3 s (FuncDecl s) Source #

A Z3 function

mkApp :: FuncDecl s -> [AST s] -> Z3 s (AST s) Source #

Create a constant or function application.

Reference: s/group__capi.html#ga33a202d86bf628bfab9b6f437536cebe

mkConst :: Symbol s -> Sort s -> Z3 s (AST s) Source #

Declare and create a constant.

Reference: s/group__capi.html#ga093c9703393f33ae282ec5e8729354ef

mkFreshConst :: String -> Sort s -> Z3 s (AST s) Source #

Declare and create a constant.

Reference: s/group__capi.html#ga093c9703393f33ae282ec5e8729354ef

mkFreshFuncDecl :: String -> [Sort s] -> Sort s -> Z3 s (FuncDecl s) Source #

Declare a fresh constant or function.

Reference: s/group__capi.html#ga1f60c7eb41c5603e55a188a14dc929ec

Helpers

mkVar :: Symbol s -> Sort s -> Z3 s (AST s) Source #

Declare and create a variable (aka constant).

An alias for mkConst.

mkBoolVar :: Symbol s -> Z3 s (AST s) Source #

Declarate and create a variable of sort bool.

See mkVar.

mkRealVar :: Symbol s -> Z3 s (AST s) Source #

Declarate and create a variable of sort real.

See mkVar.

mkIntVar :: Symbol s -> Z3 s (AST s) Source #

Declarate and create a variable of sort int.

See mkVar.

mkBvVar Source #

Arguments

:: Symbol s 
-> Int

bit-width

-> Z3 s (AST s) 

Declarate and create a variable of sort bit-vector.

See mkVar.

mkFreshVar :: String -> Sort s -> Z3 s (AST s) Source #

Declare and create a fresh variable (aka constant).

An alias for mkFreshConst.

mkFreshBoolVar :: String -> Z3 s (AST s) Source #

Declarate and create a fresh variable of sort bool.

See mkFreshVar.

mkFreshRealVar :: String -> Z3 s (AST s) Source #

Declarate and create a fresh variable of sort real.

See mkFreshVar.

mkFreshIntVar :: String -> Z3 s (AST s) Source #

Declarate and create a fresh variable of sort int.

See mkFreshVar.

mkFreshBvVar Source #

Arguments

:: String 
-> Int

bit-width

-> Z3 s (AST s) 

Declarate and create a fresh variable of sort bit-vector.

See mkFreshVar.

Propositional Logic and Equality

mkTrue :: Z3 s (AST s) Source #

Create an (AST s) node representing true.

Reference: s/group__capi.html#gae898e7380409bbc57b56cc5205ef1db7

mkFalse :: Z3 s (AST s) Source #

Create an (AST s) node representing false.

Reference: s/group__capi.html#ga5952ac17671117a02001fed6575c778d

mkEq :: AST s -> AST s -> Z3 s (AST s) Source #

Create an (AST s) node representing l = r.

Reference: s/group__capi.html#ga95a19ce675b70e22bb0401f7137af37c

mkNot :: AST s -> Z3 s (AST s) Source #

Create an (AST s) node representing not(a).

Reference: s/group__capi.html#ga3329538091996eb7b3dc677760a61072

mkIte :: AST s -> AST s -> AST s -> Z3 s (AST s) Source #

Create an (AST s) node representing an if-then-else: ite(t1, t2, t3).

Reference: s/group__capi.html#ga94417eed5c36e1ad48bcfc8ad6e83547

mkIff :: AST s -> AST s -> Z3 s (AST s) Source #

Create an (AST s) node representing t1 iff t2.

Reference: s/group__capi.html#ga930a8e844d345fbebc498ac43a696042

mkImplies :: AST s -> AST s -> Z3 s (AST s) Source #

Create an (AST s) node representing t1 implies t2.

Reference: s/group__capi.html#gac829c0e25bbbd30343bf073f7b524517

mkXor :: AST s -> AST s -> Z3 s (AST s) Source #

Create an (AST s) node representing t1 xor t2.

Reference: s/group__capi.html#gacc6d1b848032dec0c4617b594d4229ec

mkAnd :: [AST s] -> Z3 s (AST s) Source #

Create an (AST s) node representing args[0] and ... and args[num_args-1].

Reference: s/group__capi.html#gacde98ce4a8ed1dde50b9669db4838c61

mkOr :: [AST s] -> Z3 s (AST s) Source #

Create an (AST s) node representing args[0] or ... or args[num_args-1].

Reference: s/group__capi.html#ga00866d16331d505620a6c515302021f9

mkDistinct :: NonEmpty (AST s) -> Z3 s (AST s) Source #

The distinct construct is used for declaring the arguments pairwise distinct.

Reference: s/group__capi.html#gaa076d3a668e0ec97d61744403153ecf7

Helpers

mkBool :: Bool -> Z3 s (AST s) Source #

Create an (AST s) node representing the given boolean.

Arithmetic: Integers and Reals

mkAdd :: [AST s] -> Z3 s (AST s) Source #

Create an (AST s) node representing args[0] + ... + args[num_args-1].

Reference: s/group__capi.html#ga4e4ac0a4e53eee0b4b0ef159ed7d0cd5

mkMul :: [AST s] -> Z3 s (AST s) Source #

Create an (AST s) node representing args[0] * ... * args[num_args-1].

Reference: s/group__capi.html#gab9affbf8401a18eea474b59ad4adc890

mkSub :: NonEmpty (AST s) -> Z3 s (AST s) Source #

Create an (AST s) node representing args[0] - ... - args[num_args - 1].

Reference: s/group__capi.html#ga4f5fea9b683f9e674fd8f14d676cc9a9

mkUnaryMinus :: AST s -> Z3 s (AST s) Source #

Create an (AST s) node representing -arg.

Reference: s/group__capi.html#gadcd2929ad732937e25f34277ce4988ea

mkDiv :: AST s -> AST s -> Z3 s (AST s) Source #

Create an (AST s) node representing arg1 div arg2.

Reference: s/group__capi.html#ga1ac60ee8307af8d0b900375914194ff3

mkMod :: AST s -> AST s -> Z3 s (AST s) Source #

Create an (AST s) node representing arg1 mod arg2.

Reference: s/group__capi.html#ga8e350ac77e6b8fe805f57efe196e7713

mkRem :: AST s -> AST s -> Z3 s (AST s) Source #

Create an (AST s) node representing arg1 rem arg2.

Reference: s/group__capi.html#ga2fcdb17f9039bbdaddf8a30d037bd9ff

mkLt :: AST s -> AST s -> Z3 s (AST s) Source #

mkLe :: AST s -> AST s -> Z3 s (AST s) Source #

Create less than or equal to.

Reference: s/group__capi.html#gaa9a33d11096841f4e8c407f1578bc0bf

mkGt :: AST s -> AST s -> Z3 s (AST s) Source #

mkGe :: AST s -> AST s -> Z3 s (AST s) Source #

Create greater than or equal to.

Reference: s/group__capi.html#gad9245cbadb80b192323d01a8360fb942

mkInt2Real :: AST s -> Z3 s (AST s) Source #

Coerce an integer to a real.

Reference: s/group__capi.html#ga7130641e614c7ebafd28ae16a7681a21

mkReal2Int :: AST s -> Z3 s (AST s) Source #

Coerce a real to an integer.

Reference: s/group__capi.html#ga759b6563ba1204aae55289009a3fdc6d

mkIsInt :: AST s -> Z3 s (AST s) Source #

Check if a real number is an integer.

Reference: s/group__capi.html#gaac2ad0fb04e4900fdb4add438d137ad3

Bit-vectors

mkBvredand :: AST s -> Z3 s (AST s) Source #

Take conjunction of bits in vector, return vector of length 1.

Reference: s/group__capi.html#gaccc04f2b58903279b1b3be589b00a7d8

mkBvredor :: AST s -> Z3 s (AST s) Source #

Take disjunction of bits in vector, return vector of length 1.

Reference: s/group__capi.html#gafd18e127c0586abf47ad9cd96895f7d2

mkBvxor :: AST s -> AST s -> Z3 s (AST s) Source #

mkBvneg :: AST s -> Z3 s (AST s) Source #

Standard two's complement unary minus.

Reference: <http://research.microsoft.com/en-us/um/redmond/projects/Z3 s/group__capi.html#ga0c78be00c03eda4ed6a983224ed5c7b7

mkBvadd :: AST s -> AST s -> Z3 s (AST s) Source #

Standard two's complement addition.

Reference: s/group__capi.html#ga819814e33573f3f9948b32fdc5311158

mkBvsub :: AST s -> AST s -> Z3 s (AST s) Source #

Standard two's complement subtraction.

Reference: s/group__capi.html#ga688c9aa1347888c7a51be4e46c19178e

mkBvmul :: AST s -> AST s -> Z3 s (AST s) Source #

Standard two's complement multiplication.

Reference: s/group__capi.html#ga6abd3dde2a1ceff1704cf7221a72258c

mkBvudiv :: AST s -> AST s -> Z3 s (AST s) Source #

mkBvsdiv :: AST s -> AST s -> Z3 s (AST s) Source #

Two's complement signed division.

Reference: s/group__capi.html#gad240fedb2fda1c1005b8e9d3c7f3d5a0

mkBvurem :: AST s -> AST s -> Z3 s (AST s) Source #

mkBvsrem :: AST s -> AST s -> Z3 s (AST s) Source #

Two's complement signed remainder (sign follows dividend).

Reference: s/group__capi.html#ga46c18a3042fca174fe659d3185693db1

mkBvsmod :: AST s -> AST s -> Z3 s (AST s) Source #

Two's complement signed remainder (sign follows divisor).

Reference: s/group__capi.html#ga95dac8e6eecb50f63cb82038560e0879

mkBvult :: AST s -> AST s -> Z3 s (AST s) Source #

mkBvslt :: AST s -> AST s -> Z3 s (AST s) Source #

Two's complement signed less than.

Reference: s/group__capi.html#ga8ce08af4ed1fbdf08d4d6e63d171663a

mkBvule :: AST s -> AST s -> Z3 s (AST s) Source #

Unsigned less than or equal to.

Reference: s/group__capi.html#gab738b89de0410e70c089d3ac9e696e87

mkBvsle :: AST s -> AST s -> Z3 s (AST s) Source #

Two's complement signed less than or equal to.

Reference: s/group__capi.html#gab7c026feb93e7d2eab180e96f1e6255d

mkBvuge :: AST s -> AST s -> Z3 s (AST s) Source #

Unsigned greater than or equal to.

Reference: s/group__capi.html#gade58fbfcf61b67bf8c4a441490d3c4df

mkBvsge :: AST s -> AST s -> Z3 s (AST s) Source #

Two's complement signed greater than or equal to.

Reference: s/group__capi.html#gaeec3414c0e8a90a6aa5a23af36bf6dc5

mkBvugt :: AST s -> AST s -> Z3 s (AST s) Source #

mkBvsgt :: AST s -> AST s -> Z3 s (AST s) Source #

Two's complement signed greater than.

Reference: s/group__capi.html#ga4e93a985aa2a7812c7c11a2c65d7c5f0

mkConcat :: AST s -> AST s -> Z3 s (AST s) Source #

Concatenate the given bit-vectors.

Reference: s/group__capi.html#gae774128fa5e9ff7458a36bd10e6ca0fa

mkExtract :: Int -> Int -> AST s -> Z3 s (AST s) Source #

Extract the bits high down to low from a bitvector of size m to yield a new bitvector of size n, where n = high - low + 1.

Reference: s/group__capi.html#ga32d2fe7563f3e6b114c1b97b205d4317

mkSignExt :: Int -> AST s -> Z3 s (AST s) Source #

Sign-extend of the given bit-vector to the (signed) equivalent bitvector of size m+i, where m is the size of the given bit-vector.

Reference: s/group__capi.html#gad29099270b36d0680bb54b560353c10e

mkZeroExt :: Int -> AST s -> Z3 s (AST s) Source #

Extend the given bit-vector with zeros to the (unsigned) equivalent bitvector of size m+i, where m is the size of the given bit-vector.

Reference: s/group__capi.html#gac9322fae11365a78640baf9078c428b3

mkRepeat :: Int -> AST s -> Z3 s (AST s) Source #

Repeat the given bit-vector up length i.

Reference: s/group__capi.html#ga03e81721502ea225c264d1f556c9119d

mkBvlshr :: AST s -> AST s -> Z3 s (AST s) Source #

mkBvashr :: AST s -> AST s -> Z3 s (AST s) Source #

mkRotateLeft :: Int -> AST s -> Z3 s (AST s) Source #

Rotate bits of t1 to the left i times.

Reference: s/group__capi.html#ga4932b7d08fea079dd903cd857a52dcda

mkRotateRight :: Int -> AST s -> Z3 s (AST s) Source #

Rotate bits of t1 to the right i times.

Reference: s/group__capi.html#ga3b94e1bf87ecd1a1858af8ebc1da4a1c

mkExtRotateLeft :: AST s -> AST s -> Z3 s (AST s) Source #

Rotate bits of t1 to the left t2 times.

Reference: s/group__capi.html#gaf46f1cb80e5a56044591a76e7c89e5e7

mkExtRotateRight :: AST s -> AST s -> Z3 s (AST s) Source #

Rotate bits of t1 to the right t2 times.

Reference: s/group__capi.html#gabb227526c592b523879083f12aab281f

mkInt2bv :: Int -> AST s -> Z3 s (AST s) Source #

Create an n bit bit-vector from the integer argument t1.

Reference: s/group__capi.html#ga35f89eb05df43fbd9cce7200cc1f30b5

mkBv2int :: AST s -> Bool -> Z3 s (AST s) Source #

Create an integer from the bit-vector argument t1. If is_signed is false, then the bit-vector t1 is treated as unsigned. So the result is non-negative and in the range [0..2^N-1], where N are the number of bits in t1. If is_signed is true, t1 is treated as a signed bit-vector.

Reference: s/group__capi.html#gac87b227dc3821d57258d7f53a28323d4

mkBvnegNoOverflow :: AST s -> Z3 s (AST s) Source #

Check that bit-wise negation does not overflow when t1 is interpreted as a signed bit-vector.

Reference: s/group__capi.html#gae9c5d72605ddcd0e76657341eaccb6c7

mkBvaddNoOverflow :: AST s -> AST s -> Bool -> Z3 s (AST s) Source #

Create a predicate that checks that the bit-wise addition of t1 and t2 does not overflow.

Reference: s/group__capi.html#ga88f6b5ec876f05e0d7ba51e96c4b077f

mkBvaddNoUnderflow :: AST s -> AST s -> Z3 s (AST s) Source #

Create a predicate that checks that the bit-wise signed addition of t1 and t2 does not underflow.

Reference: s/group__capi.html#ga1e2b1927cf4e50000c1600d47a152947

mkBvsubNoOverflow :: AST s -> AST s -> Z3 s (AST s) Source #

Create a predicate that checks that the bit-wise signed subtraction of t1 and t2 does not overflow.

Reference: s/group__capi.html#ga785f8127b87e0b42130e6d8f52167d7c

mkBvsubNoUnderflow :: AST s -> AST s -> Z3 s (AST s) Source #

Create a predicate that checks that the bit-wise subtraction of t1 and t2 does not underflow.

Reference: s/group__capi.html#ga6480850f9fa01e14aea936c88ff184c4

mkBvmulNoOverflow :: AST s -> AST s -> Bool -> Z3 s (AST s) Source #

Create a predicate that checks that the bit-wise multiplication of t1 and t2 does not overflow.

Reference: s/group__capi.html#ga86f4415719d295a2f6845c70b3aaa1df

mkBvmulNoUnderflow :: AST s -> AST s -> Z3 s (AST s) Source #

Create a predicate that checks that the bit-wise signed multiplication of t1 and t2 does not underflow.

Reference: s/group__capi.html#ga501ccc01d737aad3ede5699741717fda

mkBvsdivNoOverflow :: AST s -> AST s -> Z3 s (AST s) Source #

Create a predicate that checks that the bit-wise signed division of t1 and t2 does not overflow.

Reference: s/group__capi.html#gaa17e7b2c33dfe2abbd74d390927ae83e

Arrays

mkSelect :: AST s -> AST s -> Z3 s (AST s) Source #

Array read. The argument a is the array and i is the index of the array that gets read.

Reference: s/group__capi.html#ga38f423f3683379e7f597a7fe59eccb67

mkStore :: AST s -> AST s -> AST s -> Z3 s (AST s) Source #

mkConstArray :: Sort s -> AST s -> Z3 s (AST s) Source #

Create the constant array.

Reference: s/group__capi.html#ga84ea6f0c32b99c70033feaa8f00e8f2d

mkMap :: FuncDecl s -> [AST s] -> Z3 s (AST s) Source #

map f on the the argument arrays.

Reference: s/group__capi.html#ga9150242d9430a8c3d55d2ca3b9a4362d

mkArrayDefault :: AST s -> Z3 s (AST s) Source #

Access the array default value. Produces the default range value, for arrays that can be represented as finite maps with a default range value.

Reference: s/group__capi.html#ga78e89cca82f0ab4d5f4e662e5e5fba7d

Sets

mkSetAdd :: AST s -> AST s -> Z3 s (AST s) Source #

mkSetDel :: AST s -> AST s -> Z3 s (AST s) Source #

Remove an element from a set.

Reference: s/group__capi.html#ga80e883f39dd3b88f9d0745c8a5b91d1d

mkSetUnion :: [AST s] -> Z3 s (AST s) Source #

Take the union of a list of sets.

Reference: s/group__capi.html#ga4050162a13d539b8913200963bb4743c

mkSetIntersect :: [AST s] -> Z3 s (AST s) Source #

Take the intersection of a list of sets.

Reference: s/group__capi.html#ga8a8abff0ebe6aeeaa6c919eaa013049d

mkSetDifference :: AST s -> AST s -> Z3 s (AST s) Source #

Take the set difference between two sets.

Reference: s/group__capi.html#gabb49c62f70b8198362e1a29ba6d8bde1

mkSetComplement :: AST s -> Z3 s (AST s) Source #

Take the complement of a set.

Reference: s/group__capi.html#ga5c57143c9229cdf730c5103ff696590f

mkSetMember :: AST s -> AST s -> Z3 s (AST s) Source #

Check for set membership.

Reference: s/group__capi.html#gac6e516f3dce0bdd41095c6d6daf56063

mkSetSubset :: AST s -> AST s -> Z3 s (AST s) Source #

Check if the first set is a subset of the second set.

Reference: s/group__capi.html#ga139c5803af0e86464adc7cedc53e7f3a

Numerals

mkNumeral :: String -> Sort s -> Z3 s (AST s) Source #

Create a numeral of a given sort.

Reference: s/group__capi.html#gac8aca397e32ca33618d8024bff32948c

mkInt :: Int -> Sort s -> Z3 s (AST s) Source #

Create a numeral of an int, bit-vector, or finite-domain sort.

This function can be use to create numerals that fit in a machine integer. It is slightly faster than mkNumeral since it is not necessary to parse a string.

mkReal :: Int -> Int -> Z3 s (AST s) Source #

Create a numeral of sort real.

mkUnsignedInt :: Word -> Sort s -> Z3 s (AST s) Source #

Create a numeral of an int, bit-vector, or finite-domain sort.

This function can be use to create numerals that fit in a machine unsigned integer. It is slightly faster than mkNumeral since it is not necessary to parse a string.

mkInt64 :: Int64 -> Sort s -> Z3 s (AST s) Source #

Create a numeral of an int, bit-vector, or finite-domain sort.

This function can be use to create numerals that fit in a machine 64-bit integer. It is slightly faster than mkNumeral since it is not necessary to parse a string.

mkUnsignedInt64 :: Word64 -> Sort s -> Z3 s (AST s) Source #

Create a numeral of an int, bit-vector, or finite-domain sort.

This function can be use to create numerals that fit in a machine unsigned 64-bit integer. It is slightly faster than mkNumeral since it is not necessary to parse a string.

Helpers

mkIntegral :: forall a s. Integral a => a -> Sort s -> Z3 s (AST s) Source #

Create a numeral of an int, bit-vector, or finite-domain sort.

mkRational :: Rational -> Z3 s (AST s) Source #

Create a numeral of sort real from a Rational.

mkFixed :: forall a s. HasResolution a => Fixed a -> Z3 s (AST s) Source #

Create a numeral of sort real from a Fixed.

mkRealNum :: forall r s. Real r => r -> Z3 s (AST s) Source #

Create a numeral of sort real from a Real.

mkInteger :: Integer -> Z3 s (AST s) Source #

Create a numeral of sort int from an Integer.

mkIntNum :: forall a s. Integral a => a -> Z3 s (AST s) Source #

Create a numeral of sort int from an Integral.

mkBitvector Source #

Arguments

:: Int

bit-width

-> Integer

integer value

-> Z3 s (AST s) 

Create a numeral of sort Bit-vector from an Integer.

mkBvNum Source #

Arguments

:: forall i s. Integral i 
=> Int

bit-width

-> i

integer value

-> Z3 s (AST s) 

Create a numeral of sort Bit-vector from an Integral.

Quantifiers

mkPattern :: [AST s] -> Z3 s (Pattern s) Source #

mkBound :: Int -> Sort s -> Z3 s (AST s) Source #

mkForall :: [Pattern s] -> [Symbol s] -> [Sort s] -> AST s -> Z3 s (AST s) Source #

mkExists :: [Pattern s] -> [Symbol s] -> [Sort s] -> AST s -> Z3 s (AST s) Source #

mkForallConst :: [Pattern s] -> [App s] -> AST s -> Z3 s (AST s) Source #

mkExistsConst :: [Pattern s] -> [App s] -> AST s -> Z3 s (AST s) Source #

Accessors

getBvSortSize :: Sort s -> Z3 s Int Source #

Return the size of the given bit-vector sort.

Reference: s/group__capi.html#ga8fc3550edace7bc046e16d1f96ddb419

getDatatypeSortConstructors Source #

Arguments

:: Sort s

Datatype sort.

-> Z3 s [FuncDecl s]

(Constructor s) declarations.

Get list of constructors for datatype.

getDatatypeSortRecognizers Source #

Arguments

:: Sort s

Datatype sort.

-> Z3 s [FuncDecl s]

(Constructor s) recognizers.

Get list of recognizers for datatype.

getDatatypeSortConstructorAccessors Source #

Arguments

:: Sort s

Datatype sort.

-> Z3 s [[FuncDecl s]]

(Constructor s) recognizers.

Get list of accessors for datatype.

getDeclName :: FuncDecl s -> Z3 s (Symbol s) Source #

Return the constant declaration name as a symbol.

Reference: s/group__capi.html#ga741b1bf11cb92aa2ec9ef2fef73ff129

getArity :: FuncDecl s -> Z3 s Int Source #

Returns the number of parameters of the given declaration

getDomain Source #

Arguments

:: FuncDecl s

A function declaration

-> Int

i

-> Z3 s (Sort s) 

Returns the sort of the i-th parameter of the given function declaration

getRange :: FuncDecl s -> Z3 s (Sort s) Source #

Returns the range of the given declaration.

appToAst :: App s -> Z3 s (AST s) Source #

Convert an app into (AST s). This is just type casting.

getAppDecl :: App s -> Z3 s (FuncDecl s) Source #

Return the declaration of a constant or function application.

getAppNumArgs :: App s -> Z3 s Int Source #

Return the number of argument of an application. If t is an constant, then the number of arguments is 0.

getAppArg :: App s -> Int -> Z3 s (AST s) Source #

Return the i-th argument of the given application.

getAppArgs :: App s -> Z3 s [AST s] Source #

Return a list of all the arguments of the given application.

getSort :: AST s -> Z3 s (Sort s) Source #

Return the sort of an (AST s) node.

getBoolValue :: AST s -> Z3 s (Maybe Bool) Source #

Returns Just True, Just False, or Nothing for undefined.

Reference: s/group__capi.html#ga133aaa1ec31af9b570ed7627a3c8c5a4

getAstKind :: AST s -> Z3 s ASTKind Source #

Return the kind of the given (AST s).

Reference: s/group__capi.html#ga4c43608feea4cae363ef9c520c239a5c

isApp :: AST s -> Z3 s Bool Source #

Return True if an ast is APP_AST, False otherwise.

toApp :: AST s -> Z3 s (App s) Source #

Cast (AST s) into an (App s).

getNumeralString :: AST s -> Z3 s String Source #

Return numeral value, as a string of a numeric constant term.

simplify :: AST s -> Z3 s (AST s) Source #

simplifyEx :: AST s -> Params s -> Z3 s (AST s) Source #

Simplify the expression using the given parameters.

Reference: s/group__capi.html#ga34329d4c83ca8c98e18b2884b679008c

Helpers

getBool :: AST s -> Z3 s Bool Source #

Read a Bool value from an '(AST s)'

getInt :: AST s -> Z3 s Integer Source #

Return the integer value

getReal :: AST s -> Z3 s Rational Source #

Return rational value

getBv Source #

Arguments

:: AST s 
-> Bool

signed?

-> Z3 s Integer 

Read the Integer value from an '(AST s)' of sort bit-vector.

See mkBv2int.

Modifiers

substituteVars :: AST s -> [AST s] -> Z3 s (AST s) Source #

Models

modelEval Source #

Arguments

:: Model s 
-> AST s 
-> Bool

(Model s) completion?

-> Z3 s (Maybe (AST s)) 

Evaluate an (AST s) node in the given model.

The evaluation may fail for the following reasons:

  • t contains a quantifier.
  • the model m is partial.
  • t is type incorrect.

evalArray :: Model s -> AST s -> Z3 s (Maybe FuncModel) Source #

Get array as a list of argument/value pairs, if it is represented as a function (ie, using as-array).

getFuncInterp :: Model s -> FuncDecl s -> Z3 s (Maybe (FuncInterp s)) Source #

Return the interpretation of the function f in the model m. Return NULL, if the model does not assign an interpretation for f. That should be interpreted as: the f does not matter.

Reference: s/group__capi.html#gafb9cc5eca9564d8a849c154c5a4a8633

isAsArray :: AST s -> Z3 s Bool Source #

The (_ as-array f) (AST s) node is a construct for assigning interpretations for arrays in Z3. It is the array such that forall indices i we have that (select (_ as-array f) i) is equal to (f i). This procedure returns Z3_TRUE if the a is an as-array (AST s) node.

Reference: s/group__capi.html#ga4674da67d226bfb16861829b9f129cfa

addConstInterp :: Model s -> FuncDecl s -> AST s -> Z3 s () Source #

getAsArrayFuncDecl :: AST s -> Z3 s (FuncDecl s) Source #

Return the function declaration f associated with a (_ as_array f) node.

Reference: s/group__capi.html#ga7d9262dc6e79f2aeb23fd4a383589dda

funcInterpGetNumEntries :: FuncInterp s -> Z3 s Int Source #

Return the number of entries in the given function interpretation.

Reference: s/group__capi.html#ga2bab9ae1444940e7593729beec279844

funcInterpGetEntry :: FuncInterp s -> Int -> Z3 s (FuncEntry s) Source #

Return a "point" of the given function intepretation. It represents the value of f in a particular point.

Reference: s/group__capi.html#gaf157e1e1cd8c0cfe6a21be6370f659da

funcInterpGetElse :: FuncInterp s -> Z3 s (AST s) Source #

Return the 'else' value of the given function interpretation.

Reference: s/group__capi.html#ga46de7559826ba71b8488d727cba1fb64

funcInterpGetArity :: FuncInterp s -> Z3 s Int Source #

Return the arity (number of arguments) of the given function interpretation.

Reference: s/group__capi.html#gaca22cbdb6f7787aaae5d814f2ab383d8

funcEntryGetValue :: FuncEntry s -> Z3 s (AST s) Source #

Return the value of this point.

Reference: s/group__capi.html#ga9fd65e2ab039aa8e40608c2ecf7084da

funcEntryGetNumArgs :: FuncEntry s -> Z3 s Int Source #

Return the number of arguments in a Z3_func_entry object.

Reference: s/group__capi.html#ga51aed8c5bc4b1f53f0c371312de3ce1a

funcEntryGetArg :: FuncEntry s -> Int -> Z3 s (AST s) Source #

Return an argument of a Z3_func_entry object.

Reference: s/group__capi.html#ga6fe03fe3c824fceb52766a4d8c2cbeab

modelToString :: Model s -> Z3 s String Source #

Convert the given model into a string.

Helpers

type EvalAst s a = Model s -> AST s -> Z3 s (Maybe a) Source #

Type of an evaluation function for '(AST s)'.

Evaluation may fail (i.e. return Nothing) for a few reasons, see modelEval.

eval :: EvalAst s (AST s) Source #

An alias for modelEval with model completion enabled.

evalBool :: EvalAst s Bool Source #

Evaluate an (AST s) node of sort bool in the given model.

See modelEval and getBool.

evalInt :: EvalAst s Integer Source #

Evaluate an (AST s) node of sort int in the given model.

See modelEval and getInt.

evalReal :: EvalAst s Rational Source #

Evaluate an (AST s) node of sort real in the given model.

See modelEval and getReal.

evalBv Source #

Arguments

:: Bool

signed?

-> EvalAst s Integer 

Evaluate an (AST s) node of sort bit-vector in the given model.

The flag signed decides whether the bit-vector value is interpreted as a signed or unsigned integer.

See modelEval and getBv.

evalT :: forall t s. Traversable t => Model s -> t (AST s) -> Z3 s (Maybe (t (AST s))) Source #

Evaluate a collection of (AST s) nodes in the given model.

mapEval :: Traversable t => EvalAst s a -> Model s -> t (AST s) -> Z3 s (Maybe (t a)) Source #

Run a evaluation function on a Traversable data structure of '(AST s)'s (e.g. [(AST s)], Vector (AST s), Maybe (AST s), etc).

This a generic version of evalT which can be used in combination with other helpers. For instance, mapEval evalInt can be used to obtain the Integer interpretation of a list of '(AST s)' of sort int.

data FuncModel #

The interpretation of a function.

Constructors

FuncModel 

Fields

evalFunc :: Model s -> FuncDecl s -> Z3 s (Maybe FuncModel) Source #

Get function as a list of argument/value pairs.

Tactics

mkTactic :: String -> Z3 s (Tactic s) Source #

andThenTactic :: Tactic s -> Tactic s -> Z3 s (Tactic s) Source #

orElseTactic :: Tactic s -> Tactic s -> Z3 s (Tactic s) Source #

skipTactic :: Z3 s (Tactic s) Source #

tryForTactic :: Tactic s -> Int -> Z3 s (Tactic s) Source #

applyTactic :: Tactic s -> Goal s -> Z3 s (ApplyResult s) Source #

getApplyResultNumSubgoals :: ApplyResult s -> Z3 s Int Source #

getApplyResultSubgoal :: ApplyResult s -> Int -> Z3 s (Goal s) Source #

getApplyResultSubgoals :: ApplyResult s -> Z3 s [Goal s] Source #

mkGoal :: Bool -> Bool -> Bool -> Z3 s (Goal s) Source #

goalAssert :: Goal s -> AST s -> Z3 s () Source #

getGoalSize :: Goal s -> Z3 s Int Source #

getGoalFormula :: Goal s -> Int -> Z3 s (AST s) Source #

getGoalFormulas :: Goal s -> Z3 s [AST s] Source #

String Conversion

data ASTPrintMode #

Pretty-printing mode for converting ASTs to strings. The mode can be one of the following:

  • Z3_PRINT_SMTLIB_FULL: Print AST nodes in SMTLIB verbose format.
  • Z3_PRINT_LOW_LEVEL: Print AST nodes using a low-level format.
  • Z3_PRINT_SMTLIB_COMPLIANT: Print AST nodes in SMTLIB 1.x compliant format.
  • Z3_PRINT_SMTLIB2_COMPLIANT: Print AST nodes in SMTLIB 2.x compliant format.

setASTPrintMode :: ASTPrintMode -> Z3 s () Source #

Set the mode for converting expressions to strings.

astToString :: AST s -> Z3 s String Source #

Convert an (AST s) to a string.

patternToString :: Pattern s -> Z3 s String Source #

Convert a pattern to a string.

sortToString :: Sort s -> Z3 s String Source #

Convert a sort to a string.

funcDeclToString :: FuncDecl s -> Z3 s String Source #

Convert a (FuncDecl s) to a string.

benchmarkToSMTLibString Source #

Arguments

:: String

name

-> String

logic

-> String

status

-> String

attributes

-> [AST s]

assumptions1

-> AST s

formula

-> Z3 s String 

Convert the given benchmark into SMT-LIB formatted string.

The output format can be configured via setASTPrintMode.

Parser interface

parseSMTLib2String Source #

Arguments

:: String

string to parse

-> [Symbol s]

sort names

-> [Sort s]

sorts

-> [Symbol s]

declaration names

-> [FuncDecl s]

declarations

-> Z3 s (AST s) 

Parse SMT expressions from a string

The sort and declaration arguments allow parsing in a context in which variables and functions have already been declared. They are almost never used.

parseSMTLib2File Source #

Arguments

:: String

string to parse

-> [Symbol s]

sort names

-> [Sort s]

sorts

-> [Symbol s]

declaration names

-> [FuncDecl s]

declarations

-> Z3 s (AST s) 

Parse SMT expressions from a file

The sort and declaration arguments allow parsing in a context in which variables and functions have already been declared. They are almost never used.

Error Handling

data Z3Error #

Z3 exceptions.

Z3 errors are re-thrown as Haskell Z3Error exceptions, see Exception.

Constructors

Z3Error 

Instances

Instances details
Show Z3Error 
Instance details

Defined in Z3.Base

Exception Z3Error 
Instance details

Defined in Z3.Base

Miscellaneous

data Version #

Constructors

Version 

Fields

Instances

Instances details
Eq Version 
Instance details

Defined in Z3.Base

Methods

(==) :: Version -> Version -> Bool #

(/=) :: Version -> Version -> Bool #

Ord Version 
Instance details

Defined in Z3.Base

Show Version 
Instance details

Defined in Z3.Base

getVersion :: Z3 s Version Source #

Return Z3 version number information.

Fixedpoint

data Fixedpoint s Source #

Instances

Instances details
Eq (Fixedpoint s) Source # 
Instance details

Defined in Z3.Tagged

Methods

(==) :: Fixedpoint s -> Fixedpoint s -> Bool #

(/=) :: Fixedpoint s -> Fixedpoint s -> Bool #

Solvers

solverGetHelp :: Z3 s String Source #

Return a string describing all solver available parameters.

solverSetParams :: Params s -> Z3 s () Source #

Set the solver using the given parameters.

solverPush :: Z3 s () Source #

Create a backtracking point.

solverPop :: Int -> Z3 s () Source #

Backtrack n backtracking points.

solverGetNumScopes :: Z3 s Int Source #

Number of backtracking points.

solverAssertCnstr :: AST s -> Z3 s () Source #

Assert a constraing into the logical context.

Reference: s/group__capi.html#ga1a05ff73a564ae7256a2257048a4680a

solverAssertAndTrack :: AST s -> AST s -> Z3 s () Source #

Assert a constraint a into the solver, and track it (in the unsat) core using the Boolean constant p.

This API is an alternative to Z3_solver_check_assumptions for extracting unsat cores. Both APIs can be used in the same solver. The unsat core will contain a combination of the Boolean variables provided using Z3_solver_assert_and_track and the Boolean literals provided using Z3_solver_check_assumptions.

solverCheck :: Z3 s Result Source #

Check whether the assertions in a given solver are consistent or not.

solverCheckAssumptions :: [AST s] -> Z3 s Result Source #

Check whether the assertions in the given solver and optional assumptions are consistent or not.

solverGetModel :: Z3 s (Model s) Source #

Retrieve the model for the last solverCheck.

The error handler is invoked if a model is not available because the commands above were not invoked for the given solver, or if the result was Unsat.

solverGetUnsatCore :: Z3 s [AST s] Source #

Retrieve the unsat core for the last solverCheckAssumptions; the unsat core is a subset of the assumptions

solverGetReasonUnknown :: Z3 s String Source #

Return a brief justification for an Unknown result for the commands solverCheck and solverCheckAssumptions.

solverToString :: Z3 s String Source #

Convert the given solver into a string.

Helpers

assert :: AST s -> Z3 s () Source #

check :: Z3 s Result Source #

Check whether the given logical context is consistent or not.

checkAssumptions :: [AST s] -> Z3 s Result Source #

Check whether the assertions in the given solver and optional assumptions are consistent or not.

withModel :: (Model s -> Z3 s a) -> Z3 s (Result, Maybe a) Source #

Check satisfiability and, if sat, compute a value from the given model.

E.g. withModel $ \m -> fromJust <$> evalInt m x

getUnsatCore :: Z3 s [AST s] Source #

Retrieve the unsat core for the last checkAssumptions; the unsat core is a subset of the assumptions.

push :: Z3 s () Source #

Create a backtracking point.

For push; m; pop 1 see local.

pop :: Int -> Z3 s () Source #

Backtrack n backtracking points.

Contrary to solverPop this funtion checks whether n is within the size of the solver scope stack.

local :: Z3 s a -> Z3 s a Source #

Run a query and restore the initial logical context.

This is a shorthand for push, run the query, and pop.

reset :: Z3 s () Source #

Backtrack all the way.

getNumScopes :: Z3 s Int Source #

Get number of backtracking points.