| 1 |
(* Some tests of the SearchPattern command *) |
| 2 |
|
| 3 |
(* Simple, random tests *) |
| 4 |
SearchPattern bool. |
| 5 |
SearchPattern nat. |
| 6 |
SearchPattern le. |
| 7 |
|
| 8 |
(* With some hypothesis *) |
| 9 |
SearchPattern (nat -> nat). |
| 10 |
SearchPattern (?n * ?m + ?n = ?n * S ?m). |
| 11 |
|
| 12 |
(* Non-linearity *) |
| 13 |
SearchPattern (_ ?X ?X). |
| 14 |
|
| 15 |
(* Non-linearity with hypothesis *) |
| 16 |
SearchPattern (forall (x:?A) (y:?B), _ ?A ?B). |
| 17 |
|
| 18 |
(* No delta-reduction *) |
| 19 |
SearchPattern (Exc _). |
| 20 |
|
| 21 |
Definition newdef := fun x:nat => x. |
| 22 |
|
| 23 |
Goal forall n:nat, n <> newdef n -> False. |
| 24 |
intros n h. |
| 25 |
SearchPattern ( _ <> newdef _). (* search hypothesis *) |
| 26 |
SearchPattern ( n <> newdef _). (* search hypothesis *) |
| 27 |
Abort. |
| 28 |
|
| 29 |
Goal forall n (P:nat -> Prop), P n -> ~P n -> False. |
| 30 |
intros n P h h'. |
| 31 |
SearchPattern (P _). (* search hypothesis also for patterns *) |
| 32 |
Search (~P n). (* search hypothesis also for patterns *) |
| 33 |
Search (P _) -"h'". (* search hypothesis also for patterns *) |
| 34 |
Search (P _) -not. (* search hypothesis also for patterns *) |
| 35 |
|
| 36 |
Abort. |