Spec-theorem database used by mvcgen'. Mirrors the legacy SpecTheorems /
SpecProof API from Lean.Elab.Tactic.Do.Attr but indexes specs in a
Sym.DiscrTree keyed on the program's syntactic shape, with explicit
SpecTheoremKind (triple vs. simp) and per-spec eta-potential metadata.
The kind of a spec theorem.
- triple
(etaPotential : Nat := 0)
: SpecTheoremKind
A Hoare triple spec:
⦃P⦄ prog ⦃Q⦄. IfetaPotentialis non-zero, then the precondition contains meta variables that can be instantiated after applyingmintro ∀setaPotentialmany times. - simp
(etaArgs : Nat := 0)
: SpecTheoremKind
A simp/equational spec:
lhs = rhs. The pattern is the LHS. When matched, the VCGen rewrites the program fromlhstorhsand continues.etaArgsis the number of extra arguments introduced by eta-expanding function-level equations (e.g., class projection unfold lemmas). These args needcongrFunat instantiation time.
Instances For
- pattern : Meta.Sym.Pattern
Pattern for the program expression. This is the key used in the discrimination tree. If the proof has type
∀ a b c, Triple prog P Q, then the pattern isprog[a:=#2, b:=#1, c:=#0]. For simp specs with type∀ a b c, lhs = rhs, the pattern islhs[a:=#2, b:=#1, c:=#0]. - proof : SpecProof
The proof for the theorem.
- kind : SpecTheoremKind
The kind of spec theorem: triple or simp.
- priority : Nat
Instances For
Equations
- Lean.Elab.Tactic.Do.SpecAttr.instBEqSpecTheoremNew = { beq := fun (thm₁ thm₂ : Lean.Elab.Tactic.Do.SpecAttr.SpecTheoremNew) => thm₁.proof == thm₂.proof }
Like SpecProof.instantiate, but for simp specs also eta-expands function-level equations.
For unfold equations of class projections (e.g., MonadState.modifyGet.eq_1), the equation
after forallMetaTelescope may be between functions rather than values:
@modifyGet σ m self = self.3 : {α} → (σ → α × σ) → m α
This method applies congrFun for each leading forall to reduce the equation to one between
values of type m α, introducing fresh metavariables for the extra arguments.
The number of extra args is stored in SpecTheoremKind.simp etaArgs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
- specs : Meta.DiscrTree SpecTheoremNew
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Create a SpecTheoremNew from a simp/equational declaration declName : ∀ xs, lhs = rhs.
The pattern is keyed on lhs.
For unfold equations of class projections (e.g., MonadState.modifyGet.eq_1), the equation
may be between functions rather than values. In that case, the pattern is eta-expanded
so the discrimination tree key includes all arguments.
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
Look up SpecTheoremNews in the @[spec] database.
Takes all specs that match the given program e and sorts by descending priority.
Equations
- One or more equations did not get rendered due to their size.