--- a/src/HOL/BNF/BNF_GFP.thy Tue Nov 13 09:08:32 2012 +0100
+++ b/src/HOL/BNF/BNF_GFP.thy Tue Nov 13 12:06:43 2012 +0100
@@ -8,7 +8,7 @@
header {* Greatest Fixed Point Operation on Bounded Natural Functors *}
theory BNF_GFP
-imports BNF_FP Equiv_Relations_More "~~/src/HOL/Library/Prefix_Order"
+imports BNF_FP Equiv_Relations_More "~~/src/HOL/Library/Sublist"
keywords
"codata" :: thy_decl
begin
@@ -163,9 +163,9 @@
(*Extended Sublist*)
definition prefCl where
- "prefCl Kl = (\<forall> kl1 kl2. kl1 \<le> kl2 \<and> kl2 \<in> Kl \<longrightarrow> kl1 \<in> Kl)"
+ "prefCl Kl = (\<forall> kl1 kl2. prefixeq kl1 kl2 \<and> kl2 \<in> Kl \<longrightarrow> kl1 \<in> Kl)"
definition PrefCl where
- "PrefCl A n = (\<forall>kl kl'. kl \<in> A n \<and> kl' \<le> kl \<longrightarrow> (\<exists>m\<le>n. kl' \<in> A m))"
+ "PrefCl A n = (\<forall>kl kl'. kl \<in> A n \<and> prefixeq kl' kl \<longrightarrow> (\<exists>m\<le>n. kl' \<in> A m))"
lemma prefCl_UN:
"\<lbrakk>\<And>n. PrefCl A n\<rbrakk> \<Longrightarrow> prefCl (\<Union>n. A n)"
@@ -185,9 +185,9 @@
unfolding prefCl_def Shift_def
proof safe
fix kl1 kl2
- assume "\<forall>kl1 kl2. kl1 \<le> kl2 \<and> kl2 \<in> Kl \<longrightarrow> kl1 \<in> Kl"
- "kl1 \<le> kl2" "k # kl2 \<in> Kl"
- thus "k # kl1 \<in> Kl" using Cons_prefix_Cons[of k kl1 k kl2] by blast
+ assume "\<forall>kl1 kl2. prefixeq kl1 kl2 \<and> kl2 \<in> Kl \<longrightarrow> kl1 \<in> Kl"
+ "prefixeq kl1 kl2" "k # kl2 \<in> Kl"
+ thus "k # kl1 \<in> Kl" using Cons_prefixeq_Cons[of k kl1 k kl2] by blast
qed
lemma not_in_Shift: "kl \<notin> Shift Kl x \<Longrightarrow> x # kl \<notin> Kl"
@@ -196,7 +196,7 @@
lemma prefCl_Succ: "\<lbrakk>prefCl Kl; k # kl \<in> Kl\<rbrakk> \<Longrightarrow> k \<in> Succ Kl []"
unfolding Succ_def proof
assume "prefCl Kl" "k # kl \<in> Kl"
- moreover have "k # [] \<le> k # kl" by auto
+ moreover have "prefixeq (k # []) (k # kl)" by auto
ultimately have "k # [] \<in> Kl" unfolding prefCl_def by blast
thus "[] @ [k] \<in> Kl" by simp
qed
--- a/src/HOL/BNF/Tools/bnf_gfp.ML Tue Nov 13 09:08:32 2012 +0100
+++ b/src/HOL/BNF/Tools/bnf_gfp.ML Tue Nov 13 12:06:43 2012 +0100
@@ -1610,7 +1610,7 @@
val prefCl_Lev_thms =
let
fun mk_conjunct i z = HOLogic.mk_imp
- (HOLogic.mk_conj (HOLogic.mk_mem (kl, mk_Lev ss nat i $ z), mk_subset kl_copy kl),
+ (HOLogic.mk_conj (HOLogic.mk_mem (kl, mk_Lev ss nat i $ z), mk_prefixeq kl_copy kl),
HOLogic.mk_mem (kl_copy, mk_Lev ss (mk_size kl_copy) i $ z));
val goal = list_all_free (kl :: kl_copy :: zs)
(Library.foldr1 HOLogic.mk_conj (map2 mk_conjunct ks zs));
--- a/src/HOL/BNF/Tools/bnf_gfp_tactics.ML Tue Nov 13 09:08:32 2012 +0100
+++ b/src/HOL/BNF/Tools/bnf_gfp_tactics.ML Tue Nov 13 12:06:43 2012 +0100
@@ -658,7 +658,7 @@
REPEAT_DETERM o rtac allI,
CONJ_WRAP' (fn Lev_0 =>
EVERY' [rtac impI, etac conjE, dtac (Lev_0 RS equalityD1 RS set_mp),
- etac @{thm singletonE}, hyp_subst_tac, dtac @{thm prefix_Nil[THEN subst, of "%x. x"]},
+ etac @{thm singletonE}, hyp_subst_tac, dtac @{thm prefixeq_Nil[THEN subst, of "%x. x"]},
hyp_subst_tac, rtac @{thm set_mp[OF equalityD2[OF trans[OF arg_cong[OF list.size(3)]]]]},
rtac Lev_0, rtac @{thm singletonI}]) Lev_0s,
REPEAT_DETERM o rtac allI,
@@ -666,7 +666,7 @@
EVERY' [rtac impI, etac conjE, dtac (Lev_Suc RS equalityD1 RS set_mp),
CONJ_WRAP_GEN' (etac (Thm.permute_prems 1 1 UnE))
(fn i => EVERY' [REPEAT_DETERM o eresolve_tac [CollectE, exE, conjE], hyp_subst_tac,
- dtac @{thm prefix_Cons[THEN subst, of "%x. x"]}, etac disjE, hyp_subst_tac,
+ dtac @{thm prefixeq_Cons[THEN subst, of "%x. x"]}, etac disjE, hyp_subst_tac,
rtac @{thm set_mp[OF equalityD2[OF trans[OF arg_cong[OF list.size(3)]]]]},
rtac Lev_0, rtac @{thm singletonI},
REPEAT_DETERM o eresolve_tac [exE, conjE], hyp_subst_tac,
@@ -857,7 +857,7 @@
rtac conjI,
rtac @{thm prefCl_UN}, rtac ssubst, rtac @{thm PrefCl_def}, REPEAT_DETERM o rtac allI,
rtac impI, etac conjE, rtac exI, rtac conjI, rtac @{thm ord_le_eq_trans},
- etac @{thm prefix_length_le}, etac length_Lev, rtac prefCl_Lev, etac conjI, atac,
+ etac @{thm prefixeq_length_le}, etac length_Lev, rtac prefCl_Lev, etac conjI, atac,
rtac conjI,
rtac ballI, etac @{thm UN_E}, rtac conjI,
if n = 1 then K all_tac else rtac (mk_sumEN n),
--- a/src/HOL/BNF/Tools/bnf_gfp_util.ML Tue Nov 13 09:08:32 2012 +0100
+++ b/src/HOL/BNF/Tools/bnf_gfp_util.ML Tue Nov 13 12:06:43 2012 +0100
@@ -25,6 +25,7 @@
val mk_nat_rec: term -> term -> term
val mk_pickWP: term -> term -> term -> term -> term -> term
val mk_prefCl: term -> term
+ val mk_prefixeq: term -> term -> term
val mk_proj: term -> term
val mk_quotient: term -> term -> term
val mk_shift: term -> term -> term
@@ -93,6 +94,9 @@
fun mk_prefCl A =
Const (@{const_name prefCl}, fastype_of A --> HOLogic.boolT) $ A;
+fun mk_prefixeq xs ys =
+ Const (@{const_name prefixeq}, fastype_of xs --> fastype_of ys --> HOLogic.boolT) $ xs $ ys;
+
fun mk_clists r =
let val T = fastype_of r;
in Const (@{const_name clists}, T --> mk_relT (`I (HOLogic.listT (fst (dest_relT T))))) $ r end;