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

Public Member Functions

def sort (self)
def domain (self)
def domain_n (self, i)
def range (self)
def __getitem__ (self, arg)
def default (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

Detailed Description

Array expressions. 

Definition at line 4548 of file z3py.py.

Member Function Documentation

◆ __getitem__()

def __getitem__ (   self,
Return the Z3 expression `self[arg]`.

>>> a = Array('a', IntSort(), BoolSort())
>>> i = Int('i')
>>> a[i]
>>> a[i].sexpr()
'(select a i)'

Definition at line 4582 of file z3py.py.

4582  def __getitem__(self, arg):
4583  """Return the Z3 expression `self[arg]`.
4585  >>> a = Array('a', IntSort(), BoolSort())
4586  >>> i = Int('i')
4587  >>> a[i]
4588  a[i]
4589  >>> a[i].sexpr()
4590  '(select a i)'
4591  """
4592  return _array_select(self, arg)

◆ default()

def default (   self)

Definition at line 4594 of file z3py.py.

4594  def default(self):
4595  return _to_expr_ref(Z3_mk_array_default(self.ctx_ref(), self.as_ast()), self.ctx)
Z3_ast Z3_API Z3_mk_array_default(Z3_context c, Z3_ast array)
Access the array default value. Produces the default range value, for arrays that can be represented ...

◆ domain()

def domain (   self)
Shorthand for `self.sort().domain()`.

>>> a = Array('a', IntSort(), BoolSort())
>>> a.domain()

Definition at line 4560 of file z3py.py.

4560  def domain(self):
4561  """Shorthand for `self.sort().domain()`.
4563  >>> a = Array('a', IntSort(), BoolSort())
4564  >>> a.domain()
4565  Int
4566  """
4567  return self.sort().domain()

Referenced by FuncDeclRef.__call__(), and ArrayRef.default().

◆ domain_n()

def domain_n (   self,
Shorthand for self.sort().domain_n(i)`.

Definition at line 4569 of file z3py.py.

4569  def domain_n(self, i):
4570  """Shorthand for self.sort().domain_n(i)`."""
4571  return self.sort().domain_n(i)

Referenced by ArrayRef.default().

◆ range()

def range (   self)
Shorthand for `self.sort().range()`.

>>> a = Array('a', IntSort(), BoolSort())
>>> a.range()

Definition at line 4573 of file z3py.py.

4573  def range(self):
4574  """Shorthand for `self.sort().range()`.
4576  >>> a = Array('a', IntSort(), BoolSort())
4577  >>> a.range()
4578  Bool
4579  """
4580  return self.sort().range()
expr range(expr const &lo, expr const &hi)
Definition: z3++.h:3970

Referenced by ArrayRef.default().

◆ sort()

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

>>> a = Array('a', IntSort(), BoolSort())
>>> a.sort()
Array(Int, Bool)

Reimplemented from ExprRef.

Definition at line 4551 of file z3py.py.

4551  def sort(self):
4552  """Return the array sort of the array expression `self`.
4554  >>> a = Array('a', IntSort(), BoolSort())
4555  >>> a.sort()
4556  Array(Int, Bool)
4557  """
4558  return ArraySortRef(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().