Equations
- Lean.Meta.instInhabitedFVarSubst = { default := { map := default } }
Equations
- Lean.Meta.FVarSubst.empty = { map := ∅ }
Equations
Equations
- Lean.Meta.FVarSubst.contains s fvarId = Std.AssocList.contains fvarId s.map
Equations
- Lean.Meta.FVarSubst.insert s fvarId v = if Lean.Meta.FVarSubst.contains s fvarId = true then s else let map := Std.AssocList.mapVal (fun e => Lean.Expr.replaceFVarId e fvarId v) s.map; { map := Std.AssocList.insert map fvarId v }
Equations
- Lean.Meta.FVarSubst.erase s fvarId = { map := Std.AssocList.erase fvarId s.map }
Equations
- Lean.Meta.FVarSubst.find? s fvarId = Std.AssocList.find? fvarId s.map
Equations
- Lean.Meta.FVarSubst.get s fvarId = match Std.AssocList.find? fvarId s.map with | none => Lean.mkFVar fvarId | some v => v
Equations
- Lean.Meta.FVarSubst.apply s e = if Std.AssocList.isEmpty s.map = true then e else if (!Lean.Expr.hasFVar e) = true then e else Lean.Expr.replace (fun e => match e with | Lean.Expr.fvar fvarId x => match Std.AssocList.find? fvarId s.map with | none => some e | some v => some v | x => none) e
Equations
- Lean.Meta.FVarSubst.domain s = Std.AssocList.foldl (fun r k v => k :: r) [] s.map
Equations
- Lean.Meta.FVarSubst.any p s = Std.AssocList.any p s.map
Equations
- Lean.LocalDecl.applyFVarSubst s x = match x with | Lean.LocalDecl.cdecl i id n t bi => Lean.LocalDecl.cdecl i id n (Lean.Meta.FVarSubst.apply s t) bi | Lean.LocalDecl.ldecl i id n t v nd => Lean.LocalDecl.ldecl i id n (Lean.Meta.FVarSubst.apply s t) (Lean.Meta.FVarSubst.apply s v) nd
@[inline]