Segmentation Fault
See original GitHub issueHi,
I am trying get a model from z3 for an array, and end up with following error: z3.z3types.Z3Exception: Z3 application expected
Formula is simple: “”" (set-logic QF_AUFBV ) (declare-fun A-data () (Array (_ BitVec 32) (_ BitVec 8) ) ) (assert (and (= (_ bv108 8) (select A-data (_ bv2 32) ) ) (= (_ bv101 8) (select A-data (_ bv1 32) ) ) ) ) (check-sat) “”"
Full Code:
DEMO_SMTLIB=\
"""
(set-logic QF_AUFBV )
(declare-fun A-data () (Array (_ BitVec 32) (_ BitVec 8) ) )
(assert (and (= (_ bv108 8) (select A-data (_ bv2 32) ) ) (= (_ bv101 8) (select A-data (_ bv1 32) ) ) ) )
(check-sat)
"""
parser = SmtLibParser()
script = parser.get_script(cStringIO(DEMO_SMTLIB))
f = script.get_last_formula()
print(f)
model = get_model(f, solver_name="z3")
print(model)
Stack Trace: Traceback (most recent call last): File “test.py”, line 98, in <module> print(model) File “/home/rshariffdeen/.local/lib/python3.6/site-packages/pysmt/solvers/solver.py”, line 496, in str return “\n”.join([ “%s := %s” % (var, value) for (var, value) in self]) File “/home/rshariffdeen/.local/lib/python3.6/site-packages/pysmt/solvers/solver.py”, line 496, in <listcomp> return “\n”.join([ “%s := %s” % (var, value) for (var, value) in self]) File “/home/rshariffdeen/.local/lib/python3.6/site-packages/pysmt/solvers/z3.py”, line 97, in iter yield pysmt_d, self.get_value(pysmt_d) File “/home/rshariffdeen/.local/lib/python3.6/site-packages/pysmt/solvers/z3.py”, line 83, in get_value return self.converter.back(z3_res, model=self.z3_model) File “/home/rshariffdeen/.local/lib/python3.6/site-packages/pysmt/solvers/z3.py”, line 473, in back for i in xrange(current.num_args()): File “/home/rshariffdeen/workspace/z3/build/python/z3/z3.py”, line 961, in num_args _z3_assert(is_app(self), “Z3 application expected”) File “/home/rshariffdeen/workspace/z3/build/python/z3/z3.py”, line 92, in _z3_assert raise Z3Exception(msg) z3.z3types.Z3Exception: Z3 application expected
Has anyone else encountered this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
Great! In the meantime, I created a branch to port pysmt to Z3 4.8.4 (see #550 if you are interested). It seems to work, but It will take a while before merging into master.
#550 closed the issue in master