Z3
 
Loading...
Searching...
No Matches
Public Member Functions | Properties
Context Class Reference

The main interaction with Z3 happens via the Context. More...

+ Inheritance diagram for Context:

Public Member Functions

 Context ()
 Constructor.
 
 Context (Dictionary< string, string > settings)
 Constructor.
 
IntSymbol MkSymbol (int i)
 Creates a new symbol using an integer.
 
StringSymbol MkSymbol (string name)
 Create a symbol using a string.
 
BoolSort MkBoolSort ()
 Create a new Boolean sort.
 
UninterpretedSort MkUninterpretedSort (Symbol s)
 Create a new uninterpreted sort.
 
UninterpretedSort MkUninterpretedSort (string str)
 Create a new uninterpreted sort.
 
IntSort MkIntSort ()
 Create a new integer sort.
 
RealSort MkRealSort ()
 Create a real sort.
 
ComplexSort MkComplexSort ()
 Creates the Complex sort.
 
BitVecSort MkBitVecSort (uint size)
 Create a new bit-vector sort.
 
SeqSort MkSeqSort (Sort s)
 Create a new sequence sort.
 
ReSort MkReSort (SeqSort s)
 Create a new regular expression sort.
 
ArraySort MkArraySort (Sort domain, Sort range)
 Create a new array sort.
 
ArraySort MkArraySort (Sort[] domain, Sort range)
 Create a new n-ary array sort.
 
TupleSort MkTupleSort (Symbol name, Symbol[] fieldNames, Sort[] fieldSorts)
 Create a new tuple sort.
 
EnumSort MkEnumSort (Symbol name, params Symbol[] enumNames)
 Create a new enumeration sort.
 
EnumSort MkEnumSort (string name, params string[] enumNames)
 Create a new enumeration sort.
 
ListSort MkListSort (Symbol name, Sort elemSort)
 Create a new list sort.
 
ListSort MkListSort (string name, Sort elemSort)
 Create a new list sort.
 
FiniteDomainSort MkFiniteDomainSort (Symbol name, ulong size)
 Create a new finite domain sort.

Returns
The result is a sort

 
FiniteDomainSort MkFiniteDomainSort (string name, ulong size)
 Create a new finite domain sort.

Returns
The result is a sort

Elements of the sort are created using

See also
MkNumeral(ulong, Sort)

, and the elements range from 0 to size-1.

 
Constructor MkConstructor (Symbol name, Symbol recognizer, Symbol[] fieldNames=null, Sort[] sorts=null, uint[] sortRefs=null)
 Create a datatype constructor.
 
Constructor MkConstructor (string name, string recognizer, string[] fieldNames=null, Sort[] sorts=null, uint[] sortRefs=null)
 Create a datatype constructor.
 
DatatypeSort MkDatatypeSort (Symbol name, Constructor[] constructors)
 Create a new datatype sort.
 
DatatypeSort MkDatatypeSort (string name, Constructor[] constructors)
 Create a new datatype sort.
 
DatatypeSort MkDatatypeSortRef (Symbol name, Sort[] parameters=null)
 Create a forward reference to a datatype sort. This is useful for creating recursive datatypes or parametric datatypes.
 
DatatypeSort MkDatatypeSortRef (string name, Sort[] parameters=null)
 Create a forward reference to a datatype sort. This is useful for creating recursive datatypes or parametric datatypes.
 
DatatypeSort[] MkDatatypeSorts (Symbol[] names, Constructor[][] c)
 Create mutually recursive datatypes.
 
DatatypeSort[] MkDatatypeSorts (string[] names, Constructor[][] c)
 Create mutually recursive data-types.
 
Sort MkTypeVariable (Symbol name)
 Create a type variable sort for use as a parameter in polymorphic datatypes.
 
Sort MkTypeVariable (string name)
 Create a type variable sort for use as a parameter in polymorphic datatypes.
 
DatatypeSort MkPolymorphicDatatypeSort (Symbol name, Sort[] typeParams, Constructor[] constructors)
 Create a polymorphic datatype sort with explicit type parameters. Type parameters should be sorts created with MkTypeVariable(string).
 
DatatypeSort MkPolymorphicDatatypeSort (string name, Sort[] typeParams, Constructor[] constructors)
 Create a polymorphic datatype sort with explicit type parameters. Type parameters should be sorts created with MkTypeVariable(string).
 
Expr MkUpdateField (FuncDecl field, Expr t, Expr v)
 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.
 
FuncDecl MkFuncDecl (Symbol name, Sort[] domain, Sort range)
 Creates a new function declaration.
 
FuncDecl MkFuncDecl (Symbol name, Sort domain, Sort range)
 Creates a new function declaration.
 
FuncDecl MkFuncDecl (string name, Sort[] domain, Sort range)
 Creates a new function declaration.
 
FuncDecl MkRecFuncDecl (string name, Sort[] domain, Sort range)
 Creates a new recursive function declaration.
 
void AddRecDef (FuncDecl f, Expr[] args, Expr body)
 Bind a definition to a recursive function declaration. The function must have previously been created using MkRecFuncDecl. The body may contain recursive uses of the function or other mutually recursive functions.
 
FuncDecl MkFuncDecl (string name, Sort domain, Sort range)
 Creates a new function declaration.
 
FuncDecl MkFreshFuncDecl (string prefix, Sort[] domain, Sort range)
 Creates a fresh function declaration with a name prefixed with prefix .
 
FuncDecl MkConstDecl (Symbol name, Sort range)
 Creates a new constant function declaration.
 
FuncDecl MkConstDecl (string name, Sort range)
 Creates a new constant function declaration.
 
FuncDecl MkFreshConstDecl (string prefix, Sort range)
 Creates a fresh constant function declaration with a name prefixed with prefix .
 
FuncDecl MkUserPropagatorFuncDecl (string name, Sort[] domain, Sort range)
 Declare a function to be processed by the user propagator plugin.
 
Expr MkBound (uint index, Sort ty)
 Creates a new bound variable.
 
Pattern MkPattern (params Expr[] terms)
 Create a quantifier pattern.
 
Expr MkConst (Symbol name, Sort range)
 Creates a new Constant of sort range and named name .
 
Expr MkConst (string name, Sort range)
 Creates a new Constant of sort range and named name .
 
Expr MkFreshConst (string prefix, Sort range)
 Creates a fresh Constant of sort range and a name prefixed with prefix .
 
Expr MkConst (FuncDecl f)
 Creates a fresh constant from the FuncDecl f .
 
BoolExpr MkBoolConst (Symbol name)
 Create a Boolean constant.
 
BoolExpr MkBoolConst (string name)
 Create a Boolean constant.
 
IntExpr MkIntConst (Symbol name)
 Creates an integer constant.
 
IntExpr MkIntConst (string name)
 Creates an integer constant.
 
RealExpr MkRealConst (Symbol name)
 Creates a real constant.
 
RealExpr MkRealConst (string name)
 Creates a real constant.
 
ComplexExpr MkComplexConst (Symbol name)
 Creates a Complex constant.
 
ComplexExpr MkComplexConst (string name)
 Creates a Complex constant.
 
ComplexExpr MkComplex (ArithExpr real, ArithExpr imag)
 Constructs a Complex expression from Int or Real components.
 
RealExpr MkRealPart (ArithExpr value)
 Returns the Real-valued real component of a Complex expression.
 
RealExpr MkImagPart (ArithExpr value)
 Returns the Real-valued imaginary component of a Complex expression.
 
BitVecExpr MkBVConst (Symbol name, uint size)
 Creates a bit-vector constant.
 
BitVecExpr MkBVConst (string name, uint size)
 Creates a bit-vector constant.
 
Expr MkApp (FuncDecl f, params Expr[] args)
 Create a new function application.
 
Expr MkApp (FuncDecl f, IEnumerable< Expr > args)
 Create a new function application.
 
BoolExpr MkTrue ()
 The true Term.
 
BoolExpr MkFalse ()
 The false Term.
 
BoolExpr MkBool (bool value)
 Creates a Boolean value.
 
BoolExpr MkEq (Expr x, Expr y)
 Creates the equality x = y .
 
BoolExpr MkDistinct (params Expr[] args)
 Creates a distinct term.
 
BoolExpr MkDistinct (IEnumerable< Expr > args)
 Creates a distinct term.
 
BoolExpr MkNot (BoolExpr a)
 Mk an expression representing not(a).
 
Expr MkITE (BoolExpr t1, Expr t2, Expr t3)
 Create an expression representing an if-then-else: ite(t1, t2, t3).
 
BoolExpr MkIff (BoolExpr t1, BoolExpr t2)
 Create an expression representing t1 iff t2.
 
BoolExpr MkImplies (BoolExpr t1, BoolExpr t2)
 Create an expression representing t1 -> t2.
 
BoolExpr MkXor (BoolExpr t1, BoolExpr t2)
 Create an expression representing t1 xor t2.
 
BoolExpr MkXor (IEnumerable< BoolExpr > args)
 Create an expression representing t1 xor t2 xor t3 ... .
 
BoolExpr MkAnd (params BoolExpr[] ts)
 Create an expression representing t[0] and t[1] and ....
 
BoolExpr MkAnd (IEnumerable< BoolExpr > t)
 Create an expression representing t[0] and t[1] and ....
 
BoolExpr MkOr (params BoolExpr[] ts)
 Create an expression representing t[0] or t[1] or ....
 
BoolExpr MkOr (IEnumerable< BoolExpr > ts)
 Create an expression representing t[0] or t[1] or ....
 
ArithExpr MkAdd (params ArithExpr[] ts)
 Create an expression representing t[0] + t[1] + ....
 
ArithExpr MkAdd (IEnumerable< ArithExpr > ts)
 Create an expression representing t[0] + t[1] + ....
 
ArithExpr MkMul (params ArithExpr[] ts)
 Create an expression representing t[0] * t[1] * ....
 
ArithExpr MkMul (IEnumerable< ArithExpr > ts)
 Create an expression representing t[0] * t[1] * ....
 
ArithExpr MkSub (params ArithExpr[] ts)
 Create an expression representing t[0] - t[1] - ....
 
ArithExpr MkUnaryMinus (ArithExpr t)
 Create an expression representing -t.
 
ArithExpr MkDiv (ArithExpr t1, ArithExpr t2)
 Create an expression representing t1 / t2.
 
IntExpr MkMod (IntExpr t1, IntExpr t2)
 Create an expression representing t1 mod t2.
 
IntExpr MkRem (IntExpr t1, IntExpr t2)
 Create an expression representing t1 rem t2.
 
ArithExpr MkPower (ArithExpr t1, ArithExpr t2)
 Create an expression representing t1 ^ t2.
 
BoolExpr MkLt (ArithExpr t1, ArithExpr t2)
 Create an expression representing t1 < t2
 
BoolExpr MkLe (ArithExpr t1, ArithExpr t2)
 Create an expression representing t1 <= t2
 
BoolExpr MkGt (ArithExpr t1, ArithExpr t2)
 Create an expression representing t1 > t2
 
BoolExpr MkGe (ArithExpr t1, ArithExpr t2)
 Create an expression representing t1 >= t2
 
RealExpr MkInt2Real (IntExpr t)
 Coerce an integer to a real.
 
IntExpr MkReal2Int (RealExpr t)
 Coerce a real to an integer.
 
BoolExpr MkIsInteger (RealExpr t)
 Creates an expression that checks whether a real number is an integer.
 
BitVecExpr MkBVNot (BitVecExpr t)
 Bitwise negation.
 
BitVecExpr MkBVRedAND (BitVecExpr t)
 Take conjunction of bits in a vector, return vector of length 1.
 
BitVecExpr MkBVRedOR (BitVecExpr t)
 Take disjunction of bits in a vector, return vector of length 1.
 
BitVecExpr MkBVAND (BitVecExpr t1, BitVecExpr t2)
 Bitwise conjunction.
 
BitVecExpr MkBVOR (BitVecExpr t1, BitVecExpr t2)
 Bitwise disjunction.
 
BitVecExpr MkBVXOR (BitVecExpr t1, BitVecExpr t2)
 Bitwise XOR.
 
BitVecExpr MkBVNAND (BitVecExpr t1, BitVecExpr t2)
 Bitwise NAND.
 
BitVecExpr MkBVNOR (BitVecExpr t1, BitVecExpr t2)
 Bitwise NOR.
 
BitVecExpr MkBVXNOR (BitVecExpr t1, BitVecExpr t2)
 Bitwise XNOR.
 
BitVecExpr MkBVNeg (BitVecExpr t)
 Standard two's complement unary minus.
 
BitVecExpr MkBVAdd (BitVecExpr t1, BitVecExpr t2)
 Two's complement addition.
 
BitVecExpr MkBVSub (BitVecExpr t1, BitVecExpr t2)
 Two's complement subtraction.
 
BitVecExpr MkBVMul (BitVecExpr t1, BitVecExpr t2)
 Two's complement multiplication.
 
BitVecExpr MkBVUDiv (BitVecExpr t1, BitVecExpr t2)
 Unsigned division.
 
BitVecExpr MkBVSDiv (BitVecExpr t1, BitVecExpr t2)
 Signed division.
 
BitVecExpr MkBVURem (BitVecExpr t1, BitVecExpr t2)
 Unsigned remainder.
 
BitVecExpr MkBVSRem (BitVecExpr t1, BitVecExpr t2)
 Signed remainder.
 
BitVecExpr MkBVSMod (BitVecExpr t1, BitVecExpr t2)
 Two's complement signed remainder (sign follows divisor).
 
BoolExpr MkBVULT (BitVecExpr t1, BitVecExpr t2)
 Unsigned less-than.
 
BoolExpr MkBVSLT (BitVecExpr t1, BitVecExpr t2)
 Two's complement signed less-than.
 
BoolExpr MkBVULE (BitVecExpr t1, BitVecExpr t2)
 Unsigned less-than or equal to.
 
BoolExpr MkBVSLE (BitVecExpr t1, BitVecExpr t2)
 Two's complement signed less-than or equal to.
 
BoolExpr MkBVUGE (BitVecExpr t1, BitVecExpr t2)
 Unsigned greater than or equal to.
 
BoolExpr MkBVSGE (BitVecExpr t1, BitVecExpr t2)
 Two's complement signed greater than or equal to.
 
BoolExpr MkBVUGT (BitVecExpr t1, BitVecExpr t2)
 Unsigned greater-than.
 
BoolExpr MkBVSGT (BitVecExpr t1, BitVecExpr t2)
 Two's complement signed greater-than.
 
BitVecExpr MkConcat (BitVecExpr t1, BitVecExpr t2)
 Bit-vector concatenation.
 
BitVecExpr MkExtract (uint high, uint low, BitVecExpr t)
 Bit-vector extraction.
 
BitVecExpr MkSignExt (uint i, BitVecExpr t)
 Bit-vector sign extension.
 
BitVecExpr MkZeroExt (uint i, BitVecExpr t)
 Bit-vector zero extension.
 
BitVecExpr MkRepeat (uint i, BitVecExpr t)
 Bit-vector repetition.
 
BitVecExpr MkBVSHL (BitVecExpr t1, BitVecExpr t2)
 Shift left.
 
BitVecExpr MkBVLSHR (BitVecExpr t1, BitVecExpr t2)
 Logical shift right.
 
BitVecExpr MkBVASHR (BitVecExpr t1, BitVecExpr t2)
 Arithmetic shift right.
 
BitVecExpr MkBVRotateLeft (uint i, BitVecExpr t)
 Rotate Left.
 
BitVecExpr MkBVRotateRight (uint i, BitVecExpr t)
 Rotate Right.
 
BitVecExpr MkBVRotateLeft (BitVecExpr t1, BitVecExpr t2)
 Rotate Left.
 
BitVecExpr MkBVRotateRight (BitVecExpr t1, BitVecExpr t2)
 Rotate Right.
 
BitVecExpr MkInt2BV (uint n, IntExpr t)
 Create an n bit bit-vector from the integer argument t .
 
IntExpr MkBV2Int (BitVecExpr t, bool signed)
 Create an integer from the bit-vector argument t .
 
BoolExpr MkBVAddNoOverflow (BitVecExpr t1, BitVecExpr t2, bool isSigned)
 Create a predicate that checks that the bit-wise addition does not overflow.
 
BoolExpr MkBVAddNoUnderflow (BitVecExpr t1, BitVecExpr t2)
 Create a predicate that checks that the bit-wise addition does not underflow.
 
BoolExpr MkBVSubNoOverflow (BitVecExpr t1, BitVecExpr t2)
 Create a predicate that checks that the bit-wise subtraction does not overflow.
 
BoolExpr MkBVSubNoUnderflow (BitVecExpr t1, BitVecExpr t2, bool isSigned)
 Create a predicate that checks that the bit-wise subtraction does not underflow.
 
BoolExpr MkBVSDivNoOverflow (BitVecExpr t1, BitVecExpr t2)
 Create a predicate that checks that the bit-wise signed division does not overflow.
 
BoolExpr MkBVNegNoOverflow (BitVecExpr t)
 Create a predicate that checks that the bit-wise negation does not overflow.
 
BoolExpr MkBVMulNoOverflow (BitVecExpr t1, BitVecExpr t2, bool isSigned)
 Create a predicate that checks that the bit-wise multiplication does not overflow.
 
BoolExpr MkBVMulNoUnderflow (BitVecExpr t1, BitVecExpr t2)
 Create a predicate that checks that the bit-wise multiplication does not underflow.
 
ArrayExpr MkArrayConst (Symbol name, Sort domain, Sort range)
 Create an array constant.
 
ArrayExpr MkArrayConst (string name, Sort domain, Sort range)
 Create an array constant.
 
Expr MkSelect (ArrayExpr a, Expr i)
 Array read.
 
Expr MkSelect (ArrayExpr a, params Expr[] args)
 Array read.
 
ArrayExpr MkStore (ArrayExpr a, Expr i, Expr v)
 Array update.
 
ArrayExpr MkStore (ArrayExpr a, Expr[] args, Expr v)
 Array update.
 
ArrayExpr MkConstArray (Sort domain, Expr v)
 Create a constant array.
 
ArrayExpr MkMap (FuncDecl f, params ArrayExpr[] args)
 Maps f on the argument arrays.
 
Expr MkTermArray (ArrayExpr array)
 Access the array default value.
 
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.
 
SetSort MkSetSort (Sort ty)
 Create a set type.
 
ArrayExpr MkEmptySet (Sort domain)
 Create an empty set.
 
ArrayExpr MkFullSet (Sort domain)
 Create the full set.
 
ArrayExpr MkSetAdd (ArrayExpr set, Expr element)
 Add an element to the set.
 
ArrayExpr MkSetDel (ArrayExpr set, Expr element)
 Remove an element from a set.
 
ArrayExpr MkSetUnion (params ArrayExpr[] args)
 Take the union of a list of sets.
 
ArrayExpr MkSetIntersection (params ArrayExpr[] args)
 Take the intersection of a list of sets.
 
ArrayExpr MkSetDifference (ArrayExpr arg1, ArrayExpr arg2)
 Take the difference between two sets.
 
ArrayExpr MkSetComplement (ArrayExpr arg)
 Take the complement of a set.
 
BoolExpr MkSetMembership (Expr elem, ArrayExpr set)
 Check for set membership.
 
BoolExpr MkSetSubset (ArrayExpr arg1, ArrayExpr arg2)
 Check for subsetness of sets.
 
FiniteSetSort MkFiniteSetSort (Sort elemSort)
 Create a finite set sort over the given element sort.
 
bool IsFiniteSetSort (Sort s)
 Check if a sort is a finite set sort.
 
Sort GetFiniteSetSortBasis (Sort s)
 Get the element sort (basis) of a finite set sort.
 
Expr MkFiniteSetEmpty (Sort setSort)
 Create an empty finite set.
 
Expr MkFiniteSetSingleton (Expr elem)
 Create a singleton finite set.
 
Expr MkFiniteSetUnion (Expr s1, Expr s2)
 Create the union of two finite sets.
 
Expr MkFiniteSetIntersect (Expr s1, Expr s2)
 Create the intersection of two finite sets.
 
Expr MkFiniteSetDifference (Expr s1, Expr s2)
 Create the difference of two finite sets.
 
BoolExpr MkFiniteSetMember (Expr elem, Expr set)
 Check for membership in a finite set.
 
Expr MkFiniteSetSize (Expr set)
 Get the cardinality of a finite set.
 
BoolExpr MkFiniteSetSubset (Expr s1, Expr s2)
 Check if one finite set is a subset of another.
 
Expr MkFiniteSetMap (Expr f, Expr set)
 Map a function over all elements in a finite set.
 
Expr MkFiniteSetFilter (Expr f, Expr set)
 Filter a finite set with a predicate.
 
Expr MkFiniteSetRange (Expr low, Expr high)
 Create a finite set containing integers in the range [low, high].
 
SeqExpr MkEmptySeq (Sort s)
 Create the empty sequence.
 
SeqExpr MkUnit (Expr elem)
 Create the singleton sequence.
 
SeqExpr MkString (string s)
 Create a string constant.
 
SeqExpr IntToString (Expr e)
 Convert an integer expression to a string.
 
SeqExpr UbvToString (Expr e)
 Convert a bit-vector expression, represented as an unsigned number, to a string.
 
SeqExpr SbvToString (Expr e)
 Convert a bit-vector expression, represented as an signed number, to a string.
 
IntExpr StringToInt (Expr e)
 Convert an integer expression to a string.
 
SeqExpr MkConcat (params SeqExpr[] t)
 Concatenate sequences.
 
IntExpr MkLength (SeqExpr s)
 Retrieve the length of a given sequence.
 
SeqExpr MkSeqPower (SeqExpr s, Expr n)
 Retrieve the sequence s concatenated n times with itself.
 
BoolExpr MkPrefixOf (SeqExpr s1, SeqExpr s2)
 Check for sequence prefix.
 
BoolExpr MkSuffixOf (SeqExpr s1, SeqExpr s2)
 Check for sequence suffix.
 
BoolExpr MkContains (SeqExpr s1, SeqExpr s2)
 Check for sequence containment of s2 in s1.
 
BoolExpr MkStringLt (SeqExpr s1, SeqExpr s2)
 Check if the string s1 is lexicographically strictly less than s2.
 
BoolExpr MkStringLe (SeqExpr s1, SeqExpr s2)
 Check if the string s1 is lexicographically less or equal to s2.
 
SeqExpr MkAt (SeqExpr s, Expr index)
 Retrieve sequence of length one at index.
 
Expr MkNth (SeqExpr s, Expr index)
 Retrieve element at index.
 
SeqExpr MkExtract (SeqExpr s, IntExpr offset, IntExpr length)
 Extract subsequence.
 
IntExpr MkIndexOf (SeqExpr s, SeqExpr substr, ArithExpr offset)
 Extract index of sub-string starting at offset.
 
SeqExpr MkReplace (SeqExpr s, SeqExpr src, SeqExpr dst)
 Replace the first occurrence of src by dst in s.
 
Expr MkSeqMap (Expr f, SeqExpr s)
 Map function f over the sequence s.
 
Expr MkSeqMapi (Expr f, Expr i, SeqExpr s)
 Map function f over the sequence s at index i.
 
Expr MkSeqFoldLeft (Expr f, Expr a, SeqExpr s)
 Fold left the function f over the sequence s with initial value a.
 
Expr MkSeqFoldLeftI (Expr f, Expr i, Expr a, SeqExpr s)
 Fold left with index the function f over the sequence s with initial value a starting at index i.
 
ReExpr MkToRe (SeqExpr s)
 Convert a regular expression that accepts sequence s.
 
BoolExpr MkInRe (SeqExpr s, ReExpr re)
 Check for regular expression membership.
 
ReExpr MkStar (ReExpr re)
 Take the Kleene star of a regular expression.
 
ReExpr MkLoop (ReExpr re, uint lo, uint hi=0)
 Take the bounded Kleene star of a regular expression.
 
ReExpr MkPlus (ReExpr re)
 Take the Kleene plus of a regular expression.
 
ReExpr MkOption (ReExpr re)
 Create the optional regular expression.
 
ReExpr MkComplement (ReExpr re)
 Create the complement regular expression.
 
ReExpr MkConcat (params ReExpr[] t)
 Create the concatenation of regular languages.
 
ReExpr MkUnion (params ReExpr[] t)
 Create the union of regular languages.
 
ReExpr MkIntersect (params ReExpr[] t)
 Create the intersection of regular languages.
 
ReExpr MkDiff (ReExpr a, ReExpr b)
 Create a difference regular expression.
 
ReExpr MkEmptyRe (Sort s)
 Create the empty regular expression. The sort s should be a regular expression.
 
ReExpr MkFullRe (Sort s)
 Create the full regular expression. The sort s should be a regular expression.
 
ReExpr MkRange (SeqExpr lo, SeqExpr hi)
 Create a range expression.
 
BoolExpr MkCharLe (Expr ch1, Expr ch2)
 Create less than or equal to between two characters.
 
IntExpr CharToInt (Expr ch)
 Create an integer (code point) from character.
 
BitVecExpr CharToBV (Expr ch)
 Create a bit-vector (code point) from character.
 
Expr CharFromBV (BitVecExpr bv)
 Create a character from a bit-vector (code point).
 
BoolExpr MkIsDigit (Expr ch)
 Create a check if the character is a digit.
 
BoolExpr MkAtMost (IEnumerable< BoolExpr > args, uint k)
 Create an at-most-k constraint.
 
BoolExpr MkAtLeast (IEnumerable< BoolExpr > args, uint k)
 Create an at-least-k constraint.
 
BoolExpr MkPBLe (int[] coeffs, BoolExpr[] args, int k)
 Create a pseudo-Boolean less-or-equal constraint.
 
BoolExpr MkPBGe (int[] coeffs, BoolExpr[] args, int k)
 Create a pseudo-Boolean greater-or-equal constraint.
 
BoolExpr MkPBEq (int[] coeffs, BoolExpr[] args, int k)
 Create a pseudo-Boolean equal constraint.
 
Expr MkNumeral (string v, Sort ty)
 Create a Term of a given sort.
 
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 than MakeNumeral since it is not necessary to parse a string.
 
