MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / __getitem__

Method __getitem__

lean_py/z3/core.py:3895–3904  ·  view source on GitHub ↗
(self, idx: ArithRef | int)

Source from the content-addressed store, hash-verified

3893 )
3894
3895 def __getitem__(self, idx: ArithRef | int) -> ExprRef:
3896 if isinstance(idx, int):
3897 idx = IntVal(idx)
3898 sort = self._sort
3899 elem_sort = sort._elem if isinstance(sort, SeqSortRef) else IntSort()
3900 return ExprRef(
3901 SeqNthNode(self._ast, idx._ast),
3902 elem_sort,
3903 _merge(self._vars, idx._vars),
3904 )
3905
3906 def at(self, idx: ArithRef | int) -> ExprRef:
3907 """Return a unit sequence at the given index."""

Callers

nothing calls this directly

Calls 5

SeqNthNodeClass · 0.90
IntValFunction · 0.85
IntSortFunction · 0.85
ExprRefClass · 0.85
_mergeFunction · 0.85

Tested by

no test coverage detected