Equations
- Lean.Compiler.CSimp.instInhabitedEntry = { default := { fromDeclName := default, toDeclName := default } }
@[inline]
Equations
Equations
- Lean.Compiler.CSimp.add declName kind = do let a ← Lean.Compiler.CSimp.isConstantReplacement? declName match a with | some entry => Lean.ScopedEnvExtension.add Lean.Compiler.CSimp.ext entry kind | x => Lean.throwError (Lean.toMessageData "invalid 'csimp' theorem, only constant replacement theorems (e.g., `@f = @g`) are currently supported.")
Equations
- Lean.Compiler.CSimp.replaceConstants env e = let map := Lean.ScopedEnvExtension.getState Lean.Compiler.CSimp.ext env; Lean.Expr.replace (fun e => if Lean.Expr.isConst e = true then match Lean.SMap.find? map (Lean.Expr.constName! e) with | some declNameNew => some (Lean.mkConst declNameNew (Lean.Expr.constLevels! e)) | none => none else none) e