lean4-htt/src/Lean
Leonardo de Moura 3deba604bf
feat: cache output universe parameter positions (#12285)
This PR implements a cache for the positions of class universe level
parameters that only appear in output parameter types.

During type class resolution, the cache key for a query like
`HAppend.{0, 0, ?u} (BitVec 8) (BitVec 8) ?m` should be independent of
the specific metavariable IDs in output parameter positions. To achieve
this, output parameter arguments are erased from the cache key. However,
universe levels that only appear in output parameter types (e.g., `?u`
corresponding to the result type's universe) must also be erased to
avoid cache misses when the same query is issued with different universe
metavariable IDs.

This function identifies which universe level parameter positions are
"output-only" by collecting all level param names that appear in
non-output parameter domains, then returning the positions of any level
params not in that set.

**Remark**: This PR requires a manual update stage0 because it changes
the structure of our .olean files.
2026-02-02 19:56:33 -08:00
..
Compiler feat: @[instance_reducible] (#12247) 2026-02-01 03:03:16 +00:00
Data refactor: eliminate $/lean/ileanHeaderInfo (#12107) 2026-01-27 10:08:37 +00:00
DocString chore: make Verso module docstring API more like that for Markdown (#12093) 2026-01-22 04:45:49 +00:00
Elab fix: set isRecursive only after adding the declaration (#12269) 2026-02-02 17:13:08 +00:00
Language perf: Options.hasTrace (#12001) 2026-01-16 09:03:40 +00:00
LibrarySuggestions feat: @[instance_reducible] (#12247) 2026-02-01 03:03:16 +00:00
Linter feat: lint coercions that are deprecated or banned in core (#11511) 2025-12-12 15:09:13 +00:00
Meta fix: unification issue in proofs generated by Lean.Meta.MkIffOfInductiveProp (#12219) 2026-02-02 10:37:44 +00:00
Parser fix: make first token detection work in modules (#12047) 2026-01-20 11:12:05 +00:00
ParserCompiler chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
PrettyPrinter perf: Options.hasTrace (#12001) 2026-01-16 09:03:40 +00:00
Server fix: use windows path separators in System.Uri.fileUriToPath? (#12197) 2026-01-28 09:10:34 +00:00
Util chore: inline trace nodes (#11954) 2026-01-26 08:51:25 +00:00
Widget chore: rename String.Range to Lean.Syntax.Range (#10852) 2025-10-21 07:32:25 +00:00
AddDecl.lean refactor: move getOriginalConstKind? into its own module to avoid future import cycle (#12265) 2026-02-01 16:18:51 +00:00
Attributes.lean fix: run @[init] declarations in declaration order (#12221) 2026-01-29 15:32:56 +00:00
AuxRecursor.lean perf: add introSubstEq shortcut (#12190) 2026-01-28 12:33:14 +00:00
BuiltinDocAttr.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Class.lean feat: cache output universe parameter positions (#12285) 2026-02-02 19:56:33 -08:00
Compiler.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
CoreM.lean fix: revert "split ngen on async elab" (#12148) 2026-01-25 03:18:24 +00:00
Data.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
Declaration.lean chore: >6 month old deprecations (#10969) 2025-10-26 22:48:41 +00:00
DeclarationRange.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
DefEqAttrib.lean perf: clarify and granularize access to async env ext state (#9587) 2025-08-02 17:01:08 +00:00
DocString.lean
Elab.lean feat: add #import_path, assert_not_exists, assert_not_imported commands (#11726) 2025-12-19 04:09:33 +00:00
EnvExtension.lean fix: avoid panic in TagDeclarationExtension.tag on partial elaboration (#11882) 2026-01-05 00:36:58 +00:00
Environment.lean perf: make Environment.getModuleIdx? constant-time (#12068) 2026-01-21 14:38:28 +00:00
ErrorExplanation.lean refactor: move error explanation text to the manual (#11688) 2025-12-26 17:14:58 +00:00
Exception.lean refactor: move error explanation text to the manual (#11688) 2025-12-26 17:14:58 +00:00
Expr.lean feat: add simpControl simproc for if-then-else simplification (#12035) 2026-01-18 04:14:26 +00:00
ExtraModUses.lean feat: shake: make Mathlib-ready (#11496) 2025-12-05 09:37:58 +00:00
HeadIndex.lean
Hygiene.lean chore: do not set unused Option.Decl.group (#11307) 2025-11-21 16:44:38 +00:00
IdentifierSuggestion.lean chore: remove NameMapExtension abbreviation (#11632) 2025-12-12 12:34:53 +00:00
ImportingFlag.lean chore: miscellaneous documentation typos (#10009) 2025-08-20 21:39:03 +00:00
InternalExceptionId.lean chore: reorganize Init imports around strings (#10289) 2025-09-07 17:09:14 +00:00
KeyedDeclsAttribute.lean fix: some ExtraModUses (#10620) 2025-10-03 15:50:40 +00:00
LabelAttribute.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Level.lean fix: move the monad argument for ForIn, ForIn', and ForM (#10204) 2025-11-25 12:20:37 +00:00
LibrarySuggestions.lean fix: make library suggestions available in module files (#11373) 2025-11-26 05:39:27 +00:00
Linter.lean feat: lint coercions that are deprecated or banned in core (#11511) 2025-12-12 15:09:13 +00:00
LoadDynlib.lean refactor: use String.Slice in String.take and variants (#11180) 2025-11-18 16:13:48 +00:00
LocalContext.lean feat: support for incrementally processing hypotheses in grind (#11787) 2025-12-24 02:50:22 +00:00
Log.lean refactor: move error explanation text to the manual (#11688) 2025-12-26 17:14:58 +00:00
Message.lean perf: Options.hasTrace (#12001) 2026-01-16 09:03:40 +00:00
Meta.lean refactor: have telescope support (#11914) 2026-01-06 19:20:25 +00:00
MetavarContext.lean perf: Options.hasTrace (#12001) 2026-01-16 09:03:40 +00:00
Modifiers.lean chore: more module system fixes and refinements for finishing batteries port (#10819) 2025-10-21 08:19:50 +00:00
MonadEnv.lean feat: grind support for .ctorIdx (#11652) 2025-12-13 13:32:19 +00:00
Namespace.lean
OriginalConstKind.lean refactor: move getOriginalConstKind? into its own module to avoid future import cycle (#12265) 2026-02-01 16:18:51 +00:00
Parser.lean feat: hexnum parser (#10716) 2025-10-08 21:12:03 +00:00
ParserCompiler.lean doc: correct typos in documentation and comments (#11465) 2025-12-02 06:38:05 +00:00
PrettyPrinter.lean chore: do not set unused Option.Decl.group (#11307) 2025-11-21 16:44:38 +00:00
PrivateName.lean
ProjFns.lean chore: delete obsolete C++ file (#11561) 2025-12-09 15:47:54 +00:00
ReducibilityAttrs.lean feat: @[instance_reducible] (#12247) 2026-02-01 03:03:16 +00:00
Replay.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
ReservedNameAction.lean
ResolveName.lean chore: more module system fixes and refinements for finishing batteries port (#10819) 2025-10-21 08:19:50 +00:00
Runtime.lean
ScopedEnvExtension.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Server.lean feat: revamp server logging (#10787) 2025-10-28 16:26:59 +00:00
Setup.lean fix: symbol clashes between packages (#11082) 2025-11-19 02:24:44 +00:00
Shell.lean perf: Options.hasTrace (#12001) 2026-01-16 09:03:40 +00:00
Structure.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
SubExpr.lean refactor: use String.split instead of String.splitOn or String.splitToList (#11250) 2025-11-19 09:35:19 +00:00
Syntax.lean fix: move the monad argument for ForIn, ForIn', and ForM (#10204) 2025-11-25 12:20:37 +00:00
ToExpr.lean feat: support for Rat scientific literals (#10961) 2025-10-26 02:05:26 +00:00
ToLevel.lean
Util.lean feat: instantiate tactic parameter optimizer (#10916) 2025-10-23 01:22:33 +00:00
Widget.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00