Anchor (aka stable hash) support for grind. We use
anchors to reference terms in the grind state.
Returns the anchor of e, or 0 if anchors are disabled. See Context.anchors.
Equations
- Lean.Meta.Grind.getAnchor e = do let __do_lift ← Lean.Meta.Grind.anchorsEnabled if __do_lift = true then Lean.Meta.Grind.getAnchorCore✝ e else pure 0
Instances For
Example: { numDigits := 4, anchorPrefix := 0x0c88 }.matches 0x0c88ab10ef20206a returns true
Equations
Instances For
Returns the number of digits needed to distinguish the anchors in es.
Elements with identical (full) anchors cannot be distinguished by adding more digits.
Thus, they are ignored by this function. Callers must handle these collisions separately
(e.g., the cases tactic uses ordinal references such as #a56e/2).
Equations
Instances For
@[instance_reducible]
Equations
- Lean.Meta.Grind.instHasAnchorExprWithAnchor = { getAnchor := fun (e : Lean.Meta.Grind.ExprWithAnchor) => e.anchor }
Equations
- Lean.Meta.Grind.mkAnchorSyntax numDigits anchor = have anchorPrefix := anchor >>> (64 - 4 * numDigits.toUInt64); Lean.Meta.Grind.mkAnchorSyntaxFromPrefix numDigits anchorPrefix