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

Returns
The result is a sort
More...
 
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. More...

 
Constructor MkConstructor (Symbol name, Symbol recognizer, Symbol[] fieldNames=null, Sort[] sorts=null, uint[] sortRefs=null)
 Create a datatype constructor. More...
 
Constructor MkConstructor (string name, string recognizer, string[] fieldNames=null, Sort[] sorts=null, uint[] sortRefs=null)
 Create a datatype constructor. More...
 
DatatypeSort MkDatatypeSort (Symbol name, Constructor[] constructors)
 Create a new datatype sort. More...
 
DatatypeSort MkDatatypeSort (string name, Constructor[] constructors)
 Create a new datatype sort. More...
 
DatatypeSort[] MkDatatypeSorts (Symbol[] names, Constructor[][] c)
 Create mutually recursive datatypes. More...
 
DatatypeSort[] MkDatatypeSorts (string[] names, Constructor[][] c)
 Create mutually recursive data-types. More...
 
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. More...
 
FuncDecl MkFuncDecl (Symbol name, Sort[] domain, Sort range)
 Creates a new function declaration. More...
 
FuncDecl MkFuncDecl (Symbol name, Sort domain, Sort range)
 Creates a new function declaration. More...
 
FuncDecl MkFuncDecl (string name, Sort[] domain, Sort range)
 Creates a new function declaration. More...
 
FuncDecl MkRecFuncDecl (string name, Sort[] domain, Sort range)
 Creates a new recursive function declaration. More...
 
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. More...
 
FuncDecl MkFuncDecl (string name, Sort domain, Sort range)
 Creates a new function declaration. More...
 
FuncDecl MkFreshFuncDecl (string prefix, Sort[] domain, Sort range)
 Creates a fresh function declaration with a name prefixed with prefix . More...
 
FuncDecl MkConstDecl (Symbol name, Sort range)
 Creates a new constant function declaration. More...
 
FuncDecl MkConstDecl (string name, Sort range)
 Creates a new constant function declaration. More...
 
FuncDecl MkFreshConstDecl (string prefix, Sort range)
 Creates a fresh constant function declaration with a name prefixed with prefix . More...
 
FuncDecl MkUserPropagatorFuncDecl (string name, Sort[] domain, Sort range)
 Declare a function to be processed by the user propagator plugin. More...
 
Expr MkBound (uint index, Sort ty)
 Creates a new bound variable. More...
 
Pattern MkPattern (params Expr[] terms)
 Create a quantifier pattern. More...
 
Expr MkConst (Symbol name, Sort range)
 Creates a new Constant of sort range and named name . More...
 
Expr MkConst (string name, Sort range)
 Creates a new Constant of sort range and named name . More...
 
Expr MkFreshConst (string prefix, Sort range)
 Creates a fresh Constant of sort range and a name prefixed with prefix . More...
 
Expr MkConst (FuncDecl f)
 Creates a fresh constant from the FuncDecl f . More...
 
BoolExpr MkBoolConst (Symbol name)
 Create a Boolean constant. More...
 
BoolExpr MkBoolConst (string name)
 Create a Boolean constant. More...
 
IntExpr MkIntConst (Symbol name)
 Creates an integer constant. More...
 
IntExpr MkIntConst (string name)
 Creates an integer constant. More...
 
RealExpr MkRealConst (Symbol name)
 Creates a real constant. More...
 
RealExpr MkRealConst (string name)
 Creates a real constant. More...
 
BitVecExpr MkBVConst (Symbol name, uint size)
 Creates a bit-vector constant. More...
 
BitVecExpr MkBVConst (string name, uint size)
 Creates a bit-vector constant. More...
 
Expr MkApp (FuncDecl f, params Expr[] args)
 Create a new function application. More...
 
Expr MkApp (FuncDecl f, IEnumerable< Expr > args)
 Create a new function application. More...
 
BoolExpr MkTrue ()
 The true Term. More...
 
BoolExpr MkFalse ()
 The false Term. More...
 
BoolExpr MkBool (bool value)
 Creates a Boolean value. More...
 
BoolExpr MkEq (Expr x, Expr y)
 Creates the equality x = y . More...
 
BoolExpr MkDistinct (params Expr[] args)
 Creates a distinct term. More...
 
BoolExpr MkDistinct (IEnumerable< Expr > args)
 Creates a distinct term. More...
 
BoolExpr MkNot (BoolExpr a)
 Mk an expression representing not(a). More...
 
Expr MkITE (BoolExpr t1, Expr t2, Expr t3)
 Create an expression representing an if-then-else: ite(t1, t2, t3). More...
 
BoolExpr MkIff (BoolExpr t1, BoolExpr t2)
 Create an expression representing t1 iff t2. More...
 
BoolExpr MkImplies (BoolExpr t1, BoolExpr t2)
 Create an expression representing t1 -> t2. More...
 
BoolExpr MkXor (BoolExpr t1, BoolExpr t2)
 Create an expression representing t1 xor t2. More...
 
BoolExpr MkXor (IEnumerable< BoolExpr > ts)
 Create an expression representing t1 xor t2 xor t3 ... . More...
 
BoolExpr MkAnd (params BoolExpr[] t)
 Create an expression representing t[0] and t[1] and .... More...
 
BoolExpr MkAnd (IEnumerable< BoolExpr > t)
 Create an expression representing t[0] and t[1] and .... More...
 
BoolExpr MkOr (params BoolExpr[] t)
 Create an expression representing t[0] or t[1] or .... More...
 
BoolExpr MkOr (IEnumerable< BoolExpr > t)
 Create an expression representing t[0] or t[1] or .... More...
 
ArithExpr MkAdd (params ArithExpr[] t)
 Create an expression representing t[0] + t[1] + .... More...
 
ArithExpr MkAdd (IEnumerable< ArithExpr > t)
 Create an expression representing t[0] + t[1] + .... More...
 
ArithExpr MkMul (params ArithExpr[] t)
 Create an expression representing t[0] * t[1] * .... More...
 
ArithExpr MkMul (IEnumerable< ArithExpr > t)
 Create an expression representing t[0] * t[1] * .... More...
 
ArithExpr MkSub (params ArithExpr[] t)
 Create an expression representing t[0] - t[1] - .... More...
 
ArithExpr MkUnaryMinus (ArithExpr t)
 Create an expression representing -t. More...
 
ArithExpr MkDiv (ArithExpr t1, ArithExpr t2)
 Create an expression representing t1 / t2. More...
 
IntExpr MkMod (IntExpr t1, IntExpr t2)
 Create an expression representing t1 mod t2. More...
 
IntExpr MkRem (IntExpr t1, IntExpr t2)
 Create an expression representing t1 rem t2. More...
 
ArithExpr MkPower (ArithExpr t1, ArithExpr t2)
 Create an expression representing t1 ^ t2. More...
 
BoolExpr MkLt (ArithExpr t1, ArithExpr t2)
 Create an expression representing t1 < t2 More...
 
BoolExpr MkLe (ArithExpr t1, ArithExpr t2)
 Create an expression representing t1 <= t2 More...
 
BoolExpr MkGt (ArithExpr t1, ArithExpr t2)
 Create an expression representing t1 > t2 More...
 
BoolExpr MkGe (ArithExpr t1, ArithExpr t2)
 Create an expression representing t1 >= t2 More...
 
RealExpr MkInt2Real (IntExpr t)
 Coerce an integer to a real. More...
 
IntExpr MkReal2Int (RealExpr t)
 Coerce a real to an integer. More...
 
BoolExpr MkIsInteger (RealExpr t)
 Creates an expression that checks whether a real number is an integer. More...
 
BitVecExpr MkBVNot (BitVecExpr t)
 Bitwise negation. More...
 
BitVecExpr MkBVRedAND (BitVecExpr t)
 Take conjunction of bits in a vector, return vector of length 1. More...
 
BitVecExpr MkBVRedOR (BitVecExpr t)
 Take disjunction of bits in a vector, return vector of length 1. More...
 
BitVecExpr MkBVAND (BitVecExpr t1, BitVecExpr t2)
 Bitwise conjunction. More...
 
BitVecExpr MkBVOR (BitVecExpr t1, BitVecExpr t2)
 Bitwise disjunction. More...
 
BitVecExpr MkBVXOR (BitVecExpr t1, BitVecExpr t2)
 Bitwise XOR. More...
 
BitVecExpr MkBVNAND (BitVecExpr t1, BitVecExpr t2)
 Bitwise NAND. More...
 
BitVecExpr MkBVNOR (BitVecExpr t1, BitVecExpr t2)
 Bitwise NOR. More...
 
BitVecExpr MkBVXNOR (BitVecExpr t1, BitVecExpr t2)
 Bitwise XNOR. More...
 
BitVecExpr MkBVNeg (BitVecExpr t)
 Standard two's complement unary minus. More...
 
BitVecExpr MkBVAdd (BitVecExpr t1, BitVecExpr t2)
 Two's complement addition. More...
 
BitVecExpr MkBVSub (BitVecExpr t1, BitVecExpr t2)
 Two's complement subtraction. More...
 
BitVecExpr MkBVMul (BitVecExpr t1, BitVecExpr t2)
 Two's complement multiplication. More...
 
BitVecExpr MkBVUDiv (BitVecExpr t1, BitVecExpr t2)
 Unsigned division. More...
 
BitVecExpr MkBVSDiv (BitVecExpr t1, BitVecExpr t2)
 Signed division. More...
 
BitVecExpr MkBVURem (BitVecExpr t1, BitVecExpr t2)
 Unsigned remainder. More...
 
BitVecExpr MkBVSRem (BitVecExpr t1, BitVecExpr t2)
 Signed remainder. More...
 
BitVecExpr MkBVSMod (BitVecExpr t1, BitVecExpr t2)
 Two's complement signed remainder (sign follows divisor). More...
 
BoolExpr MkBVULT (BitVecExpr t1, BitVecExpr t2)
 Unsigned less-than More...
 
BoolExpr MkBVSLT (BitVecExpr t1, BitVecExpr t2)
 Two's complement signed less-than More...
 
BoolExpr MkBVULE (BitVecExpr t1, BitVecExpr t2)
 Unsigned less-than or equal to. More...
 
BoolExpr MkBVSLE (BitVecExpr t1, BitVecExpr t2)
 Two's complement signed less-than or equal to. More...
 
BoolExpr MkBVUGE (BitVecExpr t1, BitVecExpr t2)
 Unsigned greater than or equal to. More...
 
BoolExpr MkBVSGE (BitVecExpr t1, BitVecExpr t2)
 Two's complement signed greater than or equal to. More...
 
BoolExpr MkBVUGT (BitVecExpr t1, BitVecExpr t2)
 Unsigned greater-than. More...
 
BoolExpr MkBVSGT (BitVecExpr t1, BitVecExpr t2)
 Two's complement signed greater-than. More...
 
BitVecExpr MkConcat (BitVecExpr t1, BitVecExpr t2)
 Bit-vector concatenation. More...
 
BitVecExpr MkExtract (uint high, uint low, BitVecExpr t)
 Bit-vector extraction. More...
 
BitVecExpr MkSignExt (uint i, BitVecExpr t)
 Bit-vector sign extension. More...
 
BitVecExpr MkZeroExt (uint i, BitVecExpr t)
 Bit-vector zero extension. More...
 
BitVecExpr MkRepeat (uint i, BitVecExpr t)
 Bit-vector repetition. More...
 
BitVecExpr MkBVSHL (BitVecExpr t1, BitVecExpr t2)
 Shift left. More...
 
BitVecExpr MkBVLSHR (BitVecExpr t1, BitVecExpr t2)
 Logical shift right More...
 
BitVecExpr MkBVASHR (BitVecExpr t1, BitVecExpr t2)
 Arithmetic shift right More...
 
BitVecExpr MkBVRotateLeft (uint i, BitVecExpr t)
 Rotate Left. More...
 
BitVecExpr MkBVRotateRight (uint i, BitVecExpr t)
 Rotate Right. More...
 
BitVecExpr MkBVRotateLeft (BitVecExpr t1, BitVecExpr t2)
 Rotate Left. More...
 
BitVecExpr MkBVRotateRight (BitVecExpr t1, BitVecExpr t2)
 Rotate Right. More...
 
BitVecExpr MkInt2BV (uint n, IntExpr t)
 Create an n bit bit-vector from the integer argument t . More...
 
IntExpr MkBV2Int (BitVecExpr t, bool signed)
 Create an integer from the bit-vector argument t . More...
 
BoolExpr MkBVAddNoOverflow (BitVecExpr t1, BitVecExpr t2, bool isSigned)
 Create a predicate that checks that the bit-wise addition does not overflow. More...
 
BoolExpr MkBVAddNoUnderflow (BitVecExpr t1, BitVecExpr t2)
 Create a predicate that checks that the bit-wise addition does not underflow. More...
 
BoolExpr MkBVSubNoOverflow (BitVecExpr t1, BitVecExpr t2)
 Create a predicate that checks that the bit-wise subtraction does not overflow. More...
 
BoolExpr MkBVSubNoUnderflow (BitVecExpr t1, BitVecExpr t2, bool isSigned)
 Create a predicate that checks that the bit-wise subtraction does not underflow. More...
 
BoolExpr MkBVSDivNoOverflow (BitVecExpr t1, BitVecExpr t2)
 Create a predicate that checks that the bit-wise signed division does not overflow. More...
 
BoolExpr MkBVNegNoOverflow (BitVecExpr t)
 Create a predicate that checks that the bit-wise negation does not overflow. More...
 
BoolExpr MkBVMulNoOverflow (BitVecExpr t1, BitVecExpr t2, bool isSigned)
 Create a predicate that checks that the bit-wise multiplication does not overflow. More...
 
BoolExpr MkBVMulNoUnderflow (BitVecExpr t1, BitVecExpr t2)
 Create a predicate that checks that the bit-wise multiplication does not underflow. More...
 
ArrayExpr MkArrayConst (Symbol name, Sort domain, Sort range)
 Create an array constant. More...
 
ArrayExpr MkArrayConst (string name, Sort domain, Sort range)
 Create an array constant. More...
 
Expr MkSelect (ArrayExpr a, Expr i)
 Array read. More...
 
Expr MkSelect (ArrayExpr a, params Expr[] args)
 Array read. More...
 
ArrayExpr MkStore (ArrayExpr a, Expr i, Expr v)
 Array update. More...
 
ArrayExpr MkStore (ArrayExpr a, Expr[] args, Expr v)
 Array update. More...
 
ArrayExpr MkConstArray (Sort domain, Expr v)
 Create a constant array. More...
 
ArrayExpr MkMap (FuncDecl f, params ArrayExpr[] args)
 Maps f on the argument arrays. More...
 
Expr MkTermArray (ArrayExpr array)
 Access the array default value. More...
 
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. More...
 
SetSort MkSetSort (Sort ty)
 Create a set type. More...
 
ArrayExpr MkEmptySet (Sort domain)
 Create an empty set. More...
 
ArrayExpr MkFullSet (Sort domain)
 Create the full set. More...
 
ArrayExpr MkSetAdd (ArrayExpr set, Expr element)
 Add an element to the set. More...
 
ArrayExpr MkSetDel (ArrayExpr set, Expr element)
 Remove an element from a set. More...
 
ArrayExpr MkSetUnion (params ArrayExpr[] args)
 Take the union of a list of sets. More...
 
ArrayExpr MkSetIntersection (params ArrayExpr[] args)
 Take the intersection of a list of sets. More...
 
ArrayExpr MkSetDifference (ArrayExpr arg1, ArrayExpr arg2)
 Take the difference between two sets. More...
 
ArrayExpr MkSetComplement (ArrayExpr arg)
 Take the complement of a set. More...
 
BoolExpr MkSetMembership (Expr elem, ArrayExpr set)
 Check for set membership. More...
 
BoolExpr MkSetSubset (ArrayExpr arg1, ArrayExpr arg2)
 Check for subsetness of sets. More...
 
SeqExpr MkEmptySeq (Sort s)
 Create the empty sequence. More...
 
SeqExpr MkUnit (Expr elem)
 Create the singleton sequence. More...
 
SeqExpr MkString (string s)
 Create a string constant. More...
 
SeqExpr IntToString (Expr e)
 Convert an integer expression to a string. More...
 
SeqExpr UbvToString (Expr e)
 Convert a bit-vector expression, represented as an unsigned number, to a string. More...
 
SeqExpr SbvToString (Expr e)
 Convert a bit-vector expression, represented as an signed number, to a string. More...
 
IntExpr StringToInt (Expr e)
 Convert an integer expression to a string. More...
 
SeqExpr MkConcat (params SeqExpr[] t)
 Concatenate sequences. More...
 
IntExpr MkLength (SeqExpr s)
 Retrieve the length of a given sequence. More...
 
BoolExpr MkPrefixOf (SeqExpr s1, SeqExpr s2)
 Check for sequence prefix. More...
 
BoolExpr MkSuffixOf (SeqExpr s1, SeqExpr s2)
 Check for sequence suffix. More...
 
BoolExpr MkContains (SeqExpr s1, SeqExpr s2)
 Check for sequence containment of s2 in s1. More...
 
BoolExpr MkStringLt (SeqExpr s1, SeqExpr s2)
 Check if the string s1 is lexicographically strictly less than s2. More...
 
BoolExpr MkStringLe (SeqExpr s1, SeqExpr s2)
 Check if the string s1 is lexicographically less or equal to s2. More...
 
SeqExpr MkAt (SeqExpr s, Expr index)
 Retrieve sequence of length one at index. More...
 
Expr MkNth (SeqExpr s, Expr index)
 Retrieve element at index. More...
 
SeqExpr MkExtract (SeqExpr s, IntExpr offset, IntExpr length)
 Extract subsequence. More...
 
IntExpr MkIndexOf (SeqExpr s, SeqExpr substr, ArithExpr offset)
 Extract index of sub-string starting at offset. More...
 
SeqExpr MkReplace (SeqExpr s, SeqExpr src, SeqExpr dst)
 Replace the first occurrence of src by dst in s. More...
 
ReExpr MkToRe (SeqExpr s)
 Convert a regular expression that accepts sequence s. More...
 
BoolExpr MkInRe (SeqExpr s, ReExpr re)
 Check for regular expression membership. More...
 
ReExpr MkStar (ReExpr re)
 Take the Kleene star of a regular expression. More...
 
ReExpr MkLoop (ReExpr re, uint lo, uint hi=0)
 Take the bounded Kleene star of a regular expression. More...
 
ReExpr MkPlus (ReExpr re)
 Take the Kleene plus of a regular expression. More...
 
ReExpr MkOption (ReExpr re)
 Create the optional regular expression. More...
 
ReExpr MkComplement (ReExpr re)
 Create the complement regular expression. More...
 
