Skip to content

Commit

Permalink
expose fold as well
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed May 9, 2024
1 parent fc6c4c9 commit c7529d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/api/python/z3/z3.py
Original file line number Diff line number Diff line change
Expand Up @@ -11224,6 +11224,19 @@ def SeqMapI(f, i, s):
i = _py2expr(i)
return _to_expr_ref(Z3_mk_seq_mapi(s.ctx_ref(), f.as_ast(), i.as_ast(), s.as_ast()), ctx)

def SeqFoldLeft(f, a, s):
ctx = _get_ctx2(f, s)
s = _coerce_seq(s, ctx)
a = _py2expr(a)
return _to_expr_ref(Z3_mk_seq_foldl(s.ctx_ref(), f.as_ast(), a.as_ast(), s.as_ast()), ctx)

def SeqFoldLeftI(f, i, a, s):
ctx = _get_ctx2(f, s)
s = _coerce_seq(s, ctx)
a = _py2expr(a)
i = _py2epxr(i)
return _to_expr_ref(Z3_mk_seq_foldli(s.ctx_ref(), f.as_ast(), i.as_ast(), a.as_ast(), s.as_ast()), ctx)

def StrToInt(s):
"""Convert string expression to integer
>>> a = StrToInt("1")
Expand Down

0 comments on commit c7529d0

Please sign in to comment.