From 7002b3daca6da29eadf80019847630b8583c3daf Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Sun, 3 Aug 2014 20:02:49 +0200 Subject: Move to a representation of universe polymorphic constants using indices for variables. Simplifies instantiation of constants/inductives, requiring less allocation and Map.find's. Abstraction by variables is handled mostly inside the kernel but could be moved outside. --- theories/Classes/CMorphisms.v | 9 ++++----- theories/Classes/CRelationClasses.v | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'theories/Classes') diff --git a/theories/Classes/CMorphisms.v b/theories/Classes/CMorphisms.v index d36833c71..a644654bc 100644 --- a/theories/Classes/CMorphisms.v +++ b/theories/Classes/CMorphisms.v @@ -73,7 +73,6 @@ Section Proper. Definition respectful (R : crelation A) (R' : crelation B) : crelation (A -> B) := Eval compute in @respectful_hetero A A (fun _ => B) (fun _ => B) R (fun _ _ => R'). - End Proper. (** We favor the use of Leibniz equality or a declared reflexive crelation @@ -396,14 +395,14 @@ Section GenericInstances. Reflexive (@Logic.eq A ==> R'). Proof. simpl_crelation. Qed. - (** [respectful] is a morphism for crelation equivalence. *) - + (** [respectful] is a morphism for crelation equivalence . *) + Set Printing All. Set Printing Universes. Global Instance respectful_morphism : Proper (relation_equivalence ++> relation_equivalence ++> relation_equivalence) (@respectful A B). Proof. - intros R R' HRR' S S' HSS' f g. - unfold respectful, relation_equivalence in * ; simpl in *. + intros R R' HRR' S S' HSS' f g. + unfold respectful , relation_equivalence in *; simpl in *. split ; intros H x y Hxy. apply (fst (HSS' _ _)). apply H. now apply (snd (HRR' _ _)). apply (snd (HSS' _ _)). apply H. now apply (fst (HRR' _ _)). diff --git a/theories/Classes/CRelationClasses.v b/theories/Classes/CRelationClasses.v index ed43a5e52..6899d2e52 100644 --- a/theories/Classes/CRelationClasses.v +++ b/theories/Classes/CRelationClasses.v @@ -66,7 +66,7 @@ Section Defs. (** Various combinations of reflexivity, symmetry and transitivity. *) (** A [PreOrder] is both Reflexive and Transitive. *) - + Class PreOrder (R : crelation A) := { PreOrder_Reflexive :> Reflexive R | 2 ; PreOrder_Transitive :> Transitive R | 2 }. @@ -270,8 +270,7 @@ Instance iff_Transitive : Transitive iff := iff_trans. (** Logical equivalence [iff] is an equivalence crelation. *) -Program Instance iff_equivalence : Equivalence iff. - +Program Instance iff_equivalence : Equivalence iff. Program Instance arrow_Reflexive : Reflexive arrow. Program Instance arrow_Transitive : Transitive arrow. -- cgit v1.2.3