Skip to content

Commit

Permalink
Fixing array select for lambda expressions in Python API (Z3Prover#6516)
Browse files Browse the repository at this point in the history
* fix: making array select work for lambda expressions

* more elegant solution
  • Loading branch information
walnutwaldo authored and hgvk94 committed Mar 27, 2023
1 parent dbcd515 commit 34a010e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/python/z3/z3.py
Original file line number Diff line number Diff line change
Expand Up @@ -4597,10 +4597,10 @@ def default(self):

def _array_select(ar, arg):
if isinstance(arg, tuple):
args = [ar.domain_n(i).cast(arg[i]) for i in range(len(arg))]
args = [ar.sort().domain_n(i).cast(arg[i]) for i in range(len(arg))]
_args, sz = _to_ast_array(args)
return _to_expr_ref(Z3_mk_select_n(ar.ctx_ref(), ar.as_ast(), sz, _args), ar.ctx)
arg = ar.domain().cast(arg)
arg = ar.sort().domain().cast(arg)
return _to_expr_ref(Z3_mk_select(ar.ctx_ref(), ar.as_ast(), arg.as_ast()), ar.ctx)


Expand Down

0 comments on commit 34a010e

Please sign in to comment.