Public Member Functions
BoolRef Class Reference
+ Inheritance diagram for BoolRef:

Public Member Functions

def sort (self)
def __rmul__ (self, other)
def __mul__ (self, other)
- Public Member Functions inherited from ExprRef
def as_ast (self)
def get_id (self)
def sort_kind (self)
def __eq__ (self, other)
def __hash__ (self)
def __ne__ (self, other)
def params (self)
def decl (self)
def num_args (self)
def arg (self, idx)
def children (self)
def from_string (self, s)
def serialize (self)
- Public Member Functions inherited from AstRef
def __init__ (self, ast, ctx=None)
def __del__ (self)
def __deepcopy__ (self, memo={})
def __str__ (self)
def __repr__ (self)
def __nonzero__ (self)
def __bool__ (self)
def sexpr (self)
def ctx_ref (self)
def eq (self, other)
def translate (self, target)
def __copy__ (self)
def hash (self)
- Public Member Functions inherited from Z3PPObject
def use_pp (self)

Additional Inherited Members

- Data Fields inherited from AstRef

Detailed Description

All Boolean expressions are instances of this class.

Definition at line 1550 of file z3py.py.

Member Function Documentation

◆ __mul__()

def __mul__ (   self,
Create the Z3 expression `self * other`.

Definition at line 1559 of file z3py.py.

1559  def __mul__(self, other):
1560  """Create the Z3 expression `self * other`.
1561  """
1562  if isinstance(other, int) and other == 1:
1563  return If(self, 1, 0)
1564  if isinstance(other, int) and other == 0:
1565  return IntVal(0, self.ctx)
1566  if isinstance(other, BoolRef):
1567  other = If(other, 1, 0)
1568  return If(self, other, 0)
def If(a, b, c, ctx=None)
Definition: z3py.py:1381
def IntVal(val, ctx=None)
Definition: z3py.py:3188

◆ __rmul__()

def __rmul__ (   self,

Definition at line 1556 of file z3py.py.

1556  def __rmul__(self, other):
1557  return self * other

◆ sort()

def sort (   self)
Return the sort of expression `self`.

>>> x = Int('x')
>>> (x + 1).sort()
>>> y = Real('y')
>>> (x + y).sort()

Reimplemented from ExprRef.

Reimplemented in QuantifierRef.

Definition at line 1553 of file z3py.py.

1553  def sort(self):
1554  return BoolSortRef(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().