ReExpr MkConcat (params ReExpr[] t)
 Create the concatenation of regular languages. More...
 
ReExpr MkUnion (params ReExpr[] t)
 Create the union of regular languages. More...
 
ReExpr MkIntersect (params ReExpr[] t)
 Create the intersection of regular languages. More...
 
ReExpr MkDiff (ReExpr a, ReExpr b)
 Create a difference regular expression. More...
 
ReExpr MkEmptyRe (Sort s)
 Create the empty regular expression. The sort s should be a regular expression. More...
 
ReExpr MkFullRe (Sort s)
 Create the full regular expression. The sort s should be a regular expression. More...
 
ReExpr MkRange (SeqExpr lo, SeqExpr hi)
 Create a range expression. More...
 
BoolExpr MkCharLe (Expr ch1, Expr ch2)
 Create less than or equal to between two characters. More...
 
IntExpr CharToInt (Expr ch)
 Create an integer (code point) from character. More...
 
BitVecExpr CharToBV (Expr ch)
 Create a bit-vector (code point) from character. More...
 
Expr CharFromBV (BitVecExpr bv)
 Create a character from a bit-vector (code point). More...
 
BoolExpr MkIsDigit (Expr ch)
 Create a check if the character is a digit. More...
 
BoolExpr MkAtMost (IEnumerable< BoolExpr > args, uint k)
 Create an at-most-k constraint. More...
 
BoolExpr MkAtLeast (IEnumerable< BoolExpr > args, uint k)
 Create an at-least-k constraint. More...
 
BoolExpr MkPBLe (int[] coeffs, BoolExpr[] args, int k)
 Create a pseudo-Boolean less-or-equal constraint. More...
 
BoolExpr MkPBGe (int[] coeffs, BoolExpr[] args, int k)
 Create a pseudo-Boolean greater-or-equal constraint. More...
 
BoolExpr MkPBEq (int[] coeffs, BoolExpr[] args, int k)
 Create a pseudo-Boolean equal constraint. More...
 
Expr MkNumeral (string v, Sort ty)
 Create a Term of a given sort. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
RatNum MkReal (int num, int den)
 Create a real from a fraction. More...
 
RatNum MkReal (string v)
 Create a real numeral. More...
 
RatNum MkReal (int v)
 Create a real numeral. More...
 
RatNum MkReal (uint v)
 Create a real numeral. More...
 
RatNum MkReal (long v)
 Create a real numeral. More...
 
RatNum MkReal (ulong v)
 Create a real numeral. More...
 
IntNum MkInt (string v)
 Create an integer numeral. More...
 
IntNum MkInt (int v)
 Create an integer numeral. More...
 
IntNum MkInt (uint v)
 Create an integer numeral. More...
 
IntNum MkInt (long v)
 Create an integer numeral. More...
 
IntNum MkInt (ulong v)
 Create an integer numeral. More...
 
BitVecNum MkBV (string v, uint size)
 Create a bit-vector numeral. More...
 
BitVecNum MkBV (int v, uint size)
 Create a bit-vector numeral. More...
 
BitVecNum MkBV (uint v, uint size)
 Create a bit-vector numeral. More...
 
BitVecNum MkBV (long v, uint size)
 Create a bit-vector numeral. More...
 
BitVecNum MkBV (ulong v, uint size)
 Create a bit-vector numeral. More...
 
BitVecNum MkBV (bool[] bits)
 Create a bit-vector numeral. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
Lambda MkLambda (Sort[] sorts, Symbol[] names, Expr body)
 Create a lambda expression. More...
 
Lambda MkLambda (Expr[] boundConstants, Expr body)
 Create a lambda expression. More...
 
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. More...
 
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. More...
 
Goal MkGoal (bool models=true, bool unsatCores=false, bool proofs=false)
 Creates a new Goal. More...
 
Params MkParams ()
 Creates a new ParameterSet. More...
 
string TacticDescription (string name)
 Returns a string containing a description of the tactic with the given name. More...
 
Tactic MkTactic (string name)
 Creates a new Tactic. More...
 
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 . More...
 
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 . More...
 
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. More...
 
Tactic TryFor (Tactic t, uint ms)
 Create a tactic that applies t to a goal for ms milliseconds. More...
 
Tactic When (Probe p, Tactic t)
 Create a tactic that applies t to a given goal if the probe p evaluates to true. More...
 
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. More...
 
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. More...
 
Tactic Skip ()
 Create a tactic that just returns the given goal. More...
 
Tactic Fail ()
 Create a tactic always fails. More...
 
Tactic FailIf (Probe p)
 Create a tactic that fails if the probe p evaluates to false. More...
 
Tactic FailIfNotDecided ()
 Create a tactic that fails if the goal is not trivially satisfiable (i.e., empty) or trivially unsatisfiable (i.e., contains ‘false’). More...
 
Tactic UsingParams (Tactic t, Params p)
 Create a tactic that applies t using the given set of parameters p . More...
 
Tactic With (Tactic t, Params p)
 Create a tactic that applies t using the given set of parameters p . More...
 
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). More...
 
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. More...
 
void Interrupt ()
 Interrupt the execution of a Z3 procedure. More...
 
string ProbeDescription (string name)
 Returns a string containing a description of the probe with the given name. More...
 
Probe MkProbe (string name)
 Creates a new Probe. More...
 
Probe ConstProbe (double val)
 Create a probe that always evaluates to val . More...
 
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 More...
 
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 More...
 
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 More...
 
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 More...
 
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 More...
 
Probe And (Probe p1, Probe p2)
 Create a probe that evaluates to "true" when the value p1 and p2 evaluate to "true". More...
 
Probe Or (Probe p1, Probe p2)
 Create a probe that evaluates to "true" when the value p1 or p2 evaluate to "true". More...
 
Probe Not (Probe p)
 Create a probe that evaluates to "true" when the value p does not evaluate to "true". More...
 
Solver MkSolver (Symbol logic=null)
 Creates a new (incremental) solver. More...
 
Solver MkSolver (string logic)
 Creates a new (incremental) solver. More...
 
Solver MkSimpleSolver ()
 Creates a new (incremental) solver. More...
 
Solver MkSolver (Tactic t)
 Creates a solver that is implemented using the given tactic. More...
 
Fixedpoint MkFixedpoint ()
 Create a Fixedpoint context. More...
 
Optimize MkOptimize ()
 Create an Optimization context. More...
 
FPRMSort MkFPRoundingModeSort ()
 Create the floating-point RoundingMode sort. More...
 
FPRMExpr MkFPRoundNearestTiesToEven ()
 Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode. More...
 
FPRMNum MkFPRNE ()
 Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode. More...
 
FPRMNum MkFPRoundNearestTiesToAway ()
 Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode. More...
 
FPRMNum MkFPRNA ()
 Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode. More...
 
FPRMNum MkFPRoundTowardPositive ()
 Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode. More...
 
FPRMNum MkFPRTP ()
 Create a numeral of RoundingMode sort which represents the RoundTowardPositive rounding mode. More...
 
FPRMNum MkFPRoundTowardNegative ()
 Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode. More...
 
FPRMNum MkFPRTN ()
 Create a numeral of RoundingMode sort which represents the RoundTowardNegative rounding mode. More...
 
FPRMNum MkFPRoundTowardZero ()
 Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode. More...
 
FPRMNum MkFPRTZ ()
 Create a numeral of RoundingMode sort which represents the RoundTowardZero rounding mode. More...
 
FPSort MkFPSort (uint ebits, uint sbits)
 Create a FloatingPoint sort. More...
 
FPSort MkFPSortHalf ()
 Create the half-precision (16-bit) FloatingPoint sort. More...
 
FPSort MkFPSort16 ()
 Create the half-precision (16-bit) FloatingPoint sort. More...
 
FPSort MkFPSortSingle ()
 Create the single-precision (32-bit) FloatingPoint sort. More...
 
FPSort MkFPSort32 ()
 Create the single-precision (32-bit) FloatingPoint sort. More...
 
FPSort MkFPSortDouble ()
 Create the double-precision (64-bit) FloatingPoint sort. More...
 
FPSort MkFPSort64 ()
 Create the double-precision (64-bit) FloatingPoint sort. More...
 
FPSort MkFPSortQuadruple ()
 Create the quadruple-precision (128-bit) FloatingPoint sort. More...
 
FPSort MkFPSort128 ()
 Create the quadruple-precision (128-bit) FloatingPoint sort. More...
 
FPNum MkFPNaN (FPSort s)
 Create a NaN of sort s. More...
 
FPNum MkFPInf (FPSort s, bool negative)
 Create a floating-point infinity of sort s. More...
 
FPNum MkFPZero (FPSort s, bool negative)
 Create a floating-point zero of sort s. More...
 
FPNum MkFPNumeral (float v, FPSort s)
 Create a numeral of FloatingPoint sort from a float. More...
 
FPNum MkFPNumeral (double v, FPSort s)
 Create a numeral of FloatingPoint sort from a float. More...
 
FPNum MkFPNumeral (int v, FPSort s)
 Create a numeral of FloatingPoint sort from an int. More...
 
FPNum MkFPNumeral (bool sgn, uint sig, int exp, FPSort s)
 Create a numeral of FloatingPoint sort from a sign bit and two integers. More...
 
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. More...
 
FPNum MkFP (float v, FPSort s)
 Create a numeral of FloatingPoint sort from a float. More...
 
FPNum MkFP (double v, FPSort s)
 Create a numeral of FloatingPoint sort from a float. More...
 
FPNum MkFP (int v, FPSort s)
 Create a numeral of FloatingPoint sort from an int. More...
 
FPNum MkFP (bool sgn, int exp, uint sig, FPSort s)
 Create a numeral of FloatingPoint sort from a sign bit and two integers. More...
 
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. More...
 
FPExpr MkFPAbs (FPExpr t)
 Floating-point absolute value More...
 
FPExpr MkFPNeg (FPExpr t)
 Floating-point negation More...
 
FPExpr MkFPAdd (FPRMExpr rm, FPExpr t1, FPExpr t2)
 Floating-point addition More...
 
FPExpr MkFPSub (FPRMExpr rm, FPExpr t1, FPExpr t2)
 Floating-point subtraction More...
 
FPExpr MkFPMul (FPRMExpr rm, FPExpr t1, FPExpr t2)
 Floating-point multiplication More...
 
FPExpr MkFPDiv (FPRMExpr rm, FPExpr t1, FPExpr t2)
 Floating-point division More...
 
FPExpr MkFPFMA (FPRMExpr rm, FPExpr t1, FPExpr t2, FPExpr t3)
 Floating-point fused multiply-add More...
 
FPExpr MkFPSqrt (FPRMExpr rm, FPExpr t)
 Floating-point square root More...
 
FPExpr MkFPRem (FPExpr t1, FPExpr t2)
 Floating-point remainder More...
 
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. More...
 
FPExpr MkFPMin (FPExpr t1, FPExpr t2)
 Minimum of floating-point numbers. More...
 
FPExpr MkFPMax (FPExpr t1, FPExpr t2)
 Maximum of floating-point numbers. More...
 
BoolExpr MkFPLEq (FPExpr t1, FPExpr t2)
 Floating-point less than or equal. More...
 
BoolExpr MkFPLt (FPExpr t1, FPExpr t2)
 Floating-point less than. More...
 
BoolExpr MkFPGEq (FPExpr t1, FPExpr t2)
 Floating-point greater than or equal. More...
 
BoolExpr MkFPGt (FPExpr t1, FPExpr t2)
 Floating-point greater than. More...
 
BoolExpr MkFPEq (FPExpr t1, FPExpr t2)
 Floating-point equality. More...
 
BoolExpr MkFPIsNormal (FPExpr t)
 Predicate indicating whether t is a normal floating-point number. More...
 
BoolExpr MkFPIsSubnormal (FPExpr t)
 Predicate indicating whether t is a subnormal floating-point number. More...
 
BoolExpr MkFPIsZero (FPExpr t)
 Predicate indicating whether t is a floating-point number with zero value, i.e., +0 or -0. More...
 
BoolExpr MkFPIsInfinite (FPExpr t)
 Predicate indicating whether t is a floating-point number representing +oo or -oo. More...
 
BoolExpr MkFPIsNaN (FPExpr t)
 Predicate indicating whether t is a NaN. More...
 
BoolExpr MkFPIsNegative (FPExpr t)
 Predicate indicating whether t is a negative floating-point number. More...
 
BoolExpr MkFPIsPositive (FPExpr t)
 Predicate indicating whether t is a positive floating-point number. More...
 
FPExpr MkFP (BitVecExpr sgn, BitVecExpr sig, BitVecExpr exp)
 Create an expression of FloatingPoint sort from three bit-vector expressions. More...
 
FPExpr MkFPToFP (BitVecExpr bv, FPSort s)
 Conversion of a single IEEE 754-2008 bit-vector into a floating-point number. More...
 
FPExpr MkFPToFP (FPRMExpr rm, FPExpr t, FPSort s)
 Conversion of a FloatingPoint term into another term of different FloatingPoint sort. More...
 
FPExpr MkFPToFP (FPRMExpr rm, RealExpr t, FPSort s)
 Conversion of a term of real sort into a term of FloatingPoint sort. More...
 
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. More...
 
FPExpr MkFPToFP (FPSort s, FPRMExpr rm, FPExpr t)
 Conversion of a floating-point number to another FloatingPoint sort s. More...
 
BitVecExpr MkFPToBV (FPRMExpr rm, FPExpr t, uint sz, bool sign)
 Conversion of a floating-point term into a bit-vector. More...
 
RealExpr MkFPToReal (FPExpr t)
 Conversion of a floating-point term into a real-numbered term. More...
 
BitVecExpr MkFPToIEEEBV (FPExpr t)
 Conversion of a floating-point term into a bit-vector term in IEEE 754-2008 format. More...
 
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. More...
 
AST WrapAST (IntPtr nativeObject)
 Wraps an AST. More...
 
IntPtr UnwrapAST (AST a)
 Unwraps an AST. More...
 
string SimplifyHelp ()
 Return a string describing all available parameters to Expr.Simplify. More...
 
void UpdateParamValue (string id, string value)
 Update a mutable configuration parameter. More...
 
void Dispose ()
 Disposes of the context. More...
 

Properties

BoolSort BoolSort [get]
 Retrieves the Boolean sort of the context. More...
 
IntSort IntSort [get]
 Retrieves the Integer sort of the context. More...
 
RealSort RealSort [get]
 Retrieves the Real sort of the context. More...
 
CharSort CharSort [get]
 Retrieves the String sort of the context. More...
 
SeqSort StringSort [get]
 Retrieves the String sort of the context. More...
 
Z3_ast_print_mode PrintMode [set]
 Selects the format used for pretty-printing expressions. More...
 
uint NumTactics [get]
 The number of supported tactics. More...
 
string[] TacticNames [get]
 The names of all supported tactics. More...
 
uint NumProbes [get]
 The number of supported Probes. More...
 
string[] ProbeNames [get]
 The names of all supported Probes. More...
 
ParamDescrs SimplifyParameterDescriptions [get]
 Retrieves parameter descriptions for simplifier. More...
 
IDecRefQueue AST_DRQ [get]
 AST DRQ More...
 
IDecRefQueue ASTMap_DRQ [get]
 ASTMap DRQ More...
 
IDecRefQueue ASTVector_DRQ [get]
 ASTVector DRQ More...
 
IDecRefQueue ApplyResult_DRQ [get]
 ApplyResult DRQ More...
 
IDecRefQueue FuncEntry_DRQ [get]
 FuncEntry DRQ More...
 
IDecRefQueue FuncInterp_DRQ [get]
 FuncInterp DRQ More...
 
IDecRefQueue Goal_DRQ [get]
 Goal DRQ More...
 
IDecRefQueue Model_DRQ [get]
 Model DRQ More...
 
IDecRefQueue Params_DRQ [get]
 Params DRQ More...
 
IDecRefQueue ParamDescrs_DRQ [get]
 ParamDescrs DRQ More...
 
IDecRefQueue Probe_DRQ [get]
 Probe DRQ More...
 
IDecRefQueue Solver_DRQ [get]
 Solver DRQ More...
 
IDecRefQueue Statistics_DRQ [get]
 Statistics DRQ More...
 
IDecRefQueue Tactic_DRQ [get]
 Tactic DRQ More...
 
IDecRefQueue Fixedpoint_DRQ [get]
 FixedPoint DRQ More...
 
IDecRefQueue Optimize_DRQ [get]
 Optimize DRQ More...
 

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 InitContext();
46 }
47 }

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

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

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

616 {
617 CheckContextMatch(f);
618 CheckContextMatch<Expr>(args);
619 CheckContextMatch(body);
620 IntPtr[] argsNative = AST.ArrayToNative(args);
621 Native.Z3_add_rec_def(nCtx, f.NativeObject, (uint)args.Length, argsNative, body.NativeObject);
622 }

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

3854 {
3855 Debug.Assert(p1 != null);
3856 Debug.Assert(p2 != null);
3857
3858 CheckContextMatch(p1);
3859 CheckContextMatch(p2);
3860 return new Probe(this, Native.Z3_probe_and(nCtx, p1.NativeObject, p2.NativeObject));
3861 }

◆ AndThen()

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

3513 {
3514 Debug.Assert(t1 != null);
3515 Debug.Assert(t2 != null);
3516 // Debug.Assert(ts == null || Contract.ForAll(0, ts.Length, j => ts[j] != null));
3517
3518
3519 CheckContextMatch(t1);
3520 CheckContextMatch(t2);
3521 CheckContextMatch<Tactic>(ts);
3522
3523 IntPtr last = IntPtr.Zero;
3524 if (ts != null && ts.Length > 0)
3525 {
3526 last = ts[ts.Length - 1].NativeObject;
3527 for (int i = ts.Length - 2; i >= 0; i--)
3528 last = Native.Z3_tactic_and_then(nCtx, ts[i].NativeObject, last);
3529 }
3530 if (last != IntPtr.Zero)
3531 {
3532 last = Native.Z3_tactic_and_then(nCtx, t2.NativeObject, last);
3533 return new Tactic(this, Native.Z3_tactic_and_then(nCtx, t1.NativeObject, last));
3534 }
3535 else
3536 return new Tactic(this, Native.Z3_tactic_and_then(nCtx, t1.NativeObject, t2.NativeObject));
3537 }

Referenced by Context.Then().

◆ CharFromBV()

Expr CharFromBV ( BitVecExpr  bv)
inline

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

Definition at line 2819 of file Context.cs.

2820 {
2821 Debug.Assert(bv != null);
2822 return new Expr(this, Native.Z3_mk_char_from_bv(nCtx, bv.NativeObject));
2823 }

◆ CharToBV()

BitVecExpr CharToBV ( Expr  ch)
inline

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

Definition at line 2810 of file Context.cs.

