diff options
author | msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2008-03-06 18:17:24 +0000 |
---|---|---|
committer | msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2008-03-06 18:17:24 +0000 |
commit | 53ed1ee05a7c3ceb3b09e2807381af4d961d642b (patch) | |
tree | 8d1d246dd1cfebf21472352aa6e5a8c61bfbca01 /theories/FSets | |
parent | 6ce9f50c6f516696236fa36e5ff190142496798f (diff) |
Plug the new setoid implemtation in, leaving the original one commented
out. The semantics of the old setoid are faithfully simulated by the new
tactic, hence no scripts involving rewrite are modified. However,
parametric morphism declarations need to be changed, but there are only a
few in the standard library, notably in FSets. The declaration and the
introduction of variables in the script need to be tweaked a bit,
otherwise the proofs remain unchanged.
Some fragile scripts not introducting their variable names explicitely
were broken. Requiring Setoid requires Program.Basics which sets stronger
implicit arguments on some constants, a few scripts benefit from that.
Ring/field have been ported but do not really use the new typeclass
architecture as well as they could. Performance should be mostly
unchanged, but will certainly improve in the near future. Size of the
vo's seems not to have changed at all.
It will certainly break some contribs using Setoid.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10631 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/FSets')
-rw-r--r-- | theories/FSets/FMapFacts.v | 52 | ||||
-rw-r--r-- | theories/FSets/FSetFacts.v | 8 | ||||
-rw-r--r-- | theories/FSets/FSetWeakList.v | 2 |
3 files changed, 32 insertions, 30 deletions
diff --git a/theories/FSets/FMapFacts.v b/theories/FSets/FMapFacts.v index 87111b1a7..78962fd1b 100644 --- a/theories/FSets/FMapFacts.v +++ b/theories/FSets/FMapFacts.v @@ -660,48 +660,50 @@ Add Relation key E.eq transitivity proved by E.eq_trans as KeySetoid. -Add Relation t Equal - reflexivity proved by Equal_refl - symmetry proved by Equal_sym - transitivity proved by Equal_trans +Implicit Arguments Equal [[elt]]. + +Add Relation (t elt) Equal + reflexivity proved by (@Equal_refl elt) + symmetry proved by (@Equal_sym elt) + transitivity proved by (@Equal_trans elt) as EqualSetoid. -Add Morphism In with signature E.eq ==> Equal ==> iff as In_m. +Add Morphism (@In elt) with signature E.eq ==> Equal ==> iff as In_m. Proof. -unfold Equal; intros elt k k' Hk m m' Hm. +unfold Equal; intros k k' Hk m m' Hm. rewrite (In_iff m Hk), in_find_iff, in_find_iff, Hm; intuition. Qed. -Add Morphism MapsTo - with signature E.eq ==> @Logic.eq ==> Equal ==> iff as MapsTo_m. +Add Morphism (@MapsTo elt) + with signature E.eq ==> Logic.eq ==> Equal ==> iff as MapsTo_m. Proof. -unfold Equal; intros elt k k' Hk e m m' Hm. +unfold Equal; intros k k' Hk e m m' Hm. rewrite (MapsTo_iff m e Hk), find_mapsto_iff, find_mapsto_iff, Hm; intuition. Qed. -Add Morphism Empty with signature Equal ==> iff as Empty_m. +Add Morphism (@Empty elt) with signature Equal ==> iff as Empty_m. Proof. -unfold Empty; intros elt m m' Hm; intuition. +unfold Empty; intros m m' Hm; intuition. rewrite <-Hm in H0; eauto. rewrite Hm in H0; eauto. Qed. -Add Morphism is_empty with signature Equal ==> @Logic.eq as is_empty_m. +Add Morphism (@is_empty elt) with signature Equal ==> Logic.eq as is_empty_m. Proof. -intros elt m m' Hm. +intros m m' Hm. rewrite eq_bool_alt, <-is_empty_iff, <-is_empty_iff, Hm; intuition. Qed. -Add Morphism mem with signature E.eq ==> Equal ==> @Logic.eq as mem_m. +Add Morphism (@mem elt) with signature E.eq ==> Equal ==> Logic.eq as mem_m. Proof. -intros elt k k' Hk m m' Hm. +intros k k' Hk m m' Hm. rewrite eq_bool_alt, <- mem_in_iff, <-mem_in_iff, Hk, Hm; intuition. Qed. -Add Morphism find with signature E.eq ==> Equal ==> @Logic.eq as find_m. +Add Morphism (@find elt) with signature E.eq ==> Equal ==> Logic.eq as find_m. Proof. -intros elt k k' Hk m m' Hm. +intros k k' Hk m m' Hm. generalize (find_mapsto_iff m k)(find_mapsto_iff m' k') (not_find_in_iff m k)(not_find_in_iff m' k'); do 2 destruct find; auto; intros. @@ -710,27 +712,27 @@ rewrite <- H1, Hk, Hm, H2; auto. symmetry; rewrite <- H2, <-Hk, <-Hm, H1; auto. Qed. -Add Morphism add with signature - E.eq ==> @Logic.eq ==> Equal ==> Equal as add_m. +Add Morphism (@add elt) with signature + E.eq ==> Logic.eq ==> Equal ==> Equal as add_m. Proof. -intros elt k k' Hk e m m' Hm y. +intros k k' Hk e m m' Hm y. rewrite add_o, add_o; do 2 destruct eq_dec; auto. elim n; rewrite <-Hk; auto. elim n; rewrite Hk; auto. Qed. -Add Morphism remove with signature +Add Morphism (@remove elt) with signature E.eq ==> Equal ==> Equal as remove_m. Proof. -intros elt k k' Hk m m' Hm y. +intros k k' Hk m m' Hm y. rewrite remove_o, remove_o; do 2 destruct eq_dec; auto. elim n; rewrite <-Hk; auto. elim n; rewrite Hk; auto. Qed. -Add Morphism map with signature @Logic.eq ==> Equal ==> Equal as map_m. +Add Morphism (@map elt elt') with signature Logic.eq ==> Equal ==> Equal as map_m. Proof. -intros elt elt' f m m' Hm y. +intros f m m' Hm y. rewrite map_o, map_o, Hm; auto. Qed. @@ -1102,7 +1104,7 @@ Module WProperties (E:DecidableType)(M:WSfun E). End Elt. - Add Morphism cardinal with signature Equal ==> @Logic.eq as cardinal_m. + Add Morphism (@cardinal elt) with signature Equal ==> Logic.eq as cardinal_m. Proof. intros; apply Equal_cardinal; auto. Qed. End WProperties. diff --git a/theories/FSets/FSetFacts.v b/theories/FSets/FSetFacts.v index 8ee74649e..b0c8ee008 100644 --- a/theories/FSets/FSetFacts.v +++ b/theories/FSets/FSetFacts.v @@ -339,7 +339,7 @@ exact (H1 (refl_equal true) _ Ha). Qed. Add Morphism Empty with signature Equal ==> iff as Empty_m. -Proof. +Proof. intros; do 2 rewrite is_empty_iff; rewrite H; intuition. Qed. @@ -429,13 +429,13 @@ Add Relation t Subset the two previous lemmas, in order to allow conversion of SubsetSetoid coming from separate Facts modules. See bug #1738. *) -Add Morphism In with signature E.eq ==> Subset ++> impl as In_s_m. +Instance In_s_m : Morphism (E.eq ==> Subset ++> impl) In | 1. Proof. -unfold Subset, impl; intros; eauto with set. + do 2 red ; intros. unfold Subset, impl; intros; eauto with set. Qed. Add Morphism Empty with signature Subset --> impl as Empty_s_m. -Proof. +Proof. unfold Subset, Empty, impl; firstorder. Qed. diff --git a/theories/FSets/FSetWeakList.v b/theories/FSets/FSetWeakList.v index 866c3f620..c2bba9283 100644 --- a/theories/FSets/FSetWeakList.v +++ b/theories/FSets/FSetWeakList.v @@ -125,7 +125,7 @@ Module Raw (X: DecidableType). Lemma In_eq : forall (s : t) (x y : elt), X.eq x y -> In x s -> In y s. Proof. - intros s x y; do 2 setoid_rewrite InA_alt; firstorder eauto. + intros s x y; setoid_rewrite InA_alt; firstorder eauto. Qed. Hint Immediate In_eq. |