-
Notifications
You must be signed in to change notification settings - Fork 130
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
Additional SMTLib2 support #365
Comments
I might be able to take a look at This is where the SMTLIB2 front-end handles So, I think, it is just a case of ensuring that we don't remove the symbols that you don't want It seems those |
If you care about |
Sure, I can come up with a test case. However, the larger context is quite a bit less self-contained. What I'm doing involves symbolic execution of programs and I use interactive solving with lots of push/pops to keep track of the control-flow conditions that lead to assertions in the program. We don't know in advance which parts of the potential problem space will be relevant to a solver query, so terms are streamed to the solver on-demand. These terms can get quite large, so it's a shame to have to stream them again if they are forgotten on a And, yes, good catch: |
Baby-steps: if you can provide an easy/minimal/self-contained example, I can take look at getting that working (but no promises). Then, once the easy bit is done, we can take a look at some larger examples :) If you can give an example with and without |
STP online support is almost, but not quite, working. If stp/stp#365 is closed, STP should become a viable online solver, so I'm leaving the support code in.
I was working on a small example to demonstrated the desired behavior. Somewhat to my surprise, STP already behaves as though |
If you don't have I would imagine that this works by luck, rather than by design. With STP, the end of the run looks like this:
but for Boolector:
and CVC4:
|
That is my understanding of the behavior specified by the standard. I think it's kind of crazy, which is why I prefer to work with the global-declarations mode. The relevant language from the standard is:
|
Okay, so that's what I expected (without reading it). Think about this:
This works for STP, irrespective of the value you give you |
Here is a similar example using |
STP online support is almost, but not quite, working. If stp/stp#365 is closed, STP should become a viable online solver, so I'm leaving the support code in.
As we all acknowledge, the default behaviour of STP should be to treat global-declaration as false. For symbols, there's a vector created(in the cpp_interface.h file) at each push level that stores the symbols created at that level. When the level is popped away, the references to the symbols in the relevant vector are removed. What's supposed to happen is that no other references to that symbol exist - so it's reference count drops to zero and the symbol is deleted. Although there should be, there's no similar mechanism for functions. They're put in a map and kept around forever. Cutting back the longer example @robdockins provided:
Shows what goes wrong. So the first step is to fix function handling (on pop) in STP. Is this something you want to work on @andrewvaughanj otherwise I can fix it? |
I’m happy to take a look/give it ago, and I should be able to take a look this week. That being said, I was offering more as way to learn more about STP and support its community, rather than already knowing the solution. On some other issue trackers, Rob has suggested he is in no rush for this — @TrevorHansen if you’re happy to wait and then review a PR by me, then I’m happy to try! |
Weirdly, this "works" (when we don't want it to):
but this is has the correct behaviour (w.r.t.
What I mean here is that the use of an uninterpreted function symbol inside of a function declaration somehow makes the uninterpreted function symbol "escape" the pop. Indeed, this has the correct behaviour (giving a parse error):
|
Ah! I think when you use When you do the This particular problem will be resolved if |
Would it be easy to add support for the
:global-declarations
option and theget-info
operation? They are convenient for certain kinds of interactive use cases. Cf http://smtlib.cs.uiowa.edu/papers/smt-lib-reference-v2.6-r2017-07-18.pdfThe text was updated successfully, but these errors were encountered: