-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
problematic interaction between macro-finder and arrays (z3-py) #6292
Comments
macro-finder never worked with operations that use function symbols as arguments: as-array and map. |
Wow, that was an amazingly fast response and patch. Thank you for that, and for the details!
I did see that MF disables itself in the presence of recfuns, and it looks like your commit just now will (if I'm understanding correctly) expand macros in the places where they're applied, but preserve the original defining formulae for map/as-array to see. Does that mean that MF will now be safe to have enabled? (in master). Or do you mean that there are probably some other correctness issues which would be hard to fix? |
From what I can say it is now safe for arrays map/as-array. When z3 does dirty tricks with functions elsewhere it will not be safe. Given that you seem to have an application (regex puzzles?) and not just poking around for mistakes I went ahead to address the bug. We would like to incentivize sharing fun applications that can serve as tutorials under |
Cool, I'll take a look at that. Thank you! Right now, I've been poking around with modeling semantics of some very simple programing languages (not even Turing-complete). I'm ending up with a bunch of quantifiers though (many of them are for things MF eliminates) and since sometimes I'm looking for a model, I have to keep MBQI on (AIUI) so without MF, things get very clunky very fast. (I've tried inlining the functions on the Python side, but the formulae getting passed to Z3 end up getting kinda huge.) The regex-crosswords didn't need quantifiers and Z3 munched through that with no sweat at all :) Again, thanks for the fast response. |
Given the following Python input:
We get
So Z3 finds what it thinks is a model, but even the model itself can tell one of the assertions is violated.
I haven't been able to simplify this further, or get a repro with smtlib input.
Tested using
z3_solver-4.10.2.0
on an M1 mac, and with a debug build on 4906425 on the same machine.The text was updated successfully, but these errors were encountered: