The `pp.maxSteps` option is a hard limit on the complexity of pretty printer output, which is necessary to prevent the LSP from crashing when there are accidental large terms. We're using the default value from the corresponding Lean 3 option. This PR also sets `pp.deepTerms` to `false` by default.
35 lines
840 B
Text
35 lines
840 B
Text
/-!
|
|
# Testing `pp.maxSteps`
|
|
-/
|
|
|
|
/-!
|
|
Without setting `pp.maxSteps`, the goal would crash the LSP when trying to create very large JSON.
|
|
-/
|
|
|
|
opaque myAuxiliaryFunction : Nat → Nat → Nat
|
|
opaque anotherHelper : Nat → Nat
|
|
|
|
def f (m : Nat) : Nat → Nat
|
|
| 0 => anotherHelper m
|
|
| n+1 => myAuxiliaryFunction (f (anotherHelper m) n) (f (myAuxiliaryFunction m (anotherHelper m)) n)
|
|
|
|
set_option pp.maxSteps 10
|
|
|
|
/--
|
|
error: unsolved goals
|
|
a b : Nat
|
|
⊢ myAuxiliaryFunction
|
|
(myAuxiliaryFunction
|
|
(myAuxiliaryFunction
|
|
(myAuxiliaryFunction
|
|
(myAuxiliaryFunction
|
|
(myAuxiliaryFunction (myAuxiliaryFunction (myAuxiliaryFunction (myAuxiliaryFunction ⋯ ⋯) ⋯) ⋯) ⋯) ⋯)
|
|
⋯)
|
|
⋯)
|
|
⋯)
|
|
⋯ =
|
|
⋯
|
|
-/
|
|
#guard_msgs in
|
|
example : f a 10 = b := by
|
|
simp [f]
|