Datastructure for representing the "head symbol" of an expression.
It is the key of KExprMap
.
Examples:
- The head of
f a
is.const f
- The head of
let x := 1; f x
is.const f
- The head of
fun x => fun
is.lam
HeadIndex
is a very simple index, and is used in situations where
we want to find definitionally equal terms, but we want to minimize
the search by checking only pairs of terms that have the same
HeadIndex
.
- fvar: Lean.FVarId → Lean.HeadIndex
- mvar: Lean.MVarId → Lean.HeadIndex
- const: Lean.Name → Lean.HeadIndex
- proj: Lean.Name → Nat → Lean.HeadIndex
- lit: Lean.Literal → Lean.HeadIndex
- sort: Lean.HeadIndex
- lam: Lean.HeadIndex
- forallE: Lean.HeadIndex
Instances For
Equations
- Lean.instReprHeadIndex = { reprPrec := Lean.reprHeadIndex✝ }
Hash code for a HeadIndex
value.
Equations
- (Lean.HeadIndex.fvar a).hash = mixHash 11 (hash a)
- (Lean.HeadIndex.mvar a).hash = mixHash 13 (hash a)
- (Lean.HeadIndex.const a).hash = mixHash 17 (hash a)
- (Lean.HeadIndex.proj a a_1).hash = mixHash 19 (mixHash (hash a) (hash a_1))
- (Lean.HeadIndex.lit a).hash = mixHash 23 (hash a)
- Lean.HeadIndex.sort.hash = 29
- Lean.HeadIndex.lam.hash = 31
- Lean.HeadIndex.forallE.hash = 37
Instances For
Return the number of arguments in the given expression with respect to its HeadIndex
Instances For
Convert the given expression into a HeadIndex
.
Equations
- e.toHeadIndex = match Lean.Expr.toHeadIndexQuick?✝ e with | some i => i | none => Lean.Expr.toHeadIndexSlow✝ e