From 0919391f43729bf172ab00c8dec9438a0a9f59ab Mon Sep 17 00:00:00 2001 From: msozeau Date: Fri, 26 Oct 2012 01:29:33 +0000 Subject: Change Hint Resolve, Immediate to take a global reference as argument instead of a general constr: this is the most common case and does not loose generality (one can simply define constrs before Hint Resolving them). Benefits: - Natural semantics for typeclasses, not class resolution needed at Hint Resolve time, meaning less trouble for users as well. - Ability to [Hint Remove] any hint so declared. - Simplifies the implementation as well. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15930 85f007b7-540e-0410-9357-904b9bb8a0f7 --- theories/MSets/MSetAVL.v | 2 +- theories/MSets/MSetGenTree.v | 2 +- theories/MSets/MSetList.v | 15 +++++---------- theories/MSets/MSetRBT.v | 2 +- theories/MSets/MSetWeakList.v | 10 ++++++---- 5 files changed, 14 insertions(+), 17 deletions(-) (limited to 'theories/MSets') diff --git a/theories/MSets/MSetAVL.v b/theories/MSets/MSetAVL.v index 1e66e2b5b..2182504dd 100644 --- a/theories/MSets/MSetAVL.v +++ b/theories/MSets/MSetAVL.v @@ -306,7 +306,7 @@ Include MSetGenTree.Props X I. Local Hint Immediate MX.eq_sym. Local Hint Unfold In lt_tree gt_tree Ok. Local Hint Constructors InT bst. -Local Hint Resolve MX.eq_refl MX.eq_trans MX.lt_trans @ok. +Local Hint Resolve MX.eq_refl MX.eq_trans MX.lt_trans ok. Local Hint Resolve lt_leaf gt_leaf lt_tree_node gt_tree_node. Local Hint Resolve lt_tree_not_in lt_tree_trans gt_tree_not_in gt_tree_trans. Local Hint Resolve elements_spec2. diff --git a/theories/MSets/MSetGenTree.v b/theories/MSets/MSetGenTree.v index cacd91343..b7f3f96c9 100644 --- a/theories/MSets/MSetGenTree.v +++ b/theories/MSets/MSetGenTree.v @@ -341,7 +341,7 @@ Module Import MX := OrderedTypeFacts X. Scheme tree_ind := Induction for tree Sort Prop. Scheme bst_ind := Induction for bst Sort Prop. -Local Hint Resolve MX.eq_refl MX.eq_trans MX.lt_trans @ok. +Local Hint Resolve MX.eq_refl MX.eq_trans MX.lt_trans ok. Local Hint Immediate MX.eq_sym. Local Hint Unfold In lt_tree gt_tree. Local Hint Constructors InT bst. diff --git a/theories/MSets/MSetList.v b/theories/MSets/MSetList.v index d9b1fd9bb..b0e09b719 100644 --- a/theories/MSets/MSetList.v +++ b/theories/MSets/MSetList.v @@ -228,16 +228,14 @@ Module MakeRaw (X: OrderedType) <: RawSets X. Notation Inf := (lelistA X.lt). Notation In := (InA X.eq). - (* TODO: modify proofs in order to avoid these hints *) - Hint Resolve (@Equivalence_Reflexive _ _ X.eq_equiv). - Hint Immediate (@Equivalence_Symmetric _ _ X.eq_equiv). - Hint Resolve (@Equivalence_Transitive _ _ X.eq_equiv). + Existing Instance X.eq_equiv. + Hint Extern 20 => solve [order]. Definition IsOk s := Sort s. Class Ok (s:t) : Prop := ok : Sort s. - Hint Resolve @ok. + Hint Resolve ok. Hint Unfold Ok. Instance Sort_Ok s `(Hs : Sort s) : Ok s := { ok := Hs }. @@ -343,7 +341,6 @@ Module MakeRaw (X: OrderedType) <: RawSets X. induction s; simpl; intros. intuition. inv; auto. elim_compare x a; inv; rewrite !InA_cons, ?IHs; intuition. - left; order. Qed. Lemma remove_inf : @@ -402,8 +399,8 @@ Module MakeRaw (X: OrderedType) <: RawSets X. Global Instance union_ok s s' : forall `(Ok s, Ok s'), Ok (union s s'). Proof. repeat rewrite <- isok_iff; revert s s'. - induction2; constructors; try apply @ok; auto. - apply Inf_eq with x'; auto; apply union_inf; auto; apply Inf_eq with x; auto. + induction2; constructors; try apply @ok; auto. + apply Inf_eq with x'; auto; apply union_inf; auto; apply Inf_eq with x; auto; order. change (Inf x' (union (x :: l) l')); auto. Qed. @@ -412,7 +409,6 @@ Module MakeRaw (X: OrderedType) <: RawSets X. In x (union s s') <-> In x s \/ In x s'. Proof. induction2; try rewrite ?InA_cons, ?Hrec, ?Hrec'; intuition; inv; auto. - left; order. Qed. Lemma inter_inf : @@ -440,7 +436,6 @@ Module MakeRaw (X: OrderedType) <: RawSets X. Proof. induction2; try rewrite ?InA_cons, ?Hrec, ?Hrec'; intuition; inv; auto; try sort_inf_in; try order. - left; order. Qed. Lemma diff_inf : diff --git a/theories/MSets/MSetRBT.v b/theories/MSets/MSetRBT.v index b838495f9..92ad2fcfb 100644 --- a/theories/MSets/MSetRBT.v +++ b/theories/MSets/MSetRBT.v @@ -452,7 +452,7 @@ Local Notation Bk := (Node Black). Local Hint Immediate MX.eq_sym. Local Hint Unfold In lt_tree gt_tree Ok. Local Hint Constructors InT bst. -Local Hint Resolve MX.eq_refl MX.eq_trans MX.lt_trans @ok. +Local Hint Resolve MX.eq_refl MX.eq_trans MX.lt_trans ok. Local Hint Resolve lt_leaf gt_leaf lt_tree_node gt_tree_node. Local Hint Resolve lt_tree_not_in lt_tree_trans gt_tree_not_in gt_tree_trans. Local Hint Resolve elements_spec2. diff --git a/theories/MSets/MSetWeakList.v b/theories/MSets/MSetWeakList.v index fd4114cd4..7c8c5e6de 100644 --- a/theories/MSets/MSetWeakList.v +++ b/theories/MSets/MSetWeakList.v @@ -118,16 +118,18 @@ Module MakeRaw (X:DecidableType) <: WRawSets X. Notation In := (InA X.eq). (* TODO: modify proofs in order to avoid these hints *) - Hint Resolve (@Equivalence_Reflexive _ _ X.eq_equiv). - Hint Immediate (@Equivalence_Symmetric _ _ X.eq_equiv). - Hint Resolve (@Equivalence_Transitive _ _ X.eq_equiv). + Let eqr:= (@Equivalence_Reflexive _ _ X.eq_equiv). + Let eqsym:= (@Equivalence_Symmetric _ _ X.eq_equiv). + Let eqtrans:= (@Equivalence_Transitive _ _ X.eq_equiv). + Hint Resolve eqr eqtrans. + Hint Immediate eqsym. Definition IsOk := NoDup. Class Ok (s:t) : Prop := ok : NoDup s. Hint Unfold Ok. - Hint Resolve @ok. + Hint Resolve ok. Instance NoDup_Ok s (nd : NoDup s) : Ok s := { ok := nd }. -- cgit v1.2.3