| /-! This file tests kernel diagnostics reporting, triggered using the expensive `ack` function. -/ | |
| 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) | |
| section async_true | |
| /-- | |
| trace: [simp] Diagnostics | |
| [simp] used theorems (max: 57, num: 1): | |
| [simp] ack.eq_3 ↦ 57 | |
| [simp] tried theorems (max: 57, num: 1): | |
| [simp] ack.eq_3 ↦ 57, succeeded: 57 | |
| use `set_option diagnostics.threshold <num>` to control threshold for reporting counters | |
| --- | |
| trace: [diag] Diagnostics | |
| [kernel] unfolded declarations (max: 88, num: 1): | |
| [kernel] OfNat.ofNat ↦ 88 | |
| 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] | |
| end async_true | |
| section async_false | |
| set_option Elab.async false | |
| /-- | |
| trace: [simp] Diagnostics | |
| [simp] used theorems (max: 57, num: 1): | |
| [simp] ack.eq_3 ↦ 57 | |
| [simp] tried theorems (max: 57, num: 1): | |
| [simp] ack.eq_3 ↦ 57, succeeded: 57 | |
| use `set_option diagnostics.threshold <num>` to control threshold for reporting counters | |
| --- | |
| trace: [diag] Diagnostics | |
| [kernel] unfolded declarations (max: 84, num: 1): | |
| [kernel] OfNat.ofNat ↦ 84 | |
| 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 ex2 : ack 3 2 = 29 := | |
| by simp [ack] | |
| end async_false | |
| -- Check that kernel diagnostics are also reported in examples | |
| /-- | |
| trace: [simp] Diagnostics | |
| [simp] used theorems (max: 57, num: 1): | |
| [simp] ack.eq_3 ↦ 57 | |
| [simp] tried theorems (max: 57, num: 1): | |
| [simp] ack.eq_3 ↦ 57, succeeded: 57 | |
| use `set_option diagnostics.threshold <num>` to control threshold for reporting counters | |
| --- | |
| trace: [diag] Diagnostics | |
| [kernel] unfolded declarations (max: 84, num: 1): | |
| [kernel] OfNat.ofNat ↦ 84 | |
| 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 | |
| example : ack 3 2 = 29 := | |
| by simp [ack] | |
| -- Also in nested lemma | |
| /-- | |
| trace: [simp] Diagnostics | |
| [simp] used theorems (max: 57, num: 1): | |
| [simp] ack.eq_3 ↦ 57 | |
| [simp] tried theorems (max: 57, num: 1): | |
| [simp] ack.eq_3 ↦ 57, succeeded: 57 | |
| use `set_option diagnostics.threshold <num>` to control threshold for reporting counters | |
| --- | |
| trace: [diag] Diagnostics | |
| [kernel] unfolded declarations (max: 84, num: 1): | |
| [kernel] OfNat.ofNat ↦ 84 | |
| 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 ex3 : ack 3 2 = 29 := | |
| by as_aux_lemma => simp [ack] |