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.
 
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.
 
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.
 
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.
 
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.
 
CharSort CharSort [get]
 Retrieves the String 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 704 of file Context.cs.

705 {
706 CheckContextMatch(f);
707 CheckContextMatch<Expr>(args);
708 CheckContextMatch(body);
709 IntPtr[] argsNative = AST.ArrayToNative(args);
710 Native.Z3_add_rec_def(nCtx, f.NativeObject, (uint)args.Length, argsNative, body.NativeObject);
711 }

◆ 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 4275 of file Context.cs.

4276 {
4277 Debug.Assert(p1 != null);
4278 Debug.Assert(p2 != null);
4279
4280 CheckContextMatch(p1);
4281 CheckContextMatch(p2);
4282 return new Probe(this, Native.Z3_probe_and(nCtx, p1.NativeObject, p2.NativeObject));
4283 }

◆ 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 4092 of file Context.cs.

4093 {
4094 Debug.Assert(t1 != null);
4095 Debug.Assert(t2 != null);
4096 // Debug.Assert(ts == null || Contract.ForAll(0, ts.Length, j => ts[j] != null));
4097
4098
4099 CheckContextMatch(t1);
4100 CheckContextMatch(t2);
4101 CheckContextMatch<Simplifier>(ts);
4102
4103 IntPtr last = IntPtr.Zero;
4104 if (ts != null && ts.Length > 0)
4105 {
4106 last = ts[ts.Length - 1].NativeObject;
4107 for (int i = ts.Length - 2; i >= 0; i--)
4108 last = Native.Z3_simplifier_and_then(nCtx, ts[i].NativeObject, last);
4109 }
4110 if (last != IntPtr.Zero)
4111 {
4112 last = Native.Z3_simplifier_and_then(nCtx, t2.NativeObject, last);
4113 return new Simplifier(this, Native.Z3_simplifier_and_then(nCtx, t1.NativeObject, last));
4114 }
4115 else
4116 return new Simplifier(this, Native.Z3_simplifier_and_then(nCtx, t1.NativeObject, t2.NativeObject));
4117 }

◆ 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 3830 of file Context.cs.

3831 {
3832 Debug.Assert(t1 != null);
3833 Debug.Assert(t2 != null);
3834 // Debug.Assert(ts == null || Contract.ForAll(0, ts.Length, j => ts[j] != null));
3835
3836
3837 CheckContextMatch(t1);
3838 CheckContextMatch(t2);
3839 CheckContextMatch<Tactic>(ts);
3840
3841 IntPtr last = IntPtr.Zero;
3842 if (ts != null && ts.Length > 0)
3843 {
3844 last = ts[ts.Length - 1].NativeObject;
3845 for (int i = ts.Length - 2; i >= 0; i--)
3846 last = Native.Z3_tactic_and_then(nCtx, ts[i].NativeObject, last);
3847 }
3848 if (last != IntPtr.Zero)
3849 {
3850 last = Native.Z3_tactic_and_then(nCtx, t2.NativeObject, last);
3851 return new Tactic(this, Native.Z3_tactic_and_then(nCtx, t1.NativeObject, last));
3852 }
3853 else
3854 return new Tactic(this, Native.Z3_tactic_and_then(nCtx, t1.NativeObject, t2.NativeObject));
3855 }

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 3737 of file Context.cs.

3738 {
3739 Debug.Assert(assumptions != null);
3740 Debug.Assert(formula != null);
3741
3742 return Native.Z3_benchmark_to_smtlib_string(
3743 nCtx,
3744 name,
3745 logic,
3746 status,
3747 attributes,
3748 (uint)(assumptions?.Length ?? 0),
3749 AST.ArrayToNative(assumptions),
3750 formula.NativeObject);
3751 }

Referenced by Solver.ToSmt2().

◆ CharFromBV()

Expr CharFromBV ( BitVecExpr  bv)
inline

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

Definition at line 3106 of file Context.cs.

3107 {
3108 Debug.Assert(bv != null);
3109 return new Expr(this, Native.Z3_mk_char_from_bv(nCtx, bv.NativeObject));
3110 }

◆ CharToBV()

BitVecExpr CharToBV ( Expr  ch)
inline

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

Definition at line 3097 of file Context.cs.

3098 {
3099 Debug.Assert(ch != null);
3100 return new BitVecExpr(this, Native.Z3_mk_char_to_bv(nCtx, ch.NativeObject));
3101 }

◆ CharToInt()

IntExpr CharToInt ( Expr  ch)
inline

Create an integer (code point) from character.

Definition at line 3088 of file Context.cs.

3089 {
3090 Debug.Assert(ch != null);
3091 return new IntExpr(this, Native.Z3_mk_char_to_int(nCtx, ch.NativeObject));
3092 }

◆ 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 3922 of file Context.cs.

3923 {
3924 Debug.Assert(p != null);
3925 Debug.Assert(t1 != null);
3926 Debug.Assert(t2 != null);
3927
3928 CheckContextMatch(p);
3929 CheckContextMatch(t1);
3930 CheckContextMatch(t2);
3931 return new Tactic(this, Native.Z3_tactic_cond(nCtx, p.NativeObject, t1.NativeObject, t2.NativeObject));
3932 }

◆ ConstProbe()

Probe ConstProbe ( double  val)
inline

Create a probe that always evaluates to val .

Definition at line 4195 of file Context.cs.

4196 {
4197
4198 return new Probe(this, Native.Z3_probe_const(nCtx, val));
4199 }

◆ Dispose()

void Dispose ( )
inline

Disposes of the context.

Definition at line 5352 of file Context.cs.

5353 {
5354 // Console.WriteLine("Context Dispose from " + System.Threading.Thread.CurrentThread.ManagedThreadId);
5355
5356 if (m_boolSort != null) m_boolSort.Dispose();
5357 if (m_intSort != null) m_intSort.Dispose();
5358 if (m_realSort != null) m_realSort.Dispose();
5359 if (m_stringSort != null) m_stringSort.Dispose();
5360 if (m_charSort != null) m_charSort.Dispose();
5361 m_boolSort = null;
5362 m_intSort = null;
5363 m_realSort = null;
5364 m_stringSort = null;
5365 m_charSort = null;
5366 if (m_ctx != IntPtr.Zero)
5367 {
5368 // Suppress the finalizer before performing cleanup so that it cannot
5369 // run concurrently or redundantly if cleanup raises an exception.
5370 GC.SuppressFinalize(this);
5371 IntPtr ctx;
5372 // Keep a local reference to the error handler delegate to ensure it stays
5373 // alive throughout Z3_del_context. Setting m_n_err_handler = null releases
5374 // the field reference; without the local variable the GC could collect the
5375 // delegate before the native destructor finishes using the handler.
5376 Native.Z3_error_handler errHandler;
5377 lock (this)
5378 {
5379 ctx = m_ctx;
5380 errHandler = m_n_err_handler;
5381 m_n_err_handler = null;
5382 m_ctx = IntPtr.Zero;
5383 }
5384 // ctx is non-zero only for the thread that wins the lock and zeros m_ctx,
5385 // preventing double-free when Dispose() is called concurrently.
5386 if (ctx != IntPtr.Zero)
5387 {
5388 if (!is_external)
5389 {
5390 Native.Z3_del_context(ctx);
5391 GC.KeepAlive(errHandler);
5392 }
5393 if (m_memPressureAdded)
5394 {
5395 GC.RemoveMemoryPressure(NativeMemoryPressureEstimate);
5396 m_memPressureAdded = false;
5397 }
5398 }
5399 }
5400 }
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 4261 of file Context.cs.

4262 {
4263 Debug.Assert(p1 != null);
4264 Debug.Assert(p2 != null);
4265
4266 CheckContextMatch(p1);
4267 CheckContextMatch(p2);
4268 return new Probe(this, Native.Z3_probe_eq(nCtx, p1.NativeObject, p2.NativeObject));
4269 }

◆ Fail()

Tactic Fail ( )
inline

Create a tactic always fails.

Definition at line 3958 of file Context.cs.

3959 {
3960
3961 return new Tactic(this, Native.Z3_tactic_fail(nCtx));
3962 }

◆ FailIf()

Tactic FailIf ( Probe  p)
inline

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

Definition at line 3967 of file Context.cs.

3968 {
3969 Debug.Assert(p != null);
3970
3971 CheckContextMatch(p);
3972 return new Tactic(this, Native.Z3_tactic_fail_if(nCtx, p.NativeObject));
3973 }

◆ 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 3979 of file Context.cs.

3980 {
3981
3982 return new Tactic(this, Native.Z3_tactic_fail_if_not_decided(nCtx));
3983 }

◆ 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 4247 of file Context.cs.

4248 {
4249 Debug.Assert(p1 != null);
4250 Debug.Assert(p2 != null);
4251
4252 CheckContextMatch(p1);
4253 CheckContextMatch(p2);
4254 return new Probe(this, Native.Z3_probe_ge(nCtx, p1.NativeObject, p2.NativeObject));
4255 }

◆ GetFiniteSetSortBasis()

Sort GetFiniteSetSortBasis ( Sort  s)
inline

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

Definition at line 2529 of file Context.cs.

2530 {
2531 Debug.Assert(s != null);
2532
2533 CheckContextMatch(s);
2534 return Sort.Create(this, Native.Z3_get_finite_set_sort_basis(nCtx, s.NativeObject));
2535 }

◆ 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 4219 of file Context.cs.

4220 {
4221 Debug.Assert(p1 != null);
4222 Debug.Assert(p2 != null);
4223
4224 CheckContextMatch(p1);
4225 CheckContextMatch(p2);
4226 return new Probe(this, Native.Z3_probe_gt(nCtx, p1.NativeObject, p2.NativeObject));
4227 }

◆ 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 4039 of file Context.cs.

4040 {
4041 Native.Z3_interrupt(nCtx);
4042 }

◆ IntToString()

SeqExpr IntToString ( Expr  e)
inline

Convert an integer expression to a string.

Definition at line 2708 of file Context.cs.

2709 {
2710 Debug.Assert(e != null);
2711 Debug.Assert(e is ArithExpr);
2712 return new SeqExpr(this, Native.Z3_mk_int_to_str(nCtx, e.NativeObject));
2713 }

◆ IsFiniteSetSort()

bool IsFiniteSetSort ( Sort  s)
inline

Check if a sort is a finite set sort.

Definition at line 2518 of file Context.cs.

2519 {
2520 Debug.Assert(s != null);
2521
2522 CheckContextMatch(s);
2523 return Native.Z3_is_finite_set_sort(nCtx, s.NativeObject) != 0;
2524 }

◆ 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 4233 of file Context.cs.

4234 {
4235 Debug.Assert(p1 != null);
4236 Debug.Assert(p2 != null);
4237
4238 CheckContextMatch(p1);
4239 CheckContextMatch(p2);
4240 return new Probe(this, Native.Z3_probe_le(nCtx, p1.NativeObject, p2.NativeObject));
4241 }

◆ 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 4205 of file Context.cs.

4206 {
4207 Debug.Assert(p1 != null);
4208 Debug.Assert(p2 != null);
4209
4210 CheckContextMatch(p1);
4211 CheckContextMatch(p2);
4212 return new Probe(this, Native.Z3_probe_lt(nCtx, p1.NativeObject, p2.NativeObject));
4213 }

◆ MkAdd() [1/2]

ArithExpr MkAdd ( IEnumerable< ArithExpr ts)
inline

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

Definition at line 1175 of file Context.cs.

1176 {
1177 Debug.Assert(ts != null);
1178 return MkAdd(ts.ToArray());
1179 }
ArithExpr MkAdd(params ArithExpr[] ts)
Create an expression representing t[0] + t[1] + ....
Definition Context.cs:1163

◆ MkAdd() [2/2]

ArithExpr MkAdd ( params ArithExpr[]  ts)
inline

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

Definition at line 1163 of file Context.cs.

