summaryrefslogtreecommitdiff
path: root/test-suite/success/Case18.v
blob: 91c80e8891cba960d83c5e7d8a12b3e99a33d1a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(* Check or-patterns *)

Definition g x :=
  match x with ((((1 as x),_) | (_,x)), (_,(2 as y))|(y,_)) => (x,y) end.

Check (refl_equal _ : g ((1,2),(3,4)) = (1,3)).

Check (refl_equal _ : g ((1,4),(3,2)) = (1,2)).

Fixpoint max (n m:nat) {struct m} : nat :=
  match  n, m with
  | S n', S m' => S (max n' m')
  | 0, p | p, 0 => p
  end.