A simplification theorem for the structural simplifier.
Contains both the theorem expression and a precomputed pattern for efficient unification during rewriting.
- expr : Expr
The theorem expression, typically
Expr.const declNamefor a named theorem. - pattern : Pattern
Precomputed pattern extracted from the theorem's type for efficient matching.
- rhs : Expr
Right-hand side of the equation.
- perm : Bool
If
true, the theorem is a permutation rule (e.g.,x + y = y + x). Rewriting is only applied when the result is strictly less than the input (usingacLt), preventing infinite loops. - rhsVarMask : Nat
- fallback : Bool
If
true, the theorem is tried only when no other theorem rewrites the term. Used for the unfolding theoremf.eq_defof a definitionfprovided as aSym.simpparameter: the equational theorems offtake precedence. SeeTheorems.rewrite.
Instances For
Collection of simplification theorems available to the simplifier.
The theorems with
Theorem.fallback := true. SeeTheorems.rewrite.
Instances For
Instances For
Returns the theorems matching e, excluding the fallback ones.
Instances For
Returns the theorems matching a prefix of e, excluding the fallback ones.
Instances For
Returns the fallback theorems matching a prefix of e.
Instances For
The names of the theorems contributed by a declaration used as a Sym.simp theorem.
The declaration itself when it is a proposition, or the equational theorems of a definition. Empty for a reducible definition, which the
Sympreprocessing unfolds.The unfolding theorem
f.eq_defof a non-recursive definitionf, unlessthmsalready unfolds everyfapplication. It is a fallback (seeTheorem.fallback), so thatsimp [f]unfolds thefapplications not covered by the equational theorems, likeMeta.simpdoes.
Instances For
Returns the names of the theorems contributed by declName when it is used as a Sym.simp
theorem. A proposition contributes itself. A definition contributes its equational theorems
and, when it is not recursive, its unfolding theorem, so that simp [f] unfolds f
applications.
Instances For
Creates the Theorems contributed by declName when it is used as a Sym.simp theorem.
See getSimpTheoremNames.
Instances For
Environment extension storing a set of Sym.Simp theorems.
Each named set gets its own extension, created by registerSymSimpAttr.