Copyright | (c) Iago Abal, 2012-2013 (c) David Castro, 2012-2013 |
---|---|
License | BSD3 |
Maintainer | Iago Abal <iago.abal@gmail.com>, David Castro <david.castro.dcp@gmail.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell98 |
- data Z3 a
- data Result
- evalZ3 :: Z3 a -> IO a
- data Args = Args {}
- stdArgs :: Args
- data Logic
- evalZ3With :: Args -> Z3 a -> IO a
- var :: IsTy a => Z3 (Expr a)
- namedVar :: IsTy a => String -> Z3 (Expr a)
- fun1 :: (IsTy a, IsTy b) => Z3 (Expr a -> Expr b)
- fun2 :: (IsTy a, IsTy b, IsTy c) => Z3 (Expr a -> Expr b -> Expr c)
- fun3 :: (IsTy a, IsTy b, IsTy c, IsTy d) => Z3 (Expr a -> Expr b -> Expr c -> Expr d)
- fun4 :: (IsTy a, IsTy b, IsTy c, IsTy d, IsTy e) => Z3 (Expr a -> Expr b -> Expr c -> Expr d -> Expr e)
- fun5 :: (IsTy a, IsTy b, IsTy c, IsTy d, IsTy e, IsTy f) => Z3 (Expr a -> Expr b -> Expr c -> Expr d -> Expr e -> Expr f)
- assert :: Expr Bool -> Z3 ()
- let_ :: IsTy a => Expr a -> Z3 (Expr a)
- check :: MonadZ3 z3 => z3 Result
- showContext :: MonadZ3 z3 => z3 String
- exprToString :: Compilable (Expr a) => Expr a -> Z3 String
- push :: MonadZ3 z3 => z3 ()
- pop :: MonadZ3 z3 => Int -> z3 ()
- data Model a
- checkModel :: Model a -> Z3 (Maybe a)
- checkModelWith :: (Result -> Maybe a -> b) -> Model a -> Z3 b
- checkModelWithResult :: Model a -> Z3 (Result, Maybe a)
- showModel :: Model String
- eval :: forall a. IsTy a => Expr a -> Model a
- evalT :: (IsTy a, Traversable t) => t (Expr a) -> Model (t a)
- data Expr :: * -> *
- data Pattern where
- class (Eq a, Show a, Typeable a, Compilable (Expr a)) => IsTy a
- class (IsTy a, Num a) => IsNum a
- class (IsNum a, Integral a) => IsInt a
- class (IsNum a, Fractional a, Real a) => IsReal a
- class (IsTy a, IsTy b) => Castable a b
- literal :: IsTy a => a -> Expr a
- true :: Expr Bool
- false :: Expr Bool
- not_ :: Expr Bool -> Expr Bool
- and_ :: [Expr Bool] -> Expr Bool
- (&&*) :: Expr Bool -> Expr Bool -> Expr Bool
- or_ :: [Expr Bool] -> Expr Bool
- (||*) :: Expr Bool -> Expr Bool -> Expr Bool
- distinct :: IsTy a => [Expr a] -> Expr Bool
- xor :: Expr Bool -> Expr Bool -> Expr Bool
- implies :: Expr Bool -> Expr Bool -> Expr Bool
- (==>) :: Expr Bool -> Expr Bool -> Expr Bool
- iff :: Expr Bool -> Expr Bool -> Expr Bool
- (<=>) :: Expr Bool -> Expr Bool -> Expr Bool
- forall :: QExpr t => t -> Expr Bool
- exists :: QExpr t => t -> Expr Bool
- instanceWhen :: Expr Bool -> [Pattern] -> QBody
- (//) :: IsInt a => Expr a -> Expr a -> Expr a
- (%*) :: IsInt a => Expr a -> Expr a -> Expr a
- (%%) :: IsInt a => Expr a -> Expr a -> Expr a
- divides :: IsInt a => Expr a -> Expr a -> Expr Bool
- (==*) :: IsTy a => Expr a -> Expr a -> Expr Bool
- (/=*) :: IsTy a => Expr a -> Expr a -> Expr Bool
- (<=*) :: IsNum a => Expr a -> Expr a -> Expr Bool
- (<*) :: IsNum a => Expr a -> Expr a -> Expr Bool
- (>=*) :: IsNum a => Expr a -> Expr a -> Expr Bool
- (>*) :: IsNum a => Expr a -> Expr a -> Expr Bool
- min_ :: IsNum a => Expr a -> Expr a -> Expr a
- max_ :: IsNum a => Expr a -> Expr a -> Expr a
- ite :: IsTy a => Expr Bool -> Expr a -> Expr a -> Expr a
- cast :: (IsTy a, IsTy b, Castable a b) => Expr a -> Expr b
Z3 script
Args | |
|
Warning: New Z3 API support is still incomplete and fragile: you may experience segmentation faults!
Solvers available in Z3.
These are described at http://smtlib.cs.uiowa.edu/logics.html
WARNING: Support for solvers is fragile, you may experience segmentation faults!
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. |
evalZ3With :: Args -> Z3 a -> IO a Source
Eval a Z3 script.
Commands
namedVar :: IsTy a => String -> Z3 (Expr a) Source
Declare skolem variables with a user specified name.
fun2 :: (IsTy a, IsTy b, IsTy c) => Z3 (Expr a -> Expr b -> Expr c) Source
Declare uninterpreted function of arity 2.
fun3 :: (IsTy a, IsTy b, IsTy c, IsTy d) => Z3 (Expr a -> Expr b -> Expr c -> Expr d) Source
Declare uninterpreted function of arity 3.
fun4 :: (IsTy a, IsTy b, IsTy c, IsTy d, IsTy e) => Z3 (Expr a -> Expr b -> Expr c -> Expr d -> Expr e) Source
Declare uninterpreted function of arity 4.
fun5 :: (IsTy a, IsTy b, IsTy c, IsTy d, IsTy e, IsTy f) => Z3 (Expr a -> Expr b -> Expr c -> Expr d -> Expr e -> Expr f) Source
Declare uninterpreted function of arity 5.
let_ :: IsTy a => Expr a -> Z3 (Expr a) Source
Introduce an auxiliary declaration to name a given expression.
If you really want sharing use this instead of Haskell's let.
check :: MonadZ3 z3 => z3 Result Source
Check whether the given logical context is consistent or not.
showContext :: MonadZ3 z3 => z3 String Source
Convert Z3's logical context into a string.
Models
checkModel :: Model a -> Z3 (Maybe a) Source
Check satisfiability and evaluate a model if some exists.
checkModelWith :: (Result -> Maybe a -> b) -> Model a -> Z3 b Source
Check satisfiability and evaluate a model if some exists.
checkModelWithResult :: Model a -> Z3 (Result, Maybe a) Source
Check satisfiability and evaluate a model if some exists, also
returning a Result
to the reason for any failure.
evalT :: (IsTy a, Traversable t) => t (Expr a) -> Model (t a) Source
Evaluate a collection of expressions within a model.
Expressions
Expressions.
class (Eq a, Show a, Typeable a, Compilable (Expr a)) => IsTy a Source
Types for expressions.
typeInv, tc, mkSort, mkLiteral, getValue
class (IsNum a, Fractional a, Real a) => IsReal a Source
Typeclass for Haskell Z3 numbers of real sort in Z3.
instanceWhen :: Expr Bool -> [Pattern] -> QBody Source
Pattern-based instantiation.