| 1 |
(** Test hint command locality w.r.t. modules *) |
| 2 |
|
| 3 |
Create HintDb foodb. |
| 4 |
Create HintDb bardb. |
| 5 |
Create HintDb quxdb. |
| 6 |
|
| 7 |
#[global] Hint Immediate O : foodb. |
| 8 |
#[global] Hint Immediate O : bardb. |
| 9 |
#[global] Hint Immediate O : quxdb. |
| 10 |
|
| 11 |
Module Test. |
| 12 |
|
| 13 |
#[global] Hint Cut [ _ ] : foodb. |
| 14 |
#[global] Hint Mode S ! : foodb. |
| 15 |
#[global] Hint Opaque id : foodb. |
| 16 |
#[global] Remove Hints O : foodb. |
| 17 |
|
| 18 |
#[local] Hint Cut [ _ ] : bardb. |
| 19 |
#[local] Hint Mode S ! : bardb. |
| 20 |
#[local] Hint Opaque id : bardb. |
| 21 |
#[local] Remove Hints O : bardb. |
| 22 |
|
| 23 |
#[export] Hint Cut [ _ ] : quxdb. |
| 24 |
#[export] Hint Mode S ! : quxdb. |
| 25 |
#[export] Hint Opaque id : quxdb. |
| 26 |
#[export] Remove Hints O : quxdb. |
| 27 |
|
| 28 |
(** All three agree here *) |
| 29 |
|
| 30 |
Print HintDb foodb. |
| 31 |
Print HintDb bardb. |
| 32 |
Print HintDb quxdb. |
| 33 |
|
| 34 |
End Test. |
| 35 |
|
| 36 |
(** bardb and quxdb agree here *) |
| 37 |
|
| 38 |
Print HintDb foodb. |
| 39 |
Print HintDb bardb. |
| 40 |
Print HintDb quxdb. |
| 41 |
|
| 42 |
Import Test. |
| 43 |
|
| 44 |
(** foodb and quxdb agree here *) |
| 45 |
|
| 46 |
Print HintDb foodb. |
| 47 |
Print HintDb bardb. |
| 48 |
Print HintDb quxdb. |
| 49 |
|
| 50 |
(** Test hint command locality w.r.t. sections *) |
| 51 |
|
| 52 |
Create HintDb secdb. |
| 53 |
|
| 54 |
#[global] Hint Immediate O : secdb. |
| 55 |
|
| 56 |
Section Sec. |
| 57 |
|
| 58 |
#[global] Hint Cut [ _ ] : secdb. |
| 59 |
#[global] Hint Mode S ! : secdb. |
| 60 |
#[global] Hint Opaque id : secdb. |
| 61 |
Fail #[global] Remove Hints O : secdb. |
| 62 |
|
| 63 |
#[local] Hint Cut [ _ ] : secdb. |
| 64 |
#[local] Hint Mode S ! : secdb. |
| 65 |
#[local] Hint Opaque id : secdb. |
| 66 |
#[local] Remove Hints O : secdb. |
| 67 |
|
| 68 |
Print HintDb secdb. |
| 69 |
|
| 70 |
End Sec. |
| 71 |
|
| 72 |
Print HintDb secdb. |
| 73 |
|
| 74 |
(** Variant of the above test |
| 75 |
- modes are correctly generalized at section closure |
| 76 |
- non-local section-specific hints trigger a warning |
| 77 |
*) |
| 78 |
|
| 79 |
Create HintDb seclocaldb. |
| 80 |
|
| 81 |
Set Warnings "non-local-section-hint". |
| 82 |
|
| 83 |
Section SecLocal. |
| 84 |
|
| 85 |
Variable A : Type. |
| 86 |
|
| 87 |
Definition refl (n : A) : n = n := eq_refl. |
| 88 |
|
| 89 |
Variable prf : forall n : nat, n = 0. |
| 90 |
|
| 91 |
#[export] Hint Mode refl ! : seclocaldb. |
| 92 |
#[export] Hint Mode prf ! : seclocaldb. |
| 93 |
|
| 94 |
#[export] Hint Cut [ prf ] : seclocaldb. |
| 95 |
|
| 96 |
#[export] Hint Variables Transparent : seclocaldb. |
| 97 |
#[export] Hint Constants Transparent : seclocaldb. |
| 98 |
#[export] Hint Opaque prf : seclocaldb. |
| 99 |
|
| 100 |
End SecLocal. |
| 101 |
|
| 102 |
Print HintDb seclocaldb. |