diff options
| author | msozeau | 2008-07-22 14:35:51 +0000 |
|---|---|---|
| committer | msozeau | 2008-07-22 14:35:51 +0000 |
| commit | d619a834de7548649f53d59ec4fc9e892b33d24c (patch) | |
| tree | 10bb2d3e30caeccfada2e2d812a56cf416e8d89a | |
| parent | 2debc4ab0b171963afff40cc3183e4e92cca9a0e (diff) | |
A try at allowing matching on applications as a binary syntax node by default.
It breaks tauto as [?X _ _] matches much more terms. It is mostly fixed
by not destructing objects of record types. The new [intuition] was also
pulling an unneeded dependency in Field_theory which can be cleared
easily. Zis_gcd_bezout is also considered a conjunction now, which seems
correct(?).
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@11243 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | contrib/setoid_ring/Field_theory.v | 1 | ||||
| -rw-r--r-- | pretyping/matching.ml | 2 | ||||
| -rw-r--r-- | tactics/tauto.ml4 | 11 | ||||
| -rw-r--r-- | theories/QArith/Qreduction.v | 4 | ||||
| -rw-r--r-- | theories/ZArith/Znumtheory.v | 5 |
5 files changed, 17 insertions, 6 deletions
diff --git a/contrib/setoid_ring/Field_theory.v b/contrib/setoid_ring/Field_theory.v index 65a397acc6..b2e5cc4b7a 100644 --- a/contrib/setoid_ring/Field_theory.v +++ b/contrib/setoid_ring/Field_theory.v @@ -1619,6 +1619,7 @@ split. generalize (PCond_cons_inv_l _ _ _ H1); simpl; auto. apply H0. generalize (PCond_cons_inv_r _ _ _ H1); simpl; auto. +clear get_sign get_sign_spec. generalize Hp; case l0; simpl; intuition. Qed. diff --git a/pretyping/matching.ml b/pretyping/matching.ml index 9a3130605e..09db049e46 100644 --- a/pretyping/matching.ml +++ b/pretyping/matching.ml @@ -208,7 +208,7 @@ let matches_core convert allow_partial_app pat c = let names,terms = sorec [] ([],[]) pat c in (names,Sort.list (fun (a,_) (b,_) -> a<b) terms) -let extended_matches = matches_core None false +let extended_matches = matches_core None true let matches c p = snd (matches_core None false c p) diff --git a/tactics/tauto.ml4 b/tactics/tauto.ml4 index 4af760ed8c..ad6d022306 100644 --- a/tactics/tauto.ml4 +++ b/tactics/tauto.ml4 @@ -10,6 +10,7 @@ (*i $Id$ i*) +open Term open Hipattern open Names open Libnames @@ -36,10 +37,18 @@ let is_unit ist = <:tactic<idtac>> else <:tactic<fail>> + +let is_record t = + let (hdapp,args) = decompose_app t in + match (kind_of_term hdapp) with + | Ind ind -> + let (mib,mip) = Global.lookup_inductive ind in + mib.Declarations.mind_record + | _ -> false let is_conj ist = let ind = assoc_last ist in - if (is_conjunction ind) && (is_nodep_ind ind) then + if (is_conjunction ind) && (is_nodep_ind ind) && not (is_record ind) then <:tactic<idtac>> else <:tactic<fail>> diff --git a/theories/QArith/Qreduction.v b/theories/QArith/Qreduction.v index 6b16cfff4c..f289b6106d 100644 --- a/theories/QArith/Qreduction.v +++ b/theories/QArith/Qreduction.v @@ -49,7 +49,7 @@ Proof. Open Scope Z_scope. intuition. rewrite <- H in H0,H1; clear H. - rewrite H3; rewrite H4. + rewrite H5; rewrite H6. assert (0 <> g). intro; subst g; discriminate. @@ -57,7 +57,7 @@ Proof. apply Zmult_gt_0_lt_0_reg_r with g. omega. rewrite Zmult_comm. - rewrite <- H4; compute; auto. + rewrite <- H6; compute; auto. rewrite Z2P_correct; auto. ring. Close Scope Z_scope. diff --git a/theories/ZArith/Znumtheory.v b/theories/ZArith/Znumtheory.v index cbe65989ed..599d6791a4 100644 --- a/theories/ZArith/Znumtheory.v +++ b/theories/ZArith/Znumtheory.v @@ -521,8 +521,9 @@ Qed. Lemma Zis_gcd_mult : forall a b c d:Z, Zis_gcd a b d -> Zis_gcd (c * a) (c * b) (c * d). Proof. - intros a b c d; simple induction 1; constructor; intuition. - elim (Zis_gcd_bezout a b d H); intros. + intros a b c d; simple induction 1; constructor. + intuition. intuition. intros. intuition. + elim (Zis_gcd_bezout a b d H). intros. elim H3; intros. elim H4; intros. apply Zdivide_intro with (u * q + v * q0). |
