File: with_strategy.v

package info (click to toggle)
coq 8.20.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 44,116 kB
  • sloc: ml: 234,160; sh: 4,301; python: 3,270; ansic: 2,644; makefile: 882; lisp: 172; javascript: 63; xml: 24; sed: 2
file content (577 lines) | stat: -rw-r--r-- 22,907 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
Notation aid := (@id) (only parsing).
Notation idn := id (only parsing).
Ltac unfold_id := unfold id.

Fixpoint fact (n : nat)
  := match n with
     | 0 => 1
     | S n => (S n) * fact n
     end.

Opaque id.
Goal id 0 = 0.
  with_strategy
    opaque [id]
    (with_strategy
       opaque [id id]
       (assert_fails unfold_id;
        with_strategy
          transparent [id]
          (assert_succeeds unfold_id;
           with_strategy
             opaque [id]
             (with_strategy
                0 [id]
                (assert_succeeds unfold_id;
                 with_strategy
                   1 [id]
                   (assert_succeeds unfold_id;
                    with_strategy
                    -1 [id]
                       (assert_succeeds unfold_id;
                        with_strategy
                          opaque [id]
                          (assert_fails unfold_id;
                           with_strategy
                             transparent [id]
                             (assert_succeeds unfold_id;
                              with_strategy
                                opaque [id]
                                (with_strategy
                                   expand [id]
                                   (assert_succeeds unfold_id;
                                    let l := strategy_level:(expand) in
                                    with_strategy
                                      l [id]
                                      (let idx := smart_global:(id) in
                                       cbv [idx];
                                       (* This should succeed, but doesn't, basically due to https://github.com/coq/coq/issues/11202 *)
                                       assert_fails
                                         (let idx := smart_global:(id) in
                                          with_strategy
                                            expand [idx]
                                            idtac);
                                       reflexivity)))))))))))).
Qed.
Goal id 0 = 0.
  with_strategy
    opaque [aid]
    (assert_fails unfold_id;
     with_strategy
       transparent [aid]
       (assert_succeeds unfold_id;
        with_strategy
          opaque [aid]
          (with_strategy
             0 [aid]
             (assert_succeeds unfold_id;
              with_strategy
                1 [aid]
                (assert_succeeds unfold_id;
                 with_strategy
                 -1 [aid]
                    (assert_succeeds unfold_id;
                     with_strategy
                       opaque [aid]
                       (assert_fails unfold_id;
                        with_strategy
                          transparent [aid]
                          (assert_succeeds unfold_id;
                           with_strategy
                             opaque [aid]
                             (with_strategy
                                expand [aid]
                                (assert_succeeds unfold_id;
                                 reflexivity)))))))))).
Qed.
Goal id 0 = 0.
  with_strategy
    opaque [idn]
    (assert_fails unfold_id;
     with_strategy
       transparent [idn]
       (assert_succeeds unfold_id;
        with_strategy
          opaque [idn]
          (with_strategy
             0 [idn]
             (assert_succeeds unfold_id;
              with_strategy
                1 [idn]
                (assert_succeeds unfold_id;
                 with_strategy
                 -1 [idn]
                    (assert_succeeds unfold_id;
                     with_strategy
                       opaque [idn]
                       (assert_fails unfold_id;
                        with_strategy
                          transparent [idn]
                          (assert_succeeds unfold_id;
                           with_strategy
                             opaque [idn]
                             (with_strategy
                                expand [idn]
                                (assert_succeeds unfold_id;
                                 reflexivity)))))))))).
Qed.

(* test that strategy tactic does not persist after the execution of the tactic *)
Opaque id.
Goal id 0 = 0.
  assert_fails unfold_id;
    (with_strategy transparent [id] assert_succeeds unfold_id);
    assert_fails unfold_id.
  assert_fails unfold_id.
  with_strategy transparent [id] assert_succeeds unfold_id.
  assert_fails unfold_id.
  reflexivity.
Qed.

(* test that the strategy tactic does persist through abstract *)
Opaque id.
Goal id 0 = 0.
  Time Timeout 5
       with_strategy
       expand [id]
       assert (id (fact 100) = fact 100) by abstract reflexivity.
  reflexivity.
Time Timeout 5 Defined.

(* test that it works even with [Qed] *)
Goal id 0 = 0.
Proof using Type.
  Time Timeout 5
       abstract
       (with_strategy
          expand [id]
          assert (id (fact 100) = fact 100) by abstract reflexivity;
       reflexivity).
Time Timeout 5 Qed.

(* test that the strategy is correctly reverted after closing the goal completely *)
Goal id 0 = 0.
  assert (id 0 = 0) by with_strategy expand [id] reflexivity.
  Fail unfold id.
  reflexivity.
Qed.

(* test that the strategy is correctly reverted after failure *)
Goal id 0 = 0.
  let id' := id in
  (try with_strategy expand [id] fail); assert_fails unfold id'.
  Fail unfold id.
  (* a more complicated test involving a success and then a failure after backtracking *)
  let id' := id in
  ((with_strategy expand [id] (unfold id' + fail)) + idtac);
    lazymatch goal with |- id 0 = 0 => idtac end;
    assert_fails unfold id'.
  Fail unfold id.
  reflexivity.
Qed.

(* test multi-success *)
Goal id (fact 100) = fact 100.
  Timeout 1
          (with_strategy -1 [id] (((idtac + (abstract reflexivity))); fail)).
  Undo.
  Timeout 1
          let id' := id in
          (with_strategy -1 [id] (((idtac + (unfold id'; reflexivity))); fail)).
  Undo.
  Timeout 1
          (with_strategy -1 [id] (idtac + (abstract reflexivity))); fail. (* should not time out *)
  Undo.
  with_strategy -1 [id] abstract reflexivity.
Defined.

(* check that module substitutions happen correctly *)
Module F.
  Definition id {T} := @id T.
  Opaque id.
  Ltac with_transparent_id tac := with_strategy transparent [id] tac.
End F.
Opaque F.id.

Goal F.id 0 = F.id 0.
  Fail unfold F.id.
  F.with_transparent_id ltac:(progress unfold F.id).
  Undo.
  F.with_transparent_id ltac:(let x := constr:(@F.id) in progress unfold x).
Abort.

Module Type Empty. End Empty.
Module E. End E.
Module F2F (E : Empty).
  Definition id {T} := @id T.
  Opaque id.
  Ltac with_transparent_id tac := with_strategy transparent [id] tac.
End F2F.
Module F2 := F2F E.
Opaque F2.id.

Goal F2.id 0 = F2.id 0.
  Fail unfold F2.id.
  F2.with_transparent_id ltac:(progress unfold F2.id).
  Undo.
  F2.with_transparent_id ltac:(let x := constr:(@F2.id) in progress unfold x).
Abort.

(* test the tactic notation entries *)
Tactic Notation "with_strategy0" strategy_level(l) "[" ne_smart_global_list(v) "]" tactic3(tac) := with_strategy l [ v ] tac.
Tactic Notation "with_strategy1" strategy_level_or_var(l) "[" ne_smart_global_list(v) "]" tactic3(tac) := with_strategy l [ v ] tac.
Tactic Notation "with_strategy2" strategy_level(l) "[" constr(v) "]" tactic3(tac) := with_strategy l [ v ] tac.
Tactic Notation "with_strategy3" strategy_level_or_var(l) "[" constr(v) "]" tactic3(tac) := with_strategy l [ v ] tac.

(* [with_strategy0] should work, but it doesn't, due to a combination of https://github.com/coq/coq/issues/11202 and https://github.com/coq/coq/issues/11209 *)
Opaque id.
Goal id 0 = 0.
  Fail (* should work, not Fail *) with_strategy0 opaque [id] idtac.
  Fail (* should work, not Fail *) with_strategy0 opaque [id id] idtac.
  assert_fails unfold_id.
  Fail (* should work, not Fail *) with_strategy0 transparent [id] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 opaque [id] idtac.
  Fail (* should work, not Fail *) with_strategy0 0 [id] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 1 [id] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 -1 [id] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 opaque [id] idtac.
  assert_fails unfold_id.
  Fail (* should work, not Fail *) with_strategy0 transparent [id] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 opaque [id] idtac.
  Fail (* should work, not Fail *) with_strategy0 expand [id] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  (* This should succeed, but doesn't, basically due to https://github.com/coq/coq/issues/11202 *)
  Fail let idx := smart_global:(id) in
       with_strategy0 expand [idx] idtac.
  reflexivity.
Qed.
Goal id 0 = 0.
  Fail (* should work, not Fail *) with_strategy0 opaque [aid] idtac.
  assert_fails unfold_id.
  Fail (* should work, not Fail *) with_strategy0 transparent [aid] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 opaque [aid] idtac.
  Fail (* should work, not Fail *) with_strategy0 0 [aid] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 1 [aid] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 -1 [aid] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 opaque [aid] idtac.
  assert_fails unfold_id.
  Fail (* should work, not Fail *) with_strategy0 transparent [aid] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 opaque [aid] idtac.
  Fail (* should work, not Fail *) with_strategy0 expand [aid] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  reflexivity.
Qed.
Goal id 0 = 0.
  Fail (* should work, not Fail *) with_strategy0 opaque [idn] idtac.
  assert_fails unfold_id.
  Fail (* should work, not Fail *) with_strategy0 transparent [idn] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 opaque [idn] idtac.
  Fail (* should work, not Fail *) with_strategy0 0 [idn] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 1 [idn] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 -1 [idn] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 opaque [idn] idtac.
  assert_fails unfold_id.
  Fail (* should work, not Fail *) with_strategy0 transparent [idn] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy0 opaque [idn] idtac.
  Fail (* should work, not Fail *) with_strategy0 expand [idn] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  reflexivity.
Qed.

(* [with_strategy1] should work, but it doesn't, due to a combination of https://github.com/coq/coq/issues/11202 and https://github.com/coq/coq/issues/11209 *)
Opaque id.
Goal id 0 = 0.
  Fail (* should work, not Fail *) with_strategy1 opaque [id] idtac.
  Fail (* should work, not Fail *) with_strategy1 opaque [id id] idtac.
  assert_fails unfold_id.
  Fail (* should work, not Fail *) with_strategy1 transparent [id] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 opaque [id] idtac.
  Fail (* should work, not Fail *) with_strategy1 0 [id] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 1 [id] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 -1 [id] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 opaque [id] idtac.
  assert_fails unfold_id.
  Fail (* should work, not Fail *) with_strategy1 transparent [id] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 opaque [id] idtac.
  Fail (* should work, not Fail *) with_strategy1 expand [id] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) let l := strategy_level:(expand) in
                                   with_strategy1 l [id] idtac.
  (* This should succeed, but doesn't, basically due to https://github idtac.com/coq/coq/issues/11202 *)
  Fail let idx := smart_global:(id) in
       with_strategy1 expand [idx] idtac.
  reflexivity.
Qed.
Goal id 0 = 0.
  Fail (* should work, not Fail *) with_strategy1 opaque [aid] idtac.
  assert_fails unfold_id.
  Fail (* should work, not Fail *) with_strategy1 transparent [aid] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 opaque [aid] idtac.
  Fail (* should work, not Fail *) with_strategy1 0 [aid] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 1 [aid] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 -1 [aid] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 opaque [aid] idtac.
  assert_fails unfold_id.
  Fail (* should work, not Fail *) with_strategy1 transparent [aid] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 opaque [aid] idtac.
  Fail (* should work, not Fail *) with_strategy1 expand [aid] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  reflexivity.
Qed.
Goal id 0 = 0.
  Fail (* should work, not Fail *) with_strategy1 opaque [idn] idtac.
  assert_fails unfold_id.
  Fail (* should work, not Fail *) with_strategy1 transparent [idn] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 opaque [idn] idtac.
  Fail (* should work, not Fail *) with_strategy1 0 [idn] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 1 [idn] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 -1 [idn] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 opaque [idn] idtac.
  assert_fails unfold_id.
  Fail (* should work, not Fail *) with_strategy1 transparent [idn] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  Fail (* should work, not Fail *) with_strategy1 opaque [idn] idtac.
  Fail (* should work, not Fail *) with_strategy1 expand [idn] idtac.
  Fail (* should work, not Fail *) assert_succeeds unfold_id idtac.
  reflexivity.
Qed.

Opaque id.
Goal id 0 = 0.
  with_strategy2
    opaque [id]
    (with_strategy2
       opaque [id]
       (assert_fails unfold_id;
        with_strategy2
          transparent [id]
          (assert_succeeds unfold_id;
           with_strategy2
             opaque [id]
             (with_strategy2
                0 [id]
                (assert_succeeds unfold_id;
                 with_strategy2
                   1 [id]
                   (assert_succeeds unfold_id;
                    with_strategy2
                    -1 [id]
                       (assert_succeeds unfold_id;
                        with_strategy2
                          opaque [id]
                          (assert_fails unfold_id;
                           with_strategy2
                             transparent [id]
                             (assert_succeeds unfold_id;
                              with_strategy2
                                opaque [id]
                                (with_strategy2
                                   expand [id]
                                   (assert_succeeds unfold_id))))))))))).
  (* This should succeed, but doesn't, basically due to https://github.com/coq/coq/issues/11202 *)
  Fail let idx := smart_global:(id) in
       with_strategy2 expand [idx] idtac.
  reflexivity.
Qed.
Goal id 0 = 0.
  with_strategy2
    opaque [aid]
    (with_strategy2
       opaque [aid]
       (assert_fails unfold_id;
        with_strategy2
          transparent [aid]
          (assert_succeeds unfold_id;
           with_strategy2
             opaque [aid]
             (with_strategy2
                0 [aid]
                (assert_succeeds unfold_id;
                 with_strategy2
                   1 [aid]
                   (assert_succeeds unfold_id;
                    with_strategy2
                    -1 [aid]
                       (assert_succeeds unfold_id;
                        with_strategy2
                          opaque [aid]
                          (assert_fails unfold_id;
                           with_strategy2
                             transparent [aid]
                             (assert_succeeds unfold_id;
                              with_strategy2
                                opaque [aid]
                                (with_strategy2
                                   expand [aid]
                                   (assert_succeeds unfold_id))))))))))).
  reflexivity.
Qed.
Goal id 0 = 0.
  with_strategy2
    opaque [idn]
    (with_strategy2
       opaque [idn]
       (assert_fails unfold_id;
        with_strategy2
          transparent [idn]
          (assert_succeeds unfold_id;
           with_strategy2
             opaque [idn]
             (with_strategy2
                0 [idn]
                (assert_succeeds unfold_id;
                 with_strategy2
                   1 [idn]
                   (assert_succeeds unfold_id;
                    with_strategy2
                    -1 [idn]
                       (assert_succeeds unfold_id;
                        with_strategy2
                          opaque [idn]
                          (assert_fails unfold_id;
                           with_strategy2
                             transparent [idn]
                             (assert_succeeds unfold_id;
                              with_strategy2
                                opaque [idn]
                                (with_strategy2
                                   expand [idn]
                                   (assert_succeeds unfold_id))))))))))).
  reflexivity.
Qed.

Opaque id.
Goal id 0 = 0.
  with_strategy3
    opaque [id]
    (with_strategy3
       opaque [id]
       (assert_fails unfold_id;
        with_strategy3
          transparent [id]
          (assert_succeeds unfold_id;
           with_strategy3
             opaque [id]
             (with_strategy3
                0 [id]
                (assert_succeeds unfold_id;
                 with_strategy3
                   1 [id]
                   (assert_succeeds unfold_id;
                    with_strategy3
                    -1 [id]
                       (assert_succeeds unfold_id;
                        with_strategy3
                          opaque [id]
                          (assert_fails unfold_id;
                           with_strategy3
                             transparent [id]
                             (assert_succeeds unfold_id;
                              with_strategy3
                                opaque [id]
                                (with_strategy3
                                   expand [id]
                                   (assert_succeeds unfold_id))))))))))).
  (* This should succeed, but doesn't, basically due to https://github.com/coq/coq/issues/11202 *)
  Fail let idx := smart_global:(id) in
       with_strategy3 expand [idx] idtac.
  reflexivity.
Qed.
Goal id 0 = 0.
  with_strategy3
    opaque [aid]
    (with_strategy3
       opaque [aid]
       (assert_fails unfold_id;
        with_strategy3
          transparent [aid]
          (assert_succeeds unfold_id;
           with_strategy3
             opaque [aid]
             (with_strategy3
                0 [aid]
                (assert_succeeds unfold_id;
                 with_strategy3
                   1 [aid]
                   (assert_succeeds unfold_id;
                    with_strategy3
                    -1 [aid]
                       (assert_succeeds unfold_id;
                        with_strategy3
                          opaque [aid]
                          (assert_fails unfold_id;
                           with_strategy3
                             transparent [aid]
                             (assert_succeeds unfold_id;
                              with_strategy3
                                opaque [aid]
                                (with_strategy3
                                   expand [aid]
                                   (assert_succeeds unfold_id))))))))))).
  reflexivity.
Qed.
Goal id 0 = 0.
  with_strategy3
    opaque [idn]
    (with_strategy3
       opaque [idn]
       (assert_fails unfold_id;
        with_strategy3
          transparent [idn]
          (assert_succeeds unfold_id;
           with_strategy3
             opaque [idn]
             (with_strategy3
                0 [idn]
                (assert_succeeds unfold_id;
                 with_strategy3
                   1 [idn]
                   (assert_succeeds unfold_id;
                    with_strategy3
                    -1 [idn]
                       (assert_succeeds unfold_id;
                        with_strategy3
                          opaque [idn]
                          (assert_fails unfold_id;
                           with_strategy3
                             transparent [idn]
                             (assert_succeeds unfold_id;
                              with_strategy3
                                opaque [idn]
                                (with_strategy3
                                   expand [idn]
                                   (assert_succeeds unfold_id))))))))))).
  reflexivity.
Qed.

(* Fake out coqchk to work around what is essentially COQBUG(https://github.com/coq/coq/issues/12200) *)
Reset Initial.