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

Implement API to set exit action to exception #7192

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

smoy
Copy link
Contributor

@smoy smoy commented Mar 26, 2024

Disclosure: I don't develop C/C++. I really just put this together by studying existing code.

Testing: In order to generate those unreachable code, i test the patch against 4.13.0 in macos.

>>> from z3 import *
>>> solver = Solver()
>>> A = SetSort(IntSort())
>>> B = SetSort(IntSort())
>>> solver.add(IsSubset(A, B) != (Union(A, B) == A))
ASSERTION VIOLATION
File: ../src/ast/ast.cpp
Line: 388
UNEXPECTED CODE WAS REACHED.
Z3 4.13.0.1
Please file an issue with this message and more detail about how you encountered it at https://github.com/Z3Prover/z3/issues/new
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/smoy/github/z3-fork/build-dist/python/z3/z3.py", line 5074, in IsSubset
    return BoolRef(Z3_mk_set_subset(ctx.ref(), a.as_ast(), b.as_ast()), ctx)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/smoy/github/z3-fork/build-dist/python/z3/z3core.py", line 2351, in Z3_mk_set_subset
    _elems.Check(a0)
  File "/Users/smoy/github/z3-fork/build-dist/python/z3/z3core.py", line 1554, in Check
    raise self.Exception(self.get_error_message(ctx, err))
z3.z3types.Z3Exception: b'unreachable'

@NikolajBjorner NikolajBjorner merged commit 111fcb9 into Z3Prover:master Mar 28, 2024
13 checks passed
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

Successfully merging this pull request may close these issues.

2 participants