-
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
Spacer: error "query failed: Uninterpreted 'mod' in <null> #3962
Comments
Spacer does not deal properly with uninterpreted functions. Non-linear In your case, the @NikolajBjorner : the error message is wrong. I think the check does not simplify the argument to |
Thanks! It still happens though, with both mod: https://gist.github.com/leonardoalt/a9951c60f44ec4e059c623f8530c4ba5 |
They have occurrences where the second argument to mod/div is a variable. |
@NikolajBjorner would it make sense to reopen the issue to track that? |
@NikolajBjorner this, and maybe other protections, for supported features seems too harsh for current users. In SeaHorn case, for example, it is assumed that for every An alternative is to allow arbitrary signature on entry, but make We can even require What do you think? |
You could remove this check from rule_properties and add validation |
@NikolajBjorner you mentioned above that
|
Hey @leonardoalt , this is on my plate as per discussion above. Are you using spacer through the horn tactic? If you use it directly, I believe this check is by-passed. (i.e., via The source of the problem is that the decision is made syntactically. There will always be a possibility that after some more pre-processing offending terms will disappear. What I want to do is to add an optional validation of the solution before it is returned to the user. The logic will then be instead of "if there is an offending term return unknown" into "if there is an offending term run validation before returning to the user". The hope is to start working on this in the next few weeks. But this has been a low priority for me since I don't know of many users of CHC with non-linear div constraints except for the fuzzers. It will always be better if you can fix it at the encoding level (i.e., substitute |
@agurfinkel that sounds good, thanks! Right, that makes sense. I'll try to substitute the terms before the query. For me the nonlinear cases are not too important, since they're too hard anyway. My current use cases include division by 2 for binary search, for example. |
The more simplification you do before you go to the solver, the more robust your results will be. For example, current pre-processing rules should eliminate |
Ok. I think a fairly easy way for me to do that is to run the SMT solver on the constraints of a block (Horn rule) that contains a division, before adding the rule. |
Hello @agurfinkel! Since you where wondering how many people are using CHC with non-linear div constraints I wanted to provide another data point: we are using them in our static analysis framework HoRSt, but it seems that for most real world cases, we can get rid of them by doing some pre-processing. |
FYI I've replaced div and mod operations by a multiplication + extra constraints, has worked well so far with Spacer. |
While discussing @wert310's recent pull request (#5821) he and I had the idea that this issue could be solved in a similar manner (basically we could allow As a side note: If one was sure that all |
Yes, as long as there are no uninterpreted functions, spacer will be sound. In fact, in our applications that is exactly what we do -- ensure that all |
smt2 file:
https://gist.github.com/leonardoalt/ab12713eb249dadb86f7bb1441705e59
@agurfinkel we once talked about cex not working super well when using nonlinear arithmetic, but this didn't happen before (this happened now on a regression test).
The text was updated successfully, but these errors were encountered: