Z3
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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 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 3843 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 3873 of file z3py.py.

3874  def __getitem__(self, arg):
3875  """Return the Z3 expression `self[arg]`.
3876 
3877  >>> a = Array('a', IntSort(), BoolSort())
3878  >>> i = Int('i')
3879  >>> a[i]
3880  a[i]
3881  >>> a[i].sexpr()
3882  '(select a i)'
3883  """
3884  arg = self.domain().cast(arg)
3885  return _to_expr_ref(Z3_mk_select(self.ctx_ref(), self.as_ast(), arg.as_ast()), self.ctx)
def domain
Definition: z3py.py:3855
def __getitem__
Definition: z3py.py:3873
Z3_ast Z3_API Z3_mk_select(__in Z3_context c, __in Z3_ast a, __in Z3_ast i)
Array read. The argument a is the array and i is the index of the array that gets read...
def as_ast
Definition: z3py.py:296
def ctx_ref
Definition: z3py.py:305
def domain (   self)
Shorthand for `self.sort().domain()`.

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

Definition at line 3855 of file z3py.py.

Referenced by ArrayRef.__getitem__().

3856  def domain(self):
3857  """Shorthand for `self.sort().domain()`.
3858 
3859  >>> a = Array('a', IntSort(), BoolSort())
3860  >>> a.domain()
3861  Int
3862  """
3863  return self.sort().domain()
def sort
Definition: z3py.py:748
def domain
Definition: z3py.py:3855
def range (   self)
Shorthand for `self.sort().range()`.

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

Definition at line 3864 of file z3py.py.

3865  def range(self):
3866  """Shorthand for `self.sort().range()`.
3867 
3868  >>> a = Array('a', IntSort(), BoolSort())
3869  >>> a.range()
3870  Bool
3871  """
3872  return self.sort().range()
def sort
Definition: z3py.py:748
def range
Definition: z3py.py:3864
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 3846 of file z3py.py.

3847  def sort(self):
3848  """Return the array sort of the array expression `self`.
3849 
3850  >>> a = Array('a', IntSort(), BoolSort())
3851  >>> a.sort()
3852  Array(Int, Bool)
3853  """
3854  return ArraySortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
Arrays.
Definition: z3py.py:3822
Z3_sort Z3_API Z3_get_sort(__in Z3_context c, __in Z3_ast a)
Return the sort of an AST node.
def as_ast
Definition: z3py.py:296
def ctx_ref
Definition: z3py.py:305
def sort
Definition: z3py.py:3846