@@ -88,3 +88,68 @@ simproc [my_simp] reduceBoo (boo _) := fun e => do
88
88
example : f x + boo 2 = id (x + 2 ) + 12 := by
89
89
simp
90
90
simp [my_simp] -- Applies the simp and simproc sets
91
+
92
+
93
+ namespace TraceAdd
94
+
95
+ set_option trace.Meta.Tactic.simp.rewrite false
96
+
97
+ /-- info: trace_add attribute added to TraceAdd.foo -/
98
+ #guard_msgs in
99
+ @[trace_add] def foo := 1
100
+
101
+ /-- info: trace_add attribute added to TraceAdd.foo -/
102
+ #guard_msgs in
103
+ attribute [trace_add] foo
104
+
105
+ /-- info: trace_add attribute added to TraceAdd.structural -/
106
+ #guard_msgs in
107
+ @[trace_add] def structural : Nat → Nat
108
+ | 0 => 0
109
+ | n+1 => structural n+1
110
+ termination_by structural n => n
111
+
112
+ /-- info: trace_add attribute added to TraceAdd.wf -/
113
+ #guard_msgs in
114
+ @[trace_add] def wf : Nat → Nat
115
+ | 0 => 0
116
+ | n+1 => wf n+1
117
+ termination_by n => n
118
+
119
+ /--
120
+ info: trace_add attribute added to TraceAdd.mutual_structural_1
121
+ ---
122
+ info: trace_add attribute added to TraceAdd.mutual_structural_2
123
+ -/
124
+ #guard_msgs in
125
+ mutual
126
+ @[trace_add] def mutual_structural_1 : Nat → Nat
127
+ | 0 => 0
128
+ | n+1 => mutual_structural_2 n+1
129
+ termination_by structural n => n
130
+ @[trace_add] def mutual_structural_2 : Nat → Nat
131
+ | 0 => 0
132
+ | n+1 => mutual_structural_1 n+1
133
+ termination_by structural n => n
134
+ end
135
+
136
+ /--
137
+ info: trace_add attribute added to TraceAdd.mutual_wf_1._mutual
138
+ ---
139
+ info: trace_add attribute added to TraceAdd.mutual_wf_1
140
+ ---
141
+ info: trace_add attribute added to TraceAdd.mutual_wf_2
142
+ -/
143
+ #guard_msgs in
144
+ mutual
145
+ @[trace_add] def mutual_wf_1 : Nat → Nat
146
+ | 0 => 0
147
+ | n+1 => mutual_wf_2 n+1
148
+ termination_by n => n
149
+ @[trace_add] def mutual_wf_2 : Nat → Nat
150
+ | 0 => 0
151
+ | n+1 => mutual_wf_1 n+1
152
+ termination_by n => n
153
+ end
154
+
155
+ end TraceAdd
0 commit comments