File: .lake/packages/lean4/src/lean/Lean/Meta/SizeOf.lean

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.mkLocalInstances
code: /-- Create `SizeOf` local instances for applicable parameters, and execute `k` using them. -/
private partial def mkLocalInstances (params : Array Expr) (k : Array Expr → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.mkLocalInstances.loop
code: /-- Create `SizeOf` local instances for applicable parameters, and execute `k` using them. -/
private partial def mkLocalInstances (params : Array Expr) (k : Array Expr → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.isInductiveHypothesis?
code: /--
  Return `some x` if `fvar` has type of the form `... -> motive ... fvar` where `motive` in `motiveFVars`.
  That is, `x` "produces" one of the recursor motives.
-/
private def isInductiveHypothesis? (motiveFVars : Array Expr) (fvar : Expr) : MetaM (Option Expr) 
goal: Lean.MetaM (Option Lean.Expr)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.isInductiveHypothesis
code: private def isInductiveHypothesis (motiveFVars : Array Expr) (fvar : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.isRecField?
code: /--
  Let `motiveFVars` be free variables for each motive in a kernel recursor, and `minorFVars` the free variables for a minor premise.
  Then, return `some idx` if `minorFVars[idx]` has a type of the form `... -> motive ... fvar` for some `motive` in `motiveFVars`.
-/
private def isRecField? (motiveFVars : Array Expr) (minorFVars : Array Expr) (fvar : Expr) : MetaM (Option Nat) 
goal: Lean.MetaM (Option Nat)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.mkSizeOfMotives
code: private partial def mkSizeOfMotives (motiveFVars : Array Expr) (k : Array Expr → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.mkSizeOfMotives.loop
code: private partial def mkSizeOfMotives (motiveFVars : Array Expr) (k : Array Expr → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.ignoreFieldType
code: private partial def ignoreFieldType (type : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.ignoreField
code: private def ignoreField (x : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.mkSizeOfRecFieldFormIH
code: /-- See `ignoreField`. We have support for functions of the form `Unit → ...` -/
private partial def mkSizeOfRecFieldFormIH (ih : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.mkSizeOfMinors
code: private partial def mkSizeOfMinors (motiveFVars : Array Expr) (minorFVars : Array Expr) (minorFVars' : Array Expr) (k : Array Expr → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.mkSizeOfMinors.loop
code: private partial def mkSizeOfMinors (motiveFVars : Array Expr) (minorFVars : Array Expr) (minorFVars' : Array Expr) (k : Array Expr → MetaM α) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Meta.mkSizeOfFn
code: /--
  Create a "sizeOf" function with name `declName` using the recursor `recName`.
-/
partial def mkSizeOfFn (recName : Name) (declName : Name): MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.mkSizeOfFns
code: /--
  Create `sizeOf` functions for all inductive datatypes in the mutual inductive declaration containing `typeName`
  The resulting array contains the generated functions names. The `NameMap` maps recursor names into the generated function names.
  There is a function for each element of the mutual inductive declaration, and for auxiliary recursors for nested inductive types.
-/
def mkSizeOfFns (typeName : Name) : MetaM (Array Name × NameMap Name) 
goal: Lean.MetaM (Array Lean.Name × Lean.NameMap Lean.Name)

full_name: Lean.Meta.mkSizeOfSpecLemmaName
code: def mkSizeOfSpecLemmaName (ctorName : Name) : Name 
goal: Lean.Name

full_name: Lean.Meta.mkSizeOfSpecLemmaInstance
code: def mkSizeOfSpecLemmaInstance (ctorApp : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.SizeOfSpecNested.Context
code: structure Context where
  indInfo    : InductiveVal
  sizeOfFns  : Array Name
  ctorName   : Name
  params     : Array Expr
  localInsts : Array Expr
  recMap     : NameMap Name
goal: Type

full_name: Lean.Meta.SizeOfSpecNested.Context.indInfo
code: structure Context where
  indInfo    : InductiveVal
  sizeOfFns  : Array Name
  ctorName   : Name
  params     : Array Expr
  localInsts : Array Expr
  recMap     : NameMap Name
goal: Lean.InductiveVal

full_name: Lean.Meta.SizeOfSpecNested.Context.recMap
code: structure Context where
  indInfo    : InductiveVal
  sizeOfFns  : Array Name
  ctorName   : Name
  params     : Array Expr
  localInsts : Array Expr
  recMap     : NameMap Name
goal: Lean.NameMap Lean.Name

full_name: Lean.Meta.SizeOfSpecNested.Context.localInsts
code: structure Context where
  indInfo    : InductiveVal
  sizeOfFns  : Array Name
  ctorName   : Name
  params     : Array Expr
  localInsts : Array Expr
  recMap     : NameMap Name
goal: Array Lean.Expr

full_name: Lean.Meta.SizeOfSpecNested.Context.ctorName
code: structure Context where
  indInfo    : InductiveVal
  sizeOfFns  : Array Name
  ctorName   : Name
  params     : Array Expr
  localInsts : Array Expr
  recMap     : NameMap Name
goal: Lean.Name

full_name: Lean.Meta.SizeOfSpecNested.Context.params
code: structure Context where
  indInfo    : InductiveVal
  sizeOfFns  : Array Name
  ctorName   : Name
  params     : Array Expr
  localInsts : Array Expr
  recMap     : NameMap Name
goal: Array Lean.Expr

full_name: Lean.Meta.SizeOfSpecNested.Context.sizeOfFns
code: structure Context where
  indInfo    : InductiveVal
  sizeOfFns  : Array Name
  ctorName   : Name
  params     : Array Expr
  localInsts : Array Expr
  recMap     : NameMap Name
goal: Array Lean.Name

full_name: Lean.Meta.SizeOfSpecNested.M
code: abbrev M 
goal: Type

full_name: Lean.Meta.SizeOfSpecNested.throwUnexpected
code: def throwUnexpected {α} (msg : MessageData) : M α 
goal: Lean.Meta.SizeOfSpecNested.M α

full_name: Lean.Meta.SizeOfSpecNested.throwFailed
code: def throwFailed {α} : M α 
goal: Lean.Meta.SizeOfSpecNested.M α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.SizeOfSpecNested.recToSizeOf
code: /-- Convert a recursor application into a `_sizeOf_<idx>` application. -/
private def recToSizeOf (e : Expr) : M Expr 
goal: Lean.Meta.SizeOfSpecNested.M Lean.Expr

full_name: Lean.Meta.SizeOfSpecNested.main.loop
code: partial def main (lhs rhs : Expr) : M Expr 
goal: Lean.Meta.SizeOfSpecNested.M Lean.Expr

full_name: Lean.Meta.SizeOfSpecNested.main.step
code: partial def main (lhs rhs : Expr) : M Expr 
goal: Lean.Meta.SizeOfSpecNested.M Lean.Expr

full_name: Lean.Meta.SizeOfSpecNested.main
code: partial def main (lhs rhs : Expr) : M Expr 
goal: Lean.Meta.SizeOfSpecNested.M Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.mkSizeOfSpecTheorem
code: private def mkSizeOfSpecTheorem (indInfo : InductiveVal) (sizeOfFns : Array Name) (recMap : NameMap Name) (ctorName : Name) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.SizeOf.0.Lean.Meta.mkSizeOfSpecTheorems
code: private def mkSizeOfSpecTheorems (indTypeNames : Array Name) (sizeOfFns : Array Name) (recMap : NameMap Name) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.genSizeOf
code: register_builtin_option genSizeOf : Bool := {
  defValue := true
  descr    := "generate `SizeOf` instance for inductive types and structures"
}
goal: Lean.Option Bool

full_name: Lean.Meta.initFn._@..lake.packages.lean4.src.lean.Lean.Meta.SizeOf._hyg.7394
code: register_builtin_option genSizeOf : Bool := {
  defValue := true
  descr    := "generate `SizeOf` instance for inductive types and structures"
}
goal: IO (Lean.Option Bool)

full_name: Lean.Meta.genSizeOfSpec
code: register_builtin_option genSizeOfSpec : Bool := {
  defValue := true
  descr    := "generate `SizeOf` specification theorems for automatically generated instances"
}
goal: Lean.Option Bool

full_name: Lean.Meta.initFn._@..lake.packages.lean4.src.lean.Lean.Meta.SizeOf._hyg.7430
code: register_builtin_option genSizeOfSpec : Bool := {
  defValue := true
  descr    := "generate `SizeOf` specification theorems for automatically generated instances"
}
goal: IO (Lean.Option Bool)

full_name: Lean.Meta.mkSizeOfInstances
code: def mkSizeOfInstances (typeName : Name) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Meta.initFn._@..lake.packages.lean4.src.lean.Lean.Meta.SizeOf._hyg.8182
code: builtin_initialize
  registerTraceClass `Meta.sizeOf
  registerTraceClass `Meta.sizeOf.minor
  registerTraceClass `Meta.sizeOf.minor.step
  registerTraceClass `Meta.sizeOf.aux
  registerTraceClass `Meta.sizeOf.loop
goal: IO Unit