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

Public Member Functions

def sort (self)
 
def __add__ (self, other)
 
def __radd__ (self, other)
 
def __rmul__ (self, other)
 
def __mul__ (self, other)
 
def __and__ (self, other)
 
def __or__ (self, other)
 
def __xor__ (self, other)
 
def __invert__ (self)
 
- 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
 ast
 
 ctx
 

Detailed Description

All Boolean expressions are instances of this class.

Definition at line 1568 of file z3py.py.

Member Function Documentation

◆ __add__()

def __add__ (   self,
  other 
)

Definition at line 1574 of file z3py.py.

1574  def __add__(self, other):
1575  if isinstance(other, BoolRef):
1576  other = If(other, 1, 0)
1577  return If(self, 1, 0) + other
1578 
def If(a, b, c, ctx=None)
Definition: z3py.py:1399

◆ __and__()

def __and__ (   self,
  other 
)

Definition at line 1596 of file z3py.py.

1596  def __and__(self, other):
1597  return And(self, other)
1598 
def And(*args)
Definition: z3py.py:1889

◆ __invert__()

def __invert__ (   self)

Definition at line 1605 of file z3py.py.

1605  def __invert__(self):
1606  return Not(self)
1607 
1608 
1609 
def Not(a, ctx=None)
Definition: z3py.py:1855

◆ __mul__()

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

Definition at line 1585 of file z3py.py.

1585  def __mul__(self, other):
1586  """Create the Z3 expression `self * other`.
1587  """
1588  if isinstance(other, int) and other == 1:
1589  return If(self, 1, 0)
1590  if isinstance(other, int) and other == 0:
1591  return IntVal(0, self.ctx)
1592  if isinstance(other, BoolRef):
1593  other = If(other, 1, 0)
1594  return If(self, other, 0)
1595 
def IntVal(val, ctx=None)
Definition: z3py.py:3234

◆ __or__()

def __or__ (   self,
  other 
)

Definition at line 1599 of file z3py.py.

1599  def __or__(self, other):
1600  return Or(self, other)
1601 
def Or(*args)
Definition: z3py.py:1922

◆ __radd__()

def __radd__ (   self,
  other 
)

Definition at line 1579 of file z3py.py.

1579  def __radd__(self, other):
1580  return self + other
1581 

◆ __rmul__()

def __rmul__ (   self,
  other 
)

Definition at line 1582 of file z3py.py.

1582  def __rmul__(self, other):
1583  return self * other
1584 

◆ __xor__()

def __xor__ (   self,
  other 
)

Definition at line 1602 of file z3py.py.

1602  def __xor__(self, other):
1603  return Xor(self, other)
1604 
def Xor(a, b, ctx=None)
Definition: z3py.py:1839

◆ 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 1571 of file z3py.py.

1571  def sort(self):
1572  return BoolSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
1573 
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().