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

Asserting a TransitiveClosure before checking results in "unknown" with reason "unclassified exception" #7103

Closed
kendfrey opened this issue Jan 28, 2024 · 1 comment

Comments

@kendfrey
Copy link

kendfrey commented Jan 28, 2024

Steps to reproduce

from z3 import *

R = Function("R", IntSort(), IntSort(), BoolSort())
solver = Solver()
# solver.check()
solver.add(TransitiveClosure(R)(0, 1))
print(solver.check())
print(solver.reason_unknown())

Note that uncommenting the first solver.check() line produces the expected behaviour.

Expected behaviour

sat
<irrelevant>

Actual behaviour

unknown
unclassified exception
@kendfrey
Copy link
Author

After some more experimentation, I found that, after uncommenting solver.check() and getting sat, if I then call solver.model() I get the following error:

    print(solver.model())
          ^^^^^^^^^^^^^^
  File "C:\Users\Kendall\AppData\Local\Programs\Python\Python311\Lib\site-packages\z3\z3.py", line 7192, in model
    return ModelRef(Z3_solver_get_model(self.ctx.ref(), self.solver), self.ctx)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Kendall\AppData\Local\Programs\Python\Python311\Lib\site-packages\z3\z3core.py", line 4255, in Z3_solver_get_model
    r = _elems.f(a0, a1)
        ^^^^^^^^^^^^^^^^
OSError: [WinError -529697949] Windows Error 0xe06d7363

I don't know if it's related or not.

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