fixrec shows unsolved subgoals when proofs of rewrites fail
authorhuffman
Sat, 18 Jun 2005 00:38:18 +0200
changeset 16463 342d74ca8815
parent 16462 8ebc8f530ab4
child 16464 db2711d07cd8
fixrec shows unsolved subgoals when proofs of rewrites fail
src/HOLCF/Fixrec.thy
src/HOLCF/fixrec_package.ML
--- a/src/HOLCF/Fixrec.thy	Sat Jun 18 00:33:27 2005 +0200
+++ b/src/HOLCF/Fixrec.thy	Sat Jun 18 00:38:18 2005 +0200
@@ -179,10 +179,16 @@
 lemma cpair_eqD2: "<x,y> = <x',y'> \<Longrightarrow> y = y'"
 by simp
 
+text {* lemma for proving rewrite rules *}
+
+lemma ssubst_lhs: "\<lbrakk>t = s; P s = Q\<rbrakk> \<Longrightarrow> P t = Q"
+by simp
+
 ML {*
 val cpair_equalI = thm "cpair_equalI";
 val cpair_eqD1 = thm "cpair_eqD1";
 val cpair_eqD2 = thm "cpair_eqD2";
+val ssubst_lhs = thm "ssubst_lhs";
 *}
 
 subsection {* Intitializing the fixrec package *}
--- a/src/HOLCF/fixrec_package.ML	Sat Jun 18 00:33:27 2005 +0200
+++ b/src/HOLCF/fixrec_package.ML	Sat Jun 18 00:38:18 2005 +0200
@@ -210,8 +210,7 @@
     val ss = simpset_of thy;
     val ct = cterm_of thy t;
     val thm = prove_goalw_cterm [] ct
-      (fn _ => [SOLVE(stac unfold_thm 1 THEN simp_tac ss 1)])
-        handle _ => sys_error (string_of_cterm ct^" :: proof failed on this equation.");
+      (fn _ => [rtac (unfold_thm RS ssubst_lhs) 1, simp_tac ss 1]);
   in thm end;
 
 (* this proves that each equation is a theorem *)