-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add Flex/Bison parser #181
Conversation
Here are the initial parser results. Note: incremental benchmarks have more solved than the total since each sat/unsat counts as a solve. I have no idea why smt-switch solves so many fewer QF_AUFLIA benchmarks. It could be a parser issue, but since all the others seem to be fine, I'm guessing it's actually a difference in the default options. I'll look into that more today. The most important thing is that the status is "ok", meaning there were no disagreements. |
Btw, the tests above were ran with an older version. I'll run tests again soon with the latest. Looking into cvc4's default options first. |
All right, I found the slowdown. The |
Awesome! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
I guess the get commands (get-unsat-core, get-value, get-model
etc) are left for future work. RIght?
That is indeed great! Interestingly, smt-switch-cvc4 solves way more in the QF_AUFLIA |
Thanks for the review!
Yeah that's right -- I haven't thought about those much yet. |
Right, so that's actually entirely from the single |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Suggestion: please open issues for the todos, like supporting getter functions in the parser.
Thanks for the reviews! Made an issue for the getters: #190. |
This PR adds an
SmtLibReader
class with virtual methods for common SMT-LIB commands. This way, a user can inherit the class and perform their own actions on standard commands. By default, it just executes the commands on the provided solver.Currently supports:
The infrastructure is based on the calc++ example.
I'm new to Flex/Bison so please let me know if there are any inefficiencies/broken conventions that you notice. Of course, trying to balance making it nice vs. getting it done soon so it's not going to be perfect. One particularly ugly part right now is here:
https://github.com/makaimann/smt-switch/blob/9b7fe79103648da4d5e7fc4ea0bf973abfd0e4a7/src/smtlibscanner.l#L72
Basically, there can be multiline string literals in set-info, or in a pipe-quoted symbol, e.g.:
Currently, the lexer combines that into one token. However, this can mess up error reporting since the line number is off. So that linked code just increments the line number accordingly. I did briefly try splitting them into one token per line and recombining them in the bison parser but ran into some issues. I could probably get it working if you think that's better. Let me know if you think that's a lot better than the current solution.