2811 {
2812 Debug.Assert(ch != null);
2813 return new BitVecExpr(this, Native.Z3_mk_char_to_bv(nCtx, ch.NativeObject));
2814 }

◆ CharToInt()

IntExpr CharToInt ( Expr  ch)
inline

Create an integer (code point) from character.

Definition at line 2801 of file Context.cs.

2802 {
2803 Debug.Assert(ch != null);
2804 return new IntExpr(this, Native.Z3_mk_char_to_int(nCtx, ch.NativeObject));
2805 }

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

3605 {
3606 Debug.Assert(p != null);
3607 Debug.Assert(t1 != null);
3608 Debug.Assert(t2 != null);
3609
3610 CheckContextMatch(p);
3611 CheckContextMatch(t1);
3612 CheckContextMatch(t2);
3613 return new Tactic(this, Native.Z3_tactic_cond(nCtx, p.NativeObject, t1.NativeObject, t2.NativeObject));
3614 }

◆ ConstProbe()

Probe ConstProbe ( double  val)
inline

Create a probe that always evaluates to val .

Definition at line 3773 of file Context.cs.

3774 {
3775
3776 return new Probe(this, Native.Z3_probe_const(nCtx, val));
3777 }

◆ Dispose()

void Dispose ( )
inline

Disposes of the context.

Definition at line 4984 of file Context.cs.

4985 {
4986 // Console.WriteLine("Context Dispose from " + System.Threading.Thread.CurrentThread.ManagedThreadId);
4987 AST_DRQ.Clear(this);
4988 ASTMap_DRQ.Clear(this);
4989 ASTVector_DRQ.Clear(this);
4990 ApplyResult_DRQ.Clear(this);
4991 FuncEntry_DRQ.Clear(this);
4992 FuncInterp_DRQ.Clear(this);
4993 Goal_DRQ.Clear(this);
4994 Model_DRQ.Clear(this);
4995 Params_DRQ.Clear(this);
4996 ParamDescrs_DRQ.Clear(this);
4997 Probe_DRQ.Clear(this);
4998 Solver_DRQ.Clear(this);
4999 Statistics_DRQ.Clear(this);
5000 Tactic_DRQ.Clear(this);
5001 Fixedpoint_DRQ.Clear(this);
5002 Optimize_DRQ.Clear(this);
5003
5004 if (m_boolSort != null) m_boolSort.Dispose();
5005 if (m_intSort != null) m_intSort.Dispose();
5006 if (m_realSort != null) m_realSort.Dispose();
5007 if (m_stringSort != null) m_stringSort.Dispose();
5008 if (m_charSort != null) m_charSort.Dispose();
5009 m_boolSort = null;
5010 m_intSort = null;
5011 m_realSort = null;
5012 m_stringSort = null;
5013 m_charSort = null;
5014 if (refCount == 0 && m_ctx != IntPtr.Zero)
5015 {
5016 m_n_err_handler = null;
5017 IntPtr ctx = m_ctx;
5018 m_ctx = IntPtr.Zero;
5019 if (!is_external)
5020 Native.Z3_del_context(ctx);
5021 }
5022 else
5023 GC.ReRegisterForFinalize(this);
5024 }
IDecRefQueue ParamDescrs_DRQ
ParamDescrs DRQ
Definition: Context.cs:4938
IDecRefQueue Params_DRQ
Params DRQ
Definition: Context.cs:4933
IDecRefQueue Model_DRQ
Model DRQ
Definition: Context.cs:4928
IDecRefQueue Optimize_DRQ
Optimize DRQ
Definition: Context.cs:4968
IDecRefQueue ApplyResult_DRQ
ApplyResult DRQ
Definition: Context.cs:4908
IDecRefQueue ASTVector_DRQ
ASTVector DRQ
Definition: Context.cs:4903
IDecRefQueue Goal_DRQ
Goal DRQ
Definition: Context.cs:4923
IDecRefQueue Statistics_DRQ
Statistics DRQ
Definition: Context.cs:4953
IDecRefQueue FuncEntry_DRQ
FuncEntry DRQ
Definition: Context.cs:4913
IDecRefQueue Solver_DRQ
Solver DRQ
Definition: Context.cs:4948
IDecRefQueue FuncInterp_DRQ
FuncInterp DRQ
Definition: Context.cs:4918
IDecRefQueue AST_DRQ
AST DRQ
Definition: Context.cs:4893
IDecRefQueue Fixedpoint_DRQ
FixedPoint DRQ
Definition: Context.cs:4963
IDecRefQueue Tactic_DRQ
Tactic DRQ
Definition: Context.cs:4958
IDecRefQueue Probe_DRQ
Probe DRQ
Definition: Context.cs:4943
IDecRefQueue ASTMap_DRQ
ASTMap DRQ
Definition: Context.cs:4898
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 3839 of file Context.cs.

3840 {
3841 Debug.Assert(p1 != null);
3842 Debug.Assert(p2 != null);
3843
3844 CheckContextMatch(p1);
3845 CheckContextMatch(p2);
3846 return new Probe(this, Native.Z3_probe_eq(nCtx, p1.NativeObject, p2.NativeObject));
3847 }

◆ Fail()

Tactic Fail ( )
inline

Create a tactic always fails.

Definition at line 3640 of file Context.cs.

3641 {
3642
3643 return new Tactic(this, Native.Z3_tactic_fail(nCtx));
3644 }

◆ FailIf()

Tactic FailIf ( Probe  p)
inline

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

Definition at line 3649 of file Context.cs.

3650 {
3651 Debug.Assert(p != null);
3652
3653 CheckContextMatch(p);
3654 return new Tactic(this, Native.Z3_tactic_fail_if(nCtx, p.NativeObject));
3655 }

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

3662 {
3663
3664 return new Tactic(this, Native.Z3_tactic_fail_if_not_decided(nCtx));
3665 }

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

3826 {
3827 Debug.Assert(p1 != null);
3828 Debug.Assert(p2 != null);
3829
3830 CheckContextMatch(p1);
3831 CheckContextMatch(p2);
3832 return new Probe(this, Native.Z3_probe_ge(nCtx, p1.NativeObject, p2.NativeObject));
3833 }

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

3798 {
3799 Debug.Assert(p1 != null);
3800 Debug.Assert(p2 != null);
3801
3802 CheckContextMatch(p1);
3803 CheckContextMatch(p2);
3804 return new Probe(this, Native.Z3_probe_gt(nCtx, p1.NativeObject, p2.NativeObject));
3805 }

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

3722 {
3723 Native.Z3_interrupt(nCtx);
3724 }

◆ IntToString()

SeqExpr IntToString ( Expr  e)
inline

Convert an integer expression to a string.

Definition at line 2470 of file Context.cs.

2471 {
2472 Debug.Assert(e != null);
2473 Debug.Assert(e is ArithExpr);
2474 return new SeqExpr(this, Native.Z3_mk_int_to_str(nCtx, e.NativeObject));
2475 }

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

3812 {
3813 Debug.Assert(p1 != null);
3814 Debug.Assert(p2 != null);
3815
3816 CheckContextMatch(p1);
3817 CheckContextMatch(p2);
3818 return new Probe(this, Native.Z3_probe_le(nCtx, p1.NativeObject, p2.NativeObject));
3819 }

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

3784 {
3785 Debug.Assert(p1 != null);
3786 Debug.Assert(p2 != null);
3787
3788 CheckContextMatch(p1);
3789 CheckContextMatch(p2);
3790 return new Probe(this, Native.Z3_probe_lt(nCtx, p1.NativeObject, p2.NativeObject));
3791 }

◆ MkAdd() [1/2]

ArithExpr MkAdd ( IEnumerable< ArithExpr t)
inline

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

Definition at line 1102 of file Context.cs.

1103 {
1104 Debug.Assert(t != null);
1105 Debug.Assert(t.All(a => a != null));
1106
1107 CheckContextMatch(t);
1108 var ts = t.ToArray();
1109 return (ArithExpr)Expr.Create(this, Native.Z3_mk_add(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1110 }

◆ MkAdd() [2/2]

ArithExpr MkAdd ( params ArithExpr[]  t)
inline

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

Definition at line 1090 of file Context.cs.

1091 {
1092 Debug.Assert(t != null);
1093 Debug.Assert(t.All(a => a != null));
1094
1095 CheckContextMatch<ArithExpr>(t);
1096 return (ArithExpr)Expr.Create(this, Native.Z3_mk_add(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
1097 }

Referenced by ArithExpr.operator+().

◆ MkAnd() [1/2]

BoolExpr MkAnd ( IEnumerable< BoolExpr t)
inline

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

Definition at line 1049 of file Context.cs.

1050 {
1051 Debug.Assert(t != null);
1052 Debug.Assert(t.All(a => a != null));
1053 CheckContextMatch<BoolExpr>(t);
1054 var ands = t.ToArray();
1055 return new BoolExpr(this, Native.Z3_mk_and(nCtx, (uint)t.Count(), AST.ArrayToNative(ands)));
1056 }

◆ MkAnd() [2/2]

BoolExpr MkAnd ( params BoolExpr[]  t)
inline

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

Definition at line 1037 of file Context.cs.

1038 {
1039 Debug.Assert(t != null);
1040 Debug.Assert(t.All(a => a != null));
1041
1042 CheckContextMatch<BoolExpr>(t);
1043 return new BoolExpr(this, Native.Z3_mk_and(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
1044 }

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

◆ MkApp() [1/2]

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

Create a new function application.

Definition at line 877 of file Context.cs.

878 {
879 Debug.Assert(f != null);
880 Debug.Assert(args == null || args.All(a => a != null));
881
882 CheckContextMatch(f);
883 CheckContextMatch(args);
884 return Expr.Create(this, f, args.ToArray());
885 }

◆ MkApp() [2/2]

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

Create a new function application.

Definition at line 864 of file Context.cs.

865 {
866 Debug.Assert(f != null);
867 Debug.Assert(args == null || args.All(a => a != null));
868
869 CheckContextMatch(f);
870 CheckContextMatch<Expr>(args);
871 return Expr.Create(this, f, args);
872 }

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

◆ MkArrayConst() [1/2]

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

Create an array constant.

Definition at line 2113 of file Context.cs.

2114 {
2115 Debug.Assert(domain != null);
2116 Debug.Assert(range != null);
2117
2118 using var symbol = MkSymbol(name);
2119 using var sort = MkArraySort(domain, range);
2120 return (ArrayExpr)MkConst(symbol, sort);
2121 }
Expr MkConst(Symbol name, Sort range)
Creates a new Constant of sort range and named name .
Definition: Context.cs:736
ArraySort MkArraySort(Sort domain, Sort range)
Create a new array sort.
Definition: Context.cs:274
IntSymbol MkSymbol(int i)
Creates a new symbol using an integer.
Definition: Context.cs:109
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3946

◆ MkArrayConst() [2/2]

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

Create an array constant.

Definition at line 2100 of file Context.cs.

2101 {
2102 Debug.Assert(name != null);
2103 Debug.Assert(domain != null);
2104 Debug.Assert(range != null);
2105
2106 using var sort = MkArraySort(domain, range);
2107 return (ArrayExpr)MkConst(name, sort);
2108 }

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

2290 {
2291 Debug.Assert(arg1 != null);
2292 Debug.Assert(arg2 != null);
2293
2294 CheckContextMatch(arg1);
2295 CheckContextMatch(arg2);
2296 return Expr.Create(this, Native.Z3_mk_array_ext(nCtx, arg1.NativeObject, arg2.NativeObject));
2297 }

◆ MkArraySort() [1/2]

ArraySort MkArraySort ( Sort  domain,
Sort  range 
)
inline

Create a new array sort.

Definition at line 274 of file Context.cs.

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

Referenced by Context.MkArrayConst().

◆ MkArraySort() [2/2]

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

Create a new n-ary array sort.

Definition at line 287 of file Context.cs.

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

◆ MkAt()

SeqExpr MkAt ( SeqExpr  s,
Expr  index 
)
inline

Retrieve sequence of length one at index.

Definition at line 2588 of file Context.cs.

2589 {
2590 Debug.Assert(s != null);
2591 Debug.Assert(index != null);
2592 CheckContextMatch(s, index);
2593 return new SeqExpr(this, Native.Z3_mk_seq_at(nCtx, s.NativeObject, index.NativeObject));
2594 }

◆ MkAtLeast()

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

Create an at-least-k constraint.

Definition at line 2853 of file Context.cs.

2854 {
2855 Debug.Assert(args != null);
2856 CheckContextMatch<BoolExpr>(args);
2857 var ts = args.ToArray();
2858 return new BoolExpr(this, Native.Z3_mk_atleast(nCtx, (uint)ts.Length,
2859 AST.ArrayToNative(ts), k));
2860 }

◆ MkAtMost()

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

Create an at-most-k constraint.

Definition at line 2841 of file Context.cs.

2842 {
2843 Debug.Assert(args != null);
2844 CheckContextMatch<BoolExpr>(args);
2845 var ts = args.ToArray();
2846 return new BoolExpr(this, Native.Z3_mk_atmost(nCtx, (uint)ts.Length,
2847 AST.ArrayToNative(ts), k));
2848 }

◆ MkBitVecSort()

BitVecSort MkBitVecSort ( uint  size)
inline

Create a new bit-vector sort.

Definition at line 248 of file Context.cs.

249 {
250 return new BitVecSort(this, Native.Z3_mk_bv_sort(nCtx, size));
251 }
def BitVecSort(sz, ctx=None)
Definition: z3py.py:3996

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

◆ MkBool()

BoolExpr MkBool ( bool  value)
inline

Creates a Boolean value.

Definition at line 909 of file Context.cs.

910 {
911
912 return value ? MkTrue() : MkFalse();
913 }
BoolExpr MkTrue()
The true Term.
Definition: Context.cs:891
BoolExpr MkFalse()
The false Term.
Definition: Context.cs:900

◆ MkBoolConst() [1/2]

BoolExpr MkBoolConst ( string  name)
inline

Create a Boolean constant.

Definition at line 794 of file Context.cs.

795 {
796 using var symbol = MkSymbol(name);
797 return (BoolExpr)MkConst(symbol, BoolSort);
798 }
BoolSort BoolSort
Retrieves the Boolean sort of the context.
Definition: Context.cs:145

◆ MkBoolConst() [2/2]

BoolExpr MkBoolConst ( Symbol  name)
inline

Create a Boolean constant.

Definition at line 784 of file Context.cs.

785 {
786 Debug.Assert(name != null);
787
788 return (BoolExpr)MkConst(name, BoolSort);
789 }

◆ MkBoolSort()

BoolSort MkBoolSort ( )
inline

Create a new Boolean sort.

Definition at line 203 of file Context.cs.

204 {
205 return new BoolSort(this);
206 }

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

710 {
711 Debug.Assert(ty != null);
712
713 return Expr.Create(this, Native.Z3_mk_bound(nCtx, index, ty.NativeObject));
714 }

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

3171 {
3172 byte[] _bits = new byte[bits.Length];
3173 for (int i = 0; i < bits.Length; ++i) _bits[i] = (byte)(bits[i] ? 1 : 0);
3174 return (BitVecNum)Expr.Create(this, Native.Z3_mk_bv_numeral(nCtx, (uint)bits.Length, _bits));
3175 }

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

3128 {
3129 using var sort = MkBitVecSort(size);
3130 return (BitVecNum)MkNumeral(v, sort);
3131 }
BitVecSort MkBitVecSort(uint size)
Create a new bit-vector sort.
Definition: Context.cs:248
Expr MkNumeral(string v, Sort ty)
Create a Term of a given sort.
Definition: Context.cs:2913

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

3150 {
3151 using var sort = MkBitVecSort(size);
3152 return (BitVecNum)MkNumeral(v, sort);
3153 }

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

3117 {
3118 using var sort = MkBitVecSort(size);
3119 return (BitVecNum)MkNumeral(v, sort);
3120 }

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

3139 {
3140 using var sort = MkBitVecSort(size);
3141 return (BitVecNum)MkNumeral(v, sort);
3142 }

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

3161 {
3162 using var sort = MkBitVecSort(size);
3163 return (BitVecNum)MkNumeral(v, sort);
3164 }

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

1962 {
1963 Debug.Assert(t != null);
1964
1965 CheckContextMatch(t);
1966 return new IntExpr(this, Native.Z3_mk_bv2int(nCtx, t.NativeObject, (byte)(signed ? 1 : 0)));
1967 }

◆ MkBVAdd()

BitVecExpr MkBVAdd ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement addition.

The arguments must have the same bit-vector sort.

Definition at line 1449 of file Context.cs.

1450 {
1451 Debug.Assert(t1 != null);
1452 Debug.Assert(t2 != null);
1453
1454 CheckContextMatch(t1);
1455 CheckContextMatch(t2);
1456 return new BitVecExpr(this, Native.Z3_mk_bvadd(nCtx, t1.NativeObject, t2.NativeObject));
1457 }

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

1976 {
1977 Debug.Assert(t1 != null);
1978 Debug.Assert(t2 != null);
1979
1980 CheckContextMatch(t1);
1981 CheckContextMatch(t2);
1982 return new BoolExpr(this, Native.Z3_mk_bvadd_no_overflow(nCtx, t1.NativeObject, t2.NativeObject, (byte)(isSigned ? 1 : 0)));
1983 }

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

1992 {
1993 Debug.Assert(t1 != null);
1994 Debug.Assert(t2 != null);
1995
1996 CheckContextMatch(t1);
1997 CheckContextMatch(t2);
1998 return new BoolExpr(this, Native.Z3_mk_bvadd_no_underflow(nCtx, t1.NativeObject, t2.NativeObject));
1999 }

◆ MkBVAND()

BitVecExpr MkBVAND ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise conjunction.

The arguments must have a bit-vector sort.

Definition at line 1353 of file Context.cs.

1354 {
1355 Debug.Assert(t1 != null);
1356 Debug.Assert(t2 != null);
1357
1358 CheckContextMatch(t1);
1359 CheckContextMatch(t2);
1360 return new BitVecExpr(this, Native.Z3_mk_bvand(nCtx, t1.NativeObject, t2.NativeObject));
1361 }

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

1855 {
1856 Debug.Assert(t1 != null);
1857 Debug.Assert(t2 != null);
1858
1859 CheckContextMatch(t1);
1860 CheckContextMatch(t2);
1861 return new BitVecExpr(this, Native.Z3_mk_bvashr(nCtx, t1.NativeObject, t2.NativeObject));
1862 }

◆ MkBVConst() [1/2]

BitVecExpr MkBVConst ( string  name,
uint  size 
)
inline

Creates a bit-vector constant.

Definition at line 853 of file Context.cs.

854 {
855 using var sort = MkBitVecSort(size);
856 return (BitVecExpr)MkConst(name, sort);
857 }

◆ MkBVConst() [2/2]

BitVecExpr MkBVConst ( Symbol  name,
uint  size 
)
inline

Creates a bit-vector constant.

Definition at line 842 of file Context.cs.

843 {
844 Debug.Assert(name != null);
845
846 using var sort = MkBitVecSort(size);
847 return (BitVecExpr)MkConst(name, sort);
848 }

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

1831 {
1832 Debug.Assert(t1 != null);
1833 Debug.Assert(t2 != null);
1834
1835 CheckContextMatch(t1);
1836 CheckContextMatch(t2);
1837 return new BitVecExpr(this, Native.Z3_mk_bvlshr(nCtx, t1.NativeObject, t2.NativeObject));
1838 }

◆ MkBVMul()

BitVecExpr MkBVMul ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement multiplication.

The arguments must have the same bit-vector sort.

Definition at line 1477 of file Context.cs.

1478 {
1479 Debug.Assert(t1 != null);
1480 Debug.Assert(t2 != null);
1481
1482 CheckContextMatch(t1);
1483 CheckContextMatch(t2);
1484 return new BitVecExpr(this, Native.Z3_mk_bvmul(nCtx, t1.NativeObject, t2.NativeObject));
1485 }

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

2070 {
2071 Debug.Assert(t1 != null);
2072 Debug.Assert(t2 != null);
2073
2074 CheckContextMatch(t1);
2075 CheckContextMatch(t2);
2076 return new BoolExpr(this, Native.Z3_mk_bvmul_no_overflow(nCtx, t1.NativeObject, t2.NativeObject, (byte)(isSigned ? 1 : 0)));
2077 }

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

2086 {
2087 Debug.Assert(t1 != null);
2088 Debug.Assert(t2 != null);
2089
2090 CheckContextMatch(t1);
2091 CheckContextMatch(t2);
2092 return new BoolExpr(this, Native.Z3_mk_bvmul_no_underflow(nCtx, t1.NativeObject, t2.NativeObject));
2093 }

◆ MkBVNAND()

BitVecExpr MkBVNAND ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise NAND.

The arguments must have a bit-vector sort.

Definition at line 1395 of file Context.cs.

1396 {
1397 Debug.Assert(t1 != null);
1398 Debug.Assert(t2 != null);
1399
1400 CheckContextMatch(t1);
1401 CheckContextMatch(t2);
1402 return new BitVecExpr(this, Native.Z3_mk_bvnand(nCtx, t1.NativeObject, t2.NativeObject));
1403 }

◆ MkBVNeg()

BitVecExpr MkBVNeg ( BitVecExpr  t)
inline

Standard two's complement unary minus.

The arguments must have a bit-vector sort.

Definition at line 1437 of file Context.cs.

1438 {
1439 Debug.Assert(t != null);
1440
1441 CheckContextMatch(t);
1442 return new BitVecExpr(this, Native.Z3_mk_bvneg(nCtx, t.NativeObject));
1443 }

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

2056 {
2057 Debug.Assert(t != null);
2058
2059 CheckContextMatch(t);
2060 return new BoolExpr(this, Native.Z3_mk_bvneg_no_overflow(nCtx, t.NativeObject));
2061 }

◆ MkBVNOR()

BitVecExpr MkBVNOR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise NOR.

The arguments must have a bit-vector sort.

Definition at line 1409 of file Context.cs.

1410 {
1411 Debug.Assert(t1 != null);
1412 Debug.Assert(t2 != null);
1413
1414 CheckContextMatch(t1);
1415 CheckContextMatch(t2);
1416 return new BitVecExpr(this, Native.Z3_mk_bvnor(nCtx, t1.NativeObject, t2.NativeObject));
1417 }

◆ MkBVNot()

BitVecExpr MkBVNot ( BitVecExpr  t)
inline

Bitwise negation.

The argument must have a bit-vector sort.

Definition at line 1317 of file Context.cs.

1318 {
1319 Debug.Assert(t != null);
1320
1321 CheckContextMatch(t);
1322 return new BitVecExpr(this, Native.Z3_mk_bvnot(nCtx, t.NativeObject));
1323 }

◆ MkBVOR()

BitVecExpr MkBVOR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise disjunction.

The arguments must have a bit-vector sort.

Definition at line 1367 of file Context.cs.

1368 {
1369 Debug.Assert(t1 != null);
1370 Debug.Assert(t2 != null);
1371
1372 CheckContextMatch(t1);
1373 CheckContextMatch(t2);
1374 return new BitVecExpr(this, Native.Z3_mk_bvor(nCtx, t1.NativeObject, t2.NativeObject));
1375 }

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

1330 {
1331 Debug.Assert(t != null);
1332
1333 CheckContextMatch(t);
1334 return new BitVecExpr(this, Native.Z3_mk_bvredand(nCtx, t.NativeObject));
1335 }

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

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

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

1902 {
1903 Debug.Assert(t1 != null);
1904 Debug.Assert(t2 != null);
1905
1906 CheckContextMatch(t1);
1907 CheckContextMatch(t2);
1908 return new BitVecExpr(this, Native.Z3_mk_ext_rotate_left(nCtx, t1.NativeObject, t2.NativeObject));
1909 }

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

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

◆ 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 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_ext_rotate_right(nCtx, t1.NativeObject, t2.NativeObject));
1926 }

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

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

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

1520 {
1521 Debug.Assert(t1 != null);
1522 Debug.Assert(t2 != null);
1523
1524 CheckContextMatch(t1);
1525 CheckContextMatch(t2);
1526 return new BitVecExpr(this, Native.Z3_mk_bvsdiv(nCtx, t1.NativeObject, t2.NativeObject));
1527 }

◆ 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 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_bvsdiv_no_overflow(nCtx, t1.NativeObject, t2.NativeObject));
2047 }

◆ 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 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_bvsge(nCtx, t1.NativeObject, t2.NativeObject));
1678 }

