Package com.microsoft.z3
Class Context
- java.lang.Object
-
- com.microsoft.z3.Context
-
- All Implemented Interfaces:
AutoCloseable
public class Context extends Object implements AutoCloseable
The main interaction with Z3 happens via the Context. For applications that spawn an unbounded number of contexts, the proper use is within a try-with-resources scope so that the Context object gets garbage collected in a predictable way. Contexts maintain all data-structures related to terms and formulas that are created relative to them.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Probeand(Probe p1, Probe p2)Create a probe that evaluates totruewhen the valuep1andp2evaluate totrue.TacticandThen(Tactic t1, Tactic t2, Tactic... ts)Create a tactic that appliest1to a Goal and thent2to every subgoal produced byt1StringbenchmarkToSMTString(String name, String logic, String status, String attributes, BoolExpr[] assumptions, BoolExpr formula)Convert a benchmark into an SMT-LIB formatted string.voidclose()Disposes of the context.Tacticcond(Probe p, Tactic t1, Tactic t2)Create a tactic that appliest1to a given goal if the probepevaluates to true andt2otherwise.ProbeconstProbe(double val)Create a probe that always evaluates toval.Probeeq(Probe p1, Probe p2)Create a probe that evaluates totruewhen the value returned byp1is equal to the value returned byp2Tacticfail()Create a tactic always fails.TacticfailIf(Probe p)Create a tactic that fails if the probepevaluates to false.TacticfailIfNotDecided()Create a tactic that fails if the goal is not trivially satisfiable (i.e., empty) or trivially unsatisfiable (i.e., contains `false').Probege(Probe p1, Probe p2)Create a probe that evaluates totruewhen the value returned byp1is greater than or equal the value returned byp2IDecRefQueue<ApplyResult>getApplyResultDRQ()IDecRefQueue<AST>getASTDRQ()IDecRefQueue<com.microsoft.z3.ASTMap>getASTMapDRQ()IDecRefQueue<ASTVector>getASTVectorDRQ()BoolSortgetBoolSort()Retrieves the Boolean sort of the context.IDecRefQueue<Constructor>getConstructorDRQ()IDecRefQueue<ConstructorList>getConstructorListDRQ()IDecRefQueue<Fixedpoint>getFixedpointDRQ()IDecRefQueue<FuncInterp.Entry>getFuncEntryDRQ()IDecRefQueue<FuncInterp>getFuncInterpDRQ()IDecRefQueue<Goal>getGoalDRQ()IntSortgetIntSort()Retrieves the Integer sort of the context.IDecRefQueue<Model>getModelDRQ()intgetNumProbes()The number of supported Probes.intgetNumTactics()The number of supported tactics.IDecRefQueue<Optimize>getOptimizeDRQ()IDecRefQueue<ParamDescrs>getParamDescrsDRQ()IDecRefQueue<Params>getParamsDRQ()StringgetProbeDescription(String name)Returns a string containing a description of the probe with the given name.IDecRefQueue<Probe>getProbeDRQ()String[]getProbeNames()The names of all supported Probes.RealSortgetRealSort()Retrieves the Real sort of the context.ParamDescrsgetSimplifyParameterDescriptions()Retrieves parameter descriptions for simplifier.IDecRefQueue<Solver>getSolverDRQ()IDecRefQueue<Statistics>getStatisticsDRQ()SeqSortgetStringSort()Retrieves the Integer sort of the context.StringgetTacticDescription(String name)Returns a string containing a description of the tactic with the given name.IDecRefQueue<Tactic>getTacticDRQ()String[]getTacticNames()The names of all supported tactics.Probegt(Probe p1, Probe p2)Create a probe that evaluates totruewhen the value returned byp1is greater than the value returned byp2voidinterrupt()Interrupt the execution of a Z3 procedure.SeqExprintToString(Expr e)Convert an integer expression to a string.Probele(Probe p1, Probe p2)Create a probe that evaluates totruewhen the value returned byp1is less than or equal the value returned byp2Probelt(Probe p1, Probe p2)Create a probe that evaluates totruewhen the value returned byp1is less than the value returned byp2ArithExprmkAdd(ArithExpr... t)Create an expression representingt[0] + t[1] + ....BoolExprmkAnd(BoolExpr... t)Create an expression representingt[0] and t[1] and ....ExprmkApp(FuncDecl f, Expr... args)Create a new function application.ArrayExprmkArrayConst(Symbol name, Sort domain, Sort range)Create an array constant.ArrayExprmkArrayConst(String name, Sort domain, Sort range)Create an array constant.ExprmkArrayExt(ArrayExpr arg1, ArrayExpr arg2)Create Extentionality index.ArraySortmkArraySort(Sort[] domains, Sort range)Create a new array sort.ArraySortmkArraySort(Sort domain, Sort range)Create a new array sort.SeqExprmkAt(SeqExpr s, IntExpr index)Retrieve sequence of length one at index.BoolExprmkAtLeast(BoolExpr[] args, int k)Create an at-least-k constraint.BoolExprmkAtMost(BoolExpr[] args, int k)Create an at-most-k constraint.BitVecSortmkBitVecSort(int size)Create a new bit-vector sort.BoolExprmkBool(boolean value)Creates a Boolean value.BoolExprmkBoolConst(Symbol name)Create a Boolean constant.BoolExprmkBoolConst(String name)Create a Boolean constant.BoolSortmkBoolSort()Create a new Boolean sort.ExprmkBound(int index, Sort ty)Creates a new bound variable.BitVecNummkBV(int v, int size)Create a bit-vector numeral.BitVecNummkBV(long v, int size)Create a bit-vector numeral.BitVecNummkBV(String v, int size)Create a bit-vector numeral.IntExprmkBV2Int(BitVecExpr t, boolean signed)Create an integer from the bit-vector argumentt.BitVecExprmkBVAdd(BitVecExpr t1, BitVecExpr t2)Two's complement addition.BoolExprmkBVAddNoOverflow(BitVecExpr t1, BitVecExpr t2, boolean isSigned)Create a predicate that checks that the bit-wise addition does not overflow.BoolExprmkBVAddNoUnderflow(BitVecExpr t1, BitVecExpr t2)Create a predicate that checks that the bit-wise addition does not underflow.BitVecExprmkBVAND(BitVecExpr t1, BitVecExpr t2)Bitwise conjunction.BitVecExprmkBVASHR(BitVecExpr t1, BitVecExpr t2)Arithmetic shift right Remarks: It is like logical shift right except that the most significant bits of the result always copy the most significant bit of the second argument.BitVecExprmkBVConst(Symbol name, int size)Creates a bit-vector constant.BitVecExprmkBVConst(String name, int size)Creates a bit-vector constant.BitVecExprmkBVLSHR(BitVecExpr t1, BitVecExpr t2)Logical shift right Remarks: It is equivalent to unsigned division by2^xwhere \c x is the value oft2.BitVecExprmkBVMul(BitVecExpr t1, BitVecExpr t2)Two's complement multiplication.BoolExprmkBVMulNoOverflow(BitVecExpr t1, BitVecExpr t2, boolean isSigned)Create a predicate that checks that the bit-wise multiplication does not overflow.BoolExprmkBVMulNoUnderflow(BitVecExpr t1, BitVecExpr t2)Create a predicate that checks that the bit-wise multiplication does not underflow.BitVecExprmkBVNAND(BitVecExpr t1, BitVecExpr t2)Bitwise NAND.BitVecExprmkBVNeg(BitVecExpr t)Standard two's complement unary minus.BoolExprmkBVNegNoOverflow(BitVecExpr t)Create a predicate that checks that the bit-wise negation does not overflow.BitVecExprmkBVNOR(BitVecExpr t1, BitVecExpr t2)Bitwise NOR.BitVecExprmkBVNot(BitVecExpr t)Bitwise negation.BitVecExprmkBVOR(BitVecExpr t1, BitVecExpr t2)Bitwise disjunction.BitVecExprmkBVRedAND(BitVecExpr t)Take conjunction of bits in a vector, return vector of length 1.BitVecExprmkBVRedOR(BitVecExpr t)Take disjunction of bits in a vector, return vector of length 1.BitVecExprmkBVRotateLeft(int i, BitVecExpr t)Rotate Left.BitVecExprmkBVRotateLeft(BitVecExpr t1, BitVecExpr t2)Rotate Left.BitVecExprmkBVRotateRight(int i, BitVecExpr t)Rotate Right.BitVecExprmkBVRotateRight(BitVecExpr t1, BitVecExpr t2)Rotate Right.BitVecExprmkBVSDiv(BitVecExpr t1, BitVecExpr t2)Signed division.BoolExprmkBVSDivNoOverflow(BitVecExpr t1, BitVecExpr t2)Create a predicate that checks that the bit-wise signed division does not overflow.BoolExprmkBVSGE(BitVecExpr t1, BitVecExpr t2)Two's complement signed greater than or equal to.BoolExprmkBVSGT(BitVecExpr t1, BitVecExpr t2)Two's complement signed greater-than.BitVecExprmkBVSHL(BitVecExpr t1, BitVecExpr t2)Shift left.BoolExprmkBVSLE(BitVecExpr t1, BitVecExpr t2)Two's complement signed less-than or equal to.BoolExprmkBVSLT(BitVecExpr t1, BitVecExpr t2)Two's complement signed less-than Remarks: The arguments must have the same bit-vector sort.BitVecExprmkBVSMod(BitVecExpr t1, BitVecExpr t2)Two's complement signed remainder (sign follows divisor).BitVecExprmkBVSRem(BitVecExpr t1, BitVecExpr t2)Signed remainder.BitVecExprmkBVSub(BitVecExpr t1, BitVecExpr t2)Two's complement subtraction.BoolExprmkBVSubNoOverflow(BitVecExpr t1, BitVecExpr t2)Create a predicate that checks that the bit-wise subtraction does not overflow.BoolExprmkBVSubNoUnderflow(BitVecExpr t1, BitVecExpr t2, boolean isSigned)Create a predicate that checks that the bit-wise subtraction does not underflow.BitVecExprmkBVUDiv(BitVecExpr t1, BitVecExpr t2)Unsigned division.BoolExprmkBVUGE(BitVecExpr t1, BitVecExpr t2)Unsigned greater than or equal to.BoolExprmkBVUGT(BitVecExpr t1, BitVecExpr t2)Unsigned greater-than.BoolExprmkBVULE(BitVecExpr t1, BitVecExpr t2)Unsigned less-than or equal to.BoolExprmkBVULT(BitVecExpr t1, BitVecExpr t2)Unsigned less-than Remarks: The arguments must have the same bit-vector sort.BitVecExprmkBVURem(BitVecExpr t1, BitVecExpr t2)Unsigned remainder.BitVecExprmkBVXNOR(BitVecExpr t1, BitVecExpr t2)Bitwise XNOR.BitVecExprmkBVXOR(BitVecExpr t1, BitVecExpr t2)Bitwise XOR.ReExprmkComplement(ReExpr re)Create the complement regular expression.BitVecExprmkConcat(BitVecExpr t1, BitVecExpr t2)Bit-vector concatenation.ReExprmkConcat(ReExpr... t)Create the concatenation of regular languages.SeqExprmkConcat(SeqExpr... t)Concatenate sequences.ExprmkConst(FuncDecl f)Creates a fresh constant from the FuncDeclf.ExprmkConst(Symbol name, Sort range)Creates a new Constant of sortrangeand namedname.ExprmkConst(String name, Sort range)Creates a new Constant of sortrangeand namedname.ArrayExprmkConstArray(Sort domain, Expr v)Create a constant array.FuncDeclmkConstDecl(Symbol name, Sort range)Creates a new constant function declaration.FuncDeclmkConstDecl(String name, Sort range)Creates a new constant function declaration.ConstructormkConstructor(Symbol name, Symbol recognizer, Symbol[] fieldNames, Sort[] sorts, int[] sortRefs)Create a datatype constructor.ConstructormkConstructor(String name, String recognizer, String[] fieldNames, Sort[] sorts, int[] sortRefs)Create a datatype constructor.BoolExprmkContains(SeqExpr s1, SeqExpr s2)Check for sequence containment of s2 in s1.DatatypeSortmkDatatypeSort(Symbol name, Constructor[] constructors)Create a new datatype sort.DatatypeSortmkDatatypeSort(String name, Constructor[] constructors)Create a new datatype sort.DatatypeSort[]mkDatatypeSorts(Symbol[] names, Constructor[][] c)Create mutually recursive datatypes.DatatypeSort[]mkDatatypeSorts(String[] names, Constructor[][] c)Create mutually recursive data-types.BoolExprmkDistinct(Expr... args)Creates adistinctterm.ArithExprmkDiv(ArithExpr t1, ArithExpr t2)Create an expression representingt1 / t2.ReExprmkEmptyRe(Sort s)Create the empty regular expression.SeqExprmkEmptySeq(Sort s)Create the empty sequence.ArrayExprmkEmptySet(Sort domain)Create an empty set.EnumSortmkEnumSort(Symbol name, Symbol... enumNames)Create a new enumeration sort.EnumSortmkEnumSort(String name, String... enumNames)Create a new enumeration sort.BoolExprmkEq(Expr x, Expr y)Creates the equalityx = yQuantifiermkExists(Expr[] boundConstants, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)Creates an existential quantifier using a list of constants that will form the set of bound variables.QuantifiermkExists(Sort[] sorts, Symbol[] names, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)Creates an existential quantifier using de-Bruijn indexed variables.BitVecExprmkExtract(int high, int low, BitVecExpr t)Bit-vector extraction.SeqExprmkExtract(SeqExpr s, IntExpr offset, IntExpr length)Extract subsequence.BoolExprmkFalse()The false Term.FiniteDomainSortmkFiniteDomainSort(Symbol name, long size)Create a new finite domain sort.FiniteDomainSortmkFiniteDomainSort(String name, long size)Create a new finite domain sort.FixedpointmkFixedpoint()Create a Fixedpoint context.QuantifiermkForall(Expr[] boundConstants, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)Creates a universal quantifier using a list of constants that will form the set of bound variables.QuantifiermkForall(Sort[] sorts, Symbol[] names, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)Create a universal Quantifier.FPNummkFP(boolean sgn, int exp, int sig, FPSort s)Create a numeral of FloatingPoint sort from a sign bit and two integers.FPNummkFP(boolean sgn, long exp, long sig, FPSort s)Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.FPNummkFP(double v, FPSort s)Create a numeral of FloatingPoint sort from a double.FPNummkFP(float v, FPSort s)Create a numeral of FloatingPoint sort from a float.FPNummkFP(int v, FPSort s)Create a numeral of FloatingPoint sort from an int.FPExprmkFP(BitVecExpr sgn, BitVecExpr sig, BitVecExpr exp)Create an expression of FloatingPoint sort from three bit-vector expressions.FPExprmkFPAbs(FPExpr t)Floating-point absolute valueFPExprmkFPAdd(FPRMExpr rm, FPExpr t1, FPExpr t2)Floating-point additionFPExprmkFPDiv(FPRMExpr rm, FPExpr t1, FPExpr t2)Floating-point divisionBoolExprmkFPEq(FPExpr t1, FPExpr t2)Floating-point equality.FPExprmkFPFMA(FPRMExpr rm, FPExpr t1, FPExpr t2, FPExpr t3)Floating-point fused multiply-addBoolExprmkFPGEq(FPExpr t1, FPExpr t2)Floating-point greater than or equal.BoolExprmkFPGt(FPExpr t1, FPExpr t2)Floating-point greater than.FPNummkFPInf(FPSort s, boolean negative)Create a floating-point infinity of sort s.BoolExprmkFPIsInfinite(FPExpr t)Predicate indicating whether t is a floating-point number representing +oo or -oo.BoolExprmkFPIsNaN(FPExpr t)Predicate indicating whether t is a NaN.BoolExprmkFPIsNegative(FPExpr t)Predicate indicating whether t is a negative floating-point number.BoolExprmkFPIsNormal(FPExpr t)Predicate indicating whether t is a normal floating-point number.\BoolExprmkFPIsPositive(FPExpr t)Predicate indicating whether t is a positive floating-point number.BoolExprmkFPIsSubnormal(FPExpr t)Predicate indicating whether t is a subnormal floating-point number.\BoolExprmkFPIsZero(FPExpr t)Predicate indicating whether t is a floating-point number with zero value, i.e., +0 or -0.BoolExprmkFPLEq(FPExpr t1, FPExpr t2)Floating-point less than or equal.BoolExprmkFPLt(FPExpr t1, FPExpr t2)Floating-point less than.FPExprmkFPMax(FPExpr t1, FPExpr t2)Maximum of floating-point numbers.FPExprmkFPMin(FPExpr t1, FPExpr t2)Minimum of floating-point numbers.FPExprmkFPMul(FPRMExpr rm, FPExpr t1, FPExpr t2)Floating-point multiplicationFPNummkFPNaN(FPSort s)Create a NaN of sort s.FPExprmkFPNeg(FPExpr t)Floating-point negationFPNummkFPNumeral(boolean sgn, int exp, int sig, FPSort s)Create a numeral of FloatingPoint sort from a sign bit and two integers.FPNummkFPNumeral(boolean sgn, long exp, long sig, FPSort s)Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.FPNummkFPNumeral(double v, FPSort s)Create a numeral of FloatingPoint sort from a double.FPNummkFPNumeral(float v, FPSort s)Create a numeral of FloatingPoint sort from a float.FPNummkFPNumeral(int v, FPSort s)Create a numeral of FloatingPoint sort from an int.FPExprmkFPRem(FPExpr t1, FPExpr t2)Floating-point remainderFPRMNummkFPRNA()Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.FPRMNummkFPRNE()Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.FPRMSortmkFPRoundingModeSort()Create the floating-point RoundingMode sort.FPRMNummkFPRoundNearestTiesToAway()Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.FPRMExprmkFPRoundNearestTiesToEven()Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.FPExprmkFPRoundToIntegral(FPRMExpr rm, FPExpr t)Floating-point roundToIntegral.FPRMNummkFPRoundTowardNegative()Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode.FPRMNummkFPRoundTowardPositive()Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode.FPRMNummkFPRoundTowardZero()Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode.FPRMNummkFPRTN()Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode.FPRMNummkFPRTP()Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode.FPRMNummkFPRTZ()Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode.FPSortmkFPSort(int ebits, int sbits)Create a FloatingPoint sort.FPSortmkFPSort128()Create the quadruple-precision (128-bit) FloatingPoint sort.FPSortmkFPSort16()Create the half-precision (16-bit) FloatingPoint sort.FPSortmkFPSort32()Create the single-precision (32-bit) FloatingPoint sort.FPSortmkFPSort64()Create the double-precision (64-bit) FloatingPoint sort.FPSortmkFPSortDouble()Create the double-precision (64-bit) FloatingPoint sort.FPSortmkFPSortHalf()Create the half-precision (16-bit) FloatingPoint sort.FPSortmkFPSortQuadruple()Create the quadruple-precision (128-bit) FloatingPoint sort.FPSortmkFPSortSingle()Create the single-precision (32-bit) FloatingPoint sort.FPExprmkFPSqrt(FPRMExpr rm, FPExpr t)Floating-point square rootFPExprmkFPSub(FPRMExpr rm, FPExpr t1, FPExpr t2)Floating-point subtractionBitVecExprmkFPToBV(FPRMExpr rm, FPExpr t, int sz, boolean signed)Conversion of a floating-point term into a bit-vector.FPExprmkFPToFP(BitVecExpr bv, FPSort s)Conversion of a single IEEE 754-2008 bit-vector into a floating-point number.FPExprmkFPToFP(FPRMExpr rm, BitVecExpr t, FPSort s, boolean signed)Conversion of a 2's complement signed bit-vector term into a term of FloatingPoint sort.FPExprmkFPToFP(FPRMExpr rm, FPExpr t, FPSort s)Conversion of a FloatingPoint term into another term of different FloatingPoint sort.BitVecExprmkFPToFP(FPRMExpr rm, IntExpr exp, RealExpr sig, FPSort s)Conversion of a real-sorted significand and an integer-sorted exponent into a term of FloatingPoint sort.FPExprmkFPToFP(FPRMExpr rm, RealExpr t, FPSort s)Conversion of a term of real sort into a term of FloatingPoint sort.FPExprmkFPToFP(FPSort s, FPRMExpr rm, FPExpr t)Conversion of a floating-point number to another FloatingPoint sort s.BitVecExprmkFPToIEEEBV(FPExpr t)Conversion of a floating-point term into a bit-vector term in IEEE 754-2008 format.RealExprmkFPToReal(FPExpr t)Conversion of a floating-point term into a real-numbered term.FPNummkFPZero(FPSort s, boolean negative)Create a floating-point zero of sort s.ExprmkFreshConst(String prefix, Sort range)Creates a fresh Constant of sortrangeand a name prefixed withprefix.FuncDeclmkFreshConstDecl(String prefix, Sort range)Creates a fresh constant function declaration with a name prefixed withprefix.FuncDeclmkFreshFuncDecl(String prefix, Sort[] domain, Sort range)Creates a fresh function declaration with a name prefixed withprefix.ReExprmkFullRe(Sort s)Create the full regular expression.ArrayExprmkFullSet(Sort domain)Create the full set.FuncDeclmkFuncDecl(Symbol name, Sort[] domain, Sort range)Creates a new function declaration.FuncDeclmkFuncDecl(Symbol name, Sort domain, Sort range)Creates a new function declaration.FuncDeclmkFuncDecl(String name, Sort[] domain, Sort range)Creates a new function declaration.FuncDeclmkFuncDecl(String name, Sort domain, Sort range)Creates a new function declaration.BoolExprmkGe(ArithExpr t1, ArithExpr t2)Create an expression representingt1 >= t2GoalmkGoal(boolean models, boolean unsatCores, boolean proofs)Creates a new Goal.BoolExprmkGt(ArithExpr t1, ArithExpr t2)Create an expression representingt1 > t2BoolExprmkIff(BoolExpr t1, BoolExpr t2)Create an expression representingt1 iff t2.BoolExprmkImplies(BoolExpr t1, BoolExpr t2)Create an expression representingt1 -> t2.IntExprmkIndexOf(SeqExpr s, SeqExpr substr, ArithExpr offset)Extract index of sub-string starting at offset.BoolExprmkInRe(SeqExpr s, ReExpr re)Check for regular expression membership.IntNummkInt(int v)Create an integer numeral.IntNummkInt(long v)Create an integer numeral.IntNummkInt(String v)Create an integer numeral.BitVecExprmkInt2BV(int n, IntExpr t)Create annbit bit-vector from the integer argumentt.RealExprmkInt2Real(IntExpr t)Coerce an integer to a real.IntExprmkIntConst(Symbol name)Creates an integer constant.IntExprmkIntConst(String name)Creates an integer constant.ReExprmkIntersect(ReExpr... t)Create the intersection of regular languages.IntSortmkIntSort()Create a new integer sort.BoolExprmkIsInteger(RealExpr t)Creates an expression that checks whether a real number is an integer.ExprmkITE(BoolExpr t1, Expr t2, Expr t3)Create an expression representing an if-then-else:ite(t1, t2, t3).LambdamkLambda(Expr[] boundConstants, Expr body)Create a lambda expression.LambdamkLambda(Sort[] sorts, Symbol[] names, Expr body)Create a lambda expression.BoolExprmkLe(ArithExpr t1, ArithExpr t2)Create an expression representingt1 <= t2IntExprmkLength(SeqExpr s)Retrieve the length of a given sequence.ListSortmkListSort(Symbol name, Sort elemSort)Create a new list sort.ListSortmkListSort(String name, Sort elemSort)Create a new list sort.ReExprmkLoop(ReExpr re, int lo)Take the lower-bounded Kleene star of a regular expression.ReExprmkLoop(ReExpr re, int lo, int hi)Take the lower and upper-bounded Kleene star of a regular expression.BoolExprmkLt(ArithExpr t1, ArithExpr t2)Create an expression representingt1 < t2ArrayExprmkMap(FuncDecl f, ArrayExpr... args)Maps f on the argument arrays.IntExprmkMod(IntExpr t1, IntExpr t2)Create an expression representingt1 mod t2.ArithExprmkMul(ArithExpr... t)Create an expression representingt[0] * t[1] * ....BoolExprmkNot(BoolExpr a)Create an expression representingnot(a).ExprMkNth(SeqExpr s, Expr index)Retrieve element at index.ExprmkNumeral(int v, Sort ty)Create a Term of a given sort.ExprmkNumeral(long v, Sort ty)Create a Term of a given sort.ExprmkNumeral(String v, Sort ty)Create a Term of a given sort.OptimizemkOptimize()Create a Optimize context.ReExprmkOption(ReExpr re)Create the optional regular expression.BoolExprmkOr(BoolExpr... t)Create an expression representingt[0] or t[1] or ....ParamsmkParams()Creates a new ParameterSet.PatternmkPattern(Expr... terms)Create a quantifier pattern.BoolExprmkPBEq(int[] coeffs, BoolExpr[] args, int k)Create a pseudo-Boolean equal constraint.BoolExprmkPBGe(int[] coeffs, BoolExpr[] args, int k)Create a pseudo-Boolean greater-or-equal constraint.BoolExprmkPBLe(int[] coeffs, BoolExpr[] args, int k)Create a pseudo-Boolean less-or-equal constraint.ReExprmkPlus(ReExpr re)Take the Kleene plus of a regular expression.ArithExprmkPower(ArithExpr t1, ArithExpr t2)Create an expression representingt1 ^ t2.BoolExprmkPrefixOf(SeqExpr s1, SeqExpr s2)Check for sequence prefix.ProbemkProbe(String name)Creates a new Probe.QuantifiermkQuantifier(boolean universal, Expr[] boundConstants, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)Create a QuantifierQuantifiermkQuantifier(boolean universal, Sort[] sorts, Symbol[] names, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)Create a Quantifier.ReExprmkRange(SeqExpr lo, SeqExpr hi)Create a range expression.RatNummkReal(int v)Create a real numeral.RatNummkReal(int num, int den)Create a real from a fraction.RatNummkReal(long v)Create a real numeral.RatNummkReal(String v)Create a real numeral.IntExprmkReal2Int(RealExpr t)Coerce a real to an integer.RealExprmkRealConst(Symbol name)Creates a real constant.RealExprmkRealConst(String name)Creates a real constant.RealSortmkRealSort()Create a real sort.IntExprmkRem(IntExpr t1, IntExpr t2)Create an expression representingt1 rem t2.BitVecExprmkRepeat(int i, BitVecExpr t)Bit-vector repetition.SeqExprmkReplace(SeqExpr s, SeqExpr src, SeqExpr dst)Replace the first occurrence of src by dst in s.ReSortmkReSort(Sort s)Create a new regular expression sortExprmkSelect(ArrayExpr a, Expr i)Array read.ExprmkSelect(ArrayExpr a, Expr[] args)Array read.SeqSortmkSeqSort(Sort s)Create a new sequence sortArrayExprmkSetAdd(ArrayExpr set, Expr element)Add an element to the set.ArrayExprmkSetComplement(ArrayExpr arg)Take the complement of a set.ArrayExprmkSetDel(ArrayExpr set, Expr element)Remove an element from a set.ArrayExprmkSetDifference(ArrayExpr arg1, ArrayExpr arg2)Take the difference between two sets.ArrayExprmkSetIntersection(ArrayExpr... args)Take the intersection of a list of sets.BoolExprmkSetMembership(Expr elem, ArrayExpr set)Check for set membership.SetSortmkSetSort(Sort ty)Create a set type.BoolExprmkSetSubset(ArrayExpr arg1, ArrayExpr arg2)Check for subsetness of sets.ArrayExprmkSetUnion(ArrayExpr... args)Take the union of a list of sets.BitVecExprmkSignExt(int i, BitVecExpr t)Bit-vector sign extension.SolvermkSimpleSolver()Creates a new (incremental) solver.SolvermkSolver()Creates a new (incremental) solver.SolvermkSolver(Symbol logic)Creates a new (incremental) solver.SolvermkSolver(Tactic t)Creates a solver that is implemented using the given tactic.SolvermkSolver(String logic)Creates a new (incremental) solver.ReExprmkStar(ReExpr re)Take the Kleene star of a regular expression.ArrayExprmkStore(ArrayExpr a, Expr[] args, Expr v)Array update.ArrayExprmkStore(ArrayExpr a, Expr i, Expr v)Array update.SeqExprmkString(String s)Create a string constant.SeqSortmkStringSort()Create a new string sortArithExprmkSub(ArithExpr... t)Create an expression representingt[0] - t[1] - ....BoolExprmkSuffixOf(SeqExpr s1, SeqExpr s2)Check for sequence suffix.IntSymbolmkSymbol(int i)Creates a new symbol using an integer.StringSymbolmkSymbol(String name)Create a symbol using a string.TacticmkTactic(String name)Creates a new Tactic.ExprmkTermArray(ArrayExpr array)Access the array default value.ReExprmkToRe(SeqExpr s)Convert a regular expression that accepts sequence s.BoolExprmkTrue()The true Term.TupleSortmkTupleSort(Symbol name, Symbol[] fieldNames, Sort[] fieldSorts)Create a new tuple sort.ArithExprmkUnaryMinus(ArithExpr t)Create an expression representing-t.UninterpretedSortmkUninterpretedSort(Symbol s)Create a new uninterpreted sort.UninterpretedSortmkUninterpretedSort(String str)Create a new uninterpreted sort.ReExprmkUnion(ReExpr... t)Create the union of regular languages.SeqExprmkUnit(Expr elem)Create the singleton sequence.ExprmkUpdateField(FuncDecl field, Expr t, Expr v)Update a datatype field at expression t with value v.BoolExprmkXor(BoolExpr t1, BoolExpr t2)Create an expression representingt1 xor t2.BitVecExprmkZeroExt(int i, BitVecExpr t)Bit-vector zero extension.longnCtx()Probenot(Probe p)Create a probe that evaluates totruewhen the valuepdoes not evaluate totrue.Probeor(Probe p1, Probe p2)Create a probe that evaluates totruewhen the valuep1orp2evaluate totrue.TacticorElse(Tactic t1, Tactic t2)Create a tactic that first appliest1to a Goal and if it fails then returns the result oft2applied to the Goal.TacticparAndThen(Tactic t1, Tactic t2)Create a tactic that appliest1to a given goal and thent2to every subgoal produced byt1.TacticparOr(Tactic... t)Create a tactic that applies the given tactics in parallel until one of them succeeds (i.e., the first that doesn't fail).BoolExpr[]parseSMTLIB2File(String fileName, Symbol[] sortNames, Sort[] sorts, Symbol[] declNames, FuncDecl[] decls)Parse the given file using the SMT-LIB2 parser.BoolExpr[]parseSMTLIB2String(String str, Symbol[] sortNames, Sort[] sorts, Symbol[] declNames, FuncDecl[] decls)Parse the given string using the SMT-LIB2 parser.Tacticrepeat(Tactic t, int max)Create a tactic that keeps applyingtuntil the goal is not modified anymore or the maximum number of iterationsmaxis reached.voidsetPrintMode(Z3_ast_print_mode value)Selects the format used for pretty-printing expressions.StringSimplifyHelp()Return a string describing all available parameters toExpr.Simplify.Tacticskip()Create a tactic that just returns the given goal.IntExprstringToInt(Expr e)Convert an integer expression to a string.Tacticthen(Tactic t1, Tactic t2, Tactic... ts)Create a tactic that appliest1to a Goal and thent2to every subgoal produced byt1Remarks: Shorthand forAndThen.TactictryFor(Tactic t, int ms)Create a tactic that appliestto a goal formsmilliseconds.longunwrapAST(AST a)Unwraps an AST.voidupdateParamValue(String id, String value)Update a mutable configuration parameter.TacticusingParams(Tactic t, Params p)Create a tactic that appliestusing the given set of parametersp.Tacticwhen(Probe p, Tactic t)Create a tactic that appliestto a given goal if the probepevaluates to true.Tacticwith(Tactic t, Params p)Create a tactic that appliestusing the given set of parametersp.ASTwrapAST(long nativeObject)Wraps an AST.
-
-
-
Constructor Detail
-
Context
public Context()
-
Context
protected Context(long m_ctx)
-
Context
public Context(Map<String,String> settings)
Constructor. Remarks: The following parameters can be set: - proof (Boolean) Enable proof generation - debug_ref_count (Boolean) Enable debug support for Z3_ast reference counting - trace (Boolean) Tracing support for VCC - trace_file_name (String) Trace out file for VCC traces - timeout (unsigned) default timeout (in milliseconds) used for solvers - well_sorted_check type checker - auto_config use heuristics to automatically select solver and configure it - model model generation for solvers, this parameter can be overwritten when creating a solver - model_validate validate models produced by solvers - unsat_core unsat-core generation for solvers, this parameter can be overwritten when creating a solver Note that in previous versions of Z3, this constructor was also used to set global and module parameters. For this purpose we should now useGlobal.setParameter
-
-
Method Detail
-
mkSymbol
public IntSymbol mkSymbol(int i)
Creates a new symbol using an integer. Remarks: Not all integers can be passed to this function. The legal range of unsigned integers is 0 to 2^30-1.
-
mkSymbol
public StringSymbol mkSymbol(String name)
Create a symbol using a string.
-
getBoolSort
public BoolSort getBoolSort()
Retrieves the Boolean sort of the context.
-
getIntSort
public IntSort getIntSort()
Retrieves the Integer sort of the context.
-
getRealSort
public RealSort getRealSort()
Retrieves the Real sort of the context.
-
mkBoolSort
public BoolSort mkBoolSort()
Create a new Boolean sort.
-
getStringSort
public SeqSort getStringSort()
Retrieves the Integer sort of the context.
-
mkUninterpretedSort
public UninterpretedSort mkUninterpretedSort(Symbol s)
Create a new uninterpreted sort.
-
mkUninterpretedSort
public UninterpretedSort mkUninterpretedSort(String str)
Create a new uninterpreted sort.
-
mkIntSort
public IntSort mkIntSort()
Create a new integer sort.
-
mkRealSort
public RealSort mkRealSort()
Create a real sort.
-
mkBitVecSort
public BitVecSort mkBitVecSort(int size)
Create a new bit-vector sort.
-
mkStringSort
public SeqSort mkStringSort()
Create a new string sort
-
mkTupleSort
public TupleSort mkTupleSort(Symbol name, Symbol[] fieldNames, Sort[] fieldSorts)
Create a new tuple sort.
-
mkEnumSort
public EnumSort mkEnumSort(Symbol name, Symbol... enumNames)
Create a new enumeration sort.
-
mkEnumSort
public EnumSort mkEnumSort(String name, String... enumNames)
Create a new enumeration sort.
-
mkFiniteDomainSort
public FiniteDomainSort mkFiniteDomainSort(Symbol name, long size)
Create a new finite domain sort.
-
mkFiniteDomainSort
public FiniteDomainSort mkFiniteDomainSort(String name, long size)
Create a new finite domain sort.
-
mkConstructor
public Constructor mkConstructor(Symbol name, Symbol recognizer, Symbol[] fieldNames, Sort[] sorts, int[] sortRefs)
Create a datatype constructor.- Parameters:
name- constructor namerecognizer- name of recognizer function.fieldNames- names of the constructor fields.sorts- field sorts, 0 if the field sort refers to a recursive sort.sortRefs- reference to datatype sort that is an argument to the constructor; if the corresponding sort reference is 0, then the value in sort_refs should be an index referring to one of the recursive datatypes that is declared.
-
mkConstructor
public Constructor mkConstructor(String name, String recognizer, String[] fieldNames, Sort[] sorts, int[] sortRefs)
Create a datatype constructor.
-
mkDatatypeSort
public DatatypeSort mkDatatypeSort(Symbol name, Constructor[] constructors)
Create a new datatype sort.
-
mkDatatypeSort
public DatatypeSort mkDatatypeSort(String name, Constructor[] constructors)
Create a new datatype sort.
-
mkDatatypeSorts
public DatatypeSort[] mkDatatypeSorts(Symbol[] names, Constructor[][] c)
Create mutually recursive datatypes.- Parameters:
names- names of datatype sortsc- list of constructors, one list per sort.
-
mkDatatypeSorts
public DatatypeSort[] mkDatatypeSorts(String[] names, Constructor[][] c)
Create mutually recursive data-types.
-
mkUpdateField
public Expr mkUpdateField(FuncDecl field, Expr t, Expr v) throws Z3Exception
Update a datatype field at expression t with value v. The function performs a record update at t. The field that is passed in as argument is updated with value v, the remaining fields of t are unchanged.- Throws:
Z3Exception
-
mkFuncDecl
public FuncDecl mkFuncDecl(Symbol name, Sort[] domain, Sort range)
Creates a new function declaration.
-
mkFuncDecl
public FuncDecl mkFuncDecl(Symbol name, Sort domain, Sort range)
Creates a new function declaration.
-
mkFuncDecl
public FuncDecl mkFuncDecl(String name, Sort[] domain, Sort range)
Creates a new function declaration.
-
mkFuncDecl
public FuncDecl mkFuncDecl(String name, Sort domain, Sort range)
Creates a new function declaration.
-
mkFreshFuncDecl
public FuncDecl mkFreshFuncDecl(String prefix, Sort[] domain, Sort range)
Creates a fresh function declaration with a name prefixed withprefix.
-
mkConstDecl
public FuncDecl mkConstDecl(Symbol name, Sort range)
Creates a new constant function declaration.
-
mkConstDecl
public FuncDecl mkConstDecl(String name, Sort range)
Creates a new constant function declaration.
-
mkFreshConstDecl
public FuncDecl mkFreshConstDecl(String prefix, Sort range)
Creates a fresh constant function declaration with a name prefixed withprefix.
-
mkBound
public Expr mkBound(int index, Sort ty)
Creates a new bound variable.- Parameters:
index- The de-Bruijn index of the variablety- The sort of the variable
-
mkConst
public Expr mkConst(Symbol name, Sort range)
Creates a new Constant of sortrangeand namedname.
-
mkConst
public Expr mkConst(String name, Sort range)
Creates a new Constant of sortrangeand namedname.
-
mkFreshConst
public Expr mkFreshConst(String prefix, Sort range)
Creates a fresh Constant of sortrangeand a name prefixed withprefix.
-
mkConst
public Expr mkConst(FuncDecl f)
Creates a fresh constant from the FuncDeclf.- Parameters:
f- A decl of a 0-arity function
-
mkBVConst
public BitVecExpr mkBVConst(Symbol name, int size)
Creates a bit-vector constant.
-
mkBVConst
public BitVecExpr mkBVConst(String name, int size)
Creates a bit-vector constant.
-
mkTrue
public BoolExpr mkTrue()
The true Term.
-
mkFalse
public BoolExpr mkFalse()
The false Term.
-
mkBool
public BoolExpr mkBool(boolean value)
Creates a Boolean value.
-
mkITE
public Expr mkITE(BoolExpr t1, Expr t2, Expr t3)
Create an expression representing an if-then-else:ite(t1, t2, t3).- Parameters:
t1- An expression with Boolean sortt2- An expressiont3- An expression with the same sort ast2
-
mkImplies
public BoolExpr mkImplies(BoolExpr t1, BoolExpr t2)
Create an expression representingt1 -> t2.
-
mkAnd
public BoolExpr mkAnd(BoolExpr... t)
Create an expression representingt[0] and t[1] and ....
-
mkDiv
public ArithExpr mkDiv(ArithExpr t1, ArithExpr t2)
Create an expression representingt1 / t2.
-
mkMod
public IntExpr mkMod(IntExpr t1, IntExpr t2)
Create an expression representingt1 mod t2. Remarks: The arguments must have int type.
-
mkRem
public IntExpr mkRem(IntExpr t1, IntExpr t2)
Create an expression representingt1 rem t2. Remarks: The arguments must have int type.
-
mkPower
public ArithExpr mkPower(ArithExpr t1, ArithExpr t2)
Create an expression representingt1 ^ t2.
-
mkLe
public BoolExpr mkLe(ArithExpr t1, ArithExpr t2)
Create an expression representingt1 <= t2
-
mkGe
public BoolExpr mkGe(ArithExpr t1, ArithExpr t2)
Create an expression representingt1 >= t2
-
mkInt2Real
public RealExpr mkInt2Real(IntExpr t)
Coerce an integer to a real. Remarks: There is also a converse operation exposed. It follows the semantics prescribed by the SMT-LIB standard. You can take the floor of a real by creating an auxiliary integer Termkand assertingMakeInt2Real(k) <= t1 < MkInt2Real(k)+1. The argument must be of integer sort.
-
mkReal2Int
public IntExpr mkReal2Int(RealExpr t)
Coerce a real to an integer. Remarks: The semantics of this function follows the SMT-LIB standard for the function to_int. The argument must be of real sort.
-
mkIsInteger
public BoolExpr mkIsInteger(RealExpr t)
Creates an expression that checks whether a real number is an integer.
-
mkBVNot
public BitVecExpr mkBVNot(BitVecExpr t)
Bitwise negation. Remarks: The argument must have a bit-vector sort.
-
mkBVRedAND
public BitVecExpr mkBVRedAND(BitVecExpr t)
Take conjunction of bits in a vector, return vector of length 1. Remarks: The argument must have a bit-vector sort.
-
mkBVRedOR
public BitVecExpr mkBVRedOR(BitVecExpr t)
Take disjunction of bits in a vector, return vector of length 1. Remarks: The argument must have a bit-vector sort.
-
mkBVAND
public BitVecExpr mkBVAND(BitVecExpr t1, BitVecExpr t2)
Bitwise conjunction. Remarks: The arguments must have a bit-vector sort.
-
mkBVOR
public BitVecExpr mkBVOR(BitVecExpr t1, BitVecExpr t2)
Bitwise disjunction. Remarks: The arguments must have a bit-vector sort.
-
mkBVXOR
public BitVecExpr mkBVXOR(BitVecExpr t1, BitVecExpr t2)
Bitwise XOR. Remarks: The arguments must have a bit-vector sort.
-
mkBVNAND
public BitVecExpr mkBVNAND(BitVecExpr t1, BitVecExpr t2)
Bitwise NAND. Remarks: The arguments must have a bit-vector sort.
-
mkBVNOR
public BitVecExpr mkBVNOR(BitVecExpr t1, BitVecExpr t2)
Bitwise NOR. Remarks: The arguments must have a bit-vector sort.
-
mkBVXNOR
public BitVecExpr mkBVXNOR(BitVecExpr t1, BitVecExpr t2)
Bitwise XNOR. Remarks: The arguments must have a bit-vector sort.
-
mkBVNeg
public BitVecExpr mkBVNeg(BitVecExpr t)
Standard two's complement unary minus. Remarks: The arguments must have a bit-vector sort.
-
mkBVAdd
public BitVecExpr mkBVAdd(BitVecExpr t1, BitVecExpr t2)
Two's complement addition. Remarks: The arguments must have the same bit-vector sort.
-
mkBVSub
public BitVecExpr mkBVSub(BitVecExpr t1, BitVecExpr t2)
Two's complement subtraction. Remarks: The arguments must have the same bit-vector sort.
-
mkBVMul
public BitVecExpr mkBVMul(BitVecExpr t1, BitVecExpr t2)
Two's complement multiplication. Remarks: The arguments must have the same bit-vector sort.
-
mkBVUDiv
public BitVecExpr mkBVUDiv(BitVecExpr t1, BitVecExpr t2)
Unsigned division. Remarks: It is defined as the floor oft1/t2if \c t2 is different from zero. Ift2is zero, then the result is undefined. The arguments must have the same bit-vector sort.
-
mkBVSDiv
public BitVecExpr mkBVSDiv(BitVecExpr t1, BitVecExpr t2)
Signed division. Remarks: It is defined in the following way: - The \c floor oft1/t2if \c t2 is different from zero, andt1*t2 >= 0. - The \c ceiling oft1/t2if \c t2 is different from zero, andt1*t2 < 0. Ift2is zero, then the result is undefined. The arguments must have the same bit-vector sort.
-
mkBVURem
public BitVecExpr mkBVURem(BitVecExpr t1, BitVecExpr t2)
Unsigned remainder. Remarks: It is defined ast1 - (t1 /u t2) * t2, where/urepresents unsigned division. Ift2is zero, then the result is undefined. The arguments must have the same bit-vector sort.
-
mkBVSRem
public BitVecExpr mkBVSRem(BitVecExpr t1, BitVecExpr t2)
Signed remainder. Remarks: It is defined ast1 - (t1 /s t2) * t2, where/srepresents signed division. The most significant bit (sign) of the result is equal to the most significant bit of \c t1. Ift2is zero, then the result is undefined. The arguments must have the same bit-vector sort.
-
mkBVSMod
public BitVecExpr mkBVSMod(BitVecExpr t1, BitVecExpr t2)
Two's complement signed remainder (sign follows divisor). Remarks: Ift2is zero, then the result is undefined. The arguments must have the same bit-vector sort.
-
mkBVULT
public BoolExpr mkBVULT(BitVecExpr t1, BitVecExpr t2)
Unsigned less-than Remarks: The arguments must have the same bit-vector sort.
-
mkBVSLT
public BoolExpr mkBVSLT(BitVecExpr t1, BitVecExpr t2)
Two's complement signed less-than Remarks: The arguments must have the same bit-vector sort.
-
mkBVULE
public BoolExpr mkBVULE(BitVecExpr t1, BitVecExpr t2)
Unsigned less-than or equal to. Remarks: The arguments must have the same bit-vector sort.
-
mkBVSLE
public BoolExpr mkBVSLE(BitVecExpr t1, BitVecExpr t2)
Two's complement signed less-than or equal to. Remarks: The arguments must have the same bit-vector sort.
-
mkBVUGE
public BoolExpr mkBVUGE(BitVecExpr t1, BitVecExpr t2)
Unsigned greater than or equal to. Remarks: The arguments must have the same bit-vector sort.
-
mkBVSGE
public BoolExpr mkBVSGE(BitVecExpr t1, BitVecExpr t2)
Two's complement signed greater than or equal to. Remarks: The arguments must have the same bit-vector sort.
-
mkBVUGT
public BoolExpr mkBVUGT(BitVecExpr t1, BitVecExpr t2)
Unsigned greater-than. Remarks: The arguments must have the same bit-vector sort.
-
mkBVSGT
public BoolExpr mkBVSGT(BitVecExpr t1, BitVecExpr t2)
Two's complement signed greater-than. Remarks: The arguments must have the same bit-vector sort.
-
mkConcat
public BitVecExpr mkConcat(BitVecExpr t1, BitVecExpr t2)
Bit-vector concatenation. Remarks: The arguments must have a bit-vector sort.- Returns:
- The result is a bit-vector of size
n1+n2, wheren1(n2) is the size oft1(t2).
-
mkExtract
public BitVecExpr mkExtract(int high, int low, BitVecExpr t)
Bit-vector extraction. Remarks: Extract the bitshighdown tolowfrom a bitvector of sizemto yield a new bitvector of sizen, wheren = high - low + 1. The argumenttmust have a bit-vector sort.
-
mkSignExt
public BitVecExpr mkSignExt(int i, BitVecExpr t)
Bit-vector sign extension. Remarks: Sign-extends the given bit-vector to the (signed) equivalent bitvector of sizem+i, where \c m is the size of the given bit-vector. The argumenttmust have a bit-vector sort.
-
mkZeroExt
public BitVecExpr mkZeroExt(int i, BitVecExpr t)
Bit-vector zero extension. Remarks: Extend the given bit-vector with zeros to the (unsigned) equivalent bitvector of sizem+i, where \c m is the size of the given bit-vector. The argumenttmust have a bit-vector sort.
-
mkRepeat
public BitVecExpr mkRepeat(int i, BitVecExpr t)
Bit-vector repetition. Remarks: The argumenttmust have a bit-vector sort.
-
mkBVSHL
public BitVecExpr mkBVSHL(BitVecExpr t1, BitVecExpr t2)
Shift left. Remarks: It is equivalent to multiplication by2^xwhere \c x is the value oft2. NB. The semantics of shift operations varies between environments. This definition does not necessarily capture directly the semantics of the programming language or assembly architecture you are modeling. The arguments must have a bit-vector sort.
-
mkBVLSHR
public BitVecExpr mkBVLSHR(BitVecExpr t1, BitVecExpr t2)
Logical shift right Remarks: It is equivalent to unsigned division by2^xwhere \c x is the value oft2. NB. The semantics of shift operations varies between environments. This definition does not necessarily capture directly the semantics of the programming language or assembly architecture you are modeling. The arguments must have a bit-vector sort.
-
mkBVASHR
public BitVecExpr mkBVASHR(BitVecExpr t1, BitVecExpr t2)
Arithmetic shift right Remarks: It is like logical shift right except that the most significant bits of the result always copy the most significant bit of the second argument. NB. The semantics of shift operations varies between environments. This definition does not necessarily capture directly the semantics of the programming language or assembly architecture you are modeling. The arguments must have a bit-vector sort.
-
mkBVRotateLeft
public BitVecExpr mkBVRotateLeft(int i, BitVecExpr t)
Rotate Left. Remarks: Rotate bits of \c t to the left \c i times. The argumenttmust have a bit-vector sort.
-
mkBVRotateRight
public BitVecExpr mkBVRotateRight(int i, BitVecExpr t)
Rotate Right. Remarks: Rotate bits of \c t to the right \c i times. The argumenttmust have a bit-vector sort.
-
mkBVRotateLeft
public BitVecExpr mkBVRotateLeft(BitVecExpr t1, BitVecExpr t2)
Rotate Left. Remarks: Rotate bits oft1to the leftt2times. The arguments must have the same bit-vector sort.
-
mkBVRotateRight
public BitVecExpr mkBVRotateRight(BitVecExpr t1, BitVecExpr t2)
Rotate Right. Remarks: Rotate bits oft1to the rightt2times. The arguments must have the same bit-vector sort.
-
mkInt2BV
public BitVecExpr mkInt2BV(int n, IntExpr t)
Create annbit bit-vector from the integer argumentt. Remarks: NB. This function is essentially treated as uninterpreted. So you cannot expect Z3 to precisely reflect the semantics of this function when solving constraints with this function. The argument must be of integer sort.
-
mkBV2Int
public IntExpr mkBV2Int(BitVecExpr t, boolean signed)
Create an integer from the bit-vector argumentt. Remarks: If \c is_signed is false, then the bit-vector \c t1 is treated as unsigned. So the result is non-negative and in the range[0..2^N-1], where N are the number of bits int. If \c is_signed is true, \c t1 is treated as a signed bit-vector. NB. This function is essentially treated as uninterpreted. So you cannot expect Z3 to precisely reflect the semantics of this function when solving constraints with this function. The argument must be of bit-vector sort.
-
mkBVAddNoOverflow
public BoolExpr mkBVAddNoOverflow(BitVecExpr t1, BitVecExpr t2, boolean isSigned)
Create a predicate that checks that the bit-wise addition does not overflow. Remarks: The arguments must be of bit-vector sort.
-
mkBVAddNoUnderflow
public BoolExpr mkBVAddNoUnderflow(BitVecExpr t1, BitVecExpr t2)
Create a predicate that checks that the bit-wise addition does not underflow. Remarks: The arguments must be of bit-vector sort.
-
mkBVSubNoOverflow
public BoolExpr mkBVSubNoOverflow(BitVecExpr t1, BitVecExpr t2)
Create a predicate that checks that the bit-wise subtraction does not overflow. Remarks: The arguments must be of bit-vector sort.
-
mkBVSubNoUnderflow
public BoolExpr mkBVSubNoUnderflow(BitVecExpr t1, BitVecExpr t2, boolean isSigned)
Create a predicate that checks that the bit-wise subtraction does not underflow. Remarks: The arguments must be of bit-vector sort.
-
mkBVSDivNoOverflow
public BoolExpr mkBVSDivNoOverflow(BitVecExpr t1, BitVecExpr t2)
Create a predicate that checks that the bit-wise signed division does not overflow. Remarks: The arguments must be of bit-vector sort.
-
mkBVNegNoOverflow
public BoolExpr mkBVNegNoOverflow(BitVecExpr t)
Create a predicate that checks that the bit-wise negation does not overflow. Remarks: The arguments must be of bit-vector sort.
-
mkBVMulNoOverflow
public BoolExpr mkBVMulNoOverflow(BitVecExpr t1, BitVecExpr t2, boolean isSigned)
Create a predicate that checks that the bit-wise multiplication does not overflow. Remarks: The arguments must be of bit-vector sort.
-
mkBVMulNoUnderflow
public BoolExpr mkBVMulNoUnderflow(BitVecExpr t1, BitVecExpr t2)
Create a predicate that checks that the bit-wise multiplication does not underflow. Remarks: The arguments must be of bit-vector sort.
-
mkArrayConst
public ArrayExpr mkArrayConst(Symbol name, Sort domain, Sort range)
Create an array constant.
-
mkArrayConst
public ArrayExpr mkArrayConst(String name, Sort domain, Sort range)
Create an array constant.
-
mkSelect
public Expr mkSelect(ArrayExpr a, Expr i)
Array read. Remarks: The argumentais the array andiis the index of the array that gets read. The nodeamust have an array sort[domain -> range], andimust have the sortdomain. The sort of the result isrange.
-
mkSelect
public Expr mkSelect(ArrayExpr a, Expr[] args)
Array read. Remarks: The argumentais the array andargsare the indices of the array that gets read. The nodeamust have an array sort[domains -> range], andargsmust have the sortsdomains. The sort of the result isrange.
-
mkStore
public ArrayExpr mkStore(ArrayExpr a, Expr i, Expr v)
Array update. Remarks: The nodeamust have an array sort[domain -> range],imust have sortdomain,vmust have sort range. The sort of the result is[domain -> range]. The semantics of this function is given by the theory of arrays described in the SMT-LIB standard. See http://smtlib.org for more details. The result of this function is an array that is equal toa(with respect toselect) on all indices except fori, where it maps tov(and theselectofawith respect toimay be a different value).
-
mkStore
public ArrayExpr mkStore(ArrayExpr a, Expr[] args, Expr v)
Array update. Remarks: The nodeamust have an array sort[domains -> range],imust have sortdomain,vmust have sort range. The sort of the result is[domains -> range]. The semantics of this function is given by the theory of arrays described in the SMT-LIB standard. See http://smtlib.org for more details. The result of this function is an array that is equal toa(with respect toselect) on all indices except forargs, where it maps tov(and theselectofawith respect toargsmay be a different value).
-
mkConstArray
public ArrayExpr mkConstArray(Sort domain, Expr v)
Create a constant array. Remarks: The resulting term is an array, such that aselecton an arbitrary index produces the valuev.
-
mkMap
public ArrayExpr mkMap(FuncDecl f, ArrayExpr... args)
Maps f on the argument arrays. Remarks: Each element ofargsmust be of an array sort[domain_i -> range_i]. The function declarationfmust have typerange_1 .. range_n -> range.vmust have sort range. The sort of the result is[domain_i -> range].
-
mkTermArray
public Expr mkTermArray(ArrayExpr array)
Access the array default value. Remarks: Produces the default range value, for arrays that can be represented as finite maps with a default range value.
-
mkArrayExt
public Expr mkArrayExt(ArrayExpr arg1, ArrayExpr arg2)
Create Extentionality index. Two arrays are equal if and only if they are equal on the index returned by MkArrayExt.
-
mkSetIntersection
public ArrayExpr mkSetIntersection(ArrayExpr... args)
Take the intersection of a list of sets.
-
mkSetDifference
public ArrayExpr mkSetDifference(ArrayExpr arg1, ArrayExpr arg2)
Take the difference between two sets.
-
mkSetMembership
public BoolExpr mkSetMembership(Expr elem, ArrayExpr set)
Check for set membership.
-
mkSetSubset
public BoolExpr mkSetSubset(ArrayExpr arg1, ArrayExpr arg2)
Check for subsetness of sets.
-
mkContains
public BoolExpr mkContains(SeqExpr s1, SeqExpr s2)
Check for sequence containment of s2 in s1.
-
mkIndexOf
public IntExpr mkIndexOf(SeqExpr s, SeqExpr substr, ArithExpr offset)
Extract index of sub-string starting at offset.
-
mkReplace
public SeqExpr mkReplace(SeqExpr s, SeqExpr src, SeqExpr dst)
Replace the first occurrence of src by dst in s.
-
mkLoop
public ReExpr mkLoop(ReExpr re, int lo, int hi)
Take the lower and upper-bounded Kleene star of a regular expression.
-
mkLoop
public ReExpr mkLoop(ReExpr re, int lo)
Take the lower-bounded Kleene star of a regular expression.
-
mkPBLe
public BoolExpr mkPBLe(int[] coeffs, BoolExpr[] args, int k)
Create a pseudo-Boolean less-or-equal constraint.
-
mkPBGe
public BoolExpr mkPBGe(int[] coeffs, BoolExpr[] args, int k)
Create a pseudo-Boolean greater-or-equal constraint.
-
mkPBEq
public BoolExpr mkPBEq(int[] coeffs, BoolExpr[] args, int k)
Create a pseudo-Boolean equal constraint.
-
mkNumeral
public Expr mkNumeral(String v, Sort ty)
Create a Term of a given sort.- Parameters:
v- A string representing the term value in decimal notation. If the given sort is a real, then the Term can be a rational, that is, a string of the form[num]* / [num]*.ty- The sort of the numeral. In the current implementation, the given sort can be an int, real, or bit-vectors of arbitrary size.- Returns:
- A Term with value
vand sortty
-
mkNumeral
public Expr mkNumeral(int v, Sort ty)
Create a Term of a given sort. This function can be used to create numerals that fit in a machine integer. It is slightly faster thanMakeNumeralsince it is not necessary to parse a string.- Parameters:
v- Value of the numeralty- Sort of the numeral- Returns:
- A Term with value
vand typety
-
mkNumeral
public Expr mkNumeral(long v, Sort ty)
Create a Term of a given sort. This function can be used to create numerals that fit in a machine integer. It is slightly faster thanMakeNumeralsince it is not necessary to parse a string.- Parameters:
v- Value of the numeralty- Sort of the numeral- Returns:
- A Term with value
vand typety
-
mkReal
public RatNum mkReal(int num, int den)
Create a real from a fraction.- Parameters:
num- numerator of rational.den- denominator of rational.- Returns:
- A Term with value
num/denand sort Real - See Also:
mkNumeral(String,Sort)
-
mkReal
public RatNum mkReal(String v)
Create a real numeral.- Parameters:
v- A string representing the Term value in decimal notation.- Returns:
- A Term with value
vand sort Real
-
mkReal
public RatNum mkReal(int v)
Create a real numeral.- Parameters:
v- value of the numeral.- Returns:
- A Term with value
vand sort Real
-
mkReal
public RatNum mkReal(long v)
Create a real numeral.- Parameters:
v- value of the numeral.- Returns:
- A Term with value
vand sort Real
-
mkInt
public IntNum mkInt(String v)
Create an integer numeral.- Parameters:
v- A string representing the Term value in decimal notation.
-
mkInt
public IntNum mkInt(int v)
Create an integer numeral.- Parameters:
v- value of the numeral.- Returns:
- A Term with value
vand sort Integer
-
mkInt
public IntNum mkInt(long v)
Create an integer numeral.- Parameters:
v- value of the numeral.- Returns:
- A Term with value
vand sort Integer
-
mkBV
public BitVecNum mkBV(String v, int size)
Create a bit-vector numeral.- Parameters:
v- A string representing the value in decimal notation.size- the size of the bit-vector
-
mkBV
public BitVecNum mkBV(int v, int size)
Create a bit-vector numeral.- Parameters:
v- value of the numeral.size- the size of the bit-vector
-
mkBV
public BitVecNum mkBV(long v, int size)
Create a bit-vector numeral.- Parameters:
v- value of the numeral. *size- the size of the bit-vector
-
mkForall
public Quantifier mkForall(Sort[] sorts, Symbol[] names, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)
Create a universal Quantifier.- Parameters:
sorts- the sorts of the bound variables.names- names of the bound variablesbody- the body of the quantifier.weight- quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. By default, pass the weight 0.patterns- array containing the patterns created usingMkPattern.noPatterns- array containing the anti-patterns created usingMkPattern.quantifierID- optional symbol to track quantifier.skolemID- optional symbol to track skolem constants.- Returns:
- Creates a forall formula, where
weightis the weight,patternsis an array of patterns,sortsis an array with the sorts of the bound variables,namesis an array with the 'names' of the bound variables, andbodyis the body of the quantifier. Quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. Note that the bound variables are de-Bruijn indices created usingmkBound(int, com.microsoft.z3.Sort). Z3 applies the convention that the last element innamesandsortsrefers to the variable with index 0, the second to last element ofnamesandsortsrefers to the variable with index 1, etc.
-
mkForall
public Quantifier mkForall(Expr[] boundConstants, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)
Creates a universal quantifier using a list of constants that will form the set of bound variables.
-
mkExists
public Quantifier mkExists(Sort[] sorts, Symbol[] names, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)
Creates an existential quantifier using de-Bruijn indexed variables.
-
mkExists
public Quantifier mkExists(Expr[] boundConstants, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)
Creates an existential quantifier using a list of constants that will form the set of bound variables.
-
mkQuantifier
public Quantifier mkQuantifier(boolean universal, Sort[] sorts, Symbol[] names, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)
Create a Quantifier.
-
mkQuantifier
public Quantifier mkQuantifier(boolean universal, Expr[] boundConstants, Expr body, int weight, Pattern[] patterns, Expr[] noPatterns, Symbol quantifierID, Symbol skolemID)
Create a Quantifier
-
mkLambda
public Lambda mkLambda(Sort[] sorts, Symbol[] names, Expr body)
Create a lambda expression.sortsis an array with the sorts of the bound variables,namesis an array with the 'names' of the bound variables, andbodyis the body of the lambda. Note that the bound variables are de-Bruijn indices created usingmkBound(int, com.microsoft.z3.Sort)Z3 applies the convention that the last element innamesandsortsrefers to the variable with index 0, the second to last element ofnamesandsortsrefers to the variable with index 1, etc.- Parameters:
sorts- the sorts of the bound variables.names- names of the bound variables.body- the body of the quantifier.
-
mkLambda
public Lambda mkLambda(Expr[] boundConstants, Expr body)
Create a lambda expression. Creates a lambda expression using a list of constants that will form the set of bound variables.
-
setPrintMode
public void setPrintMode(Z3_ast_print_mode value)
Selects the format used for pretty-printing expressions. Remarks: The default mode for pretty printing expressions is to produce SMT-LIB style output where common subexpressions are printed at each occurrence. The mode is called Z3_PRINT_SMTLIB_FULL. To print shared common subexpressions only once, use the Z3_PRINT_LOW_LEVEL mode. To print in way that conforms to SMT-LIB standards and uses let expressions to share common sub-expressions use Z3_PRINT_SMTLIB_COMPLIANT.
-
benchmarkToSMTString
public String benchmarkToSMTString(String name, String logic, String status, String attributes, BoolExpr[] assumptions, BoolExpr formula)
Convert a benchmark into an SMT-LIB formatted string.- Parameters:
name- Name of the benchmark. The argument is optional.logic- The benchmark logic.status- The status string (sat, unsat, or unknown)attributes- Other attributes, such as source, difficulty or category.assumptions- Auxiliary assumptions.formula- Formula to be checked for consistency in conjunction with assumptions.- Returns:
- A string representation of the benchmark.
-
parseSMTLIB2String
public BoolExpr[] parseSMTLIB2String(String str, Symbol[] sortNames, Sort[] sorts, Symbol[] declNames, FuncDecl[] decls)
Parse the given string using the SMT-LIB2 parser.- Returns:
- A conjunction of assertions. If the string contains push/pop commands, the set of assertions returned are the ones in the last scope level.
-
parseSMTLIB2File
public BoolExpr[] parseSMTLIB2File(String fileName, Symbol[] sortNames, Sort[] sorts, Symbol[] declNames, FuncDecl[] decls)
Parse the given file using the SMT-LIB2 parser.
-
mkGoal
public Goal mkGoal(boolean models, boolean unsatCores, boolean proofs)
Creates a new Goal. Remarks: Note that the Context must have been created with proof generation support ifproofsis set to true here.- Parameters:
models- Indicates whether model generation should be enabled.unsatCores- Indicates whether unsat core generation should be enabled.proofs- Indicates whether proof generation should be enabled.
-
mkParams
public Params mkParams()
Creates a new ParameterSet.
-
getNumTactics
public int getNumTactics()
The number of supported tactics.
-
getTacticNames
public String[] getTacticNames()
The names of all supported tactics.
-
getTacticDescription
public String getTacticDescription(String name)
Returns a string containing a description of the tactic with the given name.
-
andThen
public Tactic andThen(Tactic t1, Tactic t2, Tactic... ts)
Create a tactic that appliest1to a Goal and thent2to every subgoal produced byt1
-
then
public Tactic then(Tactic t1, Tactic t2, Tactic... ts)
Create a tactic that appliest1to a Goal and thent2to every subgoal produced byt1Remarks: Shorthand forAndThen.
-
orElse
public Tactic orElse(Tactic t1, Tactic t2)
Create a tactic that first appliest1to a Goal and if it fails then returns the result oft2applied to the Goal.
-
tryFor
public Tactic tryFor(Tactic t, int ms)
Create a tactic that appliestto a goal formsmilliseconds. Remarks: Iftdoes not terminate withinmsmilliseconds, then it fails.
-
when
public Tactic when(Probe p, Tactic t)
Create a tactic that appliestto a given goal if the probepevaluates to true. Remarks: Ifpevaluates to false, then the new tactic behaves like theskiptactic.
-
cond
public Tactic cond(Probe p, Tactic t1, Tactic t2)
Create a tactic that appliest1to a given goal if the probepevaluates to true andt2otherwise.
-
repeat
public Tactic repeat(Tactic t, int max)
Create a tactic that keeps applyingtuntil the goal is not modified anymore or the maximum number of iterationsmaxis reached.
-
skip
public Tactic skip()
Create a tactic that just returns the given goal.
-
fail
public Tactic fail()
Create a tactic always fails.
-
failIfNotDecided
public Tactic failIfNotDecided()
Create a tactic that fails if the goal is not trivially satisfiable (i.e., empty) or trivially unsatisfiable (i.e., contains `false').
-
usingParams
public Tactic usingParams(Tactic t, Params p)
Create a tactic that appliestusing the given set of parametersp.
-
with
public Tactic with(Tactic t, Params p)
Create a tactic that appliestusing the given set of parametersp. Remarks: Alias forUsingParams
-
parOr
public Tactic parOr(Tactic... t)
Create a tactic that applies the given tactics in parallel until one of them succeeds (i.e., the first that doesn't fail).
-
parAndThen
public Tactic parAndThen(Tactic t1, Tactic t2)
Create a tactic that appliest1to a given goal and thent2to every subgoal produced byt1. The subgoals are processed in parallel.
-
interrupt
public void interrupt()
Interrupt the execution of a Z3 procedure. Remarks: This procedure can be used to interrupt: solvers, simplifiers and tactics.
-
getNumProbes
public int getNumProbes()
The number of supported Probes.
-
getProbeNames
public String[] getProbeNames()
The names of all supported Probes.
-
getProbeDescription
public String getProbeDescription(String name)
Returns a string containing a description of the probe with the given name.
-
constProbe
public Probe constProbe(double val)
Create a probe that always evaluates toval.
-
lt
public Probe lt(Probe p1, Probe p2)
Create a probe that evaluates totruewhen the value returned byp1is less than the value returned byp2
-
gt
public Probe gt(Probe p1, Probe p2)
Create a probe that evaluates totruewhen the value returned byp1is greater than the value returned byp2
-
le
public Probe le(Probe p1, Probe p2)
Create a probe that evaluates totruewhen the value returned byp1is less than or equal the value returned byp2
-
ge
public Probe ge(Probe p1, Probe p2)
Create a probe that evaluates totruewhen the value returned byp1is greater than or equal the value returned byp2
-
eq
public Probe eq(Probe p1, Probe p2)
Create a probe that evaluates totruewhen the value returned byp1is equal to the value returned byp2
-
and
public Probe and(Probe p1, Probe p2)
Create a probe that evaluates totruewhen the valuep1andp2evaluate totrue.
-
or
public Probe or(Probe p1, Probe p2)
Create a probe that evaluates totruewhen the valuep1orp2evaluate totrue.
-
not
public Probe not(Probe p)
Create a probe that evaluates totruewhen the valuepdoes not evaluate totrue.
-
mkSolver
public Solver mkSolver()
Creates a new (incremental) solver. Remarks: This solver also uses a set of builtin tactics for handling the first check-sat command, and check-sat commands that take more than a given number of milliseconds to be solved.
-
mkSolver
public Solver mkSolver(Symbol logic)
Creates a new (incremental) solver. Remarks: This solver also uses a set of builtin tactics for handling the first check-sat command, and check-sat commands that take more than a given number of milliseconds to be solved.
-
mkSolver
public Solver mkSolver(String logic)
Creates a new (incremental) solver.- See Also:
mkSolver(Symbol)
-
mkSimpleSolver
public Solver mkSimpleSolver()
Creates a new (incremental) solver.
-
mkSolver
public Solver mkSolver(Tactic t)
Creates a solver that is implemented using the given tactic. Remarks: The solver supports the commandsPushandPop, but it will always solve each check from scratch.
-
mkFixedpoint
public Fixedpoint mkFixedpoint()
Create a Fixedpoint context.
-
mkOptimize
public Optimize mkOptimize()
Create a Optimize context.
-
mkFPRoundingModeSort
public FPRMSort mkFPRoundingModeSort()
Create the floating-point RoundingMode sort.- Throws:
Z3Exception
-
mkFPRoundNearestTiesToEven
public FPRMExpr mkFPRoundNearestTiesToEven()
Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.- Throws:
Z3Exception
-
mkFPRNE
public FPRMNum mkFPRNE()
Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.- Throws:
Z3Exception
-
mkFPRoundNearestTiesToAway
public FPRMNum mkFPRoundNearestTiesToAway()
Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.- Throws:
Z3Exception
-
mkFPRNA
public FPRMNum mkFPRNA()
Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.- Throws:
Z3Exception
-
mkFPRoundTowardPositive
public FPRMNum mkFPRoundTowardPositive()
Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode.- Throws:
Z3Exception
-
mkFPRTP
public FPRMNum mkFPRTP()
Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode.- Throws:
Z3Exception
-
mkFPRoundTowardNegative
public FPRMNum mkFPRoundTowardNegative()
Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode.- Throws:
Z3Exception
-
mkFPRTN
public FPRMNum mkFPRTN()
Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode.- Throws:
Z3Exception
-
mkFPRoundTowardZero
public FPRMNum mkFPRoundTowardZero()
Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode.- Throws:
Z3Exception
-
mkFPRTZ
public FPRMNum mkFPRTZ()
Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode.- Throws:
Z3Exception
-
mkFPSort
public FPSort mkFPSort(int ebits, int sbits)
Create a FloatingPoint sort.- Parameters:
ebits- exponent bits in the FloatingPoint sort.sbits- significand bits in the FloatingPoint sort.- Throws:
Z3Exception
-
mkFPSortHalf
public FPSort mkFPSortHalf()
Create the half-precision (16-bit) FloatingPoint sort.- Throws:
Z3Exception
-
mkFPSort16
public FPSort mkFPSort16()
Create the half-precision (16-bit) FloatingPoint sort.- Throws:
Z3Exception
-
mkFPSortSingle
public FPSort mkFPSortSingle()
Create the single-precision (32-bit) FloatingPoint sort.- Throws:
Z3Exception
-
mkFPSort32
public FPSort mkFPSort32()
Create the single-precision (32-bit) FloatingPoint sort.- Throws:
Z3Exception
-
mkFPSortDouble
public FPSort mkFPSortDouble()
Create the double-precision (64-bit) FloatingPoint sort.- Throws:
Z3Exception
-
mkFPSort64
public FPSort mkFPSort64()
Create the double-precision (64-bit) FloatingPoint sort.- Throws:
Z3Exception
-
mkFPSortQuadruple
public FPSort mkFPSortQuadruple()
Create the quadruple-precision (128-bit) FloatingPoint sort.- Throws:
Z3Exception
-
mkFPSort128
public FPSort mkFPSort128()
Create the quadruple-precision (128-bit) FloatingPoint sort.- Throws:
Z3Exception
-
mkFPNaN
public FPNum mkFPNaN(FPSort s)
Create a NaN of sort s.- Parameters:
s- FloatingPoint sort.- Throws:
Z3Exception
-
mkFPInf
public FPNum mkFPInf(FPSort s, boolean negative)
Create a floating-point infinity of sort s.- Parameters:
s- FloatingPoint sort.negative- indicates whether the result should be negative.- Throws:
Z3Exception
-
mkFPZero
public FPNum mkFPZero(FPSort s, boolean negative)
Create a floating-point zero of sort s.- Parameters:
s- FloatingPoint sort.negative- indicates whether the result should be negative.- Throws:
Z3Exception
-
mkFPNumeral
public FPNum mkFPNumeral(float v, FPSort s)
Create a numeral of FloatingPoint sort from a float.- Parameters:
v- numeral value.s- FloatingPoint sort.- Throws:
Z3Exception
-
mkFPNumeral
public FPNum mkFPNumeral(double v, FPSort s)
Create a numeral of FloatingPoint sort from a double.- Parameters:
v- numeral value.s- FloatingPoint sort.- Throws:
Z3Exception
-
mkFPNumeral
public FPNum mkFPNumeral(int v, FPSort s)
Create a numeral of FloatingPoint sort from an int.- Parameters:
v- numeral value.s- FloatingPoint sort.- Throws:
Z3Exception
-
mkFPNumeral
public FPNum mkFPNumeral(boolean sgn, int exp, int sig, FPSort s)
Create a numeral of FloatingPoint sort from a sign bit and two integers.- Parameters:
sgn- the sign.exp- the exponent.sig- the significand.s- FloatingPoint sort.- Throws:
Z3Exception
-
mkFPNumeral
public FPNum mkFPNumeral(boolean sgn, long exp, long sig, FPSort s)
Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.- Parameters:
sgn- the sign.exp- the exponent.sig- the significand.s- FloatingPoint sort.- Throws:
Z3Exception
-
mkFP
public FPNum mkFP(float v, FPSort s)
Create a numeral of FloatingPoint sort from a float.- Parameters:
v- numeral value.s- FloatingPoint sort.- Throws:
Z3Exception
-
mkFP
public FPNum mkFP(double v, FPSort s)
Create a numeral of FloatingPoint sort from a double.- Parameters:
v- numeral value.s- FloatingPoint sort.- Throws:
Z3Exception
-
mkFP
public FPNum mkFP(int v, FPSort s)
Create a numeral of FloatingPoint sort from an int.- Parameters:
v- numeral value.s- FloatingPoint sort.- Throws:
Z3Exception
-
mkFP
public FPNum mkFP(boolean sgn, int exp, int sig, FPSort s)
Create a numeral of FloatingPoint sort from a sign bit and two integers.- Parameters:
sgn- the sign.exp- the exponent.sig- the significand.s- FloatingPoint sort.- Throws:
Z3Exception
-
mkFP
public FPNum mkFP(boolean sgn, long exp, long sig, FPSort s)
Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.- Parameters:
sgn- the sign.exp- the exponent.sig- the significand.s- FloatingPoint sort.- Throws:
Z3Exception
-
mkFPAbs
public FPExpr mkFPAbs(FPExpr t)
Floating-point absolute value- Parameters:
t- floating-point term- Throws:
Z3Exception
-
mkFPNeg
public FPExpr mkFPNeg(FPExpr t)
Floating-point negation- Parameters:
t- floating-point term- Throws:
Z3Exception
-
mkFPAdd
public FPExpr mkFPAdd(FPRMExpr rm, FPExpr t1, FPExpr t2)
Floating-point addition- Parameters:
rm- rounding mode termt1- floating-point termt2- floating-point term- Throws:
Z3Exception
-
mkFPSub
public FPExpr mkFPSub(FPRMExpr rm, FPExpr t1, FPExpr t2)
Floating-point subtraction- Parameters:
rm- rounding mode termt1- floating-point termt2- floating-point term- Throws:
Z3Exception
-
mkFPMul
public FPExpr mkFPMul(FPRMExpr rm, FPExpr t1, FPExpr t2)
Floating-point multiplication- Parameters:
rm- rounding mode termt1- floating-point termt2- floating-point term- Throws:
Z3Exception
-
mkFPDiv
public FPExpr mkFPDiv(FPRMExpr rm, FPExpr t1, FPExpr t2)
Floating-point division- Parameters:
rm- rounding mode termt1- floating-point termt2- floating-point term- Throws:
Z3Exception
-
mkFPFMA
public FPExpr mkFPFMA(FPRMExpr rm, FPExpr t1, FPExpr t2, FPExpr t3)
Floating-point fused multiply-add- Parameters:
rm- rounding mode termt1- floating-point termt2- floating-point termt3- floating-point term Remarks: The result is round((t1 * t2) + t3)- Throws:
Z3Exception
-
mkFPSqrt
public FPExpr mkFPSqrt(FPRMExpr rm, FPExpr t)
Floating-point square root- Parameters:
rm- rounding mode termt- floating-point term- Throws:
Z3Exception
-
mkFPRem
public FPExpr mkFPRem(FPExpr t1, FPExpr t2)
Floating-point remainder- Parameters:
t1- floating-point termt2- floating-point term- Throws:
Z3Exception
-
mkFPRoundToIntegral
public FPExpr mkFPRoundToIntegral(FPRMExpr rm, FPExpr t)
Floating-point roundToIntegral. Rounds a floating-point number to the closest integer, again represented as a floating-point number.- Parameters:
rm- term of RoundingMode sortt- floating-point term- Throws:
Z3Exception
-
mkFPMin
public FPExpr mkFPMin(FPExpr t1, FPExpr t2)
Minimum of floating-point numbers.- Parameters:
t1- floating-point termt2- floating-point term- Throws:
Z3Exception
-
mkFPMax
public FPExpr mkFPMax(FPExpr t1, FPExpr t2)
Maximum of floating-point numbers.- Parameters:
t1- floating-point termt2- floating-point term- Throws:
Z3Exception
-
mkFPLEq
public BoolExpr mkFPLEq(FPExpr t1, FPExpr t2)
Floating-point less than or equal.- Parameters:
t1- floating-point termt2- floating-point term- Throws:
Z3Exception
-
mkFPLt
public BoolExpr mkFPLt(FPExpr t1, FPExpr t2)
Floating-point less than.- Parameters:
t1- floating-point termt2- floating-point term- Throws:
Z3Exception
-
mkFPGEq
public BoolExpr mkFPGEq(FPExpr t1, FPExpr t2)
Floating-point greater than or equal.- Parameters:
t1- floating-point termt2- floating-point term- Throws:
Z3Exception
-
mkFPGt
public BoolExpr mkFPGt(FPExpr t1, FPExpr t2)
Floating-point greater than.- Parameters:
t1- floating-point termt2- floating-point term- Throws:
Z3Exception
-
mkFPEq
public BoolExpr mkFPEq(FPExpr t1, FPExpr t2)
Floating-point equality.- Parameters:
t1- floating-point termt2- floating-point term Remarks: Note that this is IEEE 754 equality (as opposed to standard =).- Throws:
Z3Exception
-
mkFPIsNormal
public BoolExpr mkFPIsNormal(FPExpr t)
Predicate indicating whether t is a normal floating-point number.\- Parameters:
t- floating-point term- Throws:
Z3Exception
-
mkFPIsSubnormal
public BoolExpr mkFPIsSubnormal(FPExpr t)
Predicate indicating whether t is a subnormal floating-point number.\- Parameters:
t- floating-point term- Throws:
Z3Exception
-
mkFPIsZero
public BoolExpr mkFPIsZero(FPExpr t)
Predicate indicating whether t is a floating-point number with zero value, i.e., +0 or -0.- Parameters:
t- floating-point term- Throws:
Z3Exception
-
mkFPIsInfinite
public BoolExpr mkFPIsInfinite(FPExpr t)
Predicate indicating whether t is a floating-point number representing +oo or -oo.- Parameters:
t- floating-point term- Throws:
Z3Exception
-
mkFPIsNaN
public BoolExpr mkFPIsNaN(FPExpr t)
Predicate indicating whether t is a NaN.- Parameters:
t- floating-point term- Throws:
Z3Exception
-
mkFPIsNegative
public BoolExpr mkFPIsNegative(FPExpr t)
Predicate indicating whether t is a negative floating-point number.- Parameters:
t- floating-point term- Throws:
Z3Exception
-
mkFPIsPositive
public BoolExpr mkFPIsPositive(FPExpr t)
Predicate indicating whether t is a positive floating-point number.- Parameters:
t- floating-point term- Throws:
Z3Exception
-
mkFP
public FPExpr mkFP(BitVecExpr sgn, BitVecExpr sig, BitVecExpr exp)
Create an expression of FloatingPoint sort from three bit-vector expressions.- Parameters:
sgn- bit-vector term (of size 1) representing the sign.sig- bit-vector term representing the significand.exp- bit-vector term representing the exponent. Remarks: This is the operator named `fp' in the SMT FP theory definition. Note that sgn is required to be a bit-vector of size 1. Significand and exponent are required to be greater than 1 and 2 respectively. The FloatingPoint sort of the resulting expression is automatically determined from the bit-vector sizes of the arguments.- Throws:
Z3Exception
-
mkFPToFP
public FPExpr mkFPToFP(BitVecExpr bv, FPSort s)
Conversion of a single IEEE 754-2008 bit-vector into a floating-point number.- Parameters:
bv- bit-vector value (of size m).s- FloatingPoint sort (ebits+sbits == m) Remarks: Produces a term that represents the conversion of a bit-vector term bv to a floating-point term of sort s. The bit-vector size of bv (m) must be equal to ebits+sbits of s. The format of the bit-vector is as defined by the IEEE 754-2008 interchange format.- Throws:
Z3Exception
-
mkFPToFP
public FPExpr mkFPToFP(FPRMExpr rm, FPExpr t, FPSort s)
Conversion of a FloatingPoint term into another term of different FloatingPoint sort.- Parameters:
rm- RoundingMode term.t- FloatingPoint term.s- FloatingPoint sort. Remarks: Produces a term that represents the conversion of a floating-point term t to a floating-point term of sort s. If necessary, the result will be rounded according to rounding mode rm.- Throws:
Z3Exception
-
mkFPToFP
public FPExpr mkFPToFP(FPRMExpr rm, RealExpr t, FPSort s)
Conversion of a term of real sort into a term of FloatingPoint sort.- Parameters:
rm- RoundingMode term.t- term of Real sort.s- FloatingPoint sort. Remarks: Produces a term that represents the conversion of term t of real sort into a floating-point term of sort s. If necessary, the result will be rounded according to rounding mode rm.- Throws:
Z3Exception
-
mkFPToFP
public FPExpr mkFPToFP(FPRMExpr rm, BitVecExpr t, FPSort s, boolean signed)
Conversion of a 2's complement signed bit-vector term into a term of FloatingPoint sort.- Parameters:
rm- RoundingMode term.t- term of bit-vector sort.s- FloatingPoint sort.signed- flag indicating whether t is interpreted as signed or unsigned bit-vector. Remarks: Produces a term that represents the conversion of the bit-vector term t into a floating-point term of sort s. The bit-vector t is taken to be in signed 2's complement format (when signed==true, otherwise unsigned). If necessary, the result will be rounded according to rounding mode rm.- Throws:
Z3Exception
-
mkFPToFP
public FPExpr mkFPToFP(FPSort s, FPRMExpr rm, FPExpr t)
Conversion of a floating-point number to another FloatingPoint sort s.- Parameters:
s- FloatingPoint sortrm- floating-point rounding mode termt- floating-point term Remarks: Produces a term that represents the conversion of a floating-point term t to a different FloatingPoint sort s. If necessary, rounding according to rm is applied.- Throws:
Z3Exception
-
mkFPToBV
public BitVecExpr mkFPToBV(FPRMExpr rm, FPExpr t, int sz, boolean signed)
Conversion of a floating-point term into a bit-vector.- Parameters:
rm- RoundingMode term.t- FloatingPoint termsz- Size of the resulting bit-vector.signed- Indicates whether the result is a signed or unsigned bit-vector. Remarks: Produces a term that represents the conversion of the floating-point term t into a bit-vector term of size sz in 2's complement format (signed when signed==true). If necessary, the result will be rounded according to rounding mode rm.- Throws:
Z3Exception
-
mkFPToReal
public RealExpr mkFPToReal(FPExpr t)
Conversion of a floating-point term into a real-numbered term.- Parameters:
t- FloatingPoint term Remarks: Produces a term that represents the conversion of the floating-point term t into a real number. Note that this type of conversion will often result in non-linear constraints over real terms.- Throws:
Z3Exception
-
mkFPToIEEEBV
public BitVecExpr mkFPToIEEEBV(FPExpr t)
Conversion of a floating-point term into a bit-vector term in IEEE 754-2008 format.- Parameters:
t- FloatingPoint term. Remarks: The size of the resulting bit-vector is automatically determined. Note that IEEE 754-2008 allows multiple different representations of NaN. This conversion knows only one NaN and it will always produce the same bit-vector representation of that NaN.- Throws:
Z3Exception
-
mkFPToFP
public BitVecExpr mkFPToFP(FPRMExpr rm, IntExpr exp, RealExpr sig, FPSort s)
Conversion of a real-sorted significand and an integer-sorted exponent into a term of FloatingPoint sort.- Parameters:
rm- RoundingMode term.exp- Exponent term of Int sort.sig- Significand term of Real sort.s- FloatingPoint sort. Remarks: Produces a term that represents the conversion of sig * 2^exp into a floating-point term of sort s. If necessary, the result will be rounded according to rounding mode rm.- Throws:
Z3Exception
-
wrapAST
public AST wrapAST(long nativeObject)
Wraps an AST. Remarks: This function is used for transitions between native and managed objects. Note thatnativeObjectmust be a native object obtained from Z3 (e.g., throughUnwrapAST) and that it must have a correct reference count.- Parameters:
nativeObject- The native pointer to wrap.- See Also:
Native.incRef(long, long),unwrapAST(com.microsoft.z3.AST)
-
unwrapAST
public long unwrapAST(AST a)
Unwraps an AST. Remarks: This function is used for transitions between native and managed objects. It returns the native pointer to the AST. Note that AST objects are reference counted and unwrapping an AST disables automatic reference counting, i.e., all references to the IntPtr that is returned must be handled externally and through native calls (see e.g.,- Parameters:
a- The AST to unwrap.- See Also:
Native.incRef(long, long),wrapAST(long)
-
SimplifyHelp
public String SimplifyHelp()
Return a string describing all available parameters toExpr.Simplify.
-
getSimplifyParameterDescriptions
public ParamDescrs getSimplifyParameterDescriptions()
Retrieves parameter descriptions for simplifier.
-
updateParamValue
public void updateParamValue(String id, String value)
Update a mutable configuration parameter. Remarks: The list of all configuration parameters can be obtained using the Z3 executable:z3.exe -ini?Only a few configuration parameters are mutable once the context is created. An exception is thrown when trying to modify an immutable parameter.
-
nCtx
public long nCtx()
-
getConstructorDRQ
public IDecRefQueue<Constructor> getConstructorDRQ()
-
getConstructorListDRQ
public IDecRefQueue<ConstructorList> getConstructorListDRQ()
-
getASTDRQ
public IDecRefQueue<AST> getASTDRQ()
-
getASTMapDRQ
public IDecRefQueue<com.microsoft.z3.ASTMap> getASTMapDRQ()
-
getASTVectorDRQ
public IDecRefQueue<ASTVector> getASTVectorDRQ()
-
getApplyResultDRQ
public IDecRefQueue<ApplyResult> getApplyResultDRQ()
-
getFuncEntryDRQ
public IDecRefQueue<FuncInterp.Entry> getFuncEntryDRQ()
-
getFuncInterpDRQ
public IDecRefQueue<FuncInterp> getFuncInterpDRQ()
-
getGoalDRQ
public IDecRefQueue<Goal> getGoalDRQ()
-
getModelDRQ
public IDecRefQueue<Model> getModelDRQ()
-
getParamsDRQ
public IDecRefQueue<Params> getParamsDRQ()
-
getParamDescrsDRQ
public IDecRefQueue<ParamDescrs> getParamDescrsDRQ()
-
getProbeDRQ
public IDecRefQueue<Probe> getProbeDRQ()
-
getSolverDRQ
public IDecRefQueue<Solver> getSolverDRQ()
-
getStatisticsDRQ
public IDecRefQueue<Statistics> getStatisticsDRQ()
-
getTacticDRQ
public IDecRefQueue<Tactic> getTacticDRQ()
-
getFixedpointDRQ
public IDecRefQueue<Fixedpoint> getFixedpointDRQ()
-
getOptimizeDRQ
public IDecRefQueue<Optimize> getOptimizeDRQ()
-
close
public void close()
Disposes of the context.- Specified by:
closein interfaceAutoCloseable
-
-