feat: mvcgen', an experimental SymM-based implementation mvcgen#13644
Merged
Conversation
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
Contributor
Author
|
!bench |
|
Benchmark results for 8d2db9d against 42eb038 are in. There are significant results. @sgraf812
Large changes (5🟥)
Medium changes (4🟥)
Small changes (17🟥)
and 1 hidden |
Adds a `+debug` config option to `mvcgen'` and a `BackwardRule.applyChecked` wrapper around `BackwardRule.apply`. On apply failure with `+debug` set, the wrapper retries on the `unfoldReducible`-normalized goal type; if the retry succeeds, an earlier step missed a normalization and we throw a hard error naming the rule (auto-derived from `rule.expr.getAppFn` when available) and showing the original vs. normalized types. All `BackwardRule.apply` call sites in `Entails`, `Solve`, and `Util` (`repeatAndRfl`) now go through `applyChecked` via dot notation. Default behaviour (without `+debug`) is unchanged.
…lues User-provided invariant values (`mvcgen' invariants · …`) are elaborated against goal types containing reducible abbreviations like `PostShape.args ps`, so the resulting term carries `(PostShape.args PostShape.pure)` baked into its body instead of `[]`. Those stuck abbreviations propagate via metavariable substitution and later block rule applications such as `SPred.pure_elim'` in `solveSPredEntails`. After `tryInlineInvariant` confirms the user tactic assigned the invariant metavariable, reduce its assignment with `unfoldReducible`. Fixes the failure on `tests/elab/10564.lean` (and incidentally `9581.lean` and `grind_12246.lean`) when the proofs are migrated to `mvcgen'`. The `+debug` wrapper added in the previous commit was used to pinpoint the missing reduction.
8176e6b to
e626935
Compare
Contributor
Author
|
!bench |
|
Benchmark results for e626935 against 5d56421 are in. There are significant results. @sgraf812
Large changes (4🟥)
Medium changes (4🟥)
Small changes (18🟥)
and 1 hidden |
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 PR adds an experimental tactic
mvcgen'that will soon replacemvcgen. It has been reimplemented from the ground up using the newSymM-based framework for efficient symbolic evaluation and can outperformmvcgenby a factor of >100x for some synthetic benchmarks.mvcgen'aspires to be feature-complete withmvcgen. Known exceptions currently are join point sharing, introduction of local specs and smaller bugs.The implementation of
mvgen'used to live in the benchmark suite for rapid prototyping; this commit merely moves it into the Lean toolchain. Doing so results in an build time instruction count increase in seemingly unrelated tests such aselab/delayed_assign//instructions; the reason is that the builtin elaborator attribute now pulls in substantially more import code on startup.