◆ 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 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_bvsgt(nCtx, t1.NativeObject, t2.NativeObject));
1710 }

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

1809 {
1810 Debug.Assert(t1 != null);
1811 Debug.Assert(t2 != null);
1812
1813 CheckContextMatch(t1);
1814 CheckContextMatch(t2);
1815 return new BitVecExpr(this, Native.Z3_mk_bvshl(nCtx, t1.NativeObject, t2.NativeObject));
1816 }

◆ 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 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 BoolExpr(this, Native.Z3_mk_bvsle(nCtx, t1.NativeObject, t2.NativeObject));
1646 }

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

1607 {
1608 Debug.Assert(t1 != null);
1609 Debug.Assert(t2 != null);
1610
1611 CheckContextMatch(t1);
1612 CheckContextMatch(t2);
1613 return new BoolExpr(this, Native.Z3_mk_bvslt(nCtx, t1.NativeObject, t2.NativeObject));
1614 }

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

1575 {
1576 Debug.Assert(t1 != null);
1577 Debug.Assert(t2 != null);
1578
1579 CheckContextMatch(t1);
1580 CheckContextMatch(t2);
1581 return new BitVecExpr(this, Native.Z3_mk_bvsmod(nCtx, t1.NativeObject, t2.NativeObject));
1582 }

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

1558 {
1559 Debug.Assert(t1 != null);
1560 Debug.Assert(t2 != null);
1561
1562 CheckContextMatch(t1);
1563 CheckContextMatch(t2);
1564 return new BitVecExpr(this, Native.Z3_mk_bvsrem(nCtx, t1.NativeObject, t2.NativeObject));
1565 }

◆ MkBVSub()

BitVecExpr MkBVSub ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Two's complement subtraction.

The arguments must have the same bit-vector sort.

Definition at line 1463 of file Context.cs.

1464 {
1465 Debug.Assert(t1 != null);
1466 Debug.Assert(t2 != null);
1467
1468 CheckContextMatch(t1);
1469 CheckContextMatch(t2);
1470 return new BitVecExpr(this, Native.Z3_mk_bvsub(nCtx, t1.NativeObject, t2.NativeObject));
1471 }

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

2008 {
2009 Debug.Assert(t1 != null);
2010 Debug.Assert(t2 != null);
2011
2012 CheckContextMatch(t1);
2013 CheckContextMatch(t2);
2014 return new BoolExpr(this, Native.Z3_mk_bvsub_no_overflow(nCtx, t1.NativeObject, t2.NativeObject));
2015 }

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

2024 {
2025 Debug.Assert(t1 != null);
2026 Debug.Assert(t2 != null);
2027
2028 CheckContextMatch(t1);
2029 CheckContextMatch(t2);
2030 return new BoolExpr(this, Native.Z3_mk_bvsub_no_underflow(nCtx, t1.NativeObject, t2.NativeObject, (byte)(isSigned ? 1 : 0)));
2031 }

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

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

◆ 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 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_bvuge(nCtx, t1.NativeObject, t2.NativeObject));
1662 }

◆ MkBVUGT()

BoolExpr MkBVUGT ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Unsigned greater-than.

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_bvugt(nCtx, t1.NativeObject, t2.NativeObject));
1694 }

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

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

◆ MkBVULT()

BoolExpr MkBVULT ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Unsigned less-than

The arguments must have the same bit-vector sort.

Definition at line 1590 of file Context.cs.

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

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

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

◆ MkBVXNOR()

BitVecExpr MkBVXNOR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise XNOR.

The arguments must have a bit-vector sort.

Definition at line 1423 of file Context.cs.

1424 {
1425 Debug.Assert(t1 != null);
1426 Debug.Assert(t2 != null);
1427
1428 CheckContextMatch(t1);
1429 CheckContextMatch(t2);
1430 return new BitVecExpr(this, Native.Z3_mk_bvxnor(nCtx, t1.NativeObject, t2.NativeObject));
1431 }

◆ MkBVXOR()

BitVecExpr MkBVXOR ( BitVecExpr  t1,
BitVecExpr  t2 
)
inline

Bitwise XOR.

The arguments must have a bit-vector sort.

Definition at line 1381 of file Context.cs.

1382 {
1383 Debug.Assert(t1 != null);
1384 Debug.Assert(t2 != null);
1385
1386 CheckContextMatch(t1);
1387 CheckContextMatch(t2);
1388 return new BitVecExpr(this, Native.Z3_mk_bvxor(nCtx, t1.NativeObject, t2.NativeObject));
1389 }

◆ MkCharLe()

BoolExpr MkCharLe ( Expr  ch1,
Expr  ch2 
)
inline

Create less than or equal to between two characters.

Definition at line 2791 of file Context.cs.

2792 {
2793 Debug.Assert(ch1 != null);
2794 Debug.Assert(ch2 != null);
2795 return new BoolExpr(this, Native.Z3_mk_char_le(nCtx, ch1.NativeObject, ch2.NativeObject));
2796 }

◆ MkComplement()

ReExpr MkComplement ( ReExpr  re)
inline

Create the complement regular expression.

Definition at line 2703 of file Context.cs.

2704 {
2705 Debug.Assert(re != null);
2706 return new ReExpr(this, Native.Z3_mk_re_complement(nCtx, re.NativeObject));
2707 }

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

1723 {
1724 Debug.Assert(t1 != null);
1725 Debug.Assert(t2 != null);
1726
1727 CheckContextMatch(t1);
1728 CheckContextMatch(t2);
1729 return new BitVecExpr(this, Native.Z3_mk_concat(nCtx, t1.NativeObject, t2.NativeObject));
1730 }

◆ MkConcat() [2/3]

ReExpr MkConcat ( params ReExpr[]  t)
inline

Create the concatenation of regular languages.

Definition at line 2712 of file Context.cs.