1164 {
1165 Debug.Assert(ts != null);
1166 Debug.Assert(ts.All(a => a != null));
1167
1168 CheckContextMatch<ArithExpr>(ts);
1169 return (ArithExpr)Expr.Create(this, Native.Z3_mk_add(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1170 }

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 1129 of file Context.cs.

1130 {
1131 Debug.Assert(t != null);
1132 return MkAnd(t.ToArray());
1133 }
BoolExpr MkAnd(params BoolExpr[] ts)
Create an expression representing t[0] and t[1] and ....
Definition Context.cs:1117

◆ MkAnd() [2/2]

BoolExpr MkAnd ( params BoolExpr[]  ts)
inline

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

Definition at line 1117 of file Context.cs.

1118 {
1119 Debug.Assert(ts != null);
1120 Debug.Assert(ts.All(a => a != null));
1121
1122 CheckContextMatch<BoolExpr>(ts);
1123 return new BoolExpr(this, Native.Z3_mk_and(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1124 }

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 965 of file Context.cs.

966 {
967 Debug.Assert(f != null);
968 return MkApp(f, args?.ToArray());
969 }
Expr MkApp(FuncDecl f, params Expr[] args)
Create a new function application.
Definition Context.cs:953

◆ MkApp() [2/2]

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

Create a new function application.

Definition at line 953 of file Context.cs.

954 {
955 Debug.Assert(f != null);
956 Debug.Assert(args == null || args.All(a => a != null));
957 CheckContextMatch(f);
958 CheckContextMatch<Expr>(args);
959 return Expr.Create(this, f, args);
960 }

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 2177 of file Context.cs.

2178 {
2179 Debug.Assert(domain != null);
2180 Debug.Assert(range != null);
2181
2182 using var symbol = MkSymbol(name);
2183 using var sort = MkArraySort(domain, range);
2184 return (ArrayExpr)MkConst(symbol, sort);
2185 }
Expr MkConst(Symbol name, Sort range)
Creates a new Constant of sort range and named name .
Definition Context.cs:825
ArraySort MkArraySort(Sort domain, Sort range)
Create a new array sort.
Definition Context.cs:276
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 2164 of file Context.cs.

2165 {
2166 Debug.Assert(name != null);
2167 Debug.Assert(domain != null);
2168 Debug.Assert(range != null);
2169
2170 using var sort = MkArraySort(domain, range);
2171 return (ArrayExpr)MkConst(name, sort);
2172 }

◆ 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 2353 of file Context.cs.

2354 {
2355 Debug.Assert(arg1 != null);
2356 Debug.Assert(arg2 != null);
2357
2358 CheckContextMatch(arg1);
2359 CheckContextMatch(arg2);
2360 return Expr.Create(this, Native.Z3_mk_array_ext(nCtx, arg1.NativeObject, arg2.NativeObject));
2361 }

◆ MkArraySort() [1/2]

ArraySort MkArraySort ( Sort  domain,
Sort  range 
)
inline

Create a new array sort.

Definition at line 276 of file Context.cs.

277 {
278 Debug.Assert(domain != null);
279 Debug.Assert(range != null);
280
281 CheckContextMatch(domain);
282 CheckContextMatch(range);
283 return new ArraySort(this, domain, range);
284 }
ArraySort(*sig)
Definition z3py.py:4935

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 289 of file Context.cs.

290 {
291 Debug.Assert(domain != null);
292 Debug.Assert(range != null);
293
294 CheckContextMatch<Sort>(domain);
295 CheckContextMatch(range);
296 return new ArraySort(this, domain, range);
297 }

◆ MkAt()

SeqExpr MkAt ( SeqExpr  s,
Expr  index 
)
inline

Retrieve sequence of length one at index.

Definition at line 2826 of file Context.cs.

2827 {
2828 Debug.Assert(s != null);
2829 Debug.Assert(index != null);
2830 CheckContextMatch(s, index);
2831 return new SeqExpr(this, Native.Z3_mk_seq_at(nCtx, s.NativeObject, index.NativeObject));
2832 }

◆ MkAtLeast()

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

Create an at-least-k constraint.

Definition at line 3140 of file Context.cs.

3141 {
3142 Debug.Assert(args != null);
3143 var ts = args.ToArray();
3144 CheckContextMatch<BoolExpr>(ts);
3145 return new BoolExpr(this, Native.Z3_mk_atleast(nCtx, (uint)ts.Length,
3146 AST.ArrayToNative(ts), k));
3147 }

◆ MkAtMost()

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

Create an at-most-k constraint.

Definition at line 3128 of file Context.cs.

3129 {
3130 Debug.Assert(args != null);
3131 var ts = args.ToArray();
3132 CheckContextMatch<BoolExpr>(ts);
3133 return new BoolExpr(this, Native.Z3_mk_atmost(nCtx, (uint)ts.Length,
3134 AST.ArrayToNative(ts), k));
3135 }

◆ MkBitVecSort()

BitVecSort MkBitVecSort ( uint  size)
inline

Create a new bit-vector sort.

Definition at line 250 of file Context.cs.

251 {
252 return new BitVecSort(this, Native.Z3_mk_bv_sort(nCtx, size));
253 }
BitVecSort(sz, ctx=None)
Definition z3py.py:4178

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 991 of file Context.cs.

992 {
993 return value ? MkTrue() : MkFalse();
994 }
BoolExpr MkTrue()
The true Term.
Definition Context.cs:975
BoolExpr MkFalse()
The false Term.
Definition Context.cs:983

◆ MkBoolConst() [1/2]

BoolExpr MkBoolConst ( string  name)
inline

Create a Boolean constant.

Definition at line 883 of file Context.cs.

884 {
885 using var symbol = MkSymbol(name);
886 return (BoolExpr)MkConst(symbol, BoolSort);
887 }
BoolSort BoolSort
Retrieves the Boolean sort of the context.
Definition Context.cs:147

◆ MkBoolConst() [2/2]

BoolExpr MkBoolConst ( Symbol  name)
inline

Create a Boolean constant.

Definition at line 873 of file Context.cs.

874 {
875 Debug.Assert(name != null);
876
877 return (BoolExpr)MkConst(name, BoolSort);
878 }

◆ MkBoolSort()

BoolSort MkBoolSort ( )
inline

Create a new Boolean sort.

Definition at line 205 of file Context.cs.

206 {
207 return new BoolSort(this);
208 }

◆ 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 798 of file Context.cs.

799 {
800 Debug.Assert(ty != null);
801
802 return Expr.Create(this, Native.Z3_mk_bound(nCtx, index, ty.NativeObject));
803 }

◆ 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 3457 of file Context.cs.

3458 {
3459 byte[] _bits = new byte[bits.Length];
3460 for (int i = 0; i < bits.Length; ++i) _bits[i] = (byte)(bits[i] ? 1 : 0);
3461 return (BitVecNum)Expr.Create(this, Native.Z3_mk_bv_numeral(nCtx, (uint)bits.Length, _bits));
3462 }

◆ 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 3414 of file Context.cs.

3415 {
3416 using var sort = MkBitVecSort(size);
3417 return (BitVecNum)MkNumeral(v, sort);
3418 }
BitVecSort MkBitVecSort(uint size)
Create a new bit-vector sort.
Definition Context.cs:250
Expr MkNumeral(string v, Sort ty)
Create a Term of a given sort.
Definition Context.cs:3200

◆ 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 3436 of file Context.cs.

3437 {
3438 using var sort = MkBitVecSort(size);
3439 return (BitVecNum)MkNumeral(v, sort);
3440 }

◆ 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 3403 of file Context.cs.

3404 {
3405 using var sort = MkBitVecSort(size);
3406 return (BitVecNum)MkNumeral(v, sort);
3407 }

◆ 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 3425 of file Context.cs.

3426 {
3427 using var sort = MkBitVecSort(size);
3428 return (BitVecNum)MkNumeral(v, sort);
3429 }

◆ 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 3447 of file Context.cs.

3448 {
3449 using var sort = MkBitVecSort(size);
3450 return (BitVecNum)MkNumeral(v, sort);
3451 }

◆ 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 2025 of file Context.cs.

2026 {
2027 Debug.Assert(t != null);
2028
2029 CheckContextMatch(t);
2030 return new IntExpr(this, Native.Z3_mk_bv2int(nCtx, t.NativeObject, (byte)(signed ? 1 : 0)));
2031 }

◆ MkBVAdd()

BitVecExpr MkBVAdd ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement addition.

The arguments must have the same bit-vector sort.

Definition at line 1513 of file Context.cs.

1514 {
1515 Debug.Assert(t1 != null);
1516 Debug.Assert(t2 != null);
1517
1518 CheckContextMatch(t1);
1519 CheckContextMatch(t2);
1520 return new BitVecExpr(this, Native.Z3_mk_bvadd(nCtx, t1.NativeObject, t2.NativeObject));
1521 }

◆ 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 2039 of file Context.cs.

2040 {
2041 Debug.Assert(t1 != null);
2042 Debug.Assert(t2 != null);
2043
2044 CheckContextMatch(t1);
2045 CheckContextMatch(t2);
2046 return new BoolExpr(this, Native.Z3_mk_bvadd_no_overflow(nCtx, t1.NativeObject, t2.NativeObject, (byte)(isSigned ? 1 : 0)));
2047 }

◆ 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 2055 of file Context.cs.

2056 {
2057 Debug.Assert(t1 != null);
2058 Debug.Assert(t2 != null);
2059
2060 CheckContextMatch(t1);
2061 CheckContextMatch(t2);
2062 return new BoolExpr(this, Native.Z3_mk_bvadd_no_underflow(nCtx, t1.NativeObject, t2.NativeObject));
2063 }

◆ MkBVAND()

BitVecExpr MkBVAND ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise conjunction.

The arguments must have a bit-vector sort.

Definition at line 1417 of file Context.cs.

1418 {
1419 Debug.Assert(t1 != null);
1420 Debug.Assert(t2 != null);
1421
1422 CheckContextMatch(t1);
1423 CheckContextMatch(t2);
1424 return new BitVecExpr(this, Native.Z3_mk_bvand(nCtx, t1.NativeObject, t2.NativeObject));
1425 }

◆ 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 1918 of file Context.cs.

1919 {
1920 Debug.Assert(t1 != null);
1921 Debug.Assert(t2 != null);
1922
1923 CheckContextMatch(t1);
1924 CheckContextMatch(t2);
1925 return new BitVecExpr(this, Native.Z3_mk_bvashr(nCtx, t1.NativeObject, t2.NativeObject));
1926 }

◆ MkBVConst() [1/2]

BitVecExpr MkBVConst ( string  name,
uint  size 
)
inline

Creates a bit-vector constant.

Definition at line 942 of file Context.cs.

943 {
944 using var sort = MkBitVecSort(size);
945 return (BitVecExpr)MkConst(name, sort);
946 }

◆ MkBVConst() [2/2]

BitVecExpr MkBVConst ( Symbol  name,
uint  size 
)
inline

Creates a bit-vector constant.

Definition at line 931 of file Context.cs.

932 {
933 Debug.Assert(name != null);
934
935 using var sort = MkBitVecSort(size);
936 return (BitVecExpr)MkConst(name, sort);
937 }

◆ 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 1894 of file Context.cs.

1895 {
1896 Debug.Assert(t1 != null);
1897 Debug.Assert(t2 != null);
1898
1899 CheckContextMatch(t1);
1900 CheckContextMatch(t2);
1901 return new BitVecExpr(this, Native.Z3_mk_bvlshr(nCtx, t1.NativeObject, t2.NativeObject));
1902 }

◆ MkBVMul()

BitVecExpr MkBVMul ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement multiplication.

The arguments must have the same bit-vector sort.

Definition at line 1541 of file Context.cs.

1542 {
1543 Debug.Assert(t1 != null);
1544 Debug.Assert(t2 != null);
1545
1546 CheckContextMatch(t1);
1547 CheckContextMatch(t2);
1548 return new BitVecExpr(this, Native.Z3_mk_bvmul(nCtx, t1.NativeObject, t2.NativeObject));
1549 }

◆ 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 2133 of file Context.cs.

2134 {
2135 Debug.Assert(t1 != null);
2136 Debug.Assert(t2 != null);
2137
2138 CheckContextMatch(t1);
2139 CheckContextMatch(t2);
2140 return new BoolExpr(this, Native.Z3_mk_bvmul_no_overflow(nCtx, t1.NativeObject, t2.NativeObject, (byte)(isSigned ? 1 : 0)));
2141 }

◆ 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 2149 of file Context.cs.

2150 {
2151 Debug.Assert(t1 != null);
2152 Debug.Assert(t2 != null);
2153
2154 CheckContextMatch(t1);
2155 CheckContextMatch(t2);
2156 return new BoolExpr(this, Native.Z3_mk_bvmul_no_underflow(nCtx, t1.NativeObject, t2.NativeObject));
2157 }

◆ MkBVNAND()

BitVecExpr MkBVNAND ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise NAND.

The arguments must have a bit-vector sort.

Definition at line 1459 of file Context.cs.

1460 {
1461 Debug.Assert(t1 != null);
1462 Debug.Assert(t2 != null);
1463
1464 CheckContextMatch(t1);
1465 CheckContextMatch(t2);
1466 return new BitVecExpr(this, Native.Z3_mk_bvnand(nCtx, t1.NativeObject, t2.NativeObject));
1467 }

◆ MkBVNeg()

BitVecExpr MkBVNeg ( BitVecExpr  t)
inline

Standard two's complement unary minus.

The arguments must have a bit-vector sort.

Definition at line 1501 of file Context.cs.

1502 {
1503 Debug.Assert(t != null);
1504
1505 CheckContextMatch(t);
1506 return new BitVecExpr(this, Native.Z3_mk_bvneg(nCtx, t.NativeObject));
1507 }

◆ 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 2119 of file Context.cs.

2120 {
2121 Debug.Assert(t != null);
2122
2123 CheckContextMatch(t);
2124 return new BoolExpr(this, Native.Z3_mk_bvneg_no_overflow(nCtx, t.NativeObject));
2125 }

◆ MkBVNOR()

BitVecExpr MkBVNOR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise NOR.

The arguments must have a bit-vector sort.

Definition at line 1473 of file Context.cs.

1474 {
1475 Debug.Assert(t1 != null);
1476 Debug.Assert(t2 != null);
1477
1478 CheckContextMatch(t1);
1479 CheckContextMatch(t2);
1480 return new BitVecExpr(this, Native.Z3_mk_bvnor(nCtx, t1.NativeObject, t2.NativeObject));
1481 }

◆ MkBVNot()

BitVecExpr MkBVNot ( BitVecExpr  t)
inline

Bitwise negation.

The argument must have a bit-vector sort.

Definition at line 1381 of file Context.cs.

1382 {
1383 Debug.Assert(t != null);
1384
1385 CheckContextMatch(t);
1386 return new BitVecExpr(this, Native.Z3_mk_bvnot(nCtx, t.NativeObject));
1387 }

◆ MkBVOR()

BitVecExpr MkBVOR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise disjunction.

The arguments must have a bit-vector sort.

Definition at line 1431 of file Context.cs.

1432 {
1433 Debug.Assert(t1 != null);
1434 Debug.Assert(t2 != null);
1435
1436 CheckContextMatch(t1);
1437 CheckContextMatch(t2);
1438 return new BitVecExpr(this, Native.Z3_mk_bvor(nCtx, t1.NativeObject, t2.NativeObject));
1439 }

◆ 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 1393 of file Context.cs.

1394 {
1395 Debug.Assert(t != null);
1396
1397 CheckContextMatch(t);
1398 return new BitVecExpr(this, Native.Z3_mk_bvredand(nCtx, t.NativeObject));
1399 }

◆ 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 1405 of file Context.cs.

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

◆ 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 1965 of file Context.cs.

1966 {
1967 Debug.Assert(t1 != null);
1968 Debug.Assert(t2 != null);
1969
1970 CheckContextMatch(t1);
1971 CheckContextMatch(t2);
1972 return new BitVecExpr(this, Native.Z3_mk_ext_rotate_left(nCtx, t1.NativeObject, t2.NativeObject));
1973 }

◆ 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 1935 of file Context.cs.

1936 {
1937 Debug.Assert(t != null);
1938
1939 CheckContextMatch(t);
1940 return new BitVecExpr(this, Native.Z3_mk_rotate_left(nCtx, i, t.NativeObject));
1941 }

◆ 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 1982 of file Context.cs.

1983 {
1984 Debug.Assert(t1 != null);
1985 Debug.Assert(t2 != null);
1986
1987 CheckContextMatch(t1);
1988 CheckContextMatch(t2);
1989 return new BitVecExpr(this, Native.Z3_mk_ext_rotate_right(nCtx, t1.NativeObject, t2.NativeObject));
1990 }

◆ 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 1950 of file Context.cs.

1951 {
1952 Debug.Assert(t != null);
1953
1954 CheckContextMatch(t);
1955 return new BitVecExpr(this, Native.Z3_mk_rotate_right(nCtx, i, t.NativeObject));
1956 }

◆ 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 1583 of file Context.cs.

1584 {
1585 Debug.Assert(t1 != null);
1586 Debug.Assert(t2 != null);
1587
1588 CheckContextMatch(t1);
1589 CheckContextMatch(t2);
1590 return new BitVecExpr(this, Native.Z3_mk_bvsdiv(nCtx, t1.NativeObject, t2.NativeObject));
1591 }

◆ 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 2103 of file Context.cs.

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

◆ 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 1734 of file Context.cs.

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

◆ 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 1766 of file Context.cs.

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

◆ 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 1872 of file Context.cs.

1873 {
1874 Debug.Assert(t1 != null);
1875 Debug.Assert(t2 != null);
1876
1877 CheckContextMatch(t1);
1878 CheckContextMatch(t2);
1879 return new BitVecExpr(this, Native.Z3_mk_bvshl(nCtx, t1.NativeObject, t2.NativeObject));
1880 }

◆ 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 1702 of file Context.cs.

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

◆ 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 1670 of file Context.cs.

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

◆ 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 1638 of file Context.cs.

1639 {
1640 Debug.Assert(t1 != null);
1641 Debug.Assert(t2 != null);
1642
1643 CheckContextMatch(t1);
1644 CheckContextMatch(t2);
1645 return new BitVecExpr(this, Native.Z3_mk_bvsmod(nCtx, t1.NativeObject, t2.NativeObject));
1646 }

◆ 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 1621 of file Context.cs.

1622 {
1623 Debug.Assert(t1 != null);
1624 Debug.Assert(t2 != null);
1625
1626 CheckContextMatch(t1);
1627 CheckContextMatch(t2);
1628 return new BitVecExpr(this, Native.Z3_mk_bvsrem(nCtx, t1.NativeObject, t2.NativeObject));
1629 }

◆ MkBVSub()

BitVecExpr MkBVSub ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement subtraction.

The arguments must have the same bit-vector sort.

Definition at line 1527 of file Context.cs.

1528 {
1529 Debug.Assert(t1 != null);
1530 Debug.Assert(t2 != null);
1531
1532 CheckContextMatch(t1);
1533 CheckContextMatch(t2);
1534 return new BitVecExpr(this, Native.Z3_mk_bvsub(nCtx, t1.NativeObject, t2.NativeObject));
1535 }

◆ 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 2071 of file Context.cs.

2072 {
2073 Debug.Assert(t1 != null);
2074 Debug.Assert(t2 != null);
2075
2076 CheckContextMatch(t1);
2077 CheckContextMatch(t2);
2078 return new BoolExpr(this, Native.Z3_mk_bvsub_no_overflow(nCtx, t1.NativeObject, t2.NativeObject));
2079 }

◆ 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 2087 of file Context.cs.

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

◆ 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 1560 of file Context.cs.

1561 {
1562 Debug.Assert(t1 != null);
1563 Debug.Assert(t2 != null);
1564
1565 CheckContextMatch(t1);
1566 CheckContextMatch(t2);
1567 return new BitVecExpr(this, Native.Z3_mk_bvudiv(nCtx, t1.NativeObject, t2.NativeObject));
1568 }

◆ 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 1718 of file Context.cs.

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

◆ MkBVUGT()

BoolExpr MkBVUGT ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Unsigned greater-than.

The arguments must have the same bit-vector sort.

Definition at line 1750 of file Context.cs.

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

◆ 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 1686 of file Context.cs.

1687 {
1688 Debug.Assert(t1 != null);
1689 Debug.Assert(t2 != null);
1690
1691 CheckContextMatch(t1);
1692 CheckContextMatch(t2);
1693 return new BoolExpr(this, Native.Z3_mk_bvule(nCtx, t1.NativeObject, t2.NativeObject));
1694 }

◆ MkBVULT()

BoolExpr MkBVULT ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Unsigned less-than.

The arguments must have the same bit-vector sort.

Definition at line 1654 of file Context.cs.

1655 {
1656 Debug.Assert(t1 != null);
1657 Debug.Assert(t2 != null);
1658
1659 CheckContextMatch(t1);
1660 CheckContextMatch(t2);
1661 return new BoolExpr(this, Native.Z3_mk_bvult(nCtx, t1.NativeObject, t2.NativeObject));
1662 }

◆ 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 1601 of file Context.cs.

1602 {
1603 Debug.Assert(t1 != null);
1604 Debug.Assert(t2 != null);
1605
1606 CheckContextMatch(t1);
1607 CheckContextMatch(t2);
1608 return new BitVecExpr(this, Native.Z3_mk_bvurem(nCtx, t1.NativeObject, t2.NativeObject));
1609 }

◆ MkBVXNOR()

BitVecExpr MkBVXNOR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise XNOR.

The arguments must have a bit-vector sort.

Definition at line 1487 of file Context.cs.

1488 {
1489 Debug.Assert(t1 != null);
1490 Debug.Assert(t2 != null);
1491
1492 CheckContextMatch(t1);
1493 CheckContextMatch(t2);
1494 return new BitVecExpr(this, Native.Z3_mk_bvxnor(nCtx, t1.NativeObject, t2.NativeObject));
1495 }

◆ MkBVXOR()

BitVecExpr MkBVXOR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise XOR.

The arguments must have a bit-vector sort.

Definition at line 1445 of file Context.cs.

1446 {
1447 Debug.Assert(t1 != null);
1448 Debug.Assert(t2 != null);
1449
1450 CheckContextMatch(t1);
1451 CheckContextMatch(t2);
1452 return new BitVecExpr(this, Native.Z3_mk_bvxor(nCtx, t1.NativeObject, t2.NativeObject));
1453 }

◆ MkCharLe()

BoolExpr MkCharLe ( Expr  ch1,
Expr  ch2 
)
inline

Create less than or equal to between two characters.

Definition at line 3078 of file Context.cs.

3079 {
3080 Debug.Assert(ch1 != null);
3081 Debug.Assert(ch2 != null);
3082 return new BoolExpr(this, Native.Z3_mk_char_le(nCtx, ch1.NativeObject, ch2.NativeObject));
3083 }

◆ MkComplement()

ReExpr MkComplement ( ReExpr  re)
inline

Create the complement regular expression.

Definition at line 2990 of file Context.cs.

2991 {
2992 Debug.Assert(re != null);
2993 return new ReExpr(this, Native.Z3_mk_re_complement(nCtx, re.NativeObject));
2994 }

◆ 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 1786 of file Context.cs.

1787 {
1788 Debug.Assert(t1 != null);
1789 Debug.Assert(t2 != null);
1790
1791 CheckContextMatch(t1);
1792 CheckContextMatch(t2);
1793 return new BitVecExpr(this, Native.Z3_mk_concat(nCtx, t1.NativeObject, t2.NativeObject));
1794 }

◆ MkConcat() [2/3]

ReExpr MkConcat ( params ReExpr[]  t)
inline

Create the concatenation of regular languages.

Definition at line 2999 of file Context.cs.

3000 {
3001 Debug.Assert(t != null);
3002 Debug.Assert(t.All(a => a != null));
3003
3004 CheckContextMatch<ReExpr>(t);
3005 return new ReExpr(this, Native.Z3_mk_re_concat(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
3006 }

◆ MkConcat() [3/3]

SeqExpr MkConcat ( params SeqExpr[]  t)
inline

Concatenate sequences.

Definition at line 2749 of file Context.cs.

2750 {
2751 Debug.Assert(t != null);
2752 Debug.Assert(t.All(a => a != null));
2753
2754 CheckContextMatch<SeqExpr>(t);
2755 return new SeqExpr(this, Native.Z3_mk_seq_concat(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
2756 }

◆ 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 863 of file Context.cs.

864 {
865 Debug.Assert(f != null);
866
867 return MkApp(f);
868 }

◆ MkConst() [2/3]

Expr MkConst ( string  name,
Sort  range 
)
inline

Creates a new Constant of sort range and named name .

Definition at line 839 of file Context.cs.

840 {
841 Debug.Assert(range != null);
842
843 using var symbol = MkSymbol(name);
844 return MkConst(symbol, range);
845 }

◆ MkConst() [3/3]

Expr MkConst ( Symbol  name,
Sort  range 
)
inline

Creates a new Constant of sort range and named name .

Definition at line 825 of file Context.cs.

826 {
827 Debug.Assert(name != null);
828 Debug.Assert(range != null);
829
830 CheckContextMatch(name);
831 CheckContextMatch(range);
832
833 return Expr.Create(this, Native.Z3_mk_const(nCtx, name.NativeObject, range.NativeObject));
834 }
expr range(expr const &lo, expr const &hi)
Definition z3++.h:4436

Referenced by Context.MkArrayConst(), Context.MkArrayConst(), Context.MkBoolConst(), Context.MkBoolConst(), Context.MkBVConst(), Context.MkBVConst(), 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 2304 of file Context.cs.

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

◆ MkConstDecl() [1/2]

FuncDecl MkConstDecl ( string  name,
Sort  range 
)
inline

Creates a new constant function declaration.

Definition at line 759 of file Context.cs.

760 {
761 Debug.Assert(range != null);
762
763 CheckContextMatch(range);
764 using var symbol = MkSymbol(name);
765 return new FuncDecl(this, symbol, null, range);
766 }

◆ MkConstDecl() [2/2]

FuncDecl MkConstDecl ( Symbol  name,
Sort  range 
)
inline

Creates a new constant function declaration.

Definition at line 746 of file Context.cs.

747 {
748 Debug.Assert(name != null);
749 Debug.Assert(range != null);
750
751 CheckContextMatch(name);
752 CheckContextMatch(range);
753 return new FuncDecl(this, name, null, range);
754 }

◆ 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 432 of file Context.cs.

433 {
434
435 using var nameSymbol = MkSymbol(name);
436 using var recognizerSymbol = MkSymbol(recognizer);
437 var fieldSymbols = MkSymbols(fieldNames);
438 try
439 {
440 return new Constructor(this, nameSymbol, recognizerSymbol, fieldSymbols, sorts, sortRefs);
441 }
442 finally
443 {
444 foreach (var fieldSymbol in fieldSymbols)
445 fieldSymbol.Dispose();
446 }
447 }

◆ 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 415 of file Context.cs.

416 {
417 Debug.Assert(name != null);
418 Debug.Assert(recognizer != null);
419
420 return new Constructor(this, name, recognizer, fieldNames, sorts, sortRefs);
421 }

◆ MkContains()

BoolExpr MkContains ( SeqExpr  s1,
SeqExpr  s2 
)
inline

Check for sequence containment of s2 in s1.

Definition at line 2793 of file Context.cs.

2794 {
2795 Debug.Assert(s1 != null);
2796 Debug.Assert(s2 != null);
2797 CheckContextMatch(s1, s2);
2798 return new BoolExpr(this, Native.Z3_mk_seq_contains(nCtx, s1.NativeObject, s2.NativeObject));
2799 }

◆ MkDatatypeSort() [1/2]

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

Create a new datatype sort.

Definition at line 467 of file Context.cs.

468 {
469 Debug.Assert(constructors != null);
470 Debug.Assert(constructors.All(c => c != null));
471
472 CheckContextMatch<Constructor>(constructors);
473 using var symbol = MkSymbol(name);
474 return new DatatypeSort(this, symbol, constructors);
475 }
DatatypeSort(name, params=None, ctx=None)
Definition z3py.py:5950

◆ MkDatatypeSort() [2/2]

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

Create a new datatype sort.

Definition at line 452 of file Context.cs.

453 {
454 Debug.Assert(name != null);
455 Debug.Assert(constructors != null);
456 Debug.Assert(constructors.All(c => c != null));
457
458
459 CheckContextMatch(name);
460 CheckContextMatch<Constructor>(constructors);
461 return new DatatypeSort(this, name, constructors);
462 }

◆ 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 501 of file Context.cs.

502 {
503 using var symbol = MkSymbol(name);
504 return MkDatatypeSortRef(symbol, parameters);
505 }
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:483

◆ 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 483 of file Context.cs.

484 {
485 Debug.Assert(name != null);
486 CheckContextMatch(name);
487 if (parameters != null)
488 CheckContextMatch<Sort>(parameters);
489
490 var numParams = (parameters == null) ? 0 : (uint)parameters.Length;
491 var paramsNative = (parameters == null) ? null : AST.ArrayToNative(parameters);
492 return new DatatypeSort(this, Native.Z3_mk_datatype_sort(nCtx, name.NativeObject, numParams, paramsNative));
493 }
Length(s)
Definition z3py.py:11921

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 545 of file Context.cs.

546 {
547 Debug.Assert(names != null);
548 Debug.Assert(c != null);
549 Debug.Assert(names.Length == c.Length);
550 //Debug.Assert(Contract.ForAll(0, c.Length, j => c[j] != null));
551 //Debug.Assert(names.All(name => name != null));
552
553 var symbols = MkSymbols(names);
554 try
555 {
556 return MkDatatypeSorts(symbols, c);
557 }
558 finally
559 {
560 foreach (var symbol in symbols)
561 symbol.Dispose();
562 }
563 }
DatatypeSort[] MkDatatypeSorts(Symbol[] names, Constructor[][] c)
Create mutually recursive datatypes.
Definition Context.cs:512

◆ 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 512 of file Context.cs.

513 {
514 Debug.Assert(names != null);
515 Debug.Assert(c != null);
516 Debug.Assert(names.Length == c.Length);
517 //Debug.Assert(Contract.ForAll(0, c.Length, j => c[j] != null));
518 Debug.Assert(names.All(name => name != null));
519
520 CheckContextMatch<Symbol>(names);
521 uint n = (uint)names.Length;
522 ConstructorList[] cla = new ConstructorList[n];
523 IntPtr[] n_constr = new IntPtr[n];
524 for (uint i = 0; i < n; i++)
525 {
526 Constructor[] constructor = c[i];
527 CheckContextMatch<Constructor>(constructor);
528 cla[i] = new ConstructorList(this, constructor);
529 n_constr[i] = cla[i].NativeObject;
530 }
531 IntPtr[] n_res = new IntPtr[n];
532 Native.Z3_mk_datatypes(nCtx, n, Symbol.ArrayToNative(names), n_res, n_constr);
533 DatatypeSort[] res = new DatatypeSort[n];
534 for (uint i = 0; i < n; i++)
535 res[i] = new DatatypeSort(this, n_res[i]);
536 return res;
537 }

Referenced by Context.MkDatatypeSorts().

◆ MkDiff()

ReExpr MkDiff ( ReExpr  a,
ReExpr  b 
)
inline

Create a difference regular expression.

Definition at line 3035 of file Context.cs.

3036 {
3037 Debug.Assert(a != null);
3038 Debug.Assert(b != null);
3039 CheckContextMatch(a, b);
3040 return new ReExpr(this, Native.Z3_mk_re_diff(nCtx, a.NativeObject, b.NativeObject));
3041 }

◆ MkDistinct() [1/2]

BoolExpr MkDistinct ( IEnumerable< Expr args)
inline

Creates a distinct term.

Definition at line 1024 of file Context.cs.

1025 {
1026 Debug.Assert(args != null);
1027 return MkDistinct(args.ToArray());
1028 }
BoolExpr MkDistinct(params Expr[] args)
Creates a distinct term.
Definition Context.cs:1012

◆ MkDistinct() [2/2]

BoolExpr MkDistinct ( params Expr[]  args)
inline

Creates a distinct term.

Definition at line 1012 of file Context.cs.

1013 {
1014 Debug.Assert(args != null);
1015 Debug.Assert(args.All(a => a != null));
1016
1017 CheckContextMatch<Expr>(args);
1018 return new BoolExpr(this, Native.Z3_mk_distinct(nCtx, (uint)args.Length, AST.ArrayToNative(args)));
1019 }

Referenced by Context.MkDistinct().

◆ MkDiv()

ArithExpr MkDiv ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 / t2.

Definition at line 1228 of file Context.cs.

1229 {
1230 Debug.Assert(t1 != null);
1231 Debug.Assert(t2 != null);
1232
1233 CheckContextMatch(t1);
1234 CheckContextMatch(t2);
1235 return (ArithExpr)Expr.Create(this, Native.Z3_mk_div(nCtx, t1.NativeObject, t2.NativeObject));
1236 }

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 3047 of file Context.cs.

3048 {
3049 Debug.Assert(s != null);
3050 return new ReExpr(this, Native.Z3_mk_re_empty(nCtx, s.NativeObject));
3051 }

◆ MkEmptySeq()

SeqExpr MkEmptySeq ( Sort  s)
inline

Create the empty sequence.

Definition at line 2681 of file Context.cs.

2682 {
2683 Debug.Assert(s != null);
2684 return new SeqExpr(this, Native.Z3_mk_seq_empty(nCtx, s.NativeObject));
2685 }

◆ MkEmptySet()

ArrayExpr MkEmptySet ( Sort  domain)
inline

Create an empty set.

Definition at line 2380 of file Context.cs.

2381 {
2382 Debug.Assert(domain != null);
2383
2384 CheckContextMatch(domain);
2385 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_empty_set(nCtx, domain.NativeObject));
2386 }

◆ MkEnumSort() [1/2]

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

Create a new enumeration sort.

Definition at line 333 of file Context.cs.

334 {
335 Debug.Assert(enumNames != null);
336
337 var enumSymbols = MkSymbols(enumNames);
338 try
339 {
340 using var symbol = MkSymbol(name);
341 return new EnumSort(this, symbol, enumSymbols);
342 }
343 finally
344 {
345 foreach (var enumSymbol in enumSymbols)
346 enumSymbol.Dispose();
347 }
348 }
EnumSort(name, values, ctx=None)
Definition z3py.py:5999

◆ MkEnumSort() [2/2]

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

Create a new enumeration sort.

Definition at line 318 of file Context.cs.

319 {
320 Debug.Assert(name != null);
321 Debug.Assert(enumNames != null);
322 Debug.Assert(enumNames.All(f => f != null));
323
324
325 CheckContextMatch(name);
326 CheckContextMatch<Symbol>(enumNames);
327 return new EnumSort(this, name, enumNames);
328 }

◆ MkEq()

BoolExpr MkEq ( Expr  x,
Expr  y 
)
inline

Creates the equality x = y .

Definition at line 999 of file Context.cs.

1000 {
1001 Debug.Assert(x != null);
1002 Debug.Assert(y != null);
1003
1004 CheckContextMatch(x);
1005 CheckContextMatch(y);
1006 return new BoolExpr(this, Native.Z3_mk_eq(nCtx, x.NativeObject, y.NativeObject));
1007 }

◆ 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 3558 of file Context.cs.

3559 {
3560 Debug.Assert(body != null);
3561 Debug.Assert(boundConstants == null || boundConstants.All(n => n != null));
3562 Debug.Assert(patterns == null || patterns.All(p => p != null));
3563 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3564
3565 return new Quantifier(this, false, boundConstants, body, weight, patterns, noPatterns, quantifierID, skolemID);
3566 }

◆ 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 3536 of file Context.cs.

3537 {
3538 Debug.Assert(sorts != null);
3539 Debug.Assert(names != null);
3540 Debug.Assert(body != null);
3541 Debug.Assert(sorts.Length == names.Length);
3542 Debug.Assert(sorts.All(s => s != null));
3543 Debug.Assert(names.All(n => n != null));
3544 Debug.Assert(patterns == null || patterns.All(p => p != null));
3545 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3546
3547 return new Quantifier(this, false, sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
3548 }

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

◆ MkExtract() [1/2]

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

Extract subsequence.

Definition at line 2848 of file Context.cs.

2849 {
2850 Debug.Assert(s != null);
2851 Debug.Assert(offset != null);
2852 Debug.Assert(length != null);
2853 CheckContextMatch(s, offset, length);
2854 return new SeqExpr(this, Native.Z3_mk_seq_extract(nCtx, s.NativeObject, offset.NativeObject, length.NativeObject));
2855 }

◆ 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 1805 of file Context.cs.

1806 {
1807 Debug.Assert(t != null);
1808
1809 CheckContextMatch(t);
1810 return new BitVecExpr(this, Native.Z3_mk_extract(nCtx, high, low, t.NativeObject));
1811 }

◆ MkFalse()

BoolExpr MkFalse ( )
inline

The false Term.

Definition at line 983 of file Context.cs.

984 {
985 return new BoolExpr(this, Native.Z3_mk_false(nCtx));
986 }

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 397 of file Context.cs.

398 {
399 using var symbol = MkSymbol(name);
400 return new FiniteDomainSort(this, symbol, size);
401 }
FiniteDomainSort(name, sz, ctx=None)
Definition z3py.py:8427

◆ 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 381 of file Context.cs.

382 {
383 Debug.Assert(name != null);
384
385 CheckContextMatch(name);
386 return new FiniteDomainSort(this, name, size);
387 }

◆ MkFiniteSetDifference()

Expr MkFiniteSetDifference ( Expr  s1,
Expr  s2 
)
inline

Create the difference of two finite sets.

Definition at line 2588 of file Context.cs.

2589 {
2590 Debug.Assert(s1 != null);
2591 Debug.Assert(s2 != null);
2592
2593 CheckContextMatch(s1);
2594 CheckContextMatch(s2);
2595 return Expr.Create(this, Native.Z3_mk_finite_set_difference(nCtx, s1.NativeObject, s2.NativeObject));
2596 }

◆ MkFiniteSetEmpty()

Expr MkFiniteSetEmpty ( Sort  setSort)
inline

Create an empty finite set.

Definition at line 2540 of file Context.cs.

2541 {
2542 Debug.Assert(setSort != null);
2543
2544 CheckContextMatch(setSort);
2545 return Expr.Create(this, Native.Z3_mk_finite_set_empty(nCtx, setSort.NativeObject));
2546 }

◆ MkFiniteSetFilter()

Expr MkFiniteSetFilter ( Expr  f,
Expr  set 
)
inline

Filter a finite set with a predicate.

Definition at line 2651 of file Context.cs.

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

◆ MkFiniteSetIntersect()

Expr MkFiniteSetIntersect ( Expr  s1,
Expr  s2 
)
inline

Create the intersection of two finite sets.

Definition at line 2575 of file Context.cs.

2576 {
2577 Debug.Assert(s1 != null);
2578 Debug.Assert(s2 != null);
2579
2580 CheckContextMatch(s1);
2581 CheckContextMatch(s2);
2582 return Expr.Create(this, Native.Z3_mk_finite_set_intersect(nCtx, s1.NativeObject, s2.NativeObject));
2583 }

◆ MkFiniteSetMap()

Expr MkFiniteSetMap ( Expr  f,
Expr  set 
)
inline

Map a function over all elements in a finite set.

Definition at line 2638 of file Context.cs.

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

◆ MkFiniteSetMember()

BoolExpr MkFiniteSetMember ( Expr  elem,
Expr  set 
)
inline

Check for membership in a finite set.

Definition at line 2601 of file Context.cs.

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

◆ MkFiniteSetRange()

Expr MkFiniteSetRange ( Expr  low,
Expr  high 
)
inline

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

Definition at line 2664 of file Context.cs.

2665 {
2666 Debug.Assert(low != null);
2667 Debug.Assert(high != null);
2668
2669 CheckContextMatch(low);
2670 CheckContextMatch(high);
2671 return Expr.Create(this, Native.Z3_mk_finite_set_range(nCtx, low.NativeObject, high.NativeObject));
2672 }

◆ MkFiniteSetSingleton()

Expr MkFiniteSetSingleton ( Expr  elem)
inline

Create a singleton finite set.

Definition at line 2551 of file Context.cs.

2552 {
2553 Debug.Assert(elem != null);
2554
2555 CheckContextMatch(elem);
2556 return Expr.Create(this, Native.Z3_mk_finite_set_singleton(nCtx, elem.NativeObject));
2557 }

◆ MkFiniteSetSize()

Expr MkFiniteSetSize ( Expr  set)
inline

Get the cardinality of a finite set.

Definition at line 2614 of file Context.cs.

2615 {
2616 Debug.Assert(set != null);
2617
2618 CheckContextMatch(set);
2619 return Expr.Create(this, Native.Z3_mk_finite_set_size(nCtx, set.NativeObject));
2620 }

◆ MkFiniteSetSort()

FiniteSetSort MkFiniteSetSort ( Sort  elemSort)
inline

Create a finite set sort over the given element sort.

Definition at line 2507 of file Context.cs.

2508 {
2509 Debug.Assert(elemSort != null);
2510
2511 CheckContextMatch(elemSort);
2512 return new FiniteSetSort(this, elemSort);
2513 }
FiniteSetSort(elem_sort)
Definition z3py.py:5384

◆ MkFiniteSetSubset()

BoolExpr MkFiniteSetSubset ( Expr  s1,
Expr  s2 
)
inline

Check if one finite set is a subset of another.

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 (BoolExpr)Expr.Create(this, Native.Z3_mk_finite_set_subset(nCtx, s1.NativeObject, s2.NativeObject));
2633 }

◆ MkFiniteSetUnion()

Expr MkFiniteSetUnion ( Expr  s1,
Expr  s2 
)
inline

Create the union of two finite sets.

Definition at line 2562 of file Context.cs.

2563 {
2564 Debug.Assert(s1 != null);
2565 Debug.Assert(s2 != null);
2566
2567 CheckContextMatch(s1);
2568 CheckContextMatch(s2);
2569 return Expr.Create(this, Native.Z3_mk_finite_set_union(nCtx, s1.NativeObject, s2.NativeObject));
2570 }

◆ MkFixedpoint()

Fixedpoint MkFixedpoint ( )
inline

Create a Fixedpoint context.

Definition at line 4380 of file Context.cs.

4381 {
4382
4383 return new Fixedpoint(this);
4384 }

◆ 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 3518 of file Context.cs.

3519 {
3520 Debug.Assert(body != null);
3521 Debug.Assert(boundConstants == null || boundConstants.All(b => b != null));
3522 Debug.Assert(patterns == null || patterns.All(p => p != null));
3523 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3524
3525
3526 return new Quantifier(this, true, boundConstants, body, weight, patterns, noPatterns, quantifierID, skolemID);
3527 }

◆ 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 3494 of file Context.cs.

3495 {
3496 Debug.Assert(sorts != null);
3497 Debug.Assert(names != null);
3498 Debug.Assert(body != null);
3499 Debug.Assert(sorts.Length == names.Length);
3500 Debug.Assert(sorts.All(s => s != null));
3501 Debug.Assert(names.All(n => n != null));
3502 Debug.Assert(patterns == null || patterns.All(p => p != null));
3503 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3504
3505
3506 return new Quantifier(this, true, sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
3507 }

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 4970 of file Context.cs.

4971 {
4972 return new FPExpr(this, Native.Z3_mk_fpa_fp(this.nCtx, sgn.NativeObject, sig.NativeObject, exp.NativeObject));
4973 }

◆ 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 4691 of file Context.cs.

4692 {
4693 return MkFPNumeral(sgn, exp, sig, s);
4694 }
FPNum MkFPNumeral(float v, FPSort s)
Create a numeral of FloatingPoint sort from a float.
Definition Context.cs:4605

◆ 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 4703 of file Context.cs.

4704 {
4705 return MkFPNumeral(sgn, exp, sig, s);
4706 }

◆ 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 4669 of file Context.cs.

4670 {
4671 return MkFPNumeral(v, s);
4672 }

◆ 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 4659 of file Context.cs.

4660 {
4661 return MkFPNumeral(v, s);
4662 }

◆ 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 4679 of file Context.cs.

4680 {
4681 return MkFPNumeral(v, s);
4682 }

◆ MkFPAbs()

FPExpr MkFPAbs ( FPExpr  t)
inline

Floating-point absolute value.

Parameters
tfloating-point term

Definition at line 4715 of file Context.cs.

4716 {
4717 return new FPExpr(this, Native.Z3_mk_fpa_abs(this.nCtx, t.NativeObject));
4718 }

◆ 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 4735 of file Context.cs.

4736 {
4737 return new FPExpr(this, Native.Z3_mk_fpa_add(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject));
4738 }

◆ 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 4768 of file Context.cs.

4769 {
4770 return new FPExpr(this, Native.Z3_mk_fpa_div(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject));
4771 }

◆ 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 4887 of file Context.cs.

4888 {
4889 return new BoolExpr(this, Native.Z3_mk_fpa_eq(this.nCtx, t1.NativeObject, t2.NativeObject));
4890 }

◆ 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 4783 of file Context.cs.

4784 {
4785 return new FPExpr(this, Native.Z3_mk_fpa_fma(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject, t3.NativeObject));
4786 }

◆ MkFPGEq()

BoolExpr MkFPGEq ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point greater than or equal.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4864 of file Context.cs.

4865 {
4866 return new BoolExpr(this, Native.Z3_mk_fpa_geq(this.nCtx, t1.NativeObject, t2.NativeObject));
4867 }

◆ MkFPGt()

BoolExpr MkFPGt ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point greater than.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4874 of file Context.cs.

4875 {
4876 return new BoolExpr(this, Native.Z3_mk_fpa_gt(this.nCtx, t1.NativeObject, t2.NativeObject));
4877 }

◆ 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 4585 of file Context.cs.

4586 {
4587 return new FPNum(this, Native.Z3_mk_fpa_inf(nCtx, s.NativeObject, (byte)(negative ? 1 : 0)));
4588 }

◆ 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 4923 of file Context.cs.

4924 {
4925 return new BoolExpr(this, Native.Z3_mk_fpa_is_infinite(this.nCtx, t.NativeObject));
4926 }

◆ MkFPIsNaN()

BoolExpr MkFPIsNaN ( FPExpr  t)
inline

Predicate indicating whether t is a NaN.

Parameters
tfloating-point term

Definition at line 4932 of file Context.cs.

4933 {
4934 return new BoolExpr(this, Native.Z3_mk_fpa_is_nan(this.nCtx, t.NativeObject));
4935 }

◆ MkFPIsNegative()

BoolExpr MkFPIsNegative ( FPExpr  t)
inline

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

Parameters
tfloating-point term

Definition at line 4941 of file Context.cs.

4942 {
4943 return new BoolExpr(this, Native.Z3_mk_fpa_is_negative(this.nCtx, t.NativeObject));
4944 }

◆ MkFPIsNormal()

BoolExpr MkFPIsNormal ( FPExpr  t)
inline

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

Parameters
tfloating-point term

Definition at line 4896 of file Context.cs.

4897 {
4898 return new BoolExpr(this, Native.Z3_mk_fpa_is_normal(this.nCtx, t.NativeObject));
4899 }

◆ MkFPIsPositive()

BoolExpr MkFPIsPositive ( FPExpr  t)
inline

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

Parameters
tfloating-point term

Definition at line 4950 of file Context.cs.

4951 {
4952 return new BoolExpr(this, Native.Z3_mk_fpa_is_positive(this.nCtx, t.NativeObject));
4953 }

◆ MkFPIsSubnormal()

BoolExpr MkFPIsSubnormal ( FPExpr  t)
inline

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

Parameters
tfloating-point term

Definition at line 4905 of file Context.cs.

4906 {
4907 return new BoolExpr(this, Native.Z3_mk_fpa_is_subnormal(this.nCtx, t.NativeObject));
4908 }

◆ 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 4914 of file Context.cs.

4915 {
4916 return new BoolExpr(this, Native.Z3_mk_fpa_is_zero(this.nCtx, t.NativeObject));
4917 }

◆ MkFPLEq()

BoolExpr MkFPLEq ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point less than or equal.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4844 of file Context.cs.

4845 {
4846 return new BoolExpr(this, Native.Z3_mk_fpa_leq(this.nCtx, t1.NativeObject, t2.NativeObject));
4847 }

◆ MkFPLt()

BoolExpr MkFPLt ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point less than.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4854 of file Context.cs.

4855 {
4856 return new BoolExpr(this, Native.Z3_mk_fpa_lt(this.nCtx, t1.NativeObject, t2.NativeObject));
4857 }

◆ MkFPMax()

FPExpr MkFPMax ( FPExpr  t1,
FPExpr  t2 
)
inline

Maximum of floating-point numbers.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4834 of file Context.cs.

4835 {
4836 return new FPExpr(this, Native.Z3_mk_fpa_max(this.nCtx, t1.NativeObject, t2.NativeObject));
4837 }

◆ MkFPMin()

FPExpr MkFPMin ( FPExpr  t1,
FPExpr  t2 
)
inline

Minimum of floating-point numbers.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4824 of file Context.cs.

4825 {
4826 return new FPExpr(this, Native.Z3_mk_fpa_min(this.nCtx, t1.NativeObject, t2.NativeObject));
4827 }

◆ 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 4757 of file Context.cs.

4758 {
4759 return new FPExpr(this, Native.Z3_mk_fpa_mul(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject));
4760 }

◆ MkFPNaN()

FPNum MkFPNaN ( FPSort  s)
inline

Create a NaN of sort s.

Parameters
sFloatingPoint sort.

Definition at line 4575 of file Context.cs.

4576 {
4577 return new FPNum(this, Native.Z3_mk_fpa_nan(nCtx, s.NativeObject));
4578 }

◆ MkFPNeg()

FPExpr MkFPNeg ( FPExpr  t)
inline

Floating-point negation.

Parameters
tfloating-point term

Definition at line 4724 of file Context.cs.

4725 {
4726 return new FPExpr(this, Native.Z3_mk_fpa_neg(this.nCtx, t.NativeObject));
4727 }

◆ 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 4649 of file Context.cs.

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

◆ 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 4637 of file Context.cs.

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

◆ 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 4615 of file Context.cs.

4616 {
4617 return new FPNum(this, Native.Z3_mk_fpa_numeral_double(nCtx, v, s.NativeObject));
4618 }

◆ 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 4605 of file Context.cs.

4606 {
4607 return new FPNum(this, Native.Z3_mk_fpa_numeral_float(nCtx, v, s.NativeObject));
4608 }

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 4625 of file Context.cs.

4626 {
4627 return new FPNum(this, Native.Z3_mk_fpa_numeral_int(nCtx, v, s.NativeObject));
4628 }

◆ MkFPRem()

FPExpr MkFPRem ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point remainder.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4803 of file Context.cs.

4804 {
4805 return new FPExpr(this, Native.Z3_mk_fpa_rem(this.nCtx, t1.NativeObject, t2.NativeObject));
4806 }

◆ MkFPRNA()

FPRMNum MkFPRNA ( )
inline

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

Definition at line 4439 of file Context.cs.

4440 {
4441 return new FPRMNum(this, Native.Z3_mk_fpa_rna(nCtx));
4442 }

◆ MkFPRNE()

FPRMNum MkFPRNE ( )
inline

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

Definition at line 4423 of file Context.cs.

4424 {
4425 return new FPRMNum(this, Native.Z3_mk_fpa_rne(nCtx));
4426 }

◆ MkFPRoundingModeSort()

FPRMSort MkFPRoundingModeSort ( )
inline

Create the floating-point RoundingMode sort.

Definition at line 4405 of file Context.cs.

4406 {
4407 return new FPRMSort(this);
4408 }

◆ MkFPRoundNearestTiesToAway()

FPRMNum MkFPRoundNearestTiesToAway ( )
inline

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

Definition at line 4431 of file Context.cs.

4432 {
4433 return new FPRMNum(this, Native.Z3_mk_fpa_round_nearest_ties_to_away(nCtx));
4434 }

◆ MkFPRoundNearestTiesToEven()

FPRMExpr MkFPRoundNearestTiesToEven ( )
inline

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

Definition at line 4415 of file Context.cs.

4416 {
4417 return new FPRMExpr(this, Native.Z3_mk_fpa_round_nearest_ties_to_even(nCtx));
4418 }

◆ 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 4814 of file Context.cs.

4815 {
4816 return new FPExpr(this, Native.Z3_mk_fpa_round_to_integral(this.nCtx, rm.NativeObject, t.NativeObject));
4817 }

◆ MkFPRoundTowardNegative()

FPRMNum MkFPRoundTowardNegative ( )
inline

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

Definition at line 4463 of file Context.cs.

4464 {
4465 return new FPRMNum(this, Native.Z3_mk_fpa_round_toward_negative(nCtx));
4466 }

◆ MkFPRoundTowardPositive()

FPRMNum MkFPRoundTowardPositive ( )
inline

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

Definition at line 4447 of file Context.cs.

4448 {
4449 return new FPRMNum(this, Native.Z3_mk_fpa_round_toward_positive(nCtx));
4450 }

◆ MkFPRoundTowardZero()

FPRMNum MkFPRoundTowardZero ( )
inline

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

Definition at line 4479 of file Context.cs.

4480 {
4481 return new FPRMNum(this, Native.Z3_mk_fpa_round_toward_zero(nCtx));
4482 }

◆ MkFPRTN()

FPRMNum MkFPRTN ( )
inline

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

Definition at line 4471 of file Context.cs.

4472 {
4473 return new FPRMNum(this, Native.Z3_mk_fpa_rtn(nCtx));
4474 }

◆ MkFPRTP()

FPRMNum MkFPRTP ( )
inline

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

Definition at line 4455 of file Context.cs.

4456 {
4457 return new FPRMNum(this, Native.Z3_mk_fpa_rtp(nCtx));
4458 }

◆ MkFPRTZ()

FPRMNum MkFPRTZ ( )
inline

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

Definition at line 4487 of file Context.cs.

4488 {
4489 return new FPRMNum(this, Native.Z3_mk_fpa_rtz(nCtx));
4490 }

◆ 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 4500 of file Context.cs.

4501 {
4502 return new FPSort(this, ebits, sbits);
4503 }
FPSort(ebits, sbits, ctx=None)
Definition z3py.py:10713

◆ MkFPSort128()

FPSort MkFPSort128 ( )
inline

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

Definition at line 4564 of file Context.cs.

4565 {
4566 return new FPSort(this, Native.Z3_mk_fpa_sort_128(nCtx));
4567 }

◆ MkFPSort16()

FPSort MkFPSort16 ( )
inline

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

Definition at line 4516 of file Context.cs.

4517 {
4518 return new FPSort(this, Native.Z3_mk_fpa_sort_16(nCtx));
4519 }

◆ MkFPSort32()

FPSort MkFPSort32 ( )
inline

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

Definition at line 4532 of file Context.cs.

4533 {
4534 return new FPSort(this, Native.Z3_mk_fpa_sort_32(nCtx));
4535 }

◆ MkFPSort64()

FPSort MkFPSort64 ( )
inline

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

Definition at line 4548 of file Context.cs.

4549 {
4550 return new FPSort(this, Native.Z3_mk_fpa_sort_64(nCtx));
4551 }

◆ MkFPSortDouble()

FPSort MkFPSortDouble ( )
inline

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

Definition at line 4540 of file Context.cs.

4541 {
4542 return new FPSort(this, Native.Z3_mk_fpa_sort_double(nCtx));
4543 }

◆ MkFPSortHalf()

FPSort MkFPSortHalf ( )
inline

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

Definition at line 4508 of file Context.cs.

4509 {
4510 return new FPSort(this, Native.Z3_mk_fpa_sort_half(nCtx));
4511 }

◆ MkFPSortQuadruple()

FPSort MkFPSortQuadruple ( )
inline

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

Definition at line 4556 of file Context.cs.

4557 {
4558 return new FPSort(this, Native.Z3_mk_fpa_sort_quadruple(nCtx));
4559 }

◆ MkFPSortSingle()

FPSort MkFPSortSingle ( )
inline

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

Definition at line 4524 of file Context.cs.

4525 {
4526 return new FPSort(this, Native.Z3_mk_fpa_sort_single(nCtx));
4527 }

◆ MkFPSqrt()

FPExpr MkFPSqrt ( FPRMExpr  rm,
FPExpr  t 
)
inline

Floating-point square root.

Parameters
rmrounding mode term
tfloating-point term

Definition at line 4793 of file Context.cs.

4794 {
4795 return new FPExpr(this, Native.Z3_mk_fpa_sqrt(this.nCtx, rm.NativeObject, t.NativeObject));
4796 }

◆ 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 4746 of file Context.cs.

4747 {
4748 return new FPExpr(this, Native.Z3_mk_fpa_sub(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject));
4749 }

◆ 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 5073 of file Context.cs.

5074 {
5075 if (sign)
5076 return new BitVecExpr(this, Native.Z3_mk_fpa_to_sbv(this.nCtx, rm.NativeObject, t.NativeObject, sz));
5077 else
5078 return new BitVecExpr(this, Native.Z3_mk_fpa_to_ubv(this.nCtx, rm.NativeObject, t.NativeObject, sz));
5079 }

◆ 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 4986 of file Context.cs.

4987 {
4988 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_bv(this.nCtx, bv.NativeObject, s.NativeObject));
4989 }

◆ 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.
signedflag indicating whether t is interpreted as signed or unsigned bit-vector.

Definition at line 5036 of file Context.cs.

5037 {
5038 if (signed)
5039 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_signed(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject));
5040 else
5041 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_unsigned(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject));
5042 }

◆ 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 5002 of file Context.cs.

5003 {
5004 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_float(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject));
5005 }

◆ 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 5124 of file Context.cs.

5125 {
5126 return new BitVecExpr(this, Native.Z3_mk_fpa_to_fp_int_real(this.nCtx, rm.NativeObject, exp.NativeObject, sig.NativeObject, s.NativeObject));
5127 }

◆ 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 5018 of file Context.cs.

5019 {
5020 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_real(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject));
5021 }

◆ 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 5054 of file Context.cs.

5055 {
5056 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_float(this.nCtx, s.NativeObject, rm.NativeObject, t.NativeObject));
5057 }

◆ 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 5107 of file Context.cs.

5108 {
5109 return new BitVecExpr(this, Native.Z3_mk_fpa_to_ieee_bv(this.nCtx, t.NativeObject));
5110 }

◆ 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 5090 of file Context.cs.

5091 {
5092 return new RealExpr(this, Native.Z3_mk_fpa_to_real(this.nCtx, t.NativeObject));
5093 }

◆ 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 4595 of file Context.cs.

4596 {
4597 return new FPNum(this, Native.Z3_mk_fpa_zero(nCtx, s.NativeObject, (byte)(negative ? 1 : 0)));
4598 }

◆ MkFreshConst()

Expr MkFreshConst ( string  prefix,
Sort  range 
)
inline

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

Definition at line 851 of file Context.cs.

852 {
853 Debug.Assert(range != null);
854
855 CheckContextMatch(range);
856 return Expr.Create(this, Native.Z3_mk_fresh_const(nCtx, prefix, range.NativeObject));
857 }

◆ 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 773 of file Context.cs.

774 {
775 Debug.Assert(range != null);
776
777 CheckContextMatch(range);
778 return new FuncDecl(this, prefix, null, range);
779 }

◆ 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 733 of file Context.cs.

734 {
735 Debug.Assert(range != null);
736 Debug.Assert(domain.All(d => d != null));
737
738 CheckContextMatch<Sort>(domain);
739 CheckContextMatch(range);
740 return new FuncDecl(this, prefix, domain, range);
741 }

◆ MkFullRe()

ReExpr MkFullRe ( Sort  s)
inline

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

Definition at line 3057 of file Context.cs.

3058 {
3059 Debug.Assert(s != null);
3060 return new ReExpr(this, Native.Z3_mk_re_full(nCtx, s.NativeObject));
3061 }

◆ MkFullSet()

ArrayExpr MkFullSet ( Sort  domain)
inline

Create the full set.

Definition at line 2391 of file Context.cs.

2392 {
2393 Debug.Assert(domain != null);
2394
2395 CheckContextMatch(domain);
2396 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_full_set(nCtx, domain.NativeObject));
2397 }

◆ MkFuncDecl() [1/4]

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

Creates a new function declaration.

Definition at line 716 of file Context.cs.

717 {
718 Debug.Assert(range != null);
719 Debug.Assert(domain != null);
720
721 CheckContextMatch(domain);
722 CheckContextMatch(range);
723 using var symbol = MkSymbol(name);
724 Sort[] q = new Sort[] { domain };
725 return new FuncDecl(this, symbol, q, range);
726 }

◆ MkFuncDecl() [2/4]

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

Creates a new function declaration.

Definition at line 673 of file Context.cs.

674 {
675 Debug.Assert(range != null);
676 Debug.Assert(domain.All(d => d != null));
677
678 CheckContextMatch<Sort>(domain);
679 CheckContextMatch(range);
680 using var symbol = MkSymbol(name);
681 return new FuncDecl(this, symbol, domain, range);
682 }

◆ MkFuncDecl() [3/4]

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

Creates a new function declaration.

Definition at line 657 of file Context.cs.

658 {
659 Debug.Assert(name != null);
660 Debug.Assert(domain != null);
661 Debug.Assert(range != null);
662
663 CheckContextMatch(name);
664 CheckContextMatch(domain);
665 CheckContextMatch(range);
666 Sort[] q = new Sort[] { domain };
667 return new FuncDecl(this, name, q, range);
668 }

◆ MkFuncDecl() [4/4]

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

Creates a new function declaration.

Definition at line 642 of file Context.cs.

643 {
644 Debug.Assert(name != null);
645 Debug.Assert(range != null);
646 Debug.Assert(domain.All(d => d != null));
647
648 CheckContextMatch(name);
649 CheckContextMatch<Sort>(domain);
650 CheckContextMatch(range);
651 return new FuncDecl(this, name, domain, range);
652 }

◆ MkGe()

BoolExpr MkGe ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 >= t2

Definition at line 1321 of file Context.cs.

1322 {
1323 Debug.Assert(t1 != null);
1324 Debug.Assert(t2 != null);
1325
1326 CheckContextMatch(t1);
1327 CheckContextMatch(t2);
1328 return new BoolExpr(this, Native.Z3_mk_ge(nCtx, t1.NativeObject, t2.NativeObject));
1329 }

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 3765 of file Context.cs.

3766 {
3767
3768 return new Goal(this, models, unsatCores, proofs);
3769 }

◆ MkGt()

BoolExpr MkGt ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 > t2

Definition at line 1308 of file Context.cs.

1309 {
1310 Debug.Assert(t1 != null);
1311 Debug.Assert(t2 != null);
1312
1313 CheckContextMatch(t1);
1314 CheckContextMatch(t2);
1315 return new BoolExpr(this, Native.Z3_mk_gt(nCtx, t1.NativeObject, t2.NativeObject));
1316 }

Referenced by ArithExpr.operator>().

◆ MkIff()

BoolExpr MkIff ( BoolExpr  t1,
BoolExpr  t2 
)
inline

Create an expression representing t1 iff t2.

Definition at line 1061 of file Context.cs.

1062 {
1063 Debug.Assert(t1 != null);
1064 Debug.Assert(t2 != null);
1065
1066 CheckContextMatch(t1);
1067 CheckContextMatch(t2);
1068 return new BoolExpr(this, Native.Z3_mk_iff(nCtx, t1.NativeObject, t2.NativeObject));
1069 }

◆ MkImplies()

BoolExpr MkImplies ( BoolExpr  t1,
BoolExpr  t2 
)
inline

Create an expression representing t1 -> t2.

Definition at line 1074 of file Context.cs.

1075 {
1076 Debug.Assert(t1 != null);
1077 Debug.Assert(t2 != null);
1078
1079 CheckContextMatch(t1);
1080 CheckContextMatch(t2);
1081 return new BoolExpr(this, Native.Z3_mk_implies(nCtx, t1.NativeObject, t2.NativeObject));
1082 }

◆ MkIndexOf()

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

Extract index of sub-string starting at offset.

Definition at line 2860 of file Context.cs.

2861 {
2862 Debug.Assert(s != null);
2863 Debug.Assert(offset != null);
2864 Debug.Assert(substr != null);
2865 CheckContextMatch(s, substr, offset);
2866 return new IntExpr(this, Native.Z3_mk_seq_index(nCtx, s.NativeObject, substr.NativeObject, offset.NativeObject));
2867 }

◆ MkInRe()

BoolExpr MkInRe ( SeqExpr  s,
ReExpr  re 
)
inline

Check for regular expression membership.

Definition at line 2943 of file Context.cs.

2944 {
2945 Debug.Assert(s != null);
2946 Debug.Assert(re != null);
2947 CheckContextMatch(s, re);
2948 return new BoolExpr(this, Native.Z3_mk_seq_in_re(nCtx, s.NativeObject, re.NativeObject));
2949 }

◆ 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 3357 of file Context.cs.

3358 {
3359
3360 return new IntNum(this, Native.Z3_mk_int(nCtx, v, IntSort.NativeObject));
3361 }
IntSort IntSort
Retrieves the Integer sort of the context.
Definition Context.cs:158

◆ 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 3379 of file Context.cs.

3380 {
3381
3382 return new IntNum(this, Native.Z3_mk_int64(nCtx, v, IntSort.NativeObject));
3383 }

◆ 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 3346 of file Context.cs.

3347 {
3348
3349 return new IntNum(this, Native.Z3_mk_numeral(nCtx, v, IntSort.NativeObject));
3350 }

◆ 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 3368 of file Context.cs.

3369 {
3370
3371 return new IntNum(this, Native.Z3_mk_unsigned_int(nCtx, v, IntSort.NativeObject));
3372 }

◆ 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 3390 of file Context.cs.

3391 {
3392
3393 return new IntNum(this, Native.Z3_mk_unsigned_int64(nCtx, v, IntSort.NativeObject));
3394 }

◆ 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 2002 of file Context.cs.

2003 {
2004 Debug.Assert(t != null);
2005
2006 CheckContextMatch(t);
2007 return new BitVecExpr(this, Native.Z3_mk_int2bv(nCtx, n, t.NativeObject));
2008 }

◆ 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 1341 of file Context.cs.

1342 {
1343 Debug.Assert(t != null);
1344
1345 CheckContextMatch(t);
1346 return new RealExpr(this, Native.Z3_mk_int2real(nCtx, t.NativeObject));
1347 }

◆ MkIntConst() [1/2]

IntExpr MkIntConst ( string  name)
inline

Creates an integer constant.

Definition at line 902 of file Context.cs.

903 {
904 Debug.Assert(name != null);
905
906 return (IntExpr)MkConst(name, IntSort);
907 }

◆ MkIntConst() [2/2]

IntExpr MkIntConst ( Symbol  name)
inline

Creates an integer constant.

Definition at line 892 of file Context.cs.

893 {
894 Debug.Assert(name != null);
895
896 return (IntExpr)MkConst(name, IntSort);
897 }

◆ MkIntersect()

ReExpr MkIntersect ( params ReExpr[]  t)
inline

Create the intersection of regular languages.

Definition at line 3023 of file Context.cs.

3024 {
3025 Debug.Assert(t != null);
3026 Debug.Assert(t.All(a => a != null));
3027
3028 CheckContextMatch<ReExpr>(t);
3029 return new ReExpr(this, Native.Z3_mk_re_intersect(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
3030 }

◆ MkIntSort()

IntSort MkIntSort ( )
inline

Create a new integer sort.

Definition at line 233 of file Context.cs.

234 {
235
236 return new IntSort(this);
237 }

◆ MkIsDigit()

BoolExpr MkIsDigit ( Expr  ch)
inline

Create a check if the character is a digit.

Definition at line 3115 of file Context.cs.

3116 {
3117 Debug.Assert(ch != null);
3118 return new BoolExpr(this, Native.Z3_mk_char_is_digit(nCtx, ch.NativeObject));
3119 }

◆ MkIsInteger()

BoolExpr MkIsInteger ( RealExpr  t)
inline

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

Definition at line 1367 of file Context.cs.

1368 {
1369 Debug.Assert(t != null);
1370
1371 CheckContextMatch(t);
1372 return new BoolExpr(this, Native.Z3_mk_is_int(nCtx, t.NativeObject));
1373 }

◆ 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 1046 of file Context.cs.

1047 {
1048 Debug.Assert(t1 != null);
1049 Debug.Assert(t2 != null);
1050 Debug.Assert(t3 != null);
1051
1052 CheckContextMatch(t1);
1053 CheckContextMatch(t2);
1054 CheckContextMatch(t3);
1055 return Expr.Create(this, Native.Z3_mk_ite(nCtx, t1.NativeObject, t2.NativeObject, t3.NativeObject));
1056 }

◆ 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 3647 of file Context.cs.

3648 {
3649 Debug.Assert(body != null);
3650 Debug.Assert(boundConstants != null && boundConstants.All(b => b != null));
3651 return new Lambda(this, boundConstants, body);
3652 }
Lambda(vs, body)
Definition z3py.py:2410

◆ 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 3628 of file Context.cs.

3629 {
3630 Debug.Assert(sorts != null);
3631 Debug.Assert(names != null);
3632 Debug.Assert(body != null);
3633 Debug.Assert(sorts.Length == names.Length);
3634 Debug.Assert(sorts.All(s => s != null));
3635 Debug.Assert(names.All(n => n != null));
3636 return new Lambda(this, sorts, names, body);
3637 }

◆ MkLe()

BoolExpr MkLe ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 <= t2

Definition at line 1295 of file Context.cs.

1296 {
1297 Debug.Assert(t1 != null);
1298 Debug.Assert(t2 != null);
1299
1300 CheckContextMatch(t1);
1301 CheckContextMatch(t2);
1302 return new BoolExpr(this, Native.Z3_mk_le(nCtx, t1.NativeObject, t2.NativeObject));
1303 }

Referenced by ArithExpr.operator<=().

◆ MkLength()

IntExpr MkLength ( SeqExpr  s)
inline

Retrieve the length of a given sequence.

Definition at line 2762 of file Context.cs.

2763 {
2764 Debug.Assert(s != null);
2765 return (IntExpr)Expr.Create(this, Native.Z3_mk_seq_length(nCtx, s.NativeObject));
2766 }

◆ MkListSort() [1/2]

ListSort MkListSort ( string  name,
Sort  elemSort 
)
inline

Create a new list sort.

Definition at line 366 of file Context.cs.

367 {
368 Debug.Assert(elemSort != null);
369
370 CheckContextMatch(elemSort);
371 using var symbol = MkSymbol(name);
372 return new ListSort(this, symbol, elemSort);
373 }

◆ MkListSort() [2/2]

ListSort MkListSort ( Symbol  name,
Sort  elemSort 
)
inline

Create a new list sort.

Definition at line 353 of file Context.cs.

354 {
355 Debug.Assert(name != null);
356 Debug.Assert(elemSort != null);
357
358 CheckContextMatch(name);
359 CheckContextMatch(elemSort);
360 return new ListSort(this, name, elemSort);
361 }

◆ MkLoop()

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

Take the bounded Kleene star of a regular expression.

Definition at line 2963 of file Context.cs.

2964 {
2965 Debug.Assert(re != null);
2966 return new ReExpr(this, Native.Z3_mk_re_loop(nCtx, re.NativeObject, lo, hi));
2967 }

◆ MkLt()

BoolExpr MkLt ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 < t2

Definition at line 1282 of file Context.cs.

1283 {
1284 Debug.Assert(t1 != null);
1285 Debug.Assert(t2 != null);
1286
1287 CheckContextMatch(t1);
1288 CheckContextMatch(t2);
1289 return new BoolExpr(this, Native.Z3_mk_lt(nCtx, t1.NativeObject, t2.NativeObject));
1290 }

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 2325 of file Context.cs.

2326 {
2327 Debug.Assert(f != null);
2328 Debug.Assert(args == null || args.All(a => a != null));
2329
2330 CheckContextMatch(f);
2331 CheckContextMatch<ArrayExpr>(args);
2332 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_map(nCtx, f.NativeObject, AST.ArrayLength(args), AST.ArrayToNative(args)));
2333 }

◆ MkMod()

IntExpr MkMod ( IntExpr  t1,
IntExpr  t2 
)
inline

Create an expression representing t1 mod t2.

The arguments must have int type.

Definition at line 1242 of file Context.cs.

1243 {
1244 Debug.Assert(t1 != null);
1245 Debug.Assert(t2 != null);
1246
1247 CheckContextMatch(t1);
1248 CheckContextMatch(t2);
1249 return new IntExpr(this, Native.Z3_mk_mod(nCtx, t1.NativeObject, t2.NativeObject));
1250 }

◆ MkMul() [1/2]

ArithExpr MkMul ( IEnumerable< ArithExpr ts)
inline

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

Definition at line 1196 of file Context.cs.

1197 {
1198 Debug.Assert(ts != null);
1199 return MkMul(ts.ToArray());
1200 }
ArithExpr MkMul(params ArithExpr[] ts)
Create an expression representing t[0] * t[1] * ....
Definition Context.cs:1184

◆ MkMul() [2/2]

ArithExpr MkMul ( params ArithExpr[]  ts)
inline

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

Definition at line 1184 of file Context.cs.

1185 {
1186 Debug.Assert(ts != null);
1187 Debug.Assert(ts.All(a => a != null));
1188
1189 CheckContextMatch<ArithExpr>(ts);
1190 return (ArithExpr)Expr.Create(this, Native.Z3_mk_mul(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1191 }

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

◆ MkNot()

BoolExpr MkNot ( BoolExpr  a)
inline

Mk an expression representing not(a).

Definition at line 1033 of file Context.cs.

1034 {
1035 Debug.Assert(a != null);
1036 CheckContextMatch(a);
1037 return new BoolExpr(this, Native.Z3_mk_not(nCtx, a.NativeObject));
1038 }

Referenced by BoolExpr.operator!().

◆ MkNth()

Expr MkNth ( SeqExpr  s,
Expr  index 
)
inline

Retrieve element at index.

Definition at line 2837 of file Context.cs.

2838 {
2839 Debug.Assert(s != null);
2840 Debug.Assert(index != null);
2841 CheckContextMatch(s, index);
2842 return Expr.Create(this, Native.Z3_mk_seq_nth(nCtx, s.NativeObject, index.NativeObject));
2843 }

◆ 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 3215 of file Context.cs.

3216 {
3217 Debug.Assert(ty != null);
3218
3219 CheckContextMatch(ty);
3220 return Expr.Create(this, Native.Z3_mk_int(nCtx, v, ty.NativeObject));
3221 }

◆ 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 3245 of file Context.cs.

3246 {
3247 Debug.Assert(ty != null);
3248
3249 CheckContextMatch(ty);
3250 return Expr.Create(this, Native.Z3_mk_int64(nCtx, v, ty.NativeObject));
3251 }

◆ 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 3200 of file Context.cs.

3201 {
3202 Debug.Assert(ty != null);
3203
3204 CheckContextMatch(ty);
3205 return Expr.Create(this, Native.Z3_mk_numeral(nCtx, v, ty.NativeObject));
3206 }

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 3230 of file Context.cs.

3231 {
3232 Debug.Assert(ty != null);
3233
3234 CheckContextMatch(ty);
3235 return Expr.Create(this, Native.Z3_mk_unsigned_int(nCtx, v, ty.NativeObject));
3236 }

◆ 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 3260 of file Context.cs.

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

◆ MkOptimize()

Optimize MkOptimize ( )
inline

Create an Optimization context.

Definition at line 4391 of file Context.cs.

4392 {
4393
4394 return new Optimize(this);
4395 }

◆ MkOption()

ReExpr MkOption ( ReExpr  re)
inline

Create the optional regular expression.

Definition at line 2981 of file Context.cs.

2982 {
2983 Debug.Assert(re != null);
2984 return new ReExpr(this, Native.Z3_mk_re_option(nCtx, re.NativeObject));
2985 }

◆ MkOr() [1/2]

BoolExpr MkOr ( IEnumerable< BoolExpr ts)
inline

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

Definition at line 1151 of file Context.cs.

1152 {
1153 Debug.Assert(ts != null);
1154 return MkOr(ts.ToArray());
1155 }
BoolExpr MkOr(params BoolExpr[] ts)
Create an expression representing t[0] or t[1] or ....
Definition Context.cs:1138

◆ MkOr() [2/2]

BoolExpr MkOr ( params BoolExpr[]  ts)
inline

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

Definition at line 1138 of file Context.cs.

1139 {
1140 Debug.Assert(ts != null);
1141 Debug.Assert(ts.All(a => a != null));
1142
1143 CheckContextMatch<BoolExpr>(ts);
1144 return new BoolExpr(this, Native.Z3_mk_or(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1145 }

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 5168 of file Context.cs.

5169 {
5170 return new FuncDecl(this, Native.Z3_mk_partial_order(this.nCtx, a.NativeObject, index));
5171 }

◆ MkPattern()

Pattern MkPattern ( params Expr[]  terms)
inline

Create a quantifier pattern.

Definition at line 810 of file Context.cs.

811 {
812 Debug.Assert(terms != null);
813 if (terms.Length == 0)
814 throw new Z3Exception("Cannot create a pattern from zero terms");
815
816 IntPtr[] termsNative = AST.ArrayToNative(terms);
817 return new Pattern(this, Native.Z3_mk_pattern(nCtx, (uint)terms.Length, termsNative));
818 }

◆ MkPBEq()

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

Create a pseudo-Boolean equal constraint.

Definition at line 3179 of file Context.cs.

3180 {
3181 Debug.Assert(args != null);
3182 Debug.Assert(coeffs != null);
3183 Debug.Assert(args.Length == coeffs.Length);
3184 CheckContextMatch<BoolExpr>(args);
3185 return new BoolExpr(this, Native.Z3_mk_pbeq(nCtx, (uint)args.Length,
3186 AST.ArrayToNative(args),
3187 coeffs, k));
3188 }

◆ MkPBGe()

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

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

Definition at line 3166 of file Context.cs.

3167 {
3168 Debug.Assert(args != null);
3169 Debug.Assert(coeffs != null);
3170 Debug.Assert(args.Length == coeffs.Length);
3171 CheckContextMatch<BoolExpr>(args);
3172 return new BoolExpr(this, Native.Z3_mk_pbge(nCtx, (uint)args.Length,
3173 AST.ArrayToNative(args),
3174 coeffs, k));
3175 }

◆ MkPBLe()

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

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

Definition at line 3152 of file Context.cs.

3153 {
3154 Debug.Assert(args != null);
3155 Debug.Assert(coeffs != null);
3156 Debug.Assert(args.Length == coeffs.Length);
3157 CheckContextMatch<BoolExpr>(args);
3158 return new BoolExpr(this, Native.Z3_mk_pble(nCtx, (uint)args.Length,
3159 AST.ArrayToNative(args),
3160 coeffs, k));
3161 }

◆ MkPlus()

ReExpr MkPlus ( ReExpr  re)
inline

Take the Kleene plus of a regular expression.

Definition at line 2972 of file Context.cs.

2973 {
2974 Debug.Assert(re != null);
2975 return new ReExpr(this, Native.Z3_mk_re_plus(nCtx, re.NativeObject));
2976 }

◆ 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 616 of file Context.cs.

617 {
618 using var symbol = MkSymbol(name);
619 return MkPolymorphicDatatypeSort(symbol, typeParams, constructors);
620 }
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:593

◆ 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 593 of file Context.cs.

594 {
595 Debug.Assert(name != null);
596 Debug.Assert(typeParams != null);
597 Debug.Assert(constructors != null);
598 Debug.Assert(constructors.All(c => c != null));
599
600 CheckContextMatch(name);
601 CheckContextMatch<Sort>(typeParams);
602 CheckContextMatch<Constructor>(constructors);
603 return new DatatypeSort(this,
604 Native.Z3_mk_polymorphic_datatype(nCtx, name.NativeObject,
605 (uint)typeParams.Length, AST.ArrayToNative(typeParams),
606 (uint)constructors.Length, Z3Object.ArrayToNative(constructors)));
607 }

Referenced by Context.MkPolymorphicDatatypeSort().

◆ MkPower()

ArithExpr MkPower ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 ^ t2.

Definition at line 1269 of file Context.cs.

1270 {
1271 Debug.Assert(t1 != null);
1272 Debug.Assert(t2 != null);
1273
1274 CheckContextMatch(t1);
1275 CheckContextMatch(t2);
1276 return (ArithExpr)Expr.Create(this, Native.Z3_mk_power(nCtx, t1.NativeObject, t2.NativeObject));
1277 }

◆ MkPrefixOf()

BoolExpr MkPrefixOf ( SeqExpr  s1,
SeqExpr  s2 
)
inline

Check for sequence prefix.

Definition at line 2771 of file Context.cs.

2772 {
2773 Debug.Assert(s1 != null);
2774 Debug.Assert(s2 != null);
2775 CheckContextMatch(s1, s2);
2776 return new BoolExpr(this, Native.Z3_mk_seq_prefix(nCtx, s1.NativeObject, s2.NativeObject));
2777 }

◆ MkProbe()

Probe MkProbe ( string  name)
inline

Creates a new Probe.

Definition at line 4186 of file Context.cs.

4187 {
4188
4189 return new Probe(this, name);
4190 }

◆ 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 3596 of file Context.cs.

3597 {
3598 Debug.Assert(body != null);
3599 Debug.Assert(boundConstants == null || boundConstants.All(n => n != null));
3600 Debug.Assert(patterns == null || patterns.All(p => p != null));
3601 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3602
3603
3604 if (universal)
3605 return MkForall(boundConstants, body, weight, patterns, noPatterns, quantifierID, skolemID);
3606 else
3607 return MkExists(boundConstants, body, weight, patterns, noPatterns, quantifierID, skolemID);
3608 }
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:3536
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:3494

◆ 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 3573 of file Context.cs.

3574 {
3575 Debug.Assert(body != null);
3576 Debug.Assert(names != null);
3577 Debug.Assert(sorts != null);
3578 Debug.Assert(sorts.Length == names.Length);
3579 Debug.Assert(sorts.All(s => s != null));
3580 Debug.Assert(names.All(n => n != null));
3581 Debug.Assert(patterns == null || patterns.All(p => p != null));
3582 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3583
3584
3585 if (universal)
3586 return MkForall(sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
3587 else
3588 return MkExists(sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
3589 }

◆ MkRange()

ReExpr MkRange ( SeqExpr  lo,
SeqExpr  hi 
)
inline

Create a range expression.

Definition at line 3067 of file Context.cs.

3068 {
3069 Debug.Assert(lo != null);
3070 Debug.Assert(hi != null);
3071 CheckContextMatch(lo, hi);
3072 return new ReExpr(this, Native.Z3_mk_re_range(nCtx, lo.NativeObject, hi.NativeObject));
3073 }

◆ 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 3277 of file Context.cs.

3278 {
3279 if (den == 0)
3280 throw new Z3Exception("Denominator is zero");
3281
3282 return new RatNum(this, Native.Z3_mk_real(nCtx, num, den));
3283 }

◆ 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 3301 of file Context.cs.

3302 {
3303
3304 return new RatNum(this, Native.Z3_mk_int(nCtx, v, RealSort.NativeObject));
3305 }
RealSort RealSort
Retrieves the Real sort of the context.
Definition Context.cs:170

◆ 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 3323 of file Context.cs.

3324 {
3325
3326 return new RatNum(this, Native.Z3_mk_int64(nCtx, v, RealSort.NativeObject));
3327 }

◆ 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 3290 of file Context.cs.

3291 {
3292
3293 return new RatNum(this, Native.Z3_mk_numeral(nCtx, v, RealSort.NativeObject));
3294 }

◆ 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 3312 of file Context.cs.

3313 {
3314
3315 return new RatNum(this, Native.Z3_mk_unsigned_int(nCtx, v, RealSort.NativeObject));
3316 }

◆ 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 3334 of file Context.cs.

3335 {
3336
3337 return new RatNum(this, Native.Z3_mk_unsigned_int64(nCtx, v, RealSort.NativeObject));
3338 }

◆ 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 1356 of file Context.cs.

1357 {
1358 Debug.Assert(t != null);
1359
1360 CheckContextMatch(t);
1361 return new IntExpr(this, Native.Z3_mk_real2int(nCtx, t.NativeObject));
1362 }

◆ MkRealConst() [1/2]

RealExpr MkRealConst ( string  name)
inline

Creates a real constant.

Definition at line 922 of file Context.cs.

923 {
924
925 return (RealExpr)MkConst(name, RealSort);
926 }

◆ MkRealConst() [2/2]

RealExpr MkRealConst ( Symbol  name)
inline

Creates a real constant.

Definition at line 912 of file Context.cs.

913 {
914 Debug.Assert(name != null);
915
916 return (RealExpr)MkConst(name, RealSort);
917 }

◆ MkRealSort()

RealSort MkRealSort ( )
inline

Create a real sort.

Definition at line 242 of file Context.cs.

243 {
244 return new RealSort(this);
245 }

◆ MkRecFuncDecl()

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

Creates a new recursive function declaration.

Definition at line 687 of file Context.cs.

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

◆ MkRem()

IntExpr MkRem ( IntExpr  t1,
IntExpr  t2 
)
inline

Create an expression representing t1 rem t2.

The arguments must have int type.

Definition at line 1256 of file Context.cs.

1257 {
1258 Debug.Assert(t1 != null);
1259 Debug.Assert(t2 != null);
1260
1261 CheckContextMatch(t1);
1262 CheckContextMatch(t2);
1263 return new IntExpr(this, Native.Z3_mk_rem(nCtx, t1.NativeObject, t2.NativeObject));
1264 }

◆ MkRepeat()

BitVecExpr MkRepeat ( uint  i,
BitVecExpr  t 
)
inline

Bit-vector repetition.

The argument t must have a bit-vector sort.

Definition at line 1852 of file Context.cs.

1853 {
1854 Debug.Assert(t != null);
1855
1856 CheckContextMatch(t);
1857 return new BitVecExpr(this, Native.Z3_mk_repeat(nCtx, i, t.NativeObject));
1858 }

◆ MkReplace()

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

Replace the first occurrence of src by dst in s.

Definition at line 2872 of file Context.cs.

2873 {
2874 Debug.Assert(s != null);
2875 Debug.Assert(src != null);
2876 Debug.Assert(dst != null);
2877 CheckContextMatch(s, src, dst);
2878 return new SeqExpr(this, Native.Z3_mk_seq_replace(nCtx, s.NativeObject, src.NativeObject, dst.NativeObject));
2879 }

◆ MkReSort()

ReSort MkReSort ( SeqSort  s)
inline

Create a new regular expression sort.

Definition at line 267 of file Context.cs.

268 {
269 Debug.Assert(s != null);
270 return new ReSort(this, Native.Z3_mk_re_sort(nCtx, s.NativeObject));
271 }
ReSort(s)
Definition z3py.py:12011

◆ 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 2201 of file Context.cs.

2202 {
2203 Debug.Assert(a != null);
2204 Debug.Assert(i != null);
2205
2206 CheckContextMatch(a);
2207 CheckContextMatch(i);
2208 return Expr.Create(this, Native.Z3_mk_select(nCtx, a.NativeObject, i.NativeObject));
2209 }

◆ 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 2224 of file Context.cs.

2225 {
2226 Debug.Assert(a != null);
2227 Debug.Assert(args != null && args.All(n => n != null));
2228
2229 CheckContextMatch(a);
2230 CheckContextMatch<Expr>(args);
2231 return Expr.Create(this, Native.Z3_mk_select_n(nCtx, a.NativeObject, AST.ArrayLength(args), AST.ArrayToNative(args)));
2232 }

◆ 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 2907 of file Context.cs.

2908 {
2909 Debug.Assert(f != null);
2910 Debug.Assert(a != null);
2911 Debug.Assert(s != null);
2912 CheckContextMatch(f, a, s);
2913 return Expr.Create(this, Native.Z3_mk_seq_foldl(nCtx, f.NativeObject, a.NativeObject, s.NativeObject));
2914 }

◆ 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 2919 of file Context.cs.

2920 {
2921 Debug.Assert(f != null);
2922 Debug.Assert(i != null);
2923 Debug.Assert(a != null);
2924 Debug.Assert(s != null);
2925 CheckContextMatch(f, i, a);
2926 CheckContextMatch(s, a);
2927 return Expr.Create(this, Native.Z3_mk_seq_foldli(nCtx, f.NativeObject, i.NativeObject, a.NativeObject, s.NativeObject));
2928 }

◆ MkSeqMap()

Expr MkSeqMap ( Expr  f,
SeqExpr  s 
)
inline

Map function f over the sequence s.

Definition at line 2884 of file Context.cs.

2885 {
2886 Debug.Assert(f != null);
2887 Debug.Assert(s != null);
2888 CheckContextMatch(f, s);
2889 return Expr.Create(this, Native.Z3_mk_seq_map(nCtx, f.NativeObject, s.NativeObject));
2890 }

◆ MkSeqMapi()

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

Map function f over the sequence s at index i.

Definition at line 2895 of file Context.cs.

2896 {
2897 Debug.Assert(f != null);
2898 Debug.Assert(i != null);
2899 Debug.Assert(s != null);
2900 CheckContextMatch(f, i, s);
2901 return Expr.Create(this, Native.Z3_mk_seq_mapi(nCtx, f.NativeObject, i.NativeObject, s.NativeObject));
2902 }

◆ MkSeqSort()

SeqSort MkSeqSort ( Sort  s)
inline

Create a new sequence sort.

Definition at line 258 of file Context.cs.

259 {
260 Debug.Assert(s != null);
261 return new SeqSort(this, Native.Z3_mk_seq_sort(nCtx, s.NativeObject));
262 }
SeqSort(s)
Definition z3py.py:11577

◆ MkSetAdd()

ArrayExpr MkSetAdd ( ArrayExpr  set,
Expr  element 
)
inline

Add an element to the set.

Definition at line 2402 of file Context.cs.

2403 {
2404 Debug.Assert(set != null);
2405 Debug.Assert(element != null);
2406
2407 CheckContextMatch(set);
2408 CheckContextMatch(element);
2409 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_add(nCtx, set.NativeObject, element.NativeObject));
2410 }

◆ MkSetComplement()

ArrayExpr MkSetComplement ( ArrayExpr  arg)
inline

Take the complement of a set.

Definition at line 2466 of file Context.cs.

2467 {
2468 Debug.Assert(arg != null);
2469
2470 CheckContextMatch(arg);
2471 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_complement(nCtx, arg.NativeObject));
2472 }

◆ MkSetDel()

ArrayExpr MkSetDel ( ArrayExpr  set,
Expr  element 
)
inline

Remove an element from a set.

Definition at line 2416 of file Context.cs.

2417 {
2418 Debug.Assert(set != null);
2419 Debug.Assert(element != null);
2420
2421 CheckContextMatch(set);
2422 CheckContextMatch(element);
2423 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_del(nCtx, set.NativeObject, element.NativeObject));
2424 }

◆ MkSetDifference()

ArrayExpr MkSetDifference ( ArrayExpr  arg1,
ArrayExpr  arg2 
)
inline

Take the difference between two sets.

Definition at line 2453 of file Context.cs.

2454 {
2455 Debug.Assert(arg1 != null);
2456 Debug.Assert(arg2 != null);
2457
2458 CheckContextMatch(arg1);
2459 CheckContextMatch(arg2);
2460 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_difference(nCtx, arg1.NativeObject, arg2.NativeObject));
2461 }

◆ MkSetIntersection()

ArrayExpr MkSetIntersection ( params ArrayExpr[]  args)
inline

Take the intersection of a list of sets.

Definition at line 2441 of file Context.cs.

2442 {
2443 Debug.Assert(args != null);
2444 Debug.Assert(args.All(a => a != null));
2445
2446 CheckContextMatch<ArrayExpr>(args);
2447 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_intersect(nCtx, (uint)args.Length, AST.ArrayToNative(args)));
2448 }

◆ MkSetMembership()

BoolExpr MkSetMembership ( Expr  elem,
ArrayExpr  set 
)
inline

Check for set membership.

Definition at line 2477 of file Context.cs.

2478 {
2479 Debug.Assert(elem != null);
2480 Debug.Assert(set != null);
2481
2482 CheckContextMatch(elem);
2483 CheckContextMatch(set);
2484 return (BoolExpr)Expr.Create(this, Native.Z3_mk_set_member(nCtx, elem.NativeObject, set.NativeObject));
2485 }

◆ MkSetSort()

SetSort MkSetSort ( Sort  ty)
inline

Create a set type.

Definition at line 2369 of file Context.cs.

2370 {
2371 Debug.Assert(ty != null);
2372
2373 CheckContextMatch(ty);
2374 return new SetSort(this, ty);
2375 }
SetSort(s)
Sets.
Definition z3py.py:5164

◆ MkSetSubset()

BoolExpr MkSetSubset ( ArrayExpr  arg1,
ArrayExpr  arg2 
)
inline

Check for subsetness of sets.

Definition at line 2490 of file Context.cs.

2491 {
2492 Debug.Assert(arg1 != null);
2493 Debug.Assert(arg2 != null);
2494
2495 CheckContextMatch(arg1);
2496 CheckContextMatch(arg2);
2497 return (BoolExpr)Expr.Create(this, Native.Z3_mk_set_subset(nCtx, arg1.NativeObject, arg2.NativeObject));
2498 }

◆ MkSetUnion()

ArrayExpr MkSetUnion ( params ArrayExpr[]  args)
inline

Take the union of a list of sets.

Definition at line 2429 of file Context.cs.

2430 {
2431 Debug.Assert(args != null);
2432 Debug.Assert(args.All(a => a != null));
2433
2434 CheckContextMatch<ArrayExpr>(args);
2435 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_union(nCtx, (uint)args.Length, AST.ArrayToNative(args)));
2436 }

◆ 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 1821 of file Context.cs.

1822 {
1823 Debug.Assert(t != null);
1824
1825 CheckContextMatch(t);
1826 return new BitVecExpr(this, Native.Z3_mk_sign_ext(nCtx, i, t.NativeObject));
1827 }

◆ MkSimpleSolver()

Solver MkSimpleSolver ( )
inline

Creates a new (incremental) solver.

Definition at line 4343 of file Context.cs.

4344 {
4345
4346 return new Solver(this, Native.Z3_mk_simple_solver(nCtx));
4347 }

◆ MkSimplifier()

Simplifier MkSimplifier ( string  name)
inline

Creates a new Tactic.

Definition at line 4082 of file Context.cs.

4083 {
4084
4085 return new Simplifier(this, name);
4086 }

◆ MkSolver() [1/4]

Solver MkSolver ( Solver  s,
Simplifier  t 
)
inline

Creates a solver that uses an incremental simplifier.

Definition at line 4352 of file Context.cs.

4353 {
4354 Debug.Assert(t != null);
4355 Debug.Assert(s != null);
4356 return new Solver(this, Native.Z3_solver_add_simplifier(nCtx, s.NativeObject, t.NativeObject));
4357 }

◆ MkSolver() [2/4]

Solver MkSolver ( string  logic)
inline

Creates a new (incremental) solver.

See also
MkSolver(Symbol)

Definition at line 4334 of file Context.cs.

4335 {
4336 using var symbol = MkSymbol(logic);
4337 return MkSolver(symbol);
4338 }
Solver MkSolver(Symbol logic=null)
Creates a new (incremental) solver.
Definition Context.cs:4321

◆ 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 4321 of file Context.cs.

4322 {
4323
4324 if (logic == null)
4325 return new Solver(this, Native.Z3_mk_solver(nCtx));
4326 else
4327 return new Solver(this, Native.Z3_mk_solver_for_logic(nCtx, logic.NativeObject));
4328 }

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 4366 of file Context.cs.

4367 {
4368 Debug.Assert(t != null);
4369
4370 return new Solver(this, Native.Z3_mk_solver_from_tactic(nCtx, t.NativeObject));
4371 }

◆ MkStar()

ReExpr MkStar ( ReExpr  re)
inline

Take the Kleene star of a regular expression.

Definition at line 2954 of file Context.cs.

2955 {
2956 Debug.Assert(re != null);
2957 return new ReExpr(this, Native.Z3_mk_re_star(nCtx, re.NativeObject));
2958 }

◆ 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 2253 of file Context.cs.

2254 {
2255 Debug.Assert(a != null);
2256 Debug.Assert(i != null);
2257 Debug.Assert(v != null);
2258
2259 CheckContextMatch(a);
2260 CheckContextMatch(i);
2261 CheckContextMatch(v);
2262 return new ArrayExpr(this, Native.Z3_mk_store(nCtx, a.NativeObject, i.NativeObject, v.NativeObject));
2263 }

◆ 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 2283 of file Context.cs.

2284 {
2285 Debug.Assert(a != null);
2286 Debug.Assert(args != null);
2287 Debug.Assert(v != null);
2288
2289 CheckContextMatch<Expr>(args);
2290 CheckContextMatch(a);
2291 CheckContextMatch(v);
2292 return new ArrayExpr(this, Native.Z3_mk_store_n(nCtx, a.NativeObject, AST.ArrayLength(args), AST.ArrayToNative(args), v.NativeObject));
2293 }

◆ MkString()

SeqExpr MkString ( string  s)
inline

Create a string constant.

Definition at line 2699 of file Context.cs.

2700 {
2701 Debug.Assert(s != null);
2702 return new SeqExpr(this, Native.Z3_mk_string(nCtx, s));
2703 }

◆ MkStringLe()

BoolExpr MkStringLe ( SeqExpr  s1,
SeqExpr  s2 
)
inline

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

Definition at line 2815 of file Context.cs.

2816 {
2817 Debug.Assert(s1 != null);
2818 Debug.Assert(s2 != null);
2819 CheckContextMatch(s1, s2);
2820 return new BoolExpr(this, Native.Z3_mk_str_le(nCtx, s1.NativeObject, s2.NativeObject));
2821 }

◆ MkStringLt()

BoolExpr MkStringLt ( SeqExpr  s1,
SeqExpr  s2 
)
inline

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

Definition at line 2804 of file Context.cs.

2805 {
2806 Debug.Assert(s1 != null);
2807 Debug.Assert(s2 != null);
2808 CheckContextMatch(s1, s2);
2809 return new BoolExpr(this, Native.Z3_mk_str_lt(nCtx, s1.NativeObject, s2.NativeObject));
2810 }

◆ MkSub()

ArithExpr MkSub ( params ArithExpr[]  ts)
inline

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

Definition at line 1205 of file Context.cs.

1206 {
1207 Debug.Assert(ts != null);
1208 Debug.Assert(ts.All(a => a != null));
1209
1210 CheckContextMatch<ArithExpr>(ts);
1211 return (ArithExpr)Expr.Create(this, Native.Z3_mk_sub(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1212 }

Referenced by ArithExpr.operator-().

◆ MkSuffixOf()

BoolExpr MkSuffixOf ( SeqExpr  s1,
SeqExpr  s2 
)
inline

Check for sequence suffix.

Definition at line 2782 of file Context.cs.

2783 {
2784 Debug.Assert(s1 != null);
2785 Debug.Assert(s2 != null);
2786 CheckContextMatch(s1, s2);
2787 return new BoolExpr(this, Native.Z3_mk_seq_suffix(nCtx, s1.NativeObject, s2.NativeObject));
2788 }

◆ 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 3820 of file Context.cs.

3821 {
3822
3823 return new Tactic(this, name);
3824 }

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 2342 of file Context.cs.

2343 {
2344 Debug.Assert(array != null);
2345
2346 CheckContextMatch(array);
2347 return Expr.Create(this, Native.Z3_mk_array_default(nCtx, array.NativeObject));
2348 }

◆ MkToRe()

ReExpr MkToRe ( SeqExpr  s)
inline

Convert a regular expression that accepts sequence s.

Definition at line 2933 of file Context.cs.

2934 {
2935 Debug.Assert(s != null);
2936 return new ReExpr(this, Native.Z3_mk_seq_to_re(nCtx, s.NativeObject));
2937 }

◆ 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 5178 of file Context.cs.

5179 {
5180 return new FuncDecl(this, Native.Z3_mk_transitive_closure(this.nCtx, f.NativeObject));
5181 }

◆ MkTrue()

BoolExpr MkTrue ( )
inline

The true Term.

Definition at line 975 of file Context.cs.

976 {
977 return new BoolExpr(this, Native.Z3_mk_true(nCtx));
978 }

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 302 of file Context.cs.

303 {
304 Debug.Assert(name != null);
305 Debug.Assert(fieldNames != null);
306 Debug.Assert(fieldNames.All(fn => fn != null));
307 Debug.Assert(fieldSorts == null || fieldSorts.All(fs => fs != null));
308
309 CheckContextMatch(name);
310 CheckContextMatch<Symbol>(fieldNames);
311 CheckContextMatch<Sort>(fieldSorts);
312 return new TupleSort(this, name, (uint)fieldNames.Length, fieldNames, fieldSorts);
313 }
TupleSort(name, sorts, ctx=None)
Definition z3py.py:5975

◆ 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 580 of file Context.cs.

581 {
582 using var symbol = MkSymbol(name);
583 return MkTypeVariable(symbol);
584 }
Sort MkTypeVariable(Symbol name)
Create a type variable sort for use as a parameter in polymorphic datatypes.
Definition Context.cs:569

◆ 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 569 of file Context.cs.

570 {
571 Debug.Assert(name != null);
572 CheckContextMatch(name);
573 return new Sort(this, Native.Z3_mk_type_variable(nCtx, name.NativeObject));
574 }

Referenced by Context.MkTypeVariable().

◆ MkUnaryMinus()

ArithExpr MkUnaryMinus ( ArithExpr  t)
inline

Create an expression representing -t.

Definition at line 1217 of file Context.cs.

1218 {
1219 Debug.Assert(t != null);
1220
1221 CheckContextMatch(t);
1222 return (ArithExpr)Expr.Create(this, Native.Z3_mk_unary_minus(nCtx, t.NativeObject));
1223 }

Referenced by ArithExpr.operator-().

◆ MkUninterpretedSort() [1/2]

UninterpretedSort MkUninterpretedSort ( string  str)
inline

Create a new uninterpreted sort.

Definition at line 224 of file Context.cs.

225 {
226 using var sym = MkSymbol(str);
227 return MkUninterpretedSort(sym);
228 }
UninterpretedSort MkUninterpretedSort(Symbol s)
Create a new uninterpreted sort.
Definition Context.cs:213

◆ MkUninterpretedSort() [2/2]

UninterpretedSort MkUninterpretedSort ( Symbol  s)
inline

Create a new uninterpreted sort.

Definition at line 213 of file Context.cs.

214 {
215 Debug.Assert(s != null);
216
217 CheckContextMatch(s);
218 return new UninterpretedSort(this, s);
219 }

Referenced by Context.MkUninterpretedSort().

◆ MkUnion()

ReExpr MkUnion ( params ReExpr[]  t)
inline

Create the union of regular languages.

Definition at line 3011 of file Context.cs.

3012 {
3013 Debug.Assert(t != null);
3014 Debug.Assert(t.All(a => a != null));
3015
3016 CheckContextMatch<ReExpr>(t);
3017 return new ReExpr(this, Native.Z3_mk_re_union(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
3018 }

◆ MkUnit()

SeqExpr MkUnit ( Expr  elem)
inline

Create the singleton sequence.

Definition at line 2690 of file Context.cs.

2691 {
2692 Debug.Assert(elem != null);
2693 return new SeqExpr(this, Native.Z3_mk_seq_unit(nCtx, elem.NativeObject));
2694 }

◆ 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 628 of file Context.cs.

629 {
630 return Expr.Create(this, Native.Z3_datatype_update_field(
631 nCtx, field.NativeObject,
632 t.NativeObject, v.NativeObject));
633 }

◆ MkUserPropagatorFuncDecl()

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

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


Definition at line 784 of file Context.cs.

785 {
786 using var _name = MkSymbol(name);
787 var fn = Native.Z3_solver_propagate_declare(nCtx, _name.NativeObject, AST.ArrayLength(domain), AST.ArrayToNative(domain), range.NativeObject);
788 return new FuncDecl(this, fn);
789 }

◆ MkXor() [1/2]

BoolExpr MkXor ( BoolExpr  t1,
BoolExpr  t2 
)
inline

Create an expression representing t1 xor t2.

Definition at line 1087 of file Context.cs.

1088 {
1089 Debug.Assert(t1 != null);
1090 Debug.Assert(t2 != null);
1091
1092 CheckContextMatch(t1);
1093 CheckContextMatch(t2);
1094 return new BoolExpr(this, Native.Z3_mk_xor(nCtx, t1.NativeObject, t2.NativeObject));
1095 }

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 1100 of file Context.cs.

1101 {
1102 Debug.Assert(args != null);
1103 var ts = args.ToArray();
1104 Debug.Assert(ts.All(a => a != null));
1105 CheckContextMatch<BoolExpr>(ts);
1106
1107 return ts.Aggregate(MkFalse(), (r, t) =>
1108 {
1109 using (r)
1110 return MkXor(r, t);
1111 });
1112 }
BoolExpr MkXor(BoolExpr t1, BoolExpr t2)
Create an expression representing t1 xor t2.
Definition Context.cs:1087

◆ 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 1838 of file Context.cs.

1839 {
1840 Debug.Assert(t != null);
1841
1842 CheckContextMatch(t);
1843 return new BitVecExpr(this, Native.Z3_mk_zero_ext(nCtx, i, t.NativeObject));
1844 }

◆ 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 4303 of file Context.cs.

4304 {
4305 Debug.Assert(p != null);
4306
4307 CheckContextMatch(p);
4308 return new Probe(this, Native.Z3_probe_not(nCtx, p.NativeObject));
4309 }

◆ 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 4289 of file Context.cs.

4290 {
4291 Debug.Assert(p1 != null);
4292 Debug.Assert(p2 != null);
4293
4294 CheckContextMatch(p1);
4295 CheckContextMatch(p2);
4296 return new Probe(this, Native.Z3_probe_or(nCtx, p1.NativeObject, p2.NativeObject));
4297 }

◆ 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 3877 of file Context.cs.

3878 {
3879 Debug.Assert(t1 != null);
3880 Debug.Assert(t2 != null);
3881
3882 CheckContextMatch(t1);
3883 CheckContextMatch(t2);
3884 return new Tactic(this, Native.Z3_tactic_or_else(nCtx, t1.NativeObject, t2.NativeObject));
3885 }

◆ 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 4025 of file Context.cs.

4026 {
4027 Debug.Assert(t1 != null);
4028 Debug.Assert(t2 != null);
4029
4030 CheckContextMatch(t1);
4031 CheckContextMatch(t2);
4032 return new Tactic(this, Native.Z3_tactic_par_and_then(nCtx, t1.NativeObject, t2.NativeObject));
4033 }

◆ 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 4013 of file Context.cs.

4014 {
4015 Debug.Assert(t == null || t.All(tactic => tactic != null));
4016
4017 CheckContextMatch<Tactic>(t);
4018 return new Tactic(this, Native.Z3_tactic_par_or(nCtx, Tactic.ArrayLength(t), Tactic.ArrayToNative(t)));
4019 }

◆ 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 3712 of file Context.cs.

3713 {
3714
3715 uint csn = Symbol.ArrayLength(sortNames);
3716 uint cs = Sort.ArrayLength(sorts);
3717 uint cdn = Symbol.ArrayLength(declNames);
3718 uint cd = AST.ArrayLength(decls);
3719 if (csn != cs || cdn != cd)
3720 throw new Z3Exception("Argument size mismatch");
3721 using ASTVector assertions = new ASTVector(this, Native.Z3_parse_smtlib2_file(nCtx, fileName,
3722 AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts),
3723 AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls)));
3724 return assertions.ToBoolExprArray();
3725 }

◆ 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 3693 of file Context.cs.

3694 {
3695
3696 uint csn = Symbol.ArrayLength(sortNames);
3697 uint cs = Sort.ArrayLength(sorts);
3698 uint cdn = Symbol.ArrayLength(declNames);
3699 uint cd = AST.ArrayLength(decls);
3700 if (csn != cs || cdn != cd)
3701 throw new Z3Exception("Argument size mismatch");
3702 using ASTVector assertions = new ASTVector(this, Native.Z3_parse_smtlib2_string(nCtx, str,
3703 AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts),
3704 AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls)));
3705 return assertions.ToBoolExprArray();
3706 }

◆ 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 5193 of file Context.cs.

5194 {
5195 CheckContextMatch(p);
5196 CheckContextMatch(q);
5197 CheckContextMatch(x);
5198 return new ASTVector(this, Native.Z3_polynomial_subresultants(this.nCtx, p.NativeObject, q.NativeObject, x.NativeObject));
5199 }

◆ ProbeDescription()

string ProbeDescription ( string  name)
inline

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

Definition at line 4177 of file Context.cs.

4178 {
4179
4180 return Native.Z3_probe_get_descr(nCtx, name);
4181 }

◆ 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 3938 of file Context.cs.

3939 {
3940 Debug.Assert(t != null);
3941
3942 CheckContextMatch(t);
3943 return new Tactic(this, Native.Z3_tactic_repeat(nCtx, t.NativeObject, max));
3944 }

◆ SbvToString()

SeqExpr SbvToString ( Expr  e)
inline

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

Definition at line 2728 of file Context.cs.

2729 {
2730 Debug.Assert(e != null);
2731 Debug.Assert(e is ArithExpr);
2732 return new SeqExpr(this, Native.Z3_mk_sbv_to_str(nCtx, e.NativeObject));
2733 }

◆ SimplifierDescription()

string SimplifierDescription ( string  name)
inline

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

Definition at line 4073 of file Context.cs.

4074 {
4075
4076 return Native.Z3_simplifier_get_descr(nCtx, name);
4077 }

◆ SimplifyHelp()

string SimplifyHelp ( )
inline

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

Definition at line 5204 of file Context.cs.

5205 {
5206
5207 return Native.Z3_simplify_get_help(nCtx);
5208 }

◆ Skip()

Tactic Skip ( )
inline

Create a tactic that just returns the given goal.

Definition at line 3949 of file Context.cs.

3950 {
3951
3952 return new Tactic(this, Native.Z3_tactic_skip(nCtx));
3953 }

◆ StringToInt()

IntExpr StringToInt ( Expr  e)
inline

Convert an integer expression to a string.

Definition at line 2738 of file Context.cs.

2739 {
2740 Debug.Assert(e != null);
2741 Debug.Assert(e is SeqExpr);
2742 return new IntExpr(this, Native.Z3_mk_str_to_int(nCtx, e.NativeObject));
2743 }

◆ TacticDescription()

string TacticDescription ( string  name)
inline

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

Definition at line 3811 of file Context.cs.

3812 {
3813
3814 return Native.Z3_tactic_get_descr(nCtx, name);
3815 }

◆ 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 4126 of file Context.cs.

4127 {
4128 Debug.Assert(t1 != null);
4129 Debug.Assert(t2 != null);
4130 // Debug.Assert(ts == null || Contract.ForAll(0, ts.Length, j => ts[j] != null));
4131
4132 return AndThen(t1, t2, ts);
4133 }
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:3830

◆ 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 3864 of file Context.cs.

3865 {
3866 Debug.Assert(t1 != null);
3867 Debug.Assert(t2 != null);
3868 // Debug.Assert(ts == null || Contract.ForAll(0, ts.Length, j => ts[j] != null));
3869
3870 return AndThen(t1, t2, ts);
3871 }

◆ 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 3893 of file Context.cs.

3894 {
3895 Debug.Assert(t != null);
3896
3897 CheckContextMatch(t);
3898 return new Tactic(this, Native.Z3_tactic_try_for(nCtx, t.NativeObject, ms));
3899 }

◆ UbvToString()

SeqExpr UbvToString ( Expr  e)
inline

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

Definition at line 2718 of file Context.cs.

2719 {
2720 Debug.Assert(e != null);
2721 Debug.Assert(e is ArithExpr);
2722 return new SeqExpr(this, Native.Z3_mk_ubv_to_str(nCtx, e.NativeObject));
2723 }

◆ 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 5158 of file Context.cs.

5159 {
5160 return a.NativeObject;
5161 }

◆ 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 5245 of file Context.cs.

5246 {
5247 Native.Z3_update_param_value(nCtx, id, value);
5248 }

◆ 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 4138 of file Context.cs.

4139 {
4140 Debug.Assert(t != null);
4141 Debug.Assert(p != null);
4142
4143 CheckContextMatch(t);
4144 CheckContextMatch(p);
4145 return new Simplifier(this, Native.Z3_simplifier_using_params(nCtx, t.NativeObject, p.NativeObject));
4146 }

◆ 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 3988 of file Context.cs.

3989 {
3990 Debug.Assert(t != null);
3991 Debug.Assert(p != null);
3992
3993 CheckContextMatch(t);
3994 CheckContextMatch(p);
3995 return new Tactic(this, Native.Z3_tactic_using_params(nCtx, t.NativeObject, p.NativeObject));
3996 }

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 3908 of file Context.cs.

3909 {
3910 Debug.Assert(p != null);
3911 Debug.Assert(t != null);
3912
3913 CheckContextMatch(t);
3914 CheckContextMatch(p);
3915 return new Tactic(this, Native.Z3_tactic_when(nCtx, p.NativeObject, t.NativeObject));
3916 }

◆ 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 4002 of file Context.cs.

4003 {
4004 Debug.Assert(t != null);
4005 Debug.Assert(p != null);
4006
4007 return UsingParams(t, p);
4008 }
Tactic UsingParams(Tactic t, Params p)
Create a tactic that applies t using the given set of parameters p .
Definition Context.cs:3988

◆ 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 5142 of file Context.cs.

5143 {
5144 return AST.Create(this, nativeObject);
5145 }

Property Documentation

◆ BoolSort

Retrieves the Boolean sort of the context.

Definition at line 146 of file Context.cs.

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

Referenced by Context.MkBoolSort().

◆ CharSort

Retrieves the String sort of the context.

Definition at line 180 of file Context.cs.

181 {
182 get
183 {
184 if (m_charSort == null) m_charSort = new CharSort(this); return m_charSort;
185 }
186 }
CharSort CharSort
Retrieves the String sort of the context.
Definition Context.cs:181

◆ IntSort

Retrieves the Integer sort of the context.

Definition at line 157 of file Context.cs.

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

Referenced by Context.MkIntSort().

◆ NumProbes

uint NumProbes
get

The number of supported Probes.

Definition at line 4153 of file Context.cs.

4154 {
4155 get { return Native.Z3_get_num_probes(nCtx); }
4156 }

◆ NumSimplifiers

uint NumSimplifiers
get

The number of supported simplifiers.

Definition at line 4049 of file Context.cs.

4050 {
4051 get { return Native.Z3_get_num_simplifiers(nCtx); }
4052 }

◆ NumTactics

uint NumTactics
get

The number of supported tactics.

Definition at line 3787 of file Context.cs.

3788 {
3789 get { return Native.Z3_get_num_tactics(nCtx); }
3790 }

◆ 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 3676 of file Context.cs.

3677 {
3678 get { return m_print_mode; }
3679 set
3680 {
3681 Native.Z3_set_ast_print_mode(nCtx, (uint)value);
3682 m_print_mode = value;
3683 }
3684 }

◆ ProbeNames

string [] ProbeNames
get

The names of all supported Probes.

Definition at line 4161 of file Context.cs.

4162 {
4163 get
4164 {
4165
4166 uint n = NumProbes;
4167 string[] res = new string[n];
4168 for (uint i = 0; i < n; i++)
4169 res[i] = Native.Z3_get_probe_name(nCtx, i);
4170 return res;
4171 }
4172 }
uint NumProbes
The number of supported Probes.
Definition Context.cs:4154

◆ RealSort

Retrieves the Real sort of the context.

Definition at line 169 of file Context.cs.

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

Referenced by Context.MkRealSort().

◆ SimplifierNames

string [] SimplifierNames
get

The names of all supported tactics.

Definition at line 4057 of file Context.cs.

4058 {
4059 get
4060 {
4061
4062 uint n = NumSimplifiers;
4063 string[] res = new string[n];
4064 for (uint i = 0; i < n; i++)
4065 res[i] = Native.Z3_get_simplifier_name(nCtx, i);
4066 return res;
4067 }
4068 }
uint NumSimplifiers
The number of supported simplifiers.
Definition Context.cs:4050

◆ SimplifyParameterDescriptions

ParamDescrs SimplifyParameterDescriptions
get

Retrieves parameter descriptions for simplifier.

Definition at line 5213 of file Context.cs.

5214 {
5215 get { return new ParamDescrs(this, Native.Z3_simplify_get_param_descrs(nCtx)); }
5216 }

◆ StringSort

SeqSort StringSort
get

Retrieves the String sort of the context.

Definition at line 192 of file Context.cs.

193 {
194 get
195 {
196 if (m_stringSort == null) m_stringSort = new SeqSort(this, Native.Z3_mk_string_sort(nCtx));
197 return m_stringSort;
198 }
199 }

◆ TacticNames

string [] TacticNames
get

The names of all supported tactics.

Definition at line 3795 of file Context.cs.

3796 {
3797 get
3798 {
3799
3800 uint n = NumTactics;
3801 string[] res = new string[n];
3802 for (uint i = 0; i < n; i++)
3803 res[i] = Native.Z3_get_tactic_name(nCtx, i);
3804 return res;
3805 }
3806 }
uint NumTactics
The number of supported tactics.
Definition Context.cs:3788