feat: add pp.fvars.anonymous option#12688
Merged
kim-em merged 1 commit intoleanprover:masterfrom Mar 1, 2026
Merged
Conversation
Add a `pp.fvars.anonymous` option (default `true`) that controls the display of loose free variables (fvars not in the local context). When `true` (default), loose fvars are displayed with their internal name like `_fvar.42`. When `false`, they are displayed as `_`. This is analogous to `pp.mvars.anonymous` for metavariables, and is useful for stabilizing output in `#guard_msgs` when messages contain fvar IDs that vary between runs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
github-actions bot
pushed a commit
that referenced
this pull request
Mar 1, 2026
This PR adds a `pp.fvars.anonymous` option (default `true`) that controls the display of loose free variables (fvars not in the local context). - When `true` (default), loose fvars display their internal name like `_fvar.42` - When `false`, they display as `_fvar._` This is analogous to `pp.mvars.anonymous` for metavariables. It's useful for stabilizing output in `#guard_msgs` when messages contain fvar IDs that vary between runs — for example, in diagnostic tools that report `isDefEq` failures from trace output where the local context is not available. 🤖 Prepared with Claude Code Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> (cherry picked from commit 5dd8d57)
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 1, 2026
This PR fixes `pp.fvars.anonymous` to display loose free variables as `_fvar._` instead of `_` when the option is set to `false`. This was the intended behavior in #12688 but the fix was committed locally and not pushed before that PR was merged. 🤖 Prepared with Claude Code Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
kim-em
added a commit
that referenced
this pull request
Mar 1, 2026
kim-em
added a commit
that referenced
this pull request
Mar 1, 2026
This PR fixes `pp.fvars.anonymous` to display loose free variables as `_fvar._` instead of `_` when the option is set to `false`. This was the intended behavior in #12688 but the fix was committed locally and not pushed before that PR was merged. 🤖 Prepared with Claude Code Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
kmill
reviewed
Mar 1, 2026
| -- use internal name like `_fvar.22` | ||
| maybeAddBlockImplicit <| mkIdent (fvarId.name.replacePrefix `_uniq `_fvar) | ||
| else | ||
| maybeAddBlockImplicit <| mkIdent `_ |
Collaborator
There was a problem hiding this comment.
What do you think about using something that communicates that this is an fvar?
Suggested change
| maybeAddBlockImplicit <| mkIdent `_ | |
| maybeAddBlockImplicit <| mkIdent `_fvar |
With pp.mvars.anonymous, you can tell that what's being pretty printed is a metavariable.
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 a
pp.fvars.anonymousoption (defaulttrue) that controls the display of loose free variables (fvars not in the local context).true(default), loose fvars display their internal name like_fvar.42false, they display as_fvar._This is analogous to
pp.mvars.anonymousfor metavariables. It's useful for stabilizing output in#guard_msgswhen messages contain fvar IDs that vary between runs — for example, in diagnostic tools that reportisDefEqfailures from trace output where the local context is not available.🤖 Prepared with Claude Code