2713 {
2714 Debug.Assert(t != null);
2715 Debug.Assert(t.All(a => a != null));
2716
2717 CheckContextMatch<ReExpr>(t);
2718 return new ReExpr(this, Native.Z3_mk_re_concat(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
2719 }

◆ MkConcat() [3/3]

SeqExpr MkConcat ( params SeqExpr[]  t)
inline

Concatenate sequences.

Definition at line 2511 of file Context.cs.

2512 {
2513 Debug.Assert(t != null);
2514 Debug.Assert(t.All(a => a != null));
2515
2516 CheckContextMatch<SeqExpr>(t);
2517 return new SeqExpr(this, Native.Z3_mk_seq_concat(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
2518 }

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

775 {
776 Debug.Assert(f != null);
777
778 return MkApp(f);
779 }
Expr MkApp(FuncDecl f, params Expr[] args)
Create a new function application.
Definition: Context.cs:864

◆ MkConst() [2/3]

Expr MkConst ( string  name,
Sort  range 
)
inline

Creates a new Constant of sort range and named name .

Definition at line 750 of file Context.cs.

751 {
752 Debug.Assert(range != null);
753
754 using var symbol = MkSymbol(name);
755 return MkConst(symbol, range);
756 }

◆ MkConst() [3/3]

Expr MkConst ( Symbol  name,
Sort  range 
)
inline

Creates a new Constant of sort range and named name .

Definition at line 736 of file Context.cs.

737 {
738 Debug.Assert(name != null);
739 Debug.Assert(range != null);
740
741 CheckContextMatch(name);
742 CheckContextMatch(range);
743
744 return Expr.Create(this, Native.Z3_mk_const(nCtx, name.NativeObject, range.NativeObject));
745 }

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

2241 {
2242 Debug.Assert(domain != null);
2243 Debug.Assert(v != null);
2244
2245 CheckContextMatch(domain);
2246 CheckContextMatch(v);
2247 return new ArrayExpr(this, Native.Z3_mk_const_array(nCtx, domain.NativeObject, v.NativeObject));
2248 }

◆ MkConstDecl() [1/2]

FuncDecl MkConstDecl ( string  name,
Sort  range 
)
inline

Creates a new constant function declaration.

Definition at line 670 of file Context.cs.

671 {
672 Debug.Assert(range != null);
673
674 CheckContextMatch(range);
675 using var symbol = MkSymbol(name);
676 return new FuncDecl(this, symbol, null, range);
677 }

◆ MkConstDecl() [2/2]

FuncDecl MkConstDecl ( Symbol  name,
Sort  range 
)
inline

Creates a new constant function declaration.

Definition at line 657 of file Context.cs.

658 {
659 Debug.Assert(name != null);
660 Debug.Assert(range != null);
661
662 CheckContextMatch(name);
663 CheckContextMatch(range);
664 return new FuncDecl(this, name, null, range);
665 }

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

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

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

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

◆ MkContains()

BoolExpr MkContains ( SeqExpr  s1,
SeqExpr  s2 
)
inline

Check for sequence containment of s2 in s1.

Definition at line 2555 of file Context.cs.

2556 {
2557 Debug.Assert(s1 != null);
2558 Debug.Assert(s2 != null);
2559 CheckContextMatch(s1, s2);
2560 return new BoolExpr(this, Native.Z3_mk_seq_contains(nCtx, s1.NativeObject, s2.NativeObject));
2561 }

◆ MkDatatypeSort() [1/2]

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

Create a new datatype sort.

Definition at line 465 of file Context.cs.

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

◆ MkDatatypeSort() [2/2]

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

Create a new datatype sort.

Definition at line 450 of file Context.cs.

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

◆ MkDatatypeSorts() [1/2]

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

Create mutually recursive data-types.

Parameters
names
c
Returns

Definition at line 513 of file Context.cs.

514 {
515 Debug.Assert(names != null);
516 Debug.Assert(c != null);
517 Debug.Assert(names.Length == c.Length);
518 //Debug.Assert(Contract.ForAll(0, c.Length, j => c[j] != null));
519 //Debug.Assert(names.All(name => name != null));
520
521 var symbols = MkSymbols(names);
522 try
523 {
524 return MkDatatypeSorts(symbols, c);
525 }
526 finally
527 {
528 foreach (var symbol in symbols)
529 symbol.Dispose();
530 }
531 }
DatatypeSort[] MkDatatypeSorts(Symbol[] names, Constructor[][] c)
Create mutually recursive datatypes.
Definition: Context.cs:480

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

481 {
482 Debug.Assert(names != null);
483 Debug.Assert(c != null);
484 Debug.Assert(names.Length == c.Length);
485 //Debug.Assert(Contract.ForAll(0, c.Length, j => c[j] != null));
486 Debug.Assert(names.All(name => name != null));
487
488 CheckContextMatch<Symbol>(names);
489 uint n = (uint)names.Length;
490 ConstructorList[] cla = new ConstructorList[n];
491 IntPtr[] n_constr = new IntPtr[n];
492 for (uint i = 0; i < n; i++)
493 {
494 Constructor[] constructor = c[i];
495 CheckContextMatch<Constructor>(constructor);
496 cla[i] = new ConstructorList(this, constructor);
497 n_constr[i] = cla[i].NativeObject;
498 }
499 IntPtr[] n_res = new IntPtr[n];
500 Native.Z3_mk_datatypes(nCtx, n, Symbol.ArrayToNative(names), n_res, n_constr);
501 DatatypeSort[] res = new DatatypeSort[n];
502 for (uint i = 0; i < n; i++)
503 res[i] = new DatatypeSort(this, n_res[i]);
504 return res;
505 }

Referenced by Context.MkDatatypeSorts().

◆ MkDiff()

ReExpr MkDiff ( ReExpr  a,
ReExpr  b 
)
inline

Create a difference regular expression.

Definition at line 2748 of file Context.cs.

2749 {
2750 Debug.Assert(a != null);
2751 Debug.Assert(b != null);
2752 CheckContextMatch(a, b);
2753 return new ReExpr(this, Native.Z3_mk_re_diff(nCtx, a.NativeObject, b.NativeObject));
2754 }

◆ MkDistinct() [1/2]

BoolExpr MkDistinct ( IEnumerable< Expr args)
inline

Creates a distinct term.

Definition at line 944 of file Context.cs.

945 {
946 Debug.Assert(args != null);
947 return MkDistinct(args.ToArray());
948 }
BoolExpr MkDistinct(params Expr[] args)
Creates a distinct term.
Definition: Context.cs:931

◆ MkDistinct() [2/2]

BoolExpr MkDistinct ( params Expr[]  args)
inline

Creates a distinct term.

Definition at line 931 of file Context.cs.

932 {
933 Debug.Assert(args != null);
934 Debug.Assert(args.All(a => a != null));
935
936
937 CheckContextMatch<Expr>(args);
938 return new BoolExpr(this, Native.Z3_mk_distinct(nCtx, (uint)args.Length, AST.ArrayToNative(args)));
939 }

Referenced by Context.MkDistinct().

◆ MkDiv()

ArithExpr MkDiv ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 / t2.

Definition at line 1164 of file Context.cs.

1165 {
1166 Debug.Assert(t1 != null);
1167 Debug.Assert(t2 != null);
1168
1169 CheckContextMatch(t1);
1170 CheckContextMatch(t2);
1171 return (ArithExpr)Expr.Create(this, Native.Z3_mk_div(nCtx, t1.NativeObject, t2.NativeObject));
1172 }

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

2761 {
2762 Debug.Assert(s != null);
2763 return new ReExpr(this, Native.Z3_mk_re_empty(nCtx, s.NativeObject));
2764 }

◆ MkEmptySeq()

SeqExpr MkEmptySeq ( Sort  s)
inline

Create the empty sequence.

Definition at line 2443 of file Context.cs.

2444 {
2445 Debug.Assert(s != null);
2446 return new SeqExpr(this, Native.Z3_mk_seq_empty(nCtx, s.NativeObject));
2447 }

◆ MkEmptySet()

ArrayExpr MkEmptySet ( Sort  domain)
inline

Create an empty set.

Definition at line 2316 of file Context.cs.

2317 {
2318 Debug.Assert(domain != null);
2319
2320 CheckContextMatch(domain);
2321 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_empty_set(nCtx, domain.NativeObject));
2322 }

◆ MkEnumSort() [1/2]

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

Create a new enumeration sort.

Definition at line 331 of file Context.cs.

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

◆ MkEnumSort() [2/2]

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

Create a new enumeration sort.

Definition at line 316 of file Context.cs.

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

◆ MkEq()

BoolExpr MkEq ( Expr  x,
Expr  y 
)
inline

Creates the equality x = y .

Definition at line 918 of file Context.cs.

919 {
920 Debug.Assert(x != null);
921 Debug.Assert(y != null);
922
923 CheckContextMatch(x);
924 CheckContextMatch(y);
925 return new BoolExpr(this, Native.Z3_mk_eq(nCtx, x.NativeObject, y.NativeObject));
926 }

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

3272 {
3273 Debug.Assert(body != null);
3274 Debug.Assert(boundConstants == null || boundConstants.All(n => n != null));
3275 Debug.Assert(patterns == null || patterns.All(p => p != null));
3276 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3277
3278 return new Quantifier(this, false, boundConstants, body, weight, patterns, noPatterns, quantifierID, skolemID);
3279 }

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

3250 {
3251 Debug.Assert(sorts != null);
3252 Debug.Assert(names != null);
3253 Debug.Assert(body != null);
3254 Debug.Assert(sorts.Length == names.Length);
3255 Debug.Assert(sorts.All(s => s != null));
3256 Debug.Assert(names.All(n => n != null));
3257 Debug.Assert(patterns == null || patterns.All(p => p != null));
3258 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3259
3260 return new Quantifier(this, false, sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
3261 }

Referenced by Context.MkQuantifier().

◆ MkExtract() [1/2]

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

Extract subsequence.

Definition at line 2610 of file Context.cs.

2611 {
2612 Debug.Assert(s != null);
2613 Debug.Assert(offset != null);
2614 Debug.Assert(length != null);
2615 CheckContextMatch(s, offset, length);
2616 return new SeqExpr(this, Native.Z3_mk_seq_extract(nCtx, s.NativeObject, offset.NativeObject, length.NativeObject));
2617 }

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

1742 {
1743 Debug.Assert(t != null);
1744
1745 CheckContextMatch(t);
1746 return new BitVecExpr(this, Native.Z3_mk_extract(nCtx, high, low, t.NativeObject));
1747 }

◆ MkFalse()

BoolExpr MkFalse ( )
inline

The false Term.

Definition at line 900 of file Context.cs.

901 {
902
903 return new BoolExpr(this, Native.Z3_mk_false(nCtx));
904 }

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

396 {
397 using var symbol = MkSymbol(name);
398 return new FiniteDomainSort(this, symbol, size);
399 }
def FiniteDomainSort(name, sz, ctx=None)
Definition: z3py.py:7691

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

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

◆ MkFixedpoint()

Fixedpoint MkFixedpoint ( )
inline

Create a Fixedpoint context.

Definition at line 3946 of file Context.cs.

3947 {
3948
3949 return new Fixedpoint(this);
3950 }

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

3232 {
3233 Debug.Assert(body != null);
3234 Debug.Assert(boundConstants == null || boundConstants.All(b => b != null));
3235 Debug.Assert(patterns == null || patterns.All(p => p != null));
3236 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3237
3238
3239 return new Quantifier(this, true, boundConstants, body, weight, patterns, noPatterns, quantifierID, skolemID);
3240 }

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

3208 {
3209 Debug.Assert(sorts != null);
3210 Debug.Assert(names != null);
3211 Debug.Assert(body != null);
3212 Debug.Assert(sorts.Length == names.Length);
3213 Debug.Assert(sorts.All(s => s != null));
3214 Debug.Assert(names.All(n => n != null));
3215 Debug.Assert(patterns == null || patterns.All(p => p != null));
3216 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3217
3218
3219 return new Quantifier(this, true, sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
3220 }

Referenced by 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 4536 of file Context.cs.

4537 {
4538 return new FPExpr(this, Native.Z3_mk_fpa_fp(this.nCtx, sgn.NativeObject, sig.NativeObject, exp.NativeObject));
4539 }

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

4258 {
4259 return MkFPNumeral(sgn, exp, sig, s);
4260 }
FPNum MkFPNumeral(float v, FPSort s)
Create a numeral of FloatingPoint sort from a float.
Definition: Context.cs:4171

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

4270 {
4271 return MkFPNumeral(sgn, exp, sig, s);
4272 }

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

4236 {
4237 return MkFPNumeral(v, s);
4238 }

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

4226 {
4227 return MkFPNumeral(v, s);
4228 }

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

4246 {
4247 return MkFPNumeral(v, s);
4248 }

◆ MkFPAbs()

FPExpr MkFPAbs ( FPExpr  t)
inline

Floating-point absolute value

Parameters
tfloating-point term

Definition at line 4281 of file Context.cs.

4282 {
4283 return new FPExpr(this, Native.Z3_mk_fpa_abs(this.nCtx, t.NativeObject));
4284 }

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

4302 {
4303 return new FPExpr(this, Native.Z3_mk_fpa_add(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject));
4304 }

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

4335 {
4336 return new FPExpr(this, Native.Z3_mk_fpa_div(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject));
4337 }

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

4454 {
4455 return new BoolExpr(this, Native.Z3_mk_fpa_eq(this.nCtx, t1.NativeObject, t2.NativeObject));
4456 }

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

4350 {
4351 return new FPExpr(this, Native.Z3_mk_fpa_fma(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject, t3.NativeObject));
4352 }

◆ MkFPGEq()

BoolExpr MkFPGEq ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point greater than or equal.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4430 of file Context.cs.

4431 {
4432 return new BoolExpr(this, Native.Z3_mk_fpa_geq(this.nCtx, t1.NativeObject, t2.NativeObject));
4433 }

◆ MkFPGt()

BoolExpr MkFPGt ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point greater than.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4440 of file Context.cs.

4441 {
4442 return new BoolExpr(this, Native.Z3_mk_fpa_gt(this.nCtx, t1.NativeObject, t2.NativeObject));
4443 }

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

4152 {
4153 return new FPNum(this, Native.Z3_mk_fpa_inf(nCtx, s.NativeObject, (byte)(negative ? 1 : 0)));
4154 }

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

4490 {
4491 return new BoolExpr(this, Native.Z3_mk_fpa_is_infinite(this.nCtx, t.NativeObject));
4492 }

◆ MkFPIsNaN()

BoolExpr MkFPIsNaN ( FPExpr  t)
inline

Predicate indicating whether t is a NaN.

Parameters
tfloating-point term

Definition at line 4498 of file Context.cs.

4499 {
4500 return new BoolExpr(this, Native.Z3_mk_fpa_is_nan(this.nCtx, t.NativeObject));
4501 }

◆ MkFPIsNegative()

BoolExpr MkFPIsNegative ( FPExpr  t)
inline

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

Parameters
tfloating-point term

Definition at line 4507 of file Context.cs.

4508 {
4509 return new BoolExpr(this, Native.Z3_mk_fpa_is_negative(this.nCtx, t.NativeObject));
4510 }

◆ MkFPIsNormal()

BoolExpr MkFPIsNormal ( FPExpr  t)
inline

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

Parameters
tfloating-point term

Definition at line 4462 of file Context.cs.

4463 {
4464 return new BoolExpr(this, Native.Z3_mk_fpa_is_normal(this.nCtx, t.NativeObject));
4465 }

◆ MkFPIsPositive()

BoolExpr MkFPIsPositive ( FPExpr  t)
inline

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

Parameters
tfloating-point term

Definition at line 4516 of file Context.cs.

4517 {
4518 return new BoolExpr(this, Native.Z3_mk_fpa_is_positive(this.nCtx, t.NativeObject));
4519 }

◆ MkFPIsSubnormal()

BoolExpr MkFPIsSubnormal ( FPExpr  t)
inline

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

Parameters
tfloating-point term

Definition at line 4471 of file Context.cs.

4472 {
4473 return new BoolExpr(this, Native.Z3_mk_fpa_is_subnormal(this.nCtx, t.NativeObject));
4474 }

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

4481 {
4482 return new BoolExpr(this, Native.Z3_mk_fpa_is_zero(this.nCtx, t.NativeObject));
4483 }

◆ MkFPLEq()

BoolExpr MkFPLEq ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point less than or equal.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4410 of file Context.cs.

4411 {
4412 return new BoolExpr(this, Native.Z3_mk_fpa_leq(this.nCtx, t1.NativeObject, t2.NativeObject));
4413 }

◆ MkFPLt()

BoolExpr MkFPLt ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point less than.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4420 of file Context.cs.

4421 {
4422 return new BoolExpr(this, Native.Z3_mk_fpa_lt(this.nCtx, t1.NativeObject, t2.NativeObject));
4423 }

◆ MkFPMax()

FPExpr MkFPMax ( FPExpr  t1,
FPExpr  t2 
)
inline

Maximum of floating-point numbers.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4400 of file Context.cs.

4401 {
4402 return new FPExpr(this, Native.Z3_mk_fpa_max(this.nCtx, t1.NativeObject, t2.NativeObject));
4403 }

◆ MkFPMin()

FPExpr MkFPMin ( FPExpr  t1,
FPExpr  t2 
)
inline

Minimum of floating-point numbers.

Parameters
t1floating-point term
t2floating-point term

Definition at line 4390 of file Context.cs.

4391 {
4392 return new FPExpr(this, Native.Z3_mk_fpa_min(this.nCtx, t1.NativeObject, t2.NativeObject));
4393 }

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

4324 {
4325 return new FPExpr(this, Native.Z3_mk_fpa_mul(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject));
4326 }

◆ MkFPNaN()

FPNum MkFPNaN ( FPSort  s)
inline

Create a NaN of sort s.

Parameters
sFloatingPoint sort.

Definition at line 4141 of file Context.cs.

4142 {
4143 return new FPNum(this, Native.Z3_mk_fpa_nan(nCtx, s.NativeObject));
4144 }

◆ MkFPNeg()

FPExpr MkFPNeg ( FPExpr  t)
inline

Floating-point negation

Parameters
tfloating-point term

Definition at line 4290 of file Context.cs.

4291 {
4292 return new FPExpr(this, Native.Z3_mk_fpa_neg(this.nCtx, t.NativeObject));
4293 }

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

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

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

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

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

4182 {
4183 return new FPNum(this, Native.Z3_mk_fpa_numeral_double(nCtx, v, s.NativeObject));
4184 }

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

4172 {
4173 return new FPNum(this, Native.Z3_mk_fpa_numeral_float(nCtx, v, s.NativeObject));
4174 }

Referenced by 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 4191 of file Context.cs.

4192 {
4193 return new FPNum(this, Native.Z3_mk_fpa_numeral_int(nCtx, v, s.NativeObject));
4194 }

◆ MkFPRem()

FPExpr MkFPRem ( FPExpr  t1,
FPExpr  t2 
)
inline

Floating-point remainder

Parameters
t1floating-point term
t2floating-point term

Definition at line 4369 of file Context.cs.

4370 {
4371 return new FPExpr(this, Native.Z3_mk_fpa_rem(this.nCtx, t1.NativeObject, t2.NativeObject));
4372 }

◆ MkFPRNA()

FPRMNum MkFPRNA ( )
inline

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

Definition at line 4005 of file Context.cs.

4006 {
4007 return new FPRMNum(this, Native.Z3_mk_fpa_rna(nCtx));
4008 }

◆ MkFPRNE()

FPRMNum MkFPRNE ( )
inline

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

Definition at line 3989 of file Context.cs.

3990 {
3991 return new FPRMNum(this, Native.Z3_mk_fpa_rne(nCtx));
3992 }

◆ MkFPRoundingModeSort()

FPRMSort MkFPRoundingModeSort ( )
inline

Create the floating-point RoundingMode sort.

Definition at line 3971 of file Context.cs.

3972 {
3973 return new FPRMSort(this);
3974 }

◆ MkFPRoundNearestTiesToAway()

FPRMNum MkFPRoundNearestTiesToAway ( )
inline

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

Definition at line 3997 of file Context.cs.

3998 {
3999 return new FPRMNum(this, Native.Z3_mk_fpa_round_nearest_ties_to_away(nCtx));
4000 }

◆ MkFPRoundNearestTiesToEven()

FPRMExpr MkFPRoundNearestTiesToEven ( )
inline

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

Definition at line 3981 of file Context.cs.

3982 {
3983 return new FPRMExpr(this, Native.Z3_mk_fpa_round_nearest_ties_to_even(nCtx));
3984 }

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

4381 {
4382 return new FPExpr(this, Native.Z3_mk_fpa_round_to_integral(this.nCtx, rm.NativeObject, t.NativeObject));
4383 }

◆ MkFPRoundTowardNegative()

FPRMNum MkFPRoundTowardNegative ( )
inline

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

Definition at line 4029 of file Context.cs.

4030 {
4031 return new FPRMNum(this, Native.Z3_mk_fpa_round_toward_negative(nCtx));
4032 }

◆ MkFPRoundTowardPositive()

FPRMNum MkFPRoundTowardPositive ( )
inline

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

Definition at line 4013 of file Context.cs.

4014 {
4015 return new FPRMNum(this, Native.Z3_mk_fpa_round_toward_positive(nCtx));
4016 }

◆ MkFPRoundTowardZero()

FPRMNum MkFPRoundTowardZero ( )
inline

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

Definition at line 4045 of file Context.cs.

4046 {
4047 return new FPRMNum(this, Native.Z3_mk_fpa_round_toward_zero(nCtx));
4048 }

◆ MkFPRTN()

FPRMNum MkFPRTN ( )
inline

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

Definition at line 4037 of file Context.cs.

4038 {
4039 return new FPRMNum(this, Native.Z3_mk_fpa_rtn(nCtx));
4040 }

◆ MkFPRTP()

FPRMNum MkFPRTP ( )
inline

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

Definition at line 4021 of file Context.cs.

4022 {
4023 return new FPRMNum(this, Native.Z3_mk_fpa_rtp(nCtx));
4024 }

◆ MkFPRTZ()

FPRMNum MkFPRTZ ( )
inline

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

Definition at line 4053 of file Context.cs.

4054 {
4055 return new FPRMNum(this, Native.Z3_mk_fpa_rtz(nCtx));
4056 }

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

4067 {
4068 return new FPSort(this, ebits, sbits);
4069 }
def FPSort(ebits, sbits, ctx=None)
Definition: z3py.py:9876

◆ MkFPSort128()

FPSort MkFPSort128 ( )
inline

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

Definition at line 4130 of file Context.cs.

4131 {
4132 return new FPSort(this, Native.Z3_mk_fpa_sort_128(nCtx));
4133 }

◆ MkFPSort16()

FPSort MkFPSort16 ( )
inline

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

Definition at line 4082 of file Context.cs.

4083 {
4084 return new FPSort(this, Native.Z3_mk_fpa_sort_16(nCtx));
4085 }

◆ MkFPSort32()

FPSort MkFPSort32 ( )
inline

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

Definition at line 4098 of file Context.cs.

4099 {
4100 return new FPSort(this, Native.Z3_mk_fpa_sort_32(nCtx));
4101 }

◆ MkFPSort64()

FPSort MkFPSort64 ( )
inline

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

Definition at line 4114 of file Context.cs.

4115 {
4116 return new FPSort(this, Native.Z3_mk_fpa_sort_64(nCtx));
4117 }

◆ MkFPSortDouble()

FPSort MkFPSortDouble ( )
inline

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

Definition at line 4106 of file Context.cs.

4107 {
4108 return new FPSort(this, Native.Z3_mk_fpa_sort_double(nCtx));
4109 }

◆ MkFPSortHalf()

FPSort MkFPSortHalf ( )
inline

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

Definition at line 4074 of file Context.cs.

4075 {
4076 return new FPSort(this, Native.Z3_mk_fpa_sort_half(nCtx));
4077 }

◆ MkFPSortQuadruple()

FPSort MkFPSortQuadruple ( )
inline

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

Definition at line 4122 of file Context.cs.

4123 {
4124 return new FPSort(this, Native.Z3_mk_fpa_sort_quadruple(nCtx));
4125 }

◆ MkFPSortSingle()

FPSort MkFPSortSingle ( )
inline

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

Definition at line 4090 of file Context.cs.

4091 {
4092 return new FPSort(this, Native.Z3_mk_fpa_sort_single(nCtx));
4093 }

◆ MkFPSqrt()

FPExpr MkFPSqrt ( FPRMExpr  rm,
FPExpr  t 
)
inline

Floating-point square root

Parameters
rmrounding mode term
tfloating-point term

Definition at line 4359 of file Context.cs.

4360 {
4361 return new FPExpr(this, Native.Z3_mk_fpa_sqrt(this.nCtx, rm.NativeObject, t.NativeObject));
4362 }

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

4313 {
4314 return new FPExpr(this, Native.Z3_mk_fpa_sub(this.nCtx, rm.NativeObject, t1.NativeObject, t2.NativeObject));
4315 }

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

4640 {
4641 if (sign)
4642 return new BitVecExpr(this, Native.Z3_mk_fpa_to_sbv(this.nCtx, rm.NativeObject, t.NativeObject, sz));
4643 else
4644 return new BitVecExpr(this, Native.Z3_mk_fpa_to_ubv(this.nCtx, rm.NativeObject, t.NativeObject, sz));
4645 }

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

4553 {
4554 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_bv(this.nCtx, bv.NativeObject, s.NativeObject));
4555 }

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

4603 {
4604 if (signed)
4605 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_signed(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject));
4606 else
4607 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_unsigned(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject));
4608 }

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

4569 {
4570 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_float(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject));
4571 }

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

4691 {
4692 return new BitVecExpr(this, Native.Z3_mk_fpa_to_fp_int_real(this.nCtx, rm.NativeObject, exp.NativeObject, sig.NativeObject, s.NativeObject));
4693 }

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

4585 {
4586 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_real(this.nCtx, rm.NativeObject, t.NativeObject, s.NativeObject));
4587 }

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

