-
Notifications
You must be signed in to change notification settings - Fork 44
Make SMTContext mandatory and merge Unknown with ReasonUnknown #4003
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
Conversation
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.
I like this change, I think it turned out to be quite a nice clean-up!
Hope @jberthold likes it too!
Co-authored-by: Georgy Lukyanov <[email protected]>
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.
The changes on the caller side are actually very neat - good clean-up. Let's merge it.
I have changed my mind and think we should have
SMTContext
mandatory and not an optional, as the current design makes it way too easy to give a defaultNothing
value when extending the code-base in the future. This then has the potential to re-introduce a similar bug. Another advantage tot his approach is the removal of the ugly pattern matching present each time we actually want to use the solver.Instead, in this PR, the
Maybe
is pushed intoSMTContext
, where the dummy/empty instance now has to be consciously built using the newnoSolver
function.The fallout is fairly minimal and we confide the logic of not having a solver to the SMT interface. I.e. the only places where not having a solver has a different behavior are:
hardReset
- becomes a no-op when no solver handle is presentrunCmd
-> always returns theUnknown
response when no solver existsThis eliminates duplicate instances of handling an unknown response vs not having a solver, since in all instances of the current code-base, they are functionally the same.