These options affect the generation of equational theorems in a significant way. For these, their value at definition time, not realization time, should matter.
This is implemented by storing their values at definition time (when non-default) in an environment extension, and restoring them when the equations are lazily realized.
Equations
Instances For
Environment extension that stores the values of eqnAffectingOptions at definition time,
keyed by declaration name. Only populated when at least one option has a non-default value.
Stores an association list of (option name, value) pairs for options that differ from defaults.
Equations
Instances For
Equations
Instances For
Returns true if s is of the form eq_<idx>
Equations
Instances For
Equations
- Lean.Meta.unfoldThmSuffix = "eq_def"
Instances For
Equations
- Lean.Meta.eqUnfoldThmSuffix = "eq_unfold"
Instances For
Equations
Instances For
The equational theorem for a definition can be private even if the definition itself is not. So un-private the name here when looking for a declaration
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Throw an error if names for equation theorems for declName are not available.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Registers a new function for retrieving equation theorems. We generate equations theorems on demand, and they are generated by more than one module. For example, the structural and well-founded recursion modules generate them. Most recent getters are tried first.
A getter returns an Option (Array Name). The result is none if the getter failed.
Otherwise, it is a sequence of theorem names where each one of them corresponds to
an alternative. Example: the definition
def f (xs : List Nat) : List Nat :=
match xs with
| [] => []
| x::xs => (x+1)::f xs
should have two equational theorems associated with it
f [] = []
and
(x : Nat) → (xs : List Nat) → f (x :: xs) = (x+1) :: f xs
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
A mapping from equational theorem to the declaration it was derived from.
Runs act with the equation-affecting options restored to the values stored for declName
at definition time (or reset to their defaults if none were stored). Use this inside
realizeConst callbacks, which otherwise see the caller-independent ctx.opts rather than
the outer getEqnsFor? context.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns some declName if thmName is an equational theorem for declName.
Equations
- Lean.Meta.isEqnThm? thmName = do let __do_lift ← Lean.getEnv pure (Lean.PersistentHashMap.find? (Lean.Meta.eqnsExt.getState __do_lift).mapInv thmName)
Instances For
Returns true if thmName is an equational theorem.
Equations
- Lean.Meta.isEqnThm thmName = do let __do_lift ← Lean.getEnv pure (Lean.PersistentHashMap.contains (Lean.Meta.eqnsExt.getState __do_lift).mapInv thmName)
Instances For
Returns equation theorems for the given declaration.
Equations
- Lean.Meta.getEqnsFor? declName = Lean.Meta.withLCtx { } ∅ (Lean.Meta.withEqnOptions declName (Lean.Meta.getEqnsFor?Core✝ declName))
Instances For
If any equation theorem affecting option is not the default value, store the option values for later use during lazy equation generation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Registers a new function for retrieving a "unfold" equation theorem.
We generate this kind of equation theorem on demand, and it is generated by more than one module. For example, the structural and well-founded recursion modules generate it. Most recent getters are tried first.
A getter returns an Option Name. The result is none if the getter failed.
Otherwise, it is a theorem name. Example: the definition
def f (xs : List Nat) : List Nat :=
match xs with
| [] => []
| x::xs => (x+1)::f xs
should have the theorem
(xs : Nat) →
f xs =
match xs with
| [] => []
| x::xs => (x+1)::f xs
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns an "unfold" theorem (f.eq_def) for the given declaration.
By default, we do not create unfold theorems for nonrecursive definitions.
You can use nonRec := true to override this behavior.
Equations
- One or more equations did not get rendered due to their size.