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

assertion violation when using tester #5589

Closed
lynaghk opened this issue Oct 11, 2021 · 3 comments
Closed

assertion violation when using tester #5589

lynaghk opened this issue Oct 11, 2021 · 3 comments

Comments

@lynaghk
Copy link

lynaghk commented Oct 11, 2021

First, thanks for Z3, it's really great!

I get this error on both 4.8.12.0 and a locally-built version of f7a2d08. Both on a Mac M1, MacOS 11.6
Reporting it, as requested =D

ASSERTION VIOLATION
File: /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_math_z3/z3/work/z3-z3-4.8.12/src/ast/datatype_decl_plugin.cpp
Line: 1241
UNEXPECTED CODE WAS REACHED.
4.8.12.0
Please file an issue with this message and more detail about how you encountered it at https://github.com/Z3Prover/z3/issues/new

Input code:

(declare-datatype Signal ((A) (B)))

(declare-datatype Mapping ((NoSignal)
                           (mk-signal (get-signal Signal))))

(declare-const x Signal)

(assert ((_ is get-signal) x))

(check-sat)
@NikolajBjorner
Copy link
Contributor

It is type error in the input, not handled correctly internally.

You probably want:

(declare-datatype Signal ((A) (B)))

(declare-datatype Mapping ((NoSignal)
                           (mk-signal (get-signal Signal))))

(declare-const x Mapping) 

(assert ((_ is mk-signal) x))

(check-sat)

@lynaghk
Copy link
Author

lynaghk commented Oct 11, 2021

Yep, I realized my mistake but wanted to report the crash. Looks like the fix was straightforward, I'll try digging further myself next time. Thanks for the quick fix and all of your hard work on this great tool!

@NikolajBjorner
Copy link
Contributor

no problem at all. It is really helpful to have a test case when fixing the missing check.

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

2 participants