(* *********************************************************************)
(*                                                                     *)
(*              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       *)
(*  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.     *)
(*                                                                     *)
(* *********************************************************************)
(** Constructions of ordered types, for use with the [FSet] functors for finite sets and the [FMap] functors for finite maps. *)
(** The ordered type of positive numbers *)
Module OrderedPositive <: OrderedType.
Definition t := positive.
Definition eq (x y: t) := x = y.
Definition lt := Plt.

(* Specifications: *)
Lemma eq_refl : forall x : t, eq x x.
Proof (@refl_equal t).
Lemma eq_sym : forall x y : t, eq x y -> eq y x.
Proof (@sym_equal t).
Lemma eq_trans : forall x y z : t, eq x y -> eq y z -> eq x z.
Proof (@trans_equal t).
Lemma lt_trans : forall x y z : t, lt x y -> lt y z -> lt x z.
Proof Plt_trans.
Lemma lt_not_eq : forall x y : t, lt x y -> ~ eq x y.
Proof Plt_ne.
Lemma compare : forall x y : t, Compare lt eq x y.
Lemma lt_not_eq : forall x y : t, lt x y -> ~ eq x y.
Lemma compare : forall x y : t, Compare lt eq x y.
Lemma lt_not_eq : forall x y : t, lt x y -> ~ eq x y.
Lemma compare : forall x y : t, Compare lt eq x y.
Lemma eq_sym : forall x y : t, eq x y -> eq y x.
Lemma eq_trans : forall x y z : t, eq x y -> eq y z -> eq x z.
Definition lt (x y: t) :=
A.lt (fst x) (fst y) \/
(A.eq (fst x) (fst y) /\ B.lt (snd x) (snd y)).
Lemma lt_trans : forall x y z : t, lt x y -> lt y z -> lt x z.
Lemma lt_not_eq : forall x y : t, lt x y -> ~ eq x y.
Lemma compare : forall x y : t, Compare lt eq x y.