Z3
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions
ArrayRef Class Reference
+ Inheritance diagram for ArrayRef:

Public Member Functions

def sort
 
def domain
 
def range
 
def __getitem__
 
- Public Member Functions inherited from ExprRef
def as_ast
 
def sort
 
def sort_kind
 
def __eq__
 
def __ne__
 
def decl
 
def num_args
 
def arg
 
def children
 
- Public Member Functions inherited from AstRef
def __init__
 
def __del__
 
def __str__
 
def __repr__
 
def sexpr
 
def as_ast
 
def ctx_ref
 
def eq
 
def translate
 
def hash
 
- Public Member Functions inherited from Z3PPObject
def use_pp
 

Additional Inherited Members

- Data Fields inherited from AstRef
 ast
 
 ctx
 

Detailed Description

Array expressions. 

Definition at line 3735 of file z3py.py.

Member Function Documentation

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

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

Definition at line 3765 of file z3py.py.

3766  def __getitem__(self, arg):
3767  """Return the Z3 expression `self[arg]`.
3768 
3769  >>> a = Array('a', IntSort(), BoolSort())
3770  >>> i = Int('i')
3771  >>> a[i]
3772  a[i]
3773  >>> a[i].sexpr()
3774  '(select a i)'
3775  """
3776  arg = self.domain().cast(arg)
3777  return _to_expr_ref(Z3_mk_select(self.ctx_ref(), self.as_ast(), arg.as_ast()), self.ctx)
def domain (   self)
Shorthand for `self.sort().domain()`.

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

Definition at line 3747 of file z3py.py.

Referenced by ArrayRef.__getitem__().

3748  def domain(self):
3749  """Shorthand for `self.sort().domain()`.
3750 
3751  >>> a = Array('a', IntSort(), BoolSort())
3752  >>> a.domain()
3753  Int
3754  """
3755  return self.sort().domain()
def range (   self)
Shorthand for `self.sort().range()`.

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

Definition at line 3756 of file z3py.py.

3757  def range(self):
3758  """Shorthand for `self.sort().range()`.
3759 
3760  >>> a = Array('a', IntSort(), BoolSort())
3761  >>> a.range()
3762  Bool
3763  """
3764  return self.sort().range()
def sort (   self)
Return the array sort of the array expression `self`.

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

Definition at line 3738 of file z3py.py.

3739  def sort(self):
3740  """Return the array sort of the array expression `self`.
3741 
3742  >>> a = Array('a', IntSort(), BoolSort())
3743  >>> a.sort()
3744  Array(Int, Bool)
3745  """
3746  return ArraySortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)