Theory Prefixes_Constructive
section ‹Constructiveness of Prefixes›
theory Prefixes_Constructive
imports Process_Restriction_Space
begin
subsection ‹Equality›
lemma restriction_process⇩p⇩t⇩i⇩c⇩k_Mprefix :
‹□a ∈ A → P a ↓ n = (case n of 0 ⇒ ⊥ | Suc m ⇒ □a∈A → (P a ↓ m))› (is ‹?lhs = ?rhs›)
proof (cases n)
show ‹n = 0 ⟹ ?lhs = ?rhs› by simp
next
fix m assume ‹n = Suc m›
show ‹?lhs = ?rhs›
proof (rule Process_eq_optimizedI)
show ‹t ∈ 𝒟 ?lhs ⟹ t ∈ 𝒟 ?rhs› for t
by (auto simp add: ‹n = Suc m› Mprefix_projs D_restriction_process⇩p⇩t⇩i⇩c⇩k) blast
next
fix t assume ‹t ∈ 𝒟 ?rhs›
with D_imp_front_tickFree obtain a t'
where ‹a ∈ A› ‹t = ev a # t'› ‹ftF t'› ‹t' ∈ 𝒟 (P a ↓ m)›
by (auto simp add: ‹n = Suc m› D_Mprefix)
thus ‹t ∈ 𝒟 ?lhs›
by (simp add: ‹n = Suc m› D_restriction_process⇩p⇩t⇩i⇩c⇩k Mprefix_projs)
(metis append_Cons event⇩p⇩t⇩i⇩c⇩k.disc(1) length_Cons tickFree_Cons_iff)
next
show ‹(t, X) ∈ ℱ ?lhs ⟹ (t, X) ∈ ℱ ?rhs› for t X
by (auto simp add: ‹n = Suc m› restriction_process⇩p⇩t⇩i⇩c⇩k_projs Mprefix_projs)
next
show ‹(t, X) ∈ ℱ ?rhs ⟹ t ∉ 𝒟 ?rhs ⟹ (t, X) ∈ ℱ ?lhs› for t X
by (auto simp add: ‹n = Suc m› restriction_process⇩p⇩t⇩i⇩c⇩k_projs Mprefix_projs)
qed
qed
lemma restriction_process⇩p⇩t⇩i⇩c⇩k_Mndetprefix :
‹⊓a ∈ A → P a ↓ n = (case n of 0 ⇒ ⊥ | Suc m ⇒ ⊓a∈A → (P a ↓ m))› (is ‹?lhs = ?rhs›)
proof (cases n)
show ‹n = 0 ⟹ ?lhs = ?rhs› by simp
next
fix m assume ‹n = Suc m›
show ‹?lhs = ?rhs›
proof (rule Process_eq_optimizedI)
show ‹t ∈ 𝒟 ?lhs ⟹ t ∈ 𝒟 ?rhs› for t
by (auto simp add: ‹n = Suc m› Mndetprefix_projs D_restriction_process⇩p⇩t⇩i⇩c⇩k) blast
next
fix t assume ‹t ∈ 𝒟 ?rhs›
with D_imp_front_tickFree obtain a t'
where ‹a ∈ A› ‹t = ev a # t'› ‹ftF t'› ‹t' ∈ 𝒟 (P a ↓ m)›
by (auto simp add: ‹n = Suc m› D_Mndetprefix')
thus ‹t ∈ 𝒟 ?lhs›
by (simp add: ‹n = Suc m› D_restriction_process⇩p⇩t⇩i⇩c⇩k Mndetprefix_projs)
(metis append_Cons event⇩p⇩t⇩i⇩c⇩k.disc(1) length_Cons tickFree_Cons_iff)
next
show ‹(t, X) ∈ ℱ ?lhs ⟹ (t, X) ∈ ℱ ?rhs› for t X
by (auto simp add: ‹n = Suc m› restriction_process⇩p⇩t⇩i⇩c⇩k_projs
Mndetprefix_projs split: if_split_asm)
next
show ‹(t, X) ∈ ℱ ?rhs ⟹ t ∉ 𝒟 ?rhs ⟹ (t, X) ∈ ℱ ?lhs› for t X
by (auto simp add: ‹n = Suc m› restriction_process⇩p⇩t⇩i⇩c⇩k_projs
Mndetprefix_projs split: if_split_asm)
qed
qed
corollary restriction_process⇩p⇩t⇩i⇩c⇩k_write0 :
‹a → P ↓ n = (case n of 0 ⇒ ⊥ | Suc m ⇒ a → (P ↓ m))›
unfolding write0_def by (simp add: restriction_process⇩p⇩t⇩i⇩c⇩k_Mprefix)
corollary restriction_process⇩p⇩t⇩i⇩c⇩k_write :
‹c❙!a → P ↓ n = (case n of 0 ⇒ ⊥ | Suc m ⇒ c❙!a → (P ↓ m))›
unfolding write_def by (simp add: restriction_process⇩p⇩t⇩i⇩c⇩k_Mprefix)
corollary restriction_process⇩p⇩t⇩i⇩c⇩k_read :
‹c❙?a∈A → P a ↓ n = (case n of 0 ⇒ ⊥ | Suc m ⇒ c❙?a∈A → (P a ↓ m))›
unfolding read_def comp_def by (simp add: restriction_process⇩p⇩t⇩i⇩c⇩k_Mprefix)
corollary restriction_process⇩p⇩t⇩i⇩c⇩k_ndet_write :
‹c❙!❙!a∈A → P a ↓ n = (case n of 0 ⇒ ⊥ | Suc m ⇒ c❙!❙!a∈A → (P a ↓ m))›
unfolding ndet_write_def comp_def by (simp add: restriction_process⇩p⇩t⇩i⇩c⇩k_Mndetprefix)
subsection ‹Constructiveness›
lemma Mprefix_constructive : ‹constructive (λP. □a ∈ A → P a)›
by (auto intro: constructiveI
simp add: restriction_process⇩p⇩t⇩i⇩c⇩k_Mprefix restriction_fun_def)
lemma Mndetprefix_constructive : ‹constructive (λP. ⊓a ∈ A → P a)›
by (auto intro: constructiveI
simp add: restriction_process⇩p⇩t⇩i⇩c⇩k_Mndetprefix restriction_fun_def)
lemma write0_constructive : ‹constructive (λP. a → P)›
by (auto intro: constructiveI simp add: restriction_process⇩p⇩t⇩i⇩c⇩k_write0)
lemma write_constructive : ‹constructive (λP. c❙!a → P)›
by (auto intro: constructiveI simp add: restriction_process⇩p⇩t⇩i⇩c⇩k_write)
lemma read_constructive : ‹constructive (λP. c❙?a ∈ A → P a)›
by (auto intro: constructiveI
simp add: restriction_process⇩p⇩t⇩i⇩c⇩k_read restriction_fun_def)
lemma ndet_write_constructive : ‹constructive (λP. c❙!❙!a ∈ A → P a)›
by (auto intro: constructiveI
simp add: restriction_process⇩p⇩t⇩i⇩c⇩k_ndet_write restriction_fun_def)
end