| 1 |
Inductive Num : Type := |
| 2 |
| pos :> Pos -> Num |
| 3 |
| neg :> Neg -> Num |
| 4 |
with Pos : Type := |
| 5 |
| a : Pos |
| 6 |
with Neg : Type := |
| 7 |
| b : Neg. |
| 8 |
|
| 9 |
Definition name (x : Num) : nat := |
| 10 |
match x with |
| 11 |
| a => 0 |
| 12 |
| b => 1 |
| 13 |
end. |
| 14 |
|
| 15 |
(* Note that the following should be accepted but is not. The reason |
| 16 |
it that it is assumed that the first line is irrefutable so that |
| 17 |
the split on a and b in the first row is dropped. *) |
| 18 |
|
| 19 |
Fail Check fun x y : Num => match x, y with |
| 20 |
| x, a => 0 |
| 21 |
| a, b => 1 |
| 22 |
| b, b => 2 |
| 23 |
end. |