Expr MkNumeral (uint 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 than MakeNumeral since it is not necessary to parse a string.
 
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 than MakeNumeral since it is not necessary to parse a string.
 
Expr MkNumeral (ulong 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 than MakeNumeral since it is not necessary to parse a string.
 
RatNum MkReal (int num, int den)
 Create a real from a fraction.
 
RatNum MkReal (string v)
 Create a real numeral.
 
RatNum MkReal (int v)
 Create a real numeral.
 
RatNum MkReal (uint v)
 Create a real numeral.
 
RatNum MkReal (long v)
 Create a real numeral.
 
RatNum MkReal (ulong v)
 Create a real numeral.
 
IntNum MkInt (string v)
 Create an integer numeral.
 
IntNum MkInt (int v)
 Create an integer numeral.
 
IntNum MkInt (uint v)
 Create an integer numeral.
 
IntNum MkInt (long v)
 Create an integer numeral.
 
IntNum MkInt (ulong v)
 Create an integer numeral.
 
BitVecNum MkBV (string v, uint size)
 Create a bit-vector numeral.
 
BitVecNum MkBV (int v, uint size)
 Create a bit-vector numeral.
 
BitVecNum MkBV (uint v, uint size)
 Create a bit-vector numeral.
 
BitVecNum MkBV (long v, uint size)
 Create a bit-vector numeral.
 
BitVecNum MkBV (ulong v, uint size)
 Create a bit-vector numeral.
 
BitVecNum MkBV (bool[] bits)
 Create a bit-vector numeral.
 
Quantifier MkForall (Sort[] sorts, Symbol[] names, Expr body, uint weight=1, Pattern[] patterns=null, Expr[] noPatterns=null, Symbol quantifierID=null, Symbol skolemID=null)
 Create a universal Quantifier.
 
Quantifier MkForall (Expr[] boundConstants, Expr body, uint weight=1, Pattern[] patterns=null, Expr[] noPatterns=null, Symbol quantifierID=null, Symbol skolemID=null)
 Create a universal Quantifier.
 
Quantifier MkExists (Sort[] sorts, Symbol[] names, Expr body, uint weight=1, Pattern[] patterns=null, Expr[] noPatterns=null, Symbol quantifierID=null, Symbol skolemID=null)
 Create an existential Quantifier.
 
Quantifier MkExists (Expr[] boundConstants, Expr body, uint weight=1, Pattern[] patterns=null, Expr[] noPatterns=null, Symbol quantifierID=null, Symbol skolemID=null)
 Create an existential Quantifier.
 
Quantifier MkQuantifier (bool universal, Sort[] sorts, Symbol[] names, Expr body, uint weight=1, Pattern[] patterns=null, Expr[] noPatterns=null, Symbol quantifierID=null, Symbol skolemID=null)
 Create a Quantifier.
 
Quantifier MkQuantifier (bool universal, Expr[] boundConstants, Expr body, uint weight=1, Pattern[] patterns=null, Expr[] noPatterns=null, Symbol quantifierID=null, Symbol skolemID=null)
 Create a Quantifier.
 
Lambda MkLambda (Sort[] sorts, Symbol[] names, Expr body)
 Create a lambda expression.
 
Lambda MkLambda (Expr[] boundConstants, Expr body)
 Create a lambda expression.
 
BoolExpr[] ParseSMTLIB2String (string str, Symbol[] sortNames=null, Sort[] sorts=null, Symbol[] declNames=null, FuncDecl[] decls=null)
 Parse the given string using the SMT-LIB2 parser.
 
BoolExpr[] ParseSMTLIB2File (string fileName, Symbol[] sortNames=null, Sort[] sorts=null, Symbol[] declNames=null, FuncDecl[] decls=null)
 Parse the given file using the SMT-LIB2 parser.
 
string BenchmarkToSmtlibString (string name, string logic, string status, string attributes, BoolExpr[] assumptions, BoolExpr formula)
 Convert a benchmark into SMT-LIB2 formatted string.
 
Goal MkGoal (bool models=true, bool unsatCores=false, bool proofs=false)
 Creates a new Goal.
 
Params MkParams ()
 Creates a new ParameterSet.
 
string TacticDescription (string name)
 Returns a string containing a description of the tactic with the given name.
 
Tactic MkTactic (string name)
 Creates a new Tactic.
 
Tactic AndThen (Tactic t1, Tactic t2, params Tactic[] ts)
 Create a tactic that applies t1 to a Goal and then t2 to every subgoal produced by t1 .
 
Tactic Then (Tactic t1, Tactic t2, params Tactic[] ts)
 Create a tactic that applies t1 to a Goal and then t2 to every subgoal produced by t1 .
 
Tactic OrElse (Tactic t1, Tactic t2)
 Create a tactic that first applies t1 to a Goal and if it fails then returns the result of t2 applied to the Goal.
 
Tactic TryFor (Tactic t, uint ms)
 Create a tactic that applies t to a goal for ms milliseconds.
 
Tactic When (Probe p, Tactic t)
 Create a tactic that applies t to a given goal if the probe p evaluates to true.
 
Tactic Cond (Probe p, Tactic t1, Tactic t2)
 Create a tactic that applies t1 to a given goal if the probe p evaluates to true and t2 otherwise.
 
Tactic Repeat (Tactic t, uint max=uint.MaxValue)
 Create a tactic that keeps applying t until the goal is not modified anymore or the maximum number of iterations max is reached.
 
Tactic Skip ()
 Create a tactic that just returns the given goal.
 
Tactic Fail ()
 Create a tactic always fails.
 
Tactic FailIf (Probe p)
 Create a tactic that fails if the probe p evaluates to false.
 
Tactic FailIfNotDecided ()
 Create a tactic that fails if the goal is not trivially satisfiable (i.e., empty) or trivially unsatisfiable (i.e., contains ‘false’).
 
Tactic UsingParams (Tactic t, Params p)
 Create a tactic that applies t using the given set of parameters p .
 
Tactic With (Tactic t, Params p)
 Create a tactic that applies t using the given set of parameters p .
 
Tactic ParOr (params 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).
 
Tactic ParAndThen (Tactic t1, Tactic t2)
 Create a tactic that applies t1 to a given goal and then t2 to every subgoal produced by t1 . The subgoals are processed in parallel.
 
void Interrupt ()
 Interrupt the execution of a Z3 procedure.
 
ASTMap MkASTMap ()
 Creates an empty map from ASTs to ASTs.
 
Expr QeLite (ASTVector vars, Expr body)
 Performs best-effort quantifier elimination for the variables in vars .
 
Expr QeModelProject (Model model, Expr[] bounds, Expr body)
 Projects the bound applications from body using model .
 
Expr QeModelProjectSkolem (Model model, Expr[] bounds, Expr body, ASTMap map)
 Projects bound applications and records Skolem terms in map .
 
Expr QeModelProjectWithWitness (Model model, Expr[] bounds, Expr body, ASTMap map)
 Projects bound applications and records witnesses in map .
 
string SimplifierDescription (string name)
 Returns a string containing a description of the simplifier with the given name.
 
Simplifier MkSimplifier (string name)
 Creates a new Tactic.
 
Simplifier AndThen (Simplifier t1, Simplifier t2, params Simplifier[] ts)
 Create a simplifier that applies t1 and then t2 .
 
Simplifier Then (Simplifier t1, Simplifier t2, params Simplifier[] ts)
 Create a simplifier that applies t1 and then then t2 .
 
Simplifier UsingParams (Simplifier t, Params p)
 Create a tactic that applies t using the given set of parameters p .
 
string ProbeDescription (string name)
 Returns a string containing a description of the probe with the given name.
 
Probe MkProbe (string name)
 Creates a new Probe.
 
Probe ConstProbe (double val)
 Create a probe that always evaluates to val .
 
Probe Lt (Probe p1, Probe p2)
 Create a probe that evaluates to "true" when the value returned by p1 is less than the value returned by p2
 
Probe Gt (Probe p1, Probe p2)
 Create a probe that evaluates to "true" when the value returned by p1 is greater than the value returned by p2
 
Probe Le (Probe p1, Probe p2)
 Create a probe that evaluates to "true" when the value returned by p1 is less than or equal the value returned by p2
 
Probe Ge (Probe p1, Probe p2)
 Create a probe that evaluates to "true" when the value returned by p1 is greater than or equal the value returned by p2
 
Probe Eq (Probe p1, Probe p2)
 Create a probe that evaluates to "true" when the value returned by p1 is equal to the value returned by p2
 
Probe And (Probe p1, Probe p2)
 Create a probe that evaluates to "true" when the value p1 and p2 evaluate to "true".
 
Probe Or (Probe p1, Probe p2)
 Create a probe that evaluates to "true" when the value p1 or p2 evaluate to "true".
 
Probe Not (Probe p)
 Create a probe that evaluates to "true" when the value p does not evaluate to "true".
 
Solver MkSolver (Symbol logic=null)
 Creates a new (incremental) solver.
 
Solver MkSolver (string logic)
 Creates a new (incremental) solver.
 
Solver MkSimpleSolver ()
 Creates a new (incremental) solver.
 
Solver MkSolver (Solver s, Simplifier t)
 Creates a solver that uses an incremental simplifier.
 
Solver MkSolver (Tactic t)
 Creates a solver that is implemented using the given tactic.
 
Fixedpoint MkFixedpoint ()
 Create a Fixedpoint context.
 
Optimize MkOptimize ()
 Create an Optimization context.
 
FPRMSort MkFPRoundingModeSort ()
 Create the floating-point RoundingMode sort.
 
FPRMExpr MkFPRoundNearestTiesToEven ()
 Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
 
FPRMNum MkFPRNE ()
 Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
 
FPRMNum MkFPRoundNearestTiesToAway ()
 Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
 
FPRMNum MkFPRNA ()
 Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
 
FPRMNum MkFPRoundTowardPositive ()
 Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode.
 
FPRMNum MkFPRTP ()
 Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode.
 
FPRMNum MkFPRoundTowardNegative ()
 Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode.
 
FPRMNum MkFPRTN ()
 Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode.
 
FPRMNum MkFPRoundTowardZero ()
 Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode.
 
FPRMNum MkFPRTZ ()
 Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode.
 
FPSort MkFPSort (uint ebits, uint sbits)
 Create a FloatingPoint sort.
 
FPSort MkFPSortHalf ()
 Create the half-precision (16-bit) FloatingPoint sort.
 
FPSort MkFPSort16 ()
 Create the half-precision (16-bit) FloatingPoint sort.
 
FPSort MkFPSortSingle ()
 Create the single-precision (32-bit) FloatingPoint sort.
 
FPSort MkFPSort32 ()
 Create the single-precision (32-bit) FloatingPoint sort.
 
FPSort MkFPSortDouble ()
 Create the double-precision (64-bit) FloatingPoint sort.
 
FPSort MkFPSort64 ()
 Create the double-precision (64-bit) FloatingPoint sort.
 
FPSort MkFPSortQuadruple ()
 Create the quadruple-precision (128-bit) FloatingPoint sort.
 
FPSort MkFPSort128 ()
 Create the quadruple-precision (128-bit) FloatingPoint sort.
 
FPNum MkFPNaN (FPSort s)
 Create a NaN of sort s.
 
FPNum MkFPInf (FPSort s, bool negative)
 Create a floating-point infinity of sort s.
 
FPNum MkFPZero (FPSort s, bool negative)
 Create a floating-point zero of sort s.
 
FPNum MkFPNumeral (float v, FPSort s)
 Create a numeral of FloatingPoint sort from a float.
 
FPNum MkFPNumeral (double v, FPSort s)
 Create a numeral of FloatingPoint sort from a float.
 
FPNum MkFPNumeral (int v, FPSort s)
 Create a numeral of FloatingPoint sort from an int.
 
FPNum MkFPNumeral (bool sgn, uint sig, int exp, FPSort s)
 Create a numeral of FloatingPoint sort from a sign bit and two integers.
 
FPNum MkFPNumeral (bool sgn, Int64 exp, UInt64 sig, FPSort s)
 Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.
 
FPNum MkFP (float v, FPSort s)
 Create a numeral of FloatingPoint sort from a float.
 
FPNum MkFP (double v, FPSort s)
 Create a numeral of FloatingPoint sort from a float.
 
FPNum MkFP (int v, FPSort s)
 Create a numeral of FloatingPoint sort from an int.
 
FPNum MkFP (bool sgn, int exp, uint sig, FPSort s)
 Create a numeral of FloatingPoint sort from a sign bit and two integers.
 
FPNum MkFP (bool sgn, Int64 exp, UInt64 sig, FPSort s)
 Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.
 
FPExpr MkFPAbs (FPExpr t)
 Floating-point absolute value.
 
FPExpr MkFPNeg (FPExpr t)
 Floating-point negation.
 
FPExpr MkFPAdd (FPRMExpr rm, FPExpr t1, FPExpr t2)
 Floating-point addition.
 
FPExpr MkFPSub (FPRMExpr rm, FPExpr t1, FPExpr t2)
 Floating-point subtraction.
 
FPExpr MkFPMul (FPRMExpr rm, FPExpr t1, FPExpr t2)
 Floating-point multiplication.
 
FPExpr MkFPDiv (FPRMExpr rm, FPExpr t1, FPExpr t2)
 Floating-point division.
 
FPExpr MkFPFMA (FPRMExpr rm, FPExpr t1, FPExpr t2, FPExpr t3)
 Floating-point fused multiply-add.
 
FPExpr MkFPSqrt (FPRMExpr rm, FPExpr t)
 Floating-point square root.
 
FPExpr MkFPRem (FPExpr t1, FPExpr t2)
 Floating-point remainder.
 
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.
 
FPExpr MkFPMin (FPExpr t1, FPExpr t2)
 Minimum of floating-point numbers.
 
FPExpr MkFPMax (FPExpr t1, FPExpr t2)
 Maximum of floating-point numbers.
 
BoolExpr MkFPLEq (FPExpr t1, FPExpr t2)
 Floating-point less than or equal.
 
BoolExpr MkFPLt (FPExpr t1, FPExpr t2)
 Floating-point less than.
 
BoolExpr MkFPGEq (FPExpr t1, FPExpr t2)
 Floating-point greater than or equal.
 
BoolExpr MkFPGt (FPExpr t1, FPExpr t2)
 Floating-point greater than.
 
BoolExpr MkFPEq (FPExpr t1, FPExpr t2)
 Floating-point equality.
 
BoolExpr MkFPIsNormal (FPExpr t)
 Predicate indicating whether t is a normal floating-point number.
 
BoolExpr MkFPIsSubnormal (FPExpr t)
 Predicate indicating whether t is a subnormal floating-point number.
 
BoolExpr MkFPIsZero (FPExpr t)
 Predicate indicating whether t is a floating-point number with zero value, i.e., +0 or -0.
 
BoolExpr MkFPIsInfinite (FPExpr t)
 Predicate indicating whether t is a floating-point number representing +oo or -oo.
 
BoolExpr MkFPIsNaN (FPExpr t)
 Predicate indicating whether t is a NaN.
 
BoolExpr MkFPIsNegative (FPExpr t)
 Predicate indicating whether t is a negative floating-point number.
 
BoolExpr MkFPIsPositive (FPExpr t)
 Predicate indicating whether t is a positive floating-point number.
 
FPExpr MkFP (BitVecExpr sgn, BitVecExpr sig, BitVecExpr exp)
 Create an expression of FloatingPoint sort from three bit-vector expressions.
 
FPExpr MkFPToFP (BitVecExpr bv, FPSort s)
 Conversion of a single IEEE 754-2008 bit-vector into a floating-point number.
 
FPExpr MkFPToFP (FPRMExpr rm, FPExpr t, FPSort s)
 Conversion of a FloatingPoint term into another term of different FloatingPoint sort.
 
FPExpr MkFPToFP (FPRMExpr rm, RealExpr t, FPSort s)
 Conversion of a term of real sort into a term of FloatingPoint sort.
 
FPExpr MkFPToFP (FPRMExpr rm, BitVecExpr t, FPSort s, bool signed)
 Conversion of a 2's complement signed bit-vector term into a term of FloatingPoint sort.
 
FPExpr MkFPToFP (FPSort s, FPRMExpr rm, FPExpr t)
 Conversion of a floating-point number to another FloatingPoint sort s.
 
BitVecExpr MkFPToBV (FPRMExpr rm, FPExpr t, uint sz, bool sign)
 Conversion of a floating-point term into a bit-vector.
 
RealExpr MkFPToReal (FPExpr t)
 Conversion of a floating-point term into a real-numbered term.
 
BitVecExpr MkFPToIEEEBV (FPExpr t)
 Conversion of a floating-point term into a bit-vector term in IEEE 754-2008 format.
 
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.
 
AST WrapAST (IntPtr nativeObject)
 Wraps an AST.
 
IntPtr UnwrapAST (AST a)
 Unwraps an AST.
 
FuncDecl MkPartialOrder (Sort a, uint index)
 Create a partial order relation over a sort.
 
FuncDecl MkTransitiveClosure (FuncDecl f)
 Create the transitive closure of a binary relation.
 
ASTVector PolynomialSubresultants (Expr p, Expr q, Expr x)
 Return the nonzero subresultants of p and q with respect to the "variable" x.
 
string SimplifyHelp ()
 Return a string describing all available parameters to Expr.Simplify.
 
void UpdateParamValue (string id, string value)
 Update a mutable configuration parameter.
 
void Dispose ()
 Disposes of the context.
 

Properties

BoolSort BoolSort [get]
 Retrieves the Boolean sort of the context.
 
IntSort IntSort [get]
 Retrieves the Integer sort of the context.
 
RealSort RealSort [get]
 Retrieves the Real sort of the context.
 
ComplexSort ComplexSort [get]
 Retrieves the Complex sort of the context.
 
CharSort CharSort [get]
 Retrieves the character sort of the context.
 
SeqSort StringSort [get]
 Retrieves the String sort of the context.
 
Z3_ast_print_mode PrintMode [get, set]
 Selects the format used for pretty-printing expressions.
 
uint NumTactics [get]
 The number of supported tactics.
 
string[] TacticNames [get]
 The names of all supported tactics.
 
uint NumSimplifiers [get]
 The number of supported simplifiers.
 
string[] SimplifierNames [get]
 The names of all supported tactics.
 
uint NumProbes [get]
 The number of supported Probes.
 
string[] ProbeNames [get]
 The names of all supported Probes.
 
ParamDescrs SimplifyParameterDescriptions [get]
 Retrieves parameter descriptions for simplifier.
 

Detailed Description

The main interaction with Z3 happens via the Context.

Definition at line 33 of file Context.cs.

Constructor & Destructor Documentation

◆ Context() [1/2]

Context ( )
inline

Constructor.

Definition at line 39 of file Context.cs.

40 : base()
41 {
42 lock (creation_lock)
43 {
44 m_ctx = Native.Z3_mk_context_rc(IntPtr.Zero);
45 Native.Z3_enable_concurrent_dec_ref(m_ctx);
46 InitContext();
47 }
48 }

◆ Context() [2/2]

Context ( Dictionary< string, string >  settings)
inline

Constructor.

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 use Global.SetParameter

Definition at line 68 of file Context.cs.

69 : base()
70 {
71 Debug.Assert(settings != null);
72
73 lock (creation_lock)
74 {
75 IntPtr cfg = Native.Z3_mk_config();
76 foreach (KeyValuePair<string, string> kv in settings)
77 Native.Z3_set_param_value(cfg, kv.Key, kv.Value);
78 m_ctx = Native.Z3_mk_context_rc(cfg);
79 Native.Z3_enable_concurrent_dec_ref(m_ctx);
80 Native.Z3_del_config(cfg);
81 InitContext();
82 }
83 }

Member Function Documentation

◆ AddRecDef()

void AddRecDef ( FuncDecl  f,
Expr[]  args,
Expr  body 
)
inline

Bind a definition to a recursive function declaration. The function must have previously been created using MkRecFuncDecl. The body may contain recursive uses of the function or other mutually recursive functions.

Definition at line 721 of file Context.cs.

722 {
723 CheckContextMatch(f);
724 CheckContextMatch<Expr>(args);
725 CheckContextMatch(body);
726 IntPtr[] argsNative = AST.ArrayToNative(args);
727 Native.Z3_add_rec_def(nCtx, f.NativeObject, (uint)args.Length, argsNative, body.NativeObject);
728 }

◆ And()

Probe And ( Probe  p1,
Probe  p2 
)
inline

Create a probe that evaluates to "true" when the value p1 and p2 evaluate to "true".

Definition at line 4394 of file Context.cs.

4395 {
4396 Debug.Assert(p1 != null);
4397 Debug.Assert(p2 != null);
4398
4399 CheckContextMatch(p1);
4400 CheckContextMatch(p2);
4401 return new Probe(this, Native.Z3_probe_and(nCtx, p1.NativeObject, p2.NativeObject));
4402 }

◆ AndThen() [1/2]

Simplifier AndThen ( Simplifier  t1,
Simplifier  t2,
params Simplifier[]  ts 
)
inline

Create a simplifier that applies t1 and then t2 .

Definition at line 4211 of file Context.cs.

4212 {
4213 Debug.Assert(t1 != null);
4214 Debug.Assert(t2 != null);
4215 // Debug.Assert(ts == null || Contract.ForAll(0, ts.Length, j => ts[j] != null));
4216
4217
4218 CheckContextMatch(t1);
4219 CheckContextMatch(t2);
4220 CheckContextMatch<Simplifier>(ts);
4221
4222 IntPtr last = IntPtr.Zero;
4223 if (ts != null && ts.Length > 0)
4224 {
4225 last = ts[ts.Length - 1].NativeObject;
4226 for (int i = ts.Length - 2; i >= 0; i--)
4227 last = Native.Z3_simplifier_and_then(nCtx, ts[i].NativeObject, last);
4228 }
4229 if (last != IntPtr.Zero)
4230 {
4231 last = Native.Z3_simplifier_and_then(nCtx, t2.NativeObject, last);
4232 return new Simplifier(this, Native.Z3_simplifier_and_then(nCtx, t1.NativeObject, last));
4233 }
4234 else
4235 return new Simplifier(this, Native.Z3_simplifier_and_then(nCtx, t1.NativeObject, t2.NativeObject));
4236 }

◆ AndThen() [2/2]

Tactic AndThen ( Tactic  t1,
Tactic  t2,
params Tactic[]  ts 
)
inline

Create a tactic that applies t1 to a Goal and then t2 to every subgoal produced by t1 .

Definition at line 3891 of file Context.cs.

3892 {
3893 Debug.Assert(t1 != null);
3894 Debug.Assert(t2 != null);
3895 // Debug.Assert(ts == null || Contract.ForAll(0, ts.Length, j => ts[j] != null));
3896
3897
3898 CheckContextMatch(t1);
3899 CheckContextMatch(t2);
3900 CheckContextMatch<Tactic>(ts);
3901
3902 IntPtr last = IntPtr.Zero;
3903 if (ts != null && ts.Length > 0)
3904 {
3905 last = ts[ts.Length - 1].NativeObject;
3906 for (int i = ts.Length - 2; i >= 0; i--)
3907 last = Native.Z3_tactic_and_then(nCtx, ts[i].NativeObject, last);
3908 }
3909 if (last != IntPtr.Zero)
3910 {
3911 last = Native.Z3_tactic_and_then(nCtx, t2.NativeObject, last);
3912 return new Tactic(this, Native.Z3_tactic_and_then(nCtx, t1.NativeObject, last));
3913 }
3914 else
3915 return new Tactic(this, Native.Z3_tactic_and_then(nCtx, t1.NativeObject, t2.NativeObject));
3916 }

Referenced by Context.Then(), and Context.Then().

◆ BenchmarkToSmtlibString()

string BenchmarkToSmtlibString ( string  name,
string  logic,
string  status,
string  attributes,
BoolExpr[]  assumptions,
BoolExpr  formula 
)
inline

Convert a benchmark into SMT-LIB2 formatted string.

Parameters
nameName of the benchmark. May be null.
logicThe benchmark logic. May be null.
statusStatus string, such as "sat", "unsat", or "unknown".
attributesOther attributes, such as source, difficulty or category. May be null.
assumptionsAuxiliary assumptions.
formulaFormula to be checked for consistency in conjunction with assumptions.
Returns
A string representation of the benchmark in SMT-LIB2 format.

Definition at line 3798 of file Context.cs.

3799 {
3800 Debug.Assert(assumptions != null);
3801 Debug.Assert(formula != null);
3802
3803 return Native.Z3_benchmark_to_smtlib_string(
3804 nCtx,
3805 name,
3806 logic,
3807 status,
3808 attributes,
3809 (uint)(assumptions?.Length ?? 0),
3810 AST.ArrayToNative(assumptions),
3811 formula.NativeObject);
3812 }

Referenced by Solver.ToSmt2().

◆ CharFromBV()

Expr CharFromBV ( BitVecExpr  bv)
inline

Create a character from a bit-vector (code point).

Definition at line 3167 of file Context.cs.

3168 {
3169 Debug.Assert(bv != null);
3170 return new Expr(this, Native.Z3_mk_char_from_bv(nCtx, bv.NativeObject));
3171 }

◆ CharToBV()

BitVecExpr CharToBV ( Expr  ch)
inline

Create a bit-vector (code point) from character.

Definition at line 3158 of file Context.cs.

3159 {
3160 Debug.Assert(ch != null);
3161 return new BitVecExpr(this, Native.Z3_mk_char_to_bv(nCtx, ch.NativeObject));
3162 }

◆ CharToInt()

IntExpr CharToInt ( Expr  ch)
inline

Create an integer (code point) from character.

Definition at line 3149 of file Context.cs.

3150 {
3151 Debug.Assert(ch != null);
3152 return new IntExpr(this, Native.Z3_mk_char_to_int(nCtx, ch.NativeObject));
3153 }

◆ Cond()

Tactic Cond ( Probe  p,
Tactic  t1,
Tactic  t2 
)
inline

Create a tactic that applies t1 to a given goal if the probe p evaluates to true and t2 otherwise.

Definition at line 3983 of file Context.cs.

3984 {
3985 Debug.Assert(p != null);
3986 Debug.Assert(t1 != null);
3987 Debug.Assert(t2 != null);
3988
3989 CheckContextMatch(p);
3990 CheckContextMatch(t1);
3991 CheckContextMatch(t2);
3992 return new Tactic(this, Native.Z3_tactic_cond(nCtx, p.NativeObject, t1.NativeObject, t2.NativeObject));
3993 }

◆ ConstProbe()

Probe ConstProbe ( double  val)
inline

Create a probe that always evaluates to val .

Definition at line 4314 of file Context.cs.

4315 {
4316
4317 return new Probe(this, Native.Z3_probe_const(nCtx, val));
4318 }

◆ Dispose()

void Dispose ( )
inline

Disposes of the context.

Definition at line 5471 of file Context.cs.

5472 {
5473 // Console.WriteLine("Context Dispose from " + System.Threading.Thread.CurrentThread.ManagedThreadId);
5474
5475 if (m_boolSort != null) m_boolSort.Dispose();
5476 if (m_intSort != null) m_intSort.Dispose();
5477 if (m_realSort != null) m_realSort.Dispose();
5478 if (m_complexSort != null) m_complexSort.Dispose();
5479 if (m_stringSort != null) m_stringSort.Dispose();
5480 if (m_charSort != null) m_charSort.Dispose();
5481 m_boolSort = null;
5482 m_intSort = null;
5483 m_realSort = null;
5484 m_complexSort = null;
5485 m_stringSort = null;
5486 m_charSort = null;
5487 if (m_ctx != IntPtr.Zero)
5488 {
5489 // Suppress the finalizer before performing cleanup so that it cannot
5490 // run concurrently or redundantly if cleanup raises an exception.
5491 GC.SuppressFinalize(this);
5492 IntPtr ctx;
5493 // Keep a local reference to the error handler delegate to ensure it stays
5494 // alive throughout Z3_del_context. Setting m_n_err_handler = null releases
5495 // the field reference; without the local variable the GC could collect the
5496 // delegate before the native destructor finishes using the handler.
5497 Native.Z3_error_handler errHandler;
5498 lock (this)
5499 {
5500 ctx = m_ctx;
5501 errHandler = m_n_err_handler;
5502 m_n_err_handler = null;
5503 m_ctx = IntPtr.Zero;
5504 }
5505 // ctx is non-zero only for the thread that wins the lock and zeros m_ctx,
5506 // preventing double-free when Dispose() is called concurrently.
5507 if (ctx != IntPtr.Zero)
5508 {
5509 if (!is_external)
5510 {
5511 Native.Z3_del_context(ctx);
5512 GC.KeepAlive(errHandler);
5513 }
5514 if (m_memPressureAdded)
5515 {
5516 GC.RemoveMemoryPressure(NativeMemoryPressureEstimate);
5517 m_memPressureAdded = false;
5518 }
5519 }
5520 }
5521 }
void Dispose()
Disposes of the underlying native Z3 object.
Definition Z3Object.cs:45

◆ Eq()

Probe Eq ( Probe  p1,
Probe  p2 
)
inline

Create a probe that evaluates to "true" when the value returned by p1 is equal to the value returned by p2

Definition at line 4380 of file Context.cs.

4381 {
4382 Debug.Assert(p1 != null);
4383 Debug.Assert(p2 != null);
4384
4385 CheckContextMatch(p1);
4386 CheckContextMatch(p2);
4387 return new Probe(this, Native.Z3_probe_eq(nCtx, p1.NativeObject, p2.NativeObject));
4388 }

◆ Fail()

Tactic Fail ( )
inline

Create a tactic always fails.

Definition at line 4019 of file Context.cs.

4020 {
4021
4022 return new Tactic(this, Native.Z3_tactic_fail(nCtx));
4023 }

◆ FailIf()

Tactic FailIf ( Probe  p)
inline

Create a tactic that fails if the probe p evaluates to false.

Definition at line 4028 of file Context.cs.

4029 {
4030 Debug.Assert(p != null);
4031
4032 CheckContextMatch(p);
4033 return new Tactic(this, Native.Z3_tactic_fail_if(nCtx, p.NativeObject));
4034 }

◆ FailIfNotDecided()

Tactic FailIfNotDecided ( )
inline

Create a tactic that fails if the goal is not trivially satisfiable (i.e., empty) or trivially unsatisfiable (i.e., contains ‘false’).

Definition at line 4040 of file Context.cs.

4041 {
4042
4043 return new Tactic(this, Native.Z3_tactic_fail_if_not_decided(nCtx));
4044 }

◆ Ge()

Probe Ge ( Probe  p1,
Probe  p2 
)
inline

Create a probe that evaluates to "true" when the value returned by p1 is greater than or equal the value returned by p2

Definition at line 4366 of file Context.cs.

4367 {
4368 Debug.Assert(p1 != null);
4369 Debug.Assert(p2 != null);
4370
4371 CheckContextMatch(p1);
4372 CheckContextMatch(p2);
4373 return new Probe(this, Native.Z3_probe_ge(nCtx, p1.NativeObject, p2.NativeObject));
4374 }

◆ GetFiniteSetSortBasis()

Sort GetFiniteSetSortBasis ( Sort  s)
inline

Get the element sort (basis) of a finite set sort.

Definition at line 2579 of file Context.cs.

2580 {
2581 Debug.Assert(s != null);
2582
2583 CheckContextMatch(s);
2584 return Sort.Create(this, Native.Z3_get_finite_set_sort_basis(nCtx, s.NativeObject));
2585 }

◆ Gt()

Probe Gt ( Probe  p1,
Probe  p2 
)
inline

Create a probe that evaluates to "true" when the value returned by p1 is greater than the value returned by p2

Definition at line 4338 of file Context.cs.

4339 {
4340 Debug.Assert(p1 != null);
4341 Debug.Assert(p2 != null);
4342
4343 CheckContextMatch(p1);
4344 CheckContextMatch(p2);
4345 return new Probe(this, Native.Z3_probe_gt(nCtx, p1.NativeObject, p2.NativeObject));
4346 }

◆ Interrupt()

void Interrupt ( )
inline

Interrupt the execution of a Z3 procedure.

This procedure can be used to interrupt: solvers, simplifiers and tactics.

Definition at line 4100 of file Context.cs.

4101 {
4102 Native.Z3_interrupt(nCtx);
4103 }

◆ IntToString()

SeqExpr IntToString ( Expr  e)
inline

Convert an integer expression to a string.

Definition at line 2758 of file Context.cs.

2759 {
2760 Debug.Assert(e != null);
2761 Debug.Assert(e is ArithExpr);
2762 return new SeqExpr(this, Native.Z3_mk_int_to_str(nCtx, e.NativeObject));
2763 }

◆ IsFiniteSetSort()

bool IsFiniteSetSort ( Sort  s)
inline

Check if a sort is a finite set sort.

Definition at line 2568 of file Context.cs.

2569 {
2570 Debug.Assert(s != null);
2571
2572 CheckContextMatch(s);
2573 return Native.Z3_is_finite_set_sort(nCtx, s.NativeObject) != 0;
2574 }

◆ Le()

Probe Le ( Probe  p1,
Probe  p2 
)
inline

Create a probe that evaluates to "true" when the value returned by p1 is less than or equal the value returned by p2

Definition at line 4352 of file Context.cs.

4353 {
4354 Debug.Assert(p1 != null);
4355 Debug.Assert(p2 != null);
4356
4357 CheckContextMatch(p1);
4358 CheckContextMatch(p2);
4359 return new Probe(this, Native.Z3_probe_le(nCtx, p1.NativeObject, p2.NativeObject));
4360 }

◆ Lt()

Probe Lt ( Probe  p1,
Probe  p2 
)
inline

Create a probe that evaluates to "true" when the value returned by p1 is less than the value returned by p2

Definition at line 4324 of file Context.cs.

4325 {
4326 Debug.Assert(p1 != null);
4327 Debug.Assert(p2 != null);
4328
4329 CheckContextMatch(p1);
4330 CheckContextMatch(p2);
4331 return new Probe(this, Native.Z3_probe_lt(nCtx, p1.NativeObject, p2.NativeObject));
4332 }

◆ MkAdd() [1/2]

ArithExpr MkAdd ( IEnumerable< ArithExpr >  ts)
inline

Create an expression representing t[0] + t[1] + ....

Definition at line 1225 of file Context.cs.

1226 {
1227 Debug.Assert(ts != null);
1228 return MkAdd(ts.ToArray());
1229 }
ArithExpr MkAdd(params ArithExpr[] ts)
Create an expression representing t[0] + t[1] + ....
Definition Context.cs:1213

◆ MkAdd() [2/2]

ArithExpr MkAdd ( params ArithExpr[]  ts)
inline

Create an expression representing t[0] + t[1] + ....

Definition at line 1213 of file Context.cs.

1214 {
1215 Debug.Assert(ts != null);
1216 Debug.Assert(ts.All(a => a != null));
1217
1218 CheckContextMatch<ArithExpr>(ts);
1219 return (ArithExpr)Expr.Create(this, Native.Z3_mk_add(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1220 }

Referenced by Context.MkAdd(), and ArithExpr.operator+().

◆ MkAnd() [1/2]

BoolExpr MkAnd ( IEnumerable< BoolExpr >  t)
inline

Create an expression representing t[0] and t[1] and ....

Definition at line 1179 of file Context.cs.

1180 {
1181 Debug.Assert(t != null);
1182 return MkAnd(t.ToArray());
1183 }
BoolExpr MkAnd(params BoolExpr[] ts)
Create an expression representing t[0] and t[1] and ....
Definition Context.cs:1167

◆ MkAnd() [2/2]

BoolExpr MkAnd ( params BoolExpr[]  ts)
inline

Create an expression representing t[0] and t[1] and ....

Definition at line 1167 of file Context.cs.

1168 {
1169 Debug.Assert(ts != null);
1170 Debug.Assert(ts.All(a => a != null));
1171
1172 CheckContextMatch<BoolExpr>(ts);
1173 return new BoolExpr(this, Native.Z3_mk_and(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1174 }

Referenced by Goal.AsBoolExpr(), Context.MkAnd(), and BoolExpr.operator&().

◆ MkApp() [1/2]

Expr MkApp ( FuncDecl  f,
IEnumerable< Expr >  args 
)
inline

Create a new function application.

Definition at line 1015 of file Context.cs.

1016 {
1017 Debug.Assert(f != null);
1018 return MkApp(f, args?.ToArray());
1019 }
Expr MkApp(FuncDecl f, params Expr[] args)
Create a new function application.
Definition Context.cs:1003

◆ MkApp() [2/2]

Expr MkApp ( FuncDecl  f,
params Expr[]  args 
)
inline

Create a new function application.

Definition at line 1003 of file Context.cs.

1004 {
1005 Debug.Assert(f != null);
1006 Debug.Assert(args == null || args.All(a => a != null));
1007 CheckContextMatch(f);
1008 CheckContextMatch<Expr>(args);
1009 return Expr.Create(this, f, args);
1010 }

Referenced by EnumSort.Const(), Context.MkApp(), and Context.MkConst().

◆ MkArrayConst() [1/2]

ArrayExpr MkArrayConst ( string  name,
Sort  domain,
Sort  range 
)
inline

Create an array constant.

Definition at line 2227 of file Context.cs.

2228 {
2229 Debug.Assert(domain != null);
2230 Debug.Assert(range != null);
2231
2232 using var symbol = MkSymbol(name);
2233 using var sort = MkArraySort(domain, range);
2234 return (ArrayExpr)MkConst(symbol, sort);
2235 }
Expr MkConst(Symbol name, Sort range)
Creates a new Constant of sort range and named name .
Definition Context.cs:842
ArraySort MkArraySort(Sort domain, Sort range)
Create a new array sort.
Definition Context.cs:293
IntSymbol MkSymbol(int i)
Creates a new symbol using an integer.
Definition Context.cs:111

◆ MkArrayConst() [2/2]

ArrayExpr MkArrayConst ( Symbol  name,
Sort  domain,
Sort  range 
)
inline

Create an array constant.

Definition at line 2214 of file Context.cs.

2215 {
2216 Debug.Assert(name != null);
2217 Debug.Assert(domain != null);
2218 Debug.Assert(range != null);
2219
2220 using var sort = MkArraySort(domain, range);
2221 return (ArrayExpr)MkConst(name, sort);
2222 }

◆ MkArrayExt()

Expr MkArrayExt ( ArrayExpr  arg1,
ArrayExpr  arg2 
)
inline

Create Extentionality index. Two arrays are equal if and only if they are equal on the index returned by MkArrayExt.

Definition at line 2403 of file Context.cs.

2404 {
2405 Debug.Assert(arg1 != null);
2406 Debug.Assert(arg2 != null);
2407
2408 CheckContextMatch(arg1);
2409 CheckContextMatch(arg2);
2410 return Expr.Create(this, Native.Z3_mk_array_ext(nCtx, arg1.NativeObject, arg2.NativeObject));
2411 }

◆ MkArraySort() [1/2]

ArraySort MkArraySort ( Sort  domain,
Sort  range 
)
inline

Create a new array sort.

Definition at line 293 of file Context.cs.

294 {
295 Debug.Assert(domain != null);
296 Debug.Assert(range != null);
297
298 CheckContextMatch(domain);
299 CheckContextMatch(range);
300 return new ArraySort(this, domain, range);
301 }
ArraySort(*sig)
Definition z3py.py:5050

Referenced by Context.MkArrayConst(), and Context.MkArrayConst().

◆ MkArraySort() [2/2]

ArraySort MkArraySort ( Sort[]  domain,
Sort  range 
)
inline

Create a new n-ary array sort.

Definition at line 306 of file Context.cs.

307 {
308 Debug.Assert(domain != null);
309 Debug.Assert(range != null);
310
311 CheckContextMatch<Sort>(domain);
312 CheckContextMatch(range);
313 return new ArraySort(this, domain, range);
314 }

◆ MkASTMap()

ASTMap MkASTMap ( )
inline

Creates an empty map from ASTs to ASTs.

Definition at line 4110 of file Context.cs.

4111 {
4112 return new ASTMap(this);
4113 }

◆ MkAt()

SeqExpr MkAt ( SeqExpr  s,
Expr  index 
)
inline

Retrieve sequence of length one at index.

Definition at line 2887 of file Context.cs.

2888 {
2889 Debug.Assert(s != null);
2890 Debug.Assert(index != null);
2891 CheckContextMatch(s, index);
2892 return new SeqExpr(this, Native.Z3_mk_seq_at(nCtx, s.NativeObject, index.NativeObject));
2893 }

◆ MkAtLeast()

BoolExpr MkAtLeast ( IEnumerable< BoolExpr >  args,
uint  k 
)
inline

Create an at-least-k constraint.

Definition at line 3201 of file Context.cs.

3202 {
3203 Debug.Assert(args != null);
3204 var ts = args.ToArray();
3205 CheckContextMatch<BoolExpr>(ts);
3206 return new BoolExpr(this, Native.Z3_mk_atleast(nCtx, (uint)ts.Length,
3207 AST.ArrayToNative(ts), k));
3208 }

◆ MkAtMost()

BoolExpr MkAtMost ( IEnumerable< BoolExpr >  args,
uint  k 
)
inline

Create an at-most-k constraint.

Definition at line 3189 of file Context.cs.

3190 {
3191 Debug.Assert(args != null);
3192 var ts = args.ToArray();
3193 CheckContextMatch<BoolExpr>(ts);
3194 return new BoolExpr(this, Native.Z3_mk_atmost(nCtx, (uint)ts.Length,
3195 AST.ArrayToNative(ts), k));
3196 }

◆ MkBitVecSort()

BitVecSort MkBitVecSort ( uint  size)
inline

Create a new bit-vector sort.

Definition at line 267 of file Context.cs.

268 {
269 return new BitVecSort(this, Native.Z3_mk_bv_sort(nCtx, size));
270 }
BitVecSort(sz, ctx=None)
Definition z3py.py:4293

Referenced by Context.MkBV(), Context.MkBV(), Context.MkBV(), Context.MkBV(), Context.MkBV(), Context.MkBVConst(), and Context.MkBVConst().

◆ MkBool()

BoolExpr MkBool ( bool  value)
inline

Creates a Boolean value.

Definition at line 1041 of file Context.cs.

1042 {
1043 return value ? MkTrue() : MkFalse();
1044 }
BoolExpr MkTrue()
The true Term.
Definition Context.cs:1025
BoolExpr MkFalse()
The false Term.
Definition Context.cs:1033

◆ MkBoolConst() [1/2]

BoolExpr MkBoolConst ( string  name)
inline

Create a Boolean constant.

Definition at line 900 of file Context.cs.

901 {
902 using var symbol = MkSymbol(name);
903 return (BoolExpr)MkConst(symbol, BoolSort);
904 }
BoolSort BoolSort
Retrieves the Boolean sort of the context.
Definition Context.cs:148

◆ MkBoolConst() [2/2]

BoolExpr MkBoolConst ( Symbol  name)
inline

Create a Boolean constant.

Definition at line 890 of file Context.cs.

891 {
892 Debug.Assert(name != null);
893
894 return (BoolExpr)MkConst(name, BoolSort);
895 }

◆ MkBoolSort()

BoolSort MkBoolSort ( )
inline

Create a new Boolean sort.

Definition at line 216 of file Context.cs.

217 {
218 return new BoolSort(this);
219 }

◆ MkBound()

Expr MkBound ( uint  index,
Sort  ty 
)
inline

Creates a new bound variable.

Parameters
indexThe de-Bruijn index of the variable
tyThe sort of the variable

Definition at line 815 of file Context.cs.

816 {
817 Debug.Assert(ty != null);
818
819 return Expr.Create(this, Native.Z3_mk_bound(nCtx, index, ty.NativeObject));
820 }

◆ MkBV() [1/6]

BitVecNum MkBV ( bool[]  bits)
inline

Create a bit-vector numeral.

Parameters
bitsAn array of bits representing the bit-vector. Least significant bit is at position 0.

Definition at line 3518 of file Context.cs.

3519 {
3520 byte[] _bits = new byte[bits.Length];
3521 for (int i = 0; i < bits.Length; ++i) _bits[i] = (byte)(bits[i] ? 1 : 0);
3522 return (BitVecNum)Expr.Create(this, Native.Z3_mk_bv_numeral(nCtx, (uint)bits.Length, _bits));
3523 }

◆ MkBV() [2/6]

BitVecNum MkBV ( int  v,
uint  size 
)
inline

Create a bit-vector numeral.

Parameters
vvalue of the numeral.
sizethe size of the bit-vector

Definition at line 3475 of file Context.cs.

3476 {
3477 using var sort = MkBitVecSort(size);
3478 return (BitVecNum)MkNumeral(v, sort);
3479 }
BitVecSort MkBitVecSort(uint size)
Create a new bit-vector sort.
Definition Context.cs:267
Expr MkNumeral(string v, Sort ty)
Create a Term of a given sort.
Definition Context.cs:3261

◆ MkBV() [3/6]

BitVecNum MkBV ( long  v,
uint  size 
)
inline

Create a bit-vector numeral.

Parameters
vvalue of the numeral.
sizethe size of the bit-vector

Definition at line 3497 of file Context.cs.

3498 {
3499 using var sort = MkBitVecSort(size);
3500 return (BitVecNum)MkNumeral(v, sort);
3501 }

◆ MkBV() [4/6]

BitVecNum MkBV ( string  v,
uint  size 
)
inline

Create a bit-vector numeral.

Parameters
vA string representing the value in decimal notation.
sizethe size of the bit-vector

Definition at line 3464 of file Context.cs.

3465 {
3466 using var sort = MkBitVecSort(size);
3467 return (BitVecNum)MkNumeral(v, sort);
3468 }

◆ MkBV() [5/6]

BitVecNum MkBV ( uint  v,
uint  size 
)
inline

Create a bit-vector numeral.

Parameters
vvalue of the numeral.
sizethe size of the bit-vector

Definition at line 3486 of file Context.cs.

3487 {
3488 using var sort = MkBitVecSort(size);
3489 return (BitVecNum)MkNumeral(v, sort);
3490 }

◆ MkBV() [6/6]

BitVecNum MkBV ( ulong  v,
uint  size 
)
inline

Create a bit-vector numeral.

Parameters
vvalue of the numeral.
sizethe size of the bit-vector

Definition at line 3508 of file Context.cs.

3509 {
3510 using var sort = MkBitVecSort(size);
3511 return (BitVecNum)MkNumeral(v, sort);
3512 }

◆ MkBV2Int()

IntExpr MkBV2Int ( BitVecExpr  t,
bool signed   
)
inline

Create an integer from the bit-vector argument t .

If is_signed is false, then the bit-vector t1 is treated as unsigned. So the result is non-negative and in the range [0..2^N-1], where N are the number of bits in t . If is_signed is true, 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.

Definition at line 2075 of file Context.cs.

2076 {
2077 Debug.Assert(t != null);
2078
2079 CheckContextMatch(t);
2080 return new IntExpr(this, Native.Z3_mk_bv2int(nCtx, t.NativeObject, (byte)(signed ? 1 : 0)));
2081 }

◆ MkBVAdd()

BitVecExpr MkBVAdd ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement addition.

The arguments must have the same bit-vector sort.

Definition at line 1563 of file Context.cs.

1564 {
1565 Debug.Assert(t1 != null);
1566 Debug.Assert(t2 != null);
1567
1568 CheckContextMatch(t1);
1569 CheckContextMatch(t2);
1570 return new BitVecExpr(this, Native.Z3_mk_bvadd(nCtx, t1.NativeObject, t2.NativeObject));
1571 }

◆ MkBVAddNoOverflow()

BoolExpr MkBVAddNoOverflow ( BitVecExpr  t1,
BitVecExpr  t2,
bool  isSigned 
)
inline

Create a predicate that checks that the bit-wise addition does not overflow.

The arguments must be of bit-vector sort.

Definition at line 2089 of file Context.cs.

2090 {
2091 Debug.Assert(t1 != null);
2092 Debug.Assert(t2 != null);
2093
2094 CheckContextMatch(t1);
2095 CheckContextMatch(t2);
2096 return new BoolExpr(this, Native.Z3_mk_bvadd_no_overflow(nCtx, t1.NativeObject, t2.NativeObject, (byte)(isSigned ? 1 : 0)));
2097 }

◆ MkBVAddNoUnderflow()

BoolExpr MkBVAddNoUnderflow ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Create a predicate that checks that the bit-wise addition does not underflow.

The arguments must be of bit-vector sort.

Definition at line 2105 of file Context.cs.

2106 {
2107 Debug.Assert(t1 != null);
2108 Debug.Assert(t2 != null);
2109
2110 CheckContextMatch(t1);
2111 CheckContextMatch(t2);
2112 return new BoolExpr(this, Native.Z3_mk_bvadd_no_underflow(nCtx, t1.NativeObject, t2.NativeObject));
2113 }

◆ MkBVAND()

BitVecExpr MkBVAND ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise conjunction.

The arguments must have a bit-vector sort.

Definition at line 1467 of file Context.cs.

1468 {
1469 Debug.Assert(t1 != null);
1470 Debug.Assert(t2 != null);
1471
1472 CheckContextMatch(t1);
1473 CheckContextMatch(t2);
1474 return new BitVecExpr(this, Native.Z3_mk_bvand(nCtx, t1.NativeObject, t2.NativeObject));
1475 }

◆ MkBVASHR()

BitVecExpr MkBVASHR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Arithmetic shift right.

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.

Definition at line 1968 of file Context.cs.

1969 {
1970 Debug.Assert(t1 != null);
1971 Debug.Assert(t2 != null);
1972
1973 CheckContextMatch(t1);
1974 CheckContextMatch(t2);
1975 return new BitVecExpr(this, Native.Z3_mk_bvashr(nCtx, t1.NativeObject, t2.NativeObject));
1976 }

◆ MkBVConst() [1/2]

BitVecExpr MkBVConst ( string  name,
uint  size 
)
inline

Creates a bit-vector constant.

Definition at line 992 of file Context.cs.

993 {
994 using var sort = MkBitVecSort(size);
995 return (BitVecExpr)MkConst(name, sort);
996 }

◆ MkBVConst() [2/2]

BitVecExpr MkBVConst ( Symbol  name,
uint  size 
)
inline

Creates a bit-vector constant.

Definition at line 981 of file Context.cs.

982 {
983 Debug.Assert(name != null);
984
985 using var sort = MkBitVecSort(size);
986 return (BitVecExpr)MkConst(name, sort);
987 }

◆ MkBVLSHR()

BitVecExpr MkBVLSHR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Logical shift right.

It is equivalent to unsigned division by 2^x where x is the value of t2 .

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.

Definition at line 1944 of file Context.cs.

1945 {
1946 Debug.Assert(t1 != null);
1947 Debug.Assert(t2 != null);
1948
1949 CheckContextMatch(t1);
1950 CheckContextMatch(t2);
1951 return new BitVecExpr(this, Native.Z3_mk_bvlshr(nCtx, t1.NativeObject, t2.NativeObject));
1952 }

◆ MkBVMul()

BitVecExpr MkBVMul ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement multiplication.

The arguments must have the same bit-vector sort.

Definition at line 1591 of file Context.cs.

1592 {
1593 Debug.Assert(t1 != null);
1594 Debug.Assert(t2 != null);
1595
1596 CheckContextMatch(t1);
1597 CheckContextMatch(t2);
1598 return new BitVecExpr(this, Native.Z3_mk_bvmul(nCtx, t1.NativeObject, t2.NativeObject));
1599 }

◆ MkBVMulNoOverflow()

BoolExpr MkBVMulNoOverflow ( BitVecExpr  t1,
BitVecExpr  t2,
bool  isSigned 
)
inline

Create a predicate that checks that the bit-wise multiplication does not overflow.

The arguments must be of bit-vector sort.

Definition at line 2183 of file Context.cs.

2184 {
2185 Debug.Assert(t1 != null);
2186 Debug.Assert(t2 != null);
2187
2188 CheckContextMatch(t1);
2189 CheckContextMatch(t2);
2190 return new BoolExpr(this, Native.Z3_mk_bvmul_no_overflow(nCtx, t1.NativeObject, t2.NativeObject, (byte)(isSigned ? 1 : 0)));
2191 }

◆ MkBVMulNoUnderflow()

BoolExpr MkBVMulNoUnderflow ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Create a predicate that checks that the bit-wise multiplication does not underflow.

The arguments must be of bit-vector sort.

Definition at line 2199 of file Context.cs.

2200 {
2201 Debug.Assert(t1 != null);
2202 Debug.Assert(t2 != null);
2203
2204 CheckContextMatch(t1);
2205 CheckContextMatch(t2);
2206 return new BoolExpr(this, Native.Z3_mk_bvmul_no_underflow(nCtx, t1.NativeObject, t2.NativeObject));
2207 }

◆ MkBVNAND()

BitVecExpr MkBVNAND ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise NAND.

The arguments must have a bit-vector sort.

Definition at line 1509 of file Context.cs.

1510 {
1511 Debug.Assert(t1 != null);
1512 Debug.Assert(t2 != null);
1513
1514 CheckContextMatch(t1);
1515 CheckContextMatch(t2);
1516 return new BitVecExpr(this, Native.Z3_mk_bvnand(nCtx, t1.NativeObject, t2.NativeObject));
1517 }

◆ MkBVNeg()

BitVecExpr MkBVNeg ( BitVecExpr  t)
inline

Standard two's complement unary minus.

The arguments must have a bit-vector sort.

Definition at line 1551 of file Context.cs.

1552 {
1553 Debug.Assert(t != null);
1554
1555 CheckContextMatch(t);
1556 return new BitVecExpr(this, Native.Z3_mk_bvneg(nCtx, t.NativeObject));
1557 }

◆ MkBVNegNoOverflow()

BoolExpr MkBVNegNoOverflow ( BitVecExpr  t)
inline

Create a predicate that checks that the bit-wise negation does not overflow.

The arguments must be of bit-vector sort.

Definition at line 2169 of file Context.cs.

2170 {
2171 Debug.Assert(t != null);
2172
2173 CheckContextMatch(t);
2174 return new BoolExpr(this, Native.Z3_mk_bvneg_no_overflow(nCtx, t.NativeObject));
2175 }

◆ MkBVNOR()

BitVecExpr MkBVNOR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise NOR.

The arguments must have a bit-vector sort.

Definition at line 1523 of file Context.cs.

1524 {
1525 Debug.Assert(t1 != null);
1526 Debug.Assert(t2 != null);
1527
1528 CheckContextMatch(t1);
1529 CheckContextMatch(t2);
1530 return new BitVecExpr(this, Native.Z3_mk_bvnor(nCtx, t1.NativeObject, t2.NativeObject));
1531 }

◆ MkBVNot()

BitVecExpr MkBVNot ( BitVecExpr  t)
inline

Bitwise negation.

The argument must have a bit-vector sort.

Definition at line 1431 of file Context.cs.

1432 {
1433 Debug.Assert(t != null);
1434
1435 CheckContextMatch(t);
1436 return new BitVecExpr(this, Native.Z3_mk_bvnot(nCtx, t.NativeObject));
1437 }

◆ MkBVOR()

BitVecExpr MkBVOR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise disjunction.

The arguments must have a bit-vector sort.

Definition at line 1481 of file Context.cs.

1482 {
1483 Debug.Assert(t1 != null);
1484 Debug.Assert(t2 != null);
1485
1486 CheckContextMatch(t1);
1487 CheckContextMatch(t2);
1488 return new BitVecExpr(this, Native.Z3_mk_bvor(nCtx, t1.NativeObject, t2.NativeObject));
1489 }

◆ MkBVRedAND()

BitVecExpr MkBVRedAND ( BitVecExpr  t)
inline

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

The argument must have a bit-vector sort.

Definition at line 1443 of file Context.cs.

1444 {
1445 Debug.Assert(t != null);
1446
1447 CheckContextMatch(t);
1448 return new BitVecExpr(this, Native.Z3_mk_bvredand(nCtx, t.NativeObject));
1449 }

◆ MkBVRedOR()

BitVecExpr MkBVRedOR ( BitVecExpr  t)
inline

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

The argument must have a bit-vector sort.

Definition at line 1455 of file Context.cs.

1456 {
1457 Debug.Assert(t != null);
1458
1459 CheckContextMatch(t);
1460 return new BitVecExpr(this, Native.Z3_mk_bvredor(nCtx, t.NativeObject));
1461 }

◆ MkBVRotateLeft() [1/2]

BitVecExpr MkBVRotateLeft ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Rotate Left.

Rotate bits of t1 to the left t2 times. The arguments must have the same bit-vector sort.

Definition at line 2015 of file Context.cs.

2016 {
2017 Debug.Assert(t1 != null);
2018 Debug.Assert(t2 != null);
2019
2020 CheckContextMatch(t1);
2021 CheckContextMatch(t2);
2022 return new BitVecExpr(this, Native.Z3_mk_ext_rotate_left(nCtx, t1.NativeObject, t2.NativeObject));
2023 }

◆ MkBVRotateLeft() [2/2]

BitVecExpr MkBVRotateLeft ( uint  i,
BitVecExpr  t 
)
inline

Rotate Left.

Rotate bits of t to the left i times. The argument t must have a bit-vector sort.

Definition at line 1985 of file Context.cs.

1986 {
1987 Debug.Assert(t != null);
1988
1989 CheckContextMatch(t);
1990 return new BitVecExpr(this, Native.Z3_mk_rotate_left(nCtx, i, t.NativeObject));
1991 }

◆ MkBVRotateRight() [1/2]

BitVecExpr MkBVRotateRight ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Rotate Right.

Rotate bits of t1 to the rightt2 times. The arguments must have the same bit-vector sort.

Definition at line 2032 of file Context.cs.

2033 {
2034 Debug.Assert(t1 != null);
2035 Debug.Assert(t2 != null);
2036
2037 CheckContextMatch(t1);
2038 CheckContextMatch(t2);
2039 return new BitVecExpr(this, Native.Z3_mk_ext_rotate_right(nCtx, t1.NativeObject, t2.NativeObject));
2040 }

◆ MkBVRotateRight() [2/2]

BitVecExpr MkBVRotateRight ( uint  i,
BitVecExpr  t 
)
inline

Rotate Right.

Rotate bits of t to the right i times. The argument t must have a bit-vector sort.

Definition at line 2000 of file Context.cs.

2001 {
2002 Debug.Assert(t != null);
2003
2004 CheckContextMatch(t);
2005 return new BitVecExpr(this, Native.Z3_mk_rotate_right(nCtx, i, t.NativeObject));
2006 }

◆ MkBVSDiv()

BitVecExpr MkBVSDiv ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Signed division.

It is defined in the following way:

  • The floor of t1/t2 if t2 is different from zero, and t1*t2 >= 0.
  • The ceiling of t1/t2 if t2 is different from zero, and t1*t2 < 0.

If t2 is zero, then the result is undefined. The arguments must have the same bit-vector sort.

Definition at line 1633 of file Context.cs.

1634 {
1635 Debug.Assert(t1 != null);
1636 Debug.Assert(t2 != null);
1637
1638 CheckContextMatch(t1);
1639 CheckContextMatch(t2);
1640 return new BitVecExpr(this, Native.Z3_mk_bvsdiv(nCtx, t1.NativeObject, t2.NativeObject));
1641 }

◆ MkBVSDivNoOverflow()

BoolExpr MkBVSDivNoOverflow ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Create a predicate that checks that the bit-wise signed division does not overflow.

The arguments must be of bit-vector sort.

Definition at line 2153 of file Context.cs.

2154 {
2155 Debug.Assert(t1 != null);
2156 Debug.Assert(t2 != null);
2157
2158 CheckContextMatch(t1);
2159 CheckContextMatch(t2);
2160 return new BoolExpr(this, Native.Z3_mk_bvsdiv_no_overflow(nCtx, t1.NativeObject, t2.NativeObject));
2161 }

◆ MkBVSGE()

BoolExpr MkBVSGE ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement signed greater than or equal to.

The arguments must have the same bit-vector sort.

Definition at line 1784 of file Context.cs.

1785 {
1786 Debug.Assert(t1 != null);
1787 Debug.Assert(t2 != null);
1788
1789 CheckContextMatch(t1);
1790 CheckContextMatch(t2);
1791 return new BoolExpr(this, Native.Z3_mk_bvsge(nCtx, t1.NativeObject, t2.NativeObject));
1792 }

◆ MkBVSGT()

BoolExpr MkBVSGT ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement signed greater-than.

The arguments must have the same bit-vector sort.

Definition at line 1816 of file Context.cs.

1817 {
1818 Debug.Assert(t1 != null);
1819 Debug.Assert(t2 != null);
1820
1821 CheckContextMatch(t1);
1822 CheckContextMatch(t2);
1823 return new BoolExpr(this, Native.Z3_mk_bvsgt(nCtx, t1.NativeObject, t2.NativeObject));
1824 }

◆ MkBVSHL()

BitVecExpr MkBVSHL ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Shift left.

It is equivalent to multiplication by 2^x where x is the value of t2 .

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.

Definition at line 1922 of file Context.cs.

1923 {
1924 Debug.Assert(t1 != null);
1925 Debug.Assert(t2 != null);
1926
1927 CheckContextMatch(t1);
1928 CheckContextMatch(t2);
1929 return new BitVecExpr(this, Native.Z3_mk_bvshl(nCtx, t1.NativeObject, t2.NativeObject));
1930 }

◆ MkBVSLE()

BoolExpr MkBVSLE ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement signed less-than or equal to.

The arguments must have the same bit-vector sort.

Definition at line 1752 of file Context.cs.

1753 {
1754 Debug.Assert(t1 != null);
1755 Debug.Assert(t2 != null);
1756
1757 CheckContextMatch(t1);
1758 CheckContextMatch(t2);
1759 return new BoolExpr(this, Native.Z3_mk_bvsle(nCtx, t1.NativeObject, t2.NativeObject));
1760 }

◆ MkBVSLT()

BoolExpr MkBVSLT ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement signed less-than.

The arguments must have the same bit-vector sort.

Definition at line 1720 of file Context.cs.

1721 {
1722 Debug.Assert(t1 != null);
1723 Debug.Assert(t2 != null);
1724
1725 CheckContextMatch(t1);
1726 CheckContextMatch(t2);
1727 return new BoolExpr(this, Native.Z3_mk_bvslt(nCtx, t1.NativeObject, t2.NativeObject));
1728 }

◆ MkBVSMod()

BitVecExpr MkBVSMod ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

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

If t2 is zero, then the result is undefined. The arguments must have the same bit-vector sort.

Definition at line 1688 of file Context.cs.

1689 {
1690 Debug.Assert(t1 != null);
1691 Debug.Assert(t2 != null);
1692
1693 CheckContextMatch(t1);
1694 CheckContextMatch(t2);
1695 return new BitVecExpr(this, Native.Z3_mk_bvsmod(nCtx, t1.NativeObject, t2.NativeObject));
1696 }

◆ MkBVSRem()

BitVecExpr MkBVSRem ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Signed remainder.

It is defined as t1 - (t1 /s t2) * t2, where /s represents signed division. The most significant bit (sign) of the result is equal to the most significant bit of t1.

If t2 is zero, then the result is undefined. The arguments must have the same bit-vector sort.

Definition at line 1671 of file Context.cs.

1672 {
1673 Debug.Assert(t1 != null);
1674 Debug.Assert(t2 != null);
1675
1676 CheckContextMatch(t1);
1677 CheckContextMatch(t2);
1678 return new BitVecExpr(this, Native.Z3_mk_bvsrem(nCtx, t1.NativeObject, t2.NativeObject));
1679 }

◆ MkBVSub()

BitVecExpr MkBVSub ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement subtraction.

The arguments must have the same bit-vector sort.

Definition at line 1577 of file Context.cs.

1578 {
1579 Debug.Assert(t1 != null);
1580 Debug.Assert(t2 != null);
1581
1582 CheckContextMatch(t1);
1583 CheckContextMatch(t2);
1584 return new BitVecExpr(this, Native.Z3_mk_bvsub(nCtx, t1.NativeObject, t2.NativeObject));
1585 }

◆ MkBVSubNoOverflow()

BoolExpr MkBVSubNoOverflow ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Create a predicate that checks that the bit-wise subtraction does not overflow.

The arguments must be of bit-vector sort.

Definition at line 2121 of file Context.cs.

2122 {
2123 Debug.Assert(t1 != null);
2124 Debug.Assert(t2 != null);
2125
2126 CheckContextMatch(t1);
2127 CheckContextMatch(t2);
2128 return new BoolExpr(this, Native.Z3_mk_bvsub_no_overflow(nCtx, t1.NativeObject, t2.NativeObject));
2129 }

◆ MkBVSubNoUnderflow()

BoolExpr MkBVSubNoUnderflow ( BitVecExpr  t1,
BitVecExpr  t2,
bool  isSigned 
)
inline

Create a predicate that checks that the bit-wise subtraction does not underflow.

The arguments must be of bit-vector sort.

Definition at line 2137 of file Context.cs.

2138 {
2139 Debug.Assert(t1 != null);
2140 Debug.Assert(t2 != null);
2141
2142 CheckContextMatch(t1);
2143 CheckContextMatch(t2);
2144 return new BoolExpr(this, Native.Z3_mk_bvsub_no_underflow(nCtx, t1.NativeObject, t2.NativeObject, (byte)(isSigned ? 1 : 0)));
2145 }

◆ MkBVUDiv()

BitVecExpr MkBVUDiv ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Unsigned division.

It is defined as the floor of t1/t2 if t2 is different from zero. If t2 is zero, then the result is undefined. The arguments must have the same bit-vector sort.

Definition at line 1610 of file Context.cs.

1611 {
1612 Debug.Assert(t1 != null);
1613 Debug.Assert(t2 != null);
1614
1615 CheckContextMatch(t1);
1616 CheckContextMatch(t2);
1617 return new BitVecExpr(this, Native.Z3_mk_bvudiv(nCtx, t1.NativeObject, t2.NativeObject));
1618 }

◆ MkBVUGE()

BoolExpr MkBVUGE ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Unsigned greater than or equal to.

The arguments must have the same bit-vector sort.

Definition at line 1768 of file Context.cs.

1769 {
1770 Debug.Assert(t1 != null);
1771 Debug.Assert(t2 != null);
1772
1773 CheckContextMatch(t1);
1774 CheckContextMatch(t2);
1775 return new BoolExpr(this, Native.Z3_mk_bvuge(nCtx, t1.NativeObject, t2.NativeObject));
1776 }

◆ MkBVUGT()

BoolExpr MkBVUGT ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Unsigned greater-than.

The arguments must have the same bit-vector sort.

Definition at line 1800 of file Context.cs.

1801 {
1802 Debug.Assert(t1 != null);
1803 Debug.Assert(t2 != null);
1804
1805 CheckContextMatch(t1);
1806 CheckContextMatch(t2);
1807 return new BoolExpr(this, Native.Z3_mk_bvugt(nCtx, t1.NativeObject, t2.NativeObject));
1808 }

◆ MkBVULE()

BoolExpr MkBVULE ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Unsigned less-than or equal to.

The arguments must have the same bit-vector sort.

Definition at line 1736 of file Context.cs.

1737 {
1738 Debug.Assert(t1 != null);
1739 Debug.Assert(t2 != null);
1740
1741 CheckContextMatch(t1);
1742 CheckContextMatch(t2);
1743 return new BoolExpr(this, Native.Z3_mk_bvule(nCtx, t1.NativeObject, t2.NativeObject));
1744 }

◆ MkBVULT()

BoolExpr MkBVULT ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Unsigned less-than.

The arguments must have the same bit-vector sort.

Definition at line 1704 of file Context.cs.

1705 {
1706 Debug.Assert(t1 != null);
1707 Debug.Assert(t2 != null);
1708
1709 CheckContextMatch(t1);
1710 CheckContextMatch(t2);
1711 return new BoolExpr(this, Native.Z3_mk_bvult(nCtx, t1.NativeObject, t2.NativeObject));
1712 }

◆ MkBVURem()

BitVecExpr MkBVURem ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Unsigned remainder.

It is defined as t1 - (t1 /u t2) * t2, where /u represents unsigned division. If t2 is zero, then the result is undefined. The arguments must have the same bit-vector sort.

Definition at line 1651 of file Context.cs.

1652 {
1653 Debug.Assert(t1 != null);
1654 Debug.Assert(t2 != null);
1655
1656 CheckContextMatch(t1);
1657 CheckContextMatch(t2);
1658 return new BitVecExpr(this, Native.Z3_mk_bvurem(nCtx, t1.NativeObject, t2.NativeObject));
1659 }

◆ MkBVXNOR()

BitVecExpr MkBVXNOR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise XNOR.

The arguments must have a bit-vector sort.

Definition at line 1537 of file Context.cs.

1538 {
1539 Debug.Assert(t1 != null);
1540 Debug.Assert(t2 != null);
1541
1542 CheckContextMatch(t1);
1543 CheckContextMatch(t2);
1544 return new BitVecExpr(this, Native.Z3_mk_bvxnor(nCtx, t1.NativeObject, t2.NativeObject));
1545 }

◆ MkBVXOR()

BitVecExpr MkBVXOR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise XOR.

The arguments must have a bit-vector sort.

Definition at line 1495 of file Context.cs.

1496 {
1497 Debug.Assert(t1 != null);
1498 Debug.Assert(t2 != null);
1499
1500 CheckContextMatch(t1);
1501 CheckContextMatch(t2);
1502 return new BitVecExpr(this, Native.Z3_mk_bvxor(nCtx, t1.NativeObject, t2.NativeObject));
1503 }

◆ MkCharLe()

BoolExpr MkCharLe ( Expr  ch1,
Expr  ch2 
)
inline

Create less than or equal to between two characters.

Definition at line 3139 of file Context.cs.

3140 {
3141 Debug.Assert(ch1 != null);
3142 Debug.Assert(ch2 != null);
3143 return new BoolExpr(this, Native.Z3_mk_char_le(nCtx, ch1.NativeObject, ch2.NativeObject));
3144 }

◆ MkComplement()

ReExpr MkComplement ( ReExpr  re)
inline

Create the complement regular expression.

Definition at line 3051 of file Context.cs.

3052 {
3053 Debug.Assert(re != null);
3054 return new ReExpr(this, Native.Z3_mk_re_complement(nCtx, re.NativeObject));
3055 }

◆ MkComplex()

ComplexExpr MkComplex ( ArithExpr  real,
ArithExpr  imag 
)
inline

Constructs a Complex expression from Int or Real components.

Definition at line 958 of file Context.cs.

959 {
960 CheckContextMatch(real, imag);
961 return new ComplexExpr(this, Native.Z3_mk_complex(nCtx, real.NativeObject, imag.NativeObject));
962 }

◆ MkComplexConst() [1/2]

ComplexExpr MkComplexConst ( string  name)
inline

Creates a Complex constant.

Definition at line 952 of file Context.cs.

953 {
954 return (ComplexExpr)MkConst(name, ComplexSort);
955 }
ComplexSort ComplexSort
Retrieves the Complex sort of the context.
Definition Context.cs:182

◆ MkComplexConst() [2/2]

ComplexExpr MkComplexConst ( Symbol  name)
inline

Creates a Complex constant.

Definition at line 946 of file Context.cs.

947 {
948 return (ComplexExpr)MkConst(name, ComplexSort);
949 }

◆ MkComplexSort()

ComplexSort MkComplexSort ( )
inline

Creates the Complex sort.

Definition at line 259 of file Context.cs.

260 {
261 return new ComplexSort(this);
262 }

◆ MkConcat() [1/3]

BitVecExpr MkConcat ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bit-vector concatenation.

The arguments must have a bit-vector sort.

Returns
The result is a bit-vector of size n1+n2, where n1 (n2) is the size of t1 (t2).

Definition at line 1836 of file Context.cs.

1837 {
1838 Debug.Assert(t1 != null);
1839 Debug.Assert(t2 != null);
1840
1841 CheckContextMatch(t1);
1842 CheckContextMatch(t2);
1843 return new BitVecExpr(this, Native.Z3_mk_concat(nCtx, t1.NativeObject, t2.NativeObject));
1844 }

◆ MkConcat() [2/3]

ReExpr MkConcat ( params ReExpr[]  t)
inline

Create the concatenation of regular languages.

Definition at line 3060 of file Context.cs.

3061 {
3062 Debug.Assert(t != null);
3063 Debug.Assert(t.All(a => a != null));
3064
3065 CheckContextMatch<ReExpr>(t);
3066 return new ReExpr(this, Native.Z3_mk_re_concat(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
3067 }

◆ MkConcat() [3/3]

SeqExpr MkConcat ( params SeqExpr[]  t)
inline

Concatenate sequences.

Definition at line 2799 of file Context.cs.

2800 {
2801 Debug.Assert(t != null);
2802 Debug.Assert(t.All(a => a != null));
2803
2804 CheckContextMatch<SeqExpr>(t);
2805 return new SeqExpr(this, Native.Z3_mk_seq_concat(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
2806 }

◆ MkConst() [1/3]

Expr MkConst ( FuncDecl  f)
inline

Creates a fresh constant from the FuncDecl f .

Parameters
fA decl of a 0-arity function

Definition at line 880 of file Context.cs.

881 {
882 Debug.Assert(f != null);
883
884 return MkApp(f);
885 }

◆ MkConst() [2/3]

Expr MkConst ( string  name,
Sort  range 
)
inline

Creates a new Constant of sort range and named name .

Definition at line 856 of file Context.cs.

857 {
858 Debug.Assert(range != null);
859
860 using var symbol = MkSymbol(name);
861 return MkConst(symbol, range);
862 }

◆ MkConst() [3/3]

Expr MkConst ( Symbol  name,
Sort  range 
)
inline

Creates a new Constant of sort range and named name .

Definition at line 842 of file Context.cs.

843 {
844 Debug.Assert(name != null);
845 Debug.Assert(range != null);
846
847 CheckContextMatch(name);
848 CheckContextMatch(range);
849
850 return Expr.Create(this, Native.Z3_mk_const(nCtx, name.NativeObject, range.NativeObject));
851 }
expr range(expr const &lo, expr const &hi)
Definition z3++.h:4631

Referenced by Context.MkArrayConst(), Context.MkArrayConst(), Context.MkBoolConst(), Context.MkBoolConst(), Context.MkBVConst(), Context.MkBVConst(), Context.MkComplexConst(), Context.MkComplexConst(), Context.MkConst(), Context.MkIntConst(), Context.MkIntConst(), Context.MkRealConst(), and Context.MkRealConst().

◆ MkConstArray()

ArrayExpr MkConstArray ( Sort  domain,
Expr  v 
)
inline

Create a constant array.

The resulting term is an array, such that a selecton an arbitrary index produces the value v.

See also
MkArraySort(Sort, Sort), MkSelect(ArrayExpr, Expr)

Definition at line 2354 of file Context.cs.

2355 {
2356 Debug.Assert(domain != null);
2357 Debug.Assert(v != null);
2358
2359 CheckContextMatch(domain);
2360 CheckContextMatch(v);
2361 return new ArrayExpr(this, Native.Z3_mk_const_array(nCtx, domain.NativeObject, v.NativeObject));
2362 }

◆ MkConstDecl() [1/2]

FuncDecl MkConstDecl ( string  name,
Sort  range 
)
inline

Creates a new constant function declaration.

Definition at line 776 of file Context.cs.

777 {
778 Debug.Assert(range != null);
779
780 CheckContextMatch(range);
781 using var symbol = MkSymbol(name);
782 return new FuncDecl(this, symbol, null, range);
783 }

◆ MkConstDecl() [2/2]

FuncDecl MkConstDecl ( Symbol  name,
Sort  range 
)
inline

Creates a new constant function declaration.

Definition at line 763 of file Context.cs.

764 {
765 Debug.Assert(name != null);
766 Debug.Assert(range != null);
767
768 CheckContextMatch(name);
769 CheckContextMatch(range);
770 return new FuncDecl(this, name, null, range);
771 }

◆ MkConstructor() [1/2]

Constructor MkConstructor ( string  name,
string  recognizer,
string[]  fieldNames = null,
Sort[]  sorts = null,
uint[]  sortRefs = null 
)
inline

Create a datatype constructor.

Parameters
name
recognizer
fieldNames
sorts
sortRefs
Returns

Definition at line 449 of file Context.cs.

450 {
451
452 using var nameSymbol = MkSymbol(name);
453 using var recognizerSymbol = MkSymbol(recognizer);
454 var fieldSymbols = MkSymbols(fieldNames);
455 try
456 {
457 return new Constructor(this, nameSymbol, recognizerSymbol, fieldSymbols, sorts, sortRefs);
458 }
459 finally
460 {
461 foreach (var fieldSymbol in fieldSymbols)
462 fieldSymbol.Dispose();
463 }
464 }

◆ MkConstructor() [2/2]

Constructor MkConstructor ( Symbol  name,
Symbol  recognizer,
Symbol[]  fieldNames = null,
Sort[]  sorts = null,
uint[]  sortRefs = null 
)
inline

Create a datatype constructor.

Parameters
nameconstructor name
recognizername of recognizer function.
fieldNamesnames of the constructor fields.
sortsfield sorts, 0 if the field sort refers to a recursive sort.
sortRefsreference 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.

Definition at line 432 of file Context.cs.

433 {
434 Debug.Assert(name != null);
435 Debug.Assert(recognizer != null);
436
437 return new Constructor(this, name, recognizer, fieldNames, sorts, sortRefs);
438 }

◆ MkContains()

BoolExpr MkContains ( SeqExpr  s1,
SeqExpr  s2 
)
inline

Check for sequence containment of s2 in s1.

Definition at line 2854 of file Context.cs.

2855 {
2856 Debug.Assert(s1 != null);
2857 Debug.Assert(s2 != null);
2858 CheckContextMatch(s1, s2);
2859 return new BoolExpr(this, Native.Z3_mk_seq_contains(nCtx, s1.NativeObject, s2.NativeObject));
2860 }

◆ MkDatatypeSort() [1/2]

DatatypeSort MkDatatypeSort ( string  name,
Constructor[]  constructors 
)
inline

Create a new datatype sort.

Definition at line 484 of file Context.cs.

485 {
486 Debug.Assert(constructors != null);
487 Debug.Assert(constructors.All(c => c != null));
488
489 CheckContextMatch<Constructor>(constructors);
490 using var symbol = MkSymbol(name);
491 return new DatatypeSort(this, symbol, constructors);
492 }
DatatypeSort(name, params=None, ctx=None)
Definition z3py.py:6067

◆ MkDatatypeSort() [2/2]

DatatypeSort MkDatatypeSort ( Symbol  name,
Constructor[]  constructors 
)
inline

Create a new datatype sort.

Definition at line 469 of file Context.cs.

470 {
471 Debug.Assert(name != null);
472 Debug.Assert(constructors != null);
473 Debug.Assert(constructors.All(c => c != null));
474
475
476 CheckContextMatch(name);
477 CheckContextMatch<Constructor>(constructors);
478 return new DatatypeSort(this, name, constructors);
479 }

◆ MkDatatypeSortRef() [1/2]

DatatypeSort MkDatatypeSortRef ( string  name,
Sort[]  parameters = null 
)
inline

Create a forward reference to a datatype sort. This is useful for creating recursive datatypes or parametric datatypes.

Parameters
namename of the datatype sort
parametersoptional array of sort parameters for parametric datatypes

Definition at line 518 of file Context.cs.

519 {
520 using var symbol = MkSymbol(name);
521 return MkDatatypeSortRef(symbol, parameters);
522 }
DatatypeSort MkDatatypeSortRef(Symbol name, Sort[] parameters=null)
Create a forward reference to a datatype sort. This is useful for creating recursive datatypes or par...
Definition Context.cs:500

◆ MkDatatypeSortRef() [2/2]

DatatypeSort MkDatatypeSortRef ( Symbol  name,
Sort[]  parameters = null 
)
inline

Create a forward reference to a datatype sort. This is useful for creating recursive datatypes or parametric datatypes.

Parameters
namename of the datatype sort
parametersoptional array of sort parameters for parametric datatypes

Definition at line 500 of file Context.cs.

501 {
502 Debug.Assert(name != null);
503 CheckContextMatch(name);
504 if (parameters != null)
505 CheckContextMatch<Sort>(parameters);
506
507 var numParams = (parameters == null) ? 0 : (uint)parameters.Length;
508 var paramsNative = (parameters == null) ? null : AST.ArrayToNative(parameters);
509 return new DatatypeSort(this, Native.Z3_mk_datatype_sort(nCtx, name.NativeObject, numParams, paramsNative));
510 }
Length(s)
Definition z3py.py:12110

Referenced by Context.MkDatatypeSortRef().

◆ MkDatatypeSorts() [1/2]

DatatypeSort[] MkDatatypeSorts ( string[]  names,
Constructor  c[][] 
)
inline

Create mutually recursive data-types.

Parameters
names
c
Returns

Definition at line 562 of file Context.cs.

563 {
564 Debug.Assert(names != null);
565 Debug.Assert(c != null);
566 Debug.Assert(names.Length == c.Length);
567 //Debug.Assert(Contract.ForAll(0, c.Length, j => c[j] != null));
568 //Debug.Assert(names.All(name => name != null));
569
570 var symbols = MkSymbols(names);
571 try
572 {
573 return MkDatatypeSorts(symbols, c);
574 }
575 finally
576 {
577 foreach (var symbol in symbols)
578 symbol.Dispose();
579 }
580 }
DatatypeSort[] MkDatatypeSorts(Symbol[] names, Constructor[][] c)
Create mutually recursive datatypes.
Definition Context.cs:529

◆ MkDatatypeSorts() [2/2]

DatatypeSort[] MkDatatypeSorts ( Symbol[]  names,
Constructor  c[][] 
)
inline

Create mutually recursive datatypes.

Parameters
namesnames of datatype sorts
clist of constructors, one list per sort.

Definition at line 529 of file Context.cs.

530 {
531 Debug.Assert(names != null);
532 Debug.Assert(c != null);
533 Debug.Assert(names.Length == c.Length);
534 //Debug.Assert(Contract.ForAll(0, c.Length, j => c[j] != null));
535 Debug.Assert(names.All(name => name != null));
536
537 CheckContextMatch<Symbol>(names);
538 uint n = (uint)names.Length;
539 ConstructorList[] cla = new ConstructorList[n];
540 IntPtr[] n_constr = new IntPtr[n];
541 for (uint i = 0; i < n; i++)
542 {
543 Constructor[] constructor = c[i];
544 CheckContextMatch<Constructor>(constructor);
545 cla[i] = new ConstructorList(this, constructor);
546 n_constr[i] = cla[i].NativeObject;
547 }
548 IntPtr[] n_res = new IntPtr[n];
549 Native.Z3_mk_datatypes(nCtx, n, Symbol.ArrayToNative(names), n_res, n_constr);
550 DatatypeSort[] res = new DatatypeSort[n];
551 for (uint i = 0; i < n; i++)
552 res[i] = new DatatypeSort(this, n_res[i]);
553 return res;
554 }

Referenced by Context.MkDatatypeSorts().

◆ MkDiff()

ReExpr MkDiff ( ReExpr  a,
ReExpr  b 
)
inline

Create a difference regular expression.

Definition at line 3096 of file Context.cs.

3097 {
3098 Debug.Assert(a != null);
3099 Debug.Assert(b != null);
3100 CheckContextMatch(a, b);
3101 return new ReExpr(this, Native.Z3_mk_re_diff(nCtx, a.NativeObject, b.NativeObject));
3102 }

◆ MkDistinct() [1/2]

BoolExpr MkDistinct ( IEnumerable< Expr >  args)
inline

Creates a distinct term.

Definition at line 1074 of file Context.cs.

1075 {
1076 Debug.Assert(args != null);
1077 return MkDistinct(args.ToArray());
1078 }
BoolExpr MkDistinct(params Expr[] args)
Creates a distinct term.
Definition Context.cs:1062

◆ MkDistinct() [2/2]

BoolExpr MkDistinct ( params Expr[]  args)
inline

Creates a distinct term.

Definition at line 1062 of file Context.cs.

1063 {
1064 Debug.Assert(args != null);
1065 Debug.Assert(args.All(a => a != null));
1066
1067 CheckContextMatch<Expr>(args);
1068 return new BoolExpr(this, Native.Z3_mk_distinct(nCtx, (uint)args.Length, AST.ArrayToNative(args)));
1069 }

Referenced by Context.MkDistinct().

◆ MkDiv()

ArithExpr MkDiv ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 / t2.

Definition at line 1278 of file Context.cs.

1279 {
1280 Debug.Assert(t1 != null);
1281 Debug.Assert(t2 != null);
1282
1283 CheckContextMatch(t1);
1284 CheckContextMatch(t2);
1285 return (ArithExpr)Expr.Create(this, Native.Z3_mk_div(nCtx, t1.NativeObject, t2.NativeObject));
1286 }

Referenced by ArithExpr.operator/().

◆ MkEmptyRe()

ReExpr MkEmptyRe ( Sort  s)
inline

Create the empty regular expression. The sort s should be a regular expression.

Definition at line 3108 of file Context.cs.

3109 {
3110 Debug.Assert(s != null);
3111 return new ReExpr(this, Native.Z3_mk_re_empty(nCtx, s.NativeObject));
3112 }

◆ MkEmptySeq()

SeqExpr MkEmptySeq ( Sort  s)
inline

Create the empty sequence.

Definition at line 2731 of file Context.cs.

2732 {
2733 Debug.Assert(s != null);
2734 return new SeqExpr(this, Native.Z3_mk_seq_empty(nCtx, s.NativeObject));
2735 }

◆ MkEmptySet()

ArrayExpr MkEmptySet ( Sort  domain)
inline

Create an empty set.

Definition at line 2430 of file Context.cs.

2431 {
2432 Debug.Assert(domain != null);
2433
2434 CheckContextMatch(domain);
2435 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_empty_set(nCtx, domain.NativeObject));
2436 }

◆ MkEnumSort() [1/2]

EnumSort MkEnumSort ( string  name,
params string[]  enumNames 
)
inline

Create a new enumeration sort.

Definition at line 350 of file Context.cs.

351 {
352 Debug.Assert(enumNames != null);
353
354 var enumSymbols = MkSymbols(enumNames);
355 try
356 {
357 using var symbol = MkSymbol(name);
358 return new EnumSort(this, symbol, enumSymbols);
359 }
360 finally
361 {
362 foreach (var enumSymbol in enumSymbols)
363 enumSymbol.Dispose();
364 }
365 }
EnumSort(name, values, ctx=None)
Definition z3py.py:6116

◆ MkEnumSort() [2/2]

EnumSort MkEnumSort ( Symbol  name,
params Symbol[]  enumNames 
)
inline

Create a new enumeration sort.

Definition at line 335 of file Context.cs.

336 {
337 Debug.Assert(name != null);
338 Debug.Assert(enumNames != null);
339 Debug.Assert(enumNames.All(f => f != null));
340
341
342 CheckContextMatch(name);
343 CheckContextMatch<Symbol>(enumNames);
344 return new EnumSort(this, name, enumNames);
345 }

◆ MkEq()

BoolExpr MkEq ( Expr  x,
Expr  y 
)
inline

Creates the equality x = y .

Definition at line 1049 of file Context.cs.

1050 {
1051 Debug.Assert(x != null);
1052 Debug.Assert(y != null);
1053
1054 CheckContextMatch(x);
1055 CheckContextMatch(y);
1056 return new BoolExpr(this, Native.Z3_mk_eq(nCtx, x.NativeObject, y.NativeObject));
1057 }

◆ MkExists() [1/2]

Quantifier MkExists ( Expr[]  boundConstants,
Expr  body,
uint  weight = 1,
Pattern[]  patterns = null,
Expr[]  noPatterns = null,
Symbol  quantifierID = null,
Symbol  skolemID = null 
)
inline

Create an existential Quantifier.

Creates an existential quantifier using a list of constants that will form the set of bound variables.

See also
MkForall(Sort[], Symbol[], Expr, uint, Pattern[], Expr[], Symbol, Symbol)

Definition at line 3619 of file Context.cs.

3620 {
3621 Debug.Assert(body != null);
3622 Debug.Assert(boundConstants == null || boundConstants.All(n => n != null));
3623 Debug.Assert(patterns == null || patterns.All(p => p != null));
3624 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3625
3626 return new Quantifier(this, false, boundConstants, body, weight, patterns, noPatterns, quantifierID, skolemID);
3627 }

◆ MkExists() [2/2]

Quantifier MkExists ( Sort[]  sorts,
Symbol[]  names,
Expr  body,
uint  weight = 1,
Pattern[]  patterns = null,
Expr[]  noPatterns = null,
Symbol  quantifierID = null,
Symbol  skolemID = null 
)
inline

Create an existential Quantifier.

Creates an existential quantifier using de-Bruijn indexed variables. (MkForall(Sort[], Symbol[], Expr, uint, Pattern[], Expr[], Symbol, Symbol)).

Definition at line 3597 of file Context.cs.

3598 {
3599 Debug.Assert(sorts != null);
3600 Debug.Assert(names != null);
3601 Debug.Assert(body != null);
3602 Debug.Assert(sorts.Length == names.Length);
3603 Debug.Assert(sorts.All(s => s != null));
3604 Debug.Assert(names.All(n => n != null));
3605 Debug.Assert(patterns == null || patterns.All(p => p != null));
3606 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3607
3608 return new Quantifier(this, false, sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
3609 }

Referenced by Context.MkQuantifier(), and Context.MkQuantifier().

◆ MkExtract() [1/2]

SeqExpr MkExtract ( SeqExpr  s,
IntExpr  offset,
IntExpr  length 
)
inline

Extract subsequence.

Definition at line 2909 of file Context.cs.

2910 {
2911 Debug.Assert(s != null);
2912 Debug.Assert(offset != null);
2913 Debug.Assert(length != null);
2914 CheckContextMatch(s, offset, length);
2915 return new SeqExpr(this, Native.Z3_mk_seq_extract(nCtx, s.NativeObject, offset.NativeObject, length.NativeObject));
2916 }

◆ MkExtract() [2/2]

BitVecExpr MkExtract ( uint  high,
uint  low,
BitVecExpr  t 
)
inline

Bit-vector extraction.

Extract the bits high down to low from a bitvector of size m to yield a new bitvector of size n, where n = high - low + 1. The argument t must have a bit-vector sort.

Definition at line 1855 of file Context.cs.

1856 {
1857 Debug.Assert(t != null);
1858
1859 CheckContextMatch(t);
1860 return new BitVecExpr(this, Native.Z3_mk_extract(nCtx, high, low, t.NativeObject));
1861 }

◆ MkFalse()

BoolExpr MkFalse ( )
inline

The false Term.

Definition at line 1033 of file Context.cs.

1034 {
1035 return new BoolExpr(this, Native.Z3_mk_false(nCtx));
1036 }

Referenced by Context.MkBool(), and Context.MkXor().

◆ MkFiniteDomainSort() [1/2]

FiniteDomainSort MkFiniteDomainSort ( string  name,
ulong  size 
)
inline

Create a new finite domain sort.

Returns
The result is a sort

Elements of the sort are created using

See also
MkNumeral(ulong, Sort)

, and the elements range from 0 to size-1.

Parameters
nameThe name used to identify the sort
sizeThe size of the sort

Definition at line 414 of file Context.cs.

415 {
416 using var symbol = MkSymbol(name);
417 return new FiniteDomainSort(this, symbol, size);
418 }
FiniteDomainSort(name, sz, ctx=None)
Definition z3py.py:8566

◆ MkFiniteDomainSort() [2/2]

FiniteDomainSort MkFiniteDomainSort ( Symbol  name,
ulong  size 
)
inline

Create a new finite domain sort.

Returns
The result is a sort

Parameters
nameThe name used to identify the sort
sizeThe size of the sort

Definition at line 398 of file Context.cs.

399 {
400 Debug.Assert(name != null);
401
402 CheckContextMatch(name);
403 return new FiniteDomainSort(this, name, size);
404 }

◆ MkFiniteSetDifference()

Expr MkFiniteSetDifference ( Expr  s1,
Expr  s2 
)
inline

Create the difference of two finite sets.

Definition at line 2638 of file Context.cs.

2639 {
2640 Debug.Assert(s1 != null);
2641 Debug.Assert(s2 != null);
2642
2643 CheckContextMatch(s1);
2644 CheckContextMatch(s2);
2645 return Expr.Create(this, Native.Z3_mk_finite_set_difference(nCtx, s1.NativeObject, s2.NativeObject));
2646 }

◆ MkFiniteSetEmpty()

Expr MkFiniteSetEmpty ( Sort  setSort)
inline

Create an empty finite set.

Definition at line 2590 of file Context.cs.

2591 {
2592 Debug.Assert(setSort != null);
2593
2594 CheckContextMatch(setSort);
2595 return Expr.Create(this, Native.Z3_mk_finite_set_empty(nCtx, setSort.NativeObject));
2596 }

◆ MkFiniteSetFilter()

Expr MkFiniteSetFilter ( Expr  f,
Expr  set 
)
inline

Filter a finite set with a predicate.

Definition at line 2701 of file Context.cs.

2702 {
2703 Debug.Assert(f != null);
2704 Debug.Assert(set != null);
2705
2706 CheckContextMatch(f);
2707 CheckContextMatch(set);
2708 return Expr.Create(this, Native.Z3_mk_finite_set_filter(nCtx, f.NativeObject, set.NativeObject));
2709 }

◆ MkFiniteSetIntersect()

Expr MkFiniteSetIntersect ( Expr  s1,
Expr  s2 
)
inline

Create the intersection of two finite sets.

Definition at line 2625 of file Context.cs.

2626 {
2627 Debug.Assert(s1 != null);
2628 Debug.Assert(s2 != null);
2629
2630 CheckContextMatch(s1);
2631 CheckContextMatch(s2);
2632 return Expr.Create(this, Native.Z3_mk_finite_set_intersect(nCtx, s1.NativeObject, s2.NativeObject));
2633 }

◆ MkFiniteSetMap()

Expr MkFiniteSetMap ( Expr  f,
Expr  set 
)
inline

Map a function over all elements in a finite set.

Definition at line 2688 of file Context.cs.

2689 {
2690 Debug.Assert(f != null);
2691 Debug.Assert(set != null);
2692
2693 CheckContextMatch(f);
2694 CheckContextMatch(set);
2695 return Expr.Create(this, Native.Z3_mk_finite_set_map(nCtx, f.NativeObject, set.NativeObject));
2696 }

◆ MkFiniteSetMember()

BoolExpr MkFiniteSetMember ( Expr  elem,
Expr  set 
)
inline

Check for membership in a finite set.

Definition at line 2651 of file Context.cs.

2652 {
2653 Debug.Assert(elem != null);
2654 Debug.Assert(set != null);
2655
2656 CheckContextMatch(elem);
2657 CheckContextMatch(set);
2658 return (BoolExpr)Expr.Create(this, Native.Z3_mk_finite_set_member(nCtx, elem.NativeObject, set.NativeObject));
2659 }

◆ MkFiniteSetRange()

Expr MkFiniteSetRange ( Expr  low,
Expr  high 
)
inline

Create a finite set containing integers in the range [low, high].

Definition at line 2714 of file Context.cs.

2715 {
2716 Debug.Assert(low != null);
2717 Debug.Assert(high != null);
2718
2719 CheckContextMatch(low);
2720 CheckContextMatch(high);
2721 return Expr.Create(this, Native.Z3_mk_finite_set_range(nCtx, low.NativeObject, high.NativeObject));
2722 }

◆ MkFiniteSetSingleton()

Expr MkFiniteSetSingleton ( Expr  elem)
inline

Create a singleton finite set.

Definition at line 2601 of file Context.cs.

2602 {
2603 Debug.Assert(elem != null);
2604
2605 CheckContextMatch(elem);
2606 return Expr.Create(this, Native.Z3_mk_finite_set_singleton(nCtx, elem.NativeObject));
2607 }

◆ MkFiniteSetSize()

Expr MkFiniteSetSize ( Expr  set)
inline

Get the cardinality of a finite set.

Definition at line 2664 of file Context.cs.

2665 {
2666 Debug.Assert(set != null);
2667
2668 CheckContextMatch(set);
2669 return Expr.Create(this, Native.Z3_mk_finite_set_size(nCtx, set.NativeObject));
2670 }

◆ MkFiniteSetSort()

FiniteSetSort MkFiniteSetSort ( Sort  elemSort)
inline

Create a finite set sort over the given element sort.

Definition at line 2557 of file Context.cs.

2558 {
2559 Debug.Assert(elemSort != null);
2560
2561 CheckContextMatch(elemSort);
2562 return new FiniteSetSort(this, elemSort);
2563 }
FiniteSetSort(elem_sort)
Definition z3py.py:5501

◆ MkFiniteSetSubset()

BoolExpr MkFiniteSetSubset ( Expr  s1,
Expr  s2 
)
inline

Check if one finite set is a subset of another.

Definition at line 2675 of file Context.cs.

2676 {
2677 Debug.Assert(s1 != null);
2678 Debug.Assert(s2 != null);
2679
2680 CheckContextMatch(s1);
2681 CheckContextMatch(s2);
2682 return (BoolExpr)Expr.Create(this, Native.Z3_mk_finite_set_subset(nCtx, s1.NativeObject, s2.NativeObject));
2683 }

◆ MkFiniteSetUnion()

Expr MkFiniteSetUnion ( Expr  s1,
Expr  s2 
)
inline

Create the union of two finite sets.

Definition at line 2612 of file Context.cs.

2613 {
2614 Debug.Assert(s1 != null);
2615 Debug.Assert(s2 != null);
2616
2617 CheckContextMatch(s1);
2618 CheckContextMatch(s2);
2619 return Expr.Create(this, Native.Z3_mk_finite_set_union(nCtx, s1.NativeObject, s2.NativeObject));
2620 }

◆ MkFixedpoint()

Fixedpoint MkFixedpoint ( )
inline

Create a Fixedpoint context.

Definition at line 4499 of file Context.cs.

4500 {
4501
4502 return new Fixedpoint(this);
4503 }

◆ MkForall() [1/2]

Quantifier MkForall ( Expr[]  boundConstants,
Expr  body,
uint  weight = 1,
Pattern[]  patterns = null,
Expr[]  noPatterns = null,
Symbol  quantifierID = null,
Symbol  skolemID = null 
)
inline

Create a universal Quantifier.

Creates a universal quantifier using a list of constants that will form the set of bound variables.

See also
MkForall(Sort[], Symbol[], Expr, uint, Pattern[], Expr[], Symbol, Symbol)

Definition at line 3579 of file Context.cs.

3580 {
3581 Debug.Assert(body != null);
3582 Debug.Assert(boundConstants == null || boundConstants.All(b => b != null));
3583 Debug.Assert(patterns == null || patterns.All(p => p != null));
3584 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3585
3586
3587 return new Quantifier(this, true, boundConstants, body, weight, patterns, noPatterns, quantifierID, skolemID);
3588 }

◆ MkForall() [2/2]

Quantifier MkForall ( Sort[]  sorts,
Symbol[]  names,
Expr  body,
uint  weight = 1,
Pattern[]  patterns = null,
Expr[]  noPatterns = null,
Symbol  quantifierID = null,
Symbol  skolemID = null 
)
inline

Create a universal Quantifier.

Creates a forall formula, where weight is the weight, patterns is an array of patterns, sorts is an array with the sorts of the bound variables, names is an array with the 'names' of the bound variables, and body is 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 using MkBound. Z3 applies the convention that the last element in names and sorts refers to the variable with index 0, the second to last element of names and sorts refers to the variable with index 1, etc.

Parameters
sortsthe sorts of the bound variables.
namesnames of the bound variables
bodythe body of the quantifier.
weightquantifiers are associated with weights indicating the importance of using the quantifier during instantiation. By default, pass the weight 0.
patternsarray containing the patterns created using MkPattern.
noPatternsarray containing the anti-patterns created using MkPattern.
quantifierIDoptional symbol to track quantifier.
skolemIDoptional symbol to track skolem constants.

Definition at line 3555 of file Context.cs.

3556 {
3557 Debug.Assert(sorts != null);
3558 Debug.Assert(names != null);
3559 Debug.Assert(body != null);
3560 Debug.Assert(sorts.Length == names.Length);
3561 Debug.Assert(sorts.All(s => s != null));
3562 Debug.Assert(names.All(n => n != null));
3563 Debug.Assert(patterns == null || patterns.All(p => p != null));
3564 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3565
3566
3567 return new Quantifier(this, true, sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
3568 }

Referenced by Context.MkQuantifier(), and Context.MkQuantifier().

◆ MkFP() [1/6]

FPExpr MkFP ( BitVecExpr  sgn,
BitVecExpr  sig,
BitVecExpr  exp 
)
inline

Create an expression of FloatingPoint sort from three bit-vector expressions.

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.

Parameters
sgnbit-vector term (of size 1) representing the sign.
sigbit-vector term representing the significand.
expbit-vector term representing the exponent.

Definition at line 5089 of file Context.cs.

5090 {
5091 return new FPExpr(this, Native.Z3_mk_fpa_fp(this.nCtx, sgn.NativeObject, sig.NativeObject, exp.NativeObject));
5092 }

◆ MkFP() [2/6]

FPNum MkFP ( bool  sgn,
int  exp,
uint  sig,
FPSort  s 
)
inline

Create a numeral of FloatingPoint sort from a sign bit and two integers.

Parameters
sgnthe sign.
expthe exponent.
sigthe significand.
sFloatingPoint sort.

Definition at line 4810 of file Context.cs.

4811 {
4812 return MkFPNumeral(sgn, exp, sig, s);
4813 }
FPNum MkFPNumeral(float v, FPSort s)
Create a numeral of FloatingPoint sort from a float.
Definition Context.cs:4724

◆ MkFP() [3/6]

FPNum MkFP ( bool  sgn,
Int64  exp,
UInt64  sig,
FPSort  s 
)
inline

Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.

Parameters
sgnthe sign.
expthe exponent.
sigthe significand.
sFloatingPoint sort.

Definition at line 4822 of file Context.cs.

4823 {
4824 return MkFPNumeral(sgn, exp, sig, s);
4825 }

◆ MkFP() [4/6]

FPNum MkFP ( double  v,
FPSort  s 
)
inline

Create a numeral of FloatingPoint sort from a float.

Parameters
vnumeral value.
sFloatingPoint sort.

Definition at line 4788 of file Context.cs.

4789 {
4790 return MkFPNumeral(v, s);
4791 }

◆ MkFP() [5/6]

FPNum MkFP ( float  v,
FPSort  s 
)
inline

Create a numeral of FloatingPoint sort from a float.

Parameters
vnumeral value.
sFloatingPoint sort.

Definition at line 4778 of file Context.cs.

4779 {
4780 return MkFPNumeral(v, s);
4781 }

◆ MkFP() [6/6]

FPNum MkFP ( int  v,
FPSort  s 
)
inline

Create a numeral of FloatingPoint sort from an int.

Parameters
vnumeral value.
sFloatingPoint sort.

Definition at line 4798 of file Context.cs.

4799 {
4800 return MkFPNumeral(v, s);
4801 }

◆ MkFPAbs()

FPExpr MkFPAbs ( FPExpr  t)
inline

Floating-point absolute value.

Parameters
tfloating-point term

Definition at line 4834 of file Context.cs.

4835 {
4836 return new FPExpr(this, Native.Z3_mk_fpa_abs(this.nCtx, t.NativeObject));
4837 }

◆ MkFPAdd()

FPExpr MkFPAdd ( FPRMExpr  rm,
FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point addition.

Parameters
rmrounding mode term
t1floating-point term
t2floating-point term

Definition at line 4854 of file Context.cs.

4855 {
4856 return new FPExpr(this, Native.Z3_mk_fpa_add(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject));
4857 }

◆ MkFPDiv()

FPExpr MkFPDiv ( FPRMExpr  rm,
FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point division.

Parameters
rmrounding mode term
t1floating-point term
t2floating-point term

Definition at line 4887 of file Context.cs.

4888 {
4889 return new FPExpr(this, Native.Z3_mk_fpa_div(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject));
4890 }

◆ MkFPEq()

BoolExpr MkFPEq ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point equality.

Note that this is IEEE 754 equality (as opposed to standard =).

Parameters
t1floating-point term
t2floating-point term

Definition at line 5006 of file Context.cs.

5007 {
5008 return new BoolExpr(this, Native.Z3_mk_fpa_eq(this.nCtx, t1.NativeObject, t2.NativeObject));
5009 }

◆ MkFPFMA()

FPExpr MkFPFMA ( FPRMExpr  rm,
FPExpr  t1,
FPExpr  t2,
FPExpr  t3 
)
inline

Floating-point fused multiply-add.

The result is round((t1 * t2) + t3)

Parameters
rmrounding mode term
t1floating-point term
t2floating-point term
t3floating-point term

Definition at line 4902 of file Context.cs.

4903 {
4904 return new FPExpr(this, Native.Z3_mk_fpa_fma(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject, t3.NativeObject));
4905 }

◆ MkFPGEq()

BoolExpr MkFPGEq ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point greater than or equal.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4983 of file Context.cs.

4984 {
4985 return new BoolExpr(this, Native.Z3_mk_fpa_geq(this.nCtx, t1.NativeObject, t2.NativeObject));
4986 }

◆ MkFPGt()

BoolExpr MkFPGt ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point greater than.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4993 of file Context.cs.

4994 {
4995 return new BoolExpr(this, Native.Z3_mk_fpa_gt(this.nCtx, t1.NativeObject, t2.NativeObject));
4996 }

◆ MkFPInf()

FPNum MkFPInf ( FPSort  s,
bool  negative 
)
inline

Create a floating-point infinity of sort s.

Parameters
sFloatingPoint sort.
negativeindicates whether the result should be negative.

Definition at line 4704 of file Context.cs.

4705 {
4706 return new FPNum(this, Native.Z3_mk_fpa_inf(nCtx, s.NativeObject, (byte)(negative ? 1 : 0)));
4707 }

◆ MkFPIsInfinite()

BoolExpr MkFPIsInfinite ( FPExpr  t)
inline

Predicate indicating whether t is a floating-point number representing +oo or -oo.

Parameters
tfloating-point term

Definition at line 5042 of file Context.cs.

5043 {
5044 return new BoolExpr(this, Native.Z3_mk_fpa_is_infinite(this.nCtx, t.NativeObject));
5045 }

◆ MkFPIsNaN()

BoolExpr MkFPIsNaN ( FPExpr  t)
inline

Predicate indicating whether t is a NaN.

Parameters
tfloating-point term

Definition at line 5051 of file Context.cs.

5052 {
5053 return new BoolExpr(this, Native.Z3_mk_fpa_is_nan(this.nCtx, t.NativeObject));
5054 }

◆ MkFPIsNegative()

BoolExpr MkFPIsNegative ( FPExpr  t)
inline

Predicate indicating whether t is a negative floating-point number.

Parameters
tfloating-point term

Definition at line 5060 of file Context.cs.

5061 {
5062 return new BoolExpr(this, Native.Z3_mk_fpa_is_negative(this.nCtx, t.NativeObject));
5063 }

◆ MkFPIsNormal()

BoolExpr MkFPIsNormal ( FPExpr  t)
inline

Predicate indicating whether t is a normal floating-point number.

Parameters
tfloating-point term

Definition at line 5015 of file Context.cs.

5016 {
5017 return new BoolExpr(this, Native.Z3_mk_fpa_is_normal(this.nCtx, t.NativeObject));
5018 }

◆ MkFPIsPositive()

BoolExpr MkFPIsPositive ( FPExpr  t)
inline

Predicate indicating whether t is a positive floating-point number.

Parameters
tfloating-point term

Definition at line 5069 of file Context.cs.

5070 {
5071 return new BoolExpr(this, Native.Z3_mk_fpa_is_positive(this.nCtx, t.NativeObject));
5072 }

◆ MkFPIsSubnormal()

BoolExpr MkFPIsSubnormal ( FPExpr  t)
inline

Predicate indicating whether t is a subnormal floating-point number.

Parameters
tfloating-point term

Definition at line 5024 of file Context.cs.

5025 {
5026 return new BoolExpr(this, Native.Z3_mk_fpa_is_subnormal(this.nCtx, t.NativeObject));
5027 }

◆ MkFPIsZero()

BoolExpr MkFPIsZero ( FPExpr  t)
inline

Predicate indicating whether t is a floating-point number with zero value, i.e., +0 or -0.

Parameters
tfloating-point term

Definition at line 5033 of file Context.cs.

5034 {
5035 return new BoolExpr(this, Native.Z3_mk_fpa_is_zero(this.nCtx, t.NativeObject));
5036 }

◆ MkFPLEq()

BoolExpr MkFPLEq ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point less than or equal.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4963 of file Context.cs.

4964 {
4965 return new BoolExpr(this, Native.Z3_mk_fpa_leq(this.nCtx, t1.NativeObject, t2.NativeObject));
4966 }

◆ MkFPLt()

BoolExpr MkFPLt ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point less than.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4973 of file Context.cs.

4974 {
4975 return new BoolExpr(this, Native.Z3_mk_fpa_lt(this.nCtx, t1.NativeObject, t2.NativeObject));
4976 }

◆ MkFPMax()

FPExpr MkFPMax ( FPExpr  t1,
FPExpr  t2 
)
inline

Maximum of floating-point numbers.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4953 of file Context.cs.

4954 {
4955 return new FPExpr(this, Native.Z3_mk_fpa_max(this.nCtx, t1.NativeObject, t2.NativeObject));
4956 }

◆ MkFPMin()

FPExpr MkFPMin ( FPExpr  t1,
FPExpr  t2 
)
inline

Minimum of floating-point numbers.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4943 of file Context.cs.

4944 {
4945 return new FPExpr(this, Native.Z3_mk_fpa_min(this.nCtx, t1.NativeObject, t2.NativeObject));
4946 }

◆ MkFPMul()

FPExpr MkFPMul ( FPRMExpr  rm,
FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point multiplication.

Parameters
rmrounding mode term
t1floating-point term
t2floating-point term

Definition at line 4876 of file Context.cs.

4877 {
4878 return new FPExpr(this, Native.Z3_mk_fpa_mul(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject));
4879 }

◆ MkFPNaN()

FPNum MkFPNaN ( FPSort  s)
inline

Create a NaN of sort s.

Parameters
sFloatingPoint sort.

Definition at line 4694 of file Context.cs.

4695 {
4696 return new FPNum(this, Native.Z3_mk_fpa_nan(nCtx, s.NativeObject));
4697 }

◆ MkFPNeg()

FPExpr MkFPNeg ( FPExpr  t)
inline

Floating-point negation.

Parameters
tfloating-point term

Definition at line 4843 of file Context.cs.

4844 {
4845 return new FPExpr(this, Native.Z3_mk_fpa_neg(this.nCtx, t.NativeObject));
4846 }

◆ MkFPNumeral() [1/5]

FPNum MkFPNumeral ( bool  sgn,
Int64  exp,
UInt64  sig,
FPSort  s 
)
inline

Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.

Parameters
sgnthe sign.
sigthe significand.
expthe exponent.
sFloatingPoint sort.

Definition at line 4768 of file Context.cs.

4769 {
4770 return new FPNum(this, Native.Z3_mk_fpa_numeral_int64_uint64(nCtx, (byte)(sgn ? 1 : 0), exp, sig, s.NativeObject));
4771 }

◆ MkFPNumeral() [2/5]

FPNum MkFPNumeral ( bool  sgn,
uint  sig,
int  exp,
FPSort  s 
)
inline

Create a numeral of FloatingPoint sort from a sign bit and two integers.

Parameters
sgnthe sign.
sigthe significand.
expthe exponent.
sFloatingPoint sort.

Definition at line 4756 of file Context.cs.

4757 {
4758 return new FPNum(this, Native.Z3_mk_fpa_numeral_int_uint(nCtx, (byte)(sgn ? 1 : 0), exp, sig, s.NativeObject));
4759 }

◆ MkFPNumeral() [3/5]

FPNum MkFPNumeral ( double  v,
FPSort  s 
)
inline

Create a numeral of FloatingPoint sort from a float.

Parameters
vnumeral value.
sFloatingPoint sort.

Definition at line 4734 of file Context.cs.

4735 {
4736 return new FPNum(this, Native.Z3_mk_fpa_numeral_double(nCtx, v, s.NativeObject));
4737 }

◆ MkFPNumeral() [4/5]

FPNum MkFPNumeral ( float  v,
FPSort  s 
)
inline

Create a numeral of FloatingPoint sort from a float.

Parameters
vnumeral value.
sFloatingPoint sort.

Definition at line 4724 of file Context.cs.

4725 {
4726 return new FPNum(this, Native.Z3_mk_fpa_numeral_float(nCtx, v, s.NativeObject));
4727 }

Referenced by Context.MkFP(), Context.MkFP(), Context.MkFP(), Context.MkFP(), and Context.MkFP().

◆ MkFPNumeral() [5/5]

FPNum MkFPNumeral ( int  v,
FPSort  s 
)
inline

Create a numeral of FloatingPoint sort from an int.

Parameters
vnumeral value.
sFloatingPoint sort.

Definition at line 4744 of file Context.cs.

4745 {
4746 return new FPNum(this, Native.Z3_mk_fpa_numeral_int(nCtx, v, s.NativeObject));
4747 }

◆ MkFPRem()

FPExpr MkFPRem ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point remainder.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4922 of file Context.cs.

4923 {
4924 return new FPExpr(this, Native.Z3_mk_fpa_rem(this.nCtx, t1.NativeObject, t2.NativeObject));
4925 }

◆ MkFPRNA()

FPRMNum MkFPRNA ( )
inline

Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.

Definition at line 4558 of file Context.cs.

4559 {
4560 return new FPRMNum(this, Native.Z3_mk_fpa_rna(nCtx));
4561 }

◆ MkFPRNE()

FPRMNum MkFPRNE ( )
inline

Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.

Definition at line 4542 of file Context.cs.

4543 {
4544 return new FPRMNum(this, Native.Z3_mk_fpa_rne(nCtx));
4545 }

◆ MkFPRoundingModeSort()

FPRMSort MkFPRoundingModeSort ( )
inline

Create the floating-point RoundingMode sort.

Definition at line 4524 of file Context.cs.

4525 {
4526 return new FPRMSort(this);
4527 }

◆ MkFPRoundNearestTiesToAway()

FPRMNum MkFPRoundNearestTiesToAway ( )
inline

Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.

Definition at line 4550 of file Context.cs.

4551 {
4552 return new FPRMNum(this, Native.Z3_mk_fpa_round_nearest_ties_to_away(nCtx));
4553 }

◆ MkFPRoundNearestTiesToEven()

FPRMExpr MkFPRoundNearestTiesToEven ( )
inline

Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.

Definition at line 4534 of file Context.cs.

4535 {
4536 return new FPRMExpr(this, Native.Z3_mk_fpa_round_nearest_ties_to_even(nCtx));
4537 }

◆ MkFPRoundToIntegral()

FPExpr MkFPRoundToIntegral ( FPRMExpr  rm,
FPExpr  t 
)
inline

Floating-point roundToIntegral. Rounds a floating-point number to the closest integer, again represented as a floating-point number.

Parameters
rmterm of RoundingMode sort
tfloating-point term

Definition at line 4933 of file Context.cs.

4934 {
4935 return new FPExpr(this, Native.Z3_mk_fpa_round_to_integral(this.nCtx, rm.NativeObject, t.NativeObject));
4936 }

◆ MkFPRoundTowardNegative()

FPRMNum MkFPRoundTowardNegative ( )
inline

Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode.

Definition at line 4582 of file Context.cs.

4583 {
4584 return new FPRMNum(this, Native.Z3_mk_fpa_round_toward_negative(nCtx));
4585 }

◆ MkFPRoundTowardPositive()

FPRMNum MkFPRoundTowardPositive ( )
inline

Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode.

Definition at line 4566 of file Context.cs.

4567 {
4568 return new FPRMNum(this, Native.Z3_mk_fpa_round_toward_positive(nCtx));
4569 }

◆ MkFPRoundTowardZero()

FPRMNum MkFPRoundTowardZero ( )
inline

Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode.

Definition at line 4598 of file Context.cs.

4599 {
4600 return new FPRMNum(this, Native.Z3_mk_fpa_round_toward_zero(nCtx));
4601 }

◆ MkFPRTN()

FPRMNum MkFPRTN ( )
inline

Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode.

Definition at line 4590 of file Context.cs.

4591 {
4592 return new FPRMNum(this, Native.Z3_mk_fpa_rtn(nCtx));
4593 }

◆ MkFPRTP()

FPRMNum MkFPRTP ( )
inline

Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode.

Definition at line 4574 of file Context.cs.

4575 {
4576 return new FPRMNum(this, Native.Z3_mk_fpa_rtp(nCtx));
4577 }

◆ MkFPRTZ()

FPRMNum MkFPRTZ ( )
inline

Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode.

Definition at line 4606 of file Context.cs.

4607 {
4608 return new FPRMNum(this, Native.Z3_mk_fpa_rtz(nCtx));
4609 }

◆ MkFPSort()

FPSort MkFPSort ( uint  ebits,
uint  sbits 
)
inline

Create a FloatingPoint sort.

Parameters
ebitsexponent bits in the FloatingPoint sort.
sbitssignificand bits in the FloatingPoint sort.

Definition at line 4619 of file Context.cs.

4620 {
4621 return new FPSort(this, ebits, sbits);
4622 }
FPSort(ebits, sbits, ctx=None)
Definition z3py.py:10867

◆ MkFPSort128()

FPSort MkFPSort128 ( )
inline

Create the quadruple-precision (128-bit) FloatingPoint sort.

Definition at line 4683 of file Context.cs.

4684 {
4685 return new FPSort(this, Native.Z3_mk_fpa_sort_128(nCtx));
4686 }

◆ MkFPSort16()

FPSort MkFPSort16 ( )
inline

Create the half-precision (16-bit) FloatingPoint sort.

Definition at line 4635 of file Context.cs.

4636 {
4637 return new FPSort(this, Native.Z3_mk_fpa_sort_16(nCtx));
4638 }

◆ MkFPSort32()

FPSort MkFPSort32 ( )
inline

Create the single-precision (32-bit) FloatingPoint sort.

Definition at line 4651 of file Context.cs.

4652 {
4653 return new FPSort(this, Native.Z3_mk_fpa_sort_32(nCtx));
4654 }

◆ MkFPSort64()

FPSort MkFPSort64 ( )
inline

Create the double-precision (64-bit) FloatingPoint sort.

Definition at line 4667 of file Context.cs.

4668 {
4669 return new FPSort(this, Native.Z3_mk_fpa_sort_64(nCtx));
4670 }

◆ MkFPSortDouble()

FPSort MkFPSortDouble ( )
inline

Create the double-precision (64-bit) FloatingPoint sort.

Definition at line 4659 of file Context.cs.

4660 {
4661 return new FPSort(this, Native.Z3_mk_fpa_sort_double(nCtx));
4662 }

◆ MkFPSortHalf()

FPSort MkFPSortHalf ( )
inline

Create the half-precision (16-bit) FloatingPoint sort.

Definition at line 4627 of file Context.cs.

4628 {
4629 return new FPSort(this, Native.Z3_mk_fpa_sort_half(nCtx));
4630 }

◆ MkFPSortQuadruple()

FPSort MkFPSortQuadruple ( )
inline

Create the quadruple-precision (128-bit) FloatingPoint sort.

Definition at line 4675 of file Context.cs.

4676 {
4677 return new FPSort(this, Native.Z3_mk_fpa_sort_quadruple(nCtx));
4678 }

◆ MkFPSortSingle()

FPSort MkFPSortSingle ( )
inline

Create the single-precision (32-bit) FloatingPoint sort.

Definition at line 4643 of file Context.cs.

4644 {
4645 return new FPSort(this, Native.Z3_mk_fpa_sort_single(nCtx));
4646 }

◆ MkFPSqrt()

FPExpr MkFPSqrt ( FPRMExpr  rm,
FPExpr  t 
)
inline

Floating-point square root.

Parameters
rmrounding mode term
tfloating-point term

Definition at line 4912 of file Context.cs.

4913 {
4914 return new FPExpr(this, Native.Z3_mk_fpa_sqrt(this.nCtx, rm.NativeObject, t.NativeObject));
4915 }

◆ MkFPSub()

FPExpr MkFPSub ( FPRMExpr  rm,
FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point subtraction.

Parameters
rmrounding mode term
t1floating-point term
t2floating-point term

Definition at line 4865 of file Context.cs.

4866 {
4867 return new FPExpr(this, Native.Z3_mk_fpa_sub(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject));
4868 }

◆ MkFPToBV()

BitVecExpr MkFPToBV ( FPRMExpr  rm,
FPExpr  t,
uint  sz,
bool  sign 
)
inline

Conversion of a floating-point term into a bit-vector.

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 sign==true). If necessary, the result will be rounded according to rounding mode rm.

Parameters
rmRoundingMode term.
tFloatingPoint term
szSize of the resulting bit-vector.
signIndicates whether the result is a signed or unsigned bit-vector.

Definition at line 5192 of file Context.cs.

5193 {
5194 if (sign)
5195 return new BitVecExpr(this, Native.Z3_mk_fpa_to_sbv(this.nCtx, rm.NativeObject, t.NativeObject, sz));
5196 else
5197 return new BitVecExpr(this, Native.Z3_mk_fpa_to_ubv(this.nCtx, rm.NativeObject, t.NativeObject, sz));
5198 }

◆ MkFPToFP() [1/6]

FPExpr MkFPToFP ( BitVecExpr  bv,
FPSort  s 
)
inline

Conversion of a single IEEE 754-2008 bit-vector into a floating-point number.

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.

Parameters
bvbit-vector value (of size m).
sFloatingPoint sort (ebits+sbits == m)

Definition at line 5105 of file Context.cs.

5106 {
5107 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_bv(this.nCtx, bv.NativeObject, s.NativeObject));
5108 }

◆ MkFPToFP() [2/6]

FPExpr MkFPToFP ( FPRMExpr  rm,
BitVecExpr  t,
FPSort  s,
bool signed   
)
inline

Conversion of a 2's complement signed bit-vector term into a term of FloatingPoint sort.

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.

Parameters
rmRoundingMode term.
tterm of bit-vector sort.
sFloatingPoint sort.

signed: flag indicating whether t is interpreted as signed or unsigned bit-vector.

Definition at line 5155 of file Context.cs.

5156 {
5157 if (signed)
5158 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_signed(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject));
5159 else
5160 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_unsigned(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject));
5161 }

◆ MkFPToFP() [3/6]

FPExpr MkFPToFP ( FPRMExpr  rm,
FPExpr  t,
FPSort  s 
)
inline

Conversion of a FloatingPoint term into another term of different FloatingPoint sort.

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.

Parameters
rmRoundingMode term.
tFloatingPoint term.
sFloatingPoint sort.

Definition at line 5121 of file Context.cs.

5122 {
5123 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_float(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject));
5124 }

◆ MkFPToFP() [4/6]

BitVecExpr MkFPToFP ( FPRMExpr  rm,
IntExpr  exp,
RealExpr  sig,
FPSort  s 
)
inline

Conversion of a real-sorted significand and an integer-sorted exponent into a term of FloatingPoint sort.

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.

Parameters
rmRoundingMode term.
expExponent term of Int sort.
sigSignificand term of Real sort.
sFloatingPoint sort.

Definition at line 5243 of file Context.cs.

5244 {
5245 return new BitVecExpr(this, Native.Z3_mk_fpa_to_fp_int_real(this.nCtx, rm.NativeObject, exp.NativeObject, sig.NativeObject, s.NativeObject));
5246 }

◆ MkFPToFP() [5/6]

FPExpr MkFPToFP ( FPRMExpr  rm,
RealExpr  t,
FPSort  s 
)
inline

Conversion of a term of real sort into a term of FloatingPoint sort.

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.

Parameters
rmRoundingMode term.
tterm of Real sort.
sFloatingPoint sort.

Definition at line 5137 of file Context.cs.

5138 {
5139 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_real(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject));
5140 }

◆ MkFPToFP() [6/6]

FPExpr MkFPToFP ( FPSort  s,
FPRMExpr  rm,
FPExpr  t 
)
inline

Conversion of a floating-point number to another FloatingPoint sort s.

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.

Parameters
sFloatingPoint sort
rmfloating-point rounding mode term
tfloating-point term

Definition at line 5173 of file Context.cs.

5174 {
5175 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_float(this.nCtx, s.NativeObject, rm.NativeObject, t.NativeObject));
5176 }

◆ MkFPToIEEEBV()

BitVecExpr MkFPToIEEEBV ( FPExpr  t)
inline

Conversion of a floating-point term into a bit-vector term in IEEE 754-2008 format.

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.

Parameters
tFloatingPoint term.

Definition at line 5226 of file Context.cs.

5227 {
5228 return new BitVecExpr(this, Native.Z3_mk_fpa_to_ieee_bv(this.nCtx, t.NativeObject));
5229 }

◆ MkFPToReal()

RealExpr MkFPToReal ( FPExpr  t)
inline

Conversion of a floating-point term into a real-numbered term.

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.

Parameters
tFloatingPoint term

Definition at line 5209 of file Context.cs.

5210 {
5211 return new RealExpr(this, Native.Z3_mk_fpa_to_real(this.nCtx, t.NativeObject));
5212 }

◆ MkFPZero()

FPNum MkFPZero ( FPSort  s,
bool  negative 
)
inline

Create a floating-point zero of sort s.

Parameters
sFloatingPoint sort.
negativeindicates whether the result should be negative.

Definition at line 4714 of file Context.cs.

4715 {
4716 return new FPNum(this, Native.Z3_mk_fpa_zero(nCtx, s.NativeObject, (byte)(negative ? 1 : 0)));
4717 }

◆ MkFreshConst()

Expr MkFreshConst ( string  prefix,
Sort  range 
)
inline

Creates a fresh Constant of sort range and a name prefixed with prefix .

Definition at line 868 of file Context.cs.

869 {
870 Debug.Assert(range != null);
871
872 CheckContextMatch(range);
873 return Expr.Create(this, Native.Z3_mk_fresh_const(nCtx, prefix, range.NativeObject));
874 }

◆ MkFreshConstDecl()

FuncDecl MkFreshConstDecl ( string  prefix,
Sort  range 
)
inline

Creates a fresh constant function declaration with a name prefixed with prefix .

See also
MkFuncDecl(string,Sort,Sort), MkFuncDecl(string,Sort[],Sort)

Definition at line 790 of file Context.cs.

791 {
792 Debug.Assert(range != null);
793
794 CheckContextMatch(range);
795 return new FuncDecl(this, prefix, null, range);
796 }

◆ MkFreshFuncDecl()

FuncDecl MkFreshFuncDecl ( string  prefix,
Sort[]  domain,
Sort  range 
)
inline

Creates a fresh function declaration with a name prefixed with prefix .

See also
MkFuncDecl(string,Sort,Sort), MkFuncDecl(string,Sort[],Sort)

Definition at line 750 of file Context.cs.

751 {
752 Debug.Assert(range != null);
753 Debug.Assert(domain.All(d => d != null));
754
755 CheckContextMatch<Sort>(domain);
756 CheckContextMatch(range);
757 return new FuncDecl(this, prefix, domain, range);
758 }

◆ MkFullRe()

ReExpr MkFullRe ( Sort  s)
inline

Create the full regular expression. The sort s should be a regular expression.

Definition at line 3118 of file Context.cs.

3119 {
3120 Debug.Assert(s != null);
3121 return new ReExpr(this, Native.Z3_mk_re_full(nCtx, s.NativeObject));
3122 }

◆ MkFullSet()

ArrayExpr MkFullSet ( Sort  domain)
inline

Create the full set.

Definition at line 2441 of file Context.cs.

2442 {
2443 Debug.Assert(domain != null);
2444
2445 CheckContextMatch(domain);
2446 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_full_set(nCtx, domain.NativeObject));
2447 }

◆ MkFuncDecl() [1/4]

FuncDecl MkFuncDecl ( string  name,
Sort  domain,
Sort  range 
)
inline

Creates a new function declaration.

Definition at line 733 of file Context.cs.

734 {
735 Debug.Assert(range != null);
736 Debug.Assert(domain != null);
737
738 CheckContextMatch(domain);
739 CheckContextMatch(range);
740 using var symbol = MkSymbol(name);
741 Sort[] q = new Sort[] { domain };
742 return new FuncDecl(this, symbol, q, range);
743 }

◆ MkFuncDecl() [2/4]

FuncDecl MkFuncDecl ( string  name,
Sort[]  domain,
Sort  range 
)
inline

Creates a new function declaration.

Definition at line 690 of file Context.cs.

691 {
692 Debug.Assert(range != null);
693 Debug.Assert(domain.All(d => d != null));
694
695 CheckContextMatch<Sort>(domain);
696 CheckContextMatch(range);
697 using var symbol = MkSymbol(name);
698 return new FuncDecl(this, symbol, domain, range);
699 }

◆ MkFuncDecl() [3/4]

FuncDecl MkFuncDecl ( Symbol  name,
Sort  domain,
Sort  range 
)
inline

Creates a new function declaration.

Definition at line 674 of file Context.cs.

675 {
676 Debug.Assert(name != null);
677 Debug.Assert(domain != null);
678 Debug.Assert(range != null);
679
680 CheckContextMatch(name);
681 CheckContextMatch(domain);
682 CheckContextMatch(range);
683 Sort[] q = new Sort[] { domain };
684 return new FuncDecl(this, name, q, range);
685 }

◆ MkFuncDecl() [4/4]

FuncDecl MkFuncDecl ( Symbol  name,
Sort[]  domain,
Sort  range 
)
inline

Creates a new function declaration.

Definition at line 659 of file Context.cs.

660 {
661 Debug.Assert(name != null);
662 Debug.Assert(range != null);
663 Debug.Assert(domain.All(d => d != null));
664
665 CheckContextMatch(name);
666 CheckContextMatch<Sort>(domain);
667 CheckContextMatch(range);
668 return new FuncDecl(this, name, domain, range);
669 }

◆ MkGe()

BoolExpr MkGe ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 >= t2

Definition at line 1371 of file Context.cs.

1372 {
1373 Debug.Assert(t1 != null);
1374 Debug.Assert(t2 != null);
1375
1376 CheckContextMatch(t1);
1377 CheckContextMatch(t2);
1378 return new BoolExpr(this, Native.Z3_mk_ge(nCtx, t1.NativeObject, t2.NativeObject));
1379 }

Referenced by ArithExpr.operator>=().

◆ MkGoal()

Goal MkGoal ( bool  models = true,
bool  unsatCores = false,
bool  proofs = false 
)
inline

Creates a new Goal.

Note that the Context must have been created with proof generation support if proofs is set to true here.

Parameters
modelsIndicates whether model generation should be enabled.
unsatCoresIndicates whether unsat core generation should be enabled.
proofsIndicates whether proof generation should be enabled.

Definition at line 3826 of file Context.cs.

3827 {
3828
3829 return new Goal(this, models, unsatCores, proofs);
3830 }

◆ MkGt()

BoolExpr MkGt ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 > t2

Definition at line 1358 of file Context.cs.

1359 {
1360 Debug.Assert(t1 != null);
1361 Debug.Assert(t2 != null);
1362
1363 CheckContextMatch(t1);
1364 CheckContextMatch(t2);
1365 return new BoolExpr(this, Native.Z3_mk_gt(nCtx, t1.NativeObject, t2.NativeObject));
1366 }

Referenced by ArithExpr.operator>().

◆ MkIff()

BoolExpr MkIff ( BoolExpr  t1,
BoolExpr  t2 
)
inline

Create an expression representing t1 iff t2.

Definition at line 1111 of file Context.cs.

1112 {
1113 Debug.Assert(t1 != null);
1114 Debug.Assert(t2 != null);
1115
1116 CheckContextMatch(t1);
1117 CheckContextMatch(t2);
1118 return new BoolExpr(this, Native.Z3_mk_iff(nCtx, t1.NativeObject, t2.NativeObject));
1119 }

◆ MkImagPart()

RealExpr MkImagPart ( ArithExpr  value)
inline

Returns the Real-valued imaginary component of a Complex expression.

Definition at line 972 of file Context.cs.

973 {
974 CheckContextMatch(value);
975 return new RealExpr(this, Native.Z3_mk_imag_part(nCtx, value.NativeObject));
976 }

◆ MkImplies()

BoolExpr MkImplies ( BoolExpr  t1,
BoolExpr  t2 
)
inline

Create an expression representing t1 -> t2.

Definition at line 1124 of file Context.cs.

1125 {
1126 Debug.Assert(t1 != null);
1127 Debug.Assert(t2 != null);
1128
1129 CheckContextMatch(t1);
1130 CheckContextMatch(t2);
1131 return new BoolExpr(this, Native.Z3_mk_implies(nCtx, t1.NativeObject, t2.NativeObject));
1132 }

◆ MkIndexOf()

IntExpr MkIndexOf ( SeqExpr  s,
SeqExpr  substr,
ArithExpr  offset 
)
inline

Extract index of sub-string starting at offset.

Definition at line 2921 of file Context.cs.

2922 {
2923 Debug.Assert(s != null);
2924 Debug.Assert(offset != null);
2925 Debug.Assert(substr != null);
2926 CheckContextMatch(s, substr, offset);
2927 return new IntExpr(this, Native.Z3_mk_seq_index(nCtx, s.NativeObject, substr.NativeObject, offset.NativeObject));
2928 }

◆ MkInRe()

BoolExpr MkInRe ( SeqExpr  s,
ReExpr  re 
)
inline

Check for regular expression membership.

Definition at line 3004 of file Context.cs.

3005 {
3006 Debug.Assert(s != null);
3007 Debug.Assert(re != null);
3008 CheckContextMatch(s, re);
3009 return new BoolExpr(this, Native.Z3_mk_seq_in_re(nCtx, s.NativeObject, re.NativeObject));
3010 }

◆ MkInt() [1/5]

IntNum MkInt ( int  v)
inline

Create an integer numeral.

Parameters
vvalue of the numeral.
Returns
A Term with value v and sort Integer

Definition at line 3418 of file Context.cs.

3419 {
3420
3421 return new IntNum(this, Native.Z3_mk_int(nCtx, v, IntSort.NativeObject));
3422 }
IntSort IntSort
Retrieves the Integer sort of the context.
Definition Context.cs:159

◆ MkInt() [2/5]

IntNum MkInt ( long  v)
inline

Create an integer numeral.

Parameters
vvalue of the numeral.
Returns
A Term with value v and sort Integer

Definition at line 3440 of file Context.cs.

3441 {
3442
3443 return new IntNum(this, Native.Z3_mk_int64(nCtx, v, IntSort.NativeObject));
3444 }

◆ MkInt() [3/5]

IntNum MkInt ( string  v)
inline

Create an integer numeral.

Parameters
vA string representing the Term value in decimal notation.

Definition at line 3407 of file Context.cs.

3408 {
3409
3410 return new IntNum(this, Native.Z3_mk_numeral(nCtx, v, IntSort.NativeObject));
3411 }

◆ MkInt() [4/5]

IntNum MkInt ( uint  v)
inline

Create an integer numeral.

Parameters
vvalue of the numeral.
Returns
A Term with value v and sort Integer

Definition at line 3429 of file Context.cs.

3430 {
3431
3432 return new IntNum(this, Native.Z3_mk_unsigned_int(nCtx, v, IntSort.NativeObject));
3433 }

◆ MkInt() [5/5]

IntNum MkInt ( ulong  v)
inline

Create an integer numeral.

Parameters
vvalue of the numeral.
Returns
A Term with value v and sort Integer

Definition at line 3451 of file Context.cs.

3452 {
3453
3454 return new IntNum(this, Native.Z3_mk_unsigned_int64(nCtx, v, IntSort.NativeObject));
3455 }

◆ MkInt2BV()

BitVecExpr MkInt2BV ( uint  n,
IntExpr  t 
)
inline

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

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.

Definition at line 2052 of file Context.cs.

2053 {
2054 Debug.Assert(t != null);
2055
2056 CheckContextMatch(t);
2057 return new BitVecExpr(this, Native.Z3_mk_int2bv(nCtx, n, t.NativeObject));
2058 }

◆ MkInt2Real()

RealExpr MkInt2Real ( IntExpr  t)
inline

Coerce an integer to a real.

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 Term k and and asserting MakeInt2Real(k) <= t1 < MkInt2Real(k)+1. The argument must be of integer sort.

Definition at line 1391 of file Context.cs.

1392 {
1393 Debug.Assert(t != null);
1394
1395 CheckContextMatch(t);
1396 return new RealExpr(this, Native.Z3_mk_int2real(nCtx, t.NativeObject));
1397 }

◆ MkIntConst() [1/2]

IntExpr MkIntConst ( string  name)
inline

Creates an integer constant.

Definition at line 919 of file Context.cs.

920 {
921 Debug.Assert(name != null);
922
923 return (IntExpr)MkConst(name, IntSort);
924 }

◆ MkIntConst() [2/2]

IntExpr MkIntConst ( Symbol  name)
inline

Creates an integer constant.

Definition at line 909 of file Context.cs.

910 {
911 Debug.Assert(name != null);
912
913 return (IntExpr)MkConst(name, IntSort);
914 }

◆ MkIntersect()

ReExpr MkIntersect ( params ReExpr[]  t)
inline

Create the intersection of regular languages.

Definition at line 3084 of file Context.cs.

3085 {
3086 Debug.Assert(t != null);
3087 Debug.Assert(t.All(a => a != null));
3088
3089 CheckContextMatch<ReExpr>(t);
3090 return new ReExpr(this, Native.Z3_mk_re_intersect(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
3091 }

◆ MkIntSort()

IntSort MkIntSort ( )
inline

Create a new integer sort.

Definition at line 244 of file Context.cs.

245 {
246
247 return new IntSort(this);
248 }

◆ MkIsDigit()

BoolExpr MkIsDigit ( Expr  ch)
inline

Create a check if the character is a digit.

Definition at line 3176 of file Context.cs.

3177 {
3178 Debug.Assert(ch != null);
3179 return new BoolExpr(this, Native.Z3_mk_char_is_digit(nCtx, ch.NativeObject));
3180 }

◆ MkIsInteger()

BoolExpr MkIsInteger ( RealExpr  t)
inline

Creates an expression that checks whether a real number is an integer.

Definition at line 1417 of file Context.cs.

1418 {
1419 Debug.Assert(t != null);
1420
1421 CheckContextMatch(t);
1422 return new BoolExpr(this, Native.Z3_mk_is_int(nCtx, t.NativeObject));
1423 }

◆ MkITE()

Expr MkITE ( BoolExpr  t1,
Expr  t2,
Expr  t3 
)
inline

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

Parameters
t1An expression with Boolean sort
t2An expression
t3An expression with the same sort as t2

Definition at line 1096 of file Context.cs.

1097 {
1098 Debug.Assert(t1 != null);
1099 Debug.Assert(t2 != null);
1100 Debug.Assert(t3 != null);
1101
1102 CheckContextMatch(t1);
1103 CheckContextMatch(t2);
1104 CheckContextMatch(t3);
1105 return Expr.Create(this, Native.Z3_mk_ite(nCtx, t1.NativeObject, t2.NativeObject, t3.NativeObject));
1106 }

◆ MkLambda() [1/2]

Lambda MkLambda ( Expr[]  boundConstants,
Expr  body 
)
inline

Create a lambda expression.

Creates a lambda expression using a list of constants that will form the set of bound variables.

See also
MkLambda(Sort[], Symbol[], Expr)

Definition at line 3708 of file Context.cs.

3709 {
3710 Debug.Assert(body != null);
3711 Debug.Assert(boundConstants != null && boundConstants.All(b => b != null));
3712 return new Lambda(this, boundConstants, body);
3713 }
Lambda(vs, body)
Definition z3py.py:2432

◆ MkLambda() [2/2]

Lambda MkLambda ( Sort[]  sorts,
Symbol[]  names,
Expr  body 
)
inline

Create a lambda expression.

Creates a lambda expression. sorts is an array with the sorts of the bound variables, names is an array with the 'names' of the bound variables, and body is the body of the lambda. Note that the bound variables are de-Bruijn indices created using MkBound. Z3 applies the convention that the last element in names and sorts refers to the variable with index 0, the second to last element of names and sorts refers to the variable with index 1, etc.

Parameters
sortsthe sorts of the bound variables.
namesnames of the bound variables
bodythe body of the quantifier.

Definition at line 3689 of file Context.cs.

3690 {
3691 Debug.Assert(sorts != null);
3692 Debug.Assert(names != null);
3693 Debug.Assert(body != null);
3694 Debug.Assert(sorts.Length == names.Length);
3695 Debug.Assert(sorts.All(s => s != null));
3696 Debug.Assert(names.All(n => n != null));
3697 return new Lambda(this, sorts, names, body);
3698 }

◆ MkLe()

BoolExpr MkLe ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 <= t2

Definition at line 1345 of file Context.cs.

1346 {
1347 Debug.Assert(t1 != null);
1348 Debug.Assert(t2 != null);
1349
1350 CheckContextMatch(t1);
1351 CheckContextMatch(t2);
1352 return new BoolExpr(this, Native.Z3_mk_le(nCtx, t1.NativeObject, t2.NativeObject));
1353 }

Referenced by ArithExpr.operator<=().

◆ MkLength()

IntExpr MkLength ( SeqExpr  s)
inline

Retrieve the length of a given sequence.

Definition at line 2812 of file Context.cs.

2813 {
2814 Debug.Assert(s != null);
2815 return (IntExpr)Expr.Create(this, Native.Z3_mk_seq_length(nCtx, s.NativeObject));
2816 }

◆ MkListSort() [1/2]

ListSort MkListSort ( string  name,
Sort  elemSort 
)
inline

Create a new list sort.

Definition at line 383 of file Context.cs.

384 {
385 Debug.Assert(elemSort != null);
386
387 CheckContextMatch(elemSort);
388 using var symbol = MkSymbol(name);
389 return new ListSort(this, symbol, elemSort);
390 }

◆ MkListSort() [2/2]

ListSort MkListSort ( Symbol  name,
Sort  elemSort 
)
inline

Create a new list sort.

Definition at line 370 of file Context.cs.

371 {
372 Debug.Assert(name != null);
373 Debug.Assert(elemSort != null);
374
375 CheckContextMatch(name);
376 CheckContextMatch(elemSort);
377 return new ListSort(this, name, elemSort);
378 }

◆ MkLoop()

ReExpr MkLoop ( ReExpr  re,
uint  lo,
uint  hi = 0 
)
inline

Take the bounded Kleene star of a regular expression.

Definition at line 3024 of file Context.cs.

3025 {
3026 Debug.Assert(re != null);
3027 return new ReExpr(this, Native.Z3_mk_re_loop(nCtx, re.NativeObject, lo, hi));
3028 }

◆ MkLt()

BoolExpr MkLt ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 < t2

Definition at line 1332 of file Context.cs.

1333 {
1334 Debug.Assert(t1 != null);
1335 Debug.Assert(t2 != null);
1336
1337 CheckContextMatch(t1);
1338 CheckContextMatch(t2);
1339 return new BoolExpr(this, Native.Z3_mk_lt(nCtx, t1.NativeObject, t2.NativeObject));
1340 }

Referenced by ArithExpr.operator<().

◆ MkMap()

ArrayExpr MkMap ( FuncDecl  f,
params ArrayExpr[]  args 
)
inline

Maps f on the argument arrays.

Each element of args must be of an array sort [domain_i -> range_i]. The function declaration f must have type range_1 .. range_n -> range. v must have sort range. The sort of the result is [domain_i -> range].

See also
MkArraySort(Sort, Sort), MkSelect(ArrayExpr, Expr), MkStore(ArrayExpr, Expr, Expr)

Definition at line 2375 of file Context.cs.

2376 {
2377 Debug.Assert(f != null);
2378 Debug.Assert(args == null || args.All(a => a != null));
2379
2380 CheckContextMatch(f);
2381 CheckContextMatch<ArrayExpr>(args);
2382 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_map(nCtx, f.NativeObject, AST.ArrayLength(args), AST.ArrayToNative(args)));
2383 }

◆ MkMod()

IntExpr MkMod ( IntExpr  t1,
IntExpr  t2 
)
inline

Create an expression representing t1 mod t2.

The arguments must have int type.

Definition at line 1292 of file Context.cs.

1293 {
1294 Debug.Assert(t1 != null);
1295 Debug.Assert(t2 != null);
1296
1297 CheckContextMatch(t1);
1298 CheckContextMatch(t2);
1299 return new IntExpr(this, Native.Z3_mk_mod(nCtx, t1.NativeObject, t2.NativeObject));
1300 }

◆ MkMul() [1/2]

ArithExpr MkMul ( IEnumerable< ArithExpr >  ts)
inline

Create an expression representing t[0] * t[1] * ....

Definition at line 1246 of file Context.cs.

1247 {
1248 Debug.Assert(ts != null);
1249 return MkMul(ts.ToArray());
1250 }
ArithExpr MkMul(params ArithExpr[] ts)
Create an expression representing t[0] * t[1] * ....
Definition Context.cs:1234

◆ MkMul() [2/2]

ArithExpr MkMul ( params ArithExpr[]  ts)
inline

Create an expression representing t[0] * t[1] * ....

Definition at line 1234 of file Context.cs.

1235 {
1236 Debug.Assert(ts != null);
1237 Debug.Assert(ts.All(a => a != null));
1238
1239 CheckContextMatch<ArithExpr>(ts);
1240 return (ArithExpr)Expr.Create(this, Native.Z3_mk_mul(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1241 }

Referenced by Context.MkMul(), and ArithExpr.operator*().

◆ MkNot()

BoolExpr MkNot ( BoolExpr  a)
inline

Mk an expression representing not(a).

Definition at line 1083 of file Context.cs.

1084 {
1085 Debug.Assert(a != null);
1086 CheckContextMatch(a);
1087 return new BoolExpr(this, Native.Z3_mk_not(nCtx, a.NativeObject));
1088 }

Referenced by BoolExpr.operator!().

◆ MkNth()

Expr MkNth ( SeqExpr  s,
Expr  index 
)
inline

Retrieve element at index.

Definition at line 2898 of file Context.cs.

2899 {
2900 Debug.Assert(s != null);
2901 Debug.Assert(index != null);
2902 CheckContextMatch(s, index);
2903 return Expr.Create(this, Native.Z3_mk_seq_nth(nCtx, s.NativeObject, index.NativeObject));
2904 }

◆ MkNumeral() [1/5]

Expr MkNumeral ( int  v,
Sort  ty 
)
inline

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 than MakeNumeral since it is not necessary to parse a string.

Parameters
vValue of the numeral
tySort of the numeral
Returns
A Term with value v and type ty

Definition at line 3276 of file Context.cs.

3277 {
3278 Debug.Assert(ty != null);
3279
3280 CheckContextMatch(ty);
3281 return Expr.Create(this, Native.Z3_mk_int(nCtx, v, ty.NativeObject));
3282 }

◆ MkNumeral() [2/5]

Expr MkNumeral ( long  v,
Sort  ty 
)
inline

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 than MakeNumeral since it is not necessary to parse a string.

Parameters
vValue of the numeral
tySort of the numeral
Returns
A Term with value v and type ty

Definition at line 3306 of file Context.cs.

3307 {
3308 Debug.Assert(ty != null);
3309
3310 CheckContextMatch(ty);
3311 return Expr.Create(this, Native.Z3_mk_int64(nCtx, v, ty.NativeObject));
3312 }

◆ MkNumeral() [3/5]

Expr MkNumeral ( string  v,
Sort  ty 
)
inline

Create a Term of a given sort.

Parameters
vA 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]*.
tyThe 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 v and sort ty

Definition at line 3261 of file Context.cs.

3262 {
3263 Debug.Assert(ty != null);
3264
3265 CheckContextMatch(ty);
3266 return Expr.Create(this, Native.Z3_mk_numeral(nCtx, v, ty.NativeObject));
3267 }

Referenced by Context.MkBV(), Context.MkBV(), Context.MkBV(), Context.MkBV(), and Context.MkBV().

◆ MkNumeral() [4/5]

Expr MkNumeral ( uint  v,
Sort  ty 
)
inline

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 than MakeNumeral since it is not necessary to parse a string.

Parameters
vValue of the numeral
tySort of the numeral
Returns
A Term with value v and type ty

Definition at line 3291 of file Context.cs.

3292 {
3293 Debug.Assert(ty != null);
3294
3295 CheckContextMatch(ty);
3296 return Expr.Create(this, Native.Z3_mk_unsigned_int(nCtx, v, ty.NativeObject));
3297 }

◆ MkNumeral() [5/5]

Expr MkNumeral ( ulong  v,
Sort  ty 
)
inline

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 than MakeNumeral since it is not necessary to parse a string.

Parameters
vValue of the numeral
tySort of the numeral
Returns
A Term with value v and type ty

Definition at line 3321 of file Context.cs.

3322 {
3323 Debug.Assert(ty != null);
3324
3325 CheckContextMatch(ty);
3326 return Expr.Create(this, Native.Z3_mk_unsigned_int64(nCtx, v, ty.NativeObject));
3327 }

◆ MkOptimize()

Optimize MkOptimize ( )
inline

Create an Optimization context.

Definition at line 4510 of file Context.cs.

4511 {
4512
4513 return new Optimize(this);
4514 }

◆ MkOption()

ReExpr MkOption ( ReExpr  re)
inline

Create the optional regular expression.

Definition at line 3042 of file Context.cs.

3043 {
3044 Debug.Assert(re != null);
3045 return new ReExpr(this, Native.Z3_mk_re_option(nCtx, re.NativeObject));
3046 }

◆ MkOr() [1/2]

BoolExpr MkOr ( IEnumerable< BoolExpr >  ts)
inline

Create an expression representing t[0] or t[1] or ....

Definition at line 1201 of file Context.cs.

1202 {
1203 Debug.Assert(ts != null);
1204 return MkOr(ts.ToArray());
1205 }
BoolExpr MkOr(params BoolExpr[] ts)
Create an expression representing t[0] or t[1] or ....
Definition Context.cs:1188

◆ MkOr() [2/2]

BoolExpr MkOr ( params BoolExpr[]  ts)
inline

Create an expression representing t[0] or t[1] or ....

Definition at line 1188 of file Context.cs.

1189 {
1190 Debug.Assert(ts != null);
1191 Debug.Assert(ts.All(a => a != null));
1192
1193 CheckContextMatch<BoolExpr>(ts);
1194 return new BoolExpr(this, Native.Z3_mk_or(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1195 }

Referenced by Context.MkOr(), and BoolExpr.operator|().

◆ MkParams()

Params MkParams ( )
inline

◆ MkPartialOrder()

FuncDecl MkPartialOrder ( Sort  a,
uint  index 
)
inline

Create a partial order relation over a sort.

Parameters
aThe sort of the relation.
indexThe index of the relation.

Definition at line 5287 of file Context.cs.

5288 {
5289 return new FuncDecl(this, Native.Z3_mk_partial_order(this.nCtx, a.NativeObject, index));
5290 }

◆ MkPattern()

Pattern MkPattern ( params Expr[]  terms)
inline

Create a quantifier pattern.

Definition at line 827 of file Context.cs.

828 {
829 Debug.Assert(terms != null);
830 if (terms.Length == 0)
831 throw new Z3Exception("Cannot create a pattern from zero terms");
832
833 IntPtr[] termsNative = AST.ArrayToNative(terms);
834 return new Pattern(this, Native.Z3_mk_pattern(nCtx, (uint)terms.Length, termsNative));
835 }

◆ MkPBEq()

BoolExpr MkPBEq ( int[]  coeffs,
BoolExpr[]  args,
int  k 
)
inline

Create a pseudo-Boolean equal constraint.

Definition at line 3240 of file Context.cs.

3241 {
3242 Debug.Assert(args != null);
3243 Debug.Assert(coeffs != null);
3244 Debug.Assert(args.Length == coeffs.Length);
3245 CheckContextMatch<BoolExpr>(args);
3246 return new BoolExpr(this, Native.Z3_mk_pbeq(nCtx, (uint)args.Length,
3247 AST.ArrayToNative(args),
3248 coeffs, k));
3249 }

◆ MkPBGe()

BoolExpr MkPBGe ( int[]  coeffs,
BoolExpr[]  args,
int  k 
)
inline

Create a pseudo-Boolean greater-or-equal constraint.

Definition at line 3227 of file Context.cs.

3228 {
3229 Debug.Assert(args != null);
3230 Debug.Assert(coeffs != null);
3231 Debug.Assert(args.Length == coeffs.Length);
3232 CheckContextMatch<BoolExpr>(args);
3233 return new BoolExpr(this, Native.Z3_mk_pbge(nCtx, (uint)args.Length,
3234 AST.ArrayToNative(args),
3235 coeffs, k));
3236 }

◆ MkPBLe()

BoolExpr MkPBLe ( int[]  coeffs,
BoolExpr[]  args,
int  k 
)
inline

Create a pseudo-Boolean less-or-equal constraint.

Definition at line 3213 of file Context.cs.

3214 {
3215 Debug.Assert(args != null);
3216 Debug.Assert(coeffs != null);
3217 Debug.Assert(args.Length == coeffs.Length);
3218 CheckContextMatch<BoolExpr>(args);
3219 return new BoolExpr(this, Native.Z3_mk_pble(nCtx, (uint)args.Length,
3220 AST.ArrayToNative(args),
3221 coeffs, k));
3222 }

◆ MkPlus()

ReExpr MkPlus ( ReExpr  re)
inline

Take the Kleene plus of a regular expression.

Definition at line 3033 of file Context.cs.

3034 {
3035 Debug.Assert(re != null);
3036 return new ReExpr(this, Native.Z3_mk_re_plus(nCtx, re.NativeObject));
3037 }

◆ MkPolymorphicDatatypeSort() [1/2]

DatatypeSort MkPolymorphicDatatypeSort ( string  name,
Sort[]  typeParams,
Constructor[]  constructors 
)
inline

Create a polymorphic datatype sort with explicit type parameters. Type parameters should be sorts created with MkTypeVariable(string).

Parameters
namename of the datatype sort
typeParamsarray of type variable sorts
constructorsarray of constructors

Definition at line 633 of file Context.cs.

634 {
635 using var symbol = MkSymbol(name);
636 return MkPolymorphicDatatypeSort(symbol, typeParams, constructors);
637 }
DatatypeSort MkPolymorphicDatatypeSort(Symbol name, Sort[] typeParams, Constructor[] constructors)
Create a polymorphic datatype sort with explicit type parameters. Type parameters should be sorts cre...
Definition Context.cs:610

◆ MkPolymorphicDatatypeSort() [2/2]

DatatypeSort MkPolymorphicDatatypeSort ( Symbol  name,
Sort[]  typeParams,
Constructor[]  constructors 
)
inline

Create a polymorphic datatype sort with explicit type parameters. Type parameters should be sorts created with MkTypeVariable(string).

Parameters
namename of the datatype sort
typeParamsarray of type variable sorts
constructorsarray of constructors

Definition at line 610 of file Context.cs.

611 {
612 Debug.Assert(name != null);
613 Debug.Assert(typeParams != null);
614 Debug.Assert(constructors != null);
615 Debug.Assert(constructors.All(c => c != null));
616
617 CheckContextMatch(name);
618 CheckContextMatch<Sort>(typeParams);
619 CheckContextMatch<Constructor>(constructors);
620 return new DatatypeSort(this,
621 Native.Z3_mk_polymorphic_datatype(nCtx, name.NativeObject,
622 (uint)typeParams.Length, AST.ArrayToNative(typeParams),
623 (uint)constructors.Length, Z3Object.ArrayToNative(constructors)));
624 }

Referenced by Context.MkPolymorphicDatatypeSort().

◆ MkPower()

ArithExpr MkPower ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 ^ t2.

Definition at line 1319 of file Context.cs.

1320 {
1321 Debug.Assert(t1 != null);
1322 Debug.Assert(t2 != null);
1323
1324 CheckContextMatch(t1);
1325 CheckContextMatch(t2);
1326 return (ArithExpr)Expr.Create(this, Native.Z3_mk_power(nCtx, t1.NativeObject, t2.NativeObject));
1327 }

◆ MkPrefixOf()

BoolExpr MkPrefixOf ( SeqExpr  s1,
SeqExpr  s2 
)
inline

Check for sequence prefix.

Definition at line 2832 of file Context.cs.

2833 {
2834 Debug.Assert(s1 != null);
2835 Debug.Assert(s2 != null);
2836 CheckContextMatch(s1, s2);
2837 return new BoolExpr(this, Native.Z3_mk_seq_prefix(nCtx, s1.NativeObject, s2.NativeObject));
2838 }

◆ MkProbe()

Probe MkProbe ( string  name)
inline

Creates a new Probe.

Definition at line 4305 of file Context.cs.

4306 {
4307
4308 return new Probe(this, name);
4309 }

◆ MkQuantifier() [1/2]

Quantifier MkQuantifier ( bool  universal,
Expr[]  boundConstants,
Expr  body,
uint  weight = 1,
Pattern[]  patterns = null,
Expr[]  noPatterns = null,
Symbol  quantifierID = null,
Symbol  skolemID = null 
)
inline

Create a Quantifier.

MkForall(Sort[], Symbol[], Expr, uint, Pattern[], Expr[], Symbol, Symbol)

Definition at line 3657 of file Context.cs.

3658 {
3659 Debug.Assert(body != null);
3660 Debug.Assert(boundConstants == null || boundConstants.All(n => n != null));
3661 Debug.Assert(patterns == null || patterns.All(p => p != null));
3662 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3663
3664
3665 if (universal)
3666 return MkForall(boundConstants, body, weight, patterns, noPatterns, quantifierID, skolemID);
3667 else
3668 return MkExists(boundConstants, body, weight, patterns, noPatterns, quantifierID, skolemID);
3669 }
Quantifier MkExists(Sort[] sorts, Symbol[] names, Expr body, uint weight=1, Pattern[] patterns=null, Expr[] noPatterns=null, Symbol quantifierID=null, Symbol skolemID=null)
Create an existential Quantifier.
Definition Context.cs:3597
Quantifier MkForall(Sort[] sorts, Symbol[] names, Expr body, uint weight=1, Pattern[] patterns=null, Expr[] noPatterns=null, Symbol quantifierID=null, Symbol skolemID=null)
Create a universal Quantifier.
Definition Context.cs:3555

◆ MkQuantifier() [2/2]

Quantifier MkQuantifier ( bool  universal,
Sort[]  sorts,
Symbol[]  names,
Expr  body,
uint  weight = 1,
Pattern[]  patterns = null,
Expr[]  noPatterns = null,
Symbol  quantifierID = null,
Symbol  skolemID = null 
)
inline

Create a Quantifier.

MkForall(Sort[], Symbol[], Expr, uint, Pattern[], Expr[], Symbol, Symbol)

Definition at line 3634 of file Context.cs.

3635 {
3636 Debug.Assert(body != null);
3637 Debug.Assert(names != null);
3638 Debug.Assert(sorts != null);
3639 Debug.Assert(sorts.Length == names.Length);
3640 Debug.Assert(sorts.All(s => s != null));
3641 Debug.Assert(names.All(n => n != null));
3642 Debug.Assert(patterns == null || patterns.All(p => p != null));
3643 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3644
3645
3646 if (universal)
3647 return MkForall(sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
3648 else
3649 return MkExists(sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
3650 }

◆ MkRange()

ReExpr MkRange ( SeqExpr  lo,
SeqExpr  hi 
)
inline

Create a range expression.

Definition at line 3128 of file Context.cs.

3129 {
3130 Debug.Assert(lo != null);
3131 Debug.Assert(hi != null);
3132 CheckContextMatch(lo, hi);
3133 return new ReExpr(this, Native.Z3_mk_re_range(nCtx, lo.NativeObject, hi.NativeObject));
3134 }

◆ MkReal() [1/6]

RatNum MkReal ( int  num,
int  den 
)
inline

Create a real from a fraction.

Parameters
numnumerator of rational.
dendenominator of rational.
Returns
A Term with value num /den and sort Real
See also
MkNumeral(string, Sort)

Definition at line 3338 of file Context.cs.

3339 {
3340 if (den == 0)
3341 throw new Z3Exception("Denominator is zero");
3342
3343 return new RatNum(this, Native.Z3_mk_real(nCtx, num, den));
3344 }

◆ MkReal() [2/6]

RatNum MkReal ( int  v)
inline

Create a real numeral.

Parameters
vvalue of the numeral.
Returns
A Term with value v and sort Real

Definition at line 3362 of file Context.cs.

3363 {
3364
3365 return new RatNum(this, Native.Z3_mk_int(nCtx, v, RealSort.NativeObject));
3366 }
RealSort RealSort
Retrieves the Real sort of the context.
Definition Context.cs:171

◆ MkReal() [3/6]

RatNum MkReal ( long  v)
inline

Create a real numeral.

Parameters
vvalue of the numeral.
Returns
A Term with value v and sort Real

Definition at line 3384 of file Context.cs.

3385 {
3386
3387 return new RatNum(this, Native.Z3_mk_int64(nCtx, v, RealSort.NativeObject));
3388 }

◆ MkReal() [4/6]

RatNum MkReal ( string  v)
inline

Create a real numeral.

Parameters
vA string representing the Term value in decimal notation.
Returns
A Term with value v and sort Real

Definition at line 3351 of file Context.cs.

3352 {
3353
3354 return new RatNum(this, Native.Z3_mk_numeral(nCtx, v, RealSort.NativeObject));
3355 }

◆ MkReal() [5/6]

RatNum MkReal ( uint  v)
inline

Create a real numeral.

Parameters
vvalue of the numeral.
Returns
A Term with value v and sort Real

Definition at line 3373 of file Context.cs.

3374 {
3375
3376 return new RatNum(this, Native.Z3_mk_unsigned_int(nCtx, v, RealSort.NativeObject));
3377 }

◆ MkReal() [6/6]

RatNum MkReal ( ulong  v)
inline

Create a real numeral.

Parameters
vvalue of the numeral.
Returns
A Term with value v and sort Real

Definition at line 3395 of file Context.cs.

3396 {
3397
3398 return new RatNum(this, Native.Z3_mk_unsigned_int64(nCtx, v, RealSort.NativeObject));
3399 }

◆ MkReal2Int()

IntExpr MkReal2Int ( RealExpr  t)
inline

Coerce a real to an integer.

The semantics of this function follows the SMT-LIB standard for the function to_int. The argument must be of real sort.

Definition at line 1406 of file Context.cs.

1407 {
1408 Debug.Assert(t != null);
1409
1410 CheckContextMatch(t);
1411 return new IntExpr(this, Native.Z3_mk_real2int(nCtx, t.NativeObject));
1412 }

◆ MkRealConst() [1/2]

RealExpr MkRealConst ( string  name)
inline

Creates a real constant.

Definition at line 939 of file Context.cs.

940 {
941
942 return (RealExpr)MkConst(name, RealSort);
943 }

◆ MkRealConst() [2/2]

RealExpr MkRealConst ( Symbol  name)
inline

Creates a real constant.

Definition at line 929 of file Context.cs.

930 {
931 Debug.Assert(name != null);
932
933 return (RealExpr)MkConst(name, RealSort);
934 }

◆ MkRealPart()

RealExpr MkRealPart ( ArithExpr  value)
inline

Returns the Real-valued real component of a Complex expression.

Definition at line 965 of file Context.cs.

966 {
967 CheckContextMatch(value);
968 return new RealExpr(this, Native.Z3_mk_real_part(nCtx, value.NativeObject));
969 }

◆ MkRealSort()

RealSort MkRealSort ( )
inline

Create a real sort.

Definition at line 253 of file Context.cs.

254 {
255 return new RealSort(this);
256 }

◆ MkRecFuncDecl()

FuncDecl MkRecFuncDecl ( string  name,
Sort[]  domain,
Sort  range 
)
inline

Creates a new recursive function declaration.

Definition at line 704 of file Context.cs.

705 {
706 Debug.Assert(range != null);
707 Debug.Assert(domain.All(d => d != null));
708
709 CheckContextMatch<Sort>(domain);
710 CheckContextMatch(range);
711 using var symbol = MkSymbol(name);
712 return new FuncDecl(this, symbol, domain, range, true);
713 }

◆ MkRem()

IntExpr MkRem ( IntExpr  t1,
IntExpr  t2 
)
inline

Create an expression representing t1 rem t2.

The arguments must have int type.

Definition at line 1306 of file Context.cs.

1307 {
1308 Debug.Assert(t1 != null);
1309 Debug.Assert(t2 != null);
1310
1311 CheckContextMatch(t1);
1312 CheckContextMatch(t2);
1313 return new IntExpr(this, Native.Z3_mk_rem(nCtx, t1.NativeObject, t2.NativeObject));
1314 }

◆ MkRepeat()

BitVecExpr MkRepeat ( uint  i,
BitVecExpr  t 
)
inline

Bit-vector repetition.

The argument t must have a bit-vector sort.

Definition at line 1902 of file Context.cs.

1903 {
1904 Debug.Assert(t != null);
1905
1906 CheckContextMatch(t);
1907 return new BitVecExpr(this, Native.Z3_mk_repeat(nCtx, i, t.NativeObject));
1908 }

◆ MkReplace()

SeqExpr MkReplace ( SeqExpr  s,
SeqExpr  src,
SeqExpr  dst 
)
inline

Replace the first occurrence of src by dst in s.

Definition at line 2933 of file Context.cs.

2934 {
2935 Debug.Assert(s != null);
2936 Debug.Assert(src != null);
2937 Debug.Assert(dst != null);
2938 CheckContextMatch(s, src, dst);
2939 return new SeqExpr(this, Native.Z3_mk_seq_replace(nCtx, s.NativeObject, src.NativeObject, dst.NativeObject));
2940 }

◆ MkReSort()

ReSort MkReSort ( SeqSort  s)
inline

Create a new regular expression sort.

Definition at line 284 of file Context.cs.

285 {
286 Debug.Assert(s != null);
287 return new ReSort(this, Native.Z3_mk_re_sort(nCtx, s.NativeObject));
288 }
ReSort(s)
Definition z3py.py:12210

◆ MkSelect() [1/2]

Expr MkSelect ( ArrayExpr  a,
Expr  i 
)
inline

Array read.

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

The node a must have an array sort [domain -> range], and i must have the sort domain. The sort of the result is range.

See also
MkArraySort(Sort, Sort), MkStore(ArrayExpr, Expr, Expr)

Definition at line 2251 of file Context.cs.

2252 {
2253 Debug.Assert(a != null);
2254 Debug.Assert(i != null);
2255
2256 CheckContextMatch(a);
2257 CheckContextMatch(i);
2258 return Expr.Create(this, Native.Z3_mk_select(nCtx, a.NativeObject, i.NativeObject));
2259 }

◆ MkSelect() [2/2]

Expr MkSelect ( ArrayExpr  a,
params Expr[]  args 
)
inline

Array read.

The argument a is the array and args are the indices of the array that gets read.

The node a must have an array sort [domain1,..,domaink -> range], and args must have the sort domain1,..,domaink. The sort of the result is range.

See also
MkArraySort(Sort, Sort), MkStore(ArrayExpr, Expr, Expr)

Definition at line 2274 of file Context.cs.

2275 {
2276 Debug.Assert(a != null);
2277 Debug.Assert(args != null && args.All(n => n != null));
2278
2279 CheckContextMatch(a);
2280 CheckContextMatch<Expr>(args);
2281 return Expr.Create(this, Native.Z3_mk_select_n(nCtx, a.NativeObject, AST.ArrayLength(args), AST.ArrayToNative(args)));
2282 }

◆ MkSeqFoldLeft()

Expr MkSeqFoldLeft ( Expr  f,
Expr  a,
SeqExpr  s 
)
inline

Fold left the function f over the sequence s with initial value a.

Definition at line 2968 of file Context.cs.

2969 {
2970 Debug.Assert(f != null);
2971 Debug.Assert(a != null);
2972 Debug.Assert(s != null);
2973 CheckContextMatch(f, a, s);
2974 return Expr.Create(this, Native.Z3_mk_seq_foldl(nCtx, f.NativeObject, a.NativeObject, s.NativeObject));
2975 }

◆ MkSeqFoldLeftI()

Expr MkSeqFoldLeftI ( Expr  f,
Expr  i,
Expr  a,
SeqExpr  s 
)
inline

Fold left with index the function f over the sequence s with initial value a starting at index i.

Definition at line 2980 of file Context.cs.

2981 {
2982 Debug.Assert(f != null);
2983 Debug.Assert(i != null);
2984 Debug.Assert(a != null);
2985 Debug.Assert(s != null);
2986 CheckContextMatch(f, i, a);
2987 CheckContextMatch(s, a);
2988 return Expr.Create(this, Native.Z3_mk_seq_foldli(nCtx, f.NativeObject, i.NativeObject, a.NativeObject, s.NativeObject));
2989 }

◆ MkSeqMap()

Expr MkSeqMap ( Expr  f,
SeqExpr  s 
)
inline

Map function f over the sequence s.

Definition at line 2945 of file Context.cs.

2946 {
2947 Debug.Assert(f != null);
2948 Debug.Assert(s != null);
2949 CheckContextMatch(f, s);
2950 return Expr.Create(this, Native.Z3_mk_seq_map(nCtx, f.NativeObject, s.NativeObject));
2951 }

◆ MkSeqMapi()

Expr MkSeqMapi ( Expr  f,
Expr  i,
SeqExpr  s 
)
inline

Map function f over the sequence s at index i.

Definition at line 2956 of file Context.cs.

2957 {
2958 Debug.Assert(f != null);
2959 Debug.Assert(i != null);
2960 Debug.Assert(s != null);
2961 CheckContextMatch(f, i, s);
2962 return Expr.Create(this, Native.Z3_mk_seq_mapi(nCtx, f.NativeObject, i.NativeObject, s.NativeObject));
2963 }

◆ MkSeqPower()

SeqExpr MkSeqPower ( SeqExpr  s,
Expr  n 
)
inline

Retrieve the sequence s concatenated n times with itself.

Definition at line 2821 of file Context.cs.

2822 {
2823 Debug.Assert(s != null);
2824 Debug.Assert(n != null);
2825 CheckContextMatch(s, n);
2826 return new SeqExpr(this, Native.Z3_mk_seq_power(nCtx, s.NativeObject, n.NativeObject));
2827 }

◆ MkSeqSort()

SeqSort MkSeqSort ( Sort  s)
inline

Create a new sequence sort.

Definition at line 275 of file Context.cs.

276 {
277 Debug.Assert(s != null);
278 return new SeqSort(this, Native.Z3_mk_seq_sort(nCtx, s.NativeObject));
279 }
SeqSort(s)
Definition z3py.py:11763

◆ MkSetAdd()

ArrayExpr MkSetAdd ( ArrayExpr  set,
Expr  element 
)
inline

Add an element to the set.

Definition at line 2452 of file Context.cs.

2453 {
2454 Debug.Assert(set != null);
2455 Debug.Assert(element != null);
2456
2457 CheckContextMatch(set);
2458 CheckContextMatch(element);
2459 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_add(nCtx, set.NativeObject, element.NativeObject));
2460 }

◆ MkSetComplement()

ArrayExpr MkSetComplement ( ArrayExpr  arg)
inline

Take the complement of a set.

Definition at line 2516 of file Context.cs.

2517 {
2518 Debug.Assert(arg != null);
2519
2520 CheckContextMatch(arg);
2521 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_complement(nCtx, arg.NativeObject));
2522 }

◆ MkSetDel()

ArrayExpr MkSetDel ( ArrayExpr  set,
Expr  element 
)
inline

Remove an element from a set.

Definition at line 2466 of file Context.cs.

2467 {
2468 Debug.Assert(set != null);
2469 Debug.Assert(element != null);
2470
2471 CheckContextMatch(set);
2472 CheckContextMatch(element);
2473 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_del(nCtx, set.NativeObject, element.NativeObject));
2474 }

◆ MkSetDifference()

ArrayExpr MkSetDifference ( ArrayExpr  arg1,
ArrayExpr  arg2 
)
inline

Take the difference between two sets.

Definition at line 2503 of file Context.cs.

2504 {
2505 Debug.Assert(arg1 != null);
2506 Debug.Assert(arg2 != null);
2507
2508 CheckContextMatch(arg1);
2509 CheckContextMatch(arg2);
2510 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_difference(nCtx, arg1.NativeObject, arg2.NativeObject));
2511 }

◆ MkSetIntersection()

ArrayExpr MkSetIntersection ( params ArrayExpr[]  args)
inline

Take the intersection of a list of sets.

Definition at line 2491 of file Context.cs.

2492 {
2493 Debug.Assert(args != null);
2494 Debug.Assert(args.All(a => a != null));
2495
2496 CheckContextMatch<ArrayExpr>(args);
2497 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_intersect(nCtx, (uint)args.Length, AST.ArrayToNative(args)));
2498 }

◆ MkSetMembership()

BoolExpr MkSetMembership ( Expr  elem,
ArrayExpr  set 
)
inline

Check for set membership.

Definition at line 2527 of file Context.cs.

2528 {
2529 Debug.Assert(elem != null);
2530 Debug.Assert(set != null);
2531
2532 CheckContextMatch(elem);
2533 CheckContextMatch(set);
2534 return (BoolExpr)Expr.Create(this, Native.Z3_mk_set_member(nCtx, elem.NativeObject, set.NativeObject));
2535 }

◆ MkSetSort()

SetSort MkSetSort ( Sort  ty)
inline

Create a set type.

Definition at line 2419 of file Context.cs.

2420 {
2421 Debug.Assert(ty != null);
2422
2423 CheckContextMatch(ty);
2424 return new SetSort(this, ty);
2425 }
SetSort(s)
Sets.
Definition z3py.py:5281

◆ MkSetSubset()

BoolExpr MkSetSubset ( ArrayExpr  arg1,
ArrayExpr  arg2 
)
inline

Check for subsetness of sets.

Definition at line 2540 of file Context.cs.

2541 {
2542 Debug.Assert(arg1 != null);
2543 Debug.Assert(arg2 != null);
2544
2545 CheckContextMatch(arg1);
2546 CheckContextMatch(arg2);
2547 return (BoolExpr)Expr.Create(this, Native.Z3_mk_set_subset(nCtx, arg1.NativeObject, arg2.NativeObject));
2548 }

◆ MkSetUnion()

ArrayExpr MkSetUnion ( params ArrayExpr[]  args)
inline

Take the union of a list of sets.

Definition at line 2479 of file Context.cs.

2480 {
2481 Debug.Assert(args != null);
2482 Debug.Assert(args.All(a => a != null));
2483
2484 CheckContextMatch<ArrayExpr>(args);
2485 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_union(nCtx, (uint)args.Length, AST.ArrayToNative(args)));
2486 }

◆ MkSignExt()

BitVecExpr MkSignExt ( uint  i,
BitVecExpr  t 
)
inline

Bit-vector sign extension.

Sign-extends the given bit-vector to the (signed) equivalent bitvector of size m+i, where m is the size of the given bit-vector. The argument t must have a bit-vector sort.

Definition at line 1871 of file Context.cs.

1872 {
1873 Debug.Assert(t != null);
1874
1875 CheckContextMatch(t);
1876 return new BitVecExpr(this, Native.Z3_mk_sign_ext(nCtx, i, t.NativeObject));
1877 }

◆ MkSimpleSolver()

Solver MkSimpleSolver ( )
inline

Creates a new (incremental) solver.

Definition at line 4462 of file Context.cs.

4463 {
4464
4465 return new Solver(this, Native.Z3_mk_simple_solver(nCtx));
4466 }

◆ MkSimplifier()

Simplifier MkSimplifier ( string  name)
inline

Creates a new Tactic.

Definition at line 4201 of file Context.cs.

4202 {
4203
4204 return new Simplifier(this, name);
4205 }

◆ MkSolver() [1/4]

Solver MkSolver ( Solver  s,
Simplifier  t 
)
inline

Creates a solver that uses an incremental simplifier.

Definition at line 4471 of file Context.cs.

4472 {
4473 Debug.Assert(t != null);
4474 Debug.Assert(s != null);
4475 return new Solver(this, Native.Z3_solver_add_simplifier(nCtx, s.NativeObject, t.NativeObject));
4476 }

◆ MkSolver() [2/4]

Solver MkSolver ( string  logic)
inline

Creates a new (incremental) solver.

See also
MkSolver(Symbol)

Definition at line 4453 of file Context.cs.

4454 {
4455 using var symbol = MkSymbol(logic);
4456 return MkSolver(symbol);
4457 }
Solver MkSolver(Symbol logic=null)
Creates a new (incremental) solver.
Definition Context.cs:4440

◆ MkSolver() [3/4]

Solver MkSolver ( Symbol  logic = null)
inline

Creates a new (incremental) solver.

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.

Definition at line 4440 of file Context.cs.

4441 {
4442
4443 if (logic == null)
4444 return new Solver(this, Native.Z3_mk_solver(nCtx));
4445 else
4446 return new Solver(this, Native.Z3_mk_solver_for_logic(nCtx, logic.NativeObject));
4447 }

Referenced by Context.MkSolver().

◆ MkSolver() [4/4]

Solver MkSolver ( Tactic  t)
inline

Creates a solver that is implemented using the given tactic.

The solver supports the commands Push and Pop, but it will always solve each check from scratch.

Definition at line 4485 of file Context.cs.

4486 {
4487 Debug.Assert(t != null);
4488
4489 return new Solver(this, Native.Z3_mk_solver_from_tactic(nCtx, t.NativeObject));
4490 }

◆ MkStar()

ReExpr MkStar ( ReExpr  re)
inline

Take the Kleene star of a regular expression.

Definition at line 3015 of file Context.cs.

3016 {
3017 Debug.Assert(re != null);
3018 return new ReExpr(this, Native.Z3_mk_re_star(nCtx, re.NativeObject));
3019 }

◆ MkStore() [1/2]

ArrayExpr MkStore ( ArrayExpr  a,
Expr  i,
Expr  v 
)
inline

Array update.

The node a must have an array sort [domain -> range], i must have sort domain, v must 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 to a (with respect to select) on all indices except for i, where it maps to v (and the select of a with respect to i may be a different value).

See also
MkArraySort(Sort, Sort), MkSelect(ArrayExpr, Expr), MkSelect(ArrayExpr, Expr[])

Definition at line 2303 of file Context.cs.

2304 {
2305 Debug.Assert(a != null);
2306 Debug.Assert(i != null);
2307 Debug.Assert(v != null);
2308
2309 CheckContextMatch(a);
2310 CheckContextMatch(i);
2311 CheckContextMatch(v);
2312 return new ArrayExpr(this, Native.Z3_mk_store(nCtx, a.NativeObject, i.NativeObject, v.NativeObject));
2313 }

◆ MkStore() [2/2]

ArrayExpr MkStore ( ArrayExpr  a,
Expr[]  args,
Expr  v 
)
inline

Array update.

The node a must have an array sort [domain1,..,domaink -> range], args must have sort domain1,..,domaink, v must 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 to a (with respect to select) on all indices except for args, where it maps to v (and the select of a with respect to args may be a different value).

See also
MkArraySort(Sort, Sort), MkSelect(ArrayExpr, Expr), MkSelect(ArrayExpr, Expr[])

Definition at line 2333 of file Context.cs.

2334 {
2335 Debug.Assert(a != null);
2336 Debug.Assert(args != null);
2337 Debug.Assert(v != null);
2338
2339 CheckContextMatch<Expr>(args);
2340 CheckContextMatch(a);
2341 CheckContextMatch(v);
2342 return new ArrayExpr(this, Native.Z3_mk_store_n(nCtx, a.NativeObject, AST.ArrayLength(args), AST.ArrayToNative(args), v.NativeObject));
2343 }

◆ MkString()

SeqExpr MkString ( string  s)
inline

Create a string constant.

Definition at line 2749 of file Context.cs.

2750 {
2751 Debug.Assert(s != null);
2752 return new SeqExpr(this, Native.Z3_mk_string(nCtx, s));
2753 }

◆ MkStringLe()

BoolExpr MkStringLe ( SeqExpr  s1,
SeqExpr  s2 
)
inline

Check if the string s1 is lexicographically less or equal to s2.

Definition at line 2876 of file Context.cs.

2877 {
2878 Debug.Assert(s1 != null);
2879 Debug.Assert(s2 != null);
2880 CheckContextMatch(s1, s2);
2881 return new BoolExpr(this, Native.Z3_mk_str_le(nCtx, s1.NativeObject, s2.NativeObject));
2882 }

◆ MkStringLt()

BoolExpr MkStringLt ( SeqExpr  s1,
SeqExpr  s2 
)
inline

Check if the string s1 is lexicographically strictly less than s2.

Definition at line 2865 of file Context.cs.

2866 {
2867 Debug.Assert(s1 != null);
2868 Debug.Assert(s2 != null);
2869 CheckContextMatch(s1, s2);
2870 return new BoolExpr(this, Native.Z3_mk_str_lt(nCtx, s1.NativeObject, s2.NativeObject));
2871 }

◆ MkSub()

ArithExpr MkSub ( params ArithExpr[]  ts)
inline

Create an expression representing t[0] - t[1] - ....

Definition at line 1255 of file Context.cs.

1256 {
1257 Debug.Assert(ts != null);
1258 Debug.Assert(ts.All(a => a != null));
1259
1260 CheckContextMatch<ArithExpr>(ts);
1261 return (ArithExpr)Expr.Create(this, Native.Z3_mk_sub(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1262 }

Referenced by ArithExpr.operator-().

◆ MkSuffixOf()

BoolExpr MkSuffixOf ( SeqExpr  s1,
SeqExpr  s2 
)
inline

Check for sequence suffix.

Definition at line 2843 of file Context.cs.

2844 {
2845 Debug.Assert(s1 != null);
2846 Debug.Assert(s2 != null);
2847 CheckContextMatch(s1, s2);
2848 return new BoolExpr(this, Native.Z3_mk_seq_suffix(nCtx, s1.NativeObject, s2.NativeObject));
2849 }

◆ MkSymbol() [1/2]

IntSymbol MkSymbol ( int  i)
inline

◆ MkSymbol() [2/2]

StringSymbol MkSymbol ( string  name)
inline

Create a symbol using a string.

Definition at line 119 of file Context.cs.

120 {
121 return new StringSymbol(this, name);
122 }

◆ MkTactic()

Tactic MkTactic ( string  name)
inline

Creates a new Tactic.

Definition at line 3881 of file Context.cs.

3882 {
3883
3884 return new Tactic(this, name);
3885 }

Referenced by Goal.Simplify().

◆ MkTermArray()

Expr MkTermArray ( ArrayExpr  array)
inline

Access the array default value.

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

Definition at line 2392 of file Context.cs.

2393 {
2394 Debug.Assert(array != null);
2395
2396 CheckContextMatch(array);
2397 return Expr.Create(this, Native.Z3_mk_array_default(nCtx, array.NativeObject));
2398 }

◆ MkToRe()

ReExpr MkToRe ( SeqExpr  s)
inline

Convert a regular expression that accepts sequence s.

Definition at line 2994 of file Context.cs.

2995 {
2996 Debug.Assert(s != null);
2997 return new ReExpr(this, Native.Z3_mk_seq_to_re(nCtx, s.NativeObject));
2998 }

◆ MkTransitiveClosure()

FuncDecl MkTransitiveClosure ( FuncDecl  f)
inline

Create the transitive closure of a binary relation.

The resulting relation is recursive.

Parameters
fA binary relation represented as a function declaration.

Definition at line 5297 of file Context.cs.

5298 {
5299 return new FuncDecl(this, Native.Z3_mk_transitive_closure(this.nCtx, f.NativeObject));
5300 }

◆ MkTrue()

BoolExpr MkTrue ( )
inline

The true Term.

Definition at line 1025 of file Context.cs.

1026 {
1027 return new BoolExpr(this, Native.Z3_mk_true(nCtx));
1028 }

Referenced by Goal.AsBoolExpr(), Context.MkBool(), and Solver.ToSmt2().

◆ MkTupleSort()

TupleSort MkTupleSort ( Symbol  name,
Symbol[]  fieldNames,
Sort[]  fieldSorts 
)
inline

Create a new tuple sort.

Definition at line 319 of file Context.cs.

320 {
321 Debug.Assert(name != null);
322 Debug.Assert(fieldNames != null);
323 Debug.Assert(fieldNames.All(fn => fn != null));
324 Debug.Assert(fieldSorts == null || fieldSorts.All(fs => fs != null));
325
326 CheckContextMatch(name);
327 CheckContextMatch<Symbol>(fieldNames);
328 CheckContextMatch<Sort>(fieldSorts);
329 return new TupleSort(this, name, (uint)fieldNames.Length, fieldNames, fieldSorts);
330 }
TupleSort(name, sorts, ctx=None)
Definition z3py.py:6092

◆ MkTypeVariable() [1/2]

Sort MkTypeVariable ( string  name)
inline

Create a type variable sort for use as a parameter in polymorphic datatypes.

Parameters
namename of the type variable

Definition at line 597 of file Context.cs.

598 {
599 using var symbol = MkSymbol(name);
600 return MkTypeVariable(symbol);
601 }
Sort MkTypeVariable(Symbol name)
Create a type variable sort for use as a parameter in polymorphic datatypes.
Definition Context.cs:586

◆ MkTypeVariable() [2/2]

Sort MkTypeVariable ( Symbol  name)
inline

Create a type variable sort for use as a parameter in polymorphic datatypes.

Parameters
namename of the type variable

Definition at line 586 of file Context.cs.

587 {
588 Debug.Assert(name != null);
589 CheckContextMatch(name);
590 return new Sort(this, Native.Z3_mk_type_variable(nCtx, name.NativeObject));
591 }

Referenced by Context.MkTypeVariable().

◆ MkUnaryMinus()

ArithExpr MkUnaryMinus ( ArithExpr  t)
inline

Create an expression representing -t.

Definition at line 1267 of file Context.cs.

1268 {
1269 Debug.Assert(t != null);
1270
1271 CheckContextMatch(t);
1272 return (ArithExpr)Expr.Create(this, Native.Z3_mk_unary_minus(nCtx, t.NativeObject));
1273 }

Referenced by ArithExpr.operator-().

◆ MkUninterpretedSort() [1/2]

UninterpretedSort MkUninterpretedSort ( string  str)
inline

Create a new uninterpreted sort.

Definition at line 235 of file Context.cs.

236 {
237 using var sym = MkSymbol(str);
238 return MkUninterpretedSort(sym);
239 }
UninterpretedSort MkUninterpretedSort(Symbol s)
Create a new uninterpreted sort.
Definition Context.cs:224

◆ MkUninterpretedSort() [2/2]

UninterpretedSort MkUninterpretedSort ( Symbol  s)
inline

Create a new uninterpreted sort.

Definition at line 224 of file Context.cs.

225 {
226 Debug.Assert(s != null);
227
228 CheckContextMatch(s);
229 return new UninterpretedSort(this, s);
230 }

Referenced by Context.MkUninterpretedSort().

◆ MkUnion()

ReExpr MkUnion ( params ReExpr[]  t)
inline

Create the union of regular languages.

Definition at line 3072 of file Context.cs.

3073 {
3074 Debug.Assert(t != null);
3075 Debug.Assert(t.All(a => a != null));
3076
3077 CheckContextMatch<ReExpr>(t);
3078 return new ReExpr(this, Native.Z3_mk_re_union(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
3079 }

◆ MkUnit()

SeqExpr MkUnit ( Expr  elem)
inline

Create the singleton sequence.

Definition at line 2740 of file Context.cs.

2741 {
2742 Debug.Assert(elem != null);
2743 return new SeqExpr(this, Native.Z3_mk_seq_unit(nCtx, elem.NativeObject));
2744 }

◆ MkUpdateField()

Expr MkUpdateField ( FuncDecl  field,
Expr  t,
Expr  v 
)
inline

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.

Definition at line 645 of file Context.cs.

646 {
647 return Expr.Create(this, Native.Z3_datatype_update_field(
648 nCtx, field.NativeObject,
649 t.NativeObject, v.NativeObject));
650 }

◆ MkUserPropagatorFuncDecl()

FuncDecl MkUserPropagatorFuncDecl ( string  name,
Sort[]  domain,
Sort  range 
)
inline

Declare a function to be processed by the user propagator plugin.


Definition at line 801 of file Context.cs.

802 {
803 using var _name = MkSymbol(name);
804 var fn = Native.Z3_solver_propagate_declare(nCtx, _name.NativeObject, AST.ArrayLength(domain), AST.ArrayToNative(domain), range.NativeObject);
805 return new FuncDecl(this, fn);
806 }

◆ MkXor() [1/2]

BoolExpr MkXor ( BoolExpr  t1,
BoolExpr  t2 
)
inline

Create an expression representing t1 xor t2.

Definition at line 1137 of file Context.cs.

1138 {
1139 Debug.Assert(t1 != null);
1140 Debug.Assert(t2 != null);
1141
1142 CheckContextMatch(t1);
1143 CheckContextMatch(t2);
1144 return new BoolExpr(this, Native.Z3_mk_xor(nCtx, t1.NativeObject, t2.NativeObject));
1145 }

Referenced by Context.MkXor(), and BoolExpr.operator^().

◆ MkXor() [2/2]

BoolExpr MkXor ( IEnumerable< BoolExpr >  args)
inline

Create an expression representing t1 xor t2 xor t3 ... .

Definition at line 1150 of file Context.cs.

1151 {
1152 Debug.Assert(args != null);
1153 var ts = args.ToArray();
1154 Debug.Assert(ts.All(a => a != null));
1155 CheckContextMatch<BoolExpr>(ts);
1156
1157 return ts.Aggregate(MkFalse(), (r, t) =>
1158 {
1159 using (r)
1160 return MkXor(r, t);
1161 });
1162 }
BoolExpr MkXor(BoolExpr t1, BoolExpr t2)
Create an expression representing t1 xor t2.
Definition Context.cs:1137

◆ MkZeroExt()

BitVecExpr MkZeroExt ( uint  i,
BitVecExpr  t 
)
inline

Bit-vector zero extension.

Extend the given bit-vector with zeros to the (unsigned) equivalent bitvector of size m+i, where m is the size of the given bit-vector. The argument t must have a bit-vector sort.

Definition at line 1888 of file Context.cs.

1889 {
1890 Debug.Assert(t != null);
1891
1892 CheckContextMatch(t);
1893 return new BitVecExpr(this, Native.Z3_mk_zero_ext(nCtx, i, t.NativeObject));
1894 }

◆ Not()

Probe Not ( Probe  p)
inline

Create a probe that evaluates to "true" when the value p does not evaluate to "true".

Definition at line 4422 of file Context.cs.

4423 {
4424 Debug.Assert(p != null);
4425
4426 CheckContextMatch(p);
4427 return new Probe(this, Native.Z3_probe_not(nCtx, p.NativeObject));
4428 }

◆ Or()

Probe Or ( Probe  p1,
Probe  p2 
)
inline

Create a probe that evaluates to "true" when the value p1 or p2 evaluate to "true".

Definition at line 4408 of file Context.cs.

4409 {
4410 Debug.Assert(p1 != null);
4411 Debug.Assert(p2 != null);
4412
4413 CheckContextMatch(p1);
4414 CheckContextMatch(p2);
4415 return new Probe(this, Native.Z3_probe_or(nCtx, p1.NativeObject, p2.NativeObject));
4416 }

◆ OrElse()

Tactic OrElse ( Tactic  t1,
Tactic  t2 
)
inline

Create a tactic that first applies t1 to a Goal and if it fails then returns the result of t2 applied to the Goal.

Definition at line 3938 of file Context.cs.

3939 {
3940 Debug.Assert(t1 != null);
3941 Debug.Assert(t2 != null);
3942
3943 CheckContextMatch(t1);
3944 CheckContextMatch(t2);
3945 return new Tactic(this, Native.Z3_tactic_or_else(nCtx, t1.NativeObject, t2.NativeObject));
3946 }

◆ ParAndThen()

Tactic ParAndThen ( Tactic  t1,
Tactic  t2 
)
inline

Create a tactic that applies t1 to a given goal and then t2 to every subgoal produced by t1 . The subgoals are processed in parallel.

Definition at line 4086 of file Context.cs.

4087 {
4088 Debug.Assert(t1 != null);
4089 Debug.Assert(t2 != null);
4090
4091 CheckContextMatch(t1);
4092 CheckContextMatch(t2);
4093 return new Tactic(this, Native.Z3_tactic_par_and_then(nCtx, t1.NativeObject, t2.NativeObject));
4094 }

◆ ParOr()

Tactic ParOr ( params Tactic[]  t)
inline

Create a tactic that applies the given tactics in parallel until one of them succeeds (i.e., the first that doesn't fail).

Definition at line 4074 of file Context.cs.

4075 {
4076 Debug.Assert(t == null || t.All(tactic => tactic != null));
4077
4078 CheckContextMatch<Tactic>(t);
4079 return new Tactic(this, Native.Z3_tactic_par_or(nCtx, Tactic.ArrayLength(t), Tactic.ArrayToNative(t)));
4080 }

◆ ParseSMTLIB2File()

BoolExpr[] ParseSMTLIB2File ( string  fileName,
Symbol[]  sortNames = null,
Sort[]  sorts = null,
Symbol[]  declNames = null,
FuncDecl[]  decls = null 
)
inline

Parse the given file using the SMT-LIB2 parser.

See also
ParseSMTLIB2String

Definition at line 3773 of file Context.cs.

3774 {
3775
3776 uint csn = Symbol.ArrayLength(sortNames);
3777 uint cs = Sort.ArrayLength(sorts);
3778 uint cdn = Symbol.ArrayLength(declNames);
3779 uint cd = AST.ArrayLength(decls);
3780 if (csn != cs || cdn != cd)
3781 throw new Z3Exception("Argument size mismatch");
3782 using ASTVector assertions = new ASTVector(this, Native.Z3_parse_smtlib2_file(nCtx, fileName,
3783 AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts),
3784 AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls)));
3785 return assertions.ToBoolExprArray();
3786 }

◆ ParseSMTLIB2String()

BoolExpr[] ParseSMTLIB2String ( string  str,
Symbol[]  sortNames = null,
Sort[]  sorts = null,
Symbol[]  declNames = null,
FuncDecl[]  decls = null 
)
inline

Parse the given string using the SMT-LIB2 parser.

Returns
A conjunction of assertions in the scope (up to push/pop) at the end of the string.

Definition at line 3754 of file Context.cs.

3755 {
3756
3757 uint csn = Symbol.ArrayLength(sortNames);
3758 uint cs = Sort.ArrayLength(sorts);
3759 uint cdn = Symbol.ArrayLength(declNames);
3760 uint cd = AST.ArrayLength(decls);
3761 if (csn != cs || cdn != cd)
3762 throw new Z3Exception("Argument size mismatch");
3763 using ASTVector assertions = new ASTVector(this, Native.Z3_parse_smtlib2_string(nCtx, str,
3764 AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts),
3765 AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls)));
3766 return assertions.ToBoolExprArray();
3767 }

◆ PolynomialSubresultants()

ASTVector PolynomialSubresultants ( Expr  p,
Expr  q,
Expr  x 
)
inline

Return the nonzero subresultants of p and q with respect to the "variable" x.

p, q and x are Z3 expressions where p and q are arithmetic terms. Note that any subterm that cannot be viewed as a polynomial is assumed to be a variable.

Parameters
pFirst arithmetic term.
qSecond arithmetic term.
xThe variable with respect to which subresultants are computed.

Definition at line 5312 of file Context.cs.

5313 {
5314 CheckContextMatch(p);
5315 CheckContextMatch(q);
5316 CheckContextMatch(x);
5317 return new ASTVector(this, Native.Z3_polynomial_subresultants(this.nCtx, p.NativeObject, q.NativeObject, x.NativeObject));
5318 }

◆ ProbeDescription()

string ProbeDescription ( string  name)
inline

Returns a string containing a description of the probe with the given name.

Definition at line 4296 of file Context.cs.

4297 {
4298
4299 return Native.Z3_probe_get_descr(nCtx, name);
4300 }

◆ QeLite()

Expr QeLite ( ASTVector  vars,
Expr  body 
)
inline

Performs best-effort quantifier elimination for the variables in vars .

Definition at line 4118 of file Context.cs.

4119 {
4120 CheckContextMatch(vars);
4121 CheckContextMatch(body);
4122 return Expr.Create(this, Native.Z3_qe_lite(nCtx, vars.NativeObject, body.NativeObject));
4123 }

◆ QeModelProject()

Expr QeModelProject ( Model  model,
Expr[]  bounds,
Expr  body 
)
inline

Projects the bound applications from body using model .

Definition at line 4128 of file Context.cs.

4129 {
4130 CheckContextMatch(model);
4131 CheckContextMatch<Expr>(bounds);
4132 CheckContextMatch(body);
4133 return Expr.Create(this, Native.Z3_qe_model_project(nCtx, model.NativeObject,
4134 (uint)bounds.Length, AST.ArrayToNative(bounds), body.NativeObject));
4135 }

◆ QeModelProjectSkolem()

Expr QeModelProjectSkolem ( Model  model,
Expr[]  bounds,
Expr  body,
ASTMap  map 
)
inline

Projects bound applications and records Skolem terms in map .

Definition at line 4140 of file Context.cs.

4141 {
4142 CheckContextMatch(model);
4143 CheckContextMatch<Expr>(bounds);
4144 CheckContextMatch(body);
4145 CheckContextMatch(map);
4146 return Expr.Create(this, Native.Z3_qe_model_project_skolem(nCtx, model.NativeObject,
4147 (uint)bounds.Length, AST.ArrayToNative(bounds), body.NativeObject, map.NativeObject));
4148 }
expr map(expr const &f, expr const &list)
Definition z3++.h:2775

◆ QeModelProjectWithWitness()

Expr QeModelProjectWithWitness ( Model  model,
Expr[]  bounds,
Expr  body,
ASTMap  map 
)
inline

Projects bound applications and records witnesses in map .

Definition at line 4153 of file Context.cs.

4154 {
4155 CheckContextMatch(model);
4156 CheckContextMatch<Expr>(bounds);
4157 CheckContextMatch(body);
4158 CheckContextMatch(map);
4159 return Expr.Create(this, Native.Z3_qe_model_project_with_witness(nCtx, model.NativeObject,
4160 (uint)bounds.Length, AST.ArrayToNative(bounds), body.NativeObject, map.NativeObject));
4161 }

◆ Repeat()

Tactic Repeat ( Tactic  t,
uint  max = uint::MaxValue 
)
inline

Create a tactic that keeps applying t until the goal is not modified anymore or the maximum number of iterations max is reached.

Definition at line 3999 of file Context.cs.

4000 {
4001 Debug.Assert(t != null);
4002
4003 CheckContextMatch(t);
4004 return new Tactic(this, Native.Z3_tactic_repeat(nCtx, t.NativeObject, max));
4005 }

◆ SbvToString()

SeqExpr SbvToString ( Expr  e)
inline

Convert a bit-vector expression, represented as an signed number, to a string.

Definition at line 2778 of file Context.cs.

2779 {
2780 Debug.Assert(e != null);
2781 Debug.Assert(e is ArithExpr);
2782 return new SeqExpr(this, Native.Z3_mk_sbv_to_str(nCtx, e.NativeObject));
2783 }

◆ SimplifierDescription()

string SimplifierDescription ( string  name)
inline

Returns a string containing a description of the simplifier with the given name.

Definition at line 4192 of file Context.cs.

4193 {
4194
4195 return Native.Z3_simplifier_get_descr(nCtx, name);
4196 }

◆ SimplifyHelp()

string SimplifyHelp ( )
inline

Return a string describing all available parameters to Expr.Simplify.

Definition at line 5323 of file Context.cs.

5324 {
5325
5326 return Native.Z3_simplify_get_help(nCtx);
5327 }

◆ Skip()

Tactic Skip ( )
inline

Create a tactic that just returns the given goal.

Definition at line 4010 of file Context.cs.

4011 {
4012
4013 return new Tactic(this, Native.Z3_tactic_skip(nCtx));
4014 }

◆ StringToInt()

IntExpr StringToInt ( Expr  e)
inline

Convert an integer expression to a string.

Definition at line 2788 of file Context.cs.

2789 {
2790 Debug.Assert(e != null);
2791 Debug.Assert(e is SeqExpr);
2792 return new IntExpr(this, Native.Z3_mk_str_to_int(nCtx, e.NativeObject));
2793 }

◆ TacticDescription()

string TacticDescription ( string  name)
inline

Returns a string containing a description of the tactic with the given name.

Definition at line 3872 of file Context.cs.

3873 {
3874
3875 return Native.Z3_tactic_get_descr(nCtx, name);
3876 }

◆ Then() [1/2]

Simplifier Then ( Simplifier  t1,
Simplifier  t2,
params Simplifier[]  ts 
)
inline

Create a simplifier that applies t1 and then then t2 .

Shorthand for AndThen.

Definition at line 4245 of file Context.cs.

4246 {
4247 Debug.Assert(t1 != null);
4248 Debug.Assert(t2 != null);
4249 // Debug.Assert(ts == null || Contract.ForAll(0, ts.Length, j => ts[j] != null));
4250
4251 return AndThen(t1, t2, ts);
4252 }
Tactic AndThen(Tactic t1, Tactic t2, params Tactic[] ts)
Create a tactic that applies t1 to a Goal and then t2 to every subgoal produced by t1 .
Definition Context.cs:3891

◆ Then() [2/2]

Tactic Then ( Tactic  t1,
Tactic  t2,
params Tactic[]  ts 
)
inline

Create a tactic that applies t1 to a Goal and then t2 to every subgoal produced by t1 .

Shorthand for AndThen.

Definition at line 3925 of file Context.cs.

3926 {
3927 Debug.Assert(t1 != null);
3928 Debug.Assert(t2 != null);
3929 // Debug.Assert(ts == null || Contract.ForAll(0, ts.Length, j => ts[j] != null));
3930
3931 return AndThen(t1, t2, ts);
3932 }

◆ TryFor()

Tactic TryFor ( Tactic  t,
uint  ms 
)
inline

Create a tactic that applies t to a goal for ms milliseconds.

If t does not terminate within ms milliseconds, then it fails.

Definition at line 3954 of file Context.cs.

3955 {
3956 Debug.Assert(t != null);
3957
3958 CheckContextMatch(t);
3959 return new Tactic(this, Native.Z3_tactic_try_for(nCtx, t.NativeObject, ms));
3960 }

◆ UbvToString()

SeqExpr UbvToString ( Expr  e)
inline

Convert a bit-vector expression, represented as an unsigned number, to a string.

Definition at line 2768 of file Context.cs.

2769 {
2770 Debug.Assert(e != null);
2771 Debug.Assert(e is ArithExpr);
2772 return new SeqExpr(this, Native.Z3_mk_ubv_to_str(nCtx, e.NativeObject));
2773 }

◆ UnwrapAST()

IntPtr UnwrapAST ( AST  a)
inline

Unwraps an AST.

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.,

See also
Native.Z3_inc_ref

).

See also
WrapAST
Parameters
aThe AST to unwrap.

Definition at line 5277 of file Context.cs.

5278 {
5279 return a.NativeObject;
5280 }

◆ UpdateParamValue()

void UpdateParamValue ( string  id,
string  value 
)
inline

Update a mutable configuration parameter.

The list of all configuration parameters can be obtained using the Z3 executable: z3.exe -p Only a few configuration parameters are mutable once the context is created. An exception is thrown when trying to modify an immutable parameter.

Definition at line 5364 of file Context.cs.

5365 {
5366 Native.Z3_update_param_value(nCtx, id, value);
5367 }

◆ UsingParams() [1/2]

Simplifier UsingParams ( Simplifier  t,
Params  p 
)
inline

Create a tactic that applies t using the given set of parameters p .

Definition at line 4257 of file Context.cs.

4258 {
4259 Debug.Assert(t != null);
4260 Debug.Assert(p != null);
4261
4262 CheckContextMatch(t);
4263 CheckContextMatch(p);
4264 return new Simplifier(this, Native.Z3_simplifier_using_params(nCtx, t.NativeObject, p.NativeObject));
4265 }

◆ UsingParams() [2/2]

Tactic UsingParams ( Tactic  t,
Params  p 
)
inline

Create a tactic that applies t using the given set of parameters p .

Definition at line 4049 of file Context.cs.

4050 {
4051 Debug.Assert(t != null);
4052 Debug.Assert(p != null);
4053
4054 CheckContextMatch(t);
4055 CheckContextMatch(p);
4056 return new Tactic(this, Native.Z3_tactic_using_params(nCtx, t.NativeObject, p.NativeObject));
4057 }

Referenced by Context.With().

◆ When()

Tactic When ( Probe  p,
Tactic  t 
)
inline

Create a tactic that applies t to a given goal if the probe p evaluates to true.

If p evaluates to false, then the new tactic behaves like the skip tactic.

Definition at line 3969 of file Context.cs.

3970 {
3971 Debug.Assert(p != null);
3972 Debug.Assert(t != null);
3973
3974 CheckContextMatch(t);
3975 CheckContextMatch(p);
3976 return new Tactic(this, Native.Z3_tactic_when(nCtx, p.NativeObject, t.NativeObject));
3977 }

◆ With()

Tactic With ( Tactic  t,
Params  p 
)
inline

Create a tactic that applies t using the given set of parameters p .

Alias for UsingParams

Definition at line 4063 of file Context.cs.

4064 {
4065 Debug.Assert(t != null);
4066 Debug.Assert(p != null);
4067
4068 return UsingParams(t, p);
4069 }
Tactic UsingParams(Tactic t, Params p)
Create a tactic that applies t using the given set of parameters p .
Definition Context.cs:4049

◆ WrapAST()

AST WrapAST ( IntPtr  nativeObject)
inline

Wraps an AST.

This function is used for transitions between native and managed objects. Note that nativeObject must be a native object obtained from Z3 (e.g., through

See also
UnwrapAST, Native.Z3_inc_ref

) and that it must have a correct reference count (see e.g., .

See also
UnwrapAST
Parameters
nativeObjectThe native pointer to wrap.

Definition at line 5261 of file Context.cs.

5262 {
5263 return AST.Create(this, nativeObject);
5264 }

Property Documentation

◆ BoolSort

Retrieves the Boolean sort of the context.

Definition at line 147 of file Context.cs.

148 {
149 get
150 {
151 if (m_boolSort == null) m_boolSort = new BoolSort(this); return m_boolSort;
152 }
153 }

Referenced by Context.MkBoolSort().

◆ CharSort

Retrieves the character sort of the context.

Definition at line 191 of file Context.cs.

192 {
193 get
194 {
195 if (m_charSort == null) m_charSort = new CharSort(this); return m_charSort;
196 }
197 }
CharSort CharSort
Retrieves the character sort of the context.
Definition Context.cs:192

◆ ComplexSort

Retrieves the Complex sort of the context.

Definition at line 181 of file Context.cs.

182 {
183 get
184 {
185 if (m_complexSort == null) m_complexSort = new ComplexSort(this);
186 return m_complexSort;
187 }
188 }

Referenced by Context.MkComplexSort().

◆ IntSort

Retrieves the Integer sort of the context.

Definition at line 158 of file Context.cs.

159 {
160 get
161 {
162 if (m_intSort == null) m_intSort = new IntSort(this); return m_intSort;
163 }
164 }

Referenced by Context.MkIntSort().

◆ NumProbes

uint NumProbes
get

The number of supported Probes.

Definition at line 4272 of file Context.cs.

4273 {
4274 get { return Native.Z3_get_num_probes(nCtx); }
4275 }

◆ NumSimplifiers

uint NumSimplifiers
get

The number of supported simplifiers.

Definition at line 4168 of file Context.cs.

4169 {
4170 get { return Native.Z3_get_num_simplifiers(nCtx); }
4171 }

◆ NumTactics

uint NumTactics
get

The number of supported tactics.

Definition at line 3848 of file Context.cs.

3849 {
3850 get { return Native.Z3_get_num_tactics(nCtx); }
3851 }

◆ PrintMode

Z3_ast_print_mode PrintMode
getset

Selects the format used for pretty-printing expressions.

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.

See also
AST.ToString(), Pattern.ToString(), FuncDecl.ToString(), Sort.ToString()

Definition at line 3737 of file Context.cs.

3738 {
3739 get { return m_print_mode; }
3740 set
3741 {
3742 Native.Z3_set_ast_print_mode(nCtx, (uint)value);
3743 m_print_mode = value;
3744 }
3745 }

◆ ProbeNames

string [] ProbeNames
get

The names of all supported Probes.

Definition at line 4280 of file Context.cs.

4281 {
4282 get
4283 {
4284
4285 uint n = NumProbes;
4286 string[] res = new string[n];
4287 for (uint i = 0; i < n; i++)
4288 res[i] = Native.Z3_get_probe_name(nCtx, i);
4289 return res;
4290 }
4291 }
uint NumProbes
The number of supported Probes.
Definition Context.cs:4273

◆ RealSort

Retrieves the Real sort of the context.

Definition at line 170 of file Context.cs.

171 {
172 get
173 {
174 if (m_realSort == null) m_realSort = new RealSort(this); return m_realSort;
175 }
176 }

Referenced by Context.MkRealSort().

◆ SimplifierNames

string [] SimplifierNames
get

The names of all supported tactics.

Definition at line 4176 of file Context.cs.

4177 {
4178 get
4179 {
4180
4181 uint n = NumSimplifiers;
4182 string[] res = new string[n];
4183 for (uint i = 0; i < n; i++)
4184 res[i] = Native.Z3_get_simplifier_name(nCtx, i);
4185 return res;
4186 }
4187 }
uint NumSimplifiers
The number of supported simplifiers.
Definition Context.cs:4169

◆ SimplifyParameterDescriptions

ParamDescrs SimplifyParameterDescriptions
get

Retrieves parameter descriptions for simplifier.

Definition at line 5332 of file Context.cs.

5333 {
5334 get { return new ParamDescrs(this, Native.Z3_simplify_get_param_descrs(nCtx)); }
5335 }

◆ StringSort

SeqSort StringSort
get

Retrieves the String sort of the context.

Definition at line 203 of file Context.cs.

204 {
205 get
206 {
207 if (m_stringSort == null) m_stringSort = new SeqSort(this, Native.Z3_mk_string_sort(nCtx));
208 return m_stringSort;
209 }
210 }

◆ TacticNames

string [] TacticNames
get

The names of all supported tactics.

Definition at line 3856 of file Context.cs.

3857 {
3858 get
3859 {
3860
3861 uint n = NumTactics;
3862 string[] res = new string[n];
3863 for (uint i = 0; i < n; i++)
3864 res[i] = Native.Z3_get_tactic_name(nCtx, i);
3865 return res;
3866 }
3867 }
uint NumTactics
The number of supported tactics.
Definition Context.cs:3849