Z3
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)
 
- 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
 ast
 
 ctx
 

Detailed Description

All Boolean expressions are instances of this class.

Definition at line 1424 of file z3py.py.

Member Function Documentation

◆ __mul__()

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

Definition at line 1432 of file z3py.py.

1432  def __mul__(self, other):
1433  """Create the Z3 expression `self * other`.
1434  """
1435  if other == 1:
1436  return self
1437  if other == 0:
1438  return 0
1439  return If(self, other, 0)
1440 
1441 

◆ __rmul__()

def __rmul__ (   self,
  other 
)

Definition at line 1429 of file z3py.py.

1429  def __rmul__(self, other):
1430  return self * other
1431 

◆ sort()

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

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

Reimplemented from ExprRef.

Reimplemented in QuantifierRef.

Definition at line 1426 of file z3py.py.

1426  def sort(self):
1427  return BoolSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
1428 
z3py.If
def If(a, b, c, ctx=None)
Definition: z3py.py:1268
Z3_get_sort
Z3_sort Z3_API Z3_get_sort(Z3_context c, Z3_ast a)
Return the sort of an AST node.