Created
July 20, 2020 10:51
-
-
Save fnordomat/2fc84a46fd83af03f9d5decdcb259f93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for some reason this was missing from Z3py: | |
def Sequence(name, ctx=None): | |
"""Return a sequence constant named `name`. If `ctx=None`, then the global context is used. | |
>>> x = Sequence('x') | |
""" | |
ctx = z3.get_ctx(ctx) | |
int_sort = z3.IntSort(ctx) | |
return z3.SeqRef( | |
z3.Z3_mk_const(ctx.ref(), | |
z3.to_symbol(name, ctx), | |
z3.SeqSortRef(z3.Z3_mk_seq_sort(int_sort.ctx_ref(), int_sort.ast)).ast), | |
ctx) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment