Integer and Real expressions.
Definition at line 2430 of file z3py.py.
◆ __add__() def __add__ ( self, other )Create the Z3 expression `self + other`. >>> x = Int('x') >>> y = Int('y') >>> x + y x + y >>> (x + y).sort() Int
Definition at line 2468 of file z3py.py.
2468 def__add__(self, other):
2469 """Create the Z3 expression `self + other`. 2478a, b = _coerce_exprs(self, other)
2479 returnArithRef(_mk_bin(Z3_mk_add, a, b), self.ctx)
◆ __div__() def __div__ ( self, other )Create the Z3 expression `other/self`. >>> x = Int('x') >>> y = Int('y') >>> x/y x/y >>> (x/y).sort() Int >>> (x/y).sexpr() '(div x y)' >>> x = Real('x') >>> y = Real('y') >>> x/y x/y >>> (x/y).sort() Real >>> (x/y).sexpr() '(/ x y)'
Definition at line 2567 of file z3py.py.
2567 def__div__(self, other):
2568 """Create the Z3 expression `other/self`. 2587a, b = _coerce_exprs(self, other)
2588 returnArithRef(
Z3_mk_div(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_div(Z3_context c, Z3_ast arg1, Z3_ast arg2)
Create an AST node representing arg1 div arg2.
Referenced by ArithRef.__truediv__(), BitVecRef.__truediv__(), and FPRef.__truediv__().
◆ __ge__() def __ge__ ( self, other )Create the Z3 expression `other >= self`. >>> x, y = Ints('x y') >>> x >= y x >= y >>> y = Real('y') >>> x >= y ToReal(x) >= y
Definition at line 2701 of file z3py.py.
2701 def__ge__(self, other):
2702 """Create the Z3 expression `other >= self`. 2704 >>> x, y = Ints('x y') 2711a, b = _coerce_exprs(self, other)
2712 returnBoolRef(
Z3_mk_ge(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_ge(Z3_context c, Z3_ast t1, Z3_ast t2)
Create greater than or equal to.
◆ __gt__() def __gt__ ( self, other )Create the Z3 expression `other > self`. >>> x, y = Ints('x y') >>> x > y x > y >>> y = Real('y') >>> x > y ToReal(x) > y
Definition at line 2688 of file z3py.py.
2688 def__gt__(self, other):
2689 """Create the Z3 expression `other > self`. 2691 >>> x, y = Ints('x y') 2698a, b = _coerce_exprs(self, other)
2699 returnBoolRef(
Z3_mk_gt(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_gt(Z3_context c, Z3_ast t1, Z3_ast t2)
Create greater than.
◆ __le__() def __le__ ( self, other )Create the Z3 expression `other <= self`. >>> x, y = Ints('x y') >>> x <= y x <= y >>> y = Real('y') >>> x <= y ToReal(x) <= y
Definition at line 2662 of file z3py.py.
2662 def__le__(self, other):
2663 """Create the Z3 expression `other <= self`. 2665 >>> x, y = Ints('x y') 2672a, b = _coerce_exprs(self, other)
2673 returnBoolRef(
Z3_mk_le(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_le(Z3_context c, Z3_ast t1, Z3_ast t2)
Create less than or equal to.
◆ __lt__() def __lt__ ( self, other )Create the Z3 expression `other < self`. >>> x, y = Ints('x y') >>> x < y x < y >>> y = Real('y') >>> x < y ToReal(x) < y
Definition at line 2675 of file z3py.py.
2675 def__lt__(self, other):
2676 """Create the Z3 expression `other < self`. 2678 >>> x, y = Ints('x y') 2685a, b = _coerce_exprs(self, other)
2686 returnBoolRef(
Z3_mk_lt(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_lt(Z3_context c, Z3_ast t1, Z3_ast t2)
Create less than.
◆ __mod__() def __mod__ ( self, other )Create the Z3 expression `other%self`. >>> x = Int('x') >>> y = Int('y') >>> x % y x%y >>> simplify(IntVal(10) % IntVal(3)) 1
Definition at line 2615 of file z3py.py.
2615 def__mod__(self, other):
2616 """Create the Z3 expression `other%self`. 2622 >>> simplify(IntVal(10) % IntVal(3)) 2625a, b = _coerce_exprs(self, other)
2627_z3_assert(a.is_int(),
"Z3 integer expression expected")
2628 returnArithRef(
Z3_mk_mod(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_mod(Z3_context c, Z3_ast arg1, Z3_ast arg2)
Create an AST node representing arg1 mod arg2.
◆ __mul__() def __mul__ ( self, other )Create the Z3 expression `self * other`. >>> x = Real('x') >>> y = Real('y') >>> x * y x*y >>> (x * y).sort() Real
Definition at line 2491 of file z3py.py.
2491 def__mul__(self, other):
2492 """Create the Z3 expression `self * other`. 2501 ifisinstance(other, BoolRef):
2502 return If(other, self, 0)
2503a, b = _coerce_exprs(self, other)
2504 returnArithRef(_mk_bin(Z3_mk_mul, a, b), self.ctx)
def If(a, b, c, ctx=None)
◆ __neg__()Return an expression representing `-self`. >>> x = Int('x') >>> -x -x >>> simplify(-(-x)) x
Definition at line 2642 of file z3py.py.
2643 """Return an expression representing `-self`.Z3_ast Z3_API Z3_mk_unary_minus(Z3_context c, Z3_ast arg)
Create an AST node representing - arg.
◆ __pos__()Return `self`. >>> x = Int('x') >>> +x x
Definition at line 2653 of file z3py.py.
◆ __pow__() def __pow__ ( self, other )Create the Z3 expression `self**other` (** is the power operator). >>> x = Real('x') >>> x**3 x**3 >>> (x**3).sort() Real >>> simplify(IntVal(2)**8) 256
Definition at line 2539 of file z3py.py.
2539 def__pow__(self, other):
2540 """Create the Z3 expression `self**other` (** is the power operator). 2547 >>> simplify(IntVal(2)**8) 2550a, b = _coerce_exprs(self, other)
2551 returnArithRef(
Z3_mk_power(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_power(Z3_context c, Z3_ast arg1, Z3_ast arg2)
Create an AST node representing arg1 ^ arg2.
◆ __radd__() def __radd__ ( self, other )Create the Z3 expression `other + self`. >>> x = Int('x') >>> 10 + x 10 + x
Definition at line 2481 of file z3py.py.
2481 def__radd__(self, other):
2482 """Create the Z3 expression `other + self`. 2488a, b = _coerce_exprs(self, other)
2489 returnArithRef(_mk_bin(Z3_mk_add, b, a), self.ctx)
◆ __rdiv__() def __rdiv__ ( self, other )Create the Z3 expression `other/self`. >>> x = Int('x') >>> 10/x 10/x >>> (10/x).sexpr() '(div 10 x)' >>> x = Real('x') >>> 10/x 10/x >>> (10/x).sexpr() '(/ 10.0 x)'
Definition at line 2594 of file z3py.py.
2594 def__rdiv__(self, other):
2595 """Create the Z3 expression `other/self`. 2608a, b = _coerce_exprs(self, other)
2609 returnArithRef(
Z3_mk_div(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
Referenced by ArithRef.__rtruediv__(), BitVecRef.__rtruediv__(), and FPRef.__rtruediv__().
◆ __rmod__() def __rmod__ ( self, other )Create the Z3 expression `other%self`. >>> x = Int('x') >>> 10 % x 10%x
Definition at line 2630 of file z3py.py.
2630 def__rmod__(self, other):
2631 """Create the Z3 expression `other%self`. 2637a, b = _coerce_exprs(self, other)
2639_z3_assert(a.is_int(),
"Z3 integer expression expected")
2640 returnArithRef(
Z3_mk_mod(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
◆ __rmul__() def __rmul__ ( self, other )Create the Z3 expression `other * self`. >>> x = Real('x') >>> 10 * x 10*x
Definition at line 2506 of file z3py.py.
2506 def__rmul__(self, other):
2507 """Create the Z3 expression `other * self`. 2513a, b = _coerce_exprs(self, other)
2514 returnArithRef(_mk_bin(Z3_mk_mul, b, a), self.ctx)
◆ __rpow__() def __rpow__ ( self, other )Create the Z3 expression `other**self` (** is the power operator). >>> x = Real('x') >>> 2**x 2**x >>> (2**x).sort() Real >>> simplify(2**IntVal(8)) 256
Definition at line 2553 of file z3py.py.
2553 def__rpow__(self, other):
2554 """Create the Z3 expression `other**self` (** is the power operator). 2561 >>> simplify(2**IntVal(8)) 2564a, b = _coerce_exprs(self, other)
2565 returnArithRef(
Z3_mk_power(self.ctx_ref(), b.as_ast(), a.as_ast()), self.ctx)
◆ __rsub__() def __rsub__ ( self, other )Create the Z3 expression `other - self`. >>> x = Int('x') >>> 10 - x 10 - x
Definition at line 2529 of file z3py.py.
2529 def__rsub__(self, other):
2530 """Create the Z3 expression `other - self`. 2536a, b = _coerce_exprs(self, other)
2537 returnArithRef(_mk_bin(Z3_mk_sub, b, a), self.ctx)
◆ __rtruediv__() def __rtruediv__ ( self, other )Create the Z3 expression `other/self`.
Definition at line 2611 of file z3py.py.
2611 def__rtruediv__(self, other):
2612 """Create the Z3 expression `other/self`.""" 2613 returnself.__rdiv__(other)
◆ __sub__() def __sub__ ( self, other )Create the Z3 expression `self - other`. >>> x = Int('x') >>> y = Int('y') >>> x - y x - y >>> (x - y).sort() Int
Definition at line 2516 of file z3py.py.
2516 def__sub__(self, other):
2517 """Create the Z3 expression `self - other`. 2526a, b = _coerce_exprs(self, other)
2527 returnArithRef(_mk_bin(Z3_mk_sub, a, b), self.ctx)
◆ __truediv__() def __truediv__ ( self, other )Create the Z3 expression `other/self`.
Definition at line 2590 of file z3py.py.
2590 def__truediv__(self, other):
2591 """Create the Z3 expression `other/self`.""" 2592 returnself.__div__(other)
◆ is_int()Return `True` if `self` is an integer expression. >>> x = Int('x') >>> x.is_int() True >>> (x + 1).is_int() True >>> y = Real('y') >>> (x + y).is_int() False
Reimplemented in RatNumRef.
Definition at line 2443 of file z3py.py.
2444 """Return `True` if `self` is an integer expression. 2449 >>> (x + 1).is_int() 2452 >>> (x + y).is_int() 2455 returnself.sort().
is_int()
Referenced by IntNumRef.as_long(), and ArithSortRef.subsort().
◆ is_real()Return `True` if `self` is an real expression. >>> x = Real('x') >>> x.is_real() True >>> (x + 1).is_real() True
Reimplemented in RatNumRef.
Definition at line 2457 of file z3py.py.
2458 """Return `True` if `self` is an real expression. 2463 >>> (x + 1).is_real() 2466 returnself.sort().
is_real()
◆ sort()Return the sort (type) of the arithmetical expression `self`. >>> Int('x').sort() Int >>> (Real('x') + 1).sort() Real
Reimplemented from ExprRef.
Definition at line 2433 of file z3py.py.
2434 """Return the sort (type) of the arithmetical expression `self`. 2438 >>> (Real('x') + 1).sort() 2441 returnArithSortRef(
Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
Z3_sort Z3_API Z3_get_sort(Z3_context c, Z3_ast a)
Return the sort of an AST node.
Referenced by FPNumRef.as_string(), ArrayRef.domain(), ArrayRef.domain_n(), FPRef.ebits(), ArithRef.is_int(), ArithRef.is_real(), ArrayRef.range(), FPRef.sbits(), BitVecRef.size(), and ExprRef.sort_kind().
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4