File: .lake/packages/lean4/src/lean/Lean/Compiler/LCNF/PassManager.lean

full_name: Lean.Compiler.LCNF.Phase.toNat
code: def Phase.toNat : Phase → Nat
  
goal: Lean.Compiler.LCNF.Phase → Nat

full_name: Lean.Compiler.LCNF.«instLTPhase_.lake»
code: instance : LT Phase 
goal: LT Lean.Compiler.LCNF.Phase

full_name: Lean.Compiler.LCNF.«instLEPhase_.lake»
code: instance : LE Phase 
goal: LE Lean.Compiler.LCNF.Phase

full_name: Lean.Compiler.LCNF.«instDecidableLtPhase_.lake»
code: instance {p1 p2 : Phase} : Decidable (p1 < p2) 
goal: Decidable (p1 < p2)

full_name: Lean.Compiler.LCNF.«instDecidableLePhase_.lake»
code: instance {p1 p2 : Phase} : Decidable (p1 ≤ p2) 
goal: Decidable (p1 ≤ p2)

full_name: Lean.Compiler.LCNF.Phase.le_refl
code: @[simp] theorem Phase.le_refl (p : Phase) : p ≤ p 
goal: p ≤ p

full_name: Lean.Compiler.LCNF.Pass
code: /--
A single compiler `Pass`, consisting of the actual pass function operating
on the `Decl`s as well as meta information.
-/
structure Pass where
  /--
  Which occurrence of the pass in the pipeline this is.
  Some passes, like simp, can occur multiple times in the pipeline.
  For most passes this value does not matter.
  -/
  occurrence : Nat := 0
  /--
  Which phase this `Pass` is supposed to run in
  -/
  phase : Phase
  /--
  Resulting phase.
  -/
  phaseOut : Phase := phase
  phaseInv : phaseOut ≥ phase := by simp_arith
  /--
  The name of the `Pass`
  -/
  name : Name
  /--
  The actual pass function, operating on the `Decl`s.
  -/
  run : Array Decl → CompilerM (Array Decl)
goal: Type

full_name: Lean.Compiler.LCNF.Pass.phaseOut
code: /--
A single compiler `Pass`, consisting of the actual pass function operating
on the `Decl`s as well as meta information.
-/
structure Pass where
  /--
  Which occurrence of the pass in the pipeline this is.
  Some passes, like simp, can occur multiple times in the pipeline.
  For most passes this value does not matter.
  -/
  occurrence : Nat := 0
  /--
  Which phase this `Pass` is supposed to run in
  -/
  phase : Phase
  /--
  Resulting phase.
  -/
  phaseOut : Phase := phase
  phaseInv : phaseOut ≥ phase := by simp_arith
  /--
  The name of the `Pass`
  -/
  name : Name
  /--
  The actual pass function, operating on the `Decl`s.
  -/
  run : Array Decl → CompilerM (Array Decl)
goal: Lean.Compiler.LCNF.Phase

full_name: Lean.Compiler.LCNF.Pass.run
code: /--
A single compiler `Pass`, consisting of the actual pass function operating
on the `Decl`s as well as meta information.
-/
structure Pass where
  /--
  Which occurrence of the pass in the pipeline this is.
  Some passes, like simp, can occur multiple times in the pipeline.
  For most passes this value does not matter.
  -/
  occurrence : Nat := 0
  /--
  Which phase this `Pass` is supposed to run in
  -/
  phase : Phase
  /--
  Resulting phase.
  -/
  phaseOut : Phase := phase
  phaseInv : phaseOut ≥ phase := by simp_arith
  /--
  The name of the `Pass`
  -/
  name : Name
  /--
  The actual pass function, operating on the `Decl`s.
  -/
  run : Array Decl → CompilerM (Array Decl)
goal: Array Lean.Compiler.LCNF.Decl → Lean.Compiler.LCNF.CompilerM (Array Lean.Compiler.LCNF.Decl)

full_name: Lean.Compiler.LCNF.Pass.occurrence
code: /--
A single compiler `Pass`, consisting of the actual pass function operating
on the `Decl`s as well as meta information.
-/
structure Pass where
  /--
  Which occurrence of the pass in the pipeline this is.
  Some passes, like simp, can occur multiple times in the pipeline.
  For most passes this value does not matter.
  -/
  occurrence : Nat := 0
  /--
  Which phase this `Pass` is supposed to run in
  -/
  phase : Phase
  /--
  Resulting phase.
  -/
  phaseOut : Phase := phase
  phaseInv : phaseOut ≥ phase := by simp_arith
  /--
  The name of the `Pass`
  -/
  name : Name
  /--
  The actual pass function, operating on the `Decl`s.
  -/
  run : Array Decl → CompilerM (Array Decl)
