{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Z3.Base (
Config
, Context
, Symbol
, AST
, Sort
, TupleType(..)
, FuncDecl
, App
, Pattern
, Constructor
, Model
, FuncInterp
, FuncEntry
, Params
, Solver
, SortKind(..)
, ASTKind(..)
, Tactic
, ApplyResult
, Goal
, Result(..)
, algebraicIsValue
, algebraicIsPos
, algebraicIsNeg
, algebraicIsZero
, algebraicSign
, algebraicAdd
, algebraicSub
, algebraicMul
, algebraicDiv
, algebraicRoot
, algebraicPower
, algebraicLt
, algebraicGt
, algebraicLe
, algebraicGe
, algebraicEq
, algebraicNeq
, algebraicRoots
, algebraicEval
, globalParamSet
, globalParamResetAll
, globalParamGet
, mkConfig
, delConfig
, setParamValue
, withConfig
, mkContext
, withContext
, mkParams
, paramsSetBool
, paramsSetUInt
, paramsSetDouble
, paramsSetSymbol
, paramsToString
, mkIntSymbol
, mkStringSymbol
, mkUninterpretedSort
, mkBoolSort
, mkIntSort
, mkRealSort
, mkBvSort
, mkFiniteDomainSort
, mkArraySort
, mkArraySortN
, mkTupleSort
, mkTupleType
, mkTuple
, mkIndexTuple
, mkProjTuple
, mkEnumerationSort
, mkListSort
, mkConstructor
, mkDatatype
, mkDatatypes
, mkSetSort
, mkFuncDecl
, mkApp
, mkConst
, mkFreshFuncDecl
, mkFreshConst
, mkRecFuncDecl
, addRecDef
, mkVar
, mkBoolVar
, mkRealVar
, mkIntVar
, mkBvVar
, mkFreshVar
, mkFreshBoolVar
, mkFreshRealVar
, mkFreshIntVar
, mkFreshBvVar
, mkTrue
, mkFalse
, mkEq
, mkNot
, mkIte
, mkIff
, mkImplies
, mkXor
, mkAnd
, mkOr
, mkDistinct
, mkDistinct1
, mkBool
, mkAdd
, mkMul
, mkSub
, mkSub1
, mkUnaryMinus
, mkDiv
, mkMod
, mkRem
, mkPower
, mkLt
, mkLe
, mkGt
, mkGe
, mkInt2Real
, mkReal2Int
, mkIsInt
, mkBvnot
, mkBvredand
, mkBvredor
, mkBvand
, mkBvor
, mkBvxor
, mkBvnand
, mkBvnor
, mkBvxnor
, mkBvneg
, mkBvadd
, mkBvsub
, mkBvmul
, mkBvudiv
, mkBvsdiv
, mkBvurem
, mkBvsrem
, mkBvsmod
, mkBvult
, mkBvslt
, mkBvule
, mkBvsle
, mkBvuge
, mkBvsge
, mkBvugt
, mkBvsgt
, mkConcat
, mkExtract
, mkSignExt
, mkZeroExt
, mkRepeat
, mkBvshl
, mkBvlshr
, mkBvashr
, mkRotateLeft
, mkRotateRight
, mkExtRotateLeft
, mkExtRotateRight
, mkInt2bv
, mkBv2int
, mkBvnegNoOverflow
, mkBvaddNoOverflow
, mkBvaddNoUnderflow
, mkBvsubNoOverflow
, mkBvsubNoUnderflow
, mkBvmulNoOverflow
, mkBvmulNoUnderflow
, mkBvsdivNoOverflow
, mkSelect
, mkStore
, mkConstArray
, mkMap
, mkArrayDefault
, mkEmptySet
, mkFullSet
, mkSetAdd
, mkSetDel
, mkSetUnion
, mkSetIntersect
, mkSetDifference
, mkSetComplement
, mkSetMember
, mkSetSubset
, mkNumeral
, mkReal
, mkInt
, mkUnsignedInt
, mkInt64
, mkUnsignedInt64
, mkIntegral
, mkRational
, mkFixed
, mkRealNum
, mkInteger
, mkIntNum
, mkBitvector
, mkBvNum
, mkSeqSort
, isSeqSort
, mkReSort
, isReSort
, mkStringSort
, isStringSort
, mkString
, isString
, getString
, mkSeqEmpty
, mkSeqUnit
, mkSeqConcat
, mkSeqPrefix
, mkSeqSuffix
, mkSeqContains
, mkStrLt
, mkStrLe
, mkSeqExtract
, mkSeqReplace
, mkSeqAt
, mkSeqLength
, mkSeqIndex
, mkStrToInt
, mkIntToStr
, mkSeqToRe
, mkSeqInRe
, mkRePlus
, mkReStar
, mkReOption
, mkReUnion
, mkReConcat
, mkReRange
, mkReLoop
, mkReIntersect
, mkReComplement
, mkReEmpty
, mkReFull
, mkPattern
, mkBound
, mkForall
, mkForallW
, mkExists
, mkExistsW
, mkForallConst
, mkForallWConst
, mkExistsConst
, mkExistsWConst
, getSymbolString
, isEqSort
, getSortName
, sortToAst
, getSortId
, getSortKind
, getBvSortSize
, getFiniteDomainSortSize
, getTupleSortMkDecl
, getTupleSortNumFields
, getTupleSortFieldDecl
, getDatatypeSortConstructors
, getDatatypeSortRecognizers
, getDatatypeSortConstructorAccessors
, mkAtMost
, mkAtLeast
, getDeclName
, getArity
, getDomain
, getRange
, getDeclNumParameters
, appToAst
, getAppDecl
, getAppNumArgs
, getAppArg
, getAppArgs
, getSort
, isWellSorted
, getArraySortDomain
, getArraySortRange
, getBoolValue
, getAstKind
, isApp
, toApp
, getNumeralString
, getNumerator
, getDenominator
, simplify
, simplifyEx
, getIndexValue
, isQuantifierForall
, isQuantifierExists
, getQuantifierWeight
, getQuantifierNumPatterns
, getQuantifierPatternAST
, getQuantifierPatterns
, getQuantifierNumNoPatterns
, getQuantifierNoPatternAST
, getQuantifierNoPatterns
, getQuantifierNumBound
, getQuantifierBoundName
, getQuantifierBoundSort
, getQuantifierBoundVars
, getQuantifierBody
, getBool
, getInt
, getReal
, substituteVars
, substitute
, modelTranslate
, modelEval
, evalArray
, getConstInterp
, getFuncInterp
, hasInterp
, numConsts
, numFuncs
, getConstDecl
, getFuncDecl
, getConsts
, getFuncs
, isAsArray
, isEqAST
, addFuncInterp
, addConstInterp
, getAsArrayFuncDecl
, funcInterpGetNumEntries
, funcInterpGetEntry
, funcInterpGetElse
, funcInterpGetArity
, funcEntryGetValue
, funcEntryGetNumArgs
, funcEntryGetArg
, modelToString
, showModel
, EvalAst
, eval
, evalBool
, evalInt
, evalReal
, evalBv
, mapEval
, evalT
, FuncModel (..)
, evalFunc
, mkTactic
, andThenTactic
, orElseTactic
, skipTactic
, tryForTactic
, tacticUsingParams
, repeatTactic
, mkQuantifierEliminationTactic
, mkAndInverterGraphTactic
, applyTactic
, applyResultToString
, getApplyResultNumSubgoals
, getApplyResultSubgoal
, getApplyResultSubgoals
, mkGoal
, goalAssert
, getGoalSize
, getGoalFormula
, getGoalFormulas
, goalToString
, convertModel
, ASTPrintMode(..)
, setASTPrintMode
, astToString
, patternToString
, sortToString
, funcDeclToString
, benchmarkToSMTLibString
, parseSMTLib2String
, parseSMTLib2File
, evalSMTLib2String
, Z3Error(..)
, Z3ErrorCode(..)
, Version(..)
, getVersion
, Fixedpoint (..)
, mkFixedpoint
, fixedpointAddRule
, fixedpointSetParams
, fixedpointRegisterRelation
, fixedpointQueryRelations
, fixedpointGetAnswer
, fixedpointGetAssertions
, mkFpaRoundingModeSort
, mkFpaRoundNearestTiesToEven
, mkFpaRne
, mkFpaRoundNearestTiesToAway
, mkFpaRna
, mkFpaRoundTowardPositive
, mkFpaRtp
, mkFpaRoundTowardNegative
, mkFpaRtn
, mkFpaRoundTowardZero
, mkFpaRtz
, mkFpaSort
, mkFpaSortHalf
, mkFpaSort16
, mkFpaSortSingle
, mkFpaSort32
, mkFpaSortDouble
, mkFpaSort64
, mkFpaSortQuadruple
, mkFpaSort128
, mkFpaNaN
, mkFpaInf
, mkFpaZero
, mkFpaFp
, mkFpaNumeralFloat
, mkFpaNumeralDouble
, mkFpaNumeralInt
, mkFpaNumeralIntUInt
, mkFpaNumeralInt64UInt64
, mkFpaAbs
, mkFpaNeg
, mkFpaAdd
, mkFpaSub
, mkFpaMul
, mkFpaDiv
, mkFpaFma
, mkFpaSqrt
, mkFpaRem
, mkFpaRoundToIntegral
, mkFpaMin
, mkFpaMax
, mkFpaLeq
, mkFpaLt
, mkFpaGeq
, mkFpaGt
, mkFpaEq
, mkFpaIsNormal
, mkFpaIsSubnormal
, mkFpaIsZero
, mkFpaIsInfinite
, mkFpaIsNaN
, mkFpaIsNegative
, mkFpaIsPositive
, mkFpaToFpBv
, mkFpaToFpFloat
, mkFpaToFpReal
, mkFpaToFpSigned
, mkFpaToFpUnsigned
, mkFpaToUbv
, mkFpaToSbv
, mkFpaToReal
, fpaGetEbits
, fpaGetSbits
, fpaIsNumeralNaN
, fpaIsNumeralInf
, fpaIsNumeralZero
, fpaIsNumeralNormal
, fpaIsNumeralSubnormal
, fpaIsNumeralPositive
, fpaIsNumeralNegative
, fpaGetNumeralSignBv
, fpaGetNumeralSignificandBv
, fpaGetNumeralSignificandString
, fpaGetNumeralExponentString
, fpaGetNumeralExponentBv
, mkFpaToIEEEBv
, mkFpaToFpIntReal
, Optimize (..)
, mkOptimize
, optimizeAssert
, optimizeAssertAndTrack
, optimizeAssertSoft
, optimizeMaximize
, optimizeMinimize
, optimizePush
, optimizePop
, optimizeCheck
, optimizeGetReasonUnknown
, optimizeGetModel
, optimizeGetUnsatCore
, optimizeSetParams
, optimizeGetLower
, optimizeGetUpper
, optimizeGetUpperAsVector
, optimizeGetLowerAsVector
, optimizeToString
, optimizeFromString
, optimizeFromFile
, optimizeGetHelp
, optimizeGetAssertions
, optimizeGetObjectives
, Logic(..)
, mkSolver
, mkSimpleSolver
, mkSolverForLogic
, solverGetHelp
, solverSetParams
, solverPush
, solverPop
, solverReset
, solverGetNumScopes
, solverAssertCnstr
, solverAssertAndTrack
, solverFromFile
, solverFromString
, solverGetAssertions
, solverCheck
, solverCheckAssumptions
, solverGetModel
, solverGetProof
, solverGetUnsatCore
, solverGetReasonUnknown
, solverToString
, solverCheckAndGetModel
) where
import Z3.Base.C
import Z3.Common
import Z3.RLock ( RLock, new, with)
import Control.Applicative ( (<$>), (<*>), (<*), pure )
import Control.Exception ( Exception, bracket, throw )
import Control.Monad ( join, when, forM )
import Data.Fixed ( Fixed, HasResolution )
import Data.Foldable ( Foldable (..) )
import Data.Int
import Data.IORef ( IORef, newIORef, atomicModifyIORef' )
import Data.List.NonEmpty (NonEmpty (..), nonEmpty)
import Data.Maybe ( fromJust )
import Data.Ratio ( numerator, denominator, (%) )
import Data.Traversable ( Traversable )
import qualified Data.Traversable as T
import Data.Typeable ( Typeable )
import Data.Word
import Foreign hiding ( toBool, newForeignPtr )
import Foreign.Storable ( peek )
import Foreign.C
( CFloat, CDouble, CInt, CUInt, CLong, CULong, CLLong, CULLong, CString
, peekCString
, withCString )
import Foreign.Concurrent
newtype Config = Config { Config -> Ptr Z3_config
unConfig :: Ptr Z3_config }
deriving Config -> Config -> Bool
(Config -> Config -> Bool)
-> (Config -> Config -> Bool) -> Eq Config
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Config -> Config -> Bool
== :: Config -> Config -> Bool
$c/= :: Config -> Config -> Bool
/= :: Config -> Config -> Bool
Eq
data Context =
Context {
Context -> ForeignPtr Z3_context
unContext :: ForeignPtr Z3_context
, Context -> IORef Word
refCount :: !(IORef Word)
, Context -> RLock
lock :: RLock
}
deriving Context -> Context -> Bool
(Context -> Context -> Bool)
-> (Context -> Context -> Bool) -> Eq Context
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Context -> Context -> Bool
== :: Context -> Context -> Bool
$c/= :: Context -> Context -> Bool
/= :: Context -> Context -> Bool
Eq
newtype Symbol = Symbol { Symbol -> Ptr Z3_symbol
unSymbol :: Ptr Z3_symbol }
deriving (Symbol -> Symbol -> Bool
(Symbol -> Symbol -> Bool)
-> (Symbol -> Symbol -> Bool) -> Eq Symbol
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Symbol -> Symbol -> Bool
== :: Symbol -> Symbol -> Bool
$c/= :: Symbol -> Symbol -> Bool
/= :: Symbol -> Symbol -> Bool
Eq, Eq Symbol
Eq Symbol
-> (Symbol -> Symbol -> Ordering)
-> (Symbol -> Symbol -> Bool)
-> (Symbol -> Symbol -> Bool)
-> (Symbol -> Symbol -> Bool)
-> (Symbol -> Symbol -> Bool)
-> (Symbol -> Symbol -> Symbol)
-> (Symbol -> Symbol -> Symbol)
-> Ord Symbol
Symbol -> Symbol -> Bool
Symbol -> Symbol -> Ordering
Symbol -> Symbol -> Symbol
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Symbol -> Symbol -> Ordering
compare :: Symbol -> Symbol -> Ordering
$c< :: Symbol -> Symbol -> Bool
< :: Symbol -> Symbol -> Bool
$c<= :: Symbol -> Symbol -> Bool
<= :: Symbol -> Symbol -> Bool
$c> :: Symbol -> Symbol -> Bool
> :: Symbol -> Symbol -> Bool
$c>= :: Symbol -> Symbol -> Bool
>= :: Symbol -> Symbol -> Bool
$cmax :: Symbol -> Symbol -> Symbol
max :: Symbol -> Symbol -> Symbol
$cmin :: Symbol -> Symbol -> Symbol
min :: Symbol -> Symbol -> Symbol
Ord, Int -> Symbol -> ShowS
[Symbol] -> ShowS
Symbol -> String
(Int -> Symbol -> ShowS)
-> (Symbol -> String) -> ([Symbol] -> ShowS) -> Show Symbol
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Symbol -> ShowS
showsPrec :: Int -> Symbol -> ShowS
$cshow :: Symbol -> String
show :: Symbol -> String
$cshowList :: [Symbol] -> ShowS
showList :: [Symbol] -> ShowS
Show, Ptr Symbol -> IO Symbol
Ptr Symbol -> Int -> IO Symbol
Ptr Symbol -> Int -> Symbol -> IO ()
Ptr Symbol -> Symbol -> IO ()
Symbol -> Int
(Symbol -> Int)
-> (Symbol -> Int)
-> (Ptr Symbol -> Int -> IO Symbol)
-> (Ptr Symbol -> Int -> Symbol -> IO ())
-> (forall b. Ptr b -> Int -> IO Symbol)
-> (forall b. Ptr b -> Int -> Symbol -> IO ())
-> (Ptr Symbol -> IO Symbol)
-> (Ptr Symbol -> Symbol -> IO ())
-> Storable Symbol
forall b. Ptr b -> Int -> IO Symbol
forall b. Ptr b -> Int -> Symbol -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: Symbol -> Int
sizeOf :: Symbol -> Int
$calignment :: Symbol -> Int
alignment :: Symbol -> Int
$cpeekElemOff :: Ptr Symbol -> Int -> IO Symbol
peekElemOff :: Ptr Symbol -> Int -> IO Symbol
$cpokeElemOff :: Ptr Symbol -> Int -> Symbol -> IO ()
pokeElemOff :: Ptr Symbol -> Int -> Symbol -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO Symbol
peekByteOff :: forall b. Ptr b -> Int -> IO Symbol
$cpokeByteOff :: forall b. Ptr b -> Int -> Symbol -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> Symbol -> IO ()
$cpeek :: Ptr Symbol -> IO Symbol
peek :: Ptr Symbol -> IO Symbol
$cpoke :: Ptr Symbol -> Symbol -> IO ()
poke :: Ptr Symbol -> Symbol -> IO ()
Storable)
newtype AST = AST { AST -> ForeignPtr Z3_ast
unAST :: ForeignPtr Z3_ast }
deriving (AST -> AST -> Bool
(AST -> AST -> Bool) -> (AST -> AST -> Bool) -> Eq AST
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AST -> AST -> Bool
== :: AST -> AST -> Bool
$c/= :: AST -> AST -> Bool
/= :: AST -> AST -> Bool
Eq, Eq AST
Eq AST
-> (AST -> AST -> Ordering)
-> (AST -> AST -> Bool)
-> (AST -> AST -> Bool)
-> (AST -> AST -> Bool)
-> (AST -> AST -> Bool)
-> (AST -> AST -> AST)
-> (AST -> AST -> AST)
-> Ord AST
AST -> AST -> Bool
AST -> AST -> Ordering
AST -> AST -> AST
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: AST -> AST -> Ordering
compare :: AST -> AST -> Ordering
$c< :: AST -> AST -> Bool
< :: AST -> AST -> Bool
$c<= :: AST -> AST -> Bool
<= :: AST -> AST -> Bool
$c> :: AST -> AST -> Bool
> :: AST -> AST -> Bool
$c>= :: AST -> AST -> Bool
>= :: AST -> AST -> Bool
$cmax :: AST -> AST -> AST
max :: AST -> AST -> AST
$cmin :: AST -> AST -> AST
min :: AST -> AST -> AST
Ord, Int -> AST -> ShowS
[AST] -> ShowS
AST -> String
(Int -> AST -> ShowS)
-> (AST -> String) -> ([AST] -> ShowS) -> Show AST
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AST -> ShowS
showsPrec :: Int -> AST -> ShowS
$cshow :: AST -> String
show :: AST -> String
$cshowList :: [AST] -> ShowS
showList :: [AST] -> ShowS
Show, Typeable)
newtype Sort = Sort { Sort -> ForeignPtr Z3_sort
unSort :: ForeignPtr Z3_sort }
deriving (Sort -> Sort -> Bool
(Sort -> Sort -> Bool) -> (Sort -> Sort -> Bool) -> Eq Sort
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Sort -> Sort -> Bool
== :: Sort -> Sort -> Bool
$c/= :: Sort -> Sort -> Bool
/= :: Sort -> Sort -> Bool
Eq, Eq Sort
Eq Sort
-> (Sort -> Sort -> Ordering)
-> (Sort -> Sort -> Bool)
-> (Sort -> Sort -> Bool)
-> (Sort -> Sort -> Bool)
-> (Sort -> Sort -> Bool)
-> (Sort -> Sort -> Sort)
-> (Sort -> Sort -> Sort)
-> Ord Sort
Sort -> Sort -> Bool
Sort -> Sort -> Ordering
Sort -> Sort -> Sort
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Sort -> Sort -> Ordering
compare :: Sort -> Sort -> Ordering
$c< :: Sort -> Sort -> Bool
< :: Sort -> Sort -> Bool
$c<= :: Sort -> Sort -> Bool
<= :: Sort -> Sort -> Bool
$c> :: Sort -> Sort -> Bool
> :: Sort -> Sort -> Bool
$c>= :: Sort -> Sort -> Bool
>= :: Sort -> Sort -> Bool
$cmax :: Sort -> Sort -> Sort
max :: Sort -> Sort -> Sort
$cmin :: Sort -> Sort -> Sort
min :: Sort -> Sort -> Sort
Ord, Int -> Sort -> ShowS
[Sort] -> ShowS
Sort -> String
(Int -> Sort -> ShowS)
-> (Sort -> String) -> ([Sort] -> ShowS) -> Show Sort
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Sort -> ShowS
showsPrec :: Int -> Sort -> ShowS
$cshow :: Sort -> String
show :: Sort -> String
$cshowList :: [Sort] -> ShowS
showList :: [Sort] -> ShowS
Show)
data TupleType
= TupleType {
TupleType -> Sort
tupleSort :: Sort
, TupleType -> FuncDecl
tupleCons :: FuncDecl
, TupleType -> [(String, FuncDecl)]
namedTupleProjs :: [(String, FuncDecl)]
}
tupleProjs :: TupleType -> [FuncDecl]
tupleProjs :: TupleType -> [FuncDecl]
tupleProjs = ((String, FuncDecl) -> FuncDecl)
-> [(String, FuncDecl)] -> [FuncDecl]
forall a b. (a -> b) -> [a] -> [b]
map (String, FuncDecl) -> FuncDecl
forall a b. (a, b) -> b
snd ([(String, FuncDecl)] -> [FuncDecl])
-> (TupleType -> [(String, FuncDecl)]) -> TupleType -> [FuncDecl]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TupleType -> [(String, FuncDecl)]
namedTupleProjs
newtype FuncDecl = FuncDecl { FuncDecl -> ForeignPtr Z3_func_decl
unFuncDecl :: ForeignPtr Z3_func_decl }
deriving (FuncDecl -> FuncDecl -> Bool
(FuncDecl -> FuncDecl -> Bool)
-> (FuncDecl -> FuncDecl -> Bool) -> Eq FuncDecl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FuncDecl -> FuncDecl -> Bool
== :: FuncDecl -> FuncDecl -> Bool
$c/= :: FuncDecl -> FuncDecl -> Bool
/= :: FuncDecl -> FuncDecl -> Bool
Eq, Eq FuncDecl
Eq FuncDecl
-> (FuncDecl -> FuncDecl -> Ordering)
-> (FuncDecl -> FuncDecl -> Bool)
-> (FuncDecl -> FuncDecl -> Bool)
-> (FuncDecl -> FuncDecl -> Bool)
-> (FuncDecl -> FuncDecl -> Bool)
-> (FuncDecl -> FuncDecl -> FuncDecl)
-> (FuncDecl -> FuncDecl -> FuncDecl)
-> Ord FuncDecl
FuncDecl -> FuncDecl -> Bool
FuncDecl -> FuncDecl -> Ordering
FuncDecl -> FuncDecl -> FuncDecl
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: FuncDecl -> FuncDecl -> Ordering
compare :: FuncDecl -> FuncDecl -> Ordering
$c< :: FuncDecl -> FuncDecl -> Bool
< :: FuncDecl -> FuncDecl -> Bool
$c<= :: FuncDecl -> FuncDecl -> Bool
<= :: FuncDecl -> FuncDecl -> Bool
$c> :: FuncDecl -> FuncDecl -> Bool
> :: FuncDecl -> FuncDecl -> Bool
$c>= :: FuncDecl -> FuncDecl -> Bool
>= :: FuncDecl -> FuncDecl -> Bool
$cmax :: FuncDecl -> FuncDecl -> FuncDecl
max :: FuncDecl -> FuncDecl -> FuncDecl
$cmin :: FuncDecl -> FuncDecl -> FuncDecl
min :: FuncDecl -> FuncDecl -> FuncDecl
Ord, Int -> FuncDecl -> ShowS
[FuncDecl] -> ShowS
FuncDecl -> String
(Int -> FuncDecl -> ShowS)
-> (FuncDecl -> String) -> ([FuncDecl] -> ShowS) -> Show FuncDecl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FuncDecl -> ShowS
showsPrec :: Int -> FuncDecl -> ShowS
$cshow :: FuncDecl -> String
show :: FuncDecl -> String
$cshowList :: [FuncDecl] -> ShowS
showList :: [FuncDecl] -> ShowS
Show, Typeable)
newtype App = App { App -> ForeignPtr Z3_app
unApp :: ForeignPtr Z3_app }
deriving (App -> App -> Bool
(App -> App -> Bool) -> (App -> App -> Bool) -> Eq App
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: App -> App -> Bool
== :: App -> App -> Bool
$c/= :: App -> App -> Bool
/= :: App -> App -> Bool
Eq, Eq App
Eq App
-> (App -> App -> Ordering)
-> (App -> App -> Bool)
-> (App -> App -> Bool)
-> (App -> App -> Bool)
-> (App -> App -> Bool)
-> (App -> App -> App)
-> (App -> App -> App)
-> Ord App
App -> App -> Bool
App -> App -> Ordering
App -> App -> App
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: App -> App -> Ordering
compare :: App -> App -> Ordering
$c< :: App -> App -> Bool
< :: App -> App -> Bool
$c<= :: App -> App -> Bool
<= :: App -> App -> Bool
$c> :: App -> App -> Bool
> :: App -> App -> Bool
$c>= :: App -> App -> Bool
>= :: App -> App -> Bool
$cmax :: App -> App -> App
max :: App -> App -> App
$cmin :: App -> App -> App
min :: App -> App -> App
Ord, Int -> App -> ShowS
[App] -> ShowS
App -> String
(Int -> App -> ShowS)
-> (App -> String) -> ([App] -> ShowS) -> Show App
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> App -> ShowS
showsPrec :: Int -> App -> ShowS
$cshow :: App -> String
show :: App -> String
$cshowList :: [App] -> ShowS
showList :: [App] -> ShowS
Show)
newtype Pattern = Pattern { Pattern -> ForeignPtr Z3_pattern
unPattern :: ForeignPtr Z3_pattern }
deriving (Pattern -> Pattern -> Bool
(Pattern -> Pattern -> Bool)
-> (Pattern -> Pattern -> Bool) -> Eq Pattern
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Pattern -> Pattern -> Bool
== :: Pattern -> Pattern -> Bool
$c/= :: Pattern -> Pattern -> Bool
/= :: Pattern -> Pattern -> Bool
Eq, Eq Pattern
Eq Pattern
-> (Pattern -> Pattern -> Ordering)
-> (Pattern -> Pattern -> Bool)
-> (Pattern -> Pattern -> Bool)
-> (Pattern -> Pattern -> Bool)
-> (Pattern -> Pattern -> Bool)
-> (Pattern -> Pattern -> Pattern)
-> (Pattern -> Pattern -> Pattern)
-> Ord Pattern
Pattern -> Pattern -> Bool
Pattern -> Pattern -> Ordering
Pattern -> Pattern -> Pattern
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Pattern -> Pattern -> Ordering
compare :: Pattern -> Pattern -> Ordering
$c< :: Pattern -> Pattern -> Bool
< :: Pattern -> Pattern -> Bool
$c<= :: Pattern -> Pattern -> Bool
<= :: Pattern -> Pattern -> Bool
$c> :: Pattern -> Pattern -> Bool
> :: Pattern -> Pattern -> Bool
$c>= :: Pattern -> Pattern -> Bool
>= :: Pattern -> Pattern -> Bool
$cmax :: Pattern -> Pattern -> Pattern
max :: Pattern -> Pattern -> Pattern
$cmin :: Pattern -> Pattern -> Pattern
min :: Pattern -> Pattern -> Pattern
Ord, Int -> Pattern -> ShowS
[Pattern] -> ShowS
Pattern -> String
(Int -> Pattern -> ShowS)
-> (Pattern -> String) -> ([Pattern] -> ShowS) -> Show Pattern
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Pattern -> ShowS
showsPrec :: Int -> Pattern -> ShowS
$cshow :: Pattern -> String
show :: Pattern -> String
$cshowList :: [Pattern] -> ShowS
showList :: [Pattern] -> ShowS
Show)
newtype Constructor = Constructor { Constructor -> ForeignPtr Z3_constructor
unConstructor :: ForeignPtr Z3_constructor }
deriving (Constructor -> Constructor -> Bool
(Constructor -> Constructor -> Bool)
-> (Constructor -> Constructor -> Bool) -> Eq Constructor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Constructor -> Constructor -> Bool
== :: Constructor -> Constructor -> Bool
$c/= :: Constructor -> Constructor -> Bool
/= :: Constructor -> Constructor -> Bool
Eq, Eq Constructor
Eq Constructor
-> (Constructor -> Constructor -> Ordering)
-> (Constructor -> Constructor -> Bool)
-> (Constructor -> Constructor -> Bool)
-> (Constructor -> Constructor -> Bool)
-> (Constructor -> Constructor -> Bool)
-> (Constructor -> Constructor -> Constructor)
-> (Constructor -> Constructor -> Constructor)
-> Ord Constructor
Constructor -> Constructor -> Bool
Constructor -> Constructor -> Ordering
Constructor -> Constructor -> Constructor
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Constructor -> Constructor -> Ordering
compare :: Constructor -> Constructor -> Ordering
$c< :: Constructor -> Constructor -> Bool
< :: Constructor -> Constructor -> Bool
$c<= :: Constructor -> Constructor -> Bool
<= :: Constructor -> Constructor -> Bool
$c> :: Constructor -> Constructor -> Bool
> :: Constructor -> Constructor -> Bool
$c>= :: Constructor -> Constructor -> Bool
>= :: Constructor -> Constructor -> Bool
$cmax :: Constructor -> Constructor -> Constructor
max :: Constructor -> Constructor -> Constructor
$cmin :: Constructor -> Constructor -> Constructor
min :: Constructor -> Constructor -> Constructor
Ord, Int -> Constructor -> ShowS
[Constructor] -> ShowS
Constructor -> String
(Int -> Constructor -> ShowS)
-> (Constructor -> String)
-> ([Constructor] -> ShowS)
-> Show Constructor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Constructor -> ShowS
showsPrec :: Int -> Constructor -> ShowS
$cshow :: Constructor -> String
show :: Constructor -> String
$cshowList :: [Constructor] -> ShowS
showList :: [Constructor] -> ShowS
Show)
newtype ConstructorList = ConstructorList { ConstructorList -> ForeignPtr Z3_constructor_list
unConstructorList :: ForeignPtr Z3_constructor_list }
deriving (ConstructorList -> ConstructorList -> Bool
(ConstructorList -> ConstructorList -> Bool)
-> (ConstructorList -> ConstructorList -> Bool)
-> Eq ConstructorList
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConstructorList -> ConstructorList -> Bool
== :: ConstructorList -> ConstructorList -> Bool
$c/= :: ConstructorList -> ConstructorList -> Bool
/= :: ConstructorList -> ConstructorList -> Bool
Eq, Eq ConstructorList
Eq ConstructorList
-> (ConstructorList -> ConstructorList -> Ordering)
-> (ConstructorList -> ConstructorList -> Bool)
-> (ConstructorList -> ConstructorList -> Bool)
-> (ConstructorList -> ConstructorList -> Bool)
-> (ConstructorList -> ConstructorList -> Bool)
-> (ConstructorList -> ConstructorList -> ConstructorList)
-> (ConstructorList -> ConstructorList -> ConstructorList)
-> Ord ConstructorList
ConstructorList -> ConstructorList -> Bool
ConstructorList -> ConstructorList -> Ordering
ConstructorList -> ConstructorList -> ConstructorList
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ConstructorList -> ConstructorList -> Ordering
compare :: ConstructorList -> ConstructorList -> Ordering
$c< :: ConstructorList -> ConstructorList -> Bool
< :: ConstructorList -> ConstructorList -> Bool
$c<= :: ConstructorList -> ConstructorList -> Bool
<= :: ConstructorList -> ConstructorList -> Bool
$c> :: ConstructorList -> ConstructorList -> Bool
> :: ConstructorList -> ConstructorList -> Bool
$c>= :: ConstructorList -> ConstructorList -> Bool
>= :: ConstructorList -> ConstructorList -> Bool
$cmax :: ConstructorList -> ConstructorList -> ConstructorList
max :: ConstructorList -> ConstructorList -> ConstructorList
$cmin :: ConstructorList -> ConstructorList -> ConstructorList
min :: ConstructorList -> ConstructorList -> ConstructorList
Ord, Int -> ConstructorList -> ShowS
[ConstructorList] -> ShowS
ConstructorList -> String
(Int -> ConstructorList -> ShowS)
-> (ConstructorList -> String)
-> ([ConstructorList] -> ShowS)
-> Show ConstructorList
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConstructorList -> ShowS
showsPrec :: Int -> ConstructorList -> ShowS
$cshow :: ConstructorList -> String
show :: ConstructorList -> String
$cshowList :: [ConstructorList] -> ShowS
showList :: [ConstructorList] -> ShowS
Show)
newtype Model = Model { Model -> ForeignPtr Z3_model
unModel :: ForeignPtr Z3_model }
deriving Model -> Model -> Bool
(Model -> Model -> Bool) -> (Model -> Model -> Bool) -> Eq Model
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Model -> Model -> Bool
== :: Model -> Model -> Bool
$c/= :: Model -> Model -> Bool
/= :: Model -> Model -> Bool
Eq
newtype FuncInterp = FuncInterp { FuncInterp -> ForeignPtr Z3_func_interp
unFuncInterp :: ForeignPtr Z3_func_interp }
deriving FuncInterp -> FuncInterp -> Bool
(FuncInterp -> FuncInterp -> Bool)
-> (FuncInterp -> FuncInterp -> Bool) -> Eq FuncInterp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FuncInterp -> FuncInterp -> Bool
== :: FuncInterp -> FuncInterp -> Bool
$c/= :: FuncInterp -> FuncInterp -> Bool
/= :: FuncInterp -> FuncInterp -> Bool
Eq
newtype FuncEntry = FuncEntry { FuncEntry -> ForeignPtr Z3_func_entry
unFuncEntry :: ForeignPtr Z3_func_entry }
deriving FuncEntry -> FuncEntry -> Bool
(FuncEntry -> FuncEntry -> Bool)
-> (FuncEntry -> FuncEntry -> Bool) -> Eq FuncEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FuncEntry -> FuncEntry -> Bool
== :: FuncEntry -> FuncEntry -> Bool
$c/= :: FuncEntry -> FuncEntry -> Bool
/= :: FuncEntry -> FuncEntry -> Bool
Eq
newtype Tactic = Tactic { Tactic -> ForeignPtr Z3_tactic
unTactic :: ForeignPtr Z3_tactic }
deriving Tactic -> Tactic -> Bool
(Tactic -> Tactic -> Bool)
-> (Tactic -> Tactic -> Bool) -> Eq Tactic
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Tactic -> Tactic -> Bool
== :: Tactic -> Tactic -> Bool
$c/= :: Tactic -> Tactic -> Bool
/= :: Tactic -> Tactic -> Bool
Eq
newtype Goal = Goal { Goal -> ForeignPtr Z3_goal
unGoal :: ForeignPtr Z3_goal }
deriving Goal -> Goal -> Bool
(Goal -> Goal -> Bool) -> (Goal -> Goal -> Bool) -> Eq Goal
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Goal -> Goal -> Bool
== :: Goal -> Goal -> Bool
$c/= :: Goal -> Goal -> Bool
/= :: Goal -> Goal -> Bool
Eq
newtype ApplyResult = ApplyResult { ApplyResult -> ForeignPtr Z3_apply_result
unApplyResult :: ForeignPtr Z3_apply_result }
deriving ApplyResult -> ApplyResult -> Bool
(ApplyResult -> ApplyResult -> Bool)
-> (ApplyResult -> ApplyResult -> Bool) -> Eq ApplyResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ApplyResult -> ApplyResult -> Bool
== :: ApplyResult -> ApplyResult -> Bool
$c/= :: ApplyResult -> ApplyResult -> Bool
/= :: ApplyResult -> ApplyResult -> Bool
Eq
newtype Params = Params { Params -> ForeignPtr Z3_params
unParams :: ForeignPtr Z3_params }
deriving Params -> Params -> Bool
(Params -> Params -> Bool)
-> (Params -> Params -> Bool) -> Eq Params
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Params -> Params -> Bool
== :: Params -> Params -> Bool
$c/= :: Params -> Params -> Bool
/= :: Params -> Params -> Bool
Eq
newtype Solver = Solver { Solver -> ForeignPtr Z3_solver
unSolver :: ForeignPtr Z3_solver }
deriving Solver -> Solver -> Bool
(Solver -> Solver -> Bool)
-> (Solver -> Solver -> Bool) -> Eq Solver
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Solver -> Solver -> Bool
== :: Solver -> Solver -> Bool
$c/= :: Solver -> Solver -> Bool
/= :: Solver -> Solver -> Bool
Eq
data Result
= Sat
| Unsat
| Undef
deriving (Result -> Result -> Bool
(Result -> Result -> Bool)
-> (Result -> Result -> Bool) -> Eq Result
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Result -> Result -> Bool
== :: Result -> Result -> Bool
$c/= :: Result -> Result -> Bool
/= :: Result -> Result -> Bool
Eq, Eq Result
Eq Result
-> (Result -> Result -> Ordering)
-> (Result -> Result -> Bool)
-> (Result -> Result -> Bool)
-> (Result -> Result -> Bool)
-> (Result -> Result -> Bool)
-> (Result -> Result -> Result)
-> (Result -> Result -> Result)
-> Ord Result
Result -> Result -> Bool
Result -> Result -> Ordering
Result -> Result -> Result
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Result -> Result -> Ordering
compare :: Result -> Result -> Ordering
$c< :: Result -> Result -> Bool
< :: Result -> Result -> Bool
$c<= :: Result -> Result -> Bool
<= :: Result -> Result -> Bool
$c> :: Result -> Result -> Bool
> :: Result -> Result -> Bool
$c>= :: Result -> Result -> Bool
>= :: Result -> Result -> Bool
$cmax :: Result -> Result -> Result
max :: Result -> Result -> Result
$cmin :: Result -> Result -> Result
min :: Result -> Result -> Result
Ord, ReadPrec [Result]
ReadPrec Result
Int -> ReadS Result
ReadS [Result]
(Int -> ReadS Result)
-> ReadS [Result]
-> ReadPrec Result
-> ReadPrec [Result]
-> Read Result
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Result
readsPrec :: Int -> ReadS Result
$creadList :: ReadS [Result]
readList :: ReadS [Result]
$creadPrec :: ReadPrec Result
readPrec :: ReadPrec Result
$creadListPrec :: ReadPrec [Result]
readListPrec :: ReadPrec [Result]
Read, Int -> Result -> ShowS
[Result] -> ShowS
Result -> String
(Int -> Result -> ShowS)
-> (Result -> String) -> ([Result] -> ShowS) -> Show Result
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Result -> ShowS
showsPrec :: Int -> Result -> ShowS
$cshow :: Result -> String
show :: Result -> String
$cshowList :: [Result] -> ShowS
showList :: [Result] -> ShowS
Show)
data SortKind
= Z3_UNINTERPRETED_SORT
| Z3_BOOL_SORT
| Z3_INT_SORT
| Z3_REAL_SORT
| Z3_BV_SORT
| Z3_ARRAY_SORT
| Z3_DATATYPE_SORT
| Z3_RELATION_SORT
| Z3_FINITE_DOMAIN_SORT
| Z3_FLOATING_POINT_SORT
| Z3_ROUNDING_MODE_SORT
| Z3_UNKNOWN_SORT
deriving (SortKind -> SortKind -> Bool
(SortKind -> SortKind -> Bool)
-> (SortKind -> SortKind -> Bool) -> Eq SortKind
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SortKind -> SortKind -> Bool
== :: SortKind -> SortKind -> Bool
$c/= :: SortKind -> SortKind -> Bool
/= :: SortKind -> SortKind -> Bool
Eq, Int -> SortKind -> ShowS
[SortKind] -> ShowS
SortKind -> String
(Int -> SortKind -> ShowS)
-> (SortKind -> String) -> ([SortKind] -> ShowS) -> Show SortKind
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SortKind -> ShowS
showsPrec :: Int -> SortKind -> ShowS
$cshow :: SortKind -> String
show :: SortKind -> String
$cshowList :: [SortKind] -> ShowS
showList :: [SortKind] -> ShowS
Show)
data ASTKind
= Z3_NUMERAL_AST
| Z3_APP_AST
| Z3_VAR_AST
| Z3_QUANTIFIER_AST
| Z3_SORT_AST
| Z3_FUNC_DECL_AST
| Z3_UNKNOWN_AST
deriving (ASTKind -> ASTKind -> Bool
(ASTKind -> ASTKind -> Bool)
-> (ASTKind -> ASTKind -> Bool) -> Eq ASTKind
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ASTKind -> ASTKind -> Bool
== :: ASTKind -> ASTKind -> Bool
$c/= :: ASTKind -> ASTKind -> Bool
/= :: ASTKind -> ASTKind -> Bool
Eq, Int -> ASTKind -> ShowS
[ASTKind] -> ShowS
ASTKind -> String
(Int -> ASTKind -> ShowS)
-> (ASTKind -> String) -> ([ASTKind] -> ShowS) -> Show ASTKind
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ASTKind -> ShowS
showsPrec :: Int -> ASTKind -> ShowS
$cshow :: ASTKind -> String
show :: ASTKind -> String
$cshowList :: [ASTKind] -> ShowS
showList :: [ASTKind] -> ShowS
Show)
algebraicIsValue :: Context -> AST -> IO Bool
algebraicIsValue :: Context -> AST -> IO Bool
algebraicIsValue = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_algebraic_is_value
algebraicIsPos :: Context -> AST -> IO Bool
algebraicIsPos :: Context -> AST -> IO Bool
algebraicIsPos = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_algebraic_is_pos
algebraicIsNeg :: Context -> AST -> IO Bool
algebraicIsNeg :: Context -> AST -> IO Bool
algebraicIsNeg = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_algebraic_is_neg
algebraicIsZero :: Context -> AST -> IO Bool
algebraicIsZero :: Context -> AST -> IO Bool
algebraicIsZero = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_algebraic_is_zero
algebraicSign :: Context -> AST -> IO Int
algebraicSign :: Context -> AST -> IO Int
algebraicSign = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_error_code)
-> Context -> AST -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_error_code
z3_algebraic_sign
algebraicAdd :: Context -> AST -> AST -> IO AST
algebraicAdd :: Context -> AST -> AST -> IO AST
algebraicAdd = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_algebraic_add
algebraicSub :: Context -> AST -> AST -> IO AST
algebraicSub :: Context -> AST -> AST -> IO AST
algebraicSub = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_algebraic_sub
algebraicMul :: Context -> AST -> AST -> IO AST
algebraicMul :: Context -> AST -> AST -> IO AST
algebraicMul = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_algebraic_mul
algebraicDiv :: Context -> AST -> AST -> IO AST
algebraicDiv :: Context -> AST -> AST -> IO AST
algebraicDiv = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_algebraic_div
algebraicRoot :: Context -> AST -> Int -> IO AST
algebraicRoot :: Context -> AST -> Int -> IO AST
algebraicRoot = (Ptr Z3_context -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_ast))
-> Context -> AST -> Int -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_ast)
z3_algebraic_root
algebraicPower :: Context -> AST -> Int -> IO AST
algebraicPower :: Context -> AST -> Int -> IO AST
algebraicPower = (Ptr Z3_context -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_ast))
-> Context -> AST -> Int -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_ast)
z3_algebraic_power
algebraicLt :: Context -> AST -> AST -> IO Bool
algebraicLt :: Context -> AST -> AST -> IO Bool
algebraicLt = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> AST -> IO Bool
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool
z3_algebraic_lt
algebraicGt :: Context -> AST -> AST -> IO Bool
algebraicGt :: Context -> AST -> AST -> IO Bool
algebraicGt = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> AST -> IO Bool
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool
z3_algebraic_gt
algebraicLe :: Context -> AST -> AST -> IO Bool
algebraicLe :: Context -> AST -> AST -> IO Bool
algebraicLe = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> AST -> IO Bool
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool
z3_algebraic_le
algebraicGe :: Context -> AST -> AST -> IO Bool
algebraicGe :: Context -> AST -> AST -> IO Bool
algebraicGe = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> AST -> IO Bool
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool
z3_algebraic_ge
algebraicEq :: Context -> AST -> AST -> IO Bool
algebraicEq :: Context -> AST -> AST -> IO Bool
algebraicEq = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> AST -> IO Bool
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool
z3_algebraic_eq
algebraicNeq :: Context -> AST -> AST -> IO Bool
algebraicNeq :: Context -> AST -> AST -> IO Bool
algebraicNeq = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> AST -> IO Bool
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool
z3_algebraic_neq
algebraicRoots :: Context -> AST -> [AST] -> IO [AST]
algebraicRoots :: Context -> AST -> [AST] -> IO [AST]
algebraicRoots Context
ctx AST
p [AST]
args = (Ptr Z3_context
-> Ptr Z3_ast
-> CUInt
-> Ptr (Ptr Z3_ast)
-> IO (Ptr Z3_ast_vector))
-> Context
-> ((Ptr Z3_ast
-> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> IO [AST]
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_ast
-> CUInt
-> Ptr (Ptr Z3_ast)
-> IO (Ptr Z3_ast_vector)
z3_algebraic_roots Context
ctx (((Ptr Z3_ast
-> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> IO [AST])
-> ((Ptr Z3_ast
-> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> IO [AST]
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast_vector)
f ->
AST
-> (Ptr Z3_ast -> IO (Ptr Z3_ast_vector)) -> IO (Ptr Z3_ast_vector)
forall r. AST -> (Ptr Z3_ast -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c AST
p ((Ptr Z3_ast -> IO (Ptr Z3_ast_vector)) -> IO (Ptr Z3_ast_vector))
-> (Ptr Z3_ast -> IO (Ptr Z3_ast_vector)) -> IO (Ptr Z3_ast_vector)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast
pPtr ->
[AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
args ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall a b. (a -> b) -> a -> b
$ \CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr ->
Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast_vector)
f Ptr Z3_ast
pPtr CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr
algebraicEval :: Context -> AST -> [AST] -> IO Int
algebraicEval :: Context -> AST -> [AST] -> IO Int
algebraicEval Context
ctx AST
p [AST]
args = (Ptr Z3_context
-> Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_error_code)
-> Context
-> ((Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_error_code)
-> IO Z3_error_code)
-> IO Int
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_error_code
z3_algebraic_eval Context
ctx (((Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_error_code)
-> IO Z3_error_code)
-> IO Int)
-> ((Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_error_code)
-> IO Z3_error_code)
-> IO Int
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_error_code
f ->
AST -> (Ptr Z3_ast -> IO Z3_error_code) -> IO Z3_error_code
forall r. AST -> (Ptr Z3_ast -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c AST
p ((Ptr Z3_ast -> IO Z3_error_code) -> IO Z3_error_code)
-> (Ptr Z3_ast -> IO Z3_error_code) -> IO Z3_error_code
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast
pPtr ->
[AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_error_code)
-> IO Z3_error_code
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
args ((CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_error_code)
-> IO Z3_error_code)
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_error_code)
-> IO Z3_error_code
forall a b. (a -> b) -> a -> b
$ \CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr ->
Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_error_code
f Ptr Z3_ast
pPtr CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr
globalParamSet :: String -> String -> IO ()
globalParamSet :: String -> String -> IO ()
globalParamSet String
param String
value =
String -> (Z3_string -> IO ()) -> IO ()
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
param ((Z3_string -> IO ()) -> IO ()) -> (Z3_string -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Z3_string
cParam ->
String -> (Z3_string -> IO ()) -> IO ()
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
value ((Z3_string -> IO ()) -> IO ()) -> (Z3_string -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Z3_string
cValue ->
Z3_string -> Z3_string -> IO ()
z3_global_param_set Z3_string
cParam Z3_string
cValue
globalParamResetAll :: IO ()
globalParamResetAll :: IO ()
globalParamResetAll = IO ()
z3_global_param_reset_all
globalParamGet :: String -> IO (Maybe String)
globalParamGet :: String -> IO (Maybe String)
globalParamGet String
param =
String -> (Z3_string -> IO (Maybe String)) -> IO (Maybe String)
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
param ((Z3_string -> IO (Maybe String)) -> IO (Maybe String))
-> (Z3_string -> IO (Maybe String)) -> IO (Maybe String)
forall a b. (a -> b) -> a -> b
$ \Z3_string
cParam ->
(Ptr Z3_string -> IO (Maybe String)) -> IO (Maybe String)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr Z3_string -> IO (Maybe String)) -> IO (Maybe String))
-> (Ptr Z3_string -> IO (Maybe String)) -> IO (Maybe String)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_string
cValuePtr ->
do Bool
success <- Z3_bool -> Bool
toBool (Z3_bool -> Bool) -> IO Z3_bool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Z3_string -> Ptr Z3_string -> IO Z3_bool
z3_global_param_get Z3_string
cParam Ptr Z3_string
cValuePtr
Bool -> IO String -> IO (Maybe String)
forall (m :: * -> *) a. Monad m => Bool -> m a -> m (Maybe a)
returnValueToMaybe Bool
success (IO String -> IO (Maybe String)) -> IO String -> IO (Maybe String)
forall a b. (a -> b) -> a -> b
$ Z3_string -> IO String
peekCString (Z3_string -> IO String) -> IO Z3_string -> IO String
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr Z3_string -> IO Z3_string
forall a. Storable a => Ptr a -> IO a
peek Ptr Z3_string
cValuePtr
mkConfig :: IO Config
mkConfig :: IO Config
mkConfig = Ptr Z3_config -> Config
Config (Ptr Z3_config -> Config) -> IO (Ptr Z3_config) -> IO Config
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> IO (Ptr Z3_config)
z3_mk_config
delConfig :: Config -> IO ()
delConfig :: Config -> IO ()
delConfig = Ptr Z3_config -> IO ()
z3_del_config (Ptr Z3_config -> IO ())
-> (Config -> Ptr Z3_config) -> Config -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Config -> Ptr Z3_config
unConfig
setParamValue :: Config -> String -> String -> IO ()
setParamValue :: Config -> String -> String -> IO ()
setParamValue Config
cfg String
s1 String
s2 =
String -> (Z3_string -> IO ()) -> IO ()
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
s1 ((Z3_string -> IO ()) -> IO ()) -> (Z3_string -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Z3_string
cs1 ->
String -> (Z3_string -> IO ()) -> IO ()
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
s2 ((Z3_string -> IO ()) -> IO ()) -> (Z3_string -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Z3_string
cs2 ->
Ptr Z3_config -> Z3_string -> Z3_string -> IO ()
z3_set_param_value (Config -> Ptr Z3_config
unConfig Config
cfg) Z3_string
cs1 Z3_string
cs2
withConfig :: (Config -> IO a) -> IO a
withConfig :: forall a. (Config -> IO a) -> IO a
withConfig = IO Config -> (Config -> IO ()) -> (Config -> IO a) -> IO a
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket IO Config
mkConfig Config -> IO ()
delConfig
mkContextWith :: (Ptr Z3_config -> IO (Ptr Z3_context)) -> Config -> IO Context
mkContextWith :: (Ptr Z3_config -> IO (Ptr Z3_context)) -> Config -> IO Context
mkContextWith Ptr Z3_config -> IO (Ptr Z3_context)
mkCtx Config
cfg = do
Ptr Z3_context
ctxPtr <- Ptr Z3_config -> IO (Ptr Z3_context)
mkCtx (Config -> Ptr Z3_config
unConfig Config
cfg)
Ptr Z3_context -> FunPtr Z3_error_handler -> IO ()
z3_set_error_handler Ptr Z3_context
ctxPtr FunPtr Z3_error_handler
forall a. FunPtr a
nullFunPtr
IORef Word
count <- Word -> IO (IORef Word)
forall a. a -> IO (IORef a)
newIORef Word
1
ForeignPtr Z3_context -> IORef Word -> RLock -> Context
Context (ForeignPtr Z3_context -> IORef Word -> RLock -> Context)
-> IO (ForeignPtr Z3_context)
-> IO (IORef Word -> RLock -> Context)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr Z3_context -> IO () -> IO (ForeignPtr Z3_context)
forall a. Ptr a -> IO () -> IO (ForeignPtr a)
newForeignPtr Ptr Z3_context
ctxPtr (Ptr Z3_context -> IORef Word -> IO ()
contextDecRef Ptr Z3_context
ctxPtr IORef Word
count)
IO (IORef Word -> RLock -> Context)
-> IO (IORef Word) -> IO (RLock -> Context)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> IORef Word -> IO (IORef Word)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure IORef Word
count
IO (RLock -> Context) -> IO RLock -> IO Context
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> IO RLock
Z3.RLock.new
mkContext :: Config -> IO Context
mkContext :: Config -> IO Context
mkContext = (Ptr Z3_config -> IO (Ptr Z3_context)) -> Config -> IO Context
mkContextWith Ptr Z3_config -> IO (Ptr Z3_context)
z3_mk_context_rc
contextIncRef :: Context -> IO ()
contextIncRef :: Context -> IO ()
contextIncRef Context
ctx = IORef Word -> (Word -> (Word, ())) -> IO ()
forall a b. IORef a -> (a -> (a, b)) -> IO b
atomicModifyIORef' (Context -> IORef Word
refCount Context
ctx) ((Word -> (Word, ())) -> IO ()) -> (Word -> (Word, ())) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Word
n ->
(Word
nWord -> Word -> Word
forall a. Num a => a -> a -> a
+Word
1, ())
contextDecRef :: Ptr Z3_context -> IORef Word -> IO ()
contextDecRef :: Ptr Z3_context -> IORef Word -> IO ()
contextDecRef Ptr Z3_context
ctxPtr IORef Word
count = IO (IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => m (m a) -> m a
join (IO (IO ()) -> IO ()) -> IO (IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ IORef Word -> (Word -> (Word, IO ())) -> IO (IO ())
forall a b. IORef a -> (a -> (a, b)) -> IO b
atomicModifyIORef' IORef Word
count ((Word -> (Word, IO ())) -> IO (IO ()))
-> (Word -> (Word, IO ())) -> IO (IO ())
forall a b. (a -> b) -> a -> b
$ \Word
n ->
if Word
n Word -> Word -> Bool
forall a. Ord a => a -> a -> Bool
> Word
1
then (Word
nWord -> Word -> Word
forall a. Num a => a -> a -> a
-Word
1, () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ())
else ( Word
0, Ptr Z3_context -> IO ()
z3_del_context Ptr Z3_context
ctxPtr)
mkParams :: Context -> IO Params
mkParams :: Context -> IO Params
mkParams = (Ptr Z3_context -> IO (Ptr Z3_params)) -> Context -> IO Params
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_params)
z3_mk_params
paramsSetBool :: Context -> Params -> Symbol -> Bool -> IO ()
paramsSetBool :: Context -> Params -> Symbol -> Bool -> IO ()
paramsSetBool = (Ptr Z3_context
-> Ptr Z3_params -> Ptr Z3_symbol -> Z3_bool -> IO ())
-> Context -> Params -> Symbol -> Bool -> IO ()
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_params -> Ptr Z3_symbol -> Z3_bool -> IO ()
z3_params_set_bool
paramsSetUInt :: Context -> Params -> Symbol -> Word -> IO ()
paramsSetUInt :: Context -> Params -> Symbol -> Word -> IO ()
paramsSetUInt = (Ptr Z3_context
-> Ptr Z3_params -> Ptr Z3_symbol -> CUInt -> IO ())
-> Context -> Params -> Symbol -> Word -> IO ()
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context -> Ptr Z3_params -> Ptr Z3_symbol -> CUInt -> IO ()
z3_params_set_uint
paramsSetDouble :: Context -> Params -> Symbol -> Double -> IO ()
paramsSetDouble :: Context -> Params -> Symbol -> Double -> IO ()
paramsSetDouble = (Ptr Z3_context
-> Ptr Z3_params -> Ptr Z3_symbol -> CDouble -> IO ())
-> Context -> Params -> Symbol -> Double -> IO ()
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_params -> Ptr Z3_symbol -> CDouble -> IO ()
z3_params_set_double
paramsSetSymbol :: Context -> Params -> Symbol -> Symbol -> IO ()
paramsSetSymbol :: Context -> Params -> Symbol -> Symbol -> IO ()
paramsSetSymbol = (Ptr Z3_context
-> Ptr Z3_params -> Ptr Z3_symbol -> Ptr Z3_symbol -> IO ())
-> Context -> Params -> Symbol -> Symbol -> IO ()
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_params -> Ptr Z3_symbol -> Ptr Z3_symbol -> IO ()
z3_params_set_symbol
paramsToString :: Context -> Params -> IO String
paramsToString :: Context -> Params -> IO String
paramsToString = (Ptr Z3_context -> Ptr Z3_params -> IO Z3_string)
-> Context -> Params -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_params -> IO Z3_string
z3_params_to_string
mkIntSymbol :: Integral int => Context -> int -> IO Symbol
mkIntSymbol :: forall int. Integral int => Context -> int -> IO Symbol
mkIntSymbol Context
c int
i
| int
0 int -> int -> Bool
forall a. Ord a => a -> a -> Bool
<= int
i Bool -> Bool -> Bool
&& int
i int -> int -> Bool
forall a. Ord a => a -> a -> Bool
<= int
2int -> Int -> int
forall a b. (Num a, Integral b) => a -> b -> a
^(Int
30::Int)int -> int -> int
forall a. Num a => a -> a -> a
-int
1
= (Ptr Z3_context -> Z3_error_code -> IO (Ptr Z3_symbol))
-> Context -> int -> IO Symbol
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Z3_error_code -> IO (Ptr Z3_symbol)
z3_mk_int_symbol Context
c int
i
| Bool
otherwise
= String -> IO Symbol
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkIntSymbol: invalid range"
mkStringSymbol :: Context -> String -> IO Symbol
mkStringSymbol :: Context -> String -> IO Symbol
mkStringSymbol = (Ptr Z3_context -> Z3_string -> IO (Ptr Z3_symbol))
-> Context -> String -> IO Symbol
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Z3_string -> IO (Ptr Z3_symbol)
z3_mk_string_symbol
mkUninterpretedSort :: Context -> Symbol -> IO Sort
mkUninterpretedSort :: Context -> Symbol -> IO Sort
mkUninterpretedSort = (Ptr Z3_context -> Ptr Z3_symbol -> IO (Ptr Z3_sort))
-> Context -> Symbol -> IO Sort
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_symbol -> IO (Ptr Z3_sort)
z3_mk_uninterpreted_sort
mkBoolSort :: Context -> IO Sort
mkBoolSort :: Context -> IO Sort
mkBoolSort = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_bool_sort
mkIntSort :: Context -> IO Sort
mkIntSort :: Context -> IO Sort
mkIntSort = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_int_sort
mkRealSort :: Context -> IO Sort
mkRealSort :: Context -> IO Sort
mkRealSort = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_real_sort
mkBvSort :: Integral int => Context -> int -> IO Sort
mkBvSort :: forall int. Integral int => Context -> int -> IO Sort
mkBvSort Context
c int
i
| int
i int -> int -> Bool
forall a. Ord a => a -> a -> Bool
>= int
0 = (Ptr Z3_context -> CUInt -> IO (Ptr Z3_sort))
-> Context -> int -> IO Sort
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> CUInt -> IO (Ptr Z3_sort)
z3_mk_bv_sort Context
c int
i
| Bool
otherwise = String -> IO Sort
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkBvSort: negative size"
mkFiniteDomainSort :: Context -> Symbol -> Word64 -> IO Sort
mkFiniteDomainSort :: Context -> Symbol -> Word64 -> IO Sort
mkFiniteDomainSort = (Ptr Z3_context -> Ptr Z3_symbol -> CULLong -> IO (Ptr Z3_sort))
-> Context -> Symbol -> Word64 -> IO Sort
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_symbol -> CULLong -> IO (Ptr Z3_sort)
z3_mk_finite_domain_sort
mkArraySort :: Context -> Sort -> Sort -> IO Sort
mkArraySort :: Context -> Sort -> Sort -> IO Sort
mkArraySort = (Ptr Z3_context -> Ptr Z3_sort -> Ptr Z3_sort -> IO (Ptr Z3_sort))
-> Context -> Sort -> Sort -> IO Sort
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_sort -> Ptr Z3_sort -> IO (Ptr Z3_sort)
z3_mk_array_sort
mkArraySortN :: Context -> [Sort] -> Sort -> IO Sort
mkArraySortN :: Context -> [Sort] -> Sort -> IO Sort
mkArraySortN Context
ctx [Sort]
argSorts Sort
rangeSort = (Ptr Z3_context
-> CUInt -> Ptr (Ptr Z3_sort) -> Ptr Z3_sort -> IO (Ptr Z3_sort))
-> Context
-> ((CUInt -> Ptr (Ptr Z3_sort) -> Ptr Z3_sort -> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort))
-> IO Sort
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> CUInt -> Ptr (Ptr Z3_sort) -> Ptr Z3_sort -> IO (Ptr Z3_sort)
z3_mk_array_sort_n Context
ctx (((CUInt -> Ptr (Ptr Z3_sort) -> Ptr Z3_sort -> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort))
-> IO Sort)
-> ((CUInt -> Ptr (Ptr Z3_sort) -> Ptr Z3_sort -> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort))
-> IO Sort
forall a b. (a -> b) -> a -> b
$ \CUInt -> Ptr (Ptr Z3_sort) -> Ptr Z3_sort -> IO (Ptr Z3_sort)
f ->
[Sort]
-> (CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Sort]
argSorts ((CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort))
-> (CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort)
forall a b. (a -> b) -> a -> b
$ \CUInt
nArgs Ptr (Ptr Z3_sort)
argSortsPtr ->
Sort -> (Ptr Z3_sort -> IO (Ptr Z3_sort)) -> IO (Ptr Z3_sort)
forall r. Sort -> (Ptr Z3_sort -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Sort
rangeSort ((Ptr Z3_sort -> IO (Ptr Z3_sort)) -> IO (Ptr Z3_sort))
-> (Ptr Z3_sort -> IO (Ptr Z3_sort)) -> IO (Ptr Z3_sort)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_sort
rangeSortPtr ->
CUInt -> Ptr (Ptr Z3_sort) -> Ptr Z3_sort -> IO (Ptr Z3_sort)
f CUInt
nArgs Ptr (Ptr Z3_sort)
argSortsPtr Ptr Z3_sort
rangeSortPtr
mkTupleSort :: Context
-> Symbol
-> [(Symbol, Sort)]
-> IO (Sort, FuncDecl, [FuncDecl])
mkTupleSort :: Context
-> Symbol -> [(Symbol, Sort)] -> IO (Sort, FuncDecl, [FuncDecl])
mkTupleSort Context
c Symbol
sym [(Symbol, Sort)]
symSorts = Context
-> (Ptr Z3_context -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl])
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContextError Context
c ((Ptr Z3_context -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl]))
-> (Ptr Z3_context -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl])
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr ->
Symbol
-> (Ptr Z3_symbol -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl])
forall r. Symbol -> (Ptr Z3_symbol -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Symbol
sym ((Ptr Z3_symbol -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl]))
-> (Ptr Z3_symbol -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl])
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_symbol
symPtr ->
[Symbol]
-> (Int -> Ptr (Ptr Z3_symbol) -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl])
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Symbol]
syms ((Int -> Ptr (Ptr Z3_symbol) -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl]))
-> (Int -> Ptr (Ptr Z3_symbol) -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl])
forall a b. (a -> b) -> a -> b
$ \ Int
n Ptr (Ptr Z3_symbol)
symsPtr ->
[Sort]
-> (Ptr (Ptr Z3_sort) -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl])
forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray [Sort]
sorts ((Ptr (Ptr Z3_sort) -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl]))
-> (Ptr (Ptr Z3_sort) -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl])
forall a b. (a -> b) -> a -> b
$ \ Ptr (Ptr Z3_sort)
sortsPtr ->
(Ptr (Ptr Z3_func_decl) -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl])
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr (Ptr Z3_func_decl) -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl]))
-> (Ptr (Ptr Z3_func_decl) -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl])
forall a b. (a -> b) -> a -> b
$ \ Ptr (Ptr Z3_func_decl)
outConstrPtr ->
Int
-> (Ptr (Ptr Z3_func_decl) -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl])
forall a b. Storable a => Int -> (Ptr a -> IO b) -> IO b
allocaArray Int
n ((Ptr (Ptr Z3_func_decl) -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl]))
-> (Ptr (Ptr Z3_func_decl) -> IO (Sort, FuncDecl, [FuncDecl]))
-> IO (Sort, FuncDecl, [FuncDecl])
forall a b. (a -> b) -> a -> b
$ \ Ptr (Ptr Z3_func_decl)
outProjsPtr -> do
Ptr Z3_sort
srtPtr <- Ptr Z3_context -> IO (Ptr Z3_sort) -> IO (Ptr Z3_sort)
forall a. Ptr Z3_context -> IO a -> IO a
checkError Ptr Z3_context
cPtr (IO (Ptr Z3_sort) -> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort) -> IO (Ptr Z3_sort)
forall a b. (a -> b) -> a -> b
$ Ptr Z3_context
-> Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort)
z3_mk_tuple_sort Ptr Z3_context
cPtr Ptr Z3_symbol
symPtr
(Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
n) Ptr (Ptr Z3_symbol)
symsPtr Ptr (Ptr Z3_sort)
sortsPtr
Ptr (Ptr Z3_func_decl)
outConstrPtr Ptr (Ptr Z3_func_decl)
outProjsPtr
Ptr Z3_func_decl
outConstr <- Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_func_decl)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Z3_func_decl)
outConstrPtr
[Ptr Z3_func_decl]
outProjs <- Int -> Ptr (Ptr Z3_func_decl) -> IO [Ptr Z3_func_decl]
forall a. Storable a => Int -> Ptr a -> IO [a]
peekArray Int
n Ptr (Ptr Z3_func_decl)
outProjsPtr
Sort
tupleSort <- Context -> Ptr Z3_sort -> IO Sort
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
c Ptr Z3_sort
srtPtr
FuncDecl
tupleCons <- Context -> Ptr Z3_func_decl -> IO FuncDecl
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
c Ptr Z3_func_decl
outConstr
[FuncDecl]
tupleProjs <- (Ptr Z3_func_decl -> IO FuncDecl)
-> [Ptr Z3_func_decl] -> IO [FuncDecl]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (Context -> Ptr Z3_func_decl -> IO FuncDecl
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
c) [Ptr Z3_func_decl]
outProjs
(Sort, FuncDecl, [FuncDecl]) -> IO (Sort, FuncDecl, [FuncDecl])
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Sort
tupleSort, FuncDecl
tupleCons, [FuncDecl]
tupleProjs)
where ([Symbol]
syms, [Sort]
sorts) = [(Symbol, Sort)] -> ([Symbol], [Sort])
forall a b. [(a, b)] -> ([a], [b])
unzip [(Symbol, Sort)]
symSorts
mkTupleType :: Context -> Symbol -> [(String, Sort)] -> IO TupleType
mkTupleType :: Context -> Symbol -> [(String, Sort)] -> IO TupleType
mkTupleType Context
ctx Symbol
sym [(String, Sort)]
fs = do [(Symbol, Sort)]
fs' <- ([Symbol] -> [Sort] -> [(Symbol, Sort)])
-> [Sort] -> [Symbol] -> [(Symbol, Sort)]
forall a b c. (a -> b -> c) -> b -> a -> c
flip [Symbol] -> [Sort] -> [(Symbol, Sort)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((String, Sort) -> Sort) -> [(String, Sort)] -> [Sort]
forall a b. (a -> b) -> [a] -> [b]
map (String, Sort) -> Sort
forall a b. (a, b) -> b
snd [(String, Sort)]
fs) ([Symbol] -> [(Symbol, Sort)])
-> IO [Symbol] -> IO [(Symbol, Sort)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ((String, Sort) -> IO Symbol) -> [(String, Sort)] -> IO [Symbol]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (Context -> String -> IO Symbol
mkStringSymbol Context
ctx (String -> IO Symbol)
-> ((String, Sort) -> String) -> (String, Sort) -> IO Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String, Sort) -> String
forall a b. (a, b) -> a
fst) [(String, Sort)]
fs
(Sort
tupleSort, FuncDecl
tupleCons, [FuncDecl]
tupleProjs) <- Context
-> Symbol -> [(Symbol, Sort)] -> IO (Sort, FuncDecl, [FuncDecl])
mkTupleSort Context
ctx Symbol
sym [(Symbol, Sort)]
fs'
let namedTupleProjs :: [(String, FuncDecl)]
namedTupleProjs = [String] -> [FuncDecl] -> [(String, FuncDecl)]
forall a b. [a] -> [b] -> [(a, b)]
zip (((String, Sort) -> String) -> [(String, Sort)] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (String, Sort) -> String
forall a b. (a, b) -> a
fst [(String, Sort)]
fs) [FuncDecl]
tupleProjs
TupleType -> IO TupleType
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (TupleType -> IO TupleType) -> TupleType -> IO TupleType
forall a b. (a -> b) -> a -> b
$ TupleType {Sort
tupleSort :: Sort
tupleSort :: Sort
tupleSort, FuncDecl
tupleCons :: FuncDecl
tupleCons :: FuncDecl
tupleCons, [(String, FuncDecl)]
namedTupleProjs :: [(String, FuncDecl)]
namedTupleProjs :: [(String, FuncDecl)]
namedTupleProjs}
mkTuple :: Context -> TupleType -> [AST] -> IO AST
mkTuple :: Context -> TupleType -> [AST] -> IO AST
mkTuple Context
ctx TupleType{FuncDecl
tupleCons :: TupleType -> FuncDecl
tupleCons :: FuncDecl
tupleCons} [AST]
args = Context -> FuncDecl -> [AST] -> IO AST
mkApp Context
ctx FuncDecl
tupleCons [AST]
args
mkIndexTuple :: Context -> TupleType -> Int -> AST -> IO AST
mkIndexTuple :: Context -> TupleType -> Int -> AST -> IO AST
mkIndexTuple Context
ctx TupleType
tt Int
i AST
tup
| Int
0 Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Int
i Bool -> Bool -> Bool
&& Int
i Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< [FuncDecl] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (TupleType -> [FuncDecl]
tupleProjs TupleType
tt) = Context -> FuncDecl -> [AST] -> IO AST
mkApp Context
ctx (TupleType -> [FuncDecl]
tupleProjs TupleType
tt [FuncDecl] -> Int -> FuncDecl
forall a. HasCallStack => [a] -> Int -> a
!! Int
i) [AST
tup]
| Bool
otherwise = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Invalid tuple index used."
mkProjTuple :: Context -> TupleType -> String -> AST -> IO AST
mkProjTuple :: Context -> TupleType -> String -> AST -> IO AST
mkProjTuple Context
ctx TupleType{[(String, FuncDecl)]
namedTupleProjs :: TupleType -> [(String, FuncDecl)]
namedTupleProjs :: [(String, FuncDecl)]
namedTupleProjs} String
f AST
tup = case String -> [(String, FuncDecl)] -> Maybe FuncDecl
forall a b. Eq a => a -> [(a, b)] -> Maybe b
lookup String
f [(String, FuncDecl)]
namedTupleProjs of
Just FuncDecl
proj -> Context -> FuncDecl -> [AST] -> IO AST
mkApp Context
ctx FuncDecl
proj [AST
tup]
Maybe FuncDecl
Nothing -> String -> IO AST
forall a. HasCallStack => String -> a
error String
"Invalid tuple field used."
mkEnumerationSort :: Context
-> Symbol
-> [Symbol]
-> IO (Sort, [FuncDecl], [FuncDecl])
mkEnumerationSort :: Context -> Symbol -> [Symbol] -> IO (Sort, [FuncDecl], [FuncDecl])
mkEnumerationSort Context
ctx Symbol
sortName [Symbol]
constNames = let hn :: Int
hn = [Symbol] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Symbol]
constNames in
Int
-> (Ptr (Ptr Z3_func_decl) -> IO (Sort, [FuncDecl], [FuncDecl]))
-> IO (Sort, [FuncDecl], [FuncDecl])
forall a b. Storable a => Int -> (Ptr a -> IO b) -> IO b
allocaArray Int
hn ((Ptr (Ptr Z3_func_decl) -> IO (Sort, [FuncDecl], [FuncDecl]))
-> IO (Sort, [FuncDecl], [FuncDecl]))
-> (Ptr (Ptr Z3_func_decl) -> IO (Sort, [FuncDecl], [FuncDecl]))
-> IO (Sort, [FuncDecl], [FuncDecl])
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_func_decl)
constDeclsPtr ->
Int
-> (Ptr (Ptr Z3_func_decl) -> IO (Sort, [FuncDecl], [FuncDecl]))
-> IO (Sort, [FuncDecl], [FuncDecl])
forall a b. Storable a => Int -> (Ptr a -> IO b) -> IO b
allocaArray Int
hn ((Ptr (Ptr Z3_func_decl) -> IO (Sort, [FuncDecl], [FuncDecl]))
-> IO (Sort, [FuncDecl], [FuncDecl]))
-> (Ptr (Ptr Z3_func_decl) -> IO (Sort, [FuncDecl], [FuncDecl]))
-> IO (Sort, [FuncDecl], [FuncDecl])
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_func_decl)
testDeclsPtr ->
do Sort
s <- (Ptr Z3_context
-> Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort))
-> Context
-> ((Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort))
-> IO Sort
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort)
z3_mk_enumeration_sort Context
ctx (((Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort))
-> IO Sort)
-> ((Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort))
-> IO Sort
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort)
f ->
[Symbol]
-> (CUInt -> Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Symbol]
constNames ((CUInt -> Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort))
-> (CUInt -> Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort)
forall a b. (a -> b) -> a -> b
$ \CUInt
n Ptr (Ptr Z3_symbol)
constNamesPtr ->
Symbol -> (Ptr Z3_symbol -> IO (Ptr Z3_sort)) -> IO (Ptr Z3_sort)
forall r. Symbol -> (Ptr Z3_symbol -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Symbol
sortName ((Ptr Z3_symbol -> IO (Ptr Z3_sort)) -> IO (Ptr Z3_sort))
-> (Ptr Z3_symbol -> IO (Ptr Z3_sort)) -> IO (Ptr Z3_sort)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_symbol
sortNamePtr ->
Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort)
f Ptr Z3_symbol
sortNamePtr CUInt
n Ptr (Ptr Z3_symbol)
constNamesPtr Ptr (Ptr Z3_func_decl)
constDeclsPtr Ptr (Ptr Z3_func_decl)
testDeclsPtr
[FuncDecl]
constDecls <- Context -> Int -> Ptr (Ptr Z3_func_decl) -> IO [FuncDecl]
forall h c.
(Marshal h c, Storable c) =>
Context -> Int -> Ptr c -> IO [h]
peekArrayToHs Context
ctx Int
hn Ptr (Ptr Z3_func_decl)
constDeclsPtr
[FuncDecl]
testDecls <- Context -> Int -> Ptr (Ptr Z3_func_decl) -> IO [FuncDecl]
forall h c.
(Marshal h c, Storable c) =>
Context -> Int -> Ptr c -> IO [h]
peekArrayToHs Context
ctx Int
hn Ptr (Ptr Z3_func_decl)
testDeclsPtr
(Sort, [FuncDecl], [FuncDecl]) -> IO (Sort, [FuncDecl], [FuncDecl])
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Sort
s, [FuncDecl]
constDecls, [FuncDecl]
testDecls)
mkListSort :: Context
-> Symbol
-> Sort
-> IO (Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
mkListSort :: Context
-> Symbol
-> Sort
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
mkListSort Context
ctx Symbol
sortName Sort
elemSort =
(Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> (Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_func_decl)
nilDeclPtr ->
(Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> (Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_func_decl)
isNilDeclPtr ->
(Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> (Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_func_decl)
consDeclPtr ->
(Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> (Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_func_decl)
isConsDeclPtr ->
(Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> (Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_func_decl)
headDeclPtr ->
(Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> (Ptr (Ptr Z3_func_decl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_func_decl)
tailDeclPtr ->
Symbol
-> (Ptr Z3_symbol
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall r. Symbol -> (Ptr Z3_symbol -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Symbol
sortName ((Ptr Z3_symbol
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> (Ptr Z3_symbol
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_symbol
sortNamePtr ->
Sort
-> (Ptr Z3_sort
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall r. Sort -> (Ptr Z3_sort -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Sort
elemSort ((Ptr Z3_sort
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> (Ptr Z3_sort
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl))
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_sort
elemSortPtr ->
do Sort
listSort <- (Ptr Z3_context
-> Ptr Z3_symbol
-> Ptr Z3_sort
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort))
-> Context
-> ((Ptr Z3_symbol
-> Ptr Z3_sort
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort))
-> IO Sort
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_symbol
-> Ptr Z3_sort
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort)
z3_mk_list_sort Context
ctx (((Ptr Z3_symbol
-> Ptr Z3_sort
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort))
-> IO Sort)
-> ((Ptr Z3_symbol
-> Ptr Z3_sort
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort))
-> IO (Ptr Z3_sort))
-> IO Sort
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_symbol
-> Ptr Z3_sort
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort)
f ->
Ptr Z3_symbol
-> Ptr Z3_sort
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_sort)
f Ptr Z3_symbol
sortNamePtr Ptr Z3_sort
elemSortPtr Ptr (Ptr Z3_func_decl)
nilDeclPtr Ptr (Ptr Z3_func_decl)
isNilDeclPtr Ptr (Ptr Z3_func_decl)
consDeclPtr Ptr (Ptr Z3_func_decl)
isConsDeclPtr Ptr (Ptr Z3_func_decl)
headDeclPtr Ptr (Ptr Z3_func_decl)
tailDeclPtr
FuncDecl
nilDecl <- Context -> Ptr Z3_func_decl -> IO FuncDecl
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
ctx (Ptr Z3_func_decl -> IO FuncDecl)
-> IO (Ptr Z3_func_decl) -> IO FuncDecl
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_func_decl)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Z3_func_decl)
nilDeclPtr
FuncDecl
isNilDecl <- Context -> Ptr Z3_func_decl -> IO FuncDecl
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
ctx (Ptr Z3_func_decl -> IO FuncDecl)
-> IO (Ptr Z3_func_decl) -> IO FuncDecl
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_func_decl)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Z3_func_decl)
isNilDeclPtr
FuncDecl
consDecl <- Context -> Ptr Z3_func_decl -> IO FuncDecl
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
ctx (Ptr Z3_func_decl -> IO FuncDecl)
-> IO (Ptr Z3_func_decl) -> IO FuncDecl
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_func_decl)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Z3_func_decl)
consDeclPtr
FuncDecl
isConsDecl <- Context -> Ptr Z3_func_decl -> IO FuncDecl
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
ctx (Ptr Z3_func_decl -> IO FuncDecl)
-> IO (Ptr Z3_func_decl) -> IO FuncDecl
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_func_decl)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Z3_func_decl)
isConsDeclPtr
FuncDecl
headDecl <- Context -> Ptr Z3_func_decl -> IO FuncDecl
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
ctx (Ptr Z3_func_decl -> IO FuncDecl)
-> IO (Ptr Z3_func_decl) -> IO FuncDecl
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_func_decl)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Z3_func_decl)
headDeclPtr
FuncDecl
tailDecl <- Context -> Ptr Z3_func_decl -> IO FuncDecl
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
ctx (Ptr Z3_func_decl -> IO FuncDecl)
-> IO (Ptr Z3_func_decl) -> IO FuncDecl
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_func_decl)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Z3_func_decl)
tailDeclPtr
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
-> IO
(Sort, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl, FuncDecl)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Sort
listSort, FuncDecl
nilDecl, FuncDecl
isNilDecl, FuncDecl
consDecl, FuncDecl
isConsDecl, FuncDecl
headDecl, FuncDecl
tailDecl)
mkConstructor :: Context
-> Symbol
-> Symbol
-> [(Symbol, Maybe Sort, Int)]
-> IO Constructor
mkConstructor :: Context
-> Symbol
-> Symbol
-> [(Symbol, Maybe Sort, Int)]
-> IO Constructor
mkConstructor Context
c Symbol
sym Symbol
recog [(Symbol, Maybe Sort, Int)]
symSortsRefs =
Context -> (Ptr Z3_context -> IO Constructor) -> IO Constructor
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContextError Context
c ((Ptr Z3_context -> IO Constructor) -> IO Constructor)
-> (Ptr Z3_context -> IO Constructor) -> IO Constructor
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr ->
Symbol -> (Ptr Z3_symbol -> IO Constructor) -> IO Constructor
forall r. Symbol -> (Ptr Z3_symbol -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Symbol
sym ((Ptr Z3_symbol -> IO Constructor) -> IO Constructor)
-> (Ptr Z3_symbol -> IO Constructor) -> IO Constructor
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_symbol
symPtr ->
Symbol -> (Ptr Z3_symbol -> IO Constructor) -> IO Constructor
forall r. Symbol -> (Ptr Z3_symbol -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Symbol
recog ((Ptr Z3_symbol -> IO Constructor) -> IO Constructor)
-> (Ptr Z3_symbol -> IO Constructor) -> IO Constructor
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_symbol
recogPtr ->
[Symbol]
-> (CUInt -> Ptr (Ptr Z3_symbol) -> IO Constructor)
-> IO Constructor
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Symbol]
syms ((CUInt -> Ptr (Ptr Z3_symbol) -> IO Constructor)
-> IO Constructor)
-> (CUInt -> Ptr (Ptr Z3_symbol) -> IO Constructor)
-> IO Constructor
forall a b. (a -> b) -> a -> b
$ \ CUInt
n Ptr (Ptr Z3_symbol)
symsPtr ->
[Maybe Sort]
-> (Ptr (Ptr Z3_sort) -> IO Constructor) -> IO Constructor
forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray [Maybe Sort]
maybeSorts ((Ptr (Ptr Z3_sort) -> IO Constructor) -> IO Constructor)
-> (Ptr (Ptr Z3_sort) -> IO Constructor) -> IO Constructor
forall a b. (a -> b) -> a -> b
$ \ Ptr (Ptr Z3_sort)
sortsPtr ->
[Integer] -> (Ptr CUInt -> IO Constructor) -> IO Constructor
forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray ((Int -> Integer) -> [Int] -> [Integer]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Integer
forall a. Integral a => a -> Integer
toInteger [Int]
refs) ((Ptr CUInt -> IO Constructor) -> IO Constructor)
-> (Ptr CUInt -> IO Constructor) -> IO Constructor
forall a b. (a -> b) -> a -> b
$ \ Ptr CUInt
refsPtr -> do
Ptr Z3_constructor
constructor <- Ptr Z3_context
-> IO (Ptr Z3_constructor) -> IO (Ptr Z3_constructor)
forall a. Ptr Z3_context -> IO a -> IO a
checkError Ptr Z3_context
cPtr (IO (Ptr Z3_constructor) -> IO (Ptr Z3_constructor))
-> IO (Ptr Z3_constructor) -> IO (Ptr Z3_constructor)
forall a b. (a -> b) -> a -> b
$ Ptr Z3_context
-> Ptr Z3_symbol
-> Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> Ptr CUInt
-> IO (Ptr Z3_constructor)
z3_mk_constructor
Ptr Z3_context
cPtr Ptr Z3_symbol
symPtr Ptr Z3_symbol
recogPtr CUInt
n Ptr (Ptr Z3_symbol)
symsPtr Ptr (Ptr Z3_sort)
sortsPtr Ptr CUInt
refsPtr
Context -> Ptr Z3_constructor -> IO Constructor
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
c Ptr Z3_constructor
constructor
where ([Symbol]
syms, [Maybe Sort]
maybeSorts, [Int]
refs) = [(Symbol, Maybe Sort, Int)] -> ([Symbol], [Maybe Sort], [Int])
forall a b c. [(a, b, c)] -> ([a], [b], [c])
unzip3 [(Symbol, Maybe Sort, Int)]
symSortsRefs
mkDatatype :: Context
-> Symbol
-> [Constructor]
-> IO Sort
mkDatatype :: Context -> Symbol -> [Constructor] -> IO Sort
mkDatatype Context
c Symbol
sym [Constructor]
consList = [Constructor]
-> (CUInt -> Ptr (Ptr Z3_constructor) -> IO Sort) -> IO Sort
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Constructor]
consList ((CUInt -> Ptr (Ptr Z3_constructor) -> IO Sort) -> IO Sort)
-> (CUInt -> Ptr (Ptr Z3_constructor) -> IO Sort) -> IO Sort
forall a b. (a -> b) -> a -> b
$ \ CUInt
n Ptr (Ptr Z3_constructor)
consPtrs -> do
Context -> (Ptr Z3_context -> IO (Ptr Z3_sort)) -> IO Sort
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c ((Ptr Z3_context -> IO (Ptr Z3_sort)) -> IO Sort)
-> (Ptr Z3_context -> IO (Ptr Z3_sort)) -> IO Sort
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context
-> Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_constructor)
-> IO (Ptr Z3_sort)
z3_mk_datatype Ptr Z3_context
cPtr (Symbol -> Ptr Z3_symbol
unSymbol Symbol
sym) CUInt
n Ptr (Ptr Z3_constructor)
consPtrs
mkConstructorList :: Context
-> [Constructor]
-> IO ConstructorList
mkConstructorList :: Context -> [Constructor] -> IO ConstructorList
mkConstructorList Context
c [Constructor]
consList = [Constructor]
-> (CUInt -> Ptr (Ptr Z3_constructor) -> IO ConstructorList)
-> IO ConstructorList
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Constructor]
consList ((CUInt -> Ptr (Ptr Z3_constructor) -> IO ConstructorList)
-> IO ConstructorList)
-> (CUInt -> Ptr (Ptr Z3_constructor) -> IO ConstructorList)
-> IO ConstructorList
forall a b. (a -> b) -> a -> b
$ \ CUInt
n Ptr (Ptr Z3_constructor)
consPtrs -> do
Context
-> (Ptr Z3_context -> IO (Ptr Z3_constructor_list))
-> IO ConstructorList
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c ((Ptr Z3_context -> IO (Ptr Z3_constructor_list))
-> IO ConstructorList)
-> (Ptr Z3_context -> IO (Ptr Z3_constructor_list))
-> IO ConstructorList
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context
-> CUInt
-> Ptr (Ptr Z3_constructor)
-> IO (Ptr Z3_constructor_list)
z3_mk_constructor_list Ptr Z3_context
cPtr CUInt
n Ptr (Ptr Z3_constructor)
consPtrs
mkDatatypes :: Context
-> [Symbol]
-> [[Constructor]]
-> IO ([Sort])
mkDatatypes :: Context -> [Symbol] -> [[Constructor]] -> IO [Sort]
mkDatatypes Context
c [Symbol]
syms [[Constructor]]
consLists =
if [[Constructor]] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [[Constructor]]
consLists Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
n then do
[ConstructorList]
consLists' <- ([Constructor] -> IO ConstructorList)
-> [[Constructor]] -> IO [ConstructorList]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (Context -> [Constructor] -> IO ConstructorList
mkConstructorList Context
c) [[Constructor]]
consLists
Context -> (Ptr Z3_context -> IO [Sort]) -> IO [Sort]
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContextError Context
c ((Ptr Z3_context -> IO [Sort]) -> IO [Sort])
-> (Ptr Z3_context -> IO [Sort]) -> IO [Sort]
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr ->
[Symbol]
-> (CUInt -> Ptr (Ptr Z3_symbol) -> IO [Sort]) -> IO [Sort]
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Symbol]
syms ((CUInt -> Ptr (Ptr Z3_symbol) -> IO [Sort]) -> IO [Sort])
-> (CUInt -> Ptr (Ptr Z3_symbol) -> IO [Sort]) -> IO [Sort]
forall a b. (a -> b) -> a -> b
$ \ CUInt
symLen Ptr (Ptr Z3_symbol)
symsPtr ->
[ConstructorList]
-> (Ptr (Ptr Z3_constructor_list) -> IO [Sort]) -> IO [Sort]
forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray [ConstructorList]
consLists' ((Ptr (Ptr Z3_constructor_list) -> IO [Sort]) -> IO [Sort])
-> (Ptr (Ptr Z3_constructor_list) -> IO [Sort]) -> IO [Sort]
forall a b. (a -> b) -> a -> b
$ \ Ptr (Ptr Z3_constructor_list)
consPtr ->
Int -> (Ptr (Ptr Z3_sort) -> IO [Sort]) -> IO [Sort]
forall a b. Storable a => Int -> (Ptr a -> IO b) -> IO b
allocaArray Int
n ((Ptr (Ptr Z3_sort) -> IO [Sort]) -> IO [Sort])
-> (Ptr (Ptr Z3_sort) -> IO [Sort]) -> IO [Sort]
forall a b. (a -> b) -> a -> b
$ \ Ptr (Ptr Z3_sort)
sortsPtr -> do
Ptr Z3_context
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> Ptr (Ptr Z3_constructor_list)
-> IO ()
z3_mk_datatypes Ptr Z3_context
cPtr CUInt
symLen Ptr (Ptr Z3_symbol)
symsPtr Ptr (Ptr Z3_sort)
sortsPtr Ptr (Ptr Z3_constructor_list)
consPtr
Context -> Int -> Ptr (Ptr Z3_sort) -> IO [Sort]
forall h c.
(Marshal h c, Storable c) =>
Context -> Int -> Ptr c -> IO [h]
peekArrayToHs Context
c Int
n Ptr (Ptr Z3_sort)
sortsPtr
else
String -> IO [Sort]
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkDatatypes: lists of different length"
where n :: Int
n = [Symbol] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Symbol]
syms
mkSetSort :: Context -> Sort -> IO Sort
mkSetSort :: Context -> Sort -> IO Sort
mkSetSort = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_sort))
-> Context -> Sort -> IO Sort
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_sort)
z3_mk_set_sort
mkFuncDecl :: Context
-> Symbol
-> [Sort]
-> Sort
-> IO FuncDecl
mkFuncDecl :: Context -> Symbol -> [Sort] -> Sort -> IO FuncDecl
mkFuncDecl Context
ctx Symbol
smb [Sort]
dom Sort
rng =
(Ptr Z3_context
-> Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl))
-> Context
-> ((Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> IO FuncDecl
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl)
z3_mk_func_decl Context
ctx (((Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> IO FuncDecl)
-> ((Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> IO FuncDecl
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl)
f ->
Symbol
-> (Ptr Z3_symbol -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl)
forall r. Symbol -> (Ptr Z3_symbol -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Symbol
smb ((Ptr Z3_symbol -> IO (Ptr Z3_func_decl)) -> IO (Ptr Z3_func_decl))
-> (Ptr Z3_symbol -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_symbol
ptrSym ->
[Sort]
-> (CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Sort]
dom ((CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> (CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl)
forall a b. (a -> b) -> a -> b
$ \CUInt
domNum Ptr (Ptr Z3_sort)
domArr ->
Sort
-> (Ptr Z3_sort -> IO (Ptr Z3_func_decl)) -> IO (Ptr Z3_func_decl)
forall r. Sort -> (Ptr Z3_sort -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Sort
rng ((Ptr Z3_sort -> IO (Ptr Z3_func_decl)) -> IO (Ptr Z3_func_decl))
-> (Ptr Z3_sort -> IO (Ptr Z3_func_decl)) -> IO (Ptr Z3_func_decl)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_sort
ptrRange ->
Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl)
f Ptr Z3_symbol
ptrSym CUInt
domNum Ptr (Ptr Z3_sort)
domArr Ptr Z3_sort
ptrRange
mkApp :: Context -> FuncDecl -> [AST] -> IO AST
mkApp :: Context -> FuncDecl -> [AST] -> IO AST
mkApp Context
ctx FuncDecl
fd [AST]
args = (Ptr Z3_context
-> Ptr Z3_func_decl
-> CUInt
-> Ptr (Ptr Z3_ast)
-> IO (Ptr Z3_ast))
-> Context
-> ((Ptr Z3_func_decl
-> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_func_decl -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_app Context
ctx (((Ptr Z3_func_decl
-> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((Ptr Z3_func_decl
-> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_func_decl -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f ->
FuncDecl
-> (Ptr Z3_func_decl -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall r. FuncDecl -> (Ptr Z3_func_decl -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c FuncDecl
fd ((Ptr Z3_func_decl -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (Ptr Z3_func_decl -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_func_decl
fdPtr ->
[AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
args ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr ->
Ptr Z3_func_decl -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f Ptr Z3_func_decl
fdPtr CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr
mkConst :: Context -> Symbol -> Sort -> IO AST
mkConst :: Context -> Symbol -> Sort -> IO AST
mkConst = (Ptr Z3_context -> Ptr Z3_symbol -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Symbol -> Sort -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_symbol -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_const
mkFreshFuncDecl :: Context -> String -> [Sort] -> Sort -> IO FuncDecl
mkFreshFuncDecl :: Context -> String -> [Sort] -> Sort -> IO FuncDecl
mkFreshFuncDecl Context
ctx String
str [Sort]
dom Sort
rng =
String -> (Z3_string -> IO FuncDecl) -> IO FuncDecl
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
str ((Z3_string -> IO FuncDecl) -> IO FuncDecl)
-> (Z3_string -> IO FuncDecl) -> IO FuncDecl
forall a b. (a -> b) -> a -> b
$ \Z3_string
cstr ->
(Ptr Z3_context
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl))
-> Context
-> ((Z3_string
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> IO FuncDecl
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl)
forall z3_context.
Ptr z3_context
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl)
z3_mk_fresh_func_decl Context
ctx (((Z3_string
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> IO FuncDecl)
-> ((Z3_string
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> IO FuncDecl
forall a b. (a -> b) -> a -> b
$ \Z3_string
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl)
f ->
[Sort]
-> (CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Sort]
dom ((CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> (CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl)
forall a b. (a -> b) -> a -> b
$ \CUInt
domNum Ptr (Ptr Z3_sort)
domArr ->
Sort
-> (Ptr Z3_sort -> IO (Ptr Z3_func_decl)) -> IO (Ptr Z3_func_decl)
forall r. Sort -> (Ptr Z3_sort -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Sort
rng ((Ptr Z3_sort -> IO (Ptr Z3_func_decl)) -> IO (Ptr Z3_func_decl))
-> (Ptr Z3_sort -> IO (Ptr Z3_func_decl)) -> IO (Ptr Z3_func_decl)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_sort
ptrRange ->
Z3_string
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl)
f Z3_string
cstr CUInt
domNum Ptr (Ptr Z3_sort)
domArr Ptr Z3_sort
ptrRange
mkFreshConst :: Context
-> String
-> Sort
-> IO AST
mkFreshConst :: Context -> String -> Sort -> IO AST
mkFreshConst = (Ptr Z3_context -> Z3_string -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> String -> Sort -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Z3_string -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_fresh_const
mkRecFuncDecl :: Context
-> Symbol
-> [Sort]
-> Sort
-> IO FuncDecl
mkRecFuncDecl :: Context -> Symbol -> [Sort] -> Sort -> IO FuncDecl
mkRecFuncDecl Context
ctx Symbol
smb [Sort]
dom Sort
rng =
(Ptr Z3_context
-> Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl))
-> Context
-> ((Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> IO FuncDecl
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl)
z3_mk_rec_func_decl Context
ctx (((Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> IO FuncDecl)
-> ((Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> IO FuncDecl
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl)
f ->
Symbol
-> (Ptr Z3_symbol -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl)
forall r. Symbol -> (Ptr Z3_symbol -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Symbol
smb ((Ptr Z3_symbol -> IO (Ptr Z3_func_decl)) -> IO (Ptr Z3_func_decl))
-> (Ptr Z3_symbol -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_symbol
ptrSym ->
[Sort]
-> (CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Sort]
dom ((CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> (CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl)
forall a b. (a -> b) -> a -> b
$ \CUInt
domNum Ptr (Ptr Z3_sort)
domArr ->
Sort
-> (Ptr Z3_sort -> IO (Ptr Z3_func_decl)) -> IO (Ptr Z3_func_decl)
forall r. Sort -> (Ptr Z3_sort -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Sort
rng ((Ptr Z3_sort -> IO (Ptr Z3_func_decl)) -> IO (Ptr Z3_func_decl))
-> (Ptr Z3_sort -> IO (Ptr Z3_func_decl)) -> IO (Ptr Z3_func_decl)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_sort
ptrRange ->
Ptr Z3_symbol
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr Z3_sort
-> IO (Ptr Z3_func_decl)
f Ptr Z3_symbol
ptrSym CUInt
domNum Ptr (Ptr Z3_sort)
domArr Ptr Z3_sort
ptrRange
addRecDef :: Context
-> FuncDecl
-> [AST]
-> AST
-> IO ()
addRecDef :: Context -> FuncDecl -> [AST] -> AST -> IO ()
addRecDef Context
ctx FuncDecl
decl [AST]
args AST
body =
(Ptr Z3_context
-> Ptr Z3_func_decl
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr Z3_ast
-> IO ())
-> Context
-> ((Ptr Z3_func_decl
-> CUInt -> Ptr (Ptr Z3_ast) -> Ptr Z3_ast -> IO ())
-> IO ())
-> IO ()
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_func_decl
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr Z3_ast
-> IO ()
z3_add_rec_def Context
ctx (((Ptr Z3_func_decl
-> CUInt -> Ptr (Ptr Z3_ast) -> Ptr Z3_ast -> IO ())
-> IO ())
-> IO ())
-> ((Ptr Z3_func_decl
-> CUInt -> Ptr (Ptr Z3_ast) -> Ptr Z3_ast -> IO ())
-> IO ())
-> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_func_decl
-> CUInt -> Ptr (Ptr Z3_ast) -> Ptr Z3_ast -> IO ()
f ->
FuncDecl -> (Ptr Z3_func_decl -> IO ()) -> IO ()
forall r. FuncDecl -> (Ptr Z3_func_decl -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c FuncDecl
decl ((Ptr Z3_func_decl -> IO ()) -> IO ())
-> (Ptr Z3_func_decl -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_func_decl
declPtr ->
[AST] -> (CUInt -> Ptr (Ptr Z3_ast) -> IO ()) -> IO ()
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
args ((CUInt -> Ptr (Ptr Z3_ast) -> IO ()) -> IO ())
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr ->
AST -> (Ptr Z3_ast -> IO ()) -> IO ()
forall r. AST -> (Ptr Z3_ast -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c AST
body ((Ptr Z3_ast -> IO ()) -> IO ()) -> (Ptr Z3_ast -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast
bodyPtr ->
Ptr Z3_func_decl
-> CUInt -> Ptr (Ptr Z3_ast) -> Ptr Z3_ast -> IO ()
f Ptr Z3_func_decl
declPtr CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr Ptr Z3_ast
bodyPtr
mkVar :: Context -> Symbol -> Sort -> IO AST
mkVar :: Context -> Symbol -> Sort -> IO AST
mkVar = Context -> Symbol -> Sort -> IO AST
mkConst
mkBoolVar :: Context -> Symbol -> IO AST
mkBoolVar :: Context -> Symbol -> IO AST
mkBoolVar Context
ctx Symbol
sym = Context -> Symbol -> Sort -> IO AST
mkVar Context
ctx Symbol
sym (Sort -> IO AST) -> IO Sort -> IO AST
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Context -> IO Sort
mkBoolSort Context
ctx
mkRealVar :: Context -> Symbol -> IO AST
mkRealVar :: Context -> Symbol -> IO AST
mkRealVar Context
ctx Symbol
sym = Context -> Symbol -> Sort -> IO AST
mkVar Context
ctx Symbol
sym (Sort -> IO AST) -> IO Sort -> IO AST
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Context -> IO Sort
mkRealSort Context
ctx
mkIntVar :: Context -> Symbol -> IO AST
mkIntVar :: Context -> Symbol -> IO AST
mkIntVar Context
ctx Symbol
sym = Context -> Symbol -> Sort -> IO AST
mkVar Context
ctx Symbol
sym (Sort -> IO AST) -> IO Sort -> IO AST
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Context -> IO Sort
mkIntSort Context
ctx
mkBvVar :: Context -> Symbol
-> Int
-> IO AST
mkBvVar :: Context -> Symbol -> Int -> IO AST
mkBvVar Context
ctx Symbol
sym Int
sz = Context -> Symbol -> Sort -> IO AST
mkVar Context
ctx Symbol
sym (Sort -> IO AST) -> IO Sort -> IO AST
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Context -> Int -> IO Sort
forall int. Integral int => Context -> int -> IO Sort
mkBvSort Context
ctx Int
sz
mkFreshVar :: Context -> String -> Sort -> IO AST
mkFreshVar :: Context -> String -> Sort -> IO AST
mkFreshVar = Context -> String -> Sort -> IO AST
mkFreshConst
mkFreshBoolVar :: Context -> String -> IO AST
mkFreshBoolVar :: Context -> String -> IO AST
mkFreshBoolVar Context
ctx String
str = Context -> String -> Sort -> IO AST
mkFreshVar Context
ctx String
str (Sort -> IO AST) -> IO Sort -> IO AST
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Context -> IO Sort
mkBoolSort Context
ctx
mkFreshRealVar :: Context -> String -> IO AST
mkFreshRealVar :: Context -> String -> IO AST
mkFreshRealVar Context
ctx String
str = Context -> String -> Sort -> IO AST
mkFreshVar Context
ctx String
str (Sort -> IO AST) -> IO Sort -> IO AST
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Context -> IO Sort
mkRealSort Context
ctx
mkFreshIntVar :: Context -> String -> IO AST
mkFreshIntVar :: Context -> String -> IO AST
mkFreshIntVar Context
ctx String
str = Context -> String -> Sort -> IO AST
mkFreshVar Context
ctx String
str (Sort -> IO AST) -> IO Sort -> IO AST
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Context -> IO Sort
mkIntSort Context
ctx
mkFreshBvVar :: Context -> String
-> Int
-> IO AST
mkFreshBvVar :: Context -> String -> Int -> IO AST
mkFreshBvVar Context
ctx String
str Int
sz = Context -> String -> Sort -> IO AST
mkFreshVar Context
ctx String
str (Sort -> IO AST) -> IO Sort -> IO AST
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Context -> Int -> IO Sort
forall int. Integral int => Context -> int -> IO Sort
mkBvSort Context
ctx Int
sz
mkTrue :: Context -> IO AST
mkTrue :: Context -> IO AST
mkTrue = (Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_true
mkFalse :: Context -> IO AST
mkFalse :: Context -> IO AST
mkFalse = (Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_false
mkEq :: Context -> AST -> AST -> IO AST
mkEq :: Context -> AST -> AST -> IO AST
mkEq = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_eq
mkDistinct :: Context -> [AST] -> IO AST
mkDistinct :: Context -> [AST] -> IO AST
mkDistinct =
String
-> (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> [AST]
-> IO AST
liftAstN_err String
"Z3.Base.mkDistinct: empty list of expressions" Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_distinct
mkDistinct1 :: Context -> NonEmpty AST -> IO AST
mkDistinct1 :: Context -> NonEmpty AST -> IO AST
mkDistinct1 = (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context -> NonEmpty AST -> IO AST
liftAstN1 Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_distinct
mkNot :: Context -> AST -> IO AST
mkNot :: Context -> AST -> IO AST
mkNot = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_not
mkIte :: Context -> AST -> AST -> AST -> IO AST
mkIte :: Context -> AST -> AST -> AST -> IO AST
mkIte = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> AST -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_ite
mkIff :: Context -> AST -> AST -> IO AST
mkIff :: Context -> AST -> AST -> IO AST
mkIff = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_iff
mkImplies :: Context -> AST -> AST -> IO AST
mkImplies :: Context -> AST -> AST -> IO AST
mkImplies = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_implies
mkXor :: Context -> AST -> AST -> IO AST
mkXor :: Context -> AST -> AST -> IO AST
mkXor = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_xor
mkAnd :: Context -> [AST] -> IO AST
mkAnd :: Context -> [AST] -> IO AST
mkAnd = (Ptr Z3_context -> IO (Ptr Z3_ast))
-> (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> [AST]
-> IO AST
liftAstN Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_true Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_and
mkOr :: Context -> [AST] -> IO AST
mkOr :: Context -> [AST] -> IO AST
mkOr = (Ptr Z3_context -> IO (Ptr Z3_ast))
-> (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> [AST]
-> IO AST
liftAstN Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_false Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_or
mkBool :: Context -> Bool -> IO AST
mkBool :: Context -> Bool -> IO AST
mkBool Context
ctx Bool
False = Context -> IO AST
mkFalse Context
ctx
mkBool Context
ctx Bool
True = Context -> IO AST
mkTrue Context
ctx
mkAdd :: Context -> [AST] -> IO AST
mkAdd :: Context -> [AST] -> IO AST
mkAdd Context
ctx = IO AST
-> (NonEmpty AST -> IO AST) -> Maybe (NonEmpty AST) -> IO AST
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Context -> Integer -> IO AST
mkInteger Context
ctx Integer
0) ((Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context -> NonEmpty AST -> IO AST
liftAstN1 Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_add Context
ctx) (Maybe (NonEmpty AST) -> IO AST)
-> ([AST] -> Maybe (NonEmpty AST)) -> [AST] -> IO AST
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [AST] -> Maybe (NonEmpty AST)
forall a. [a] -> Maybe (NonEmpty a)
nonEmpty
mkMul :: Context -> [AST] -> IO AST
mkMul :: Context -> [AST] -> IO AST
mkMul Context
ctx = IO AST
-> (NonEmpty AST -> IO AST) -> Maybe (NonEmpty AST) -> IO AST
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (Context -> Integer -> IO AST
mkInteger Context
ctx Integer
1) ((Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context -> NonEmpty AST -> IO AST
liftAstN1 Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_mul Context
ctx) (Maybe (NonEmpty AST) -> IO AST)
-> ([AST] -> Maybe (NonEmpty AST)) -> [AST] -> IO AST
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [AST] -> Maybe (NonEmpty AST)
forall a. [a] -> Maybe (NonEmpty a)
nonEmpty
mkSub :: Context -> [AST] -> IO AST
mkSub :: Context -> [AST] -> IO AST
mkSub = String
-> (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> [AST]
-> IO AST
liftAstN_err String
"Z3.Base.mkSub: empty list of expressions" Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_sub
mkSub1 :: Context -> NonEmpty AST -> IO AST
mkSub1 :: Context -> NonEmpty AST -> IO AST
mkSub1 = (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context -> NonEmpty AST -> IO AST
liftAstN1 Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_sub
mkUnaryMinus :: Context -> AST -> IO AST
mkUnaryMinus :: Context -> AST -> IO AST
mkUnaryMinus = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_unary_minus
mkDiv :: Context -> AST -> AST -> IO AST
mkDiv :: Context -> AST -> AST -> IO AST
mkDiv = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_div
mkMod :: Context -> AST -> AST -> IO AST
mkMod :: Context -> AST -> AST -> IO AST
mkMod = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_mod
mkRem :: Context -> AST -> AST -> IO AST
mkRem :: Context -> AST -> AST -> IO AST
mkRem = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_rem
mkPower :: Context -> AST -> AST -> IO AST
mkPower :: Context -> AST -> AST -> IO AST
mkPower = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_power
mkLt :: Context -> AST -> AST -> IO AST
mkLt :: Context -> AST -> AST -> IO AST
mkLt = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_lt
mkLe :: Context -> AST -> AST -> IO AST
mkLe :: Context -> AST -> AST -> IO AST
mkLe = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_le
mkGt :: Context -> AST -> AST -> IO AST
mkGt :: Context -> AST -> AST -> IO AST
mkGt = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_gt
mkGe :: Context -> AST -> AST -> IO AST
mkGe :: Context -> AST -> AST -> IO AST
mkGe = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_ge
mkInt2Real :: Context -> AST -> IO AST
mkInt2Real :: Context -> AST -> IO AST
mkInt2Real = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_int2real
mkReal2Int :: Context -> AST -> IO AST
mkReal2Int :: Context -> AST -> IO AST
mkReal2Int = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_real2int
mkIsInt :: Context -> AST -> IO AST
mkIsInt :: Context -> AST -> IO AST
mkIsInt = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_is_int
mkBvnot :: Context -> AST -> IO AST
mkBvnot :: Context -> AST -> IO AST
mkBvnot = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvnot
mkBvredand :: Context -> AST -> IO AST
mkBvredand :: Context -> AST -> IO AST
mkBvredand = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvredand
mkBvredor :: Context -> AST -> IO AST
mkBvredor :: Context -> AST -> IO AST
mkBvredor = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvredor
mkBvand :: Context -> AST -> AST -> IO AST
mkBvand :: Context -> AST -> AST -> IO AST
mkBvand = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvand
mkBvor :: Context -> AST -> AST -> IO AST
mkBvor :: Context -> AST -> AST -> IO AST
mkBvor = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvor
mkBvxor :: Context -> AST -> AST -> IO AST
mkBvxor :: Context -> AST -> AST -> IO AST
mkBvxor = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvxor
mkBvnand :: Context -> AST -> AST -> IO AST
mkBvnand :: Context -> AST -> AST -> IO AST
mkBvnand = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvnand
mkBvnor :: Context -> AST -> AST -> IO AST
mkBvnor :: Context -> AST -> AST -> IO AST
mkBvnor = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvnor
mkBvxnor :: Context -> AST -> AST -> IO AST
mkBvxnor :: Context -> AST -> AST -> IO AST
mkBvxnor = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvxnor
mkBvneg :: Context -> AST -> IO AST
mkBvneg :: Context -> AST -> IO AST
mkBvneg = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvneg
mkBvadd :: Context -> AST -> AST -> IO AST
mkBvadd :: Context -> AST -> AST -> IO AST
mkBvadd = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvadd
mkBvsub :: Context -> AST -> AST -> IO AST
mkBvsub :: Context -> AST -> AST -> IO AST
mkBvsub = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvsub
mkBvmul :: Context -> AST -> AST -> IO AST
mkBvmul :: Context -> AST -> AST -> IO AST
mkBvmul = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvmul
mkBvudiv :: Context -> AST -> AST -> IO AST
mkBvudiv :: Context -> AST -> AST -> IO AST
mkBvudiv = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvudiv
mkBvsdiv :: Context -> AST -> AST -> IO AST
mkBvsdiv :: Context -> AST -> AST -> IO AST
mkBvsdiv = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvsdiv
mkBvurem :: Context -> AST -> AST -> IO AST
mkBvurem :: Context -> AST -> AST -> IO AST
mkBvurem = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvurem
mkBvsrem :: Context -> AST -> AST -> IO AST
mkBvsrem :: Context -> AST -> AST -> IO AST
mkBvsrem = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvsrem
mkBvsmod :: Context -> AST -> AST -> IO AST
mkBvsmod :: Context -> AST -> AST -> IO AST
mkBvsmod = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvsmod
mkBvult :: Context -> AST -> AST -> IO AST
mkBvult :: Context -> AST -> AST -> IO AST
mkBvult = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvult
mkBvslt :: Context -> AST -> AST -> IO AST
mkBvslt :: Context -> AST -> AST -> IO AST
mkBvslt = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvslt
mkBvule :: Context -> AST -> AST -> IO AST
mkBvule :: Context -> AST -> AST -> IO AST
mkBvule = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvule
mkBvsle :: Context -> AST -> AST -> IO AST
mkBvsle :: Context -> AST -> AST -> IO AST
mkBvsle = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvsle
mkBvuge :: Context -> AST -> AST -> IO AST
mkBvuge :: Context -> AST -> AST -> IO AST
mkBvuge = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvuge
mkBvsge :: Context -> AST -> AST -> IO AST
mkBvsge :: Context -> AST -> AST -> IO AST
mkBvsge = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvsge
mkBvugt :: Context -> AST -> AST -> IO AST
mkBvugt :: Context -> AST -> AST -> IO AST
mkBvugt = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvugt
mkBvsgt :: Context -> AST -> AST -> IO AST
mkBvsgt :: Context -> AST -> AST -> IO AST
mkBvsgt = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvsgt
mkConcat :: Context -> AST -> AST -> IO AST
mkConcat :: Context -> AST -> AST -> IO AST
mkConcat = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_concat
mkExtract :: Context -> Int -> Int -> AST -> IO AST
= (Ptr Z3_context -> CUInt -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> Int -> Int -> AST -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context -> CUInt -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_extract
mkSignExt :: Context -> Int -> AST -> IO AST
mkSignExt :: Context -> Int -> AST -> IO AST
mkSignExt = (Ptr Z3_context -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> Int -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_sign_ext
mkZeroExt :: Context -> Int -> AST -> IO AST
mkZeroExt :: Context -> Int -> AST -> IO AST
mkZeroExt = (Ptr Z3_context -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> Int -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_zero_ext
mkRepeat :: Context -> Int -> AST -> IO AST
mkRepeat :: Context -> Int -> AST -> IO AST
mkRepeat = (Ptr Z3_context -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> Int -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_repeat
mkBvshl :: Context -> AST -> AST -> IO AST
mkBvshl :: Context -> AST -> AST -> IO AST
mkBvshl = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvshl
mkBvlshr :: Context -> AST -> AST -> IO AST
mkBvlshr :: Context -> AST -> AST -> IO AST
mkBvlshr = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvlshr
mkBvashr :: Context -> AST -> AST -> IO AST
mkBvashr :: Context -> AST -> AST -> IO AST
mkBvashr = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvashr
mkRotateLeft :: Context -> Int -> AST -> IO AST
mkRotateLeft :: Context -> Int -> AST -> IO AST
mkRotateLeft = (Ptr Z3_context -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> Int -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_rotate_left
mkRotateRight :: Context -> Int -> AST -> IO AST
mkRotateRight :: Context -> Int -> AST -> IO AST
mkRotateRight = (Ptr Z3_context -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> Int -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_rotate_right
mkExtRotateLeft :: Context -> AST -> AST -> IO AST
mkExtRotateLeft :: Context -> AST -> AST -> IO AST
mkExtRotateLeft = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_ext_rotate_left
mkExtRotateRight :: Context -> AST -> AST -> IO AST
mkExtRotateRight :: Context -> AST -> AST -> IO AST
mkExtRotateRight = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_ext_rotate_right
mkInt2bv :: Context -> Int -> AST -> IO AST
mkInt2bv :: Context -> Int -> AST -> IO AST
mkInt2bv = (Ptr Z3_context -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> Int -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CUInt -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_int2bv
mkBv2int :: Context -> AST -> Bool -> IO AST
mkBv2int :: Context -> AST -> Bool -> IO AST
mkBv2int = (Ptr Z3_context -> Ptr Z3_ast -> Z3_bool -> IO (Ptr Z3_ast))
-> Context -> AST -> Bool -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Z3_bool -> IO (Ptr Z3_ast)
z3_mk_bv2int
mkBvaddNoOverflow :: Context -> AST -> AST -> Bool -> IO AST
mkBvaddNoOverflow :: Context -> AST -> AST -> Bool -> IO AST
mkBvaddNoOverflow = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Z3_bool -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> Bool -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Z3_bool -> IO (Ptr Z3_ast)
z3_mk_bvadd_no_overflow
mkBvaddNoUnderflow :: Context -> AST -> AST -> IO AST
mkBvaddNoUnderflow :: Context -> AST -> AST -> IO AST
mkBvaddNoUnderflow = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvadd_no_underflow
mkBvsubNoOverflow :: Context -> AST -> AST -> IO AST
mkBvsubNoOverflow :: Context -> AST -> AST -> IO AST
mkBvsubNoOverflow = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvsub_no_overflow
mkBvsubNoUnderflow :: Context -> AST -> AST -> IO AST
mkBvsubNoUnderflow :: Context -> AST -> AST -> IO AST
mkBvsubNoUnderflow = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvsub_no_underflow
mkBvsdivNoOverflow :: Context -> AST -> AST -> IO AST
mkBvsdivNoOverflow :: Context -> AST -> AST -> IO AST
mkBvsdivNoOverflow = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvsdiv_no_overflow
mkBvnegNoOverflow :: Context -> AST -> IO AST
mkBvnegNoOverflow :: Context -> AST -> IO AST
mkBvnegNoOverflow = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvneg_no_overflow
mkBvmulNoOverflow :: Context -> AST -> AST -> Bool -> IO AST
mkBvmulNoOverflow :: Context -> AST -> AST -> Bool -> IO AST
mkBvmulNoOverflow = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Z3_bool -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> Bool -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Z3_bool -> IO (Ptr Z3_ast)
z3_mk_bvmul_no_overflow
mkBvmulNoUnderflow :: Context -> AST -> AST -> IO AST
mkBvmulNoUnderflow :: Context -> AST -> AST -> IO AST
mkBvmulNoUnderflow = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_bvmul_no_underflow
mkSelect :: Context
-> AST
-> AST
-> IO AST
mkSelect :: Context -> AST -> AST -> IO AST
mkSelect = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_select
mkStore :: Context
-> AST
-> AST
-> AST
-> IO AST
mkStore :: Context -> AST -> AST -> AST -> IO AST
mkStore = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> AST -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_store
mkConstArray :: Context
-> Sort
-> AST
-> IO AST
mkConstArray :: Context -> Sort -> AST -> IO AST
mkConstArray = (Ptr Z3_context -> Ptr Z3_sort -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> Sort -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_sort -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_const_array
mkMap :: Context
-> FuncDecl
-> [AST]
-> IO AST
mkMap :: Context -> FuncDecl -> [AST] -> IO AST
mkMap Context
ctx FuncDecl
fun [AST]
args = (Ptr Z3_context
-> Ptr Z3_func_decl
-> CUInt
-> Ptr (Ptr Z3_ast)
-> IO (Ptr Z3_ast))
-> Context
-> ((Ptr Z3_func_decl
-> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_func_decl -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_map Context
ctx (((Ptr Z3_func_decl
-> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((Ptr Z3_func_decl
-> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_func_decl -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f ->
FuncDecl
-> (Ptr Z3_func_decl -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall r. FuncDecl -> (Ptr Z3_func_decl -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c FuncDecl
fun ((Ptr Z3_func_decl -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (Ptr Z3_func_decl -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_func_decl
funPtr ->
[AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
args ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr ->
Ptr Z3_func_decl -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f Ptr Z3_func_decl
funPtr CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr
mkArrayDefault :: Context
-> AST
-> IO AST
mkArrayDefault :: Context -> AST -> IO AST
mkArrayDefault = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_array_default
mkEmptySet :: Context
-> Sort
-> IO AST
mkEmptySet :: Context -> Sort -> IO AST
mkEmptySet = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Sort -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_empty_set
mkFullSet :: Context
-> Sort
-> IO AST
mkFullSet :: Context -> Sort -> IO AST
mkFullSet = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Sort -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_full_set
mkSetAdd :: Context
-> AST
-> AST
-> IO AST
mkSetAdd :: Context -> AST -> AST -> IO AST
mkSetAdd = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_set_add
mkSetDel :: Context
-> AST
-> AST
-> IO AST
mkSetDel :: Context -> AST -> AST -> IO AST
mkSetDel = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_set_del
mkSetUnion :: Context -> [AST] -> IO AST
mkSetUnion :: Context -> [AST] -> IO AST
mkSetUnion Context
ctx [AST]
args = (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_set_union Context
ctx (((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ \CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f ->
[AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
args ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr ->
CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr
mkSetIntersect :: Context -> [AST] -> IO AST
mkSetIntersect :: Context -> [AST] -> IO AST
mkSetIntersect Context
ctx [AST]
args = (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_set_intersect Context
ctx (((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ \CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f ->
[AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
args ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr ->
CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f CUInt
argsNum Ptr (Ptr Z3_ast)
argsArr
mkSetDifference :: Context
-> AST
-> AST
-> IO AST
mkSetDifference :: Context -> AST -> AST -> IO AST
mkSetDifference = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_set_difference
mkSetComplement :: Context
-> AST
-> IO AST
mkSetComplement :: Context -> AST -> IO AST
mkSetComplement = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_set_complement
mkSetMember :: Context
-> AST
-> AST
-> IO AST
mkSetMember :: Context -> AST -> AST -> IO AST
mkSetMember = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_set_member
mkSetSubset :: Context
-> AST
-> AST
-> IO AST
mkSetSubset :: Context -> AST -> AST -> IO AST
mkSetSubset = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_set_subset
mkNumeral :: Context -> String -> Sort -> IO AST
mkNumeral :: Context -> String -> Sort -> IO AST
mkNumeral = (Ptr Z3_context -> Z3_string -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> String -> Sort -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Z3_string -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_numeral
mkReal :: Context -> Int
-> Int
-> IO AST
mkReal :: Context -> Int -> Int -> IO AST
mkReal Context
ctx Int
num Int
den
| Int
den Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= Int
0 = (Ptr Z3_context
-> Z3_error_code -> Z3_error_code -> IO (Ptr Z3_ast))
-> Context -> Int -> Int -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Z3_error_code -> Z3_error_code -> IO (Ptr Z3_ast)
z3_mk_real Context
ctx Int
num Int
den
| Bool
otherwise = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkReal: zero denominator"
mkInt :: Context -> Int -> Sort -> IO AST
mkInt :: Context -> Int -> Sort -> IO AST
mkInt = (Ptr Z3_context -> Z3_error_code -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Int -> Sort -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Z3_error_code -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_int
mkUnsignedInt :: Context -> Word -> Sort -> IO AST
mkUnsignedInt :: Context -> Word -> Sort -> IO AST
mkUnsignedInt = (Ptr Z3_context -> CUInt -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Word -> Sort -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CUInt -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_unsigned_int
mkInt64 :: Context -> Int64 -> Sort -> IO AST
mkInt64 :: Context -> Int64 -> Sort -> IO AST
mkInt64 = (Ptr Z3_context -> CLLong -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Int64 -> Sort -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CLLong -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_int64
mkUnsignedInt64 :: Context -> Word64 -> Sort -> IO AST
mkUnsignedInt64 :: Context -> Word64 -> Sort -> IO AST
mkUnsignedInt64 = (Ptr Z3_context -> CULLong -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Word64 -> Sort -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CULLong -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_unsigned_int64
mkIntegral :: Integral a => Context -> a -> Sort -> IO AST
mkIntegral :: forall a. Integral a => Context -> a -> Sort -> IO AST
mkIntegral Context
c a
n Sort
s = Context -> String -> Sort -> IO AST
mkNumeral Context
c String
n_str Sort
s
where n_str :: String
n_str = Integer -> String
forall a. Show a => a -> String
show (Integer -> String) -> Integer -> String
forall a b. (a -> b) -> a -> b
$ a -> Integer
forall a. Integral a => a -> Integer
toInteger a
n
mkRational :: Context -> Rational -> IO AST
mkRational :: Context -> Rational -> IO AST
mkRational = Context -> Rational -> IO AST
forall r. Real r => Context -> r -> IO AST
mkRealNum
mkFixed :: HasResolution a => Context -> Fixed a -> IO AST
mkFixed :: forall a. HasResolution a => Context -> Fixed a -> IO AST
mkFixed Context
ctx = Context -> Rational -> IO AST
mkRational Context
ctx (Rational -> IO AST) -> (Fixed a -> Rational) -> Fixed a -> IO AST
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Fixed a -> Rational
forall a. Real a => a -> Rational
toRational
mkRealNum :: Real r => Context -> r -> IO AST
mkRealNum :: forall r. Real r => Context -> r -> IO AST
mkRealNum Context
c r
n = Context -> String -> Sort -> IO AST
mkNumeral Context
c String
n_str (Sort -> IO AST) -> IO Sort -> IO AST
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Context -> IO Sort
mkRealSort Context
c
where r :: Rational
r = r -> Rational
forall a. Real a => a -> Rational
toRational r
n
r_n :: Integer
r_n = Integer -> Integer
forall a. Integral a => a -> Integer
toInteger (Integer -> Integer) -> Integer -> Integer
forall a b. (a -> b) -> a -> b
$ Rational -> Integer
forall a. Ratio a -> a
numerator Rational
r
r_d :: Integer
r_d = Integer -> Integer
forall a. Integral a => a -> Integer
toInteger (Integer -> Integer) -> Integer -> Integer
forall a b. (a -> b) -> a -> b
$ Rational -> Integer
forall a. Ratio a -> a
denominator Rational
r
n_str :: String
n_str = Integer -> String
forall a. Show a => a -> String
show Integer
r_n String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" / " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Integer -> String
forall a. Show a => a -> String
show Integer
r_d
mkInteger :: Context -> Integer -> IO AST
mkInteger :: Context -> Integer -> IO AST
mkInteger = Context -> Integer -> IO AST
forall a. Integral a => Context -> a -> IO AST
mkIntNum
mkIntNum :: Integral a => Context -> a -> IO AST
mkIntNum :: forall a. Integral a => Context -> a -> IO AST
mkIntNum Context
ctx a
n = Context -> a -> Sort -> IO AST
forall a. Integral a => Context -> a -> Sort -> IO AST
mkIntegral Context
ctx a
n (Sort -> IO AST) -> IO Sort -> IO AST
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Context -> IO Sort
mkIntSort Context
ctx
mkBitvector :: Context -> Int
-> Integer
-> IO AST
mkBitvector :: Context -> Int -> Integer -> IO AST
mkBitvector = Context -> Int -> Integer -> IO AST
forall i. Integral i => Context -> Int -> i -> IO AST
mkBvNum
mkBvNum :: Integral i => Context -> Int
-> i
-> IO AST
mkBvNum :: forall i. Integral i => Context -> Int -> i -> IO AST
mkBvNum Context
ctx Int
s i
n = Context -> i -> Sort -> IO AST
forall a. Integral a => Context -> a -> Sort -> IO AST
mkIntegral Context
ctx i
n (Sort -> IO AST) -> IO Sort -> IO AST
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Context -> Int -> IO Sort
forall int. Integral int => Context -> int -> IO Sort
mkBvSort Context
ctx Int
s
mkSeqSort :: Context -> Sort -> IO Sort
mkSeqSort :: Context -> Sort -> IO Sort
mkSeqSort = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_sort))
-> Context -> Sort -> IO Sort
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_sort)
z3_mk_seq_sort
isSeqSort :: Context -> Sort -> IO Bool
isSeqSort :: Context -> Sort -> IO Bool
isSeqSort = (Ptr Z3_context -> Ptr Z3_sort -> IO Z3_bool)
-> Context -> Sort -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO Z3_bool
z3_is_seq_sort
mkReSort :: Context -> Sort -> IO Sort
mkReSort :: Context -> Sort -> IO Sort
mkReSort = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_sort))
-> Context -> Sort -> IO Sort
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_sort)
z3_mk_re_sort
isReSort :: Context -> Sort -> IO Bool
isReSort :: Context -> Sort -> IO Bool
isReSort = (Ptr Z3_context -> Ptr Z3_sort -> IO Z3_bool)
-> Context -> Sort -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO Z3_bool
z3_is_re_sort
mkStringSort :: Context -> IO Sort
mkStringSort :: Context -> IO Sort
mkStringSort = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_string_sort
isStringSort :: Context -> Sort -> IO Bool
isStringSort :: Context -> Sort -> IO Bool
isStringSort = (Ptr Z3_context -> Ptr Z3_sort -> IO Z3_bool)
-> Context -> Sort -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO Z3_bool
z3_is_string_sort
mkString :: Context -> String -> IO AST
mkString :: Context -> String -> IO AST
mkString = (Ptr Z3_context -> Z3_string -> IO (Ptr Z3_ast))
-> Context -> String -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Z3_string -> IO (Ptr Z3_ast)
z3_mk_string
isString :: Context -> AST -> IO Bool
isString :: Context -> AST -> IO Bool
isString = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_is_string
getString :: Context -> AST -> IO String
getString :: Context -> AST -> IO String
getString = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_string)
-> Context -> AST -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_string
z3_get_string
mkSeqEmpty :: Context -> Sort -> IO AST
mkSeqEmpty :: Context -> Sort -> IO AST
mkSeqEmpty = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Sort -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_seq_empty
mkSeqUnit :: Context -> AST -> IO AST
mkSeqUnit :: Context -> AST -> IO AST
mkSeqUnit = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_seq_unit
mkSeqConcat :: Context -> [AST] -> IO AST
mkSeqConcat :: Context -> [AST] -> IO AST
mkSeqConcat Context
c [AST]
as
| [AST] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [AST]
as = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkSeqConcet: empty list of expressions"
| Bool
otherwise = (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_seq_concat Context
c (((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ [AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
as
mkSeqPrefix :: Context
-> AST
-> AST
-> IO AST
mkSeqPrefix :: Context -> AST -> AST -> IO AST
mkSeqPrefix = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_seq_prefix
mkSeqSuffix :: Context
-> AST
-> AST
-> IO AST
mkSeqSuffix :: Context -> AST -> AST -> IO AST
mkSeqSuffix = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_seq_suffix
mkSeqContains :: Context
-> AST
-> AST
-> IO AST
mkSeqContains :: Context -> AST -> AST -> IO AST
mkSeqContains = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_seq_contains
mkStrLt :: Context
-> AST
-> AST
-> IO AST
mkStrLt :: Context -> AST -> AST -> IO AST
mkStrLt = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_str_lt
mkStrLe :: Context
-> AST
-> AST
-> IO AST
mkStrLe :: Context -> AST -> AST -> IO AST
mkStrLe = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_str_le
mkSeqExtract :: Context
-> AST
-> AST
-> AST
-> IO AST
= (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> AST -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_seq_extract
mkSeqReplace :: Context
-> AST
-> AST
-> AST
-> IO AST
mkSeqReplace :: Context -> AST -> AST -> AST -> IO AST
mkSeqReplace = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> AST -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_seq_replace
mkSeqAt :: Context
-> AST
-> AST
-> IO AST
mkSeqAt :: Context -> AST -> AST -> IO AST
mkSeqAt = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_seq_at
mkSeqLength :: Context
-> AST
-> IO AST
mkSeqLength :: Context -> AST -> IO AST
mkSeqLength = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_seq_length
mkSeqIndex :: Context
-> AST
-> AST
-> AST
-> IO AST
mkSeqIndex :: Context -> AST -> AST -> AST -> IO AST
mkSeqIndex = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> AST -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_seq_index
mkStrToInt :: Context -> AST -> IO AST
mkStrToInt :: Context -> AST -> IO AST
mkStrToInt = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_str_to_int
mkIntToStr :: Context -> AST -> IO AST
mkIntToStr :: Context -> AST -> IO AST
mkIntToStr = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_int_to_str
mkSeqToRe :: Context -> AST -> IO AST
mkSeqToRe :: Context -> AST -> IO AST
mkSeqToRe = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_seq_to_re
mkSeqInRe :: Context
-> AST
-> AST
-> IO AST
mkSeqInRe :: Context -> AST -> AST -> IO AST
mkSeqInRe = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_seq_in_re
mkRePlus :: Context -> AST -> IO AST
mkRePlus :: Context -> AST -> IO AST
mkRePlus = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_re_plus
mkReStar :: Context -> AST -> IO AST
mkReStar :: Context -> AST -> IO AST
mkReStar = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_re_star
mkReOption :: Context -> AST -> IO AST
mkReOption :: Context -> AST -> IO AST
mkReOption = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_re_option
mkReUnion :: (Integral int) => Context -> int -> [AST] -> IO AST
mkReUnion :: forall int. Integral int => Context -> int -> [AST] -> IO AST
mkReUnion Context
c int
i [AST]
as
| int
i int -> int -> Bool
forall a. Ord a => a -> a -> Bool
< int
0 = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkReUnion: negative size"
| int
i int -> int -> Bool
forall a. Ord a => a -> a -> Bool
>= int
0 Bool -> Bool -> Bool
&& [AST] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [AST]
as = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkReUnion: empty list of expressions"
| Bool
otherwise = (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_re_union Context
c (((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ [AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
as
mkReConcat :: (Integral int) => Context -> int -> [AST] -> IO AST
mkReConcat :: forall int. Integral int => Context -> int -> [AST] -> IO AST
mkReConcat Context
c int
i [AST]
as
| int
i int -> int -> Bool
forall a. Ord a => a -> a -> Bool
< int
0 = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkReConcat: negative size"
| int
i int -> int -> Bool
forall a. Ord a => a -> a -> Bool
>= int
0 Bool -> Bool -> Bool
&& [AST] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [AST]
as = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkReConcat: empty list of expressions"
| Bool
otherwise = (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_re_concat Context
c (((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ [AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
as
mkReRange :: Context
-> AST
-> AST
-> IO AST
mkReRange :: Context -> AST -> AST -> IO AST
mkReRange = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_re_range
mkReLoop :: (Integral int)
=> Context
-> AST
-> int
-> int
-> IO AST
mkReLoop :: forall int. Integral int => Context -> AST -> int -> int -> IO AST
mkReLoop Context
c AST
a int
i int
j
| int
i int -> int -> Bool
forall a. Ord a => a -> a -> Bool
< int
0 = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkReLoop: negative size"
| int
i int -> int -> Bool
forall a. Ord a => a -> a -> Bool
< int
0 = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkReLoop: empty list of expressions"
| Bool
otherwise = (Ptr Z3_context -> Ptr Z3_ast -> CUInt -> CUInt -> IO (Ptr Z3_ast))
-> Context -> AST -> int -> int -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context -> Ptr Z3_ast -> CUInt -> CUInt -> IO (Ptr Z3_ast)
z3_mk_re_loop Context
c AST
a int
i int
j
mkReIntersect :: (Integral int) => Context -> int -> [AST] -> IO AST
mkReIntersect :: forall int. Integral int => Context -> int -> [AST] -> IO AST
mkReIntersect Context
c int
i [AST]
as
| int
i int -> int -> Bool
forall a. Ord a => a -> a -> Bool
< int
0 = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkReIntersect: negative size"
| int
i int -> int -> Bool
forall a. Ord a => a -> a -> Bool
>= int
0 Bool -> Bool -> Bool
&& [AST] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [AST]
as = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkReIntersect: empty list of expressions"
| Bool
otherwise = (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_mk_re_intersect Context
c (((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ [AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
as
mkReComplement :: Context -> AST -> IO AST
mkReComplement :: Context -> AST -> IO AST
mkReComplement = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_re_complement
mkReEmpty :: Context -> Sort -> IO AST
mkReEmpty :: Context -> Sort -> IO AST
mkReEmpty = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Sort -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_re_empty
mkReFull :: Context -> Sort -> IO AST
mkReFull :: Context -> Sort -> IO AST
mkReFull = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Sort -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_re_full
mkPattern :: Context
-> [AST]
-> IO Pattern
mkPattern :: Context -> [AST] -> IO Pattern
mkPattern Context
_ [] = String -> IO Pattern
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkPattern: empty list of expressions"
mkPattern Context
c [AST]
es = (Ptr Z3_context
-> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_pattern))
-> Context
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_pattern))
-> IO (Ptr Z3_pattern))
-> IO Pattern
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_pattern)
z3_mk_pattern Context
c (((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_pattern))
-> IO (Ptr Z3_pattern))
-> IO Pattern)
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_pattern))
-> IO (Ptr Z3_pattern))
-> IO Pattern
forall a b. (a -> b) -> a -> b
$ [AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_pattern))
-> IO (Ptr Z3_pattern)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
es
mkBound :: Context
-> Int
-> Sort
-> IO AST
mkBound :: Context -> Int -> Sort -> IO AST
mkBound Context
c Int
i Sort
s
| Int
i Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Int
0 = (Ptr Z3_context -> CUInt -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Int -> Sort -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CUInt -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_bound Context
c Int
i Sort
s
| Bool
otherwise = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkBound: negative de-Bruijn index"
type MkZ3Quantifier = Ptr Z3_context -> CUInt
-> CUInt -> Ptr (Ptr Z3_pattern)
-> CUInt -> Ptr (Ptr Z3_sort) -> Ptr (Ptr Z3_symbol)
-> Ptr Z3_ast
-> IO (Ptr Z3_ast)
marshalMkQ :: MkZ3Quantifier
-> Context
-> Int
-> [Pattern]
-> [Symbol]
-> [Sort]
-> AST
-> IO AST
marshalMkQ :: MkZ3Quantifier
-> Context
-> Int
-> [Pattern]
-> [Symbol]
-> [Sort]
-> AST
-> IO AST
marshalMkQ MkZ3Quantifier
z3_mk_Q Context
ctx Int
weight [Pattern]
pats [Symbol]
x [Sort]
s AST
body = MkZ3Quantifier
-> Context
-> ((CUInt
-> CUInt
-> Ptr (Ptr Z3_pattern)
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr (Ptr Z3_symbol)
-> Ptr Z3_ast
-> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal MkZ3Quantifier
z3_mk_Q Context
ctx (((CUInt
-> CUInt
-> Ptr (Ptr Z3_pattern)
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr (Ptr Z3_symbol)
-> Ptr Z3_ast
-> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((CUInt
-> CUInt
-> Ptr (Ptr Z3_pattern)
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr (Ptr Z3_symbol)
-> Ptr Z3_ast
-> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ \CUInt
-> CUInt
-> Ptr (Ptr Z3_pattern)
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr (Ptr Z3_symbol)
-> Ptr Z3_ast
-> IO (Ptr Z3_ast)
f ->
[Pattern]
-> (CUInt -> Ptr (Ptr Z3_pattern) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Pattern]
pats ((CUInt -> Ptr (Ptr Z3_pattern) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> (CUInt -> Ptr (Ptr Z3_pattern) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
n Ptr (Ptr Z3_pattern)
patsArr ->
[Symbol]
-> (Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray [Symbol]
x ((Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_symbol)
xArr ->
[Sort] -> (Ptr (Ptr Z3_sort) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray [Sort]
s ((Ptr (Ptr Z3_sort) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (Ptr (Ptr Z3_sort) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_sort)
sArr ->
Int -> (CUInt -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall r. Int -> (CUInt -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Int
weight ((CUInt -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (CUInt -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
weightC ->
AST -> (Ptr Z3_ast -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall r. AST -> (Ptr Z3_ast -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c AST
body ((Ptr Z3_ast -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (Ptr Z3_ast -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast
bodyPtr ->
CUInt
-> CUInt
-> Ptr (Ptr Z3_pattern)
-> CUInt
-> Ptr (Ptr Z3_sort)
-> Ptr (Ptr Z3_symbol)
-> Ptr Z3_ast
-> IO (Ptr Z3_ast)
f CUInt
weightC CUInt
n Ptr (Ptr Z3_pattern)
patsArr CUInt
len Ptr (Ptr Z3_sort)
sArr Ptr (Ptr Z3_symbol)
xArr Ptr Z3_ast
bodyPtr
where len :: CUInt
len
| Int
l Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0 = String -> CUInt
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkQuantifier:\
\ quantifier with 0 bound variables"
| Int
l Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= [Symbol] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Symbol]
x = String -> CUInt
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkQuantifier:\
\ different number of symbols and sorts"
| Bool
otherwise = Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
l
where l :: Int
l = [Sort] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Sort]
s
mkForall :: Context
-> [Pattern]
-> [Symbol]
-> [Sort]
-> AST
-> IO AST
mkForall :: Context -> [Pattern] -> [Symbol] -> [Sort] -> AST -> IO AST
mkForall = (Context
-> Int -> [Pattern] -> [Symbol] -> [Sort] -> AST -> IO AST)
-> Int
-> Context
-> [Pattern]
-> [Symbol]
-> [Sort]
-> AST
-> IO AST
forall a b c. (a -> b -> c) -> b -> a -> c
flip Context -> Int -> [Pattern] -> [Symbol] -> [Sort] -> AST -> IO AST
mkForallW Int
0
mkForallW :: Context
-> Int
-> [Pattern]
-> [Symbol]
-> [Sort]
-> AST
-> IO AST
mkForallW :: Context -> Int -> [Pattern] -> [Symbol] -> [Sort] -> AST -> IO AST
mkForallW = MkZ3Quantifier
-> Context
-> Int
-> [Pattern]
-> [Symbol]
-> [Sort]
-> AST
-> IO AST
marshalMkQ MkZ3Quantifier
z3_mk_forall
mkExistsW :: Context -> Int -> [Pattern] -> [Symbol] -> [Sort] -> AST -> IO AST
mkExistsW :: Context -> Int -> [Pattern] -> [Symbol] -> [Sort] -> AST -> IO AST
mkExistsW = MkZ3Quantifier
-> Context
-> Int
-> [Pattern]
-> [Symbol]
-> [Sort]
-> AST
-> IO AST
marshalMkQ MkZ3Quantifier
z3_mk_exists
mkExists :: Context -> [Pattern] -> [Symbol] -> [Sort] -> AST -> IO AST
mkExists :: Context -> [Pattern] -> [Symbol] -> [Sort] -> AST -> IO AST
mkExists = (Context
-> Int -> [Pattern] -> [Symbol] -> [Sort] -> AST -> IO AST)
-> Int
-> Context
-> [Pattern]
-> [Symbol]
-> [Sort]
-> AST
-> IO AST
forall a b c. (a -> b -> c) -> b -> a -> c
flip Context -> Int -> [Pattern] -> [Symbol] -> [Sort] -> AST -> IO AST
mkExistsW Int
0
type MkZ3QuantifierConst = Ptr Z3_context
-> CUInt
-> CUInt
-> Ptr (Ptr Z3_app)
-> CUInt
-> Ptr (Ptr Z3_pattern)
-> Ptr Z3_ast
-> IO (Ptr Z3_ast)
marshalMkQConst :: MkZ3QuantifierConst
-> Context
-> Int
-> [Pattern]
-> [App]
-> AST
-> IO AST
marshalMkQConst :: MkZ3QuantifierConst
-> Context -> Int -> [Pattern] -> [App] -> AST -> IO AST
marshalMkQConst MkZ3QuantifierConst
z3_mk_Q_const Context
ctx Int
weight [Pattern]
pats [App]
apps AST
body =
MkZ3QuantifierConst
-> Context
-> ((CUInt
-> CUInt
-> Ptr (Ptr Z3_app)
-> CUInt
-> Ptr (Ptr Z3_pattern)
-> Ptr Z3_ast
-> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal MkZ3QuantifierConst
z3_mk_Q_const Context
ctx (((CUInt
-> CUInt
-> Ptr (Ptr Z3_app)
-> CUInt
-> Ptr (Ptr Z3_pattern)
-> Ptr Z3_ast
-> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((CUInt
-> CUInt
-> Ptr (Ptr Z3_app)
-> CUInt
-> Ptr (Ptr Z3_pattern)
-> Ptr Z3_ast
-> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ \CUInt
-> CUInt
-> Ptr (Ptr Z3_app)
-> CUInt
-> Ptr (Ptr Z3_pattern)
-> Ptr Z3_ast
-> IO (Ptr Z3_ast)
f ->
[Pattern]
-> (CUInt -> Ptr (Ptr Z3_pattern) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Pattern]
pats ((CUInt -> Ptr (Ptr Z3_pattern) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> (CUInt -> Ptr (Ptr Z3_pattern) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
patsNum Ptr (Ptr Z3_pattern)
patsArr ->
[App] -> (Ptr (Ptr Z3_app) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray [App]
apps ((Ptr (Ptr Z3_app) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (Ptr (Ptr Z3_app) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_app)
appsArr ->
Int -> (CUInt -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall r. Int -> (CUInt -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Int
weight ((CUInt -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (CUInt -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
weightC ->
AST -> (Ptr Z3_ast -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall r. AST -> (Ptr Z3_ast -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c AST
body ((Ptr Z3_ast -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (Ptr Z3_ast -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast
bodyPtr ->
CUInt
-> CUInt
-> Ptr (Ptr Z3_app)
-> CUInt
-> Ptr (Ptr Z3_pattern)
-> Ptr Z3_ast
-> IO (Ptr Z3_ast)
f CUInt
weightC CUInt
len Ptr (Ptr Z3_app)
appsArr CUInt
patsNum Ptr (Ptr Z3_pattern)
patsArr Ptr Z3_ast
bodyPtr
where len :: CUInt
len
| Int
l Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
0 = String -> CUInt
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkQuantifierConst:\
\ quantifier with 0 bound variables"
| Bool
otherwise = Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
l
where l :: Int
l = [App] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [App]
apps
mkForallWConst :: Context
-> Int
-> [Pattern]
-> [App]
-> AST
-> IO AST
mkForallWConst :: Context -> Int -> [Pattern] -> [App] -> AST -> IO AST
mkForallWConst = MkZ3QuantifierConst
-> Context -> Int -> [Pattern] -> [App] -> AST -> IO AST
marshalMkQConst MkZ3QuantifierConst
z3_mk_forall_const
mkForallConst :: Context -> [Pattern] -> [App] -> AST -> IO AST
mkForallConst :: Context -> [Pattern] -> [App] -> AST -> IO AST
mkForallConst = (Context -> Int -> [Pattern] -> [App] -> AST -> IO AST)
-> Int -> Context -> [Pattern] -> [App] -> AST -> IO AST
forall a b c. (a -> b -> c) -> b -> a -> c
flip Context -> Int -> [Pattern] -> [App] -> AST -> IO AST
mkForallWConst Int
0
mkExistsWConst :: Context
-> Int
-> [Pattern]
-> [App]
-> AST
-> IO AST
mkExistsWConst :: Context -> Int -> [Pattern] -> [App] -> AST -> IO AST
mkExistsWConst = MkZ3QuantifierConst
-> Context -> Int -> [Pattern] -> [App] -> AST -> IO AST
marshalMkQConst MkZ3QuantifierConst
z3_mk_exists_const
mkExistsConst :: Context -> [Pattern] -> [App] -> AST -> IO AST
mkExistsConst :: Context -> [Pattern] -> [App] -> AST -> IO AST
mkExistsConst = (Context -> Int -> [Pattern] -> [App] -> AST -> IO AST)
-> Int -> Context -> [Pattern] -> [App] -> AST -> IO AST
forall a b c. (a -> b -> c) -> b -> a -> c
flip Context -> Int -> [Pattern] -> [App] -> AST -> IO AST
mkExistsWConst Int
0
getSymbolString :: Context -> Symbol -> IO String
getSymbolString :: Context -> Symbol -> IO String
getSymbolString = (Ptr Z3_context -> Ptr Z3_symbol -> IO Z3_string)
-> Context -> Symbol -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_symbol -> IO Z3_string
z3_get_symbol_string
getSortName :: Context -> Sort -> IO Symbol
getSortName :: Context -> Sort -> IO Symbol
getSortName = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_symbol))
-> Context -> Sort -> IO Symbol
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_symbol)
z3_get_sort_name
sortToAst :: Context -> Sort -> IO AST
sortToAst :: Context -> Sort -> IO AST
sortToAst = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Sort -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_sort_to_ast
getSortId :: Context -> Sort -> IO Int
getSortId :: Context -> Sort -> IO Int
getSortId = (Ptr Z3_context -> Ptr Z3_sort -> IO CUInt)
-> Context -> Sort -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO CUInt
z3_get_sort_id
isEqSort :: Context -> Sort -> Sort -> IO Bool
isEqSort :: Context -> Sort -> Sort -> IO Bool
isEqSort = (Ptr Z3_context -> Ptr Z3_sort -> Ptr Z3_sort -> IO Z3_bool)
-> Context -> Sort -> Sort -> IO Bool
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_sort -> Ptr Z3_sort -> IO Z3_bool
z3_is_eq_sort
getSortKind :: Context -> Sort -> IO SortKind
getSortKind :: Context -> Sort -> IO SortKind
getSortKind Context
ctx Sort
sort = Z3_error_code -> SortKind
toSortKind (Z3_error_code -> SortKind) -> IO Z3_error_code -> IO SortKind
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Ptr Z3_context -> Ptr Z3_sort -> IO Z3_error_code)
-> Context -> Sort -> IO Z3_error_code
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO Z3_error_code
z3_get_sort_kind Context
ctx Sort
sort
where toSortKind :: Z3_sort_kind -> SortKind
toSortKind :: Z3_error_code -> SortKind
toSortKind Z3_error_code
k
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_uninterpreted_sort = SortKind
Z3_UNINTERPRETED_SORT
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_bool_sort = SortKind
Z3_BOOL_SORT
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_int_sort = SortKind
Z3_INT_SORT
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_real_sort = SortKind
Z3_REAL_SORT
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_bv_sort = SortKind
Z3_BV_SORT
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_array_sort = SortKind
Z3_ARRAY_SORT
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_datatype_sort = SortKind
Z3_DATATYPE_SORT
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_relation_sort = SortKind
Z3_RELATION_SORT
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_finite_domain_sort = SortKind
Z3_FINITE_DOMAIN_SORT
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_floating_point_sort = SortKind
Z3_FLOATING_POINT_SORT
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_rounding_mode_sort = SortKind
Z3_ROUNDING_MODE_SORT
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_unknown_sort = SortKind
Z3_UNKNOWN_SORT
| Bool
otherwise =
String -> SortKind
forall a. HasCallStack => String -> a
error String
"Z3.Base.getSortKind: unknown `Z3_sort_kind'"
getBvSortSize :: Context -> Sort -> IO Int
getBvSortSize :: Context -> Sort -> IO Int
getBvSortSize = (Ptr Z3_context -> Ptr Z3_sort -> IO CUInt)
-> Context -> Sort -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO CUInt
z3_get_bv_sort_size
getFiniteDomainSortSize :: Context -> Sort -> IO (Maybe Word64)
getFiniteDomainSortSize :: Context -> Sort -> IO (Maybe Word64)
getFiniteDomainSortSize Context
ctx Sort
sort = (Ptr CULLong -> IO (Maybe Word64)) -> IO (Maybe Word64)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CULLong -> IO (Maybe Word64)) -> IO (Maybe Word64))
-> (Ptr CULLong -> IO (Maybe Word64)) -> IO (Maybe Word64)
forall a b. (a -> b) -> a -> b
$ \Ptr CULLong
sizePtr ->
Context
-> (Ptr Z3_context -> IO (Maybe Word64)) -> IO (Maybe Word64)
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContext Context
ctx ((Ptr Z3_context -> IO (Maybe Word64)) -> IO (Maybe Word64))
-> (Ptr Z3_context -> IO (Maybe Word64)) -> IO (Maybe Word64)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
ctxPtr ->
Sort -> (Ptr Z3_sort -> IO (Maybe Word64)) -> IO (Maybe Word64)
forall r. Sort -> (Ptr Z3_sort -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Sort
sort ((Ptr Z3_sort -> IO (Maybe Word64)) -> IO (Maybe Word64))
-> (Ptr Z3_sort -> IO (Maybe Word64)) -> IO (Maybe Word64)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_sort
sortPtr ->
do Bool
success <- Z3_bool -> Bool
toBool (Z3_bool -> Bool) -> IO Z3_bool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Ptr Z3_context -> Ptr Z3_sort -> Ptr CULLong -> IO Z3_bool
z3_get_finite_domain_sort_size Ptr Z3_context
ctxPtr Ptr Z3_sort
sortPtr Ptr CULLong
sizePtr)
Bool -> IO Word64 -> IO (Maybe Word64)
forall (m :: * -> *) a. Monad m => Bool -> m a -> m (Maybe a)
returnValueToMaybe Bool
success (IO Word64 -> IO (Maybe Word64)) -> IO Word64 -> IO (Maybe Word64)
forall a b. (a -> b) -> a -> b
$ (CULLong -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (CULLong -> Word64) -> IO CULLong -> IO Word64
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr CULLong -> IO CULLong
forall a. Storable a => Ptr a -> IO a
peek Ptr CULLong
sizePtr)
getArraySortDomain :: Context -> Sort -> IO Sort
getArraySortDomain :: Context -> Sort -> IO Sort
getArraySortDomain = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_sort))
-> Context -> Sort -> IO Sort
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_sort)
z3_get_array_sort_domain
getArraySortRange :: Context -> Sort -> IO Sort
getArraySortRange :: Context -> Sort -> IO Sort
getArraySortRange = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_sort))
-> Context -> Sort -> IO Sort
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_sort)
z3_get_array_sort_range
getTupleSortMkDecl :: Context -> Sort -> IO FuncDecl
getTupleSortMkDecl :: Context -> Sort -> IO FuncDecl
getTupleSortMkDecl = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_func_decl))
-> Context -> Sort -> IO FuncDecl
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_func_decl)
z3_get_tuple_sort_mk_decl
getTupleSortNumFields :: Context -> Sort -> IO Int
getTupleSortNumFields :: Context -> Sort -> IO Int
getTupleSortNumFields = (Ptr Z3_context -> Ptr Z3_sort -> IO CUInt)
-> Context -> Sort -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO CUInt
z3_get_tuple_sort_num_fields
getTupleSortFieldDecl :: Context -> Sort -> Int -> IO FuncDecl
getTupleSortFieldDecl :: Context -> Sort -> Int -> IO FuncDecl
getTupleSortFieldDecl = (Ptr Z3_context -> Ptr Z3_sort -> CUInt -> IO (Ptr Z3_func_decl))
-> Context -> Sort -> Int -> IO FuncDecl
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_sort -> CUInt -> IO (Ptr Z3_func_decl)
z3_get_tuple_sort_field_decl
getDatatypeSortConstructors :: Context
-> Sort
-> IO [FuncDecl]
getDatatypeSortConstructors :: Context -> Sort -> IO [FuncDecl]
getDatatypeSortConstructors Context
c Sort
dtSort =
Context -> (Ptr Z3_context -> IO [FuncDecl]) -> IO [FuncDecl]
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContextError Context
c ((Ptr Z3_context -> IO [FuncDecl]) -> IO [FuncDecl])
-> (Ptr Z3_context -> IO [FuncDecl]) -> IO [FuncDecl]
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr ->
Sort -> (Ptr Z3_sort -> IO [FuncDecl]) -> IO [FuncDecl]
forall r. Sort -> (Ptr Z3_sort -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Sort
dtSort ((Ptr Z3_sort -> IO [FuncDecl]) -> IO [FuncDecl])
-> (Ptr Z3_sort -> IO [FuncDecl]) -> IO [FuncDecl]
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_sort
dtSortPtr -> do
CUInt
numCons <- Ptr Z3_context -> IO CUInt -> IO CUInt
forall a. Ptr Z3_context -> IO a -> IO a
checkError Ptr Z3_context
cPtr (IO CUInt -> IO CUInt) -> IO CUInt -> IO CUInt
forall a b. (a -> b) -> a -> b
$ Ptr Z3_context -> Ptr Z3_sort -> IO CUInt
z3_get_datatype_sort_num_constructors Ptr Z3_context
cPtr Ptr Z3_sort
dtSortPtr
(CUInt -> IO FuncDecl) -> [CUInt] -> IO [FuncDecl]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
T.mapM (Ptr Z3_sort -> CUInt -> IO FuncDecl
forall {h}.
Marshal h (Ptr Z3_func_decl) =>
Ptr Z3_sort -> CUInt -> IO h
getConstructor Ptr Z3_sort
dtSortPtr) [CUInt
0..(CUInt
numConsCUInt -> CUInt -> CUInt
forall a. Num a => a -> a -> a
-CUInt
1)]
where
getConstructor :: Ptr Z3_sort -> CUInt -> IO h
getConstructor Ptr Z3_sort
dtSortPtr CUInt
idx =
Context -> (Ptr Z3_context -> IO (Ptr Z3_func_decl)) -> IO h
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c ((Ptr Z3_context -> IO (Ptr Z3_func_decl)) -> IO h)
-> (Ptr Z3_context -> IO (Ptr Z3_func_decl)) -> IO h
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context -> Ptr Z3_sort -> CUInt -> IO (Ptr Z3_func_decl)
z3_get_datatype_sort_constructor Ptr Z3_context
cPtr Ptr Z3_sort
dtSortPtr CUInt
idx
getDatatypeSortRecognizers :: Context
-> Sort
-> IO [FuncDecl]
getDatatypeSortRecognizers :: Context -> Sort -> IO [FuncDecl]
getDatatypeSortRecognizers Context
c Sort
dtSort =
Context -> (Ptr Z3_context -> IO [FuncDecl]) -> IO [FuncDecl]
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContextError Context
c ((Ptr Z3_context -> IO [FuncDecl]) -> IO [FuncDecl])
-> (Ptr Z3_context -> IO [FuncDecl]) -> IO [FuncDecl]
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr ->
Sort -> (Ptr Z3_sort -> IO [FuncDecl]) -> IO [FuncDecl]
forall r. Sort -> (Ptr Z3_sort -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Sort
dtSort ((Ptr Z3_sort -> IO [FuncDecl]) -> IO [FuncDecl])
-> (Ptr Z3_sort -> IO [FuncDecl]) -> IO [FuncDecl]
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_sort
dtSortPtr -> do
CUInt
numCons <- Ptr Z3_context -> IO CUInt -> IO CUInt
forall a. Ptr Z3_context -> IO a -> IO a
checkError Ptr Z3_context
cPtr (IO CUInt -> IO CUInt) -> IO CUInt -> IO CUInt
forall a b. (a -> b) -> a -> b
$ Ptr Z3_context -> Ptr Z3_sort -> IO CUInt
z3_get_datatype_sort_num_constructors Ptr Z3_context
cPtr Ptr Z3_sort
dtSortPtr
(CUInt -> IO FuncDecl) -> [CUInt] -> IO [FuncDecl]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
T.mapM (Ptr Z3_sort -> CUInt -> IO FuncDecl
forall {h}.
Marshal h (Ptr Z3_func_decl) =>
Ptr Z3_sort -> CUInt -> IO h
getRecognizer Ptr Z3_sort
dtSortPtr) [CUInt
0..(CUInt
numConsCUInt -> CUInt -> CUInt
forall a. Num a => a -> a -> a
-CUInt
1)]
where
getRecognizer :: Ptr Z3_sort -> CUInt -> IO h
getRecognizer Ptr Z3_sort
dtSortPtr CUInt
idx =
Context -> (Ptr Z3_context -> IO (Ptr Z3_func_decl)) -> IO h
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c ((Ptr Z3_context -> IO (Ptr Z3_func_decl)) -> IO h)
-> (Ptr Z3_context -> IO (Ptr Z3_func_decl)) -> IO h
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context -> Ptr Z3_sort -> CUInt -> IO (Ptr Z3_func_decl)
z3_get_datatype_sort_recognizer Ptr Z3_context
cPtr Ptr Z3_sort
dtSortPtr CUInt
idx
getDatatypeSortConstructorAccessors :: Context
-> Sort
-> IO [[FuncDecl]]
getDatatypeSortConstructorAccessors :: Context -> Sort -> IO [[FuncDecl]]
getDatatypeSortConstructorAccessors Context
c Sort
dtSort =
Context -> (Ptr Z3_context -> IO [[FuncDecl]]) -> IO [[FuncDecl]]
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContextError Context
c ((Ptr Z3_context -> IO [[FuncDecl]]) -> IO [[FuncDecl]])
-> (Ptr Z3_context -> IO [[FuncDecl]]) -> IO [[FuncDecl]]
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr ->
Sort -> (Ptr Z3_sort -> IO [[FuncDecl]]) -> IO [[FuncDecl]]
forall r. Sort -> (Ptr Z3_sort -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Sort
dtSort ((Ptr Z3_sort -> IO [[FuncDecl]]) -> IO [[FuncDecl]])
-> (Ptr Z3_sort -> IO [[FuncDecl]]) -> IO [[FuncDecl]]
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_sort
dtSortPtr -> do
CUInt
numCons <- Ptr Z3_context -> IO CUInt -> IO CUInt
forall a. Ptr Z3_context -> IO a -> IO a
checkError Ptr Z3_context
cPtr (IO CUInt -> IO CUInt) -> IO CUInt -> IO CUInt
forall a b. (a -> b) -> a -> b
$ Ptr Z3_context -> Ptr Z3_sort -> IO CUInt
z3_get_datatype_sort_num_constructors Ptr Z3_context
cPtr Ptr Z3_sort
dtSortPtr
(CUInt -> IO [FuncDecl]) -> [CUInt] -> IO [[FuncDecl]]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
T.mapM (Ptr Z3_sort -> CUInt -> IO [FuncDecl]
forall {b}.
Marshal b (Ptr Z3_func_decl) =>
Ptr Z3_sort -> CUInt -> IO [b]
getAccessors Ptr Z3_sort
dtSortPtr) [CUInt
0..(CUInt
numConsCUInt -> CUInt -> CUInt
forall a. Num a => a -> a -> a
-CUInt
1)]
where
getConstructor :: Ptr Z3_sort -> CUInt -> IO (Ptr Z3_func_decl)
getConstructor Ptr Z3_sort
dtSortPtr CUInt
idx_c =
Context
-> (Ptr Z3_context -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl)
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContext Context
c ((Ptr Z3_context -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl))
-> (Ptr Z3_context -> IO (Ptr Z3_func_decl))
-> IO (Ptr Z3_func_decl)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context -> Ptr Z3_sort -> CUInt -> IO (Ptr Z3_func_decl)
z3_get_datatype_sort_constructor Ptr Z3_context
cPtr Ptr Z3_sort
dtSortPtr CUInt
idx_c
getAccessors :: Ptr Z3_sort -> CUInt -> IO [b]
getAccessors Ptr Z3_sort
dtSortPtr CUInt
idx_c = do
Ptr Z3_func_decl
consPtr <- Ptr Z3_sort -> CUInt -> IO (Ptr Z3_func_decl)
getConstructor Ptr Z3_sort
dtSortPtr CUInt
idx_c
CUInt
numAs <- Context -> (Ptr Z3_context -> IO CUInt) -> IO CUInt
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c ((Ptr Z3_context -> IO CUInt) -> IO CUInt)
-> (Ptr Z3_context -> IO CUInt) -> IO CUInt
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context -> Ptr Z3_func_decl -> IO CUInt
z3_get_arity Ptr Z3_context
cPtr Ptr Z3_func_decl
consPtr
if CUInt
numAs CUInt -> CUInt -> Bool
forall a. Ord a => a -> a -> Bool
> CUInt
0
then (CUInt -> IO b) -> [CUInt] -> IO [b]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
T.mapM (\CUInt
idx_a -> Ptr Z3_sort -> CUInt -> CUInt -> IO b
forall {h}.
Marshal h (Ptr Z3_func_decl) =>
Ptr Z3_sort -> CUInt -> CUInt -> IO h
getAccessors' Ptr Z3_sort
dtSortPtr CUInt
idx_c CUInt
idx_a) [CUInt
0..(CUInt
numAs CUInt -> CUInt -> CUInt
forall a. Num a => a -> a -> a
- CUInt
1)]
else [b] -> IO [b]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return []
getAccessors' :: Ptr Z3_sort -> CUInt -> CUInt -> IO h
getAccessors' Ptr Z3_sort
dtSortPtr CUInt
idx_c CUInt
idx_a =
Context -> (Ptr Z3_context -> IO (Ptr Z3_func_decl)) -> IO h
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c ((Ptr Z3_context -> IO (Ptr Z3_func_decl)) -> IO h)
-> (Ptr Z3_context -> IO (Ptr Z3_func_decl)) -> IO h
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context
-> Ptr Z3_sort -> CUInt -> CUInt -> IO (Ptr Z3_func_decl)
z3_get_datatype_sort_constructor_accessor Ptr Z3_context
cPtr Ptr Z3_sort
dtSortPtr CUInt
idx_c CUInt
idx_a
mkAtMost :: Context -> [AST] -> Int -> IO AST
mkAtMost :: Context -> [AST] -> Int -> IO AST
mkAtMost Context
_ctx [] Int
_n = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkAtMost: empty list of expressions"
mkAtMost Context
ctx [AST]
es Int
n =
(Ptr Z3_context
-> CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast))
-> Context
-> ((CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast)
z3_mk_atmost Context
ctx (((CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ \CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast)
f ->
[AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
es ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
esLen Ptr (Ptr Z3_ast)
esArr ->
Int -> (CUInt -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall r. Int -> (CUInt -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Int
n ((CUInt -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (CUInt -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
n' ->
CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast)
f CUInt
esLen Ptr (Ptr Z3_ast)
esArr CUInt
n'
mkAtLeast :: Context -> [AST] -> Int -> IO AST
mkAtLeast :: Context -> [AST] -> Int -> IO AST
mkAtLeast Context
_ctx [] Int
_n = String -> IO AST
forall a. HasCallStack => String -> a
error String
"Z3.Base.mkAtLeast: empty list of expressions"
mkAtLeast Context
ctx [AST]
es Int
n =
(Ptr Z3_context
-> CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast))
-> Context
-> ((CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast)
z3_mk_atleast Context
ctx (((CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ \CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast)
f ->
[AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
es ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
esLen Ptr (Ptr Z3_ast)
esArr ->
Int -> (CUInt -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall r. Int -> (CUInt -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Int
n ((CUInt -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (CUInt -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
n' ->
CUInt -> Ptr (Ptr Z3_ast) -> CUInt -> IO (Ptr Z3_ast)
f CUInt
esLen Ptr (Ptr Z3_ast)
esArr CUInt
n'
getDeclName :: Context -> FuncDecl -> IO Symbol
getDeclName :: Context -> FuncDecl -> IO Symbol
getDeclName Context
c FuncDecl
decl = FuncDecl -> (Ptr Z3_func_decl -> IO Symbol) -> IO Symbol
forall r. FuncDecl -> (Ptr Z3_func_decl -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c FuncDecl
decl ((Ptr Z3_func_decl -> IO Symbol) -> IO Symbol)
-> (Ptr Z3_func_decl -> IO Symbol) -> IO Symbol
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_func_decl
declPtr ->
Ptr Z3_symbol -> Symbol
Symbol (Ptr Z3_symbol -> Symbol) -> IO (Ptr Z3_symbol) -> IO Symbol
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Context
-> (Ptr Z3_context -> IO (Ptr Z3_symbol)) -> IO (Ptr Z3_symbol)
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContextError Context
c (\Ptr Z3_context
cPtr -> Ptr Z3_context -> Ptr Z3_func_decl -> IO (Ptr Z3_symbol)
z3_get_decl_name Ptr Z3_context
cPtr Ptr Z3_func_decl
declPtr)
getArity :: Context -> FuncDecl -> IO Int
getArity :: Context -> FuncDecl -> IO Int
getArity = (Ptr Z3_context -> Ptr Z3_func_decl -> IO CUInt)
-> Context -> FuncDecl -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_func_decl -> IO CUInt
z3_get_arity
getDomain :: Context
-> FuncDecl
-> Int
-> IO Sort
getDomain :: Context -> FuncDecl -> Int -> IO Sort
getDomain = (Ptr Z3_context -> Ptr Z3_func_decl -> CUInt -> IO (Ptr Z3_sort))
-> Context -> FuncDecl -> Int -> IO Sort
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_func_decl -> CUInt -> IO (Ptr Z3_sort)
z3_get_domain
getRange :: Context -> FuncDecl -> IO Sort
getRange :: Context -> FuncDecl -> IO Sort
getRange = (Ptr Z3_context -> Ptr Z3_func_decl -> IO (Ptr Z3_sort))
-> Context -> FuncDecl -> IO Sort
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_func_decl -> IO (Ptr Z3_sort)
z3_get_range
getDeclNumParameters :: Context -> FuncDecl -> IO Int
getDeclNumParameters :: Context -> FuncDecl -> IO Int
getDeclNumParameters = (Ptr Z3_context -> Ptr Z3_func_decl -> IO CUInt)
-> Context -> FuncDecl -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_func_decl -> IO CUInt
z3_get_decl_num_parameters
appToAst :: Context -> App -> IO AST
appToAst :: Context -> App -> IO AST
appToAst = (Ptr Z3_context -> Ptr Z3_app -> IO (Ptr Z3_ast))
-> Context -> App -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_app -> IO (Ptr Z3_ast)
z3_app_to_ast
getAppDecl :: Context -> App -> IO FuncDecl
getAppDecl :: Context -> App -> IO FuncDecl
getAppDecl = (Ptr Z3_context -> Ptr Z3_app -> IO (Ptr Z3_func_decl))
-> Context -> App -> IO FuncDecl
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_app -> IO (Ptr Z3_func_decl)
z3_get_app_decl
getAppNumArgs :: Context -> App -> IO Int
getAppNumArgs :: Context -> App -> IO Int
getAppNumArgs = (Ptr Z3_context -> Ptr Z3_app -> IO CUInt)
-> Context -> App -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_app -> IO CUInt
z3_get_app_num_args
getAppArg :: Context -> App -> Int -> IO AST
getAppArg :: Context -> App -> Int -> IO AST
getAppArg = (Ptr Z3_context -> Ptr Z3_app -> CUInt -> IO (Ptr Z3_ast))
-> Context -> App -> Int -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_app -> CUInt -> IO (Ptr Z3_ast)
z3_get_app_arg
getAppArgs :: Context -> App -> IO [AST]
getAppArgs :: Context -> App -> IO [AST]
getAppArgs Context
ctx App
a = do
Int
n <- Context -> App -> IO Int
getAppNumArgs Context
ctx App
a
[Int] -> (Int -> IO AST) -> IO [AST]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
t a -> (a -> m b) -> m (t b)
T.forM [Int
0..Int
nInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1] (Context -> App -> Int -> IO AST
getAppArg Context
ctx App
a)
getSort :: Context -> AST -> IO Sort
getSort :: Context -> AST -> IO Sort
getSort = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_sort))
-> Context -> AST -> IO Sort
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_sort)
z3_get_sort
isWellSorted :: Context -> AST -> IO Bool
isWellSorted :: Context -> AST -> IO Bool
isWellSorted = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_is_well_sorted
getBoolValue :: Context -> AST -> IO (Maybe Bool)
getBoolValue :: Context -> AST -> IO (Maybe Bool)
getBoolValue Context
c AST
a = AST -> (Ptr Z3_ast -> IO (Maybe Bool)) -> IO (Maybe Bool)
forall r. AST -> (Ptr Z3_ast -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c AST
a ((Ptr Z3_ast -> IO (Maybe Bool)) -> IO (Maybe Bool))
-> (Ptr Z3_ast -> IO (Maybe Bool)) -> IO (Maybe Bool)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast
astPtr ->
Z3_lbool -> Maybe Bool
castLBool (Z3_lbool -> Maybe Bool) -> IO Z3_lbool -> IO (Maybe Bool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Context -> (Ptr Z3_context -> IO Z3_lbool) -> IO Z3_lbool
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContextError Context
c (\Ptr Z3_context
cPtr -> Ptr Z3_context -> Ptr Z3_ast -> IO Z3_lbool
z3_get_bool_value Ptr Z3_context
cPtr Ptr Z3_ast
astPtr)
where castLBool :: Z3_lbool -> Maybe Bool
castLBool :: Z3_lbool -> Maybe Bool
castLBool Z3_lbool
lb
| Z3_lbool
lb Z3_lbool -> Z3_lbool -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_lbool
z3_l_true = Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
True
| Z3_lbool
lb Z3_lbool -> Z3_lbool -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_lbool
z3_l_false = Bool -> Maybe Bool
forall a. a -> Maybe a
Just Bool
False
| Z3_lbool
lb Z3_lbool -> Z3_lbool -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_lbool
z3_l_undef = Maybe Bool
forall a. Maybe a
Nothing
| Bool
otherwise =
String -> Maybe Bool
forall a. HasCallStack => String -> a
error String
"Z3.Base.castLBool: illegal `Z3_lbool' value"
getAstKind :: Context -> AST -> IO ASTKind
getAstKind :: Context -> AST -> IO ASTKind
getAstKind Context
ctx AST
ast = Z3_error_code -> ASTKind
toAstKind (Z3_error_code -> ASTKind) -> IO Z3_error_code -> IO ASTKind
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_error_code)
-> Context -> AST -> IO Z3_error_code
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_error_code
z3_get_ast_kind Context
ctx AST
ast
where toAstKind :: Z3_ast_kind -> ASTKind
toAstKind :: Z3_error_code -> ASTKind
toAstKind Z3_error_code
k
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_numeral_ast = ASTKind
Z3_NUMERAL_AST
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_app_ast = ASTKind
Z3_APP_AST
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_var_ast = ASTKind
Z3_VAR_AST
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_quantifier_ast = ASTKind
Z3_QUANTIFIER_AST
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_sort_ast = ASTKind
Z3_SORT_AST
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_func_decl_ast = ASTKind
Z3_FUNC_DECL_AST
| Z3_error_code
k Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_unknown_ast = ASTKind
Z3_UNKNOWN_AST
| Bool
otherwise =
String -> ASTKind
forall a. HasCallStack => String -> a
error String
"Z3.Base.getAstKind: unknown `Z3_ast_kind'"
isApp :: Context -> AST -> IO Bool
isApp :: Context -> AST -> IO Bool
isApp = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_is_app
toApp :: Context -> AST -> IO App
toApp :: Context -> AST -> IO App
toApp = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_app))
-> Context -> AST -> IO App
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_app)
z3_to_app
getNumeralString :: Context -> AST -> IO String
getNumeralString :: Context -> AST -> IO String
getNumeralString = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_string)
-> Context -> AST -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_string
z3_get_numeral_string
getNumerator :: Context -> AST -> IO AST
getNumerator :: Context -> AST -> IO AST
getNumerator = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_get_numerator
getDenominator :: Context -> AST -> IO AST
getDenominator :: Context -> AST -> IO AST
getDenominator = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_get_denominator
getIndexValue :: Context -> AST -> IO Int
getIndexValue :: Context -> AST -> IO Int
getIndexValue = (Ptr Z3_context -> Ptr Z3_ast -> IO CUInt)
-> Context -> AST -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO CUInt
z3_get_index_value
isQuantifierForall :: Context -> AST -> IO Bool
isQuantifierForall :: Context -> AST -> IO Bool
isQuantifierForall = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_is_quantifier_forall
isQuantifierExists :: Context -> AST -> IO Bool
isQuantifierExists :: Context -> AST -> IO Bool
isQuantifierExists Context
ctx = (Bool -> Bool) -> IO Bool -> IO Bool
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Bool -> Bool
not (IO Bool -> IO Bool) -> (AST -> IO Bool) -> AST -> IO Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Context -> AST -> IO Bool
isQuantifierForall Context
ctx
getQuantifierWeight :: Context -> AST -> IO Int
getQuantifierWeight :: Context -> AST -> IO Int
getQuantifierWeight = (Ptr Z3_context -> Ptr Z3_ast -> IO CUInt)
-> Context -> AST -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO CUInt
z3_get_quantifier_weight
getQuantifierNumPatterns :: Context -> AST -> IO Int
getQuantifierNumPatterns :: Context -> AST -> IO Int
getQuantifierNumPatterns = (Ptr Z3_context -> Ptr Z3_ast -> IO CUInt)
-> Context -> AST -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO CUInt
z3_get_quantifier_num_patterns
getQuantifierPatternAST :: Context -> AST -> Int -> IO AST
getQuantifierPatternAST :: Context -> AST -> Int -> IO AST
getQuantifierPatternAST = (Ptr Z3_context -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_ast))
-> Context -> AST -> Int -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_ast)
z3_get_quantifier_pattern_ast
getQuantifierPatterns :: Context -> AST -> IO [AST]
getQuantifierPatterns :: Context -> AST -> IO [AST]
getQuantifierPatterns Context
ctx AST
a = do
Int
n <- Context -> AST -> IO Int
getQuantifierNumPatterns Context
ctx AST
a
[Int] -> (Int -> IO AST) -> IO [AST]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
t a -> (a -> m b) -> m (t b)
T.forM [Int
0..Int
nInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1] (Context -> AST -> Int -> IO AST
getQuantifierPatternAST Context
ctx AST
a)
getQuantifierNumNoPatterns :: Context -> AST -> IO Int
getQuantifierNumNoPatterns :: Context -> AST -> IO Int
getQuantifierNumNoPatterns = (Ptr Z3_context -> Ptr Z3_ast -> IO CUInt)
-> Context -> AST -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO CUInt
z3_get_quantifier_num_no_patterns
getQuantifierNoPatternAST :: Context -> AST -> Int -> IO AST
getQuantifierNoPatternAST :: Context -> AST -> Int -> IO AST
getQuantifierNoPatternAST = (Ptr Z3_context -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_ast))
-> Context -> AST -> Int -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_ast)
z3_get_quantifier_no_pattern_ast
getQuantifierNoPatterns :: Context -> AST -> IO [AST]
getQuantifierNoPatterns :: Context -> AST -> IO [AST]
getQuantifierNoPatterns Context
ctx AST
a = do
Int
n <- Context -> AST -> IO Int
getQuantifierNumNoPatterns Context
ctx AST
a
[Int] -> (Int -> IO AST) -> IO [AST]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
t a -> (a -> m b) -> m (t b)
T.forM [Int
0..Int
nInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1] (Context -> AST -> Int -> IO AST
getQuantifierNoPatternAST Context
ctx AST
a)
getQuantifierNumBound :: Context -> AST -> IO Int
getQuantifierNumBound :: Context -> AST -> IO Int
getQuantifierNumBound = (Ptr Z3_context -> Ptr Z3_ast -> IO CUInt)
-> Context -> AST -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO CUInt
z3_get_quantifier_num_bound
getQuantifierBoundName :: Context -> AST -> Int -> IO Symbol
getQuantifierBoundName :: Context -> AST -> Int -> IO Symbol
getQuantifierBoundName = (Ptr Z3_context -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_symbol))
-> Context -> AST -> Int -> IO Symbol
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_symbol)
z3_get_quantifier_bound_name
getQuantifierBoundSort :: Context -> AST -> Int -> IO Sort
getQuantifierBoundSort :: Context -> AST -> Int -> IO Sort
getQuantifierBoundSort = (Ptr Z3_context -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_sort))
-> Context -> AST -> Int -> IO Sort
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_sort)
z3_get_quantifier_bound_sort
getQuantifierBoundVars :: Context -> AST -> IO [AST]
getQuantifierBoundVars :: Context -> AST -> IO [AST]
getQuantifierBoundVars Context
ctx AST
a = do
Int
n <- Context -> AST -> IO Int
getQuantifierNumBound Context
ctx AST
a
[Int] -> (Int -> IO AST) -> IO [AST]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
t a -> (a -> m b) -> m (t b)
T.forM [Int
0..Int
nInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1] ((Int -> IO AST) -> IO [AST]) -> (Int -> IO AST) -> IO [AST]
forall a b. (a -> b) -> a -> b
$ \Int
i -> do
Symbol
b <- Context -> AST -> Int -> IO Symbol
getQuantifierBoundName Context
ctx AST
a Int
i
Sort
s <- Context -> AST -> Int -> IO Sort
getQuantifierBoundSort Context
ctx AST
a Int
i
Context -> Symbol -> Sort -> IO AST
mkVar Context
ctx Symbol
b Sort
s
getQuantifierBody :: Context -> AST -> IO AST
getQuantifierBody :: Context -> AST -> IO AST
getQuantifierBody = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_get_quantifier_body
simplify :: Context -> AST -> IO AST
simplify :: Context -> AST -> IO AST
simplify = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_simplify
simplifyEx :: Context -> AST -> Params -> IO AST
simplifyEx :: Context -> AST -> Params -> IO AST
simplifyEx = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_params -> IO (Ptr Z3_ast))
-> Context -> AST -> Params -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_params -> IO (Ptr Z3_ast)
z3_simplify_ex
getBool :: Context -> AST -> IO Bool
getBool :: Context -> AST -> IO Bool
getBool Context
c AST
a = Maybe Bool -> Bool
forall a. HasCallStack => Maybe a -> a
fromJust (Maybe Bool -> Bool) -> IO (Maybe Bool) -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Context -> AST -> IO (Maybe Bool)
getBoolValue Context
c AST
a
getInt :: Context -> AST -> IO Integer
getInt :: Context -> AST -> IO Integer
getInt Context
c AST
a = String -> Integer
forall a. Read a => String -> a
read (String -> Integer) -> IO String -> IO Integer
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Context -> AST -> IO String
getNumeralString Context
c AST
a
getReal :: Context -> AST -> IO Rational
getReal :: Context -> AST -> IO Rational
getReal Context
c AST
a = String -> Rational
parse (String -> Rational) -> IO String -> IO Rational
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Context -> AST -> IO String
getNumeralString Context
c AST
a
where parse :: String -> Rational
parse :: String -> Rational
parse String
s
| [(Integer
i, String
sj)] <- ReadS Integer
forall a. Read a => ReadS a
reads String
s = Integer
i Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% String -> Integer
parseDen ((Char -> Bool) -> ShowS
forall a. (a -> Bool) -> [a] -> [a]
dropWhile (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
' ') String
sj)
| Bool
otherwise = String -> Rational
forall a. HasCallStack => String -> a
error String
"Z3.Base.getReal: no parse"
parseDen :: String -> Integer
parseDen :: String -> Integer
parseDen String
"" = Integer
1
parseDen (Char
'/':String
sj) = String -> Integer
forall a. Read a => String -> a
read String
sj
parseDen String
_ = String -> Integer
forall a. HasCallStack => String -> a
error String
"Z3.Base.getReal: no parse"
substituteVars :: Context -> AST -> [AST] -> IO AST
substituteVars :: Context -> AST -> [AST] -> IO AST
substituteVars Context
ctx AST
a [AST]
vars =
(Ptr Z3_context
-> Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> ((Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
z3_substitute_vars Context
ctx (((Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f ->
AST -> (Ptr Z3_ast -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall r. AST -> (Ptr Z3_ast -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c AST
a ((Ptr Z3_ast -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (Ptr Z3_ast -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast
aPtr ->
[AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
vars ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
varsNum Ptr (Ptr Z3_ast)
varsArr ->
Ptr Z3_ast -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f Ptr Z3_ast
aPtr CUInt
varsNum Ptr (Ptr Z3_ast)
varsArr
substitute :: Context -> AST -> [(AST, AST)] -> IO AST
substitute :: Context -> AST -> [(AST, AST)] -> IO AST
substitute Context
ctx AST
a [(AST, AST)]
substs =
let froms :: [AST]
froms = ((AST, AST) -> AST) -> [(AST, AST)] -> [AST]
forall a b. (a -> b) -> [a] -> [b]
map (AST, AST) -> AST
forall a b. (a, b) -> a
fst [(AST, AST)]
substs
tos :: [AST]
tos = ((AST, AST) -> AST) -> [(AST, AST)] -> [AST]
forall a b. (a -> b) -> [a] -> [b]
map (AST, AST) -> AST
forall a b. (a, b) -> b
snd [(AST, AST)]
substs
in (Ptr Z3_context
-> Ptr Z3_ast
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr (Ptr Z3_ast)
-> IO (Ptr Z3_ast))
-> Context
-> ((Ptr Z3_ast
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr (Ptr Z3_ast)
-> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_ast
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr (Ptr Z3_ast)
-> IO (Ptr Z3_ast)
z3_substitute Context
ctx (((Ptr Z3_ast
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr (Ptr Z3_ast)
-> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((Ptr Z3_ast
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr (Ptr Z3_ast)
-> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast
-> CUInt -> Ptr (Ptr Z3_ast) -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f ->
AST -> (Ptr Z3_ast -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall r. AST -> (Ptr Z3_ast -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c AST
a ((Ptr Z3_ast -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (Ptr Z3_ast -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast
aPtr ->
[AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
froms ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \CUInt
fromsLen Ptr (Ptr Z3_ast)
fromsArr ->
[AST] -> (Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray [AST]
tos ((Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \ Ptr (Ptr Z3_ast)
tosArr ->
Ptr Z3_ast
-> CUInt -> Ptr (Ptr Z3_ast) -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f Ptr Z3_ast
aPtr CUInt
fromsLen Ptr (Ptr Z3_ast)
fromsArr Ptr (Ptr Z3_ast)
tosArr
modelEval :: Context
-> Model
-> AST
-> Bool
-> IO (Maybe AST)
modelEval :: Context -> Model -> AST -> Bool -> IO (Maybe AST)
modelEval Context
ctx Model
m AST
a Bool
b =
Context -> (Ptr Z3_context -> IO (Maybe AST)) -> IO (Maybe AST)
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContext Context
ctx ((Ptr Z3_context -> IO (Maybe AST)) -> IO (Maybe AST))
-> (Ptr Z3_context -> IO (Maybe AST)) -> IO (Maybe AST)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
ctxPtr ->
(Ptr (Ptr Z3_ast) -> IO (Maybe AST)) -> IO (Maybe AST)
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr (Ptr Z3_ast) -> IO (Maybe AST)) -> IO (Maybe AST))
-> (Ptr (Ptr Z3_ast) -> IO (Maybe AST)) -> IO (Maybe AST)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_ast)
aptr2 ->
AST -> (Ptr Z3_ast -> IO (Maybe AST)) -> IO (Maybe AST)
forall r. AST -> (Ptr Z3_ast -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c AST
a ((Ptr Z3_ast -> IO (Maybe AST)) -> IO (Maybe AST))
-> (Ptr Z3_ast -> IO (Maybe AST)) -> IO (Maybe AST)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast
astPtr ->
Model -> (Ptr Z3_model -> IO (Maybe AST)) -> IO (Maybe AST)
forall r. Model -> (Ptr Z3_model -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Model
m ((Ptr Z3_model -> IO (Maybe AST)) -> IO (Maybe AST))
-> (Ptr Z3_model -> IO (Maybe AST)) -> IO (Maybe AST)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_model
mPtr ->
Bool -> (Z3_bool -> IO (Maybe AST)) -> IO (Maybe AST)
forall r. Bool -> (Z3_bool -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Bool
b ((Z3_bool -> IO (Maybe AST)) -> IO (Maybe AST))
-> (Z3_bool -> IO (Maybe AST)) -> IO (Maybe AST)
forall a b. (a -> b) -> a -> b
$ \Z3_bool
b' ->
Ptr Z3_context -> IO Z3_bool -> IO Z3_bool
forall a. Ptr Z3_context -> IO a -> IO a
checkError Ptr Z3_context
ctxPtr
(Ptr Z3_context
-> Ptr Z3_model
-> Ptr Z3_ast
-> Z3_bool
-> Ptr (Ptr Z3_ast)
-> IO Z3_bool
z3_model_eval Ptr Z3_context
ctxPtr Ptr Z3_model
mPtr Ptr Z3_ast
astPtr Z3_bool
b' Ptr (Ptr Z3_ast)
aptr2) IO Z3_bool -> (Z3_bool -> IO (Maybe AST)) -> IO (Maybe AST)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Ptr (Ptr Z3_ast) -> Bool -> IO (Maybe AST)
peekAST Ptr (Ptr Z3_ast)
aptr2 (Bool -> IO (Maybe AST))
-> (Z3_bool -> Bool) -> Z3_bool -> IO (Maybe AST)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Z3_bool -> Bool
toBool
where peekAST :: Ptr (Ptr Z3_ast) -> Bool -> IO (Maybe AST)
peekAST :: Ptr (Ptr Z3_ast) -> Bool -> IO (Maybe AST)
peekAST Ptr (Ptr Z3_ast)
_p Bool
False = Maybe AST -> IO (Maybe AST)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe AST
forall a. Maybe a
Nothing
peekAST Ptr (Ptr Z3_ast)
p Bool
True = (AST -> Maybe AST) -> IO AST -> IO (Maybe AST)
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap AST -> Maybe AST
forall a. a -> Maybe a
Just (IO AST -> IO (Maybe AST))
-> (Ptr Z3_ast -> IO AST) -> Ptr Z3_ast -> IO (Maybe AST)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Context -> Ptr Z3_ast -> IO AST
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
ctx (Ptr Z3_ast -> IO (Maybe AST)) -> IO (Ptr Z3_ast) -> IO (Maybe AST)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Z3_ast)
p
getConstInterp :: Context -> Model -> FuncDecl -> IO (Maybe AST)
getConstInterp :: Context -> Model -> FuncDecl -> IO (Maybe AST)
getConstInterp Context
ctx Model
m FuncDecl
fd = (Ptr Z3_context
-> Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_ast))
-> Context
-> ((Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO (Maybe AST)
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_ast)
z3_model_get_const_interp Context
ctx (((Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO (Maybe AST))
-> ((Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO (Maybe AST)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_ast)
f ->
Model -> (Ptr Z3_model -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall r. Model -> (Ptr Z3_model -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Model
m ((Ptr Z3_model -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (Ptr Z3_model -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_model
mPtr ->
FuncDecl
-> (Ptr Z3_func_decl -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall r. FuncDecl -> (Ptr Z3_func_decl -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c FuncDecl
fd ((Ptr Z3_func_decl -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast))
-> (Ptr Z3_func_decl -> IO (Ptr Z3_ast)) -> IO (Ptr Z3_ast)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_func_decl
fdPtr ->
Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_ast)
f Ptr Z3_model
mPtr Ptr Z3_func_decl
fdPtr
modelTranslate :: Context -> Model -> Context -> IO Model
modelTranslate :: Context -> Model -> Context -> IO Model
modelTranslate = (Ptr Z3_context
-> Ptr Z3_model -> Ptr Z3_context -> IO (Ptr Z3_model))
-> Context -> Model -> Context -> IO Model
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context
-> Ptr Z3_model -> Ptr Z3_context -> IO (Ptr Z3_model)
z3_model_translate
hasInterp :: Context -> Model -> FuncDecl -> IO Bool
hasInterp :: Context -> Model -> FuncDecl -> IO Bool
hasInterp = (Ptr Z3_context -> Ptr Z3_model -> Ptr Z3_func_decl -> IO Z3_bool)
-> Context -> Model -> FuncDecl -> IO Bool
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_model -> Ptr Z3_func_decl -> IO Z3_bool
z3_model_has_interp
numConsts :: Context -> Model -> IO Word
numConsts :: Context -> Model -> IO Word
numConsts = (Ptr Z3_context -> Ptr Z3_model -> IO CUInt)
-> Context -> Model -> IO Word
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_model -> IO CUInt
z3_model_get_num_consts
numFuncs :: Context -> Model -> IO Word
numFuncs :: Context -> Model -> IO Word
numFuncs = (Ptr Z3_context -> Ptr Z3_model -> IO CUInt)
-> Context -> Model -> IO Word
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_model -> IO CUInt
z3_model_get_num_funcs
getConstDecl :: Context -> Model -> Word -> IO FuncDecl
getConstDecl :: Context -> Model -> Word -> IO FuncDecl
getConstDecl = (Ptr Z3_context -> Ptr Z3_model -> CUInt -> IO (Ptr Z3_func_decl))
-> Context -> Model -> Word -> IO FuncDecl
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_model -> CUInt -> IO (Ptr Z3_func_decl)
z3_model_get_const_decl
getFuncDecl :: Context -> Model -> Word -> IO FuncDecl
getFuncDecl :: Context -> Model -> Word -> IO FuncDecl
getFuncDecl = (Ptr Z3_context -> Ptr Z3_model -> CUInt -> IO (Ptr Z3_func_decl))
-> Context -> Model -> Word -> IO FuncDecl
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_model -> CUInt -> IO (Ptr Z3_func_decl)
z3_model_get_func_decl
getConsts :: Context -> Model -> IO [FuncDecl]
getConsts :: Context -> Model -> IO [FuncDecl]
getConsts Context
ctx Model
m = do
Word
n <- Context -> Model -> IO Word
numConsts Context
ctx Model
m
[Word] -> (Word -> IO FuncDecl) -> IO [FuncDecl]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
t a -> (a -> m b) -> m (t b)
forM [Word
0..Word
nWord -> Word -> Word
forall a. Num a => a -> a -> a
-Word
1] ((Word -> IO FuncDecl) -> IO [FuncDecl])
-> (Word -> IO FuncDecl) -> IO [FuncDecl]
forall a b. (a -> b) -> a -> b
$ \Word
i -> Context -> Model -> Word -> IO FuncDecl
getConstDecl Context
ctx Model
m Word
i
getFuncs :: Context -> Model -> IO [FuncDecl]
getFuncs :: Context -> Model -> IO [FuncDecl]
getFuncs Context
ctx Model
m = do
Word
n <- Context -> Model -> IO Word
numFuncs Context
ctx Model
m
[Word] -> (Word -> IO FuncDecl) -> IO [FuncDecl]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
t a -> (a -> m b) -> m (t b)
forM [Word
0..Word
nWord -> Word -> Word
forall a. Num a => a -> a -> a
-Word
1] ((Word -> IO FuncDecl) -> IO [FuncDecl])
-> (Word -> IO FuncDecl) -> IO [FuncDecl]
forall a b. (a -> b) -> a -> b
$ \Word
i -> Context -> Model -> Word -> IO FuncDecl
getFuncDecl Context
ctx Model
m Word
i
evalArray :: Context -> Model -> AST -> IO (Maybe FuncModel)
evalArray :: Context -> Model -> AST -> IO (Maybe FuncModel)
evalArray Context
ctx Model
model AST
array =
do
Maybe AST
evaldArrayMb <- Context -> EvalAst AST
eval Context
ctx Model
model AST
array
case Maybe AST
evaldArrayMb of
Maybe AST
Nothing -> Maybe FuncModel -> IO (Maybe FuncModel)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe FuncModel
forall a. Maybe a
Nothing
Just AST
evaldArray ->
do Bool
canConvert <- Context -> AST -> IO Bool
isAsArray Context
ctx AST
evaldArray
if Bool
canConvert
then
do FuncDecl
arrayDecl <- Context -> AST -> IO FuncDecl
getAsArrayFuncDecl Context
ctx AST
evaldArray
Context -> Model -> FuncDecl -> IO (Maybe FuncModel)
evalFunc Context
ctx Model
model FuncDecl
arrayDecl
else Maybe FuncModel -> IO (Maybe FuncModel)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe FuncModel
forall a. Maybe a
Nothing
getAsArrayFuncDecl :: Context -> AST -> IO FuncDecl
getAsArrayFuncDecl :: Context -> AST -> IO FuncDecl
getAsArrayFuncDecl = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_func_decl))
-> Context -> AST -> IO FuncDecl
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_func_decl)
z3_get_as_array_func_decl
isAsArray :: Context -> AST -> IO Bool
isAsArray :: Context -> AST -> IO Bool
isAsArray = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_is_as_array
isEqAST :: Context -> AST -> AST -> IO Bool
isEqAST :: Context -> AST -> AST -> IO Bool
isEqAST = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> AST -> IO Bool
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO Z3_bool
z3_is_eq_ast
addFuncInterp :: Context -> Model -> FuncDecl -> AST -> IO FuncInterp
addFuncInterp :: Context -> Model -> FuncDecl -> AST -> IO FuncInterp
addFuncInterp = (Ptr Z3_context
-> Ptr Z3_model
-> Ptr Z3_func_decl
-> Ptr Z3_ast
-> IO (Ptr Z3_func_interp))
-> Context -> Model -> FuncDecl -> AST -> IO FuncInterp
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_model
-> Ptr Z3_func_decl
-> Ptr Z3_ast
-> IO (Ptr Z3_func_interp)
z3_add_func_interp
addConstInterp :: Context -> Model -> FuncDecl -> AST -> IO ()
addConstInterp :: Context -> Model -> FuncDecl -> AST -> IO ()
addConstInterp = (Ptr Z3_context
-> Ptr Z3_model -> Ptr Z3_func_decl -> Ptr Z3_ast -> IO ())
-> Context -> Model -> FuncDecl -> AST -> IO ()
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_model -> Ptr Z3_func_decl -> Ptr Z3_ast -> IO ()
z3_add_const_interp
getMapFromInterp :: Context -> FuncInterp -> IO [([AST], AST)]
getMapFromInterp :: Context -> FuncInterp -> IO [([AST], AST)]
getMapFromInterp Context
ctx FuncInterp
interp =
do Int
n <- Context -> FuncInterp -> IO Int
funcInterpGetNumEntries Context
ctx FuncInterp
interp
[FuncEntry]
entries <- (Int -> IO FuncEntry) -> [Int] -> IO [FuncEntry]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (Context -> FuncInterp -> Int -> IO FuncEntry
funcInterpGetEntry Context
ctx FuncInterp
interp) [Int
0..Int
nInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1]
(FuncEntry -> IO ([AST], AST)) -> [FuncEntry] -> IO [([AST], AST)]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (Context -> FuncEntry -> IO ([AST], AST)
getEntry Context
ctx) [FuncEntry]
entries
getEntry :: Context -> FuncEntry -> IO ([AST], AST)
getEntry :: Context -> FuncEntry -> IO ([AST], AST)
getEntry Context
ctx FuncEntry
entry =
do AST
val <- Context -> FuncEntry -> IO AST
funcEntryGetValue Context
ctx FuncEntry
entry
[AST]
args <- Context -> FuncEntry -> IO [AST]
getEntryArgs Context
ctx FuncEntry
entry
([AST], AST) -> IO ([AST], AST)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ([AST]
args, AST
val)
getEntryArgs :: Context -> FuncEntry -> IO [AST]
getEntryArgs :: Context -> FuncEntry -> IO [AST]
getEntryArgs Context
ctx FuncEntry
entry =
do Int
n <- Context -> FuncEntry -> IO Int
funcEntryGetNumArgs Context
ctx FuncEntry
entry
(Int -> IO AST) -> [Int] -> IO [AST]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (Context -> FuncEntry -> Int -> IO AST
funcEntryGetArg Context
ctx FuncEntry
entry) [Int
0..Int
nInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1]
getFuncInterp :: Context -> Model -> FuncDecl -> IO (Maybe FuncInterp)
getFuncInterp :: Context -> Model -> FuncDecl -> IO (Maybe FuncInterp)
getFuncInterp Context
ctx Model
m FuncDecl
fd = (Ptr Z3_context
-> Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_func_interp))
-> Context
-> ((Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_func_interp))
-> IO (Ptr Z3_func_interp))
-> IO (Maybe FuncInterp)
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_func_interp)
z3_model_get_func_interp Context
ctx (((Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_func_interp))
-> IO (Ptr Z3_func_interp))
-> IO (Maybe FuncInterp))
-> ((Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_func_interp))
-> IO (Ptr Z3_func_interp))
-> IO (Maybe FuncInterp)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_func_interp)
f ->
Model
-> (Ptr Z3_model -> IO (Ptr Z3_func_interp))
-> IO (Ptr Z3_func_interp)
forall r. Model -> (Ptr Z3_model -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Model
m ((Ptr Z3_model -> IO (Ptr Z3_func_interp))
-> IO (Ptr Z3_func_interp))
-> (Ptr Z3_model -> IO (Ptr Z3_func_interp))
-> IO (Ptr Z3_func_interp)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_model
mPtr ->
FuncDecl
-> (Ptr Z3_func_decl -> IO (Ptr Z3_func_interp))
-> IO (Ptr Z3_func_interp)
forall r. FuncDecl -> (Ptr Z3_func_decl -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c FuncDecl
fd ((Ptr Z3_func_decl -> IO (Ptr Z3_func_interp))
-> IO (Ptr Z3_func_interp))
-> (Ptr Z3_func_decl -> IO (Ptr Z3_func_interp))
-> IO (Ptr Z3_func_interp)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_func_decl
fdPtr ->
Ptr Z3_model -> Ptr Z3_func_decl -> IO (Ptr Z3_func_interp)
f Ptr Z3_model
mPtr Ptr Z3_func_decl
fdPtr
funcInterpGetNumEntries :: Context -> FuncInterp -> IO Int
funcInterpGetNumEntries :: Context -> FuncInterp -> IO Int
funcInterpGetNumEntries = (Ptr Z3_context -> Ptr Z3_func_interp -> IO CUInt)
-> Context -> FuncInterp -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_func_interp -> IO CUInt
z3_func_interp_get_num_entries
funcInterpGetEntry :: Context -> FuncInterp -> Int -> IO FuncEntry
funcInterpGetEntry :: Context -> FuncInterp -> Int -> IO FuncEntry
funcInterpGetEntry = (Ptr Z3_context
-> Ptr Z3_func_interp -> CUInt -> IO (Ptr Z3_func_entry))
-> Context -> FuncInterp -> Int -> IO FuncEntry
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context
-> Ptr Z3_func_interp -> CUInt -> IO (Ptr Z3_func_entry)
z3_func_interp_get_entry
funcInterpGetElse :: Context -> FuncInterp -> IO AST
funcInterpGetElse :: Context -> FuncInterp -> IO AST
funcInterpGetElse = (Ptr Z3_context -> Ptr Z3_func_interp -> IO (Ptr Z3_ast))
-> Context -> FuncInterp -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_func_interp -> IO (Ptr Z3_ast)
z3_func_interp_get_else
funcInterpGetArity :: Context -> FuncInterp -> IO Int
funcInterpGetArity :: Context -> FuncInterp -> IO Int
funcInterpGetArity = (Ptr Z3_context -> Ptr Z3_func_interp -> IO CUInt)
-> Context -> FuncInterp -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_func_interp -> IO CUInt
z3_func_interp_get_arity
funcEntryGetValue :: Context -> FuncEntry -> IO AST
funcEntryGetValue :: Context -> FuncEntry -> IO AST
funcEntryGetValue = (Ptr Z3_context -> Ptr Z3_func_entry -> IO (Ptr Z3_ast))
-> Context -> FuncEntry -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_func_entry -> IO (Ptr Z3_ast)
z3_func_entry_get_value
funcEntryGetNumArgs :: Context -> FuncEntry -> IO Int
funcEntryGetNumArgs :: Context -> FuncEntry -> IO Int
funcEntryGetNumArgs = (Ptr Z3_context -> Ptr Z3_func_entry -> IO CUInt)
-> Context -> FuncEntry -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_func_entry -> IO CUInt
z3_func_entry_get_num_args
funcEntryGetArg :: Context -> FuncEntry -> Int -> IO AST
funcEntryGetArg :: Context -> FuncEntry -> Int -> IO AST
funcEntryGetArg = (Ptr Z3_context -> Ptr Z3_func_entry -> CUInt -> IO (Ptr Z3_ast))
-> Context -> FuncEntry -> Int -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_func_entry -> CUInt -> IO (Ptr Z3_ast)
z3_func_entry_get_arg
modelToString :: Context -> Model -> IO String
modelToString :: Context -> Model -> IO String
modelToString = (Ptr Z3_context -> Ptr Z3_model -> IO Z3_string)
-> Context -> Model -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_model -> IO Z3_string
z3_model_to_string
showModel :: Context -> Model -> IO String
showModel :: Context -> Model -> IO String
showModel = Context -> Model -> IO String
modelToString
{-# DEPRECATED showModel "Use modelToString instead." #-}
type EvalAst a = Model -> AST -> IO (Maybe a)
eval :: Context -> EvalAst AST
eval :: Context -> EvalAst AST
eval Context
ctx Model
m AST
a = Context -> Model -> AST -> Bool -> IO (Maybe AST)
modelEval Context
ctx Model
m AST
a Bool
True
evalBool :: Context -> EvalAst Bool
evalBool :: Context -> EvalAst Bool
evalBool Context
ctx Model
m AST
ast = Context -> EvalAst AST
eval Context
ctx Model
m AST
ast IO (Maybe AST) -> (Maybe AST -> IO (Maybe Bool)) -> IO (Maybe Bool)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (AST -> IO Bool) -> Maybe AST -> IO (Maybe Bool)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Maybe a -> f (Maybe b)
T.traverse (Context -> AST -> IO Bool
getBool Context
ctx)
evalInt :: Context -> EvalAst Integer
evalInt :: Context -> EvalAst Integer
evalInt Context
ctx Model
m AST
ast = Context -> EvalAst AST
eval Context
ctx Model
m AST
ast IO (Maybe AST)
-> (Maybe AST -> IO (Maybe Integer)) -> IO (Maybe Integer)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (AST -> IO Integer) -> Maybe AST -> IO (Maybe Integer)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Maybe a -> f (Maybe b)
T.traverse (Context -> AST -> IO Integer
getInt Context
ctx)
evalReal :: Context -> EvalAst Rational
evalReal :: Context -> EvalAst Rational
evalReal Context
ctx Model
m AST
ast = Context -> EvalAst AST
eval Context
ctx Model
m AST
ast IO (Maybe AST)
-> (Maybe AST -> IO (Maybe Rational)) -> IO (Maybe Rational)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (AST -> IO Rational) -> Maybe AST -> IO (Maybe Rational)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Maybe a -> f (Maybe b)
T.traverse (Context -> AST -> IO Rational
getReal Context
ctx)
evalBv :: Context -> Bool
-> EvalAst Integer
evalBv :: Context -> Bool -> EvalAst Integer
evalBv Context
ctx Bool
signed Model
m AST
ast =
Context -> AST -> Bool -> IO AST
mkBv2int Context
ctx AST
ast Bool
signed IO AST -> (AST -> IO (Maybe AST)) -> IO (Maybe AST)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Context -> EvalAst AST
eval Context
ctx Model
m IO (Maybe AST)
-> (Maybe AST -> IO (Maybe Integer)) -> IO (Maybe Integer)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (AST -> IO Integer) -> Maybe AST -> IO (Maybe Integer)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Maybe a -> f (Maybe b)
T.traverse (\AST
a -> Context -> AST -> IO Integer
getInt Context
ctx AST
a)
evalT :: Traversable t => Context -> Model -> t AST -> IO (Maybe (t AST))
evalT :: forall (t :: * -> *).
Traversable t =>
Context -> Model -> t AST -> IO (Maybe (t AST))
evalT Context
c = EvalAst AST -> Model -> t AST -> IO (Maybe (t AST))
forall (t :: * -> *) a.
Traversable t =>
EvalAst a -> Model -> t AST -> IO (Maybe (t a))
mapEval (Context -> EvalAst AST
eval Context
c)
mapEval :: Traversable t => EvalAst a -> Model -> t AST -> IO (Maybe (t a))
mapEval :: forall (t :: * -> *) a.
Traversable t =>
EvalAst a -> Model -> t AST -> IO (Maybe (t a))
mapEval EvalAst a
f Model
m = (t (Maybe a) -> Maybe (t a))
-> IO (t (Maybe a)) -> IO (Maybe (t a))
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap t (Maybe a) -> Maybe (t a)
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => t (m a) -> m (t a)
T.sequence (IO (t (Maybe a)) -> IO (Maybe (t a)))
-> (t AST -> IO (t (Maybe a))) -> t AST -> IO (Maybe (t a))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (AST -> IO (Maybe a)) -> t AST -> IO (t (Maybe a))
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> t a -> m (t b)
T.mapM (EvalAst a
f Model
m)
data FuncModel = FuncModel
{ FuncModel -> [([AST], AST)]
interpMap :: [([AST], AST)]
, FuncModel -> AST
interpElse :: AST
}
evalFunc :: Context -> Model -> FuncDecl -> IO (Maybe FuncModel)
evalFunc :: Context -> Model -> FuncDecl -> IO (Maybe FuncModel)
evalFunc Context
ctx Model
m FuncDecl
fDecl =
do Maybe FuncInterp
interpMb <- Context -> Model -> FuncDecl -> IO (Maybe FuncInterp)
getFuncInterp Context
ctx Model
m FuncDecl
fDecl
case Maybe FuncInterp
interpMb of
Maybe FuncInterp
Nothing -> Maybe FuncModel -> IO (Maybe FuncModel)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe FuncModel
forall a. Maybe a
Nothing
Just FuncInterp
interp ->
do [([AST], AST)]
funcMap <- Context -> FuncInterp -> IO [([AST], AST)]
getMapFromInterp Context
ctx FuncInterp
interp
AST
elsePart <- Context -> FuncInterp -> IO AST
funcInterpGetElse Context
ctx FuncInterp
interp
Maybe FuncModel -> IO (Maybe FuncModel)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (FuncModel -> Maybe FuncModel
forall a. a -> Maybe a
Just (FuncModel -> Maybe FuncModel) -> FuncModel -> Maybe FuncModel
forall a b. (a -> b) -> a -> b
$ [([AST], AST)] -> AST -> FuncModel
FuncModel [([AST], AST)]
funcMap AST
elsePart)
data ASTPrintMode
= Z3_PRINT_SMTLIB_FULL
| Z3_PRINT_LOW_LEVEL
| Z3_PRINT_SMTLIB2_COMPLIANT
setASTPrintMode :: Context -> ASTPrintMode -> IO ()
setASTPrintMode :: Context -> ASTPrintMode -> IO ()
setASTPrintMode Context
ctx ASTPrintMode
mode = Context -> (Ptr Z3_context -> IO ()) -> IO ()
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContextError Context
ctx ((Ptr Z3_context -> IO ()) -> IO ())
-> (Ptr Z3_context -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
ctxPtr ->
case ASTPrintMode
mode of
ASTPrintMode
Z3_PRINT_SMTLIB_FULL ->
Z3_error_handler
z3_set_ast_print_mode Ptr Z3_context
ctxPtr Z3_error_code
z3_print_smtlib_full
ASTPrintMode
Z3_PRINT_LOW_LEVEL ->
Z3_error_handler
z3_set_ast_print_mode Ptr Z3_context
ctxPtr Z3_error_code
z3_print_low_level
ASTPrintMode
Z3_PRINT_SMTLIB2_COMPLIANT ->
Z3_error_handler
z3_set_ast_print_mode Ptr Z3_context
ctxPtr Z3_error_code
z3_print_smtlib2_compliant
astToString :: Context -> AST -> IO String
astToString :: Context -> AST -> IO String
astToString = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_string)
-> Context -> AST -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_string
z3_ast_to_string
patternToString :: Context -> Pattern -> IO String
patternToString :: Context -> Pattern -> IO String
patternToString = (Ptr Z3_context -> Ptr Z3_pattern -> IO Z3_string)
-> Context -> Pattern -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_pattern -> IO Z3_string
z3_pattern_to_string
sortToString :: Context -> Sort -> IO String
sortToString :: Context -> Sort -> IO String
sortToString = (Ptr Z3_context -> Ptr Z3_sort -> IO Z3_string)
-> Context -> Sort -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO Z3_string
z3_sort_to_string
funcDeclToString :: Context -> FuncDecl -> IO String
funcDeclToString :: Context -> FuncDecl -> IO String
funcDeclToString = (Ptr Z3_context -> Ptr Z3_func_decl -> IO Z3_string)
-> Context -> FuncDecl -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_func_decl -> IO Z3_string
z3_func_decl_to_string
benchmarkToSMTLibString :: Context
-> String
-> String
-> String
-> String
-> [AST]
-> AST
-> IO String
benchmarkToSMTLibString :: Context
-> String
-> String
-> String
-> String
-> [AST]
-> AST
-> IO String
benchmarkToSMTLibString Context
ctx String
name String
logic String
status String
attr [AST]
assump AST
form =
(Ptr Z3_context
-> Z3_string
-> Z3_string
-> Z3_string
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr Z3_ast
-> IO Z3_string)
-> Context
-> ((Z3_string
-> Z3_string
-> Z3_string
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr Z3_ast
-> IO Z3_string)
-> IO Z3_string)
-> IO String
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Z3_string
-> Z3_string
-> Z3_string
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr Z3_ast
-> IO Z3_string
z3_benchmark_to_smtlib_string Context
ctx (((Z3_string
-> Z3_string
-> Z3_string
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr Z3_ast
-> IO Z3_string)
-> IO Z3_string)
-> IO String)
-> ((Z3_string
-> Z3_string
-> Z3_string
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr Z3_ast
-> IO Z3_string)
-> IO Z3_string)
-> IO String
forall a b. (a -> b) -> a -> b
$ \Z3_string
-> Z3_string
-> Z3_string
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr Z3_ast
-> IO Z3_string
f ->
String -> (Z3_string -> IO Z3_string) -> IO Z3_string
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
name ((Z3_string -> IO Z3_string) -> IO Z3_string)
-> (Z3_string -> IO Z3_string) -> IO Z3_string
forall a b. (a -> b) -> a -> b
$ \Z3_string
namePtr ->
String -> (Z3_string -> IO Z3_string) -> IO Z3_string
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
logic ((Z3_string -> IO Z3_string) -> IO Z3_string)
-> (Z3_string -> IO Z3_string) -> IO Z3_string
forall a b. (a -> b) -> a -> b
$ \Z3_string
logicPtr ->
String -> (Z3_string -> IO Z3_string) -> IO Z3_string
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
status ((Z3_string -> IO Z3_string) -> IO Z3_string)
-> (Z3_string -> IO Z3_string) -> IO Z3_string
forall a b. (a -> b) -> a -> b
$ \Z3_string
statusPtr ->
String -> (Z3_string -> IO Z3_string) -> IO Z3_string
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
attr ((Z3_string -> IO Z3_string) -> IO Z3_string)
-> (Z3_string -> IO Z3_string) -> IO Z3_string
forall a b. (a -> b) -> a -> b
$ \Z3_string
attrPtr ->
[AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_string) -> IO Z3_string
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
assump ((CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_string) -> IO Z3_string)
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_string) -> IO Z3_string
forall a b. (a -> b) -> a -> b
$ \CUInt
assumpNum Ptr (Ptr Z3_ast)
assumpArr ->
AST -> (Ptr Z3_ast -> IO Z3_string) -> IO Z3_string
forall r. AST -> (Ptr Z3_ast -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c AST
form ((Ptr Z3_ast -> IO Z3_string) -> IO Z3_string)
-> (Ptr Z3_ast -> IO Z3_string) -> IO Z3_string
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast
formPtr ->
Z3_string
-> Z3_string
-> Z3_string
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_ast)
-> Ptr Z3_ast
-> IO Z3_string
f Z3_string
namePtr Z3_string
logicPtr Z3_string
statusPtr Z3_string
attrPtr CUInt
assumpNum Ptr (Ptr Z3_ast)
assumpArr Ptr Z3_ast
formPtr
mkTactic :: Context -> String -> IO Tactic
mkTactic :: Context -> String -> IO Tactic
mkTactic = (Ptr Z3_context -> Z3_string -> IO (Ptr Z3_tactic))
-> Context -> String -> IO Tactic
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Z3_string -> IO (Ptr Z3_tactic)
z3_mk_tactic
andThenTactic :: Context -> Tactic -> Tactic -> IO Tactic
andThenTactic :: Context -> Tactic -> Tactic -> IO Tactic
andThenTactic = (Ptr Z3_context
-> Ptr Z3_tactic -> Ptr Z3_tactic -> IO (Ptr Z3_tactic))
-> Context -> Tactic -> Tactic -> IO Tactic
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context
-> Ptr Z3_tactic -> Ptr Z3_tactic -> IO (Ptr Z3_tactic)
z3_tactic_and_then
orElseTactic :: Context -> Tactic -> Tactic -> IO Tactic
orElseTactic :: Context -> Tactic -> Tactic -> IO Tactic
orElseTactic = (Ptr Z3_context
-> Ptr Z3_tactic -> Ptr Z3_tactic -> IO (Ptr Z3_tactic))
-> Context -> Tactic -> Tactic -> IO Tactic
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context
-> Ptr Z3_tactic -> Ptr Z3_tactic -> IO (Ptr Z3_tactic)
z3_tactic_or_else
skipTactic :: Context -> IO Tactic
skipTactic :: Context -> IO Tactic
skipTactic = (Ptr Z3_context -> IO (Ptr Z3_tactic)) -> Context -> IO Tactic
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_tactic)
z3_tactic_skip
tryForTactic :: Context -> Tactic -> Int -> IO Tactic
tryForTactic :: Context -> Tactic -> Int -> IO Tactic
tryForTactic = (Ptr Z3_context -> Ptr Z3_tactic -> CUInt -> IO (Ptr Z3_tactic))
-> Context -> Tactic -> Int -> IO Tactic
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_tactic -> CUInt -> IO (Ptr Z3_tactic)
z3_tactic_try_for
tacticUsingParams :: Context -> Tactic -> Params -> IO Tactic
tacticUsingParams :: Context -> Tactic -> Params -> IO Tactic
tacticUsingParams = (Ptr Z3_context
-> Ptr Z3_tactic -> Ptr Z3_params -> IO (Ptr Z3_tactic))
-> Context -> Tactic -> Params -> IO Tactic
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context
-> Ptr Z3_tactic -> Ptr Z3_params -> IO (Ptr Z3_tactic)
z3_tactic_using_params
repeatTactic :: Context -> Tactic -> Int -> IO Tactic
repeatTactic :: Context -> Tactic -> Int -> IO Tactic
repeatTactic = (Ptr Z3_context -> Ptr Z3_tactic -> CUInt -> IO (Ptr Z3_tactic))
-> Context -> Tactic -> Int -> IO Tactic
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_tactic -> CUInt -> IO (Ptr Z3_tactic)
z3_tactic_repeat
mkQuantifierEliminationTactic :: Context -> IO Tactic
mkQuantifierEliminationTactic :: Context -> IO Tactic
mkQuantifierEliminationTactic Context
ctx = Context -> String -> IO Tactic
mkTactic Context
ctx String
"qe"
mkAndInverterGraphTactic :: Context -> IO Tactic
mkAndInverterGraphTactic :: Context -> IO Tactic
mkAndInverterGraphTactic Context
ctx = Context -> String -> IO Tactic
mkTactic Context
ctx String
"aig"
applyTactic :: Context -> Tactic -> Goal -> IO ApplyResult
applyTactic :: Context -> Tactic -> Goal -> IO ApplyResult
applyTactic = (Ptr Z3_context
-> Ptr Z3_tactic -> Ptr Z3_goal -> IO (Ptr Z3_apply_result))
-> Context -> Tactic -> Goal -> IO ApplyResult
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context
-> Ptr Z3_tactic -> Ptr Z3_goal -> IO (Ptr Z3_apply_result)
z3_tactic_apply
applyResultToString :: Context -> ApplyResult -> IO String
applyResultToString :: Context -> ApplyResult -> IO String
applyResultToString = (Ptr Z3_context -> Ptr Z3_apply_result -> IO Z3_string)
-> Context -> ApplyResult -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_apply_result -> IO Z3_string
z3_apply_result_to_string
getApplyResultNumSubgoals :: Context -> ApplyResult -> IO Int
getApplyResultNumSubgoals :: Context -> ApplyResult -> IO Int
getApplyResultNumSubgoals = (Ptr Z3_context -> Ptr Z3_apply_result -> IO CUInt)
-> Context -> ApplyResult -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_apply_result -> IO CUInt
z3_apply_result_get_num_subgoals
getApplyResultSubgoal :: Context -> ApplyResult -> Int -> IO Goal
getApplyResultSubgoal :: Context -> ApplyResult -> Int -> IO Goal
getApplyResultSubgoal = (Ptr Z3_context
-> Ptr Z3_apply_result -> CUInt -> IO (Ptr Z3_goal))
-> Context -> ApplyResult -> Int -> IO Goal
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_apply_result -> CUInt -> IO (Ptr Z3_goal)
z3_apply_result_get_subgoal
getApplyResultSubgoals :: Context -> ApplyResult -> IO [Goal]
getApplyResultSubgoals :: Context -> ApplyResult -> IO [Goal]
getApplyResultSubgoals Context
ctx ApplyResult
a = do
Int
n <- Context -> ApplyResult -> IO Int
getApplyResultNumSubgoals Context
ctx ApplyResult
a
[Int] -> (Int -> IO Goal) -> IO [Goal]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
t a -> (a -> m b) -> m (t b)
T.forM [Int
0..Int
nInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1] (Context -> ApplyResult -> Int -> IO Goal
getApplyResultSubgoal Context
ctx ApplyResult
a)
mkGoal :: Context -> Bool -> Bool -> Bool -> IO Goal
mkGoal :: Context -> Bool -> Bool -> Bool -> IO Goal
mkGoal = (Ptr Z3_context
-> Z3_bool -> Z3_bool -> Z3_bool -> IO (Ptr Z3_goal))
-> Context -> Bool -> Bool -> Bool -> IO Goal
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context -> Z3_bool -> Z3_bool -> Z3_bool -> IO (Ptr Z3_goal)
z3_mk_goal
goalAssert :: Context -> Goal -> AST -> IO ()
goalAssert :: Context -> Goal -> AST -> IO ()
goalAssert = (Ptr Z3_context -> Ptr Z3_goal -> Ptr Z3_ast -> IO ())
-> Context -> Goal -> AST -> IO ()
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_goal -> Ptr Z3_ast -> IO ()
z3_goal_assert
getGoalSize :: Context -> Goal -> IO Int
getGoalSize :: Context -> Goal -> IO Int
getGoalSize = (Ptr Z3_context -> Ptr Z3_goal -> IO CUInt)
-> Context -> Goal -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_goal -> IO CUInt
z3_goal_size
getGoalFormula :: Context -> Goal -> Int -> IO AST
getGoalFormula :: Context -> Goal -> Int -> IO AST
getGoalFormula = (Ptr Z3_context -> Ptr Z3_goal -> CUInt -> IO (Ptr Z3_ast))
-> Context -> Goal -> Int -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_goal -> CUInt -> IO (Ptr Z3_ast)
z3_goal_formula
getGoalFormulas :: Context -> Goal -> IO [AST]
getGoalFormulas :: Context -> Goal -> IO [AST]
getGoalFormulas Context
ctx Goal
g = do
Int
n <- Context -> Goal -> IO Int
getGoalSize Context
ctx Goal
g
[Int] -> (Int -> IO AST) -> IO [AST]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
t a -> (a -> m b) -> m (t b)
T.forM [Int
0..Int
nInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1] (Context -> Goal -> Int -> IO AST
getGoalFormula Context
ctx Goal
g)
goalToString :: Context -> Goal -> IO String
goalToString :: Context -> Goal -> IO String
goalToString = (Ptr Z3_context -> Ptr Z3_goal -> IO Z3_string)
-> Context -> Goal -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_goal -> IO Z3_string
z3_goal_to_string
convertModel :: Context -> Goal -> Model -> IO Model
convertModel :: Context -> Goal -> Model -> IO Model
convertModel = (Ptr Z3_context
-> Ptr Z3_goal -> Ptr Z3_model -> IO (Ptr Z3_model))
-> Context -> Goal -> Model -> IO Model
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_goal -> Ptr Z3_model -> IO (Ptr Z3_model)
z3_goal_convert_model
parseSMTLib2String :: Context
-> String
-> [Symbol]
-> [Sort]
-> [Symbol]
-> [FuncDecl]
-> IO [AST]
parseSMTLib2String :: Context
-> String
-> [Symbol]
-> [Sort]
-> [Symbol]
-> [FuncDecl]
-> IO [AST]
parseSMTLib2String Context
ctx String
str [Symbol]
sortNames [Sort]
sorts [Symbol]
declNames [FuncDecl]
decls =
(Ptr Z3_context
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector))
-> Context
-> ((Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> IO [AST]
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector)
z3_parse_smtlib2_string Context
ctx (((Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> IO [AST])
-> ((Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> IO [AST]
forall a b. (a -> b) -> a -> b
$ \Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector)
f ->
String
-> (Z3_string -> IO (Ptr Z3_ast_vector)) -> IO (Ptr Z3_ast_vector)
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
str ((Z3_string -> IO (Ptr Z3_ast_vector)) -> IO (Ptr Z3_ast_vector))
-> (Z3_string -> IO (Ptr Z3_ast_vector)) -> IO (Ptr Z3_ast_vector)
forall a b. (a -> b) -> a -> b
$ \Z3_string
cstr ->
[Sort]
-> (CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Sort]
sorts ((CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> (CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall a b. (a -> b) -> a -> b
$ \CUInt
sortNum Ptr (Ptr Z3_sort)
sortArr ->
[Symbol]
-> (Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray [Symbol]
sortNames ((Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> (Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_symbol)
sortNameArr ->
[FuncDecl]
-> (CUInt -> Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [FuncDecl]
decls ((CUInt -> Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> (CUInt -> Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall a b. (a -> b) -> a -> b
$ \CUInt
declNum Ptr (Ptr Z3_func_decl)
declArr ->
[Symbol]
-> (Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray [Symbol]
declNames ((Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> (Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_symbol)
declNameArr ->
Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector)
f Z3_string
cstr CUInt
sortNum Ptr (Ptr Z3_symbol)
sortNameArr Ptr (Ptr Z3_sort)
sortArr CUInt
declNum Ptr (Ptr Z3_symbol)
declNameArr Ptr (Ptr Z3_func_decl)
declArr
parseSMTLib2File :: Context
-> String
-> [Symbol]
-> [Sort]
-> [Symbol]
-> [FuncDecl]
-> IO [AST]
parseSMTLib2File :: Context
-> String
-> [Symbol]
-> [Sort]
-> [Symbol]
-> [FuncDecl]
-> IO [AST]
parseSMTLib2File Context
ctx String
file [Symbol]
sortNames [Sort]
sorts [Symbol]
declNames [FuncDecl]
decls =
(Ptr Z3_context
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector))
-> Context
-> ((Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> IO [AST]
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector)
z3_parse_smtlib2_file Context
ctx (((Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> IO [AST])
-> ((Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> IO [AST]
forall a b. (a -> b) -> a -> b
$ \Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector)
f ->
String
-> (Z3_string -> IO (Ptr Z3_ast_vector)) -> IO (Ptr Z3_ast_vector)
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
file ((Z3_string -> IO (Ptr Z3_ast_vector)) -> IO (Ptr Z3_ast_vector))
-> (Z3_string -> IO (Ptr Z3_ast_vector)) -> IO (Ptr Z3_ast_vector)
forall a b. (a -> b) -> a -> b
$ \Z3_string
fileName ->
[Sort]
-> (CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [Sort]
sorts ((CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> (CUInt -> Ptr (Ptr Z3_sort) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall a b. (a -> b) -> a -> b
$ \CUInt
sortNum Ptr (Ptr Z3_sort)
sortArr ->
[Symbol]
-> (Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray [Symbol]
sortNames ((Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> (Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_symbol)
sortNameArr ->
[FuncDecl]
-> (CUInt -> Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [FuncDecl]
decls ((CUInt -> Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> (CUInt -> Ptr (Ptr Z3_func_decl) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall a b. (a -> b) -> a -> b
$ \CUInt
declNum Ptr (Ptr Z3_func_decl)
declArr ->
[Symbol]
-> (Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray [Symbol]
declNames ((Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector))
-> (Ptr (Ptr Z3_symbol) -> IO (Ptr Z3_ast_vector))
-> IO (Ptr Z3_ast_vector)
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr Z3_symbol)
declNameArr ->
Z3_string
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_sort)
-> CUInt
-> Ptr (Ptr Z3_symbol)
-> Ptr (Ptr Z3_func_decl)
-> IO (Ptr Z3_ast_vector)
f Z3_string
fileName CUInt
sortNum Ptr (Ptr Z3_symbol)
sortNameArr Ptr (Ptr Z3_sort)
sortArr CUInt
declNum Ptr (Ptr Z3_symbol)
declNameArr Ptr (Ptr Z3_func_decl)
declArr
evalSMTLib2String :: Context
-> String
-> IO String
evalSMTLib2String :: Context -> String -> IO String
evalSMTLib2String Context
ctx String
cmd =
(Ptr Z3_context -> Z3_string -> IO Z3_string)
-> Context
-> ((Z3_string -> IO Z3_string) -> IO Z3_string)
-> IO String
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> Z3_string -> IO Z3_string
z3_eval_smtlib2_string Context
ctx (((Z3_string -> IO Z3_string) -> IO Z3_string) -> IO String)
-> ((Z3_string -> IO Z3_string) -> IO Z3_string) -> IO String
forall a b. (a -> b) -> a -> b
$ \Z3_string -> IO Z3_string
f ->
String -> (Z3_string -> IO Z3_string) -> IO Z3_string
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
cmd ((Z3_string -> IO Z3_string) -> IO Z3_string)
-> (Z3_string -> IO Z3_string) -> IO Z3_string
forall a b. (a -> b) -> a -> b
$ \Z3_string
command ->
Z3_string -> IO Z3_string
f Z3_string
command
data Z3Error = Z3Error
{ Z3Error -> Z3ErrorCode
errCode :: Z3ErrorCode
, Z3Error -> String
errMsg :: String
}
deriving Typeable
instance Show Z3Error where
show :: Z3Error -> String
show (Z3Error Z3ErrorCode
_ String
s) = String
"Z3 error: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
data Z3ErrorCode = SortError | IOB | InvalidArg | ParserError | NoParser
| InvalidPattern | MemoutFail | FileAccessError | InternalFatal
| InvalidUsage | DecRefError | Z3Exception
deriving (Int -> Z3ErrorCode -> ShowS
[Z3ErrorCode] -> ShowS
Z3ErrorCode -> String
(Int -> Z3ErrorCode -> ShowS)
-> (Z3ErrorCode -> String)
-> ([Z3ErrorCode] -> ShowS)
-> Show Z3ErrorCode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Z3ErrorCode -> ShowS
showsPrec :: Int -> Z3ErrorCode -> ShowS
$cshow :: Z3ErrorCode -> String
show :: Z3ErrorCode -> String
$cshowList :: [Z3ErrorCode] -> ShowS
showList :: [Z3ErrorCode] -> ShowS
Show, Typeable)
toZ3Error :: Z3_error_code -> Z3ErrorCode
toZ3Error :: Z3_error_code -> Z3ErrorCode
toZ3Error Z3_error_code
e
| Z3_error_code
e Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_sort_error = Z3ErrorCode
SortError
| Z3_error_code
e Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_iob = Z3ErrorCode
IOB
| Z3_error_code
e Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_invalid_arg = Z3ErrorCode
InvalidArg
| Z3_error_code
e Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_parser_error = Z3ErrorCode
ParserError
| Z3_error_code
e Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_no_parser = Z3ErrorCode
NoParser
| Z3_error_code
e Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_invalid_pattern = Z3ErrorCode
InvalidPattern
| Z3_error_code
e Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_memout_fail = Z3ErrorCode
MemoutFail
| Z3_error_code
e Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_file_access_error = Z3ErrorCode
FileAccessError
| Z3_error_code
e Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_internal_fatal = Z3ErrorCode
InternalFatal
| Z3_error_code
e Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_invalid_usage = Z3ErrorCode
InvalidUsage
| Z3_error_code
e Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_dec_ref_error = Z3ErrorCode
DecRefError
| Z3_error_code
e Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_error_code
z3_exception = Z3ErrorCode
Z3Exception
| Bool
otherwise = String -> Z3ErrorCode
forall a. HasCallStack => String -> a
error String
"Z3.Base.toZ3Error: illegal `Z3_error_code' value"
instance Exception Z3Error
z3Error :: Z3ErrorCode -> String -> IO ()
z3Error :: Z3ErrorCode -> String -> IO ()
z3Error Z3ErrorCode
cd = Z3Error -> IO ()
forall a e. Exception e => e -> a
throw (Z3Error -> IO ()) -> (String -> Z3Error) -> String -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Z3ErrorCode -> String -> Z3Error
Z3Error Z3ErrorCode
cd
checkError :: Ptr Z3_context -> IO a -> IO a
checkError :: forall a. Ptr Z3_context -> IO a -> IO a
checkError Ptr Z3_context
cPtr IO a
m = do
IO a
m IO a -> IO () -> IO a
forall a b. IO a -> IO b -> IO a
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
<* (Ptr Z3_context -> IO Z3_error_code
z3_get_error_code Ptr Z3_context
cPtr IO Z3_error_code -> (Z3_error_code -> IO ()) -> IO ()
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Z3_error_code -> IO ()
throwZ3Exn)
where getErrStr :: Z3_error_code -> IO String
getErrStr Z3_error_code
i = Z3_string -> IO String
peekCString (Z3_string -> IO String) -> IO Z3_string -> IO String
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr Z3_context -> Z3_error_code -> IO Z3_string
z3_get_error_msg Ptr Z3_context
cPtr Z3_error_code
i
throwZ3Exn :: Z3_error_code -> IO ()
throwZ3Exn Z3_error_code
i = Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Z3_error_code
i Z3_error_code -> Z3_error_code -> Bool
forall a. Eq a => a -> a -> Bool
/= Z3_error_code
z3_ok) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$ Z3_error_code -> IO String
getErrStr Z3_error_code
i IO String -> (String -> IO ()) -> IO ()
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Z3ErrorCode -> String -> IO ()
z3Error (Z3_error_code -> Z3ErrorCode
toZ3Error Z3_error_code
i)
data Version
= Version {
Version -> Int
z3Major :: !Int
, Version -> Int
z3Minor :: !Int
, Version -> Int
z3Build :: !Int
, Version -> Int
z3Revision :: !Int
}
deriving (Version -> Version -> Bool
(Version -> Version -> Bool)
-> (Version -> Version -> Bool) -> Eq Version
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Version -> Version -> Bool
== :: Version -> Version -> Bool
$c/= :: Version -> Version -> Bool
/= :: Version -> Version -> Bool
Eq,Eq Version
Eq Version
-> (Version -> Version -> Ordering)
-> (Version -> Version -> Bool)
-> (Version -> Version -> Bool)
-> (Version -> Version -> Bool)
-> (Version -> Version -> Bool)
-> (Version -> Version -> Version)
-> (Version -> Version -> Version)
-> Ord Version
Version -> Version -> Bool
Version -> Version -> Ordering
Version -> Version -> Version
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Version -> Version -> Ordering
compare :: Version -> Version -> Ordering
$c< :: Version -> Version -> Bool
< :: Version -> Version -> Bool
$c<= :: Version -> Version -> Bool
<= :: Version -> Version -> Bool
$c> :: Version -> Version -> Bool
> :: Version -> Version -> Bool
$c>= :: Version -> Version -> Bool
>= :: Version -> Version -> Bool
$cmax :: Version -> Version -> Version
max :: Version -> Version -> Version
$cmin :: Version -> Version -> Version
min :: Version -> Version -> Version
Ord)
instance Show Version where
show :: Version -> String
show (Version Int
major Int
minor Int
build Int
_) =
Int -> String
forall a. Show a => a -> String
show Int
major String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
"." String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show Int
minor String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
"." String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show Int
build
getVersion :: IO Version
getVersion :: IO Version
getVersion =
(Ptr CUInt -> IO Version) -> IO Version
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CUInt -> IO Version) -> IO Version)
-> (Ptr CUInt -> IO Version) -> IO Version
forall a b. (a -> b) -> a -> b
$ \Ptr CUInt
ptrMinor ->
(Ptr CUInt -> IO Version) -> IO Version
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CUInt -> IO Version) -> IO Version)
-> (Ptr CUInt -> IO Version) -> IO Version
forall a b. (a -> b) -> a -> b
$ \Ptr CUInt
ptrMajor ->
(Ptr CUInt -> IO Version) -> IO Version
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CUInt -> IO Version) -> IO Version)
-> (Ptr CUInt -> IO Version) -> IO Version
forall a b. (a -> b) -> a -> b
$ \Ptr CUInt
ptrBuild ->
(Ptr CUInt -> IO Version) -> IO Version
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr CUInt -> IO Version) -> IO Version)
-> (Ptr CUInt -> IO Version) -> IO Version
forall a b. (a -> b) -> a -> b
$ \Ptr CUInt
ptrRevision -> do
Ptr CUInt -> Ptr CUInt -> Ptr CUInt -> Ptr CUInt -> IO ()
z3_get_version Ptr CUInt
ptrMinor Ptr CUInt
ptrMajor Ptr CUInt
ptrBuild Ptr CUInt
ptrRevision
Int
minor <- CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (CUInt -> Int) -> IO CUInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
ptrMinor
Int
major <- CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (CUInt -> Int) -> IO CUInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
ptrMajor
Int
build <- CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (CUInt -> Int) -> IO CUInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
ptrBuild
Int
revision <- CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (CUInt -> Int) -> IO CUInt -> IO Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
ptrRevision
Version -> IO Version
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Version -> IO Version) -> Version -> IO Version
forall a b. (a -> b) -> a -> b
$ Int -> Int -> Int -> Int -> Version
Version Int
minor Int
major Int
build Int
revision
newtype Fixedpoint = Fixedpoint { Fixedpoint -> ForeignPtr Z3_fixedpoint
unFixedpoint :: ForeignPtr Z3_fixedpoint }
deriving Fixedpoint -> Fixedpoint -> Bool
(Fixedpoint -> Fixedpoint -> Bool)
-> (Fixedpoint -> Fixedpoint -> Bool) -> Eq Fixedpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Fixedpoint -> Fixedpoint -> Bool
== :: Fixedpoint -> Fixedpoint -> Bool
$c/= :: Fixedpoint -> Fixedpoint -> Bool
/= :: Fixedpoint -> Fixedpoint -> Bool
Eq
instance Marshal Fixedpoint (Ptr Z3_fixedpoint) where
c2h :: Context -> Ptr Z3_fixedpoint -> IO Fixedpoint
c2h = (ForeignPtr Z3_fixedpoint -> Fixedpoint)
-> Z3IncRefFun Z3_fixedpoint
-> Z3IncRefFun Z3_fixedpoint
-> Context
-> Ptr Z3_fixedpoint
-> IO Fixedpoint
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_fixedpoint -> Fixedpoint
Fixedpoint Z3IncRefFun Z3_fixedpoint
z3_fixedpoint_inc_ref Z3IncRefFun Z3_fixedpoint
z3_fixedpoint_dec_ref
h2c :: forall r. Fixedpoint -> (Ptr Z3_fixedpoint -> IO r) -> IO r
h2c Fixedpoint
fp = ForeignPtr Z3_fixedpoint -> (Ptr Z3_fixedpoint -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Fixedpoint -> ForeignPtr Z3_fixedpoint
unFixedpoint Fixedpoint
fp)
mkFixedpoint :: Context -> IO Fixedpoint
mkFixedpoint :: Context -> IO Fixedpoint
mkFixedpoint = (Ptr Z3_context -> IO (Ptr Z3_fixedpoint))
-> Context -> IO Fixedpoint
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_fixedpoint)
z3_mk_fixedpoint
fixedpointAddRule :: Context -> Fixedpoint -> AST -> Symbol -> IO ()
fixedpointAddRule :: Context -> Fixedpoint -> AST -> Symbol -> IO ()
fixedpointAddRule = (Ptr Z3_context
-> Ptr Z3_fixedpoint -> Ptr Z3_ast -> Ptr Z3_symbol -> IO ())
-> Context -> Fixedpoint -> AST -> Symbol -> IO ()
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_fixedpoint -> Ptr Z3_ast -> Ptr Z3_symbol -> IO ()
z3_fixedpoint_add_rule
fixedpointSetParams :: Context -> Fixedpoint -> Params -> IO ()
fixedpointSetParams :: Context -> Fixedpoint -> Params -> IO ()
fixedpointSetParams = (Ptr Z3_context -> Ptr Z3_fixedpoint -> Ptr Z3_params -> IO ())
-> Context -> Fixedpoint -> Params -> IO ()
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_fixedpoint -> Ptr Z3_params -> IO ()
z3_fixedpoint_set_params
fixedpointRegisterRelation :: Context -> Fixedpoint -> FuncDecl -> IO ()
fixedpointRegisterRelation :: Context -> Fixedpoint -> FuncDecl -> IO ()
fixedpointRegisterRelation = (Ptr Z3_context -> Ptr Z3_fixedpoint -> Ptr Z3_func_decl -> IO ())
-> Context -> Fixedpoint -> FuncDecl -> IO ()
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_fixedpoint -> Ptr Z3_func_decl -> IO ()
z3_fixedpoint_register_relation
fixedpointQueryRelations :: Context -> Fixedpoint -> [FuncDecl] -> IO Result
fixedpointQueryRelations :: Context -> Fixedpoint -> [FuncDecl] -> IO Result
fixedpointQueryRelations Context
ctx Fixedpoint
fixedpoint [FuncDecl]
fds =
(Ptr Z3_context
-> Ptr Z3_fixedpoint
-> CUInt
-> Ptr (Ptr Z3_func_decl)
-> IO Z3_lbool)
-> Context
-> ((Ptr Z3_fixedpoint
-> CUInt -> Ptr (Ptr Z3_func_decl) -> IO Z3_lbool)
-> IO Z3_lbool)
-> IO Result
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_fixedpoint
-> CUInt
-> Ptr (Ptr Z3_func_decl)
-> IO Z3_lbool
z3_fixedpoint_query_relations Context
ctx (((Ptr Z3_fixedpoint
-> CUInt -> Ptr (Ptr Z3_func_decl) -> IO Z3_lbool)
-> IO Z3_lbool)
-> IO Result)
-> ((Ptr Z3_fixedpoint
-> CUInt -> Ptr (Ptr Z3_func_decl) -> IO Z3_lbool)
-> IO Z3_lbool)
-> IO Result
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_fixedpoint -> CUInt -> Ptr (Ptr Z3_func_decl) -> IO Z3_lbool
f ->
Fixedpoint -> (Ptr Z3_fixedpoint -> IO Z3_lbool) -> IO Z3_lbool
forall r. Fixedpoint -> (Ptr Z3_fixedpoint -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Fixedpoint
fixedpoint ((Ptr Z3_fixedpoint -> IO Z3_lbool) -> IO Z3_lbool)
-> (Ptr Z3_fixedpoint -> IO Z3_lbool) -> IO Z3_lbool
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_fixedpoint
fixedpointPtr ->
[FuncDecl]
-> (CUInt -> Ptr (Ptr Z3_func_decl) -> IO Z3_lbool) -> IO Z3_lbool
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [FuncDecl]
fds ((CUInt -> Ptr (Ptr Z3_func_decl) -> IO Z3_lbool) -> IO Z3_lbool)
-> (CUInt -> Ptr (Ptr Z3_func_decl) -> IO Z3_lbool) -> IO Z3_lbool
forall a b. (a -> b) -> a -> b
$ \CUInt
fdsNum Ptr (Ptr Z3_func_decl)
fdsArr ->
Ptr Z3_fixedpoint -> CUInt -> Ptr (Ptr Z3_func_decl) -> IO Z3_lbool
f Ptr Z3_fixedpoint
fixedpointPtr CUInt
fdsNum Ptr (Ptr Z3_func_decl)
fdsArr
fixedpointGetAnswer :: Context -> Fixedpoint -> IO AST
fixedpointGetAnswer :: Context -> Fixedpoint -> IO AST
fixedpointGetAnswer = (Ptr Z3_context -> Ptr Z3_fixedpoint -> IO (Ptr Z3_ast))
-> Context -> Fixedpoint -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_fixedpoint -> IO (Ptr Z3_ast)
z3_fixedpoint_get_answer
fixedpointGetAssertions :: Context -> Fixedpoint -> IO [AST]
fixedpointGetAssertions :: Context -> Fixedpoint -> IO [AST]
fixedpointGetAssertions = (Ptr Z3_context -> Ptr Z3_fixedpoint -> IO (Ptr Z3_ast_vector))
-> Context -> Fixedpoint -> IO [AST]
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_fixedpoint -> IO (Ptr Z3_ast_vector)
z3_fixedpoint_get_assertions
mkFpaRoundingModeSort :: Context -> IO Sort
mkFpaRoundingModeSort :: Context -> IO Sort
mkFpaRoundingModeSort = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_fpa_rounding_mode_sort
mkFpaRoundNearestTiesToEven :: Context -> IO AST
mkFpaRoundNearestTiesToEven :: Context -> IO AST
mkFpaRoundNearestTiesToEven = (Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_fpa_round_nearest_ties_to_even
mkFpaRne :: Context -> IO AST
mkFpaRne :: Context -> IO AST
mkFpaRne = (Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_fpa_rne
mkFpaRoundNearestTiesToAway :: Context -> IO AST
mkFpaRoundNearestTiesToAway :: Context -> IO AST
mkFpaRoundNearestTiesToAway = (Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_fpa_round_nearest_ties_to_away
mkFpaRna :: Context -> IO AST
mkFpaRna :: Context -> IO AST
mkFpaRna = (Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_fpa_rna
mkFpaRoundTowardPositive :: Context -> IO AST
mkFpaRoundTowardPositive :: Context -> IO AST
mkFpaRoundTowardPositive = (Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_fpa_round_toward_positive
mkFpaRtp :: Context -> IO AST
mkFpaRtp :: Context -> IO AST
mkFpaRtp = (Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_fpa_rtp
mkFpaRoundTowardNegative :: Context -> IO AST
mkFpaRoundTowardNegative :: Context -> IO AST
mkFpaRoundTowardNegative = (Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_fpa_round_toward_negative
mkFpaRtn :: Context -> IO AST
mkFpaRtn :: Context -> IO AST
mkFpaRtn = (Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_fpa_rtn
mkFpaRoundTowardZero :: Context -> IO AST
mkFpaRoundTowardZero :: Context -> IO AST
mkFpaRoundTowardZero = (Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_fpa_round_toward_zero
mkFpaRtz :: Context -> IO AST
mkFpaRtz :: Context -> IO AST
mkFpaRtz = (Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
z3_mk_fpa_rtz
mkFpaSort :: Integral int
=> Context
-> int
-> int
-> IO Sort
mkFpaSort :: forall int. Integral int => Context -> int -> int -> IO Sort
mkFpaSort = (Ptr Z3_context -> CUInt -> CUInt -> IO (Ptr Z3_sort))
-> Context -> int -> int -> IO Sort
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CUInt -> CUInt -> IO (Ptr Z3_sort)
z3_mk_fpa_sort
mkFpaSortHalf :: Context -> IO Sort
mkFpaSortHalf :: Context -> IO Sort
mkFpaSortHalf = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_fpa_sort_half
mkFpaSort16 :: Context -> IO Sort
mkFpaSort16 :: Context -> IO Sort
mkFpaSort16 = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_fpa_sort_16
mkFpaSortSingle :: Context -> IO Sort
mkFpaSortSingle :: Context -> IO Sort
mkFpaSortSingle = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_fpa_sort_single
mkFpaSort32 :: Context -> IO Sort
mkFpaSort32 :: Context -> IO Sort
mkFpaSort32 = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_fpa_sort_32
mkFpaSortDouble :: Context -> IO Sort
mkFpaSortDouble :: Context -> IO Sort
mkFpaSortDouble = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_fpa_sort_double
mkFpaSort64 :: Context -> IO Sort
mkFpaSort64 :: Context -> IO Sort
mkFpaSort64 = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_fpa_sort_64
mkFpaSortQuadruple :: Context -> IO Sort
mkFpaSortQuadruple :: Context -> IO Sort
mkFpaSortQuadruple = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_fpa_sort_quadruple
mkFpaSort128 :: Context -> IO Sort
mkFpaSort128 :: Context -> IO Sort
mkFpaSort128 = (Ptr Z3_context -> IO (Ptr Z3_sort)) -> Context -> IO Sort
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_sort)
z3_mk_fpa_sort_128
mkFpaNaN :: Context -> Sort -> IO AST
mkFpaNaN :: Context -> Sort -> IO AST
mkFpaNaN = (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Sort -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_fpa_nan
mkFpaInf :: Context
-> Sort
-> Bool
-> IO AST
mkFpaInf :: Context -> Sort -> Bool -> IO AST
mkFpaInf = (Ptr Z3_context -> Ptr Z3_sort -> Z3_bool -> IO (Ptr Z3_ast))
-> Context -> Sort -> Bool -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_sort -> Z3_bool -> IO (Ptr Z3_ast)
z3_mk_fpa_inf
mkFpaZero :: Context
-> Sort
-> Bool
-> IO AST
mkFpaZero :: Context -> Sort -> Bool -> IO AST
mkFpaZero = (Ptr Z3_context -> Ptr Z3_sort -> Z3_bool -> IO (Ptr Z3_ast))
-> Context -> Sort -> Bool -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_sort -> Z3_bool -> IO (Ptr Z3_ast)
z3_mk_fpa_zero
mkFpaFp :: Context
-> AST
-> AST
-> AST
-> IO AST
mkFpaFp :: Context -> AST -> AST -> AST -> IO AST
mkFpaFp = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> AST -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_fp
mkFpaNumeralFloat :: Context -> Float -> Sort -> IO AST
mkFpaNumeralFloat :: Context -> Float -> Sort -> IO AST
mkFpaNumeralFloat = (Ptr Z3_context -> CFloat -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Float -> Sort -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CFloat -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_fpa_numeral_float
mkFpaNumeralDouble :: Context -> Double -> Sort -> IO AST
mkFpaNumeralDouble :: Context -> Double -> Sort -> IO AST
mkFpaNumeralDouble = (Ptr Z3_context -> CDouble -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Double -> Sort -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> CDouble -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_fpa_numeral_double
mkFpaNumeralInt :: Integral int => Context -> int -> Sort -> IO AST
mkFpaNumeralInt :: forall a. Integral a => Context -> a -> Sort -> IO AST
mkFpaNumeralInt = (Ptr Z3_context -> Z3_error_code -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> int -> Sort -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Z3_error_code -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_fpa_numeral_int
mkFpaNumeralIntUInt :: Integral int
=> Context
-> Bool
-> int
-> int
-> Sort
-> IO AST
mkFpaNumeralIntUInt :: forall int.
Integral int =>
Context -> Bool -> int -> int -> Sort -> IO AST
mkFpaNumeralIntUInt = (Ptr Z3_context
-> Z3_bool
-> Z3_error_code
-> CUInt
-> Ptr Z3_sort
-> IO (Ptr Z3_ast))
-> Context -> Bool -> int -> int -> Sort -> IO AST
forall ah ac bh bc ch cc dh dc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal dh dc,
Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> dc -> IO rc)
-> Context -> ah -> bh -> ch -> dh -> IO rh
liftFun4 Ptr Z3_context
-> Z3_bool
-> Z3_error_code
-> CUInt
-> Ptr Z3_sort
-> IO (Ptr Z3_ast)
z3_mk_fpa_numeral_int_uint
mkFpaNumeralInt64UInt64 :: Integral int
=> Context
-> Bool
-> int
-> int
-> Sort
-> IO AST
mkFpaNumeralInt64UInt64 :: forall int.
Integral int =>
Context -> Bool -> int -> int -> Sort -> IO AST
mkFpaNumeralInt64UInt64 = (Ptr Z3_context
-> Z3_bool -> CLong -> CULong -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> Bool -> int -> int -> Sort -> IO AST
forall ah ac bh bc ch cc dh dc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal dh dc,
Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> dc -> IO rc)
-> Context -> ah -> bh -> ch -> dh -> IO rh
liftFun4 Ptr Z3_context
-> Z3_bool -> CLong -> CULong -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_fpa_numeral_int64_uint64
mkFpaAbs :: Context -> AST -> IO AST
mkFpaAbs :: Context -> AST -> IO AST
mkFpaAbs = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_abs
mkFpaNeg :: Context -> AST -> IO AST
mkFpaNeg :: Context -> AST -> IO AST
mkFpaNeg = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_neg
mkFpaAdd :: Context
-> AST
-> AST
-> AST
-> IO AST
mkFpaAdd :: Context -> AST -> AST -> AST -> IO AST
mkFpaAdd = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> AST -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_add
mkFpaSub :: Context
-> AST
-> AST
-> AST
-> IO AST
mkFpaSub :: Context -> AST -> AST -> AST -> IO AST
mkFpaSub = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> AST -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_sub
mkFpaMul :: Context
-> AST
-> AST
-> AST
-> IO AST
mkFpaMul :: Context -> AST -> AST -> AST -> IO AST
mkFpaMul = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> AST -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_mul
mkFpaDiv :: Context
-> AST
-> AST
-> AST
-> IO AST
mkFpaDiv :: Context -> AST -> AST -> AST -> IO AST
mkFpaDiv = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> AST -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_div
mkFpaFma :: Context -> AST -> AST -> AST -> AST -> IO AST
mkFpaFma :: Context -> AST -> AST -> AST -> AST -> IO AST
mkFpaFma = (Ptr Z3_context
-> Ptr Z3_ast
-> Ptr Z3_ast
-> Ptr Z3_ast
-> Ptr Z3_ast
-> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> AST -> AST -> IO AST
forall ah ac bh bc ch cc dh dc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal dh dc,
Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> dc -> IO rc)
-> Context -> ah -> bh -> ch -> dh -> IO rh
liftFun4 Ptr Z3_context
-> Ptr Z3_ast
-> Ptr Z3_ast
-> Ptr Z3_ast
-> Ptr Z3_ast
-> IO (Ptr Z3_ast)
z3_mk_fpa_fma
mkFpaSqrt :: Context -> AST -> AST -> IO AST
mkFpaSqrt :: Context -> AST -> AST -> IO AST
mkFpaSqrt = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_sqrt
mkFpaRem :: Context -> AST -> AST -> IO AST
mkFpaRem :: Context -> AST -> AST -> IO AST
mkFpaRem = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_rem
mkFpaRoundToIntegral :: Context -> AST -> AST -> IO AST
mkFpaRoundToIntegral :: Context -> AST -> AST -> IO AST
mkFpaRoundToIntegral = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_round_to_integral
mkFpaMin :: Context -> AST -> AST -> IO AST
mkFpaMin :: Context -> AST -> AST -> IO AST
mkFpaMin = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_min
mkFpaMax :: Context -> AST -> AST -> IO AST
mkFpaMax :: Context -> AST -> AST -> IO AST
mkFpaMax = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_max
mkFpaLeq :: Context -> AST -> AST -> IO AST
mkFpaLeq :: Context -> AST -> AST -> IO AST
mkFpaLeq = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_leq
mkFpaLt :: Context -> AST -> AST -> IO AST
mkFpaLt :: Context -> AST -> AST -> IO AST
mkFpaLt = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_lt
mkFpaGeq :: Context -> AST -> AST -> IO AST
mkFpaGeq :: Context -> AST -> AST -> IO AST
mkFpaGeq = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_geq
mkFpaGt :: Context -> AST -> AST -> IO AST
mkFpaGt :: Context -> AST -> AST -> IO AST
mkFpaGt = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_gt
mkFpaEq :: Context -> AST -> AST -> IO AST
mkFpaEq :: Context -> AST -> AST -> IO AST
mkFpaEq = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_eq
mkFpaIsNormal :: Context -> AST -> IO AST
mkFpaIsNormal :: Context -> AST -> IO AST
mkFpaIsNormal = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_is_normal
mkFpaIsSubnormal :: Context -> AST -> IO AST
mkFpaIsSubnormal :: Context -> AST -> IO AST
mkFpaIsSubnormal = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_is_subnormal
mkFpaIsZero :: Context -> AST -> IO AST
mkFpaIsZero :: Context -> AST -> IO AST
mkFpaIsZero = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_is_zero
mkFpaIsInfinite :: Context -> AST -> IO AST
mkFpaIsInfinite :: Context -> AST -> IO AST
mkFpaIsInfinite = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_is_infinite
mkFpaIsNaN :: Context -> AST -> IO AST
mkFpaIsNaN :: Context -> AST -> IO AST
mkFpaIsNaN = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_is_nan
mkFpaIsNegative :: Context -> AST -> IO AST
mkFpaIsNegative :: Context -> AST -> IO AST
mkFpaIsNegative = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_is_negative
mkFpaIsPositive :: Context -> AST -> IO AST
mkFpaIsPositive :: Context -> AST -> IO AST
mkFpaIsPositive = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_is_positive
mkFpaToFpBv :: Context -> AST -> Sort -> IO AST
mkFpaToFpBv :: Context -> AST -> Sort -> IO AST
mkFpaToFpBv = (Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> AST -> Sort -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_fpa_to_fp_bv
mkFpaToFpFloat :: Context -> AST -> AST -> Sort -> IO AST
mkFpaToFpFloat :: Context -> AST -> AST -> Sort -> IO AST
mkFpaToFpFloat = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> Sort -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_fpa_to_fp_float
mkFpaToFpReal :: Context -> AST -> AST -> Sort -> IO AST
mkFpaToFpReal :: Context -> AST -> AST -> Sort -> IO AST
mkFpaToFpReal = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> Sort -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_fpa_to_fp_real
mkFpaToFpSigned :: Context -> AST -> AST -> Sort -> IO AST
mkFpaToFpSigned :: Context -> AST -> AST -> Sort -> IO AST
mkFpaToFpSigned = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> Sort -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_fpa_to_fp_signed
mkFpaToFpUnsigned :: Context -> AST -> AST -> Sort -> IO AST
mkFpaToFpUnsigned :: Context -> AST -> AST -> Sort -> IO AST
mkFpaToFpUnsigned = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> Sort -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_mk_fpa_to_fp_unsigned
mkFpaToUbv :: Integral int => Context -> AST -> AST -> int -> IO AST
mkFpaToUbv :: forall int. Integral int => Context -> AST -> AST -> int -> IO AST
mkFpaToUbv = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> int -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_ast)
z3_mk_fpa_to_ubv
mkFpaToSbv :: Integral int => Context -> AST -> AST -> int -> IO AST
mkFpaToSbv :: forall int. Integral int => Context -> AST -> AST -> int -> IO AST
mkFpaToSbv = (Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> int -> IO AST
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_ast -> Ptr Z3_ast -> CUInt -> IO (Ptr Z3_ast)
z3_mk_fpa_to_sbv
mkFpaToReal :: Context -> AST -> IO AST
mkFpaToReal :: Context -> AST -> IO AST
mkFpaToReal = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_to_real
fpaGetEbits :: Integral int => Context -> Sort -> IO int
fpaGetEbits :: forall int. Integral int => Context -> Sort -> IO int
fpaGetEbits = (Ptr Z3_context -> Ptr Z3_sort -> IO CUInt)
-> Context -> Sort -> IO int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO CUInt
z3_fpa_get_ebits
fpaGetSbits :: Integral int => Context -> Sort -> IO int
fpaGetSbits :: forall int. Integral int => Context -> Sort -> IO int
fpaGetSbits = (Ptr Z3_context -> Ptr Z3_sort -> IO CUInt)
-> Context -> Sort -> IO int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_sort -> IO CUInt
z3_fpa_get_sbits
fpaIsNumeralNaN :: Context -> AST -> IO Bool
fpaIsNumeralNaN :: Context -> AST -> IO Bool
fpaIsNumeralNaN = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_fpa_is_numeral_nan
fpaIsNumeralInf :: Context -> AST -> IO Bool
fpaIsNumeralInf :: Context -> AST -> IO Bool
fpaIsNumeralInf = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_fpa_is_numeral_inf
fpaIsNumeralZero :: Context -> AST -> IO Bool
fpaIsNumeralZero :: Context -> AST -> IO Bool
fpaIsNumeralZero = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_fpa_is_numeral_zero
fpaIsNumeralNormal :: Context -> AST -> IO Bool
fpaIsNumeralNormal :: Context -> AST -> IO Bool
fpaIsNumeralNormal = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_fpa_is_numeral_normal
fpaIsNumeralSubnormal :: Context -> AST -> IO Bool
fpaIsNumeralSubnormal :: Context -> AST -> IO Bool
fpaIsNumeralSubnormal = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_fpa_is_numeral_subnormal
fpaIsNumeralPositive :: Context -> AST -> IO Bool
fpaIsNumeralPositive :: Context -> AST -> IO Bool
fpaIsNumeralPositive = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_fpa_is_numeral_positive
fpaIsNumeralNegative :: Context -> AST -> IO Bool
fpaIsNumeralNegative :: Context -> AST -> IO Bool
fpaIsNumeralNegative = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool)
-> Context -> AST -> IO Bool
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_bool
z3_fpa_is_numeral_negative
fpaGetNumeralSignBv :: Context -> AST -> IO AST
fpaGetNumeralSignBv :: Context -> AST -> IO AST
fpaGetNumeralSignBv = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_fpa_get_numeral_sign_bv
fpaGetNumeralSignificandBv :: Context -> AST -> IO AST
fpaGetNumeralSignificandBv :: Context -> AST -> IO AST
fpaGetNumeralSignificandBv = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_fpa_get_numeral_significand_bv
fpaGetNumeralSignificandString :: Context -> AST -> IO String
fpaGetNumeralSignificandString :: Context -> AST -> IO String
fpaGetNumeralSignificandString = (Ptr Z3_context -> Ptr Z3_ast -> IO Z3_string)
-> Context -> AST -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO Z3_string
z3_fpa_get_numeral_significand_string
fpaGetNumeralExponentString :: Context -> AST -> Bool -> IO String
fpaGetNumeralExponentString :: Context -> AST -> Bool -> IO String
fpaGetNumeralExponentString = (Ptr Z3_context -> Ptr Z3_ast -> Z3_bool -> IO Z3_string)
-> Context -> AST -> Bool -> IO String
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Z3_bool -> IO Z3_string
z3_fpa_get_numeral_exponent_string
fpaGetNumeralExponentBv :: Context -> AST -> Bool -> IO AST
fpaGetNumeralExponentBv :: Context -> AST -> Bool -> IO AST
fpaGetNumeralExponentBv = (Ptr Z3_context -> Ptr Z3_ast -> Z3_bool -> IO (Ptr Z3_ast))
-> Context -> AST -> Bool -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_ast -> Z3_bool -> IO (Ptr Z3_ast)
z3_fpa_get_numeral_exponent_bv
mkFpaToIEEEBv :: Context -> AST -> IO AST
mkFpaToIEEEBv :: Context -> AST -> IO AST
mkFpaToIEEEBv = (Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast))
-> Context -> AST -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_ast -> IO (Ptr Z3_ast)
z3_mk_fpa_to_ieee_bv
mkFpaToFpIntReal :: Context -> AST -> AST -> AST -> Sort -> IO AST
mkFpaToFpIntReal :: Context -> AST -> AST -> AST -> Sort -> IO AST
mkFpaToFpIntReal = (Ptr Z3_context
-> Ptr Z3_ast
-> Ptr Z3_ast
-> Ptr Z3_ast
-> Ptr Z3_sort
-> IO (Ptr Z3_ast))
-> Context -> AST -> AST -> AST -> Sort -> IO AST
forall ah ac bh bc ch cc dh dc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal dh dc,
Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> dc -> IO rc)
-> Context -> ah -> bh -> ch -> dh -> IO rh
liftFun4 Ptr Z3_context
-> Ptr Z3_ast
-> Ptr Z3_ast
-> Ptr Z3_ast
-> Ptr Z3_sort
-> IO (Ptr Z3_ast)
z3_mk_fpa_to_fp_int_real
newtype Optimize = Optimize { Optimize -> ForeignPtr Z3_optimize
unOptimize :: ForeignPtr Z3_optimize }
deriving Optimize -> Optimize -> Bool
(Optimize -> Optimize -> Bool)
-> (Optimize -> Optimize -> Bool) -> Eq Optimize
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Optimize -> Optimize -> Bool
== :: Optimize -> Optimize -> Bool
$c/= :: Optimize -> Optimize -> Bool
/= :: Optimize -> Optimize -> Bool
Eq
instance Marshal Optimize (Ptr Z3_optimize) where
c2h :: Context -> Ptr Z3_optimize -> IO Optimize
c2h = (ForeignPtr Z3_optimize -> Optimize)
-> Z3IncRefFun Z3_optimize
-> Z3IncRefFun Z3_optimize
-> Context
-> Ptr Z3_optimize
-> IO Optimize
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_optimize -> Optimize
Optimize Z3IncRefFun Z3_optimize
z3_optimize_inc_ref Z3IncRefFun Z3_optimize
z3_optimize_dec_ref
h2c :: forall r. Optimize -> (Ptr Z3_optimize -> IO r) -> IO r
h2c Optimize
fp = ForeignPtr Z3_optimize -> (Ptr Z3_optimize -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Optimize -> ForeignPtr Z3_optimize
unOptimize Optimize
fp)
mkOptimize :: Context -> IO Optimize
mkOptimize :: Context -> IO Optimize
mkOptimize = (Ptr Z3_context -> IO (Ptr Z3_optimize)) -> Context -> IO Optimize
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_optimize)
z3_mk_optimize
optimizeAssert :: Context -> Optimize -> AST -> IO ()
optimizeAssert :: Context -> Optimize -> AST -> IO ()
optimizeAssert = (Ptr Z3_context -> Ptr Z3_optimize -> Ptr Z3_ast -> IO ())
-> Context -> Optimize -> AST -> IO ()
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_optimize -> Ptr Z3_ast -> IO ()
z3_optimize_assert
optimizeAssertAndTrack :: Context -> Optimize -> AST -> AST -> IO ()
optimizeAssertAndTrack :: Context -> Optimize -> AST -> AST -> IO ()
optimizeAssertAndTrack = (Ptr Z3_context
-> Ptr Z3_optimize -> Ptr Z3_ast -> Ptr Z3_ast -> IO ())
-> Context -> Optimize -> AST -> AST -> IO ()
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_optimize -> Ptr Z3_ast -> Ptr Z3_ast -> IO ()
z3_optimize_assert_and_track
optimizeAssertSoft :: Context -> Optimize -> AST -> String -> Symbol -> IO Int
optimizeAssertSoft :: Context -> Optimize -> AST -> String -> Symbol -> IO Int
optimizeAssertSoft Context
ctx Optimize
opt AST
ast String
str Symbol
sym =
(Ptr Z3_context
-> Ptr Z3_optimize
-> Ptr Z3_ast
-> Z3_string
-> Ptr Z3_symbol
-> IO CUInt)
-> Context
-> ((Ptr Z3_optimize
-> Ptr Z3_ast -> Z3_string -> Ptr Z3_symbol -> IO CUInt)
-> IO CUInt)
-> IO Int
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_optimize
-> Ptr Z3_ast
-> Z3_string
-> Ptr Z3_symbol
-> IO CUInt
z3_optimize_assert_soft Context
ctx (((Ptr Z3_optimize
-> Ptr Z3_ast -> Z3_string -> Ptr Z3_symbol -> IO CUInt)
-> IO CUInt)
-> IO Int)
-> ((Ptr Z3_optimize
-> Ptr Z3_ast -> Z3_string -> Ptr Z3_symbol -> IO CUInt)
-> IO CUInt)
-> IO Int
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_optimize
-> Ptr Z3_ast -> Z3_string -> Ptr Z3_symbol -> IO CUInt
f ->
Optimize -> (Ptr Z3_optimize -> IO CUInt) -> IO CUInt
forall r. Optimize -> (Ptr Z3_optimize -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Optimize
opt ((Ptr Z3_optimize -> IO CUInt) -> IO CUInt)
-> (Ptr Z3_optimize -> IO CUInt) -> IO CUInt
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_optimize
optPtr ->
AST -> (Ptr Z3_ast -> IO CUInt) -> IO CUInt
forall r. AST -> (Ptr Z3_ast -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c AST
ast ((Ptr Z3_ast -> IO CUInt) -> IO CUInt)
-> (Ptr Z3_ast -> IO CUInt) -> IO CUInt
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_ast
astPtr ->
String -> (Z3_string -> IO CUInt) -> IO CUInt
forall a. String -> (Z3_string -> IO a) -> IO a
withCString String
str ((Z3_string -> IO CUInt) -> IO CUInt)
-> (Z3_string -> IO CUInt) -> IO CUInt
forall a b. (a -> b) -> a -> b
$ \Z3_string
strPtr ->
Symbol -> (Ptr Z3_symbol -> IO CUInt) -> IO CUInt
forall r. Symbol -> (Ptr Z3_symbol -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Symbol
sym ((Ptr Z3_symbol -> IO CUInt) -> IO CUInt)
-> (Ptr Z3_symbol -> IO CUInt) -> IO CUInt
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_symbol
symPtr ->
Ptr Z3_optimize
-> Ptr Z3_ast -> Z3_string -> Ptr Z3_symbol -> IO CUInt
f Ptr Z3_optimize
optPtr Ptr Z3_ast
astPtr Z3_string
strPtr Ptr Z3_symbol
symPtr
optimizeMaximize :: Context -> Optimize -> AST -> IO Int
optimizeMaximize :: Context -> Optimize -> AST -> IO Int
optimizeMaximize = (Ptr Z3_context -> Ptr Z3_optimize -> Ptr Z3_ast -> IO CUInt)
-> Context -> Optimize -> AST -> IO Int
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_optimize -> Ptr Z3_ast -> IO CUInt
z3_optimize_maximize
optimizeMinimize :: Context -> Optimize -> AST -> IO Int
optimizeMinimize :: Context -> Optimize -> AST -> IO Int
optimizeMinimize = (Ptr Z3_context -> Ptr Z3_optimize -> Ptr Z3_ast -> IO CUInt)
-> Context -> Optimize -> AST -> IO Int
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_optimize -> Ptr Z3_ast -> IO CUInt
z3_optimize_minimize
optimizePush :: Context -> Optimize -> IO ()
optimizePush :: Context -> Optimize -> IO ()
optimizePush = Z3IncRefFun Z3_optimize -> Context -> Optimize -> IO ()
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Z3IncRefFun Z3_optimize
z3_optimize_push
optimizePop :: Context -> Optimize -> IO ()
optimizePop :: Context -> Optimize -> IO ()
optimizePop = Z3IncRefFun Z3_optimize -> Context -> Optimize -> IO ()
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Z3IncRefFun Z3_optimize
z3_optimize_pop
optimizeCheck :: Context -> Optimize -> [AST] -> IO Result
optimizeCheck :: Context -> Optimize -> [AST] -> IO Result
optimizeCheck Context
ctx Optimize
opt [AST]
ss = (Ptr Z3_context
-> Ptr Z3_optimize -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool)
-> Context
-> ((Ptr Z3_optimize -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool)
-> IO Z3_lbool)
-> IO Result
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_optimize -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool
z3_optimize_check Context
ctx (((Ptr Z3_optimize -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool)
-> IO Z3_lbool)
-> IO Result)
-> ((Ptr Z3_optimize -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool)
-> IO Z3_lbool)
-> IO Result
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_optimize -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool
f ->
Optimize -> (Ptr Z3_optimize -> IO Z3_lbool) -> IO Z3_lbool
forall r. Optimize -> (Ptr Z3_optimize -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Optimize
opt ((Ptr Z3_optimize -> IO Z3_lbool) -> IO Z3_lbool)
-> (Ptr Z3_optimize -> IO Z3_lbool) -> IO Z3_lbool
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_optimize
optPtr ->
[AST] -> (CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool) -> IO Z3_lbool
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
ss ((CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool) -> IO Z3_lbool)
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool) -> IO Z3_lbool
forall a b. (a -> b) -> a -> b
$ \CUInt
ssNum Ptr (Ptr Z3_ast)
ssPtr ->
Ptr Z3_optimize -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool
f Ptr Z3_optimize
optPtr CUInt
ssNum Ptr (Ptr Z3_ast)
ssPtr
optimizeGetReasonUnknown :: Context -> Optimize -> IO String
optimizeGetReasonUnknown :: Context -> Optimize -> IO String
optimizeGetReasonUnknown = (Ptr Z3_context -> Ptr Z3_optimize -> IO Z3_string)
-> Context -> Optimize -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_optimize -> IO Z3_string
z3_optimize_get_reason_unknown
optimizeGetModel :: Context -> Optimize -> IO Model
optimizeGetModel :: Context -> Optimize -> IO Model
optimizeGetModel = (Ptr Z3_context -> Ptr Z3_optimize -> IO (Ptr Z3_model))
-> Context -> Optimize -> IO Model
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_optimize -> IO (Ptr Z3_model)
z3_optimize_get_model
optimizeGetUnsatCore :: Context -> Optimize -> IO [AST]
optimizeGetUnsatCore :: Context -> Optimize -> IO [AST]
optimizeGetUnsatCore = (Ptr Z3_context -> Ptr Z3_optimize -> IO (Ptr Z3_ast_vector))
-> Context -> Optimize -> IO [AST]
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_optimize -> IO (Ptr Z3_ast_vector)
z3_optimize_get_unsat_core
optimizeSetParams :: Context -> Optimize -> Params -> IO ()
optimizeSetParams :: Context -> Optimize -> Params -> IO ()
optimizeSetParams = (Ptr Z3_context -> Ptr Z3_optimize -> Ptr Z3_params -> IO ())
-> Context -> Optimize -> Params -> IO ()
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_optimize -> Ptr Z3_params -> IO ()
z3_optimize_set_params
optimizeGetLower :: Context -> Optimize -> Int -> IO AST
optimizeGetLower :: Context -> Optimize -> Int -> IO AST
optimizeGetLower = (Ptr Z3_context -> Ptr Z3_optimize -> CUInt -> IO (Ptr Z3_ast))
-> Context -> Optimize -> Int -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_optimize -> CUInt -> IO (Ptr Z3_ast)
z3_optimize_get_lower
optimizeGetUpper :: Context -> Optimize -> Int -> IO AST
optimizeGetUpper :: Context -> Optimize -> Int -> IO AST
optimizeGetUpper = (Ptr Z3_context -> Ptr Z3_optimize -> CUInt -> IO (Ptr Z3_ast))
-> Context -> Optimize -> Int -> IO AST
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_optimize -> CUInt -> IO (Ptr Z3_ast)
z3_optimize_get_upper
optimizeGetUpperAsVector :: Context -> Optimize -> Int -> IO [AST]
optimizeGetUpperAsVector :: Context -> Optimize -> Int -> IO [AST]
optimizeGetUpperAsVector = (Ptr Z3_context
-> Ptr Z3_optimize -> CUInt -> IO (Ptr Z3_ast_vector))
-> Context -> Optimize -> Int -> IO [AST]
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context
-> Ptr Z3_optimize -> CUInt -> IO (Ptr Z3_ast_vector)
z3_optimize_get_upper_as_vector
optimizeGetLowerAsVector :: Context -> Optimize -> Int -> IO [AST]
optimizeGetLowerAsVector :: Context -> Optimize -> Int -> IO [AST]
optimizeGetLowerAsVector = (Ptr Z3_context
-> Ptr Z3_optimize -> CUInt -> IO (Ptr Z3_ast_vector))
-> Context -> Optimize -> Int -> IO [AST]
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context
-> Ptr Z3_optimize -> CUInt -> IO (Ptr Z3_ast_vector)
z3_optimize_get_lower_as_vector
optimizeToString :: Context -> Optimize -> IO String
optimizeToString :: Context -> Optimize -> IO String
optimizeToString = (Ptr Z3_context -> Ptr Z3_optimize -> IO Z3_string)
-> Context -> Optimize -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_optimize -> IO Z3_string
z3_optimize_to_string
optimizeFromString :: Context -> Optimize -> String -> IO ()
optimizeFromString :: Context -> Optimize -> String -> IO ()
optimizeFromString = (Ptr Z3_context -> Ptr Z3_optimize -> Z3_string -> IO ())
-> Context -> Optimize -> String -> IO ()
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_optimize -> Z3_string -> IO ()
z3_optimize_from_string
optimizeFromFile :: Context -> Optimize -> String -> IO ()
optimizeFromFile :: Context -> Optimize -> String -> IO ()
optimizeFromFile = (Ptr Z3_context -> Ptr Z3_optimize -> Z3_string -> IO ())
-> Context -> Optimize -> String -> IO ()
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_optimize -> Z3_string -> IO ()
z3_optimize_from_file
optimizeGetHelp :: Context -> Optimize -> IO String
optimizeGetHelp :: Context -> Optimize -> IO String
optimizeGetHelp = (Ptr Z3_context -> Ptr Z3_optimize -> IO Z3_string)
-> Context -> Optimize -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_optimize -> IO Z3_string
z3_optimize_get_help
optimizeGetAssertions :: Context -> Optimize -> IO [AST]
optimizeGetAssertions :: Context -> Optimize -> IO [AST]
optimizeGetAssertions = (Ptr Z3_context -> Ptr Z3_optimize -> IO (Ptr Z3_ast_vector))
-> Context -> Optimize -> IO [AST]
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_optimize -> IO (Ptr Z3_ast_vector)
z3_optimize_get_assertions
optimizeGetObjectives :: Context -> Optimize -> IO [AST]
optimizeGetObjectives :: Context -> Optimize -> IO [AST]
optimizeGetObjectives = (Ptr Z3_context -> Ptr Z3_optimize -> IO (Ptr Z3_ast_vector))
-> Context -> Optimize -> IO [AST]
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_optimize -> IO (Ptr Z3_ast_vector)
z3_optimize_get_objectives
data Logic
= AUFLIA
| AUFLIRA
| AUFNIRA
| LRA
| QF_ABV
| QF_AUFBV
| QF_AUFLIA
| QF_AX
| QF_BV
| QF_IDL
| QF_LIA
| QF_LRA
| QF_NIA
| QF_NRA
| QF_RDL
| QF_UF
| QF_UFBV
| QF_UFIDL
| QF_UFLIA
| QF_UFLRA
| QF_UFNRA
| UFLRA
| UFNIA
instance Show Logic where
show :: Logic -> String
show Logic
AUFLIA = String
"AUFLIA"
show Logic
AUFLIRA = String
"AUFLIRA"
show Logic
AUFNIRA = String
"AUFNIRA"
show Logic
LRA = String
"LRA"
show Logic
QF_ABV = String
"QF_ABV"
show Logic
QF_AUFBV = String
"QF_AUFBV"
show Logic
QF_AUFLIA = String
"QF_AUFLIA"
show Logic
QF_AX = String
"QF_AX"
show Logic
QF_BV = String
"QF_BV"
show Logic
QF_IDL = String
"QF_IDL"
show Logic
QF_LIA = String
"QF_LIA"
show Logic
QF_LRA = String
"QF_LRA"
show Logic
QF_NIA = String
"QF_NIA"
show Logic
QF_NRA = String
"QF_NRA"
show Logic
QF_RDL = String
"QF_RDL"
show Logic
QF_UF = String
"QF_UF"
show Logic
QF_UFBV = String
"QF_UFBV"
show Logic
QF_UFIDL = String
"QF_UFIDL"
show Logic
QF_UFLIA = String
"QF_UFLIA"
show Logic
QF_UFLRA = String
"QF_UFLRA"
show Logic
QF_UFNRA = String
"QF_UFNRA"
show Logic
UFLRA = String
"UFLRA"
show Logic
UFNIA = String
"UFNIA"
mkSolver :: Context -> IO Solver
mkSolver :: Context -> IO Solver
mkSolver = (Ptr Z3_context -> IO (Ptr Z3_solver)) -> Context -> IO Solver
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_solver)
z3_mk_solver
mkSimpleSolver :: Context -> IO Solver
mkSimpleSolver :: Context -> IO Solver
mkSimpleSolver = (Ptr Z3_context -> IO (Ptr Z3_solver)) -> Context -> IO Solver
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_solver)
z3_mk_simple_solver
mkSolverForLogic :: Context -> Logic -> IO Solver
mkSolverForLogic :: Context -> Logic -> IO Solver
mkSolverForLogic Context
c Logic
logic = Context -> String -> IO Symbol
mkStringSymbol Context
c (Logic -> String
forall a. Show a => a -> String
show Logic
logic) IO Symbol -> (Symbol -> IO Solver) -> IO Solver
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Symbol
sym ->
Context -> (Ptr Z3_context -> IO (Ptr Z3_solver)) -> IO Solver
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c ((Ptr Z3_context -> IO (Ptr Z3_solver)) -> IO Solver)
-> (Ptr Z3_context -> IO (Ptr Z3_solver)) -> IO Solver
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context -> Ptr Z3_symbol -> IO (Ptr Z3_solver)
z3_mk_solver_for_logic Ptr Z3_context
cPtr (Ptr Z3_symbol -> IO (Ptr Z3_solver))
-> Ptr Z3_symbol -> IO (Ptr Z3_solver)
forall a b. (a -> b) -> a -> b
$ Symbol -> Ptr Z3_symbol
unSymbol Symbol
sym
solverGetHelp :: Context -> Solver -> IO String
solverGetHelp :: Context -> Solver -> IO String
solverGetHelp = (Ptr Z3_context -> Ptr Z3_solver -> IO Z3_string)
-> Context -> Solver -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_solver -> IO Z3_string
z3_solver_get_help
solverSetParams :: Context -> Solver -> Params -> IO ()
solverSetParams :: Context -> Solver -> Params -> IO ()
solverSetParams = (Ptr Z3_context -> Ptr Z3_solver -> Ptr Z3_params -> IO ())
-> Context -> Solver -> Params -> IO ()
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_solver -> Ptr Z3_params -> IO ()
z3_solver_set_params
solverPush :: Context -> Solver -> IO ()
solverPush :: Context -> Solver -> IO ()
solverPush = (Ptr Z3_context -> Ptr Z3_solver -> IO ())
-> Context -> Solver -> IO ()
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_solver -> IO ()
z3_solver_push
solverPop :: Context -> Solver -> Int -> IO ()
solverPop :: Context -> Solver -> Int -> IO ()
solverPop = (Ptr Z3_context -> Ptr Z3_solver -> CUInt -> IO ())
-> Context -> Solver -> Int -> IO ()
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_solver -> CUInt -> IO ()
z3_solver_pop
solverReset :: Context -> Solver -> IO ()
solverReset :: Context -> Solver -> IO ()
solverReset = (Ptr Z3_context -> Ptr Z3_solver -> IO ())
-> Context -> Solver -> IO ()
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_solver -> IO ()
z3_solver_reset
solverGetNumScopes :: Context -> Solver -> IO Int
solverGetNumScopes :: Context -> Solver -> IO Int
solverGetNumScopes = (Ptr Z3_context -> Ptr Z3_solver -> IO CUInt)
-> Context -> Solver -> IO Int
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_solver -> IO CUInt
z3_solver_get_num_scopes
solverAssertCnstr :: Context -> Solver -> AST -> IO ()
solverAssertCnstr :: Context -> Solver -> AST -> IO ()
solverAssertCnstr = (Ptr Z3_context -> Ptr Z3_solver -> Ptr Z3_ast -> IO ())
-> Context -> Solver -> AST -> IO ()
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_solver -> Ptr Z3_ast -> IO ()
z3_solver_assert
solverAssertAndTrack :: Context -> Solver -> AST -> AST -> IO ()
solverAssertAndTrack :: Context -> Solver -> AST -> AST -> IO ()
solverAssertAndTrack = (Ptr Z3_context
-> Ptr Z3_solver -> Ptr Z3_ast -> Ptr Z3_ast -> IO ())
-> Context -> Solver -> AST -> AST -> IO ()
forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context
-> Ptr Z3_solver -> Ptr Z3_ast -> Ptr Z3_ast -> IO ()
z3_solver_assert_and_track
solverFromFile :: Context -> Solver -> String -> IO ()
solverFromFile :: Context -> Solver -> String -> IO ()
solverFromFile = (Ptr Z3_context -> Ptr Z3_solver -> Z3_string -> IO ())
-> Context -> Solver -> String -> IO ()
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_solver -> Z3_string -> IO ()
z3_solver_from_file
solverFromString :: Context -> Solver -> String -> IO ()
solverFromString :: Context -> Solver -> String -> IO ()
solverFromString = (Ptr Z3_context -> Ptr Z3_solver -> Z3_string -> IO ())
-> Context -> Solver -> String -> IO ()
forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> Ptr Z3_solver -> Z3_string -> IO ()
z3_solver_from_string
solverGetAssertions :: Context -> Solver -> IO [AST]
solverGetAssertions :: Context -> Solver -> IO [AST]
solverGetAssertions = (Ptr Z3_context -> Ptr Z3_solver -> IO (Ptr Z3_ast_vector))
-> Context -> Solver -> IO [AST]
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_solver -> IO (Ptr Z3_ast_vector)
z3_solver_get_assertions
solverCheck :: Context -> Solver -> IO Result
solverCheck :: Context -> Solver -> IO Result
solverCheck Context
ctx Solver
solver = (Ptr Z3_context -> Ptr Z3_solver -> IO Z3_lbool)
-> Context
-> ((Ptr Z3_solver -> IO Z3_lbool) -> IO Z3_lbool)
-> IO Result
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> Ptr Z3_solver -> IO Z3_lbool
z3_solver_check Context
ctx (((Ptr Z3_solver -> IO Z3_lbool) -> IO Z3_lbool) -> IO Result)
-> ((Ptr Z3_solver -> IO Z3_lbool) -> IO Z3_lbool) -> IO Result
forall a b. (a -> b) -> a -> b
$ Solver -> (Ptr Z3_solver -> IO Z3_lbool) -> IO Z3_lbool
forall r. Solver -> (Ptr Z3_solver -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Solver
solver
solverCheckAssumptions :: Context -> Solver -> [AST] -> IO Result
solverCheckAssumptions :: Context -> Solver -> [AST] -> IO Result
solverCheckAssumptions Context
ctx Solver
solver [AST]
assump =
(Ptr Z3_context
-> Ptr Z3_solver -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool)
-> Context
-> ((Ptr Z3_solver -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool)
-> IO Z3_lbool)
-> IO Result
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context
-> Ptr Z3_solver -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool
z3_solver_check_assumptions Context
ctx (((Ptr Z3_solver -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool)
-> IO Z3_lbool)
-> IO Result)
-> ((Ptr Z3_solver -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool)
-> IO Z3_lbool)
-> IO Result
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_solver -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool
f ->
Solver -> (Ptr Z3_solver -> IO Z3_lbool) -> IO Z3_lbool
forall r. Solver -> (Ptr Z3_solver -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Solver
solver ((Ptr Z3_solver -> IO Z3_lbool) -> IO Z3_lbool)
-> (Ptr Z3_solver -> IO Z3_lbool) -> IO Z3_lbool
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_solver
solverPtr ->
[AST] -> (CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool) -> IO Z3_lbool
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
assump ((CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool) -> IO Z3_lbool)
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool) -> IO Z3_lbool
forall a b. (a -> b) -> a -> b
$ \CUInt
assumpNum Ptr (Ptr Z3_ast)
assumpArr ->
Ptr Z3_solver -> CUInt -> Ptr (Ptr Z3_ast) -> IO Z3_lbool
f Ptr Z3_solver
solverPtr CUInt
assumpNum Ptr (Ptr Z3_ast)
assumpArr
solverGetModel :: Context -> Solver -> IO Model
solverGetModel :: Context -> Solver -> IO Model
solverGetModel Context
ctx Solver
solver = (Ptr Z3_context -> Ptr Z3_solver -> IO (Ptr Z3_model))
-> Context
-> ((Ptr Z3_solver -> IO (Ptr Z3_model)) -> IO (Ptr Z3_model))
-> IO Model
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> Ptr Z3_solver -> IO (Ptr Z3_model)
z3_solver_get_model Context
ctx (((Ptr Z3_solver -> IO (Ptr Z3_model)) -> IO (Ptr Z3_model))
-> IO Model)
-> ((Ptr Z3_solver -> IO (Ptr Z3_model)) -> IO (Ptr Z3_model))
-> IO Model
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_solver -> IO (Ptr Z3_model)
f ->
Solver -> (Ptr Z3_solver -> IO (Ptr Z3_model)) -> IO (Ptr Z3_model)
forall r. Solver -> (Ptr Z3_solver -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c Solver
solver ((Ptr Z3_solver -> IO (Ptr Z3_model)) -> IO (Ptr Z3_model))
-> (Ptr Z3_solver -> IO (Ptr Z3_model)) -> IO (Ptr Z3_model)
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_solver
solverPtr ->
Ptr Z3_solver -> IO (Ptr Z3_model)
f Ptr Z3_solver
solverPtr
solverGetProof :: Context -> Solver -> IO AST
solverGetProof :: Context -> Solver -> IO AST
solverGetProof = (Ptr Z3_context -> Ptr Z3_solver -> IO (Ptr Z3_ast))
-> Context -> Solver -> IO AST
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_solver -> IO (Ptr Z3_ast)
z3_solver_get_proof
solverGetUnsatCore :: Context -> Solver -> IO [AST]
solverGetUnsatCore :: Context -> Solver -> IO [AST]
solverGetUnsatCore = (Ptr Z3_context -> Ptr Z3_solver -> IO (Ptr Z3_ast_vector))
-> Context -> Solver -> IO [AST]
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_solver -> IO (Ptr Z3_ast_vector)
z3_solver_get_unsat_core
solverGetReasonUnknown :: Context -> Solver -> IO String
solverGetReasonUnknown :: Context -> Solver -> IO String
solverGetReasonUnknown = (Ptr Z3_context -> Ptr Z3_solver -> IO Z3_string)
-> Context -> Solver -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_solver -> IO Z3_string
z3_solver_get_reason_unknown
solverToString :: Context -> Solver -> IO String
solverToString :: Context -> Solver -> IO String
solverToString = (Ptr Z3_context -> Ptr Z3_solver -> IO Z3_string)
-> Context -> Solver -> IO String
forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> Ptr Z3_solver -> IO Z3_string
z3_solver_to_string
solverCheckAndGetModel :: Context -> Solver -> IO (Result, Maybe Model)
solverCheckAndGetModel :: Context -> Solver -> IO (Result, Maybe Model)
solverCheckAndGetModel Context
ctx Solver
solver =
do Result
res <- Context -> Solver -> IO Result
solverCheck Context
ctx Solver
solver
Maybe Model
mbModel <- case Result
res of
Result
Unsat -> Maybe Model -> IO (Maybe Model)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Model
forall a. Maybe a
Nothing
Result
_ -> Model -> Maybe Model
forall a. a -> Maybe a
Just (Model -> Maybe Model) -> IO Model -> IO (Maybe Model)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Context -> Solver -> IO Model
solverGetModel Context
ctx Solver
solver
(Result, Maybe Model) -> IO (Result, Maybe Model)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Result
res, Maybe Model
mbModel)
withContext :: Context -> (Ptr Z3_context -> IO r) -> IO r
withContext :: forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContext Context
c Ptr Z3_context -> IO r
f = RLock -> IO r -> IO r
forall a. RLock -> IO a -> IO a
Z3.RLock.with (Context -> RLock
lock Context
c) (IO r -> IO r) -> IO r -> IO r
forall a b. (a -> b) -> a -> b
$ ForeignPtr Z3_context -> (Ptr Z3_context -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Context -> ForeignPtr Z3_context
unContext Context
c) Ptr Z3_context -> IO r
f
withContextError :: Context -> (Ptr Z3_context -> IO r) -> IO r
withContextError :: forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContextError Context
c Ptr Z3_context -> IO r
f = Context -> (Ptr Z3_context -> IO r) -> IO r
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContext Context
c ((Ptr Z3_context -> IO r) -> IO r)
-> (Ptr Z3_context -> IO r) -> IO r
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context -> IO r -> IO r
forall a. Ptr Z3_context -> IO a -> IO a
checkError Ptr Z3_context
cPtr (Ptr Z3_context -> IO r
f Ptr Z3_context
cPtr)
marshalArray :: (Marshal h c, Storable c) => [h] -> (Ptr c -> IO a) -> IO a
marshalArray :: forall h c a.
(Marshal h c, Storable c) =>
[h] -> (Ptr c -> IO a) -> IO a
marshalArray [h]
hs Ptr c -> IO a
f = [h] -> ([c] -> IO a) -> IO a
forall h c r. Marshal h c => [h] -> ([c] -> IO r) -> IO r
hs2cs [h]
hs (([c] -> IO a) -> IO a) -> ([c] -> IO a) -> IO a
forall a b. (a -> b) -> a -> b
$ \[c]
cs -> [c] -> (Ptr c -> IO a) -> IO a
forall a b. Storable a => [a] -> (Ptr a -> IO b) -> IO b
withArray [c]
cs Ptr c -> IO a
f
marshalArrayLen :: (Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen :: forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [h]
hs i -> Ptr c -> IO a
f =
[h] -> ([c] -> IO a) -> IO a
forall h c r. Marshal h c => [h] -> ([c] -> IO r) -> IO r
hs2cs [h]
hs (([c] -> IO a) -> IO a) -> ([c] -> IO a) -> IO a
forall a b. (a -> b) -> a -> b
$ \[c]
cs -> [c] -> (Int -> Ptr c -> IO a) -> IO a
forall a b. Storable a => [a] -> (Int -> Ptr a -> IO b) -> IO b
withArrayLen [c]
cs ((Int -> Ptr c -> IO a) -> IO a) -> (Int -> Ptr c -> IO a) -> IO a
forall a b. (a -> b) -> a -> b
$ \Int
n -> i -> Ptr c -> IO a
f (Int -> i
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
n)
liftAstN_err :: String
-> (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context -> [AST] -> IO AST
liftAstN_err :: String
-> (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> [AST]
-> IO AST
liftAstN_err String
s Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
_ Context
_ [] = String -> IO AST
forall a. HasCallStack => String -> a
error String
s
liftAstN_err String
_ Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f Context
c [AST]
es = (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f Context
c (((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall a b. (a -> b) -> a -> b
$ [AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen [AST]
es
{-# INLINE liftAstN_err #-}
liftAstN :: (Ptr Z3_context -> IO (Ptr Z3_ast))
-> (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context -> [AST] -> IO AST
liftAstN :: (Ptr Z3_context -> IO (Ptr Z3_ast))
-> (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> [AST]
-> IO AST
liftAstN Ptr Z3_context -> IO (Ptr Z3_ast)
s Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f Context
c = IO AST
-> (NonEmpty AST -> IO AST) -> Maybe (NonEmpty AST) -> IO AST
forall b a. b -> (a -> b) -> Maybe a -> b
maybe ((Ptr Z3_context -> IO (Ptr Z3_ast)) -> Context -> IO AST
forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 Ptr Z3_context -> IO (Ptr Z3_ast)
s Context
c) ((Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context -> NonEmpty AST -> IO AST
liftAstN1 Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f Context
c) (Maybe (NonEmpty AST) -> IO AST)
-> ([AST] -> Maybe (NonEmpty AST)) -> [AST] -> IO AST
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [AST] -> Maybe (NonEmpty AST)
forall a. [a] -> Maybe (NonEmpty a)
nonEmpty
{-# INLINE liftAstN #-}
liftAstN1 :: (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context -> NonEmpty AST -> IO AST
liftAstN1 :: (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context -> NonEmpty AST -> IO AST
liftAstN1 Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f Context
c = (Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> Context
-> ((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST
forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast)
f Context
c (((CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> IO AST)
-> (NonEmpty AST
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> NonEmpty AST
-> IO AST
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall h c i a.
(Marshal h c, Storable c, Integral i) =>
[h] -> (i -> Ptr c -> IO a) -> IO a
marshalArrayLen ([AST]
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast))
-> (NonEmpty AST -> [AST])
-> NonEmpty AST
-> (CUInt -> Ptr (Ptr Z3_ast) -> IO (Ptr Z3_ast))
-> IO (Ptr Z3_ast)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty AST -> [AST]
forall a. NonEmpty a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList
{-# INLINE liftAstN1 #-}
class Marshal h c where
c2h :: Context -> c -> IO h
h2c :: h -> (c -> IO r) -> IO r
hs2cs :: Marshal h c => [h] -> ([c] -> IO r) -> IO r
hs2cs :: forall h c r. Marshal h c => [h] -> ([c] -> IO r) -> IO r
hs2cs [] [c] -> IO r
f = [c] -> IO r
f []
hs2cs (h
h:[h]
hs) [c] -> IO r
f =
h -> (c -> IO r) -> IO r
forall r. h -> (c -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c h
h ((c -> IO r) -> IO r) -> (c -> IO r) -> IO r
forall a b. (a -> b) -> a -> b
$ \c
c ->
[h] -> ([c] -> IO r) -> IO r
forall h c r. Marshal h c => [h] -> ([c] -> IO r) -> IO r
hs2cs [h]
hs (([c] -> IO r) -> IO r) -> ([c] -> IO r) -> IO r
forall a b. (a -> b) -> a -> b
$ \[c]
cs -> [c] -> IO r
f (c
cc -> [c] -> [c]
forall a. a -> [a] -> [a]
:[c]
cs)
cs2hs :: Marshal h c => Context -> [c] -> IO [h]
cs2hs :: forall h c. Marshal h c => Context -> [c] -> IO [h]
cs2hs Context
ctx = (c -> IO h) -> [c] -> IO [h]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (Context -> c -> IO h
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
ctx)
peekArrayToHs :: (Marshal h c, Storable c) => Context -> Int -> Ptr c -> IO [h]
peekArrayToHs :: forall h c.
(Marshal h c, Storable c) =>
Context -> Int -> Ptr c -> IO [h]
peekArrayToHs Context
c Int
n Ptr c
dPtr =
Context -> [c] -> IO [h]
forall h c. Marshal h c => Context -> [c] -> IO [h]
cs2hs Context
c ([c] -> IO [h]) -> IO [c] -> IO [h]
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Int -> Ptr c -> IO [c]
forall a. Storable a => Int -> Ptr a -> IO [a]
peekArray Int
n Ptr c
dPtr
toHsCheckError :: Marshal h c => Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError :: forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c Ptr Z3_context -> IO c
f = Context -> (Ptr Z3_context -> IO h) -> IO h
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContext Context
c ((Ptr Z3_context -> IO h) -> IO h)
-> (Ptr Z3_context -> IO h) -> IO h
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr ->
Context -> c -> IO h
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
c (c -> IO h) -> IO c -> IO h
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr Z3_context -> IO c -> IO c
forall a. Ptr Z3_context -> IO a -> IO a
checkError Ptr Z3_context
cPtr (Ptr Z3_context -> IO c
f Ptr Z3_context
cPtr)
type Z3SetRefCount c = Ptr Z3_context -> Ptr c -> IO ()
type Z3IncRefFun c = Z3SetRefCount c
type Z3DecRefFun c = Z3SetRefCount c
mkC2hRefCount :: (ForeignPtr c -> h)
-> Z3IncRefFun c
-> Z3DecRefFun c
-> Context -> Ptr c -> IO h
mkC2hRefCount :: forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr c -> h
mk Z3IncRefFun c
incRef Z3IncRefFun c
decRef Context
ctx Ptr c
xPtr =
Context -> (Ptr Z3_context -> IO h) -> IO h
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContext Context
ctx ((Ptr Z3_context -> IO h) -> IO h)
-> (Ptr Z3_context -> IO h) -> IO h
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
ctxPtr -> do
Z3IncRefFun c
incRef Ptr Z3_context
ctxPtr Ptr c
xPtr
Context -> IO ()
contextIncRef Context
ctx
let xFinalizer :: IO ()
xFinalizer = RLock -> IO () -> IO ()
forall a. RLock -> IO a -> IO a
Z3.RLock.with (Context -> RLock
lock Context
ctx) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$ (do Z3IncRefFun c
decRef Ptr Z3_context
ctxPtr Ptr c
xPtr
Ptr Z3_context -> IORef Word -> IO ()
contextDecRef Ptr Z3_context
ctxPtr (Context -> IORef Word
refCount Context
ctx))
ForeignPtr c -> h
mk (ForeignPtr c -> h) -> IO (ForeignPtr c) -> IO h
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr c -> IO () -> IO (ForeignPtr c)
forall a. Ptr a -> IO () -> IO (ForeignPtr a)
newForeignPtr Ptr c
xPtr IO ()
xFinalizer
dummy_inc_ref :: Z3IncRefFun c
dummy_inc_ref :: forall c. Z3IncRefFun c
dummy_inc_ref Ptr Z3_context
_ Ptr c
_ = () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
on_ast_ptr :: Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr a -> IO (Ptr Z3_ast))
-> Z3SetRefCount a
Z3SetRefCount Z3_ast
f on_ast_ptr :: forall a.
Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr a -> IO (Ptr Z3_ast)) -> Z3SetRefCount a
`on_ast_ptr` Ptr Z3_context -> Ptr a -> IO (Ptr Z3_ast)
t = \Ptr Z3_context
ctxPtr Ptr a
ptr -> Z3SetRefCount Z3_ast
f Ptr Z3_context
ctxPtr (Ptr Z3_ast -> IO ()) -> IO (Ptr Z3_ast) -> IO ()
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr Z3_context -> Ptr a -> IO (Ptr Z3_ast)
t Ptr Z3_context
ctxPtr Ptr a
ptr
instance Marshal h (Ptr x) => Marshal (Maybe h) (Ptr x) where
c2h :: Context -> Ptr x -> IO (Maybe h)
c2h Context
c = (Ptr x -> IO h) -> Maybe (Ptr x) -> IO (Maybe h)
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Maybe a -> m (Maybe b)
T.mapM (Context -> Ptr x -> IO h
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
c) (Maybe (Ptr x) -> IO (Maybe h))
-> (Ptr x -> Maybe (Ptr x)) -> Ptr x -> IO (Maybe h)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr x -> Maybe (Ptr x)
forall a. Ptr a -> Maybe (Ptr a)
ptrToMaybe
h2c :: forall r. Maybe h -> (Ptr x -> IO r) -> IO r
h2c Maybe h
Nothing Ptr x -> IO r
f = Ptr x -> IO r
f Ptr x
forall a. Ptr a
nullPtr
h2c (Just h
x) Ptr x -> IO r
f = h -> (Ptr x -> IO r) -> IO r
forall r. h -> (Ptr x -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c h
x Ptr x -> IO r
f
instance Marshal () () where
c2h :: Context -> () -> IO ()
c2h Context
_ = () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return
h2c :: forall r. () -> (() -> IO r) -> IO r
h2c ()
x () -> IO r
f = () -> IO r
f ()
x
instance Marshal Bool Z3_bool where
c2h :: Context -> Z3_bool -> IO Bool
c2h Context
_ = Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool -> IO Bool) -> (Z3_bool -> Bool) -> Z3_bool -> IO Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Z3_bool -> Bool
toBool
h2c :: forall r. Bool -> (Z3_bool -> IO r) -> IO r
h2c Bool
b Z3_bool -> IO r
f = Z3_bool -> IO r
f (Bool -> Z3_bool
unBool Bool
b)
instance Marshal Result Z3_lbool where
c2h :: Context -> Z3_lbool -> IO Result
c2h Context
_ = Result -> IO Result
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Result -> IO Result)
-> (Z3_lbool -> Result) -> Z3_lbool -> IO Result
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Z3_lbool -> Result
toResult
h2c :: forall r. Result -> (Z3_lbool -> IO r) -> IO r
h2c = String -> Result -> (Z3_lbool -> IO r) -> IO r
forall a. HasCallStack => String -> a
error String
"Marshal Result Z3_lbool => h2c not implemented"
instance Integral h => Marshal h CInt where
c2h :: Context -> Z3_error_code -> IO h
c2h Context
_ = h -> IO h
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (h -> IO h) -> (Z3_error_code -> h) -> Z3_error_code -> IO h
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Z3_error_code -> h
forall a b. (Integral a, Num b) => a -> b
fromIntegral
h2c :: forall r. h -> (Z3_error_code -> IO r) -> IO r
h2c h
i Z3_error_code -> IO r
f = Z3_error_code -> IO r
f (h -> Z3_error_code
forall a b. (Integral a, Num b) => a -> b
fromIntegral h
i)
instance Integral h => Marshal h CUInt where
c2h :: Context -> CUInt -> IO h
c2h Context
_ = h -> IO h
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (h -> IO h) -> (CUInt -> h) -> CUInt -> IO h
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> h
forall a b. (Integral a, Num b) => a -> b
fromIntegral
h2c :: forall r. h -> (CUInt -> IO r) -> IO r
h2c h
i CUInt -> IO r
f = CUInt -> IO r
f (h -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral h
i)
instance Integral h => Marshal h CLong where
c2h :: Context -> CLong -> IO h
c2h Context
_ = h -> IO h
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (h -> IO h) -> (CLong -> h) -> CLong -> IO h
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CLong -> h
forall a b. (Integral a, Num b) => a -> b
fromIntegral
h2c :: forall r. h -> (CLong -> IO r) -> IO r
h2c h
i CLong -> IO r
f = CLong -> IO r
f (h -> CLong
forall a b. (Integral a, Num b) => a -> b
fromIntegral h
i)
instance Integral h => Marshal h CULong where
c2h :: Context -> CULong -> IO h
c2h Context
_ = h -> IO h
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (h -> IO h) -> (CULong -> h) -> CULong -> IO h
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CULong -> h
forall a b. (Integral a, Num b) => a -> b
fromIntegral
h2c :: forall r. h -> (CULong -> IO r) -> IO r
h2c h
i CULong -> IO r
f = CULong -> IO r
f (h -> CULong
forall a b. (Integral a, Num b) => a -> b
fromIntegral h
i)
instance Integral h => Marshal h CLLong where
c2h :: Context -> CLLong -> IO h
c2h Context
_ = h -> IO h
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (h -> IO h) -> (CLLong -> h) -> CLLong -> IO h
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CLLong -> h
forall a b. (Integral a, Num b) => a -> b
fromIntegral
h2c :: forall r. h -> (CLLong -> IO r) -> IO r
h2c h
i CLLong -> IO r
f = CLLong -> IO r
f (h -> CLLong
forall a b. (Integral a, Num b) => a -> b
fromIntegral h
i)
instance Integral h => Marshal h CULLong where
c2h :: Context -> CULLong -> IO h
c2h Context
_ = h -> IO h
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (h -> IO h) -> (CULLong -> h) -> CULLong -> IO h
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CULLong -> h
forall a b. (Integral a, Num b) => a -> b
fromIntegral
h2c :: forall r. h -> (CULLong -> IO r) -> IO r
h2c h
i CULLong -> IO r
f = CULLong -> IO r
f (h -> CULLong
forall a b. (Integral a, Num b) => a -> b
fromIntegral h
i)
instance Marshal Float CFloat where
c2h :: Context -> CFloat -> IO Float
c2h Context
_ = Float -> IO Float
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Float -> IO Float) -> (CFloat -> Float) -> CFloat -> IO Float
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac
h2c :: forall r. Float -> (CFloat -> IO r) -> IO r
h2c Float
d CFloat -> IO r
f = CFloat -> IO r
f (Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
d)
instance Marshal Double CDouble where
c2h :: Context -> CDouble -> IO Double
c2h Context
_ = Double -> IO Double
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Double -> IO Double)
-> (CDouble -> Double) -> CDouble -> IO Double
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac
h2c :: forall r. Double -> (CDouble -> IO r) -> IO r
h2c Double
d CDouble -> IO r
f = CDouble -> IO r
f (Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
d)
instance Marshal String CString where
c2h :: Context -> Z3_string -> IO String
c2h Context
_ = Z3_string -> IO String
peekCString
h2c :: forall a. String -> (Z3_string -> IO a) -> IO a
h2c = String -> (Z3_string -> IO r) -> IO r
forall a. String -> (Z3_string -> IO a) -> IO a
withCString
instance Marshal Context (Ptr Z3_context) where
c2h :: Context -> Ptr Z3_context -> IO Context
c2h Context
_ Ptr Z3_context
ctx = (Config -> IO Context) -> IO Context
forall a. (Config -> IO a) -> IO a
withConfig ((Config -> IO Context) -> IO Context)
-> (Config -> IO Context) -> IO Context
forall a b. (a -> b) -> a -> b
$ (Ptr Z3_config -> IO (Ptr Z3_context)) -> Config -> IO Context
mkContextWith (IO (Ptr Z3_context) -> Ptr Z3_config -> IO (Ptr Z3_context)
forall a b. a -> b -> a
const (Ptr Z3_context -> IO (Ptr Z3_context)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Z3_context
ctx))
h2c :: forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
h2c Context
ctx = ForeignPtr Z3_context -> (Ptr Z3_context -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Context -> ForeignPtr Z3_context
unContext Context
ctx)
instance Marshal App (Ptr Z3_app) where
c2h :: Context -> Ptr Z3_app -> IO App
c2h = (ForeignPtr Z3_app -> App)
-> Z3IncRefFun Z3_app
-> Z3IncRefFun Z3_app
-> Context
-> Ptr Z3_app
-> IO App
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_app -> App
App
(Z3SetRefCount Z3_ast
z3_inc_ref Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr Z3_app -> IO (Ptr Z3_ast))
-> Z3IncRefFun Z3_app
forall a.
Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr a -> IO (Ptr Z3_ast)) -> Z3SetRefCount a
`on_ast_ptr` Ptr Z3_context -> Ptr Z3_app -> IO (Ptr Z3_ast)
z3_app_to_ast)
(Z3SetRefCount Z3_ast
z3_dec_ref Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr Z3_app -> IO (Ptr Z3_ast))
-> Z3IncRefFun Z3_app
forall a.
Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr a -> IO (Ptr Z3_ast)) -> Z3SetRefCount a
`on_ast_ptr` Ptr Z3_context -> Ptr Z3_app -> IO (Ptr Z3_ast)
z3_app_to_ast)
h2c :: forall r. App -> (Ptr Z3_app -> IO r) -> IO r
h2c App
app = ForeignPtr Z3_app -> (Ptr Z3_app -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (App -> ForeignPtr Z3_app
unApp App
app)
instance Marshal Params (Ptr Z3_params) where
c2h :: Context -> Ptr Z3_params -> IO Params
c2h = (ForeignPtr Z3_params -> Params)
-> Z3IncRefFun Z3_params
-> Z3IncRefFun Z3_params
-> Context
-> Ptr Z3_params
-> IO Params
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_params -> Params
Params Z3IncRefFun Z3_params
z3_params_inc_ref Z3IncRefFun Z3_params
z3_params_dec_ref
h2c :: forall r. Params -> (Ptr Z3_params -> IO r) -> IO r
h2c Params
prm = ForeignPtr Z3_params -> (Ptr Z3_params -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Params -> ForeignPtr Z3_params
unParams Params
prm)
instance Marshal Symbol (Ptr Z3_symbol) where
c2h :: Context -> Ptr Z3_symbol -> IO Symbol
c2h Context
_ = Symbol -> IO Symbol
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Symbol -> IO Symbol)
-> (Ptr Z3_symbol -> Symbol) -> Ptr Z3_symbol -> IO Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr Z3_symbol -> Symbol
Symbol
h2c :: forall r. Symbol -> (Ptr Z3_symbol -> IO r) -> IO r
h2c Symbol
s Ptr Z3_symbol -> IO r
f = Ptr Z3_symbol -> IO r
f (Symbol -> Ptr Z3_symbol
unSymbol Symbol
s)
instance Marshal AST (Ptr Z3_ast) where
c2h :: Context -> Ptr Z3_ast -> IO AST
c2h = (ForeignPtr Z3_ast -> AST)
-> Z3SetRefCount Z3_ast
-> Z3SetRefCount Z3_ast
-> Context
-> Ptr Z3_ast
-> IO AST
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_ast -> AST
AST Z3SetRefCount Z3_ast
z3_inc_ref Z3SetRefCount Z3_ast
z3_dec_ref
h2c :: forall r. AST -> (Ptr Z3_ast -> IO r) -> IO r
h2c AST
a Ptr Z3_ast -> IO r
f = ForeignPtr Z3_ast -> (Ptr Z3_ast -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (AST -> ForeignPtr Z3_ast
unAST AST
a) Ptr Z3_ast -> IO r
f
instance Marshal [AST] (Ptr Z3_ast_vector) where
c2h :: Context -> Ptr Z3_ast_vector -> IO [AST]
c2h Context
ctx Ptr Z3_ast_vector
vecPtr = Context -> (Ptr Z3_context -> IO [AST]) -> IO [AST]
forall r. Context -> (Ptr Z3_context -> IO r) -> IO r
withContext Context
ctx ((Ptr Z3_context -> IO [AST]) -> IO [AST])
-> (Ptr Z3_context -> IO [AST]) -> IO [AST]
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
ctxPtr -> do
Ptr Z3_context -> Ptr Z3_ast_vector -> IO ()
z3_ast_vector_inc_ref Ptr Z3_context
ctxPtr Ptr Z3_ast_vector
vecPtr
CUInt
n <- Ptr Z3_context -> Ptr Z3_ast_vector -> IO CUInt
z3_ast_vector_size Ptr Z3_context
ctxPtr Ptr Z3_ast_vector
vecPtr
[AST]
res <- if CUInt
n CUInt -> CUInt -> Bool
forall a. Eq a => a -> a -> Bool
== CUInt
0
then [AST] -> IO [AST]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return []
else (CUInt -> IO AST) -> [CUInt] -> IO [AST]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM (\CUInt
i -> Ptr Z3_context -> Ptr Z3_ast_vector -> CUInt -> IO (Ptr Z3_ast)
z3_ast_vector_get Ptr Z3_context
ctxPtr Ptr Z3_ast_vector
vecPtr CUInt
i IO (Ptr Z3_ast) -> (Ptr Z3_ast -> IO AST) -> IO AST
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Context -> Ptr Z3_ast -> IO AST
forall h c. Marshal h c => Context -> c -> IO h
c2h Context
ctx) [CUInt
0 .. (CUInt
n CUInt -> CUInt -> CUInt
forall a. Num a => a -> a -> a
- CUInt
1)]
Ptr Z3_context -> Ptr Z3_ast_vector -> IO ()
z3_ast_vector_dec_ref Ptr Z3_context
ctxPtr Ptr Z3_ast_vector
vecPtr
[AST] -> IO [AST]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [AST]
res
h2c :: forall r. [AST] -> (Ptr Z3_ast_vector -> IO r) -> IO r
h2c [AST]
_ Ptr Z3_ast_vector -> IO r
_ = String -> IO r
forall a. HasCallStack => String -> a
error String
"Marshal [AST] (Ptr Z3_ast_vector) => h2c not implemented"
instance Marshal Sort (Ptr Z3_sort) where
c2h :: Context -> Ptr Z3_sort -> IO Sort
c2h = (ForeignPtr Z3_sort -> Sort)
-> Z3IncRefFun Z3_sort
-> Z3IncRefFun Z3_sort
-> Context
-> Ptr Z3_sort
-> IO Sort
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_sort -> Sort
Sort
(Z3SetRefCount Z3_ast
z3_inc_ref Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Z3IncRefFun Z3_sort
forall a.
Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr a -> IO (Ptr Z3_ast)) -> Z3SetRefCount a
`on_ast_ptr` Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_sort_to_ast)
(Z3SetRefCount Z3_ast
z3_dec_ref Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast))
-> Z3IncRefFun Z3_sort
forall a.
Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr a -> IO (Ptr Z3_ast)) -> Z3SetRefCount a
`on_ast_ptr` Ptr Z3_context -> Ptr Z3_sort -> IO (Ptr Z3_ast)
z3_sort_to_ast)
h2c :: forall r. Sort -> (Ptr Z3_sort -> IO r) -> IO r
h2c Sort
srt = ForeignPtr Z3_sort -> (Ptr Z3_sort -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Sort -> ForeignPtr Z3_sort
unSort Sort
srt)
instance Marshal FuncDecl (Ptr Z3_func_decl) where
c2h :: Context -> Ptr Z3_func_decl -> IO FuncDecl
c2h = (ForeignPtr Z3_func_decl -> FuncDecl)
-> Z3IncRefFun Z3_func_decl
-> Z3IncRefFun Z3_func_decl
-> Context
-> Ptr Z3_func_decl
-> IO FuncDecl
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_func_decl -> FuncDecl
FuncDecl
(Z3SetRefCount Z3_ast
z3_inc_ref Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr Z3_func_decl -> IO (Ptr Z3_ast))
-> Z3IncRefFun Z3_func_decl
forall a.
Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr a -> IO (Ptr Z3_ast)) -> Z3SetRefCount a
`on_ast_ptr` Ptr Z3_context -> Ptr Z3_func_decl -> IO (Ptr Z3_ast)
z3_func_decl_to_ast)
(Z3SetRefCount Z3_ast
z3_dec_ref Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr Z3_func_decl -> IO (Ptr Z3_ast))
-> Z3IncRefFun Z3_func_decl
forall a.
Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr a -> IO (Ptr Z3_ast)) -> Z3SetRefCount a
`on_ast_ptr` Ptr Z3_context -> Ptr Z3_func_decl -> IO (Ptr Z3_ast)
z3_func_decl_to_ast)
h2c :: forall r. FuncDecl -> (Ptr Z3_func_decl -> IO r) -> IO r
h2c FuncDecl
fnd = ForeignPtr Z3_func_decl -> (Ptr Z3_func_decl -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (FuncDecl -> ForeignPtr Z3_func_decl
unFuncDecl FuncDecl
fnd)
instance Marshal FuncEntry (Ptr Z3_func_entry) where
c2h :: Context -> Ptr Z3_func_entry -> IO FuncEntry
c2h = (ForeignPtr Z3_func_entry -> FuncEntry)
-> Z3IncRefFun Z3_func_entry
-> Z3IncRefFun Z3_func_entry
-> Context
-> Ptr Z3_func_entry
-> IO FuncEntry
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_func_entry -> FuncEntry
FuncEntry Z3IncRefFun Z3_func_entry
z3_func_entry_inc_ref
Z3IncRefFun Z3_func_entry
z3_func_entry_dec_ref
h2c :: forall r. FuncEntry -> (Ptr Z3_func_entry -> IO r) -> IO r
h2c FuncEntry
fne = ForeignPtr Z3_func_entry -> (Ptr Z3_func_entry -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (FuncEntry -> ForeignPtr Z3_func_entry
unFuncEntry FuncEntry
fne)
instance Marshal FuncInterp (Ptr Z3_func_interp) where
c2h :: Context -> Ptr Z3_func_interp -> IO FuncInterp
c2h = (ForeignPtr Z3_func_interp -> FuncInterp)
-> Z3IncRefFun Z3_func_interp
-> Z3IncRefFun Z3_func_interp
-> Context
-> Ptr Z3_func_interp
-> IO FuncInterp
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_func_interp -> FuncInterp
FuncInterp Z3IncRefFun Z3_func_interp
z3_func_interp_inc_ref
Z3IncRefFun Z3_func_interp
z3_func_interp_dec_ref
h2c :: forall r. FuncInterp -> (Ptr Z3_func_interp -> IO r) -> IO r
h2c FuncInterp
fni = ForeignPtr Z3_func_interp -> (Ptr Z3_func_interp -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (FuncInterp -> ForeignPtr Z3_func_interp
unFuncInterp FuncInterp
fni)
instance Marshal Model (Ptr Z3_model) where
c2h :: Context -> Ptr Z3_model -> IO Model
c2h = (ForeignPtr Z3_model -> Model)
-> Z3IncRefFun Z3_model
-> Z3IncRefFun Z3_model
-> Context
-> Ptr Z3_model
-> IO Model
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_model -> Model
Model Z3IncRefFun Z3_model
z3_model_inc_ref Z3IncRefFun Z3_model
z3_model_dec_ref
h2c :: forall r. Model -> (Ptr Z3_model -> IO r) -> IO r
h2c Model
m = ForeignPtr Z3_model -> (Ptr Z3_model -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Model -> ForeignPtr Z3_model
unModel Model
m)
instance Marshal Pattern (Ptr Z3_pattern) where
c2h :: Context -> Ptr Z3_pattern -> IO Pattern
c2h = (ForeignPtr Z3_pattern -> Pattern)
-> Z3IncRefFun Z3_pattern
-> Z3IncRefFun Z3_pattern
-> Context
-> Ptr Z3_pattern
-> IO Pattern
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_pattern -> Pattern
Pattern
(Z3SetRefCount Z3_ast
z3_inc_ref Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr Z3_pattern -> IO (Ptr Z3_ast))
-> Z3IncRefFun Z3_pattern
forall a.
Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr a -> IO (Ptr Z3_ast)) -> Z3SetRefCount a
`on_ast_ptr` Ptr Z3_context -> Ptr Z3_pattern -> IO (Ptr Z3_ast)
z3_pattern_to_ast)
(Z3SetRefCount Z3_ast
z3_dec_ref Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr Z3_pattern -> IO (Ptr Z3_ast))
-> Z3IncRefFun Z3_pattern
forall a.
Z3SetRefCount Z3_ast
-> (Ptr Z3_context -> Ptr a -> IO (Ptr Z3_ast)) -> Z3SetRefCount a
`on_ast_ptr` Ptr Z3_context -> Ptr Z3_pattern -> IO (Ptr Z3_ast)
z3_pattern_to_ast)
h2c :: forall r. Pattern -> (Ptr Z3_pattern -> IO r) -> IO r
h2c Pattern
pat = ForeignPtr Z3_pattern -> (Ptr Z3_pattern -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Pattern -> ForeignPtr Z3_pattern
unPattern Pattern
pat)
instance Marshal Constructor (Ptr Z3_constructor) where
c2h :: Context -> Ptr Z3_constructor -> IO Constructor
c2h = (ForeignPtr Z3_constructor -> Constructor)
-> Z3IncRefFun Z3_constructor
-> Z3IncRefFun Z3_constructor
-> Context
-> Ptr Z3_constructor
-> IO Constructor
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_constructor -> Constructor
Constructor Z3IncRefFun Z3_constructor
forall c. Z3IncRefFun c
dummy_inc_ref Z3IncRefFun Z3_constructor
z3_del_constructor
h2c :: forall r. Constructor -> (Ptr Z3_constructor -> IO r) -> IO r
h2c Constructor
cns = ForeignPtr Z3_constructor -> (Ptr Z3_constructor -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Constructor -> ForeignPtr Z3_constructor
unConstructor Constructor
cns)
instance Marshal ConstructorList (Ptr Z3_constructor_list) where
c2h :: Context -> Ptr Z3_constructor_list -> IO ConstructorList
c2h = (ForeignPtr Z3_constructor_list -> ConstructorList)
-> Z3IncRefFun Z3_constructor_list
-> Z3IncRefFun Z3_constructor_list
-> Context
-> Ptr Z3_constructor_list
-> IO ConstructorList
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_constructor_list -> ConstructorList
ConstructorList Z3IncRefFun Z3_constructor_list
forall c. Z3IncRefFun c
dummy_inc_ref Z3IncRefFun Z3_constructor_list
z3_del_constructor_list
h2c :: forall r.
ConstructorList -> (Ptr Z3_constructor_list -> IO r) -> IO r
h2c ConstructorList
cl = ForeignPtr Z3_constructor_list
-> (Ptr Z3_constructor_list -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ConstructorList -> ForeignPtr Z3_constructor_list
unConstructorList ConstructorList
cl)
instance Marshal Solver (Ptr Z3_solver) where
c2h :: Context -> Ptr Z3_solver -> IO Solver
c2h = (ForeignPtr Z3_solver -> Solver)
-> (Ptr Z3_context -> Ptr Z3_solver -> IO ())
-> (Ptr Z3_context -> Ptr Z3_solver -> IO ())
-> Context
-> Ptr Z3_solver
-> IO Solver
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_solver -> Solver
Solver Ptr Z3_context -> Ptr Z3_solver -> IO ()
z3_solver_inc_ref Ptr Z3_context -> Ptr Z3_solver -> IO ()
z3_solver_dec_ref
h2c :: forall r. Solver -> (Ptr Z3_solver -> IO r) -> IO r
h2c Solver
slv = ForeignPtr Z3_solver -> (Ptr Z3_solver -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Solver -> ForeignPtr Z3_solver
unSolver Solver
slv)
instance Marshal Tactic (Ptr Z3_tactic) where
c2h :: Context -> Ptr Z3_tactic -> IO Tactic
c2h = (ForeignPtr Z3_tactic -> Tactic)
-> Z3IncRefFun Z3_tactic
-> Z3IncRefFun Z3_tactic
-> Context
-> Ptr Z3_tactic
-> IO Tactic
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_tactic -> Tactic
Tactic Z3IncRefFun Z3_tactic
z3_tactic_inc_ref Z3IncRefFun Z3_tactic
z3_tactic_dec_ref
h2c :: forall r. Tactic -> (Ptr Z3_tactic -> IO r) -> IO r
h2c Tactic
tac = ForeignPtr Z3_tactic -> (Ptr Z3_tactic -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Tactic -> ForeignPtr Z3_tactic
unTactic Tactic
tac)
instance Marshal ApplyResult (Ptr Z3_apply_result) where
c2h :: Context -> Ptr Z3_apply_result -> IO ApplyResult
c2h = (ForeignPtr Z3_apply_result -> ApplyResult)
-> Z3IncRefFun Z3_apply_result
-> Z3IncRefFun Z3_apply_result
-> Context
-> Ptr Z3_apply_result
-> IO ApplyResult
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_apply_result -> ApplyResult
ApplyResult Z3IncRefFun Z3_apply_result
z3_apply_result_inc_ref Z3IncRefFun Z3_apply_result
z3_apply_result_dec_ref
h2c :: forall r. ApplyResult -> (Ptr Z3_apply_result -> IO r) -> IO r
h2c ApplyResult
apl = ForeignPtr Z3_apply_result -> (Ptr Z3_apply_result -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (ApplyResult -> ForeignPtr Z3_apply_result
unApplyResult ApplyResult
apl)
instance Marshal Goal (Ptr Z3_goal) where
c2h :: Context -> Ptr Z3_goal -> IO Goal
c2h = (ForeignPtr Z3_goal -> Goal)
-> Z3IncRefFun Z3_goal
-> Z3IncRefFun Z3_goal
-> Context
-> Ptr Z3_goal
-> IO Goal
forall c h.
(ForeignPtr c -> h)
-> Z3IncRefFun c -> Z3IncRefFun c -> Context -> Ptr c -> IO h
mkC2hRefCount ForeignPtr Z3_goal -> Goal
Goal Z3IncRefFun Z3_goal
z3_goal_inc_ref Z3IncRefFun Z3_goal
z3_goal_dec_ref
h2c :: forall r. Goal -> (Ptr Z3_goal -> IO r) -> IO r
h2c Goal
goa = ForeignPtr Z3_goal -> (Ptr Z3_goal -> IO r) -> IO r
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Goal -> ForeignPtr Z3_goal
unGoal Goal
goa)
marshal :: Marshal rh rc => (Ptr Z3_context -> t) ->
Context -> (t -> IO rc) -> IO rh
marshal :: forall rh rc t.
Marshal rh rc =>
(Ptr Z3_context -> t) -> Context -> (t -> IO rc) -> IO rh
marshal Ptr Z3_context -> t
f Context
c t -> IO rc
cont = Context -> (Ptr Z3_context -> IO rc) -> IO rh
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c ((Ptr Z3_context -> IO rc) -> IO rh)
-> (Ptr Z3_context -> IO rc) -> IO rh
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> t -> IO rc
cont (t -> IO rc) -> t -> IO rc
forall a b. (a -> b) -> a -> b
$ Ptr Z3_context -> t
f Ptr Z3_context
cPtr
liftFun0 :: Marshal rh rc => (Ptr Z3_context -> IO rc) ->
Context -> IO rh
liftFun0 :: forall rh rc.
Marshal rh rc =>
(Ptr Z3_context -> IO rc) -> Context -> IO rh
liftFun0 = (Context -> (Ptr Z3_context -> IO rc) -> IO rh)
-> (Ptr Z3_context -> IO rc) -> Context -> IO rh
forall a b c. (a -> b -> c) -> b -> a -> c
flip Context -> (Ptr Z3_context -> IO rc) -> IO rh
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError
{-# INLINE liftFun0 #-}
liftFun1 :: (Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) ->
Context -> ah -> IO rh
liftFun1 :: forall ah ac rh rc.
(Marshal ah ac, Marshal rh rc) =>
(Ptr Z3_context -> ac -> IO rc) -> Context -> ah -> IO rh
liftFun1 Ptr Z3_context -> ac -> IO rc
f Context
c ah
x = ah -> (ac -> IO rh) -> IO rh
forall r. ah -> (ac -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c ah
x ((ac -> IO rh) -> IO rh) -> (ac -> IO rh) -> IO rh
forall a b. (a -> b) -> a -> b
$ \ac
a ->
Context -> (Ptr Z3_context -> IO rc) -> IO rh
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c ((Ptr Z3_context -> IO rc) -> IO rh)
-> (Ptr Z3_context -> IO rc) -> IO rh
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context -> ac -> IO rc
f Ptr Z3_context
cPtr ac
a
{-# INLINE liftFun1 #-}
liftFun2 :: (Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc) ->
Context -> ah -> bh -> IO rh
liftFun2 :: forall ah ac bh bc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> IO rc)
-> Context -> ah -> bh -> IO rh
liftFun2 Ptr Z3_context -> ac -> bc -> IO rc
f Context
c ah
x bh
y = ah -> (ac -> IO rh) -> IO rh
forall r. ah -> (ac -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c ah
x ((ac -> IO rh) -> IO rh) -> (ac -> IO rh) -> IO rh
forall a b. (a -> b) -> a -> b
$ \ac
a -> bh -> (bc -> IO rh) -> IO rh
forall r. bh -> (bc -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c bh
y ((bc -> IO rh) -> IO rh) -> (bc -> IO rh) -> IO rh
forall a b. (a -> b) -> a -> b
$ \bc
b ->
Context -> (Ptr Z3_context -> IO rc) -> IO rh
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c ((Ptr Z3_context -> IO rc) -> IO rh)
-> (Ptr Z3_context -> IO rc) -> IO rh
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context -> ac -> bc -> IO rc
f Ptr Z3_context
cPtr ac
a bc
b
{-# INLINE liftFun2 #-}
liftFun3 :: (Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc) ->
Context -> ah -> bh -> ch -> IO rh
liftFun3 :: forall ah ac bh bc ch cc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> IO rc)
-> Context -> ah -> bh -> ch -> IO rh
liftFun3 Ptr Z3_context -> ac -> bc -> cc -> IO rc
f Context
c ah
x bh
y ch
z = ah -> (ac -> IO rh) -> IO rh
forall r. ah -> (ac -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c ah
x ((ac -> IO rh) -> IO rh) -> (ac -> IO rh) -> IO rh
forall a b. (a -> b) -> a -> b
$ \ac
x1 -> bh -> (bc -> IO rh) -> IO rh
forall r. bh -> (bc -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c bh
y ((bc -> IO rh) -> IO rh) -> (bc -> IO rh) -> IO rh
forall a b. (a -> b) -> a -> b
$ \bc
y1 -> ch -> (cc -> IO rh) -> IO rh
forall r. ch -> (cc -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c ch
z ((cc -> IO rh) -> IO rh) -> (cc -> IO rh) -> IO rh
forall a b. (a -> b) -> a -> b
$ \cc
z1 ->
Context -> (Ptr Z3_context -> IO rc) -> IO rh
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c ((Ptr Z3_context -> IO rc) -> IO rh)
-> (Ptr Z3_context -> IO rc) -> IO rh
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context -> ac -> bc -> cc -> IO rc
f Ptr Z3_context
cPtr ac
x1 bc
y1 cc
z1
{-# INLINE liftFun3 #-}
liftFun4 :: (Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal dh dc,
Marshal rh rc) => (Ptr Z3_context -> ac -> bc -> cc -> dc ->
IO rc) ->
Context -> ah -> bh -> ch -> dh -> IO rh
liftFun4 :: forall ah ac bh bc ch cc dh dc rh rc.
(Marshal ah ac, Marshal bh bc, Marshal ch cc, Marshal dh dc,
Marshal rh rc) =>
(Ptr Z3_context -> ac -> bc -> cc -> dc -> IO rc)
-> Context -> ah -> bh -> ch -> dh -> IO rh
liftFun4 Ptr Z3_context -> ac -> bc -> cc -> dc -> IO rc
f Context
c ah
x bh
y ch
z dh
zz = ah -> (ac -> IO rh) -> IO rh
forall r. ah -> (ac -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c ah
x ((ac -> IO rh) -> IO rh) -> (ac -> IO rh) -> IO rh
forall a b. (a -> b) -> a -> b
$ \ac
x1 -> bh -> (bc -> IO rh) -> IO rh
forall r. bh -> (bc -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c bh
y ((bc -> IO rh) -> IO rh) -> (bc -> IO rh) -> IO rh
forall a b. (a -> b) -> a -> b
$ \bc
y1 -> ch -> (cc -> IO rh) -> IO rh
forall r. ch -> (cc -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c ch
z ((cc -> IO rh) -> IO rh) -> (cc -> IO rh) -> IO rh
forall a b. (a -> b) -> a -> b
$ \cc
z1 ->
dh -> (dc -> IO rh) -> IO rh
forall r. dh -> (dc -> IO r) -> IO r
forall h c r. Marshal h c => h -> (c -> IO r) -> IO r
h2c dh
zz ((dc -> IO rh) -> IO rh) -> (dc -> IO rh) -> IO rh
forall a b. (a -> b) -> a -> b
$ \dc
zz1 -> Context -> (Ptr Z3_context -> IO rc) -> IO rh
forall h c.
Marshal h c =>
Context -> (Ptr Z3_context -> IO c) -> IO h
toHsCheckError Context
c ((Ptr Z3_context -> IO rc) -> IO rh)
-> (Ptr Z3_context -> IO rc) -> IO rh
forall a b. (a -> b) -> a -> b
$ \Ptr Z3_context
cPtr -> Ptr Z3_context -> ac -> bc -> cc -> dc -> IO rc
f Ptr Z3_context
cPtr ac
x1 bc
y1 cc
z1 dc
zz1
{-# INLINE liftFun4 #-}
toResult :: Z3_lbool -> Result
toResult :: Z3_lbool -> Result
toResult Z3_lbool
lb
| Z3_lbool
lb Z3_lbool -> Z3_lbool -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_lbool
z3_l_true = Result
Sat
| Z3_lbool
lb Z3_lbool -> Z3_lbool -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_lbool
z3_l_false = Result
Unsat
| Z3_lbool
lb Z3_lbool -> Z3_lbool -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_lbool
z3_l_undef = Result
Undef
| Bool
otherwise = String -> Result
forall a. HasCallStack => String -> a
error String
"Z3.Base.toResult: illegal `Z3_lbool' value"
toBool :: Z3_bool -> Bool
toBool :: Z3_bool -> Bool
toBool Z3_bool
b
| Z3_bool
b Z3_bool -> Z3_bool -> Bool
forall a. Eq a => a -> a -> Bool
== Z3_bool
z3_false = Bool
False
| Bool
otherwise = Bool
True
unBool :: Bool -> Z3_bool
unBool :: Bool -> Z3_bool
unBool Bool
True = Z3_bool
z3_true
unBool Bool
False = Z3_bool
z3_false
ptrToMaybe :: Ptr a -> Maybe (Ptr a)
ptrToMaybe :: forall a. Ptr a -> Maybe (Ptr a)
ptrToMaybe Ptr a
ptr | Ptr a
ptr Ptr a -> Ptr a -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr a
forall a. Ptr a
nullPtr = Maybe (Ptr a)
forall a. Maybe a
Nothing
| Bool
otherwise = Ptr a -> Maybe (Ptr a)
forall a. a -> Maybe a
Just Ptr a
ptr