From 590512e3f003f0bdc26d585e996dc065936c7d4a Mon Sep 17 00:00:00 2001 From: barras Date: Tue, 14 May 2002 14:10:23 +0000 Subject: ajout des theoremes eqT_rec_r et eqT_rect_r pour Rewrite git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@2680 85f007b7-540e-0410-9357-904b9bb8a0f7 --- tactics/equality.ml | 13 ++++++++----- theories/Init/Logic_Type.v | 10 ++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/tactics/equality.ml b/tactics/equality.ml index 044126a7e3..c3eb158465 100644 --- a/tactics/equality.ml +++ b/tactics/equality.ml @@ -137,12 +137,15 @@ let general_rewrite_in lft2rgt id (c,l) gl = let hdcncls = string_of_inductive hdcncl in let suffix = Indrec.elimination_suffix (elimination_sort_of_hyp id gl) in + let hdcncls = string_of_inductive hdcncl in + let suffix = + Indrec.elimination_suffix (elimination_sort_of_hyp id gl) in + let rwr_thm = + if lft2rgt then hdcncls^suffix else hdcncls^suffix^"_r" in let elim = - if lft2rgt then - pf_global gl (id_of_string (hdcncls^suffix)) - else - pf_global gl (id_of_string (hdcncls^suffix^"_r")) - in + try pf_global gl (id_of_string rwr_thm) + with Not_found -> + error ("Cannot find rewrite principle "^rwr_thm) in general_elim_in id (c,l) (elim,[]) gl let conditional_rewrite_in lft2rgt id tac (c,bl) = diff --git a/theories/Init/Logic_Type.v b/theories/Init/Logic_Type.v index af5b04ed0e..fa375ad107 100755 --- a/theories/Init/Logic_Type.v +++ b/theories/Init/Logic_Type.v @@ -94,17 +94,19 @@ End Equality_is_a_congruence. Hints Immediate sym_eqT sym_not_eqT : core v62. -(** This states the replacement of equals by equals in a proposition *) +(** This states the replacement of equals by equals *) -Definition eqT_ind_r : (A:Type)(x:A)(P:A->Prop)(P x)->(y:A)(eqT ? y x)->(P y). +Definition eqT_ind_r : (A:Type)(x:A)(P:A->Prop)(P x)->(y:A)y==x -> (P y). Intros A x P H y H0; Case sym_eqT with 1:=H0; Trivial. Defined. -(** not allowed because of dependencies: [[ Definition eqT_rec_r : (A:Type)(x:A)(P:A->Set)(P x)->(y:A)y==x -> (P y). Intros A x P H y H0; Case sym_eqT with 1:=H0; Trivial. Defined. -]] *) + +Definition eqT_rect_r : (A:Type)(x:A)(P:A->Type)(P x)->(y:A)y==x -> (P y). +Intros A x P H y H0; Case sym_eqT with 1:=H0; Trivial. +Defined. (** Some datatypes at the [Type] level *) -- cgit v1.2.3