| 1 |
(* Check or-patterns *) |
| 2 |
|
| 3 |
(* Non-interference with Numbers divisibility. *) |
| 4 |
Reserved Notation "( p | q )" (at level 0). |
| 5 |
|
| 6 |
Definition g x := |
| 7 |
match x with ((((1 as x),_) | (_,x)), ((_,(2 as y)) | (y,_))) => (x,y) end. |
| 8 |
|
| 9 |
Check (refl_equal _ : g ((1,2),(3,4)) = (1,3)). |
| 10 |
|
| 11 |
Check (refl_equal _ : g ((1,4),(3,2)) = (1,2)). |
| 12 |
|
| 13 |
Fixpoint max (n m:nat) {struct m} : nat := |
| 14 |
match n, m with |
| 15 |
| S n', S m' => S (max n' m') |
| 16 |
| 0, p | p, 0 => p |
| 17 |
end. |
| 18 |
|
| 19 |
(* Check bug #1477 *) |
| 20 |
|
| 21 |
Inductive I : Set := |
| 22 |
| A : nat -> nat -> I |
| 23 |
| B : nat -> nat -> I. |
| 24 |
|
| 25 |
Definition foo (x:I) : nat := |
| 26 |
match x with |
| 27 |
| A a b | B b a => S b |
| 28 |
end. |
| 29 |
|