(***********************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team    *)
(* <O___,, *        INRIA-Rocquencourt  &  LRI-CNRS-Orsay              *)
(*   \VV/  *************************************************************)
(*    //   *      This file is distributed under the terms of the      *)
(*         *       GNU Lesser General Public License Version 2.1       *)
(***********************************************************************)
(* Finite sets library. * Authors: Pierre Letouzey and Jean-Christophe Filliâtre * Institution: LRI, CNRS UMR 8623 - Université Paris Sud *              91405 Orsay, France *)
(* $Id$ *)
Set Implicit Arguments.
(** * An implementation of [FMapInterface.S] based on [IntMap] *)
(** Keys are of type [N]. The main functions are directly taken from [IntMap]. Since they have no exact counterpart in [IntMap], functions [fold], [map2] and [equal] are for now obtained by translation to sorted lists. *)
(** [N] is an ordered type, using not the usual order on numbers, but lexicographic ordering on bits (lower bit considered first). *)
Module NUsualOrderedType <: UsualOrderedType.
Definition t:=N.
Definition eq:=@eq N.
Definition eq_refl := @refl_equal t.
Definition eq_sym := @sym_eq t.
Definition eq_trans := @trans_eq t.
Definition lt p q:= Nless p q = true.
Definition lt_trans := Nless_trans.

Lemma lt_not_eq : forall x y : t, lt x y -> ~ eq x y.
Definition compare : forall x y : t, Compare lt eq x y.