Equations
- (Lean.Expr.bvar deBruijnIndex).ctorWeight = 0
- (Lean.Expr.fvar fvarId).ctorWeight = 1
- (Lean.Expr.mvar mvarId).ctorWeight = 2
- (Lean.Expr.sort u).ctorWeight = 3
- (Lean.Expr.const declName us).ctorWeight = 4
- (Lean.Expr.lit a).ctorWeight = 5
- (Lean.Expr.mdata data expr).ctorWeight = 6
- (Lean.Expr.proj typeName idx struct).ctorWeight = 7
- (fn.app arg).ctorWeight = 8
- (Lean.Expr.lam binderName binderType body binderInfo).ctorWeight = 9
- (Lean.Expr.forallE binderName binderType body binderInfo).ctorWeight = 10
- (Lean.Expr.letE declName type value body nonDep).ctorWeight = 11
Instances For
- reduce: Lean.Meta.ACLt.ReduceMode
- reduceSimpleOnly: Lean.Meta.ACLt.ReduceMode
- none: Lean.Meta.ACLt.ReduceMode
Instances For
An AC-compatible ordering.
Recall that an AC-compatible ordering if it is monotonic, well-founded, and total. Both KBO and LPO are AC-compatible. KBO is faster, but we do not cache the weight of each expression in Lean 4. Even if we did, we would need to have a weight where implicit instance arguments are ignored. So, we use a LPO-like term ordering.
Remark: this method is used to implement ordered rewriting. We ignore implicit instance arguments to address an issue reported at issue #972.
Remark: the order is not really total on terms since
- We instance implicit arguments.
- We ignore metadata.
- We ignore universe parameterst at constants.
Equations
- Lean.Meta.ACLt.main a b mode = Lean.Meta.ACLt.main.lt mode a b
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.Meta.ACLt.main.reduce Lean.Meta.ACLt.ReduceMode.none e = if e.hasLooseBVars = true then pure e else pure e
Instances For
Equations
- Lean.Meta.ACLt.main.getParamsInfo f numArgs = if f.hasLooseBVars = true then pure #[] else do let __do_lift ← Lean.Meta.getFunInfoNArgs f numArgs pure __do_lift.paramInfo
Instances For
An AC-compatible ordering.
Recall that an AC-compatible ordering if it is monotonic, well-founded, and total. Both KBO and LPO are AC-compatible. KBO is faster, but we do not cache the weight of each expression in Lean 4. Even if we did, we would need to have a weight where implicit instance arguments are ignored. So, we use a LPO-like term ordering.
Remark: this method is used to implement ordered rewriting. We ignore implicit instance arguments to address an issue reported at issue #972.
Remark: the order is not really total on terms since
- We instance implicit arguments.
- We ignore metadata.
- We ignore universe parameterst at constants.
Equations
- Lean.Meta.acLt a b mode = Lean.Meta.ACLt.main a b mode