aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tactics/equality.ml13
-rwxr-xr-xtheories/Init/Logic_Type.v10
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 *)