4621 {
4622 return new FPExpr(this, Native.Z3_mk_fpa_to_fp_float(this.nCtx, s.NativeObject, rm.NativeObject, t.NativeObject));
4623 }

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

4674 {
4675 return new BitVecExpr(this, Native.Z3_mk_fpa_to_ieee_bv(this.nCtx, t.NativeObject));
4676 }

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

4657 {
4658 return new RealExpr(this, Native.Z3_mk_fpa_to_real(this.nCtx, t.NativeObject));
4659 }

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

4162 {
4163 return new FPNum(this, Native.Z3_mk_fpa_zero(nCtx, s.NativeObject, (byte)(negative ? 1 : 0)));
4164 }

◆ MkFreshConst()

Expr MkFreshConst ( string  prefix,
Sort  range 
)
inline

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

Definition at line 762 of file Context.cs.

763 {
764 Debug.Assert(range != null);
765
766 CheckContextMatch(range);
767 return Expr.Create(this, Native.Z3_mk_fresh_const(nCtx, prefix, range.NativeObject));
768 }

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

685 {
686 Debug.Assert(range != null);
687
688 CheckContextMatch(range);
689 return new FuncDecl(this, prefix, null, range);
690 }

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

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

◆ MkFullRe()

ReExpr MkFullRe ( Sort  s)
inline

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

Definition at line 2770 of file Context.cs.

2771 {
2772 Debug.Assert(s != null);
2773 return new ReExpr(this, Native.Z3_mk_re_full(nCtx, s.NativeObject));
2774 }

◆ MkFullSet()

ArrayExpr MkFullSet ( Sort  domain)
inline

Create the full set.

Definition at line 2327 of file Context.cs.

2328 {
2329 Debug.Assert(domain != null);
2330
2331 CheckContextMatch(domain);
2332 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_full_set(nCtx, domain.NativeObject));
2333 }

◆ MkFuncDecl() [1/4]

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

Creates a new function declaration.

Definition at line 627 of file Context.cs.

628 {
629 Debug.Assert(range != null);
630 Debug.Assert(domain != null);
631
632 CheckContextMatch(domain);
633 CheckContextMatch(range);
634 using var symbol = MkSymbol(name);
635 Sort[] q = new Sort[] { domain };
636 return new FuncDecl(this, symbol, q, range);
637 }

◆ MkFuncDecl() [2/4]

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

Creates a new function declaration.

Definition at line 584 of file Context.cs.

585 {
586 Debug.Assert(range != null);
587 Debug.Assert(domain.All(d => d != null));
588
589 CheckContextMatch<Sort>(domain);
590 CheckContextMatch(range);
591 using var symbol = MkSymbol(name);
592 return new FuncDecl(this, symbol, domain, range);
593 }

◆ MkFuncDecl() [3/4]

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

Creates a new function declaration.

Definition at line 568 of file Context.cs.

569 {
570 Debug.Assert(name != null);
571 Debug.Assert(domain != null);
572 Debug.Assert(range != null);
573
574 CheckContextMatch(name);
575 CheckContextMatch(domain);
576 CheckContextMatch(range);
577 Sort[] q = new Sort[] { domain };
578 return new FuncDecl(this, name, q, range);
579 }

◆ MkFuncDecl() [4/4]

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

Creates a new function declaration.

Definition at line 553 of file Context.cs.

554 {
555 Debug.Assert(name != null);
556 Debug.Assert(range != null);
557 Debug.Assert(domain.All(d => d != null));
558
559 CheckContextMatch(name);
560 CheckContextMatch<Sort>(domain);
561 CheckContextMatch(range);
562 return new FuncDecl(this, name, domain, range);
563 }

◆ MkGe()

BoolExpr MkGe ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 >= t2

Definition at line 1257 of file Context.cs.

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

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

3448 {
3449
3450 return new Goal(this, models, unsatCores, proofs);
3451 }

◆ MkGt()

BoolExpr MkGt ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 > t2

Definition at line 1244 of file Context.cs.

1245 {
1246 Debug.Assert(t1 != null);
1247 Debug.Assert(t2 != null);
1248
1249 CheckContextMatch(t1);
1250 CheckContextMatch(t2);
1251 return new BoolExpr(this, Native.Z3_mk_gt(nCtx, t1.NativeObject, t2.NativeObject));
1252 }

Referenced by ArithExpr.operator>().

◆ MkIff()

BoolExpr MkIff ( BoolExpr  t1,
BoolExpr  t2 
)
inline

Create an expression representing t1 iff t2.

Definition at line 982 of file Context.cs.

983 {
984 Debug.Assert(t1 != null);
985 Debug.Assert(t2 != null);
986
987 CheckContextMatch(t1);
988 CheckContextMatch(t2);
989 return new BoolExpr(this, Native.Z3_mk_iff(nCtx, t1.NativeObject, t2.NativeObject));
990 }

◆ MkImplies()

BoolExpr MkImplies ( BoolExpr  t1,
BoolExpr  t2 
)
inline

Create an expression representing t1 -> t2.

Definition at line 995 of file Context.cs.

996 {
997 Debug.Assert(t1 != null);
998 Debug.Assert(t2 != null);
999
1000 CheckContextMatch(t1);
1001 CheckContextMatch(t2);
1002 return new BoolExpr(this, Native.Z3_mk_implies(nCtx, t1.NativeObject, t2.NativeObject));
1003 }

◆ MkIndexOf()

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

Extract index of sub-string starting at offset.

Definition at line 2622 of file Context.cs.

2623 {
2624 Debug.Assert(s != null);
2625 Debug.Assert(offset != null);
2626 Debug.Assert(substr != null);
2627 CheckContextMatch(s, substr, offset);
2628 return new IntExpr(this, Native.Z3_mk_seq_index(nCtx, s.NativeObject, substr.NativeObject, offset.NativeObject));
2629 }

◆ MkInRe()

BoolExpr MkInRe ( SeqExpr  s,
ReExpr  re 
)
inline

Check for regular expression membership.

Definition at line 2656 of file Context.cs.

2657 {
2658 Debug.Assert(s != null);
2659 Debug.Assert(re != null);
2660 CheckContextMatch(s, re);
2661 return new BoolExpr(this, Native.Z3_mk_seq_in_re(nCtx, s.NativeObject, re.NativeObject));
2662 }

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

3071 {
3072
3073 return new IntNum(this, Native.Z3_mk_int(nCtx, v, IntSort.NativeObject));
3074 }
IntSort IntSort
Retrieves the Integer sort of the context.
Definition: Context.cs:156

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

3093 {
3094
3095 return new IntNum(this, Native.Z3_mk_int64(nCtx, v, IntSort.NativeObject));
3096 }

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

3060 {
3061
3062 return new IntNum(this, Native.Z3_mk_numeral(nCtx, v, IntSort.NativeObject));
3063 }

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

3082 {
3083
3084 return new IntNum(this, Native.Z3_mk_unsigned_int(nCtx, v, IntSort.NativeObject));
3085 }

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

3104 {
3105
3106 return new IntNum(this, Native.Z3_mk_unsigned_int64(nCtx, v, IntSort.NativeObject));
3107 }

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

1939 {
1940 Debug.Assert(t != null);
1941
1942 CheckContextMatch(t);
1943 return new BitVecExpr(this, Native.Z3_mk_int2bv(nCtx, n, t.NativeObject));
1944 }

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

1278 {
1279 Debug.Assert(t != null);
1280
1281 CheckContextMatch(t);
1282 return new RealExpr(this, Native.Z3_mk_int2real(nCtx, t.NativeObject));
1283 }

◆ MkIntConst() [1/2]

IntExpr MkIntConst ( string  name)
inline

Creates an integer constant.

Definition at line 813 of file Context.cs.

814 {
815 Debug.Assert(name != null);
816
817 return (IntExpr)MkConst(name, IntSort);
818 }

◆ MkIntConst() [2/2]

IntExpr MkIntConst ( Symbol  name)
inline

Creates an integer constant.

Definition at line 803 of file Context.cs.

804 {
805 Debug.Assert(name != null);
806
807 return (IntExpr)MkConst(name, IntSort);
808 }

◆ MkIntersect()

ReExpr MkIntersect ( params ReExpr[]  t)
inline

Create the intersection of regular languages.

Definition at line 2736 of file Context.cs.

