Alpha equivalence for LCNF Code
@[reducible, inline]
Instances For
Equations
- Lean.Compiler.LCNF.AlphaEqv.eqvFVar fvarId₁ fvarId₂ = do let __do_lift ← read let fvarId₂ : Lean.FVarId := (Lean.RBMap.find? __do_lift fvarId₂).getD fvarId₂ pure (fvarId₁ == fvarId₂)
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.Compiler.LCNF.AlphaEqv.eqvArg
(a₁ : Lean.Compiler.LCNF.Arg)
(a₂ : Lean.Compiler.LCNF.Arg)
:
Equations
- Lean.Compiler.LCNF.AlphaEqv.eqvArg (Lean.Compiler.LCNF.Arg.type e₁) (Lean.Compiler.LCNF.Arg.type e₂) = Lean.Compiler.LCNF.AlphaEqv.eqvType e₁ e₂
- Lean.Compiler.LCNF.AlphaEqv.eqvArg (Lean.Compiler.LCNF.Arg.fvar x₁) (Lean.Compiler.LCNF.Arg.fvar x₂) = Lean.Compiler.LCNF.AlphaEqv.eqvFVar x₁ x₂
- Lean.Compiler.LCNF.AlphaEqv.eqvArg Lean.Compiler.LCNF.Arg.erased Lean.Compiler.LCNF.Arg.erased = pure true
- Lean.Compiler.LCNF.AlphaEqv.eqvArg a₁ a₂ = pure false
Instances For
def
Lean.Compiler.LCNF.AlphaEqv.eqvArgs
(as₁ : Array Lean.Compiler.LCNF.Arg)
(as₂ : Array Lean.Compiler.LCNF.Arg)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.Compiler.LCNF.AlphaEqv.eqvLetValue
(e₁ : Lean.Compiler.LCNF.LetValue)
(e₂ : Lean.Compiler.LCNF.LetValue)
:
Equations
- One or more equations did not get rendered due to their size.
- Lean.Compiler.LCNF.AlphaEqv.eqvLetValue (Lean.Compiler.LCNF.LetValue.value v₁) (Lean.Compiler.LCNF.LetValue.value v₂) = pure (v₁ == v₂)
- Lean.Compiler.LCNF.AlphaEqv.eqvLetValue Lean.Compiler.LCNF.LetValue.erased Lean.Compiler.LCNF.LetValue.erased = pure true
- Lean.Compiler.LCNF.AlphaEqv.eqvLetValue e₁ e₂ = pure false
Instances For
@[inline]
def
Lean.Compiler.LCNF.AlphaEqv.withFVar
{α : Type}
(fvarId₁ : Lean.FVarId)
(fvarId₂ : Lean.FVarId)
(x : Lean.Compiler.LCNF.AlphaEqv.EqvM α)
:
Equations
- Lean.Compiler.LCNF.AlphaEqv.withFVar fvarId₁ fvarId₂ x = withReader (fun (x : Lean.FVarIdMap Lean.FVarId) => x.insert fvarId₂ fvarId₁) x
Instances For
@[inline]
def
Lean.Compiler.LCNF.AlphaEqv.withParams
(params₁ : Array Lean.Compiler.LCNF.Param)
(params₂ : Array Lean.Compiler.LCNF.Param)
(x : Lean.Compiler.LCNF.AlphaEqv.EqvM Bool)
:
Equations
- Lean.Compiler.LCNF.AlphaEqv.withParams params₁ params₂ x = if h : params₂.size = params₁.size then Lean.Compiler.LCNF.AlphaEqv.withParams.go params₁ params₂ x h 0 else pure false
Instances For
@[irreducible, specialize #[]]
def
Lean.Compiler.LCNF.AlphaEqv.withParams.go
(params₁ : Array Lean.Compiler.LCNF.Param)
(params₂ : Array Lean.Compiler.LCNF.Param)
(x : Lean.Compiler.LCNF.AlphaEqv.EqvM Bool)
(h : params₂.size = params₁.size)
(i : Nat)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
partial def
Lean.Compiler.LCNF.AlphaEqv.eqvAlts
(alts₁ : Array Lean.Compiler.LCNF.Alt)
(alts₂ : Array Lean.Compiler.LCNF.Alt)
:
partial def
Lean.Compiler.LCNF.AlphaEqv.eqv
(code₁ : Lean.Compiler.LCNF.Code)
(code₂ : Lean.Compiler.LCNF.Code)
:
def
Lean.Compiler.LCNF.Code.alphaEqv
(c₁ : Lean.Compiler.LCNF.Code)
(c₂ : Lean.Compiler.LCNF.Code)
:
Return true
if c₁
and c₂
are alpha equivalent.
Equations
- c₁.alphaEqv c₂ = ReaderT.run (Lean.Compiler.LCNF.AlphaEqv.eqv c₁ c₂) ∅