theory CSP_T_surj
imports CSP_T_traces
begin
declare disj_not1 [simp del]
consts
head_traces :: "'a domT => 'a set"
tail_traces :: "'a domT => 'a => 'a domT"
Proc_T_rec :: "nat => 'a domT => ('p,'a) proc"
Proc_T :: "'a domT => ('p,'a) proc"
defs
head_traces_def :
"head_traces T == {a. EX t. <Ev a> ^^^ t :t T}"
tail_traces_def :
"tail_traces T == (%a. {t. <Ev a> ^^^ t :t T}t)"
primrec
"Proc_T_rec 0 = (%T. DIV)"
"Proc_T_rec (Suc n)
= (%T. ((! a:(head_traces T) .. a -> Proc_T_rec n (tail_traces T a)) [+] DIV)
|~| (IF (<Tick> :t T) THEN SKIP ELSE DIV))"
defs
Proc_T_def :
"Proc_T T == !nat n .. Proc_T_rec n T"
consts
ALL_traces_Proc_T_rec :: "'a domT => 'a trace => nat => ('p => 'a domT) => bool"
defs
ALL_traces_Proc_T_rec_def :
"ALL_traces_Proc_T_rec T t n M == t :t traces (Proc_T_rec n T) M --> t :t T"
lemma tail_traces_domT:
"a : head_traces T ==> {t. <Ev a> ^^^ t :t T} : domT"
apply (simp add: domT_def)
apply (simp add: HC_T1_def)
apply (rule)
apply (simp add: head_traces_def)
apply (simp add: prefix_closed_def)
apply (intro allI impI)
apply (elim conjE exE)
apply (rule memT_prefix_closed)
apply (simp)
apply (simp)
done
lemma in_tail_traces:
"a : head_traces T ==> (s :t tail_traces T a) = (<Ev a> ^^^ s :t T)"
apply (simp add: tail_traces_def)
apply (simp add: tail_traces_domT CollectT_open_memT)
done
lemma head_tail_traces_only_if:
"<Ev a> ^^^ s :t T ==> a : head_traces T & s :t tail_traces T a"
apply (subgoal_tac "a : head_traces T", simp)
apply (simp add: in_tail_traces head_traces_def)
apply (auto simp add: head_traces_def)
done
lemma head_tail_traces_if:
"[| a : head_traces T ; s :t tail_traces T a |]
==> <Ev a> ^^^ s :t T"
by (simp add: in_tail_traces)
lemma head_tail_traces:
"<Ev a> ^^^ s :t T = (a : head_traces T & s :t tail_traces T a)"
apply (rule iffI)
apply (simp add: head_tail_traces_only_if)
apply (simp add: head_tail_traces_if)
done
lemma semT_Proc_T_only_if_lm:
"ALL n T t. t :t traces (Proc_T_rec n T) M --> t :t T"
apply (rule allI)
apply (induct_tac n)
apply (simp add: in_traces)
apply (fold ALL_traces_Proc_T_rec_def)
apply (simp (no_asm) add: ALL_traces_Proc_T_rec_def)
apply (simp add: in_traces)
apply (intro allI impI)
apply (elim conjE exE bexE disjE)
apply (simp)
apply (simp)
apply (unfold ALL_traces_Proc_T_rec_def)
apply (drule_tac x="tail_traces T a" in spec)
apply (drule_tac x="s" in spec)
apply (simp add: head_tail_traces)
done
lemma semT_Proc_T_only_if:
"EX n. t :t traces (Proc_T_rec n T) M ==> t :t T"
apply (erule exE)
apply (insert semT_Proc_T_only_if_lm[of M])
apply (drule_tac x="n" in spec)
apply (drule_tac x="T" in spec)
apply (drule_tac x="t" in spec)
by (simp)
lemma semT_Proc_T_if_lm:
"ALL t T. t :t T
--> t :t traces (Proc_T_rec (lengtht t) T) M"
apply (rule allI)
apply (induct_tac t rule: induct_trace)
apply (simp)
apply (intro allI impI)
apply (simp add: in_traces)
apply (intro allI impI)
apply (simp add: in_traces)
apply (drule_tac x="tail_traces T a" in spec)
apply (simp add: head_tail_traces)
done
lemma semT_Proc_T_if:
"t :t T
==> t :t traces (Proc_T_rec (lengtht t) T) M"
by (simp add: semT_Proc_T_if_lm)
lemma semT_Proc_T: "[[ Proc_T T ]]Tf M = T"
apply (simp add: Proc_T_def)
apply (rule order_antisym)
apply (rule)
apply (simp add: semT_def semTf_def)
apply (simp add: in_traces)
apply (erule disjE, simp)
apply (elim conjE exE)
apply (rule semT_Proc_T_only_if)
apply (rule_tac x="n" in exI)
apply (simp)
apply (rule)
apply (simp add: semT_def semTf_def)
apply (simp add: in_traces)
apply (rule disjI2)
apply (rule_tac x="lengtht t" in exI)
apply (simp add: semT_Proc_T_if)
done
lemma traces_Proc_T: "traces (Proc_T T) M = T"
by (simp add: semT_Proc_T[simplified semT_def semTf_def])
theorem EX_proc_domT: "ALL T. EX P::('p,'a) proc. [[P]]T = T"
apply (rule allI)
apply (rule_tac x="Proc_T T" in exI)
apply (simp add: semT_def semT_Proc_T)
done
theorem surj_domT: "surj (%P::('p,'a) proc. [[P]]T)"
apply (simp add: surj_def)
apply (rule allI)
apply (rule_tac x=" Proc_T y" in exI)
apply (simp add: semT_def semT_Proc_T)
done
declare disj_not1 [simp]
end