lean4-htt/src/Lean/Elab
Matthew Robert Ballard 03f344a35f
feat: use supplied structure fields left to right and eta reduce terms in structure instance elaboration (#2478)
Modifies the structure instance elaborator to
1. Fill in missing fields from sources in strict left-to-right order. In
`{a, b with}`, sometimes the elaborator
would ignore `a` even if both `a` and `b` provided the same field,
depending on what subobject fields they had.
2. Use the sources, or subobjects of the sources, to fill in entire
subobjects of the target structure as much as possible.
Currently, a field cannot be filled directly by a source itself
resulting in the term being eta expanded.
This change avoids this unnecessary and surprisingly costly extra eta
expansion.

Adds two new tests to illustrate the performance benefit (one courtesy
@semorrison). These are currently failing on master and succeed on this
branch.

There is one additional test to exercise the changes to the elaboration
of structure instances.

Changes to make mathlib build are in leanprover-community/mathlib4#9843

Closes #2451
2024-02-01 03:42:39 +00:00
..
Deriving fix: derive BEq on structure with Prop-fields (#3191) 2024-01-18 02:32:51 +00:00
InfoTree feat: elidible subterms (#3201) 2024-01-31 17:28:29 +00:00
PreDefinition fix: predefinition preprocessing: float .mdata out of non-unary applications (#3204) 2024-01-24 08:37:16 +00:00
Quotation feat: add quot_precheck for expression tree elaborators (binop%, etc.) (#3078) 2023-12-18 16:52:49 +00:00
Tactic feat: induction using <term> (#3188) 2024-01-25 16:57:41 +00:00
App.lean feat: induction using <term> (#3188) 2024-01-25 16:57:41 +00:00
Arg.lean chore: remove unused param 2022-07-29 20:41:38 -07:00
Attributes.lean fix: attribute info nesting 2022-11-16 11:12:24 +01:00
AutoBound.lean feat: allow upper case single character identifiers when relaxedAutoImplicit false (#2277) 2023-06-19 20:04:09 -07:00
AuxDef.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Binders.lean feat: per-function termination hints 2024-01-10 17:27:35 +01:00
BindersUtil.lean chore: post-bootstrap cleanup 2022-10-11 17:24:35 -07:00
BuiltinCommand.lean doc: add documentation for universe, open, export, variable 2023-11-17 13:19:10 +00:00
BuiltinNotation.lean doc: fix typos (#3114) 2023-12-23 18:55:48 +00:00
BuiltinTerm.lean fix: implement · tacs as a builtin elaborator, part 2 2023-03-15 17:00:15 +01:00
Calc.lean chore: fix typos in comments 2023-10-08 10:46:05 +02:00
Command.lean feat: partial context info (#3159) 2024-01-22 12:34:20 +00:00
ComputedFields.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Config.lean chore: convert doc/mod comments from /- to /--//-! (#1354) 2022-07-22 12:05:31 -07:00
Declaration.lean feat: per-function termination hints 2024-01-10 17:27:35 +01:00
DeclarationRange.lean chore: fix typos in comments 2023-10-08 10:46:05 +02:00
DeclModifiers.lean feat: go to duplicate definition 2022-10-11 10:07:49 +02:00
DeclUtil.lean refactor: use computed fields for Expr 2022-07-11 14:19:41 -07:00
DefView.lean feat: per-function termination hints 2024-01-10 17:27:35 +01:00
Deriving.lean feat: add derive handler for Nonempty 2022-12-22 03:48:15 +01:00
Do.lean fix: allow generalization in let (#3060) 2024-01-23 09:02:05 +00:00
ElabRules.lean fix: fixes #2009 2023-01-04 10:32:03 -08:00
Eval.lean
Exception.lean
Extra.lean feat: leftact%/rightact% binop variants 2023-11-12 16:57:51 +11:00
Frontend.lean feat: add call hierarchy support (#3082) 2024-01-25 14:43:23 +00:00
GenInjective.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Import.lean perf: leak environments not freed before process exit 2023-11-14 17:33:04 +01:00
Inductive.lean chore: fix typos in comments 2023-10-08 10:46:05 +02:00
InfoTree.lean refactor: split InfoTree.lean 2022-07-25 08:41:34 -07:00
InheritDoc.lean fix: improved error span for inherit_doc (#1807) 2022-11-07 20:11:41 +00:00
LetRec.lean feat: per-function termination hints 2024-01-10 17:27:35 +01:00
Level.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Macro.lean fix: fixes #2009 2023-01-04 10:32:03 -08:00
MacroArgUtil.lean feat: dynamic quotations for categories 2022-10-18 14:59:14 -07:00
MacroRules.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Match.lean chore: fix typos in comments 2023-10-08 10:46:05 +02:00
MatchAltView.lean chore: convert doc/mod comments from /- to /--//-! (#1354) 2022-07-22 12:05:31 -07:00
Mixfix.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
MutualDef.lean feat: per-function termination hints 2024-01-10 17:27:35 +01:00
Notation.lean fix: notation unexpander on overapplication of non-nullary notation 2023-01-26 13:05:33 +01:00
Open.lean feat: hovers on open and export decls 2023-11-02 17:01:51 +01:00
ParseImportsFast.lean fix: parseImports': respect prelude 2022-11-15 07:40:10 -08:00
PatternVar.lean doc: mention x:h@e variant in docstring of x@e (#3073) 2023-12-14 18:58:14 +00:00
PreDefinition.lean
Print.lean doc: fix typos/indentation (#3085) 2023-12-17 18:41:46 +00:00
Quotation.lean fix: $_* anonymous suffix splice syntax pattern 2023-03-06 16:30:18 +01:00
RecAppSyntax.lean fix: Float RecApp out of applications (#2818) 2023-11-22 14:25:09 +00:00
SetOption.lean feat: hover/go-to-def/refs for options 2022-11-07 20:01:13 +01:00
StructInst.lean feat: use supplied structure fields left to right and eta reduce terms in structure instance elaboration (#2478) 2024-02-01 03:42:39 +00:00
Structure.lean feat: rename request handler (#2462) 2023-11-21 13:10:52 +01:00
Syntax.lean fix: prefer resolving parser alias over declaration 2023-06-05 16:52:23 +02:00
SyntheticMVars.lean feat: per-function termination hints 2024-01-10 17:27:35 +01:00
Tactic.lean feat: simproc declaration vs simproc attribute 2024-01-09 12:57:15 +01:00
Term.lean feat: induction using <term> (#3188) 2024-01-25 16:57:41 +00:00
Util.lean doc: fix typo 2023-11-15 12:19:42 +11:00