-
Notifications
You must be signed in to change notification settings - Fork 41
SMT test cases rework #3592
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
SMT test cases rework #3592
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…cy and new modular translation
Member
|
If the goal for test are these three points (and I think they are good!)
Would it then not make more sense to only run a few of the test cases through the SMT solvers to test the basics of the bridge, while for the majority of cases, we only compare the output of the SMT translation to snapshots? |
5 tasks
wadoon
reviewed
Apr 14, 2025
key.core/src/main/resources/de/uka/ilkd/key/smt/solvertypes/CVC4_legacy.props
Show resolved
Hide resolved
…/unsat and 2s for timeout/unknown cases
wadoon
approved these changes
May 9, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Currently, we have a category of SMT test cases (
TestCvc4,TestZ3) which work by loading a .key file with a single formula, for example\forall s x; p(x) -> \exists s y; p(y), directly converting it to SMT-LIB, and running a solver.These test cases have some problems:
unsatreturned by solver), or not (satreturned by solver). However, as it is implemented, the test case also always succeeds if the solver returnsunknownor runs into a timeout!The question is: What do we intend with the SMT test cases? My take on this would be:
Intended Change
ThreeValuedTruthis used, so the test cases actually specify whetherunsat,sat, orunknown/timeout is expected by the solver.unsator explicitunknownreturned easily (on my machine this was always more than four times the time needed, but it needs to be that high since tests run slower on GitHub CI), but still much faster than the current situation, where the test cases block the pipeline for a long time without producing real insights.SMTSolverTestnow, the subclassesZ3Test,Z3LegacTest, ... define the actual parameters by overwriting the abstract methodprovideTestData. This way the test cases are much more concise and readable.Caveats
sat(i.e., there is a counterexample), which is not possible with the modular translation. But I think that is expected ...unknownreturned by the solver. In the future, we might want to separate that to be able to define the expected result more precisely ...Open TODOs
More test cases for other solvers (?)Discussion: Disable the test cases that are expected to run into a timeout?to avoid long waiting, if a timeout is expected the timeout is set to a significantly lower value (2 sec instead of 50 sec at the moment)Discussion: What should happen if a solver is not installed? Skip or fail tests?see Warn on missing SMT solvers if flag is set #3600Maybe: Do not use hardcoded settings inSMTTestSettings, but respect the settings set in the individual file?Type of pull request
Ensuring quality
The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.