test: Bring Sym-based mvcgen' on par with mvcgen#13578
Draft
test: Bring Sym-based mvcgen' on par with mvcgen#13578
mvcgen' on par with mvcgen#13578Conversation
… in `mkSpecContext` This PR rewrites the `mvcgen'` `mkSpecContext` helper to partition the `[...]` argument list into spec theorems and simp lemmas, mirroring the approach used in `Lean.Elab.Tactic.Do.VCGen.mkSpecContext`: each entry is first tried as a spec theorem, and on failure it falls back to a simp/unfold lemma which is processed via `mkSimpContext`. The resulting simp theorems are fed into the migrated spec theorem database so that unfold/simp rules registered by the user are actually picked up. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ia `entails.mk` This PR refactors the post-condition entailment solver to attempt closing the whole `PostCond.entails` goal by reflexivity first via a new `PostCond.entails.rfl` backward rule, before falling back to decomposition via `PostCond.entails.mk`. When the exception subgoal cannot be discharged by reflexivity it is now emitted as a VC instead of raising an error.
… via new `entails.pure` lemma This PR adds `ExceptConds.entails.pure` in `Std.Do.PostCond`, stating that `ExceptConds.entails` is trivially inhabited at `PostShape.pure`, and uses it as a backward rule in the sym mvcgen to discharge the exception side of a `PostCond.entails` goal for pure post shapes before falling back to reflexivity.
… `@[simp]` This PR changes `Invariant`, `StringInvariant`, `StringSliceInvariant` and their `withEarlyReturn`/`withEarlyReturnNewDo` counterparts from `abbrev` to `def` (with `@[simp]` so they still unfold on demand). The motivation is that `SymM` does not unfold `def`s, so these declarations remain visible as applications of a named constant in proof states and can be detected as invariant types by `isSpecInvariantType`. The sym `mvcgen'` `emitVC` is updated to use `isSpecInvariantType` instead of the hard-coded `Std.Do.Invariant` check, so any `@[spec_invariant_type]`-tagged type is classified as an invariant. `String.toNat?_eq_some_of_mem` is updated to feed the relevant unfold lemmas to `simp only` explicitly now that they no longer reduce transparently.
This PR removes a now-redundant `pure_cons` from the simp argument list of `conjunction_apply`. The earlier `apply_pure_cons` `@[simp]` rule subsumes it, and the `linter.unusedSimpArgs` lint (now enforced) flags it as unused.
Contributor
Author
|
!bench |
|
Benchmark results for 9693009 against 2ba4c55 are in. There are significant results. @sgraf812
Large changes (2✅, 1🟥)
Medium changes (2🟥)
Small changes (11🟥)
|
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
Renames `down_apply_pure_elim` to `down_pure_intro` and relocates it under the `# Pure` section of `DerivedLaws.lean`, matching #13582 as merged. Reverts the six `Invariant.withEarlyReturn`/`withEarlyReturnNewDo` variants to `abbrev` and reverts `Std/Data/String/ToNat.lean` to its pre-PR state, matching the final form of #13583. Updates the local `VCGen.lean` reference to the renamed `SPred.down_pure_intro` lemma and restores `mkFreshPair_triple` to legacy `mvcgen -elimLets +trivial` (it remains blocked under `mvcgen'`).
Contributor
Author
|
!bench |
|
Benchmark results for 3621d83 against 19baa47 are in. There are significant results. @sgraf812
Large changes (2✅, 2🟥)
Medium changes (1🟥)
Small changes (9🟥)
|
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.
TODO. Semantically feature-complete with
mvcgen. Just needs more work for invariant sections, config settings and join point handling.