lean4-htt/tests/lean/run/ack.lean
Joachim Breitner 0e49576fe4
feat: guard_msgs to treat trace messages separate (#8267)
This PR makes `#guard_msgs` to treat `trace` messages separate from
`info`, `warning` and `error`. It also introduce the ability to say
`#guard_msgs (pass info`, like `(drop info)` so far, and also adds
`(check info)` as the explicit form of `(info)`, for completeness.

Fixes #8266
2025-05-09 05:44:34 +00:00

33 lines
1.1 KiB
Text

def ack : Nat → Nat → Nat
| 0, y => y+1
| x+1, 0 => ack x 1
| x+1, y+1 => ack x (ack (x+1) y)
termination_by a b => (a, b)
/--
trace: [diag] Diagnostics
[kernel] unfolded declarations (max: 147, num: 3):
[kernel] OfNat.ofNat ↦ 147
[kernel] Add.add ↦ 61
[kernel] HAdd.hAdd ↦ 61
use `set_option diagnostics.threshold <num>` to control threshold for reporting counters
---
trace: [simp] Diagnostics
[simp] used theorems (max: 59, num: 1):
[simp] ack.eq_3 ↦ 59
[simp] tried theorems (max: 59, num: 1):
[simp] ack.eq_3 ↦ 59, succeeded: 59
use `set_option diagnostics.threshold <num>` to control threshold for reporting counters
---
trace: [diag] Diagnostics
[kernel] unfolded declarations (max: 147, num: 3):
[kernel] OfNat.ofNat ↦ 147
[kernel] Add.add ↦ 61
[kernel] HAdd.hAdd ↦ 61
use `set_option diagnostics.threshold <num>` to control threshold for reporting counters
-/
#guard_msgs in
set_option diagnostics.threshold 50 in
set_option diagnostics true in
theorem ex : ack 3 2 = 29 :=
by simp [ack]