(* An execution fragment is modelled with a pair of sequences: the first is the action options, the second the state sequence. Finite executions have None actions from some point on. *) definition is_execution_fragment :: "[('action,'state)ioa, ('action,'state)execution] => bool" where"is_execution_fragment A ex ≡ let act = fst(ex); state = snd(ex) in ∀n a. (act(n)=None ⟶ state(Suc(n)) = state(n)) ∧ (act(n)=Some(a) ⟶ (state(n),a,state(Suc(n))) ∈ trans_of(A))"
definition par :: "[('a,'s)ioa, ('a,'t)ioa] ==> ('a,'s*'t)ioa" (infixr‹||› 10) where"(ioa1 || ioa2) ≡ (asig_comp (asig_of ioa1) (asig_of ioa2), {pr. fst(pr) ∈ starts_of(ioa1) ∧ snd(pr) ∈ starts_of(ioa2)}, {tr. let s = fst(tr); a = fst(snd(tr)); t = snd(snd(tr)) in (a ∈ actions(asig_of(ioa1)) | a ∈ actions(asig_of(ioa2))) & (if a ∈ actions(asig_of(ioa1)) then (fst(s),a,fst(t)) ∈ trans_of(ioa1) else fst(t) = fst(s)) & (if a ∈ actions(asig_of(ioa2)) then (snd(s),a,snd(t)) ∈ trans_of(ioa2) else snd(t) = snd(s))})"
(* Filtering and hiding *)
(* Restrict the trace to those members of the set s *) definition filter_oseq :: "('a => bool) => 'a oseq => 'a oseq" where"filter_oseq p s ≡ (λi. case s(i) of None ==> None | Some(x) ==> if p x then Some x else None)"
(* Does an ioa have an execution with the given trace *) definition has_trace :: "[('action,'state)ioa, 'action oseq] ==> bool" where"has_trace ioa b ≡ (∃ex∈executions(ioa). b = mk_trace ioa (fst ex))"
lemma filter_oseq_idemp: "filter_oseq p (filter_oseq p s) = filter_oseq p s" apply (simp add: filter_oseq_def) apply (rule ext) apply (case_tac "s i") apply simp_all done
lemma mk_trace_thm: "(mk_trace A s n = None) = (s(n)=None | (∃a. s(n)=Some(a) ∧ a ∉ externals(asig_of(A)))) & (mk_trace A s n = Some(a)) = (s(n)=Some(a) ∧ a ∈ externals(asig_of(A)))" apply (unfold mk_trace_def filter_oseq_def) apply (case_tac "s n") apply auto done
(* Every state in an execution is reachable *) lemma states_of_exec_reachable: "ex ∈ executions(A) ==>∀n. reachable A (snd ex n)" apply (unfold reachable_def) apply fast done
lemma trans_of_par4: "(s,a,t) ∈ trans_of(A || B || C || D) = ((a ∈ actions(asig_of(A)) | a ∈ actions(asig_of(B)) | a ∈ actions(asig_of(C)) | a ∈ actions(asig_of(D))) ∧ (if a ∈ actions(asig_of(A)) then (fst(s),a,fst(t)) ∈ trans_of(A) else fst t=fst s) ∧ (if a ∈ actions(asig_of(B)) then (fst(snd(s)),a,fst(snd(t))) ∈ trans_of(B) else fst(snd(t))=fst(snd(s))) ∧ (if a ∈ actions(asig_of(C)) then (fst(snd(snd(s))),a,fst(snd(snd(t)))) ∈ trans_of(C) else fst(snd(snd(t)))=fst(snd(snd(s)))) ∧ (if a ∈ actions(asig_of(D)) then (snd(snd(snd(s))),a,snd(snd(snd(t)))) ∈ trans_of(D) else snd(snd(snd(t)))=snd(snd(snd(s)))))" (*SLOW*) apply (simp (no_asm) add: par_def actions_asig_comp prod_eq_iff ioa_projections) done
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.