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__
 
def mk_default
 
- Public Member Functions inherited from ExprRef
def as_ast
 
def get_id
 
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 get_id
 
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 3880 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 3910 of file z3py.py.

3911  def __getitem__(self, arg):
3912  """Return the Z3 expression `self[arg]`.
3913 
3914  >>> a = Array('a', IntSort(), BoolSort())
3915  >>> i = Int('i')
3916  >>> a[i]
3917  a[i]
3918  >>> a[i].sexpr()
3919  '(select a i)'
3920  """
3921  arg = self.domain().cast(arg)
3922  return _to_expr_ref(Z3_mk_select(self.ctx_ref(), self.as_ast(), arg.as_ast()), self.ctx)
def domain
Definition: z3py.py:3892
def __getitem__
Definition: z3py.py:3910
def as_ast
Definition: z3py.py:296
def ctx_ref
Definition: z3py.py:304
Z3_ast Z3_API Z3_mk_select(Z3_context c, Z3_ast a, Z3_ast i)
Array read. The argument a is the array and i is the index of the array that gets read...
def domain (   self)
Shorthand for `self.sort().domain()`.

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

Definition at line 3892 of file z3py.py.

Referenced by ArrayRef.__getitem__().

3893  def domain(self):
3894  """Shorthand for `self.sort().domain()`.
3895 
3896  >>> a = Array('a', IntSort(), BoolSort())
3897  >>> a.domain()
3898  Int
3899  """
3900  return self.sort().domain()
def sort
Definition: z3py.py:752
def domain
Definition: z3py.py:3892
def mk_default (   self)

Definition at line 3923 of file z3py.py.

3924  def mk_default(self):
3925  return _to_expr_ref(Z3_mk_array_default(self.ctx_ref(), self.as_ast()), self.ctx)
3926 
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 ...
def mk_default
Definition: z3py.py:3923
def as_ast
Definition: z3py.py:296
def ctx_ref
Definition: z3py.py:304
def range (   self)
Shorthand for `self.sort().range()`.

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

Definition at line 3901 of file z3py.py.

3902  def range(self):
3903  """Shorthand for `self.sort().range()`.
3904 
3905  >>> a = Array('a', IntSort(), BoolSort())
3906  >>> a.range()
3907  Bool
3908  """
3909  return self.sort().range()
def sort
Definition: z3py.py:752
def range
Definition: z3py.py:3901
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 3883 of file z3py.py.

3884  def sort(self):
3885  """Return the array sort of the array expression `self`.
3886 
3887  >>> a = Array('a', IntSort(), BoolSort())
3888  >>> a.sort()
3889  Array(Int, Bool)
3890  """
3891  return ArraySortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
Arrays.
Definition: z3py.py:3859
def as_ast
Definition: z3py.py:296
def ctx_ref
Definition: z3py.py:304
Z3_sort Z3_API Z3_get_sort(Z3_context c, Z3_ast a)
Return the sort of an AST node.
def sort
Definition: z3py.py:3883