A Z3 expression is used to represent formulas and terms. For Z3, a formula is any expression of sort Boolean. Every expression has a sort. More...
Public Member Functions | |
expr (context &c) | |
expr (context &c, Z3_ast n) | |
expr (expr const &n) | |
expr & | operator= (expr const &n) |
sort | get_sort () const |
Return the sort of this expression. More... | |
bool | is_bool () const |
Return true if this is a Boolean expression. More... | |
bool | is_int () const |
Return true if this is an integer expression. More... | |
bool | is_real () const |
Return true if this is a real expression. More... | |
bool | is_arith () const |
Return true if this is an integer or real expression. More... | |
bool | is_bv () const |
Return true if this is a Bit-vector expression. More... | |
bool | is_array () const |
Return true if this is a Array expression. More... | |
bool | is_datatype () const |
Return true if this is a Datatype expression. More... | |
bool | is_relation () const |
Return true if this is a Relation expression. More... | |
bool | is_seq () const |
Return true if this is a sequence expression. More... | |
bool | is_re () const |
Return true if this is a regular expression. More... | |
bool | is_finite_domain () const |
Return true if this is a Finite-domain expression. More... | |
bool | is_fpa () const |
Return true if this is a FloatingPoint expression. . More... | |
bool | is_numeral () const |
Return true if this expression is a numeral. Specialized functions also return representations for the numerals as small integers, 64 bit integers or rational or decimal strings. More... | |
bool | is_numeral_i64 (int64_t &i) const |
bool | is_numeral_u64 (uint64_t &i) const |
bool | is_numeral_i (int &i) const |
bool | is_numeral_u (unsigned &i) const |
bool | is_numeral (std::string &s) const |
bool | is_numeral (std::string &s, unsigned precision) const |
bool | is_numeral (double &d) const |
bool | is_app () const |
Return true if this expression is an application. More... | |
bool | is_const () const |
Return true if this expression is a constant (i.e., an application with 0 arguments). More... | |
bool | is_quantifier () const |
Return true if this expression is a quantifier. More... | |
bool | is_forall () const |
Return true if this expression is a universal quantifier. More... | |
bool | is_exists () const |
Return true if this expression is an existential quantifier. More... | |
bool | is_lambda () const |
Return true if this expression is a lambda expression. More... | |
bool | is_var () const |
Return true if this expression is a variable. More... | |
bool | is_algebraic () const |
Return true if expression is an algebraic number. More... | |
bool | is_well_sorted () const |
Return true if this expression is well sorted (aka type correct). More... | |
std::string | get_decimal_string (int precision) const |
Return string representation of numeral or algebraic number This method assumes the expression is numeral or algebraic. More... | |
int | get_numeral_int () const |
Return int value of numeral, throw if result cannot fit in machine int. More... | |
unsigned | get_numeral_uint () const |
Return uint value of numeral, throw if result cannot fit in machine uint. More... | |
int64_t | get_numeral_int64 () const |
Return int64_t value of numeral, throw if result cannot fit in int64_t . More... | |
uint64_t | get_numeral_uint64 () const |
Return uint64_t value of numeral, throw if result cannot fit in uint64_t . More... | |
Z3_lbool | bool_value () const |
expr | numerator () const |
expr | denominator () const |
operator Z3_app () const | |
sort | fpa_rounding_mode () |
Return a RoundingMode sort. More... | |
func_decl | decl () const |
Return the declaration associated with this application. This method assumes the expression is an application. More... | |
unsigned | num_args () const |
Return the number of arguments in this application. This method assumes the expression is an application. More... | |
expr | arg (unsigned i) const |
Return the i-th argument of this application. This method assumes the expression is an application. More... | |
expr | body () const |
Return the 'body' of this quantifier. More... | |
bool | is_true () const |
bool | is_false () const |
bool | is_not () const |
bool | is_and () const |
bool | is_or () const |
bool | is_xor () const |
bool | is_implies () const |
bool | is_eq () const |
bool | is_ite () const |
expr | rotate_left (unsigned i) |
expr | rotate_right (unsigned i) |
expr | repeat (unsigned i) |
expr | extract (unsigned hi, unsigned lo) const |
unsigned | lo () const |
unsigned | hi () const |
expr | extract (expr const &offset, expr const &length) const |
sequence and regular expression operations. More... | |
expr | replace (expr const &src, expr const &dst) const |
expr | unit () const |
expr | contains (expr const &s) |
expr | at (expr const &index) const |
expr | length () const |
expr | stoi () const |
expr | itos () const |
expr | loop (unsigned lo) |
create a looping regular expression. More... | |
expr | loop (unsigned lo, unsigned hi) |
expr | simplify () const |
Return a simplified version of this expression. More... | |
expr | simplify (params const &p) const |
Return a simplified version of this expression. The parameter p is a set of parameters for the Z3 simplifier. More... | |
expr | substitute (expr_vector const &src, expr_vector const &dst) |
Apply substitution. Replace src expressions by dst. More... | |
expr | substitute (expr_vector const &dst) |
Apply substitution. Replace bound variables by expressions. More... | |
![]() | |
ast (context &c) | |
ast (context &c, Z3_ast n) | |
ast (ast const &s) | |
~ast () | |
operator Z3_ast () const | |
operator bool () const | |
ast & | operator= (ast const &s) |
Z3_ast_kind | kind () const |
unsigned | hash () const |
std::string | to_string () const |
![]() | |
object (context &c) | |
object (object const &s) | |
context & | ctx () const |
Z3_error_code | check_error () const |
Friends | |
expr | operator! (expr const &a) |
Return an expression representing not(a) . More... | |
expr | operator && (expr const &a, expr const &b) |
Return an expression representing a and b . More... | |
expr | operator && (expr const &a, bool b) |
Return an expression representing a and b . The C++ Boolean value b is automatically converted into a Z3 Boolean constant. More... | |
expr | operator && (bool a, expr const &b) |
Return an expression representing a and b . The C++ Boolean value a is automatically converted into a Z3 Boolean constant. More... | |
expr | operator|| (expr const &a, expr const &b) |
Return an expression representing a or b . More... | |
expr | operator|| (expr const &a, bool b) |
Return an expression representing a or b . The C++ Boolean value b is automatically converted into a Z3 Boolean constant. More... | |
expr | operator|| (bool a, expr const &b) |
Return an expression representing a or b . The C++ Boolean value a is automatically converted into a Z3 Boolean constant. More... | |
expr | implies (expr const &a, expr const &b) |
expr | implies (expr const &a, bool b) |
expr | implies (bool a, expr const &b) |
expr | mk_or (expr_vector const &args) |
expr | mk_and (expr_vector const &args) |
expr | ite (expr const &c, expr const &t, expr const &e) |
Create the if-then-else expression ite(c, t, e) More... | |
expr | distinct (expr_vector const &args) |
expr | concat (expr const &a, expr const &b) |
expr | concat (expr_vector const &args) |
expr | operator== (expr const &a, expr const &b) |
expr | operator== (expr const &a, int b) |
expr | operator== (int a, expr const &b) |
expr | operator!= (expr const &a, expr const &b) |
expr | operator!= (expr const &a, int b) |
expr | operator!= (int a, expr const &b) |
expr | operator+ (expr const &a, expr const &b) |
expr | operator+ (expr const &a, int b) |
expr | operator+ (int a, expr const &b) |
expr | sum (expr_vector const &args) |
expr | operator* (expr const &a, expr const &b) |
expr | operator* (expr const &a, int b) |
expr | operator* (int a, expr const &b) |
expr | pw (expr const &a, expr const &b) |
expr | pw (expr const &a, int b) |
expr | pw (int a, expr const &b) |
expr | mod (expr const &a, expr const &b) |
expr | mod (expr const &a, int b) |
expr | mod (int a, expr const &b) |
expr | rem (expr const &a, expr const &b) |
expr | rem (expr const &a, int b) |
expr | rem (int a, expr const &b) |
expr | is_int (expr const &e) |
expr | operator/ (expr const &a, expr const &b) |
expr | operator/ (expr const &a, int b) |
expr | operator/ (int a, expr const &b) |
expr | operator- (expr const &a) |
expr | operator- (expr const &a, expr const &b) |
expr | operator- (expr const &a, int b) |
expr | operator- (int a, expr const &b) |
expr | operator<= (expr const &a, expr const &b) |
expr | operator<= (expr const &a, int b) |
expr | operator<= (int a, expr const &b) |
expr | operator>= (expr const &a, expr const &b) |
expr | operator>= (expr const &a, int b) |
expr | operator>= (int a, expr const &b) |
expr | operator< (expr const &a, expr const &b) |
expr | operator< (expr const &a, int b) |
expr | operator< (int a, expr const &b) |
expr | operator> (expr const &a, expr const &b) |
expr | operator> (expr const &a, int b) |
expr | operator> (int a, expr const &b) |
expr | pble (expr_vector const &es, int const *coeffs, int bound) |
expr | pbge (expr_vector const &es, int const *coeffs, int bound) |
expr | pbeq (expr_vector const &es, int const *coeffs, int bound) |
expr | atmost (expr_vector const &es, unsigned bound) |
expr | atleast (expr_vector const &es, unsigned bound) |
expr | operator & (expr const &a, expr const &b) |
expr | operator & (expr const &a, int b) |
expr | operator & (int a, expr const &b) |
expr | operator^ (expr const &a, expr const &b) |
expr | operator^ (expr const &a, int b) |
expr | operator^ (int a, expr const &b) |
expr | operator| (expr const &a, expr const &b) |
expr | operator| (expr const &a, int b) |
expr | operator| (int a, expr const &b) |
expr | nand (expr const &a, expr const &b) |
expr | nor (expr const &a, expr const &b) |
expr | xnor (expr const &a, expr const &b) |
expr | min (expr const &a, expr const &b) |
expr | max (expr const &a, expr const &b) |
expr | abs (expr const &a) |
expr | sqrt (expr const &a, expr const &rm) |
expr | operator~ (expr const &a) |
expr | fma (expr const &a, expr const &b, expr const &c) |
FloatingPoint fused multiply-add. More... | |
expr | range (expr const &lo, expr const &hi) |
Additional Inherited Members | |
![]() | |
Z3_ast | m_ast |
![]() | |
context * | m_ctx |
A Z3 expression is used to represent formulas and terms. For Z3, a formula is any expression of sort Boolean. Every expression has a sort.
Definition at line 645 of file z3++.h.
Referenced by expr::arg(), expr::at(), expr::body(), expr::contains(), expr::denominator(), expr::extract(), expr::itos(), expr::length(), expr::loop(), expr::numerator(), expr::repeat(), expr::replace(), expr::rotate_left(), expr::rotate_right(), expr::simplify(), expr::stoi(), expr::substitute(), and expr::unit().
|
inline |
Return the i-th argument of this application. This method assumes the expression is an application.
Definition at line 901 of file z3++.h.
Referenced by AstRef::__bool__().
Definition at line 1115 of file z3++.h.
|
inline |
Return the 'body' of this quantifier.
Definition at line 908 of file z3++.h.
|
inline |
Definition at line 1109 of file z3++.h.
|
inline |
Return the declaration associated with this application. This method assumes the expression is an application.
Definition at line 886 of file z3++.h.
Referenced by expr::hi(), expr::is_and(), expr::is_eq(), expr::is_false(), expr::is_implies(), expr::is_ite(), expr::is_not(), expr::is_or(), expr::is_true(), expr::is_xor(), and expr::lo().
|
inline |
Definition at line 860 of file z3++.h.
|
inline |
Definition at line 1080 of file z3++.h.
sequence and regular expression operations.
Definition at line 1094 of file z3++.h.
|
inline |
Return a RoundingMode sort.
Definition at line 872 of file z3++.h.
|
inline |
Return string representation of numeral or algebraic number This method assumes the expression is numeral or algebraic.
Definition at line 769 of file z3++.h.
|
inline |
Return int value of numeral, throw if result cannot fit in machine int.
It only makes sense to use this function if the caller can ensure that the result is an integer or if exceptions are enabled. If exceptions are disabled, then use the is_numeral_i function.
Definition at line 784 of file z3++.h.
|
inline |
Return int64_t
value of numeral, throw if result cannot fit in int64_t
.
Definition at line 820 of file z3++.h.
|
inline |
Return uint value of numeral, throw if result cannot fit in machine uint.
It only makes sense to use this function if the caller can ensure that the result is an integer or if exceptions are enabled. If exceptions are disabled, then use the is_numeral_u function.
Definition at line 803 of file z3++.h.
|
inline |
Return uint64_t
value of numeral, throw if result cannot fit in uint64_t
.
Definition at line 837 of file z3++.h.
|
inline |
Return the sort of this expression.
Definition at line 653 of file z3++.h.
Referenced by z3::ashr(), z3::concat(), expr::is_arith(), expr::is_array(), expr::is_bool(), expr::is_bv(), expr::is_datatype(), expr::is_finite_domain(), expr::is_fpa(), expr::is_int(), expr::is_re(), expr::is_real(), expr::is_relation(), expr::is_seq(), z3::lshr(), z3::mod(), z3::operator &(), z3::operator!=(), z3::operator*(), z3::operator+(), z3::operator-(), z3::operator/(), z3::operator<(), z3::operator<=(), z3::operator==(), z3::operator>(), z3::operator>=(), z3::operator^(), z3::operator|(), z3::pw(), z3::rem(), z3::select(), z3::shl(), z3::smod(), z3::srem(), z3::store(), z3::udiv(), z3::uge(), z3::ugt(), z3::ule(), z3::ult(), and z3::urem().
|
inline |
Definition at line 1082 of file z3++.h.
Referenced by expr::extract(), and expr::loop().
|
inline |
Return true if expression is an algebraic number.
Definition at line 756 of file z3++.h.
Referenced by expr::get_decimal_string().
|
inline |
Definition at line 976 of file z3++.h.
|
inline |
Return true if this expression is an application.
Definition at line 726 of file z3++.h.
Referenced by expr::hi(), expr::is_and(), expr::is_const(), expr::is_eq(), expr::is_false(), expr::is_implies(), expr::is_ite(), expr::is_not(), expr::is_or(), expr::is_true(), expr::is_xor(), expr::lo(), and expr::operator Z3_app().
|
inline |
Return true if this is an integer or real expression.
Definition at line 670 of file z3++.h.
Referenced by z3::max(), z3::min(), z3::operator!=(), z3::operator*(), z3::operator+(), z3::operator-(), z3::operator/(), z3::operator<(), z3::operator<=(), z3::operator==(), z3::operator>(), and z3::operator>=().
|
inline |
Return true if this is a Array expression.
Definition at line 678 of file z3++.h.
|
inline |
Return true if this is a Boolean expression.
Definition at line 658 of file z3++.h.
Referenced by solver::add(), optimize::add(), z3::implies(), z3::ite(), z3::operator &&(), z3::operator!(), and z3::operator||().
|
inline |
Return true if this is a Bit-vector expression.
Definition at line 674 of file z3++.h.
Referenced by z3::max(), z3::min(), z3::operator!=(), z3::operator*(), z3::operator+(), z3::operator-(), z3::operator/(), z3::operator<(), z3::operator<=(), z3::operator==(), z3::operator>(), and z3::operator>=().
|
inline |
Return true if this expression is a constant (i.e., an application with 0 arguments).
Definition at line 730 of file z3++.h.
Referenced by solver::add().
|
inline |
Return true if this is a Datatype expression.
Definition at line 682 of file z3++.h.
|
inline |
Definition at line 980 of file z3++.h.
|
inline |
|
inline |
Definition at line 974 of file z3++.h.
|
inline |
Return true if this is a Finite-domain expression.
Definition at line 704 of file z3++.h.
|
inline |
|
inline |
Return true if this is a FloatingPoint expression. .
Definition at line 708 of file z3++.h.
Referenced by z3::fma(), expr::fpa_rounding_mode(), z3::max(), z3::min(), z3::operator!=(), z3::operator*(), z3::operator+(), z3::operator-(), z3::operator/(), z3::operator<(), z3::operator<=(), z3::operator==(), z3::operator>(), z3::rem(), and z3::sqrt().
|
inline |
Definition at line 979 of file z3++.h.
|
inline |
Return true if this is an integer expression.
Definition at line 662 of file z3++.h.
Referenced by z3::abs().
|
inline |
Definition at line 981 of file z3++.h.
|
inline |
|
inline |
Definition at line 975 of file z3++.h.
|
inline |
Return true if this expression is a numeral. Specialized functions also return representations for the numerals as small integers, 64 bit integers or rational or decimal strings.
Definition at line 715 of file z3++.h.
Referenced by expr::denominator(), expr::get_decimal_string(), expr::get_numeral_int64(), expr::get_numeral_uint(), expr::get_numeral_uint64(), and expr::numerator().
|
inline |
Definition at line 720 of file z3++.h.
Referenced by expr::is_numeral().
|
inline |
Definition at line 721 of file z3++.h.
Referenced by expr::is_numeral().
|
inline |
Definition at line 722 of file z3++.h.
Referenced by expr::is_numeral().
|
inline |
Definition at line 718 of file z3++.h.
Referenced by expr::get_numeral_int().
|
inline |
Definition at line 716 of file z3++.h.
Referenced by expr::get_numeral_int64().
|
inline |
Definition at line 719 of file z3++.h.
Referenced by expr::get_numeral_uint().
|
inline |
Definition at line 717 of file z3++.h.
Referenced by expr::get_numeral_uint64().
|
inline |
Definition at line 977 of file z3++.h.
|
inline |
Return true if this expression is a quantifier.
Definition at line 734 of file z3++.h.
Referenced by expr::body().
|
inline |
Return true if this is a regular expression.
Definition at line 694 of file z3++.h.
Referenced by z3::operator+().
|
inline |
Return true if this is a real expression.
Definition at line 666 of file z3++.h.
Referenced by z3::abs().
|
inline |
Return true if this is a Relation expression.
Definition at line 686 of file z3++.h.
|
inline |
Return true if this is a sequence expression.
Definition at line 690 of file z3++.h.
Referenced by z3::operator+().
|
inline |
Definition at line 973 of file z3++.h.
|
inline |
Return true if this expression is a variable.
Definition at line 752 of file z3++.h.
|
inline |
|
inline |
Definition at line 978 of file z3++.h.
|
inline |
Definition at line 1121 of file z3++.h.
Referenced by expr::extract().
|
inline |
Definition at line 1081 of file z3++.h.
Referenced by expr::extract(), and expr::loop().
|
inline |
|
inline |
|
inline |
Return the number of arguments in this application. This method assumes the expression is an application.
Definition at line 893 of file z3++.h.
Referenced by AstRef::__bool__(), and expr::is_const().
|
inline |
Definition at line 852 of file z3++.h.
|
inline |
Definition at line 867 of file z3++.h.
|
inline |
Definition at line 1074 of file z3++.h.
Definition at line 1098 of file z3++.h.
|
inline |
Definition at line 1072 of file z3++.h.
|
inline |
Definition at line 1073 of file z3++.h.
|
inline |
|
inline |
Apply substitution. Replace src expressions by dst.
Definition at line 3301 of file z3++.h.
|
inline |
|
friend |
Definition at line 1876 of file z3++.h.
|
friend |
Definition at line 1868 of file z3++.h.
Definition at line 1902 of file z3++.h.
|
friend |
Definition at line 1920 of file z3++.h.
|
friend |
Definition at line 1893 of file z3++.h.
FloatingPoint fused multiply-add.
Create the if-then-else expression ite(c, t, e)
Definition at line 1550 of file z3++.h.
Definition at line 1499 of file z3++.h.
Definition at line 1484 of file z3++.h.
|
friend |
|
friend |
Definition at line 1481 of file z3++.h.
Definition at line 1482 of file z3++.h.
Definition at line 1469 of file z3++.h.
Return an expression representing a and b
.
Definition at line 1221 of file z3++.h.
Return an expression representing a and b
. The C++ Boolean value b
is automatically converted into a Z3 Boolean constant.
Return an expression representing a and b
. The C++ Boolean value a
is automatically converted into a Z3 Boolean constant.
Return an expression representing not(a)
.
Definition at line 1215 of file z3++.h.
Definition at line 1255 of file z3++.h.
Definition at line 1295 of file z3++.h.
Definition at line 1265 of file z3++.h.
Definition at line 1377 of file z3++.h.
Definition at line 1336 of file z3++.h.
Definition at line 1425 of file z3++.h.
Definition at line 1400 of file z3++.h.
Definition at line 1246 of file z3++.h.
Definition at line 1447 of file z3++.h.
Definition at line 1319 of file z3++.h.
Definition at line 1473 of file z3++.h.
Definition at line 1477 of file z3++.h.
Return an expression representing a or b
.
Definition at line 1233 of file z3++.h.
Return an expression representing a or b
. The C++ Boolean value b
is automatically converted into a Z3 Boolean constant.
Return an expression representing a or b
. The C++ Boolean value a
is automatically converted into a Z3 Boolean constant.
|
friend |
Definition at line 1860 of file z3++.h.
|
friend |
Definition at line 1852 of file z3++.h.
|
friend |
Definition at line 1844 of file z3++.h.
Definition at line 3244 of file z3++.h.
Definition at line 1529 of file z3++.h.
|
friend |
Definition at line 1884 of file z3++.h.
Definition at line 1483 of file z3++.h.