Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault via API when variable has empty name #2309

Closed
mikand opened this issue May 31, 2019 · 0 comments
Closed

Segfault via API when variable has empty name #2309

mikand opened this issue May 31, 2019 · 0 comments

Comments

@mikand
Copy link

mikand commented May 31, 2019

The code below, causes a segfault in Z3 because of the variable b that has an empty name (if b is set to something, the code works perfectly).

from z3 import *

a = Bool('a')
b = Bool('') # b = Bool('b')
expr = And(a, b)

Z3_set_ast_print_mode(expr.ctx.ref(), Z3_PRINT_SMTLIB2_COMPLIANT)
s = Z3_benchmark_to_smtlib_string(expr.ctx.ref(),
                                  None, None,
                                  None, None,
                                  0, None,
                                  expr.ast)
print(s)

The issue arose in dealing with pysmt/pysmt#587, strangely enough Z3 is able to parse and solve https://clc-gitlab.cs.uiowa.edu:2443/SMT-LIB-benchmarks/QF_BV/blob/master/check2/symbols.smt2 but if the same formula is created via API it is unable to print it in SMT2 format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant