definition
fcall:: "('s==>'s) ==> 'p ==> ('s ==> 's ==> 's)==>('s ==> 'v) ==> ('v==>('s,'p,'f) com) ==>('s,'p,'f)com"where "fcall init p return result c = call init p return (λs t. c (result t))"
definition
lem:: "'x ==> ('s,'p,'f)com ==>('s,'p,'f)com"where "lem x c = c"
primrec switch:: "('s ==> 'v) ==> ('v set × ('s,'p,'f) com) list ==> ('s,'p,'f) com" where "switch v [] = Skip" | "switch v (Vc#vs) = Cond {s. v s ∈ fst Vc} (snd Vc) (switch v vs)"
definition guaranteeStrip:: "'f ==> 's set ==> ('s,'p,'f) com ==> ('s,'p,'f) com" where"guaranteeStrip f g c = Guard f g c"
definition guaranteeStripPair:: "'f ==> 's set ==> ('f × 's set)" where"guaranteeStripPair f g = (f,g)"
definition
while:: "('f × 's set) list ==> 's bexp ==> ('s,'p,'f) com ==> ('s, 'p, 'f) com" where "while gs b c = guards gs (While b (Seq c (guards gs Skip)))"
definition
whileAnno:: "'s bexp ==> 's assn ==> ('s × 's) assn ==> ('s,'p,'f) com ==> ('s,'p,'f) com"where "whileAnno b I V c = While b c"
definition
whileAnnoG:: "('f × 's set) list ==> 's bexp ==> 's assn ==> ('s × 's) assn ==> ('s,'p,'f) com ==> ('s,'p,'f) com"where "whileAnnoG gs b I V c = while gs b c"
definition
whileAnnoFix:: "'s bexp ==> ('a ==> 's assn) ==> ('a ==> ('s × 's) assn) ==> ('a ==> ('s,'p,'f) com) ==> ('s,'p,'f) com"where "whileAnnoFix b I V c = While b (c undefined)"
definition
whileAnnoGFix:: "('f × 's set) list ==> 's bexp ==> ('a ==> 's assn) ==> ('a ==> ('s × 's) assn)==> ('a ==> ('s,'p,'f) com) ==> ('s,'p,'f) com"where "whileAnnoGFix gs b I V c = while gs b (c undefined)"
definition if_rel::"('s ==> bool) ==> ('s ==> 's) ==> ('s ==> 's) ==> ('s ==> 's)==> ('s × 's) set" where"if_rel b f g h = {(s,t). if b s then t = f s else t = g s ∨ t = h s}"
lemma fst_guaranteeStripPair: "fst (guaranteeStripPair f g) = f" by (simp add: guaranteeStripPair_def)
lemma snd_guaranteeStripPair: "snd (guaranteeStripPair f g) = g" by (simp add: guaranteeStripPair_def)
lemma call_call_exn: "call init p return result = call_exn init p return (λs t. s) result" by (simp add: call_def call_exn_def block_def)
lemma dynCall_dynCall_exn: "dynCall init p return result = dynCall_exn undefined UNIV init p return (λs t. s) result" by (simp add: dynCall_def dynCall_exn_def call_call_exn)
subsection‹Operations on Simpl-Syntax›
subsubsection‹Normalisation of Sequential Composition: ‹sequence›, ‹flatten› and‹normalize››
primrec flatten:: "('s,'p,'f) com ==> ('s,'p,'f) com list" where "flatten Skip = [Skip]" | "flatten (Basic f) = [Basic f]" | "flatten (Spec r) = [Spec r]" | "flatten (Seq c1 c2) = flatten c1 @ flatten c2" | "flatten (Cond b c1 c2) = [Cond b c1 c2]" | "flatten (While b c) = [While b c]" | "flatten (Call p) = [Call p]" | "flatten (DynCom c) = [DynCom c]" | "flatten (Guard f g c) = [Guard f g c]" | "flatten Throw = [Throw]" | "flatten (Catch c1 c2) = [Catch c1 c2]"
primrec sequence:: "(('s,'p,'f) com ==> ('s,'p,'f) com ==> ('s,'p,'f) com) ==> ('s,'p,'f) com list ==> ('s,'p,'f) com" where "sequence seq [] = Skip" | "sequence seq (c#cs) = (case cs of [] ==> c | _ ==> seq c (sequence seq cs))"
primrec normalize:: "('s,'p,'f) com ==> ('s,'p,'f) com" where "normalize Skip = Skip" | "normalize (Basic f) = Basic f" | "normalize (Spec r) = Spec r" | "normalize (Seq c1 c2) = sequence Seq ((flatten (normalize c1)) @ (flatten (normalize c2)))" | "normalize (Cond b c1 c2) = Cond b (normalize c1) (normalize c2)" | "normalize (While b c) = While b (normalize c)" | "normalize (Call p) = Call p" | "normalize (DynCom c) = DynCom (λs. (normalize (c s)))" | "normalize (Guard f g c) = Guard f g (normalize c)" | "normalize Throw = Throw" | "normalize (Catch c1 c2) = Catch (normalize c1) (normalize c2)"
lemma flatten_nonEmpty: "flatten c ≠ []" by (induct c) simp_all
lemma flatten_call [simp]: "flatten (call init p return result) = [call init p return result]" by (simp add: call_def)
lemma flatten_dynCall [simp]: "flatten (dynCall init p return result) = [dynCall init p return result]" by (simp add: dynCall_def)
lemma flatten_call_exn [simp]: "flatten (call_exn init p return result_exn result) = [call_exn init p return result_exn result]" by (simp add: call_exn_def)
lemma flatten_dynCall_exn [simp]: "flatten (dynCall_exn f g init p return result_exn result) = [dynCall_exn f g init p return result_exn result]" by (simp add: dynCall_exn_def maybe_guard_def)
lemma flatten_fcall [simp]: "flatten (fcall init p return result c) = [fcall init p return result c]" by (simp add: fcall_def)
lemma flatten_switch [simp]: "flatten (switch v Vcs) = [switch v Vcs]" by (cases Vcs) auto
lemma flatten_guaranteeStrip [simp]: "flatten (guaranteeStrip f g c) = [guaranteeStrip f g c]" by (simp add: guaranteeStrip_def)
lemma flatten_while [simp]: "flatten (while gs b c) = [while gs b c]" apply (simp add: while_def) apply (induct gs) apply auto done
lemma flatten_whileAnno [simp]: "flatten (whileAnno b I V c) = [whileAnno b I V c]" by (simp add: whileAnno_def)
lemma flatten_whileAnnoG [simp]: "flatten (whileAnnoG gs b I V c) = [whileAnnoG gs b I V c]" by (simp add: whileAnnoG_def)
lemma flatten_specAnno [simp]: "flatten (specAnno P c Q A) = flatten (c undefined)" by (simp add: specAnno_def)
lemma normalize_block [simp]: "normalize (block init bdy return c) = block init (normalize bdy) return (λs t. normalize (c s t))" by (simp add: block_def)
lemma normalize_call [simp]: "normalize (call init p return c) = call init p return (λi t. normalize (c i t))" by (simp add: call_def)
lemma normalize_call_exn [simp]: "normalize (call_exn init p return result_exn c) = call_exn init p return result_exn (λi t. normalize (c i t))" by (simp add: call_exn_def)
lemma normalize_dynCall [simp]: "normalize (dynCall init p return c) = dynCall init p return (λs t. normalize (c s t))" by (simp add: dynCall_def)
lemma normalize_guards [simp]: "normalize (guards gs c) = guards gs (normalize c)" by (induct gs) auto
lemma normalize_dynCall_exn [simp]: "normalize (dynCall_exn f g init p return result_exn c) = dynCall_exn f g init p return result_exn (λs t. normalize (c s t))" by (simp add: dynCall_exn_def maybe_guard_def)
lemma normalize_fcall [simp]: "normalize (fcall init p return result c) = fcall init p return result (λv. normalize (c v))" by (simp add: fcall_def)
lemma normalize_switch [simp]: "normalize (switch v Vcs) = switch v (map (λ(V,c). (V,normalize c)) Vcs)" apply (induct Vcs) apply auto done
lemma normalize_guaranteeStrip [simp]: "normalize (guaranteeStrip f g c) = guaranteeStrip f g (normalize c)" by (simp add: guaranteeStrip_def)
text‹Sequencial composition with guards in the body is not preserved by
normalize› lemma normalize_while [simp]: "normalize (while gs b c) = guards gs (While b (sequence Seq (flatten (normalize c) @ flatten (guards gs Skip))))" by (simp add: while_def)
lemma normalize_whileAnno [simp]: "normalize (whileAnno b I V c) = whileAnno b I V (normalize c)" by (simp add: whileAnno_def)
lemma normalize_whileAnnoG [simp]: "normalize (whileAnnoG gs b I V c) = guards gs (While b (sequence Seq (flatten (normalize c) @ flatten (guards gs Skip))))" by (simp add: whileAnnoG_def)
lemma normalize_specAnno [simp]: "normalize (specAnno P c Q A) = specAnno P (λs. normalize (c undefined)) Q A" by (simp add: specAnno_def)
primrec strip_guards:: "'f set ==> ('s,'p,'f) com ==> ('s,'p,'f) com" where "strip_guards F Skip = Skip" | "strip_guards F (Basic f) = Basic f" | "strip_guards F (Spec r) = Spec r" | "strip_guards F (Seq c1 c2) = (Seq (strip_guards F c1) (strip_guards F c2))" | "strip_guards F (Cond b c1 c2) = Cond b (strip_guards F c1) (strip_guards F c2)"| "strip_guards F (While b c) = While b (strip_guards F c)" | "strip_guards F (Call p) = Call p" | "strip_guards F (DynCom c) = DynCom (λs. (strip_guards F (c s)))" | "strip_guards F (Guard f g c) = (if f ∈ F then strip_guards F c else Guard f g (strip_guards F c))" | "strip_guards F Throw = Throw" | "strip_guards F (Catch c1 c2) = Catch (strip_guards F c1) (strip_guards F c2)"
definition strip:: "'f set ==> ('p ==> ('s,'p,'f) com option) ==> ('p ==> ('s,'p,'f) com option)" where"strip F Γ = (λp. map_option (strip_guards F) (Γ p))"
lemma strip_simp [simp]: "(strip F Γ) p = map_option (strip_guards F) (Γ p)" by (simp add: strip_def)
lemma dom_strip: "dom (strip F Γ) = dom Γ" by (auto)
lemma strip_guards_idem: "strip_guards F (strip_guards F c) = strip_guards F c" by (induct c) auto
lemma strip_idem: "strip F (strip F Γ) = strip F Γ" apply (rule ext) apply (case_tac "Γ x") apply (auto simp add: strip_guards_idem strip_def) done
lemma strip_guards_raise [simp]: "strip_guards F (raise f) = raise f" by (simp add: raise_def)
lemma strip_guards_condCatch [simp]: "strip_guards F (condCatch c1 b c2) = condCatch (strip_guards F c1) b (strip_guards F c2)" by (simp add: condCatch_def)
lemma strip_guards_bind [simp]: "strip_guards F (bind e c) = bind e (λv. strip_guards F (c v))" by (simp add: bind_def)
lemma strip_guards_bseq [simp]: "strip_guards F (bseq c1 c2) = bseq (strip_guards F c1) (strip_guards F c2)" by (simp add: bseq_def)
lemma strip_guards_block_exn [simp]: "strip_guards F (block_exn init bdy return result_exn c) = block_exn init (strip_guards F bdy) return result_exn (λs t. strip_guards F (c s t))" by (simp add: block_exn_def)
lemma strip_guards_block [simp]: "strip_guards F (block init bdy return c) = block init (strip_guards F bdy) return (λs t. strip_guards F (c s t))" by (simp add: block_def)
lemma strip_guards_call [simp]: "strip_guards F (call init p return c) = call init p return (λs t. strip_guards F (c s t))" by (simp add: call_def)
lemma strip_guards_call_exn [simp]: "strip_guards F (call_exn init p return result_exn c) = call_exn init p return result_exn (λs t. strip_guards F (c s t))" by (simp add: call_exn_def)
lemma strip_guards_dynCall [simp]: "strip_guards F (dynCall init p return c) = dynCall init p return (λs t. strip_guards F (c s t))" by (simp add: dynCall_def)
lemma strip_guards_guards [simp]: "strip_guards F (guards gs c) = guards (filter (λ(f,g). f ∉ F) gs) (strip_guards F c)" by (induct gs) auto
lemma strip_guards_dynCall_exn [simp]: "strip_guards F (dynCall_exn f g init p return result_exn c) = dynCall_exn f (if f ∈ F then UNIV else g) init p return result_exn (λs t. strip_guards F (c s t))" by (simp add: dynCall_exn_def maybe_guard_def)
lemma strip_guards_fcall [simp]: "strip_guards F (fcall init p return result c) = fcall init p return result (λv. strip_guards F (c v))" by (simp add: fcall_def)
lemma strip_guards_switch [simp]: "strip_guards F (switch v Vc) = switch v (map (λ(V,c). (V,strip_guards F c)) Vc)" by (induct Vc) auto
lemma strip_guards_guaranteeStrip [simp]: "strip_guards F (guaranteeStrip f g c) = (if f ∈ F then strip_guards F c else guaranteeStrip f g (strip_guards F c))" by (simp add: guaranteeStrip_def)
lemma guaranteeStripPair_split_conv [simp]: "case_prod c (guaranteeStripPair f g) = c f g" by (simp add: guaranteeStripPair_def)
lemma strip_guards_while [simp]: "strip_guards F (while gs b c) = while (filter (λ(f,g). f ∉ F) gs) b (strip_guards F c)" by (simp add: while_def)
lemma strip_guards_whileAnno [simp]: "strip_guards F (whileAnno b I V c) = whileAnno b I V (strip_guards F c)" by (simp add: whileAnno_def while_def)
lemma strip_guards_whileAnnoG [simp]: "strip_guards F (whileAnnoG gs b I V c) = whileAnnoG (filter (λ(f,g). f ∉ F) gs) b I V (strip_guards F c)" by (simp add: whileAnnoG_def)
lemma strip_guards_specAnno [simp]: "strip_guards F (specAnno P c Q A) = specAnno P (λs. strip_guards F (c undefined)) Q A" by (simp add: specAnno_def)
primrec mark_guards:: "'f ==> ('s,'p,'g) com ==> ('s,'p,'f) com" where "mark_guards f Skip = Skip" | "mark_guards f (Basic g) = Basic g" | "mark_guards f (Spec r) = Spec r" | "mark_guards f (Seq c1 c2) = (Seq (mark_guards f c1) (mark_guards f c2))" | "mark_guards f (Cond b c1 c2) = Cond b (mark_guards f c1) (mark_guards f c2)" | "mark_guards f (While b c) = While b (mark_guards f c)" | "mark_guards f (Call p) = Call p" | "mark_guards f (DynCom c) = DynCom (λs. (mark_guards f (c s)))" | "mark_guards f (Guard f' g c) = Guard f g (mark_guards f c)" | "mark_guards f Throw = Throw" | "mark_guards f (Catch c1 c2) = Catch (mark_guards f c1) (mark_guards f c2)"
lemma mark_guards_raise: "mark_guards f (raise g) = raise g" by (simp add: raise_def)
lemma mark_guards_condCatch [simp]: "mark_guards f (condCatch c1 b c2) = condCatch (mark_guards f c1) b (mark_guards f c2)" by (simp add: condCatch_def)
lemma mark_guards_bind [simp]: "mark_guards f (bind e c) = bind e (λv. mark_guards f (c v))" by (simp add: bind_def)
lemma mark_guards_bseq [simp]: "mark_guards f (bseq c1 c2) = bseq (mark_guards f c1) (mark_guards f c2)" by (simp add: bseq_def)
lemma mark_guards_block_exn [simp]: "mark_guards f (block_exn init bdy return result_exn c) = block_exn init (mark_guards f bdy) return result_exn (λs t. mark_guards f (c s t))" by (simp add: block_exn_def)
lemma mark_guards_block [simp]: "mark_guards f (block init bdy return c) = block init (mark_guards f bdy) return (λs t. mark_guards f (c s t))" by (simp add: block_def)
lemma mark_guards_call [simp]: "mark_guards f (call init p return c) = call init p return (λs t. mark_guards f (c s t))" by (simp add: call_def)
lemma mark_guards_call_exn [simp]: "mark_guards f (call_exn init p return result_exn c) = call_exn init p return result_exn (λs t. mark_guards f (c s t))" by (simp add: call_exn_def)
lemma mark_guards_dynCall [simp]: "mark_guards f (dynCall init p return c) = dynCall init p return (λs t. mark_guards f (c s t))" by (simp add: dynCall_def)
lemma mark_guards_guards [simp]: "mark_guards f (guards gs c) = guards (map (λ(f',g). (f,g)) gs) (mark_guards f c)" by (induct gs) auto
lemma mark_guards_dynCall_exn [simp]: "mark_guards f (dynCall_exn f' g init p return result_exn c) = dynCall_exn f g init p return result_exn (λs t. mark_guards f (c s t))" by (simp add: dynCall_exn_def maybe_guard_def)
lemma mark_guards_fcall [simp]: "mark_guards f (fcall init p return result c) = fcall init p return result (λv. mark_guards f (c v))" by (simp add: fcall_def)
lemma mark_guards_switch [simp]: "mark_guards f (switch v vs) = switch v (map (λ(V,c). (V,mark_guards f c)) vs)" by (induct vs) auto
lemma mark_guards_guaranteeStrip [simp]: "mark_guards f (guaranteeStrip f' g c) = guaranteeStrip f g (mark_guards f c)" by (simp add: guaranteeStrip_def)
lemma mark_guards_while [simp]: "mark_guards f (while gs b c) = while (map (λ(f',g). (f,g)) gs) b (mark_guards f c)" by (simp add: while_def)
lemma mark_guards_whileAnno [simp]: "mark_guards f (whileAnno b I V c) = whileAnno b I V (mark_guards f c)" by (simp add: whileAnno_def while_def)
lemma mark_guards_whileAnnoG [simp]: "mark_guards f (whileAnnoG gs b I V c) = whileAnnoG (map (λ(f',g). (f,g)) gs) b I V (mark_guards f c)" by (simp add: whileAnno_def whileAnnoG_def while_def)
lemma mark_guards_specAnno [simp]: "mark_guards f (specAnno P c Q A) = specAnno P (λs. mark_guards f (c undefined)) Q A" by (simp add: specAnno_def)
primrec merge_guards:: "('s,'p,'f) com ==> ('s,'p,'f) com" where "merge_guards Skip = Skip" | "merge_guards (Basic g) = Basic g" | "merge_guards (Spec r) = Spec r" | "merge_guards (Seq c1 c2) = (Seq (merge_guards c1) (merge_guards c2))" | "merge_guards (Cond b c1 c2) = Cond b (merge_guards c1) (merge_guards c2)" | "merge_guards (While b c) = While b (merge_guards c)" | "merge_guards (Call p) = Call p" | "merge_guards (DynCom c) = DynCom (λs. (merge_guards (c s)))" | (*"merge_guards (Guard f g c) = (case(merge_guardsc)of Guardf'g'c'\<Rightarrow>iff=f'thenGuardf(g\<inter>g')c' elseGuardfg(Guardf'g'c')
| _ \<Rightarrow> Guard f g (merge_guards c))"*) (* the following version works better with derived language constructs *) "merge_guards (Guard f g c) = (let c' = (merge_guards c) in if is_Guard c' then let (f',g',c'') = dest_Guard c' in if f=f' then Guard f (g ∩ g') c'' else Guard f g (Guard f' g' c'') else Guard f g c')" | "merge_guards Throw = Throw" | "merge_guards (Catch c1 c2) = Catch (merge_guards c1) (merge_guards c2)"
lemma merge_guards_res_Skip: "merge_guards c = Skip ==> c = Skip" by (cases c) (auto split: com.splits if_split_asm simp add: is_Guard_def Let_def)
lemma merge_guards_res_Basic: "merge_guards c = Basic f ==> c = Basic f" by (cases c) (auto split: com.splits if_split_asm simp add: is_Guard_def Let_def)
lemma merge_guards_res_Spec: "merge_guards c = Spec r ==> c = Spec r" by (cases c) (auto split: com.splits if_split_asm simp add: is_Guard_def Let_def)
lemma merge_guards_res_Seq: "merge_guards c = Seq c1 c2 ==> ∃c1' c2'. c = Seq c1' c2' ∧ merge_guards c1' = c1 ∧ merge_guards c2' = c2" by (cases c) (auto split: com.splits if_split_asm simp add: is_Guard_def Let_def)
lemma merge_guards_res_Cond: "merge_guards c = Cond b c1 c2 ==> ∃c1' c2'. c = Cond b c1' c2' ∧ merge_guards c1' = c1 ∧ merge_guards c2' = c2" by (cases c) (auto split: com.splits if_split_asm simp add: is_Guard_def Let_def)
lemma merge_guards_res_While: "merge_guards c = While b c' ==> ∃c''. c = While b c'' ∧ merge_guards c'' = c'" by (cases c) (auto split: com.splits if_split_asm simp add: is_Guard_def Let_def)
lemma merge_guards_res_Call: "merge_guards c = Call p ==> c = Call p" by (cases c) (auto split: com.splits if_split_asm simp add: is_Guard_def Let_def)
lemma merge_guards_res_DynCom: "merge_guards c = DynCom c' ==> ∃c''. c = DynCom c'' ∧ (λs. (merge_guards (c'' s))) = c'" by (cases c) (auto split: com.splits if_split_asm simp add: is_Guard_def Let_def)
lemma merge_guards_res_Throw: "merge_guards c = Throw ==> c = Throw" by (cases c) (auto split: com.splits if_split_asm simp add: is_Guard_def Let_def)
lemma merge_guards_res_Catch: "merge_guards c = Catch c1 c2 ==> ∃c1' c2'. c = Catch c1' c2' ∧ merge_guards c1' = c1 ∧ merge_guards c2' = c2" by (cases c) (auto split: com.splits if_split_asm simp add: is_Guard_def Let_def)
lemma merge_guards_res_Guard: "merge_guards c = Guard f g c' ==>∃c'' f' g'. c = Guard f' g' c''" by (cases c) (auto split: com.splits if_split_asm simp add: is_Guard_def Let_def)
lemma merge_guards_block_exn [simp]: "merge_guards (block_exn init bdy return result_exn c) = block_exn init (merge_guards bdy) return result_exn (λs t. merge_guards (c s t))" by (simp add: block_exn_def)
lemma merge_guards_block [simp]: "merge_guards (block init bdy return c) = block init (merge_guards bdy) return (λs t. merge_guards (c s t))" by (simp add: block_def)
lemma merge_guards_call [simp]: "merge_guards (call init p return c) = call init p return (λs t. merge_guards (c s t))" by (simp add: call_def)
lemma merge_guards_call_exn [simp]: "merge_guards (call_exn init p return result_exn c) = call_exn init p return result_exn (λs t. merge_guards (c s t))" by (simp add: call_exn_def)
lemma merge_guards_dynCall [simp]: "merge_guards (dynCall init p return c) = dynCall init p return (λs t. merge_guards (c s t))" by (simp add: dynCall_def)
lemma merge_guards_fcall [simp]: "merge_guards (fcall init p return result c) = fcall init p return result (λv. merge_guards (c v))" by (simp add: fcall_def)
lemma merge_guards_switch [simp]: "merge_guards (switch v vs) = switch v (map (λ(V,c). (V,merge_guards c)) vs)" by (induct vs) auto
lemma merge_guards_guaranteeStrip [simp]: "merge_guards (guaranteeStrip f g c) = (let c' = (merge_guards c) in if is_Guard c' then let (f',g',c') = dest_Guard c' in if f=f' then Guard f (g ∩ g') c' else Guard f g (Guard f' g' c') else Guard f g c')" by (simp add: guaranteeStrip_def)
lemma merge_guards_whileAnno [simp]: "merge_guards (whileAnno b I V c) = whileAnno b I V (merge_guards c)" by (simp add: whileAnno_def while_def)
lemma merge_guards_specAnno [simp]: "merge_guards (specAnno P c Q A) = specAnno P (λs. merge_guards (c undefined)) Q A" by (simp add: specAnno_def)
text‹@{term "merge_guards"} for guard-lists as in @{const guards}, @{const while}
and @{const whileAnnoG} may have funny effects since the guard-list has to
be merged with the body statement too.›
lemma inter_guards_Skip: "(Skip ∩g c2) = Some c = (c2=Skip ∧ c=Skip)" by (cases c2) auto
lemma inter_guards_Basic: "((Basic f) ∩g c2) = Some c = (c2=Basic f ∧ c=Basic f)" by (cases c2) auto
lemma inter_guards_Spec: "((Spec r) ∩g c2) = Some c = (c2=Spec r ∧ c=Spec r)" by (cases c2) auto
lemma inter_guards_Seq: "(Seq a1 a2 ∩g c2) = Some c = (∃b1 b2 d1 d2. c2=Seq b1 b2 ∧ (a1 ∩g b1) = Some d1 ∧ (a2 ∩g b2) = Some d2 ∧ c=Seq d1 d2)" by (cases c2) (auto split: option.splits)
lemma inter_guards_Cond: "(Cond cnd t1 e1 ∩g c2) = Some c = (∃t2 e2 t e. c2=Cond cnd t2 e2 ∧ (t1 ∩g t2) = Some t ∧ (e1 ∩g e2) = Some e ∧ c=Cond cnd t e)" by (cases c2) (auto split: option.splits)
lemma inter_guards_While: "(While cnd bdy1 ∩g c2) = Some c = (∃bdy2 bdy. c2 =While cnd bdy2 ∧ (bdy1 ∩g bdy2) = Some bdy ∧ c=While cnd bdy)" by (cases c2) (auto split: option.splits if_split_asm)
lemma inter_guards_Call: "(Call p ∩g c2) = Some c = (c2=Call p ∧ c=Call p)" by (cases c2) (auto split: if_split_asm)
lemma inter_guards_DynCom: "(DynCom f1 ∩g c2) = Some c = (∃f2. c2=DynCom f2 ∧ (∀s. ((f1 s) ∩g (f2 s)) ≠ None) ∧ c=DynCom (λs. the ((f1 s) ∩g (f2 s))))" by (cases c2) (auto split: if_split_asm)
lemma inter_guards_Guard: "(Guard f g1 bdy1 ∩g c2) = Some c = (∃g2 bdy2 bdy. c2=Guard f g2 bdy2 ∧ (bdy1 ∩g bdy2) = Some bdy ∧ c=Guard f (g1 ∩ g2) bdy)" by (cases c2) (auto split: option.splits)
lemma inter_guards_Throw: "(Throw ∩g c2) = Some c = (c2=Throw ∧ c=Throw)" by (cases c2) auto
lemma inter_guards_Catch: "(Catch a1 a2 ∩g c2) = Some c = (∃b1 b2 d1 d2. c2=Catch b1 b2 ∧ (a1 ∩g b1) = Some d1 ∧ (a2 ∩g b2) = Some d2 ∧ c=Catch d1 d2)" by (cases c2) (auto split: option.splits)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.