Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
We introduces strong(er) types related to our translation to SMT-LIB and communication with the solvers.
The main goal is to remove the need for
splitSExprandgetSExprmethods. We have control over how we build the SMT-LIB script so we should not need to reparse it again after we have built it.As a side effect, we start a refactor of the SMT module, specifically to understand what exactly needs to be exported and what can stay hidden.
Details
Instead of building the SMT-LIB script just as a text (using
Builder), we actually use a typeSMTScriptto represent final script that can be sent to a solver.A script consists of entries, represented by
SMTEntry. An entry can be a command or comment. Comments are actually filtered out when sent to the solver, but they are useful when dumping a script to a file.Commands represent valid SMT-LIB commands to which we are expecting a solver to respond.
This is mostly internal change that allows us to skip some expensive operations we were doing before.
Previously, we were basically recoding lines of text and then we had to reparse them to retrieve commands as s-expressions to be sent to the solver.
This is just an initial design that will be refined gradually. Specifically, the top type
SMT2needs some refinement.As part of this work I initiated a split of the SMT module to submodules, to organize the code internally.
This also definitely needs more work and we have to come up with a design that feels right.