datatype support for smtvcs#1273
Draft
kondylidou wants to merge 2 commits into
Draft
Conversation
Contributor
Author
|
@joscoh following the discussion in the meeting yesterday could you check if this would be the right fix? |
Contributor
Author
@abdoo8080 fyi too |
Contributor
|
A few notes from an offline discussion:
|
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
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.
Summary
Programs with user-defined datatypes (constructors, selectors, testers) previously caused
smtVCsCorrectto silently reduce toFalseandgen_smt_vcsto throw a runtime error.This PR fixes three coordinated gaps:
SanitizedContext.ofCore(MetaVerifier.lean) stripped all datatype UFs/sorts, soneither the translate nor the denote path could see constructor/selector/tester functions.
translateTerm(Translate.lean) had nodatatype_opcase, sogen_smt_vcsthrew"datatype function not found in context" for any VC containing a selector or constructor.
denoteTerm(Denote.lean) had nodatatype_opcase, sodenoteQueryreturnednonefor any VC containing a datatype operation, causingsmtVCsCorrectto reduce toFalse.Test
StrataTest/Languages/Boole/datatype_selector_vcs.lean— a minimalBox { Box_mk(val : int) }program whose
inc_valprocedure usesBox..valin bothrequiresandensures. All 4generated VCs pass cvc5 and
smtVCsCorrect boxSelectorSeedis fully proved bygen_smt_vcsgrind.