| 1 |
Axioms A B C D : Type. |
| 2 |
Axiom a : A. |
| 3 |
Module M. |
| 4 |
Axiom AB : A -> B. |
| 5 |
Coercion AB : A >-> B. |
| 6 |
|
| 7 |
Module Inner. |
| 8 |
Axiom BC : B -> C. |
| 9 |
Coercion BC : B >-> C. |
| 10 |
End Inner. |
| 11 |
Export Inner. |
| 12 |
|
| 13 |
Module Alt. |
| 14 |
Axiom BD : B -> D. |
| 15 |
Coercion BD : B >-> D. |
| 16 |
End Alt. |
| 17 |
|
| 18 |
Notation "x <<< y" := (x + y) (at level 22). |
| 19 |
|
| 20 |
Reserved Notation "@@". |
| 21 |
|
| 22 |
Tactic Notation "@@" := idtac. |
| 23 |
End M. |
| 24 |
|
| 25 |
Module N. |
| 26 |
Notation "x <<< y" := (x - y) (at level 23). |
| 27 |
End N. |
| 28 |
|
| 29 |
Fail Import(coercions) M(AB). |
| 30 |
|
| 31 |
Module Test1. |
| 32 |
Import(coercions) M. |
| 33 |
Check a : B. |
| 34 |
Check a : C. |
| 35 |
Fail Check a : D. |
| 36 |
|
| 37 |
(* names not imported *) |
| 38 |
Fail Import Alt. |
| 39 |
Fail Check AB. |
| 40 |
Check M.AB. |
| 41 |
|
| 42 |
Import M.Alt. |
| 43 |
Check a : D. |
| 44 |
|
| 45 |
Import N. (* notations didn't get imported *) |
| 46 |
End Test1. |
| 47 |
|
| 48 |
Module Test2. |
| 49 |
Import -(coercions) M. |
| 50 |
Fail Check a : B. |
| 51 |
Check AB. |
| 52 |
Fail Check AB a : C. |
| 53 |
|
| 54 |
Fail Import N. |
| 55 |
|
| 56 |
Check Inner.BC. |
| 57 |
Import Inner. |
| 58 |
Check AB a : C. |
| 59 |
Fail Check a : C. |
| 60 |
End Test2. |
| 61 |
|
| 62 |
Module TestExport. |
| 63 |
Import M(AB). |
| 64 |
Module Import(notations) X. |
| 65 |
Module Y. |
| 66 |
Definition bla := 0. |
| 67 |
Coercion AB : A >-> B. |
| 68 |
End Y. |
| 69 |
Export(coercions) Y. |
| 70 |
End X. |
| 71 |
|
| 72 |
Fail Check a : B. |
| 73 |
|
| 74 |
Import X. |
| 75 |
Check a : B. |
| 76 |
Fail Check bla. |
| 77 |
Check Y.bla. |
| 78 |
End TestExport. |
| 79 |
|
| 80 |
Module Notas. |
| 81 |
Import -(ltac.notations,notations) M. |
| 82 |
|
| 83 |
Import N. |
| 84 |
|
| 85 |
Check eq_refl : 1 <<< 1 = 0. |
| 86 |
|
| 87 |
Module X. |
| 88 |
Tactic Notation "@@" := fail. |
| 89 |
Lemma foo : False. |
| 90 |
Proof. Fail @@. Abort. |
| 91 |
End X. |
| 92 |
|
| 93 |
Import (ltac.notations) M. |
| 94 |
|
| 95 |
Lemma foo : False. |
| 96 |
Proof. @@. Abort. |
| 97 |
End Notas. |