Inheritance diagram for ArrayRef:Public Member Functions | |
| def | sort |
| def | domain |
| def | range |
| def | __getitem__ |
| def | mk_default |
| 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.
03910 03911 def __getitem__(self, arg): 03912 """Return the Z3 expression `self[arg]`. 03913 03914 >>> a = Array('a', IntSort(), BoolSort()) 03915 >>> i = Int('i') 03916 >>> a[i] 03917 a[i] 03918 >>> a[i].sexpr() 03919 '(select a i)' 03920 """ 03921 arg = self.domain().cast(arg) 03922 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 3892 of file z3py.py.
Referenced by ArrayRef.__getitem__().
| def mk_default | ( | self | ) |
Definition at line 3923 of file z3py.py.
03923 03924 def mk_default(self): 03925 return _to_expr_ref(Z3_mk_array_default(self.ctx_ref(), self.as_ast()), self.ctx) 03926
| def range | ( | self | ) |
Shorthand for `self.sort().range()`.
>>> a = Array('a', IntSort(), BoolSort())
>>> a.range()
Bool
| 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 3883 of file z3py.py.
Referenced by ArrayRef.domain(), and ArrayRef.range().
03883 03884 def sort(self): 03885 """Return the array sort of the array expression `self`. 03886 03887 >>> a = Array('a', IntSort(), BoolSort()) 03888 >>> a.sort() 03889 Array(Int, Bool) 03890 """ 03891 return ArraySortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
1.7.6.1