goal: Nat

full_name: Lean.Compiler.LCNF.Pass.phase
code: /--
A single compiler `Pass`, consisting of the actual pass function operating
on the `Decl`s as well as meta information.
-/
structure Pass where
  /--
  Which occurrence of the pass in the pipeline this is.
  Some passes, like simp, can occur multiple times in the pipeline.
  For most passes this value does not matter.
  -/
  occurrence : Nat := 0
  /--
  Which phase this `Pass` is supposed to run in
  -/
  phase : Phase
  /--
  Resulting phase.
  -/
  phaseOut : Phase := phase
  phaseInv : phaseOut ≥ phase := by simp_arith
  /--
  The name of the `Pass`
  -/
  name : Name
  /--
  The actual pass function, operating on the `Decl`s.
  -/
  run : Array Decl → CompilerM (Array Decl)
goal: Lean.Compiler.LCNF.Phase

full_name: Lean.Compiler.LCNF.Pass.name
code: /--
A single compiler `Pass`, consisting of the actual pass function operating
on the `Decl`s as well as meta information.
-/
structure Pass where
  /--
  Which occurrence of the pass in the pipeline this is.
  Some passes, like simp, can occur multiple times in the pipeline.
  For most passes this value does not matter.
  -/
  occurrence : Nat := 0
  /--
  Which phase this `Pass` is supposed to run in
  -/
  phase : Phase
  /--
  Resulting phase.
  -/
  phaseOut : Phase := phase
  phaseInv : phaseOut ≥ phase := by simp_arith
  /--
  The name of the `Pass`
  -/
  name : Name
  /--
  The actual pass function, operating on the `Decl`s.
  -/
  run : Array Decl → CompilerM (Array Decl)
goal: Lean.Name

full_name: Lean.Compiler.LCNF.Pass.phaseInv
code: /--
A single compiler `Pass`, consisting of the actual pass function operating
on the `Decl`s as well as meta information.
-/
structure Pass where
  /--
  Which occurrence of the pass in the pipeline this is.
  Some passes, like simp, can occur multiple times in the pipeline.
  For most passes this value does not matter.
  -/
  occurrence : Nat := 0
  /--
  Which phase this `Pass` is supposed to run in
  -/
  phase : Phase
  /--
  Resulting phase.
  -/
  phaseOut : Phase := phase
  phaseInv : phaseOut ≥ phase := by simp_arith
  /--
  The name of the `Pass`
  -/
  name : Name
  /--
  The actual pass function, operating on the `Decl`s.
  -/
  run : Array Decl → CompilerM (Array Decl)
goal: self.phaseOut ≥ self.phase

full_name: Lean.Compiler.LCNF.instInhabitedPass
code: instance : Inhabited Pass 
goal: Inhabited Lean.Compiler.LCNF.Pass

full_name: Lean.Compiler.LCNF.PassInstaller.install
code: /--
Can be used to install, remove, replace etc. passes by tagging a declaration
of type `PassInstaller` with the `cpass` attribute.
-/
structure PassInstaller where
  /--
  When the installer is run this function will receive a list of all
  current `Pass`es and return a new one, this can modify the list (and
  the `Pass`es contained within) in any way it wants.
  -/
  install : Array Pass → CoreM (Array Pass)
  deriving Inhabited
goal: Array Lean.Compiler.LCNF.Pass → Lean.CoreM (Array Lean.Compiler.LCNF.Pass)

full_name: Lean.Compiler.LCNF.instInhabitedPassInstaller
code: /--
Can be used to install, remove, replace etc. passes by tagging a declaration
of type `PassInstaller` with the `cpass` attribute.
-/
structure PassInstaller where
  /--
  When the installer is run this function will receive a list of all
  current `Pass`es and return a new one, this can modify the list (and
  the `Pass`es contained within) in any way it wants.
  -/
  install : Array Pass → CoreM (Array Pass)
  deriving Inhabited
goal: Inhabited Lean.Compiler.LCNF.PassInstaller

full_name: Lean.Compiler.LCNF.PassInstaller
code: /--
Can be used to install, remove, replace etc. passes by tagging a declaration
of type `PassInstaller` with the `cpass` attribute.
-/
structure PassInstaller where
  /--
  When the installer is run this function will receive a list of all
  current `Pass`es and return a new one, this can modify the list (and
  the `Pass`es contained within) in any way it wants.
  -/
  install : Array Pass → CoreM (Array Pass)
  deriving Inhabited
goal: Type

full_name: Lean.Compiler.LCNF.instInhabitedPassManager
code: /--
The `PassManager` used to store all `Pass`es that will be run within
pipeline.
-/
structure PassManager where
  passes : Array Pass
  deriving Inhabited
