(* *********************************************************************)
(*                                                                     *)
(*              The Compcert verified compiler                         *)
(*                                                                     *)
(*          Xavier Leroy, INRIA Paris-Rocquencourt                     *)
(*                                                                     *)
(*  Copyright Institut National de Recherche en Informatique et en     *)
(*  Automatique.  All rights reserved.  This file is distributed       *)
(*  under the terms of the GNU General Public License as published by  *)
(*  the Free Software Foundation, either version 2 of the License, or  *)
(*  (at your option) any later version.  This file is also distributed *)
(*  under the terms of the INRIA Non-Commercial License Agreement.     *)
(*                                                                     *)
(* *********************************************************************)
(** Multi-way branches (``switch'' statements) and their compilation to comparison trees. *)
Module IntIndexed <: INDEXED_TYPE.
Definition t := int.
Definition index (n: int) : positive :=
match Int.unsigned n with
| Z0 => xH
| Zpos p => xO p
| Zneg p => xI p  (**r never happens *)
end.

(* Specifications: *)
Lemma index_inj: forall n m, index n = index m -> n = m.
Definition eq := Int.eq_dec.