Add stack size troubleshooting
This commit is contained in:
parent
3cb0795bb6
commit
2ec4efde55
|
@ -52,7 +52,9 @@ def catalog (args: Catalog): Subroutine CatalogResult := do
|
|||
match state.environments.get? args.id with
|
||||
| .some env =>
|
||||
let names := env.constants.fold (init := []) (λ es name info =>
|
||||
if es.length > 3000 ∨ is_symbol_unsafe_or_internal name info then es else (toString name)::es)
|
||||
match to_filtered_symbol name info with
|
||||
| .some x => x::es
|
||||
| .none => es)
|
||||
return { theorems := names }
|
||||
| .none => throw s!"Invalid environment id {args.id}"
|
||||
|
||||
|
|
|
@ -15,4 +15,21 @@ def is_symbol_unsafe_or_internal (n: Lean.Name) (info: Lean.ConstantInfo): Bool
|
|||
| .num _ _ => true
|
||||
nameDeduce ∨ stemDeduce ∨ info.isUnsafe
|
||||
|
||||
def to_compact_symbol_name (n: Lean.Name) (info: Lean.ConstantInfo): String :=
|
||||
let pref := match info with
|
||||
| .axiomInfo _ => "axiom"
|
||||
| .defnInfo _ => "defn"
|
||||
| .thmInfo _ => "thm"
|
||||
| .opaqueInfo _ => "opaque"
|
||||
| .quotInfo _ => "quot"
|
||||
| .inductInfo _ => "induct"
|
||||
| .ctorInfo _ => "ctor"
|
||||
| .recInfo _ => "rec"
|
||||
s!"{pref}|{toString n}"
|
||||
|
||||
def to_filtered_symbol (n: Lean.Name) (info: Lean.ConstantInfo): Option String :=
|
||||
if is_symbol_unsafe_or_internal n info
|
||||
then Option.none
|
||||
else Option.some <| to_compact_symbol_name n info
|
||||
|
||||
end Pantograph
|
||||
|
|
Loading…
Reference in New Issue