Z3
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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__
 
def default
 
- Public Member Functions inherited from ExprRef
def as_ast
 
def get_id
 
def sort
 
def sort_kind
 
def __eq__
 
def __hash__
 
def __ne__
 
def params
 
def decl
 
def num_args
 
def arg
 
def children
 
- Public Member Functions inherited from AstRef
def __init__
 
def __del__
 
def __deepcopy__
 
def __str__
 
def __repr__
 
def __eq__
 
def __hash__
 
def __nonzero__
 
def __bool__
 
def sexpr
 
def as_ast
 
def get_id
 
def ctx_ref
 
def eq
 
def translate
 
def __copy__
 
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 4227 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 4257 of file z3py.py.

4258  def __getitem__(self, arg):
4259  """Return the Z3 expression `self[arg]`.
4260 
4261  >>> a = Array('a', IntSort(), BoolSort())
4262  >>> i = Int('i')
4263  >>> a[i]
4264  a[i]
4265  >>> a[i].sexpr()
4266  '(select a i)'
4267  """
4268  arg = self.domain().cast(arg)
4269  return _to_expr_ref(Z3_mk_select(self.ctx_ref(), self.as_ast(), arg.as_ast()), self.ctx)
def domain
Definition: z3py.py:4239
def __getitem__
Definition: z3py.py:4257
def as_ast
Definition: z3py.py:344
def ctx_ref
Definition: z3py.py:352
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 default (   self)

Definition at line 4270 of file z3py.py.

4271  def default(self):
4272  return _to_expr_ref(Z3_mk_array_default(self.ctx_ref(), self.as_ast()), self.ctx)
4273 
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 default
Definition: z3py.py:4270
def as_ast
Definition: z3py.py:344
def ctx_ref
Definition: z3py.py:352
def domain (   self)
Shorthand for `self.sort().domain()`.

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

Definition at line 4239 of file z3py.py.

Referenced by ArrayRef.__getitem__().

4240  def domain(self):
4241  """Shorthand for `self.sort().domain()`.
4242 
4243  >>> a = Array('a', IntSort(), BoolSort())
4244  >>> a.domain()
4245  Int
4246  """
4247  return self.sort().domain()
def sort
Definition: z3py.py:879
def domain
Definition: z3py.py:4239
def range (   self)
Shorthand for `self.sort().range()`.

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

Definition at line 4248 of file z3py.py.

4249  def range(self):
4250  """Shorthand for `self.sort().range()`.
4251 
4252  >>> a = Array('a', IntSort(), BoolSort())
4253  >>> a.range()
4254  Bool
4255  """
4256  return self.sort().range()
def sort
Definition: z3py.py:879
def range
Definition: z3py.py:4248
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 4230 of file z3py.py.

4231  def sort(self):
4232  """Return the array sort of the array expression `self`.
4233 
4234  >>> a = Array('a', IntSort(), BoolSort())
4235  >>> a.sort()
4236  Array(Int, Bool)
4237  """
4238  return ArraySortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
Arrays.
Definition: z3py.py:4206
def as_ast
Definition: z3py.py:344
def ctx_ref
Definition: z3py.py:352
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:4230