goal: Inhabited Lean.Compiler.LCNF.PassManager

full_name: Lean.Compiler.LCNF.PassManager.passes
code: /--
The `PassManager` used to store all `Pass`es that will be run within
pipeline.
-/
structure PassManager where
  passes : Array Pass
  deriving Inhabited
goal: Array Lean.Compiler.LCNF.Pass

full_name: Lean.Compiler.LCNF.PassManager
code: /--
The `PassManager` used to store all `Pass`es that will be run within
pipeline.
-/
structure PassManager where
  passes : Array Pass
  deriving Inhabited
goal: Type

full_name: Lean.Compiler.LCNF.«instToStringPhase_.lake»
code: instance : ToString Phase 
goal: ToString Lean.Compiler.LCNF.Phase

full_name: Lean.Compiler.LCNF.Pass.mkPerDeclaration
code: def mkPerDeclaration (name : Name) (run : Decl → CompilerM Decl) (phase : Phase) (occurrence : Nat := 0) : Pass 
goal: Lean.Compiler.LCNF.Pass

full_name: Lean.Compiler.LCNF.PassManager.validate
code: def validate (manager : PassManager) : CoreM Unit 
goal: Lean.CoreM Unit

full_name: Lean.Compiler.LCNF.PassManager.findHighestOccurrence
code: def findHighestOccurrence (targetName : Name) (passes : Array Pass) : CoreM Nat 
goal: Lean.CoreM Nat

full_name: Lean.Compiler.LCNF.PassInstaller.installAtEnd
code: def installAtEnd (p : Pass) : PassInstaller 
goal: Lean.Compiler.LCNF.PassInstaller

full_name: Lean.Compiler.LCNF.PassInstaller.append
code: def append (passesNew : Array Pass) : PassInstaller 
goal: Lean.Compiler.LCNF.PassInstaller

full_name: Lean.Compiler.LCNF.PassInstaller.withEachOccurrence
code: def withEachOccurrence (targetName : Name) (f : Nat → PassInstaller) : PassInstaller 
goal: Lean.Compiler.LCNF.PassInstaller

full_name: Lean.Compiler.LCNF.PassInstaller.installAfter
code: def installAfter (targetName : Name) (p : Pass → Pass) (occurrence : Nat := 0) : PassInstaller 
goal: Lean.Compiler.LCNF.PassInstaller

full_name: Lean.Compiler.LCNF.PassInstaller.installAfterEach
code: def installAfterEach (targetName : Name) (p : Pass → Pass) : PassInstaller 
goal: Lean.Compiler.LCNF.PassInstaller

full_name: Lean.Compiler.LCNF.PassInstaller.installBefore
code: def installBefore (targetName : Name) (p : Pass → Pass) (occurrence : Nat := 0): PassInstaller 
goal: Lean.Compiler.LCNF.PassInstaller

full_name: Lean.Compiler.LCNF.PassInstaller.installBeforeEachOccurrence
code: def installBeforeEachOccurrence (targetName : Name) (p : Pass → Pass) : PassInstaller 
goal: Lean.Compiler.LCNF.PassInstaller

full_name: Lean.Compiler.LCNF.PassInstaller.replacePass
code: def replacePass (targetName : Name) (p : Pass → Pass) (occurrence : Nat := 0) : PassInstaller 
goal: Lean.Compiler.LCNF.PassInstaller

full_name: Lean.Compiler.LCNF.PassInstaller.replaceEachOccurrence
code: def replaceEachOccurrence (targetName : Name) (p : Pass → Pass) : PassInstaller 
goal: Lean.Compiler.LCNF.PassInstaller

full_name: Lean.Compiler.LCNF.PassInstaller.run
code: def run (manager : PassManager) (installer : PassInstaller) : CoreM PassManager 
goal: Lean.CoreM Lean.Compiler.LCNF.PassManager

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.PassManager.0.Lean.Compiler.LCNF.PassInstaller.getPassInstallerUnsafe
code: private unsafe def getPassInstallerUnsafe (declName : Name) : CoreM PassInstaller 
goal: Lean.CoreM Lean.Compiler.LCNF.PassInstaller

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Compiler.LCNF.PassManager.0.Lean.Compiler.LCNF.PassInstaller.getPassInstaller
code: @[implemented_by getPassInstallerUnsafe]
private opaque getPassInstaller (declName : Name) : CoreM PassInstaller
goal: Lean.CoreM Lean.Compiler.LCNF.PassInstaller

full_name: Lean.Compiler.LCNF.PassInstaller.runFromDecl
code: def runFromDecl (manager : PassManager) (declName : Name) : CoreM PassManager 
goal: Lean.CoreM Lean.Compiler.LCNF.PassManager