| 1 |
(* Testing of various things about Print Ltac *) |
| 2 |
(* https://github.com/rocq-prover/rocq/issues/10971 *) |
| 3 |
Ltac t1 := time "my tactic" idtac. |
| 4 |
Print Ltac t1. |
| 5 |
Ltac t2 := let x := string:("my tactic") in idtac x. |
| 6 |
Print Ltac t2. |
| 7 |
Tactic Notation "idtacstr" string(str) := idtac str. |
| 8 |
Ltac t3 := idtacstr "my tactic". |
| 9 |
Print Ltac t3. |
| 10 |
(* https://github.com/rocq-prover/rocq/issues/9716 *) |
| 11 |
Ltac t4 x := match x with ?A => constr:((A, A)) end. |
| 12 |
Print Ltac t4. |
| 13 |
|
| 14 |
Abbreviation idnat := (@id nat). |
| 15 |
Abbreviation idn := id. |
| 16 |
Abbreviation idan := (@id). |
| 17 |
Fail Strategy transparent [idnat]. |
| 18 |
Strategy transparent [idn]. |
| 19 |
Strategy transparent [idan]. |
| 20 |
Ltac withstrategy l x := |
| 21 |
let idx := smart_global:(id) in |
| 22 |
let tl := strategy_level:(transparent) in |
| 23 |
with_strategy 1 [id id] ( |
| 24 |
with_strategy l [id id] ( |
| 25 |
with_strategy tl [id id] ( |
| 26 |
with_strategy 0 [id id] ( |
| 27 |
with_strategy transparent [id id] ( |
| 28 |
with_strategy opaque [id id] ( |
| 29 |
with_strategy expand [id id] ( |
| 30 |
with_strategy 0 [idx] ( |
| 31 |
with_strategy 0 [id x] ( |
| 32 |
with_strategy 0 [x id] ( |
| 33 |
with_strategy 0 [idn] ( |
| 34 |
with_strategy 0 [idn x] ( |
| 35 |
with_strategy 0 [idn id] ( |
| 36 |
with_strategy 0 [idn id x] ( |
| 37 |
with_strategy 0 [idan] ( |
| 38 |
with_strategy 0 [idan x] ( |
| 39 |
with_strategy 0 [idan id] ( |
| 40 |
with_strategy 0 [idan id x] ( |
| 41 |
idtac |
| 42 |
)))))))))))))))))). |
| 43 |
Print Ltac withstrategy. |
| 44 |
|
| 45 |
Module Type Empty. End Empty. |
| 46 |
Module E. End E. |
| 47 |
Module F (E : Empty). |
| 48 |
Definition id {T} := @id T. |
| 49 |
Abbreviation idnat := (@id nat). |
| 50 |
Abbreviation idn := id. |
| 51 |
Abbreviation idan := (@id). |
| 52 |
Fail Strategy transparent [idnat]. |
| 53 |
Strategy transparent [idn]. |
| 54 |
Strategy transparent [idan]. |
| 55 |
Ltac withstrategy l x := |
| 56 |
let idx := smart_global:(id) in |
| 57 |
let tl := strategy_level:(transparent) in |
| 58 |
with_strategy 1 [id id] ( |
| 59 |
with_strategy l [id id] ( |
| 60 |
with_strategy tl [id id] ( |
| 61 |
with_strategy 0 [id id] ( |
| 62 |
with_strategy transparent [id id] ( |
| 63 |
with_strategy opaque [id id] ( |
| 64 |
with_strategy expand [id id] ( |
| 65 |
with_strategy 0 [idx] ( |
| 66 |
with_strategy 0 [id x] ( |
| 67 |
with_strategy 0 [x id] ( |
| 68 |
with_strategy 0 [idn] ( |
| 69 |
with_strategy 0 [idn x] ( |
| 70 |
with_strategy 0 [idn id] ( |
| 71 |
with_strategy 0 [idn id x] ( |
| 72 |
with_strategy 0 [idan] ( |
| 73 |
with_strategy 0 [idan x] ( |
| 74 |
with_strategy 0 [idan id] ( |
| 75 |
with_strategy 0 [idan id x] ( |
| 76 |
idtac |
| 77 |
)))))))))))))))))). |
| 78 |
Print Ltac withstrategy. |
| 79 |
End F. |
| 80 |
|
| 81 |
Module FE := F E. |
| 82 |
Print Ltac FE.withstrategy. |