Parse and lift the SMT counterexamples to LExpr#495
Open
aqjune-aws wants to merge 9 commits intomainfrom
Open
Conversation
…paceSepBy, which seems to be only used by SMTDDM
atomb
approved these changes
Feb 27, 2026
| /-- | ||
| A counterexample expressed as Core `LExpr` values, suitable for display | ||
| using Core's expression formatter and for future use as program metadata. | ||
| -/ |
| throw (IO.userError errMsg) | ||
|
|
||
| /-- | ||
| Parse a single syntax category from a loaded dialect set. |
Contributor
There was a problem hiding this comment.
Oh, nice! I was thinking we'd need something like this eventually.
| directly, which avoids the ambiguity that arises when parsing at the | ||
| `Command` level. | ||
|
|
||
| Returns a list of (key-string, value-Term) pairs on success. |
| Property: assert | ||
| Result: ❌ fail | ||
| Model: | ||
| ($__xs1, Cons(0, Nil)) |
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.
This patch
To implement this,
parseCategoryFromDialectfunction is added to DDM. It parses a string using a specific syntax category.A new StrataTest/Languages/Core/CounterExampleLiftTest.lean test shows a handful of interesting results.
#482 and this pull request have overlapping edits. Merging #482 does not introduce merge conflict, but tests need updates. Would be great if #482 is reviewed first! :)
Thanks to Kiro :)
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.