2737 {
2738 Debug.Assert(t != null);
2739 Debug.Assert(t.All(a => a != null));
2740
2741 CheckContextMatch<ReExpr>(t);
2742 return new ReExpr(this, Native.Z3_mk_re_intersect(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
2743 }

◆ MkIntSort()

IntSort MkIntSort ( )
inline

Create a new integer sort.

Definition at line 231 of file Context.cs.

232 {
233
234 return new IntSort(this);
235 }

◆ MkIsDigit()

BoolExpr MkIsDigit ( Expr  ch)
inline

Create a check if the character is a digit.

Definition at line 2828 of file Context.cs.

2829 {
2830 Debug.Assert(ch != null);
2831 return new BoolExpr(this, Native.Z3_mk_char_is_digit(nCtx, ch.NativeObject));
2832 }

◆ MkIsInteger()

BoolExpr MkIsInteger ( RealExpr  t)
inline

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

Definition at line 1303 of file Context.cs.

1304 {
1305 Debug.Assert(t != null);
1306
1307 CheckContextMatch(t);
1308 return new BoolExpr(this, Native.Z3_mk_is_int(nCtx, t.NativeObject));
1309 }

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

968 {
969 Debug.Assert(t1 != null);
970 Debug.Assert(t2 != null);
971 Debug.Assert(t3 != null);
972
973 CheckContextMatch(t1);
974 CheckContextMatch(t2);
975 CheckContextMatch(t3);
976 return Expr.Create(this, Native.Z3_mk_ite(nCtx, t1.NativeObject, t2.NativeObject, t3.NativeObject));
977 }

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

3361 {
3362 Debug.Assert(body != null);
3363 Debug.Assert(boundConstants != null && boundConstants.All(b => b != null));
3364 return new Lambda(this, boundConstants, body);
3365 }
def Lambda(vs, body)
Definition: z3py.py:2252

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

3342 {
3343 Debug.Assert(sorts != null);
3344 Debug.Assert(names != null);
3345 Debug.Assert(body != null);
3346 Debug.Assert(sorts.Length == names.Length);
3347 Debug.Assert(sorts.All(s => s != null));
3348 Debug.Assert(names.All(n => n != null));
3349 return new Lambda(this, sorts, names, body);
3350 }

◆ MkLe()

BoolExpr MkLe ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 <= t2

Definition at line 1231 of file Context.cs.

1232 {
1233 Debug.Assert(t1 != null);
1234 Debug.Assert(t2 != null);
1235
1236 CheckContextMatch(t1);
1237 CheckContextMatch(t2);
1238 return new BoolExpr(this, Native.Z3_mk_le(nCtx, t1.NativeObject, t2.NativeObject));
1239 }

Referenced by ArithExpr.operator<=().

◆ MkLength()

IntExpr MkLength ( SeqExpr  s)
inline

Retrieve the length of a given sequence.

Definition at line 2524 of file Context.cs.

2525 {
2526 Debug.Assert(s != null);
2527 return (IntExpr)Expr.Create(this, Native.Z3_mk_seq_length(nCtx, s.NativeObject));
2528 }

◆ MkListSort() [1/2]

ListSort MkListSort ( string  name,
Sort  elemSort 
)
inline

Create a new list sort.

Definition at line 364 of file Context.cs.

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

◆ MkListSort() [2/2]

ListSort MkListSort ( Symbol  name,
Sort  elemSort 
)
inline

Create a new list sort.

Definition at line 351 of file Context.cs.

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

◆ MkLoop()

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

Take the bounded Kleene star of a regular expression.

Definition at line 2676 of file Context.cs.

2677 {
2678 Debug.Assert(re != null);
2679 return new ReExpr(this, Native.Z3_mk_re_loop(nCtx, re.NativeObject, lo, hi));
2680 }

◆ MkLt()

BoolExpr MkLt ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 < t2

Definition at line 1218 of file Context.cs.

1219 {
1220 Debug.Assert(t1 != null);
1221 Debug.Assert(t2 != null);
1222
1223 CheckContextMatch(t1);
1224 CheckContextMatch(t2);
1225 return new BoolExpr(this, Native.Z3_mk_lt(nCtx, t1.NativeObject, t2.NativeObject));
1226 }

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

2262 {
2263 Debug.Assert(f != null);
2264 Debug.Assert(args == null || args.All(a => a != null));
2265
2266 CheckContextMatch(f);
2267 CheckContextMatch<ArrayExpr>(args);
2268 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_map(nCtx, f.NativeObject, AST.ArrayLength(args), AST.ArrayToNative(args)));
2269 }

◆ MkMod()

IntExpr MkMod ( IntExpr  t1,
IntExpr  t2 
)
inline

Create an expression representing t1 mod t2.

The arguments must have int type.

Definition at line 1178 of file Context.cs.

1179 {
1180 Debug.Assert(t1 != null);
1181 Debug.Assert(t2 != null);
1182
1183 CheckContextMatch(t1);
1184 CheckContextMatch(t2);
1185 return new IntExpr(this, Native.Z3_mk_mod(nCtx, t1.NativeObject, t2.NativeObject));
1186 }

◆ MkMul() [1/2]

ArithExpr MkMul ( IEnumerable< ArithExpr t)
inline

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

Definition at line 1128 of file Context.cs.

1129 {
1130 Debug.Assert(t != null);
1131 Debug.Assert(t.All(a => a != null));
1132
1133 CheckContextMatch<ArithExpr>(t);
1134 var ts = t.ToArray();
1135 return (ArithExpr)Expr.Create(this, Native.Z3_mk_mul(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1136 }

◆ MkMul() [2/2]

ArithExpr MkMul ( params ArithExpr[]  t)
inline

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

Definition at line 1115 of file Context.cs.

1116 {
1117 Debug.Assert(t != null);
1118 Debug.Assert(t.All(a => a != null));
1119
1120 CheckContextMatch<ArithExpr>(t);
1121 var ts = t.ToArray();
1122 return (ArithExpr)Expr.Create(this, Native.Z3_mk_mul(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1123 }

Referenced by ArithExpr.operator*().

◆ MkNot()

BoolExpr MkNot ( BoolExpr  a)
inline

Mk an expression representing not(a).

Definition at line 953 of file Context.cs.

954 {
955 Debug.Assert(a != null);
956
957 CheckContextMatch(a);
958 return new BoolExpr(this, Native.Z3_mk_not(nCtx, a.NativeObject));
959 }

Referenced by BoolExpr.operator!().

◆ MkNth()

Expr MkNth ( SeqExpr  s,
Expr  index 
)
inline

Retrieve element at index.

Definition at line 2599 of file Context.cs.

2600 {
2601 Debug.Assert(s != null);
2602 Debug.Assert(index != null);
2603 CheckContextMatch(s, index);
2604 return Expr.Create(this, Native.Z3_mk_seq_nth(nCtx, s.NativeObject, index.NativeObject));
2605 }

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

2929 {
2930 Debug.Assert(ty != null);
2931
2932 CheckContextMatch(ty);
2933 return Expr.Create(this, Native.Z3_mk_int(nCtx, v, ty.NativeObject));
2934 }

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

2959 {
2960 Debug.Assert(ty != null);
2961
2962 CheckContextMatch(ty);
2963 return Expr.Create(this, Native.Z3_mk_int64(nCtx, v, ty.NativeObject));
2964 }

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

2914 {
2915 Debug.Assert(ty != null);
2916
2917 CheckContextMatch(ty);
2918 return Expr.Create(this, Native.Z3_mk_numeral(nCtx, v, ty.NativeObject));
2919 }

Referenced by 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 2943 of file Context.cs.

2944 {
2945 Debug.Assert(ty != null);
2946
2947 CheckContextMatch(ty);
2948 return Expr.Create(this, Native.Z3_mk_unsigned_int(nCtx, v, ty.NativeObject));
2949 }

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

2974 {
2975 Debug.Assert(ty != null);
2976
2977 CheckContextMatch(ty);
2978 return Expr.Create(this, Native.Z3_mk_unsigned_int64(nCtx, v, ty.NativeObject));
2979 }

◆ MkOptimize()

Optimize MkOptimize ( )
inline

Create an Optimization context.

Definition at line 3957 of file Context.cs.

3958 {
3959
3960 return new Optimize(this);
3961 }

◆ MkOption()

ReExpr MkOption ( ReExpr  re)
inline

Create the optional regular expression.

Definition at line 2694 of file Context.cs.

2695 {
2696 Debug.Assert(re != null);
2697 return new ReExpr(this, Native.Z3_mk_re_option(nCtx, re.NativeObject));
2698 }

◆ MkOr() [1/2]

BoolExpr MkOr ( IEnumerable< BoolExpr t)
inline

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

Definition at line 1074 of file Context.cs.

1075 {
1076 Debug.Assert(t != null);
1077 Debug.Assert(t.All(a => a != null));
1078
1079 CheckContextMatch(t);
1080 var ts = t.ToArray();
1081 return new BoolExpr(this, Native.Z3_mk_or(nCtx, (uint)ts.Length, AST.ArrayToNative(ts)));
1082 }

◆ MkOr() [2/2]

BoolExpr MkOr ( params BoolExpr[]  t)
inline

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

Definition at line 1061 of file Context.cs.

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

Referenced by BoolExpr.operator|().

◆ MkParams()

Params MkParams ( )
inline

Creates a new ParameterSet.

Definition at line 3458 of file Context.cs.

3459 {
3460
3461 return new Params(this);
3462 }

Referenced by Optimize.Set(), and Solver.Set().

◆ MkPattern()

Pattern MkPattern ( params Expr[]  terms)
inline

Create a quantifier pattern.

Definition at line 721 of file Context.cs.

722 {
723 Debug.Assert(terms != null);
724 if (terms.Length == 0)
725 throw new Z3Exception("Cannot create a pattern from zero terms");
726
727 IntPtr[] termsNative = AST.ArrayToNative(terms);
728 return new Pattern(this, Native.Z3_mk_pattern(nCtx, (uint)terms.Length, termsNative));
729 }

◆ MkPBEq()

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

Create a pseudo-Boolean equal constraint.

Definition at line 2892 of file Context.cs.

2893 {
2894 Debug.Assert(args != null);
2895 Debug.Assert(coeffs != null);
2896 Debug.Assert(args.Length == coeffs.Length);
2897 CheckContextMatch<BoolExpr>(args);
2898 return new BoolExpr(this, Native.Z3_mk_pbeq(nCtx, (uint)args.Length,
2899 AST.ArrayToNative(args),
2900 coeffs, k));
2901 }

◆ MkPBGe()

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

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

Definition at line 2879 of file Context.cs.

2880 {
2881 Debug.Assert(args != null);
2882 Debug.Assert(coeffs != null);
2883 Debug.Assert(args.Length == coeffs.Length);
2884 CheckContextMatch<BoolExpr>(args);
2885 return new BoolExpr(this, Native.Z3_mk_pbge(nCtx, (uint)args.Length,
2886 AST.ArrayToNative(args),
2887 coeffs, k));
2888 }

◆ MkPBLe()

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

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

Definition at line 2865 of file Context.cs.

2866 {
2867 Debug.Assert(args != null);
2868 Debug.Assert(coeffs != null);
2869 Debug.Assert(args.Length == coeffs.Length);
2870 CheckContextMatch<BoolExpr>(args);
2871 return new BoolExpr(this, Native.Z3_mk_pble(nCtx, (uint)args.Length,
2872 AST.ArrayToNative(args),
2873 coeffs, k));
2874 }

◆ MkPlus()

ReExpr MkPlus ( ReExpr  re)
inline

Take the Kleene plus of a regular expression.

Definition at line 2685 of file Context.cs.

2686 {
2687 Debug.Assert(re != null);
2688 return new ReExpr(this, Native.Z3_mk_re_plus(nCtx, re.NativeObject));
2689 }

◆ MkPower()

ArithExpr MkPower ( ArithExpr  t1,
ArithExpr  t2 
)
inline

Create an expression representing t1 ^ t2.

Definition at line 1205 of file Context.cs.

1206 {
1207 Debug.Assert(t1 != null);
1208 Debug.Assert(t2 != null);
1209
1210 CheckContextMatch(t1);
1211 CheckContextMatch(t2);
1212 return (ArithExpr)Expr.Create(this, Native.Z3_mk_power(nCtx, t1.NativeObject, t2.NativeObject));
1213 }

◆ MkPrefixOf()

BoolExpr MkPrefixOf ( SeqExpr  s1,
SeqExpr  s2 
)
inline

Check for sequence prefix.

Definition at line 2533 of file Context.cs.

2534 {
2535 Debug.Assert(s1 != null);
2536 Debug.Assert(s2 != null);
2537 CheckContextMatch(s1, s2);
2538 return new BoolExpr(this, Native.Z3_mk_seq_prefix(nCtx, s1.NativeObject, s2.NativeObject));
2539 }

◆ MkProbe()

Probe MkProbe ( string  name)
inline

Creates a new Probe.

Definition at line 3764 of file Context.cs.

3765 {
3766
3767 return new Probe(this, name);
3768 }

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

3310 {
3311 Debug.Assert(body != null);
3312 Debug.Assert(boundConstants == null || boundConstants.All(n => n != null));
3313 Debug.Assert(patterns == null || patterns.All(p => p != null));
3314 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3315
3316
3317 if (universal)
3318 return MkForall(boundConstants, body, weight, patterns, noPatterns, quantifierID, skolemID);
3319 else
3320 return MkExists(boundConstants, body, weight, patterns, noPatterns, quantifierID, skolemID);
3321 }
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:3249
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:3207

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

3287 {
3288 Debug.Assert(body != null);
3289 Debug.Assert(names != null);
3290 Debug.Assert(sorts != null);
3291 Debug.Assert(sorts.Length == names.Length);
3292 Debug.Assert(sorts.All(s => s != null));
3293 Debug.Assert(names.All(n => n != null));
3294 Debug.Assert(patterns == null || patterns.All(p => p != null));
3295 Debug.Assert(noPatterns == null || noPatterns.All(np => np != null));
3296
3297
3298 if (universal)
3299 return MkForall(sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
3300 else
3301 return MkExists(sorts, names, body, weight, patterns, noPatterns, quantifierID, skolemID);
3302 }

◆ MkRange()

ReExpr MkRange ( SeqExpr  lo,
SeqExpr  hi 
)
inline

Create a range expression.

Definition at line 2780 of file Context.cs.

2781 {
2782 Debug.Assert(lo != null);
2783 Debug.Assert(hi != null);
2784 CheckContextMatch(lo, hi);
2785 return new ReExpr(this, Native.Z3_mk_re_range(nCtx, lo.NativeObject, hi.NativeObject));
2786 }

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

2991 {
2992 if (den == 0)
2993 throw new Z3Exception("Denominator is zero");
2994
2995 return new RatNum(this, Native.Z3_mk_real(nCtx, num, den));
2996 }

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

3015 {
3016
3017 return new RatNum(this, Native.Z3_mk_int(nCtx, v, RealSort.NativeObject));
3018 }
RealSort RealSort
Retrieves the Real sort of the context.
Definition: Context.cs:168

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

3037 {
3038
3039 return new RatNum(this, Native.Z3_mk_int64(nCtx, v, RealSort.NativeObject));
3040 }

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

3004 {
3005
3006 return new RatNum(this, Native.Z3_mk_numeral(nCtx, v, RealSort.NativeObject));
3007 }

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

3026 {
3027
3028 return new RatNum(this, Native.Z3_mk_unsigned_int(nCtx, v, RealSort.NativeObject));
3029 }

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

3048 {
3049
3050 return new RatNum(this, Native.Z3_mk_unsigned_int64(nCtx, v, RealSort.NativeObject));
3051 }

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

1293 {
1294 Debug.Assert(t != null);
1295
1296 CheckContextMatch(t);
1297 return new IntExpr(this, Native.Z3_mk_real2int(nCtx, t.NativeObject));
1298 }

◆ MkRealConst() [1/2]

RealExpr MkRealConst ( string  name)
inline

Creates a real constant.

Definition at line 833 of file Context.cs.

834 {
835
836 return (RealExpr)MkConst(name, RealSort);
837 }

◆ MkRealConst() [2/2]

RealExpr MkRealConst ( Symbol  name)
inline

Creates a real constant.

Definition at line 823 of file Context.cs.

824 {
825 Debug.Assert(name != null);
826
827 return (RealExpr)MkConst(name, RealSort);
828 }

◆ MkRealSort()

RealSort MkRealSort ( )
inline

Create a real sort.

Definition at line 240 of file Context.cs.

241 {
242 return new RealSort(this);
243 }

◆ MkRecFuncDecl()

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

Creates a new recursive function declaration.

Definition at line 598 of file Context.cs.

599 {
600 Debug.Assert(range != null);
601 Debug.Assert(domain.All(d => d != null));
602
603 CheckContextMatch<Sort>(domain);
604 CheckContextMatch(range);
605 using var symbol = MkSymbol(name);
606 return new FuncDecl(this, symbol, domain, range, true);
607 }

◆ MkRem()

IntExpr MkRem ( IntExpr  t1,
IntExpr  t2 
)
inline

Create an expression representing t1 rem t2.

The arguments must have int type.

Definition at line 1192 of file Context.cs.

1193 {
1194 Debug.Assert(t1 != null);
1195 Debug.Assert(t2 != null);
1196
1197 CheckContextMatch(t1);
1198 CheckContextMatch(t2);
1199 return new IntExpr(this, Native.Z3_mk_rem(nCtx, t1.NativeObject, t2.NativeObject));
1200 }

◆ MkRepeat()

BitVecExpr MkRepeat ( uint  i,
BitVecExpr  t 
)
inline

Bit-vector repetition.

The argument t must have a bit-vector sort.

Definition at line 1788 of file Context.cs.

1789 {
1790 Debug.Assert(t != null);
1791
1792 CheckContextMatch(t);
1793 return new BitVecExpr(this, Native.Z3_mk_repeat(nCtx, i, t.NativeObject));
1794 }

◆ MkReplace()

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

Replace the first occurrence of src by dst in s.

Definition at line 2634 of file Context.cs.

2635 {
2636 Debug.Assert(s != null);
2637 Debug.Assert(src != null);
2638 Debug.Assert(dst != null);
2639 CheckContextMatch(s, src, dst);
2640 return new SeqExpr(this, Native.Z3_mk_seq_replace(nCtx, s.NativeObject, src.NativeObject, dst.NativeObject));
2641 }

◆ MkReSort()

ReSort MkReSort ( SeqSort  s)
inline

Create a new regular expression sort.

Definition at line 265 of file Context.cs.

266 {
267 Debug.Assert(s != null);
268 return new ReSort(this, Native.Z3_mk_re_sort(nCtx, s.NativeObject));
269 }
def ReSort(s)
Definition: z3py.py:11127

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

2138 {
2139 Debug.Assert(a != null);
2140 Debug.Assert(i != null);
2141
2142 CheckContextMatch(a);
2143 CheckContextMatch(i);
2144 return Expr.Create(this, Native.Z3_mk_select(nCtx, a.NativeObject, i.NativeObject));
2145 }

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

2161 {
2162 Debug.Assert(a != null);
2163 Debug.Assert(args != null && args.All(n => n != null));
2164
2165 CheckContextMatch(a);
2166 CheckContextMatch<Expr>(args);
2167 return Expr.Create(this, Native.Z3_mk_select_n(nCtx, a.NativeObject, AST.ArrayLength(args), AST.ArrayToNative(args)));
2168 }

◆ MkSeqSort()

SeqSort MkSeqSort ( Sort  s)
inline

Create a new sequence sort.

Definition at line 256 of file Context.cs.

257 {
258 Debug.Assert(s != null);
259 return new SeqSort(this, Native.Z3_mk_seq_sort(nCtx, s.NativeObject));
260 }
def SeqSort(s)
Definition: z3py.py:10740

◆ MkSetAdd()

ArrayExpr MkSetAdd ( ArrayExpr  set,
Expr  element 
)
inline

Add an element to the set.

Definition at line 2338 of file Context.cs.

2339 {
2340 Debug.Assert(set != null);
2341 Debug.Assert(element != null);
2342
2343 CheckContextMatch(set);
2344 CheckContextMatch(element);
2345 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_add(nCtx, set.NativeObject, element.NativeObject));
2346 }

◆ MkSetComplement()

ArrayExpr MkSetComplement ( ArrayExpr  arg)
inline

Take the complement of a set.

Definition at line 2402 of file Context.cs.

2403 {
2404 Debug.Assert(arg != null);
2405
2406 CheckContextMatch(arg);
2407 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_complement(nCtx, arg.NativeObject));
2408 }

◆ MkSetDel()

ArrayExpr MkSetDel ( ArrayExpr  set,
Expr  element 
)
inline

Remove an element from a set.

Definition at line 2352 of file Context.cs.

2353 {
2354 Debug.Assert(set != null);
2355 Debug.Assert(element != null);
2356
2357 CheckContextMatch(set);
2358 CheckContextMatch(element);
2359 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_del(nCtx, set.NativeObject, element.NativeObject));
2360 }

◆ MkSetDifference()

ArrayExpr MkSetDifference ( ArrayExpr  arg1,
ArrayExpr  arg2 
)
inline

Take the difference between two sets.

Definition at line 2389 of file Context.cs.

2390 {
2391 Debug.Assert(arg1 != null);
2392 Debug.Assert(arg2 != null);
2393
2394 CheckContextMatch(arg1);
2395 CheckContextMatch(arg2);
2396 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_difference(nCtx, arg1.NativeObject, arg2.NativeObject));
2397 }

◆ MkSetIntersection()

ArrayExpr MkSetIntersection ( params ArrayExpr[]  args)
inline

Take the intersection of a list of sets.

Definition at line 2377 of file Context.cs.

2378 {
2379 Debug.Assert(args != null);
2380 Debug.Assert(args.All(a => a != null));
2381
2382 CheckContextMatch<ArrayExpr>(args);
2383 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_intersect(nCtx, (uint)args.Length, AST.ArrayToNative(args)));
2384 }

◆ MkSetMembership()

BoolExpr MkSetMembership ( Expr  elem,
ArrayExpr  set 
)
inline

Check for set membership.

Definition at line 2413 of file Context.cs.

2414 {
2415 Debug.Assert(elem != null);
2416 Debug.Assert(set != null);
2417
2418 CheckContextMatch(elem);
2419 CheckContextMatch(set);
2420 return (BoolExpr)Expr.Create(this, Native.Z3_mk_set_member(nCtx, elem.NativeObject, set.NativeObject));
2421 }

◆ MkSetSort()

SetSort MkSetSort ( Sort  ty)
inline

Create a set type.

Definition at line 2305 of file Context.cs.

2306 {
2307 Debug.Assert(ty != null);
2308
2309 CheckContextMatch(ty);
2310 return new SetSort(this, ty);
2311 }
def SetSort(s)
Sets.
Definition: z3py.py:4908

◆ MkSetSubset()

BoolExpr MkSetSubset ( ArrayExpr  arg1,
ArrayExpr  arg2 
)
inline

Check for subsetness of sets.

Definition at line 2426 of file Context.cs.

2427 {
2428 Debug.Assert(arg1 != null);
2429 Debug.Assert(arg2 != null);
2430
2431 CheckContextMatch(arg1);
2432 CheckContextMatch(arg2);
2433 return (BoolExpr)Expr.Create(this, Native.Z3_mk_set_subset(nCtx, arg1.NativeObject, arg2.NativeObject));
2434 }

◆ MkSetUnion()

ArrayExpr MkSetUnion ( params ArrayExpr[]  args)
inline

Take the union of a list of sets.

Definition at line 2365 of file Context.cs.

2366 {
2367 Debug.Assert(args != null);
2368 Debug.Assert(args.All(a => a != null));
2369
2370 CheckContextMatch<ArrayExpr>(args);
2371 return (ArrayExpr)Expr.Create(this, Native.Z3_mk_set_union(nCtx, (uint)args.Length, AST.ArrayToNative(args)));
2372 }

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

1758 {
1759 Debug.Assert(t != null);
1760
1761 CheckContextMatch(t);
1762 return new BitVecExpr(this, Native.Z3_mk_sign_ext(nCtx, i, t.NativeObject));
1763 }

◆ MkSimpleSolver()

Solver MkSimpleSolver ( )
inline

Creates a new (incremental) solver.

Definition at line 3921 of file Context.cs.

3922 {
3923
3924 return new Solver(this, Native.Z3_mk_simple_solver(nCtx));
3925 }

◆ MkSolver() [1/3]

Solver MkSolver ( string  logic)
inline

Creates a new (incremental) solver.

See also
MkSolver(Symbol)

Definition at line 3912 of file Context.cs.

3913 {
3914 using var symbol = MkSymbol(logic);
3915 return MkSolver(symbol);
3916 }
Solver MkSolver(Symbol logic=null)
Creates a new (incremental) solver.
Definition: Context.cs:3899

◆ MkSolver() [2/3]

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

3900 {
3901
3902 if (logic == null)
3903 return new Solver(this, Native.Z3_mk_solver(nCtx));
3904 else
3905 return new Solver(this, Native.Z3_mk_solver_for_logic(nCtx, logic.NativeObject));
3906 }

Referenced by Context.MkSolver().

◆ MkSolver() [3/3]

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

3935 {
3936 Debug.Assert(t != null);
3937
3938 return new Solver(this, Native.Z3_mk_solver_from_tactic(nCtx, t.NativeObject));
3939 }

◆ MkStar()

ReExpr MkStar ( ReExpr  re)
inline

Take the Kleene star of a regular expression.

Definition at line 2667 of file Context.cs.

2668 {
2669 Debug.Assert(re != null);
2670 return new ReExpr(this, Native.Z3_mk_re_star(nCtx, re.NativeObject));
2671 }

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

2190 {
2191 Debug.Assert(a != null);
2192 Debug.Assert(i != null);
2193 Debug.Assert(v != null);
2194
2195 CheckContextMatch(a);
2196 CheckContextMatch(i);
2197 CheckContextMatch(v);
2198 return new ArrayExpr(this, Native.Z3_mk_store(nCtx, a.NativeObject, i.NativeObject, v.NativeObject));
2199 }

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

2220 {
2221 Debug.Assert(a != null);
2222 Debug.Assert(args != null);
2223 Debug.Assert(v != null);
2224
2225 CheckContextMatch<Expr>(args);
2226 CheckContextMatch(a);
2227 CheckContextMatch(v);
2228 return new ArrayExpr(this, Native.Z3_mk_store_n(nCtx, a.NativeObject, AST.ArrayLength(args), AST.ArrayToNative(args), v.NativeObject));
2229 }

◆ MkString()

SeqExpr MkString ( string  s)
inline

Create a string constant.

Definition at line 2461 of file Context.cs.

2462 {
2463 Debug.Assert(s != null);
2464 return new SeqExpr(this, Native.Z3_mk_string(nCtx, s));
2465 }

◆ MkStringLe()

BoolExpr MkStringLe ( SeqExpr  s1,
SeqExpr  s2 
)
inline

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

Definition at line 2577 of file Context.cs.

2578 {
2579 Debug.Assert(s1 != null);
2580 Debug.Assert(s2 != null);
2581 CheckContextMatch(s1, s2);
2582 return new BoolExpr(this, Native.Z3_mk_str_le(nCtx, s1.NativeObject, s2.NativeObject));
2583 }

◆ MkStringLt()

BoolExpr MkStringLt ( SeqExpr  s1,
SeqExpr  s2 
)
inline

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

Definition at line 2566 of file Context.cs.

2567 {
2568 Debug.Assert(s1 != null);
2569 Debug.Assert(s2 != null);
2570 CheckContextMatch(s1, s2);
2571 return new BoolExpr(this, Native.Z3_mk_str_lt(nCtx, s1.NativeObject, s2.NativeObject));
2572 }

◆ MkSub()

ArithExpr MkSub ( params ArithExpr[]  t)
inline

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

Definition at line 1141 of file Context.cs.

1142 {
1143 Debug.Assert(t != null);
1144 Debug.Assert(t.All(a => a != null));
1145
1146 CheckContextMatch<ArithExpr>(t);
1147 return (ArithExpr)Expr.Create(this, Native.Z3_mk_sub(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
1148 }

Referenced by ArithExpr.operator-().

◆ MkSuffixOf()

BoolExpr MkSuffixOf ( SeqExpr  s1,
SeqExpr  s2 
)
inline

Check for sequence suffix.

Definition at line 2544 of file Context.cs.

2545 {
2546 Debug.Assert(s1 != null);
2547 Debug.Assert(s2 != null);
2548 CheckContextMatch(s1, s2);
2549 return new BoolExpr(this, Native.Z3_mk_seq_suffix(nCtx, s1.NativeObject, s2.NativeObject));
2550 }

◆ MkSymbol() [1/2]

IntSymbol MkSymbol ( int  i)
inline

Creates a new symbol using an integer.

Not all integers can be passed to this function. The legal range of unsigned integers is 0 to 2^30-1.

Definition at line 109 of file Context.cs.

110 {
111 return new IntSymbol(this, i);
112 }

Referenced by Params.Add(), Optimize.AssertSoft(), Context.MkArrayConst(), Context.MkBoolConst(), Context.MkConst(), Context.MkConstDecl(), Context.MkConstructor(), Context.MkDatatypeSort(), Context.MkEnumSort(), Context.MkFiniteDomainSort(), Context.MkFuncDecl(), Context.MkListSort(), Context.MkRecFuncDecl(), Context.MkSolver(), Context.MkUninterpretedSort(), and Context.MkUserPropagatorFuncDecl().

◆ MkSymbol() [2/2]

StringSymbol MkSymbol ( string  name)
inline

Create a symbol using a string.

Definition at line 117 of file Context.cs.

118 {
119 return new StringSymbol(this, name);
120 }

◆ MkTactic()

Tactic MkTactic ( string  name)
inline

Creates a new Tactic.

Definition at line 3502 of file Context.cs.

3503 {
3504
3505 return new Tactic(this, name);
3506 }

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

2279 {
2280 Debug.Assert(array != null);
2281
2282 CheckContextMatch(array);
2283 return Expr.Create(this, Native.Z3_mk_array_default(nCtx, array.NativeObject));
2284 }

◆ MkToRe()

ReExpr MkToRe ( SeqExpr  s)
inline

Convert a regular expression that accepts sequence s.

Definition at line 2646 of file Context.cs.

2647 {
2648 Debug.Assert(s != null);
2649 return new ReExpr(this, Native.Z3_mk_seq_to_re(nCtx, s.NativeObject));
2650 }

◆ MkTrue()

BoolExpr MkTrue ( )
inline

The true Term.

Definition at line 891 of file Context.cs.

892 {
893
894 return new BoolExpr(this, Native.Z3_mk_true(nCtx));
895 }

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

◆ MkTupleSort()

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

Create a new tuple sort.

Definition at line 300 of file Context.cs.

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

◆ MkUnaryMinus()

ArithExpr MkUnaryMinus ( ArithExpr  t)
inline

Create an expression representing -t.

Definition at line 1153 of file Context.cs.

1154 {
1155 Debug.Assert(t != null);
1156
1157 CheckContextMatch(t);
1158 return (ArithExpr)Expr.Create(this, Native.Z3_mk_unary_minus(nCtx, t.NativeObject));
1159 }

Referenced by ArithExpr.operator-().

◆ MkUninterpretedSort() [1/2]

UninterpretedSort MkUninterpretedSort ( string  str)
inline

Create a new uninterpreted sort.

Definition at line 222 of file Context.cs.

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

◆ MkUninterpretedSort() [2/2]

UninterpretedSort MkUninterpretedSort ( Symbol  s)
inline

Create a new uninterpreted sort.

Definition at line 211 of file Context.cs.

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

Referenced by Context.MkUninterpretedSort().

◆ MkUnion()

ReExpr MkUnion ( params ReExpr[]  t)
inline

Create the union of regular languages.

Definition at line 2724 of file Context.cs.

2725 {
2726 Debug.Assert(t != null);
2727 Debug.Assert(t.All(a => a != null));
2728
2729 CheckContextMatch<ReExpr>(t);
2730 return new ReExpr(this, Native.Z3_mk_re_union(nCtx, (uint)t.Length, AST.ArrayToNative(t)));
2731 }

◆ MkUnit()

SeqExpr MkUnit ( Expr  elem)
inline

Create the singleton sequence.

Definition at line 2452 of file Context.cs.

2453 {
2454 Debug.Assert(elem != null);
2455 return new SeqExpr(this, Native.Z3_mk_seq_unit(nCtx, elem.NativeObject));
2456 }

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

540 {
541 return Expr.Create(this, Native.Z3_datatype_update_field(
542 nCtx, field.NativeObject,
543 t.NativeObject, v.NativeObject));
544 }

◆ MkUserPropagatorFuncDecl()

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

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


Definition at line 695 of file Context.cs.

696 {
697 using var _name = MkSymbol(name);
698 var fn = Native.Z3_solver_propagate_declare(nCtx, _name.NativeObject, AST.ArrayLength(domain), AST.ArrayToNative(domain), range.NativeObject);
699 return new FuncDecl(this, fn);
700 }

◆ MkXor() [1/2]

BoolExpr MkXor ( BoolExpr  t1,
BoolExpr  t2 
)
inline

Create an expression representing t1 xor t2.

Definition at line 1008 of file Context.cs.

1009 {
1010 Debug.Assert(t1 != null);
1011 Debug.Assert(t2 != null);
1012
1013 CheckContextMatch(t1);
1014 CheckContextMatch(t2);
1015 return new BoolExpr(this, Native.Z3_mk_xor(nCtx, t1.NativeObject, t2.NativeObject));
1016 }

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

◆ MkXor() [2/2]

BoolExpr MkXor ( IEnumerable< BoolExpr ts)
inline

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

Definition at line 1021 of file Context.cs.

1022 {
1023 Debug.Assert(ts != null);
1024 Debug.Assert(ts.All(a => a != null));
1025 CheckContextMatch<BoolExpr>(ts);
1026
1027 return ts.Aggregate(MkFalse(), (r, t) =>
1028 {
1029 using (r)
1030 return MkXor(r, t);
1031 });
1032 }
BoolExpr MkXor(BoolExpr t1, BoolExpr t2)
Create an expression representing t1 xor t2.
Definition: Context.cs:1008

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

1775 {
1776 Debug.Assert(t != null);
1777
1778 CheckContextMatch(t);
1779 return new BitVecExpr(this, Native.Z3_mk_zero_ext(nCtx, i, t.NativeObject));
1780 }

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

3882 {
3883 Debug.Assert(p != null);
3884
3885 CheckContextMatch(p);
3886 return new Probe(this, Native.Z3_probe_not(nCtx, p.NativeObject));
3887 }

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

3868 {
3869 Debug.Assert(p1 != null);
3870 Debug.Assert(p2 != null);
3871
3872 CheckContextMatch(p1);
3873 CheckContextMatch(p2);
3874 return new Probe(this, Native.Z3_probe_or(nCtx, p1.NativeObject, p2.NativeObject));
3875 }

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

3560 {
3561 Debug.Assert(t1 != null);
3562 Debug.Assert(t2 != null);
3563
3564 CheckContextMatch(t1);
3565 CheckContextMatch(t2);
3566 return new Tactic(this, Native.Z3_tactic_or_else(nCtx, t1.NativeObject, t2.NativeObject));
3567 }

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

3708 {
3709 Debug.Assert(t1 != null);
3710 Debug.Assert(t2 != null);
3711
3712 CheckContextMatch(t1);
3713 CheckContextMatch(t2);
3714 return new Tactic(this, Native.Z3_tactic_par_and_then(nCtx, t1.NativeObject, t2.NativeObject));
3715 }

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

3696 {
3697 Debug.Assert(t == null || t.All(tactic => tactic != null));
3698
3699 CheckContextMatch<Tactic>(t);
3700 return new Tactic(this, Native.Z3_tactic_par_or(nCtx, Tactic.ArrayLength(t), Tactic.ArrayToNative(t)));
3701 }

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

3421 {
3422
3423 uint csn = Symbol.ArrayLength(sortNames);
3424 uint cs = Sort.ArrayLength(sorts);
3425 uint cdn = Symbol.ArrayLength(declNames);
3426 uint cd = AST.ArrayLength(decls);
3427 if (csn != cs || cdn != cd)
3428 throw new Z3Exception("Argument size mismatch");
3429 using ASTVector assertions = new ASTVector(this, Native.Z3_parse_smtlib2_file(nCtx, fileName,
3430 AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts),
3431 AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls)));
3432 return assertions.ToBoolExprArray();
3433 }

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

3402 {
3403
3404 uint csn = Symbol.ArrayLength(sortNames);
3405 uint cs = Sort.ArrayLength(sorts);
3406 uint cdn = Symbol.ArrayLength(declNames);
3407 uint cd = AST.ArrayLength(decls);
3408 if (csn != cs || cdn != cd)
3409 throw new Z3Exception("Argument size mismatch");
3410 using ASTVector assertions = new ASTVector(this, Native.Z3_parse_smtlib2_string(nCtx, str,
3411 AST.ArrayLength(sorts), Symbol.ArrayToNative(sortNames), AST.ArrayToNative(sorts),
3412 AST.ArrayLength(decls), Symbol.ArrayToNative(declNames), AST.ArrayToNative(decls)));
3413 return assertions.ToBoolExprArray();
3414 }

◆ ProbeDescription()

string ProbeDescription ( string  name)
inline

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

Definition at line 3755 of file Context.cs.

3756 {
3757
3758 return Native.Z3_probe_get_descr(nCtx, name);
3759 }

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

3621 {
3622 Debug.Assert(t != null);
3623
3624 CheckContextMatch(t);
3625 return new Tactic(this, Native.Z3_tactic_repeat(nCtx, t.NativeObject, max));
3626 }
expr max(expr const &a, expr const &b)
Definition: z3++.h:1935

◆ SbvToString()

SeqExpr SbvToString ( Expr  e)
inline

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

Definition at line 2490 of file Context.cs.

2491 {
2492 Debug.Assert(e != null);
2493 Debug.Assert(e is ArithExpr);
2494 return new SeqExpr(this, Native.Z3_mk_sbv_to_str(nCtx, e.NativeObject));
2495 }

◆ SimplifyHelp()

string SimplifyHelp ( )
inline

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

Definition at line 4732 of file Context.cs.

4733 {
4734
4735 return Native.Z3_simplify_get_help(nCtx);
4736 }

◆ Skip()

Tactic Skip ( )
inline

Create a tactic that just returns the given goal.

Definition at line 3631 of file Context.cs.

3632 {
3633
3634 return new Tactic(this, Native.Z3_tactic_skip(nCtx));
3635 }

◆ StringToInt()

IntExpr StringToInt ( Expr  e)
inline

Convert an integer expression to a string.

Definition at line 2500 of file Context.cs.

2501 {
2502 Debug.Assert(e != null);
2503 Debug.Assert(e is SeqExpr);
2504 return new IntExpr(this, Native.Z3_mk_str_to_int(nCtx, e.NativeObject));
2505 }

◆ TacticDescription()

string TacticDescription ( string  name)
inline

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

Definition at line 3493 of file Context.cs.

3494 {
3495
3496 return Native.Z3_tactic_get_descr(nCtx, name);
3497 }

◆ Then()

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

3547 {
3548 Debug.Assert(t1 != null);
3549 Debug.Assert(t2 != null);
3550 // Debug.Assert(ts == null || Contract.ForAll(0, ts.Length, j => ts[j] != null));
3551
3552 return AndThen(t1, t2, ts);
3553 }
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:3512

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

3576 {
3577 Debug.Assert(t != null);
3578
3579 CheckContextMatch(t);
3580 return new Tactic(this, Native.Z3_tactic_try_for(nCtx, t.NativeObject, ms));
3581 }

◆ UbvToString()

SeqExpr UbvToString ( Expr  e)
inline

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

Definition at line 2480 of file Context.cs.

2481 {
2482 Debug.Assert(e != null);
2483 Debug.Assert(e is ArithExpr);
2484 return new SeqExpr(this, Native.Z3_mk_ubv_to_str(nCtx, e.NativeObject));
2485 }

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

4725 {
4726 return a.NativeObject;
4727 }

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

4774 {
4775 Native.Z3_update_param_value(nCtx, id, value);
4776 }

◆ UsingParams()

Tactic UsingParams ( Tactic  t,
Params  p 
)
inline

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

Definition at line 3670 of file Context.cs.

3671 {
3672 Debug.Assert(t != null);
3673 Debug.Assert(p != null);
3674
3675 CheckContextMatch(t);
3676 CheckContextMatch(p);
3677 return new Tactic(this, Native.Z3_tactic_using_params(nCtx, t.NativeObject, p.NativeObject));
3678 }

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

3591 {
3592 Debug.Assert(p != null);
3593 Debug.Assert(t != null);
3594
3595 CheckContextMatch(t);
3596 CheckContextMatch(p);
3597 return new Tactic(this, Native.Z3_tactic_when(nCtx, p.NativeObject, t.NativeObject));
3598 }

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

3685 {
3686 Debug.Assert(t != null);
3687 Debug.Assert(p != null);
3688
3689 return UsingParams(t, p);
3690 }
Tactic UsingParams(Tactic t, Params p)
Create a tactic that applies t using the given set of parameters p .
Definition: Context.cs:3670

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

4709 {
4710 return AST.Create(this, nativeObject);
4711 }

Property Documentation

◆ ApplyResult_DRQ

IDecRefQueue ApplyResult_DRQ
get

ApplyResult DRQ

Definition at line 4908 of file Context.cs.

4908{ get { return m_ApplyResult_DRQ; } }

Referenced by Context.Dispose().

◆ AST_DRQ

IDecRefQueue AST_DRQ
get

AST DRQ

Definition at line 4893 of file Context.cs.

4893{ get { return m_AST_DRQ; } }

Referenced by Context.Dispose().

◆ ASTMap_DRQ

IDecRefQueue ASTMap_DRQ
get

ASTMap DRQ

Definition at line 4898 of file Context.cs.

4898{ get { return m_ASTMap_DRQ; } }

Referenced by Context.Dispose().

◆ ASTVector_DRQ

IDecRefQueue ASTVector_DRQ
get

ASTVector DRQ

Definition at line 4903 of file Context.cs.

4903{ get { return m_ASTVector_DRQ; } }

Referenced by Context.Dispose().

◆ BoolSort

Retrieves the Boolean sort of the context.

Definition at line 144 of file Context.cs.

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

Referenced by Context.MkBoolSort().

◆ CharSort

Retrieves the String sort of the context.

Definition at line 178 of file Context.cs.

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

◆ Fixedpoint_DRQ

IDecRefQueue Fixedpoint_DRQ
get

FixedPoint DRQ

Definition at line 4963 of file Context.cs.

4963{ get { return m_Fixedpoint_DRQ; } }

Referenced by Context.Dispose().

◆ FuncEntry_DRQ

IDecRefQueue FuncEntry_DRQ
get

FuncEntry DRQ

Definition at line 4913 of file Context.cs.

4913{ get { return m_FuncEntry_DRQ; } }

Referenced by Context.Dispose().

◆ FuncInterp_DRQ

IDecRefQueue FuncInterp_DRQ
get

FuncInterp DRQ

Definition at line 4918 of file Context.cs.

4918{ get { return m_FuncInterp_DRQ; } }

Referenced by Context.Dispose().

◆ Goal_DRQ

IDecRefQueue Goal_DRQ
get

Goal DRQ

Definition at line 4923 of file Context.cs.

4923{ get { return m_Goal_DRQ; } }

Referenced by Context.Dispose().

◆ IntSort

Retrieves the Integer sort of the context.

Definition at line 155 of file Context.cs.

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

Referenced by Context.MkIntSort().

◆ Model_DRQ

IDecRefQueue Model_DRQ
get

Model DRQ

Definition at line 4928 of file Context.cs.

4928{ get { return m_Model_DRQ; } }

Referenced by Context.Dispose().

◆ NumProbes

uint NumProbes
get

The number of supported Probes.

Definition at line 3731 of file Context.cs.

3732 {
3733 get { return Native.Z3_get_num_probes(nCtx); }
3734 }

◆ NumTactics

uint NumTactics
get

The number of supported tactics.

Definition at line 3469 of file Context.cs.

3470 {
3471 get { return Native.Z3_get_num_tactics(nCtx); }
3472 }

◆ Optimize_DRQ

IDecRefQueue Optimize_DRQ
get

Optimize DRQ

Definition at line 4968 of file Context.cs.

4968{ get { return m_Fixedpoint_DRQ; } }

Referenced by Context.Dispose().

◆ ParamDescrs_DRQ

IDecRefQueue ParamDescrs_DRQ
get

ParamDescrs DRQ

Definition at line 4938 of file Context.cs.

4938{ get { return m_ParamDescrs_DRQ; } }

Referenced by Context.Dispose().

◆ Params_DRQ

IDecRefQueue Params_DRQ
get

Params DRQ

Definition at line 4933 of file Context.cs.

4933{ get { return m_Params_DRQ; } }

Referenced by Context.Dispose().

◆ PrintMode

Z3_ast_print_mode PrintMode
set

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

3390 {
3391 set { Native.Z3_set_ast_print_mode(nCtx, (uint)value); }
3392 }

◆ Probe_DRQ

IDecRefQueue Probe_DRQ
get

Probe DRQ

Definition at line 4943 of file Context.cs.

4943{ get { return m_Probe_DRQ; } }

Referenced by Context.Dispose().

◆ ProbeNames

string [] ProbeNames
get

The names of all supported Probes.

Definition at line 3739 of file Context.cs.

3740 {
3741 get
3742 {
3743
3744 uint n = NumProbes;
3745 string[] res = new string[n];
3746 for (uint i = 0; i < n; i++)
3747 res[i] = Native.Z3_get_probe_name(nCtx, i);
3748 return res;
3749 }
3750 }
uint NumProbes
The number of supported Probes.
Definition: Context.cs:3732

◆ RealSort

Retrieves the Real sort of the context.

Definition at line 167 of file Context.cs.

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

Referenced by Context.MkRealSort().

◆ SimplifyParameterDescriptions

ParamDescrs SimplifyParameterDescriptions
get

Retrieves parameter descriptions for simplifier.

Definition at line 4741 of file Context.cs.

4742 {
4743 get { return new ParamDescrs(this, Native.Z3_simplify_get_param_descrs(nCtx)); }
4744 }

◆ Solver_DRQ

IDecRefQueue Solver_DRQ
get

Solver DRQ

Definition at line 4948 of file Context.cs.

4948{ get { return m_Solver_DRQ; } }

Referenced by Context.Dispose().

◆ Statistics_DRQ

IDecRefQueue Statistics_DRQ
get

Statistics DRQ

Definition at line 4953 of file Context.cs.

4953{ get { return m_Statistics_DRQ; } }

Referenced by Context.Dispose().

◆ StringSort

SeqSort StringSort
get

Retrieves the String sort of the context.

Definition at line 190 of file Context.cs.

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

◆ Tactic_DRQ

IDecRefQueue Tactic_DRQ
get

Tactic DRQ

Definition at line 4958 of file Context.cs.

4958{ get { return m_Tactic_DRQ; } }

Referenced by Context.Dispose().

◆ TacticNames

string [] TacticNames
get

The names of all supported tactics.

Definition at line 3477 of file Context.cs.

3478 {
3479 get
3480 {
3481
3482 uint n = NumTactics;
3483 string[] res = new string[n];
3484 for (uint i = 0; i < n; i++)
3485 res[i] = Native.Z3_get_tactic_name(nCtx, i);
3486 return res;
3487 }
3488 }
uint NumTactics
The number of supported tactics.
Definition: Context.cs:3470