Skip to content

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

Merged
merged 7 commits into from
Jul 30, 2024

Conversation

goodlyrottenapple
Copy link
Contributor

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 default Nothing 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 into SMTContext, where the dummy/empty instance now has to be consciously built using the new noSolver 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 present
  • runCmd -> always returns the Unknown response when no solver exists
    This 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.

@goodlyrottenapple goodlyrottenapple changed the title Make SMTContext mandatory Make SMTContext mandatory and merge Unknown with ReasonUnknown Jul 29, 2024
Copy link
Contributor

@geo2a geo2a left a 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!

@goodlyrottenapple goodlyrottenapple marked this pull request as ready for review July 29, 2024 15:40
Copy link
Member

@jberthold jberthold left a 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.

@rv-jenkins rv-jenkins merged commit f66df15 into master Jul 30, 2024
6 checks passed
@rv-jenkins rv-jenkins deleted the sam/smt-context branch July 30, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants