(* 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\<forall>n a. (act(n)=None \<longrightarrow> state(Suc(n)) = state(n)) \<and>
(act(n)=Some(a) \<longrightarrow> (state(n),a,state(Suc(n))) \<in> 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) \<in> starts_of(ioa1) \<and> snd(pr) \<in> starts_of(ioa2)},
{tr. let s = fst(tr); a = fst(snd(tr)); t = snd(snd(tr)) in (a \<in> actions(asig_of(ioa1)) | a \<in> actions(asig_of(ioa2))) &
(if a \<in> actions(asig_of(ioa1)) then
(fst(s),a,fst(t)) \<in> trans_of(ioa1)
else fst(t) = fst(s))
&
(if a \<in> actions(asig_of(ioa2)) then
(snd(s),a,snd(t)) \<in> 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 \
(\<lambda>i. case s(i)
of None \<Rightarrow> None
| Some(x) \<Rightarrow> 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 | (\<exists>a. s(n)=Some(a) \<and> a \<notin> externals(asig_of(A))))
&
(mk_trace A s n = Some(a)) =
(s(n)=Some(a) \<and> a \<in> 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 \<in> actions(asig_of(A)) | a \<in> actions(asig_of(B)) | a \<in> actions(asig_of(C)) |
a \<in> actions(asig_of(D))) \<and>
(if a \<in> actions(asig_of(A)) then (fst(s),a,fst(t)) \<in> trans_of(A)
else fst t=fst s) \<and>
(if a \<in> actions(asig_of(B)) then (fst(snd(s)),a,fst(snd(t))) \<in> trans_of(B)
else fst(snd(t))=fst(snd(s))) \<and>
(if a \<in> actions(asig_of(C)) then
(fst(snd(snd(s))),a,fst(snd(snd(t)))) \<in> trans_of(C)
else fst(snd(snd(t)))=fst(snd(snd(s)))) \<and>
(if a \<in> actions(asig_of(D)) then
(snd(snd(snd(s))),a,snd(snd(snd(t)))) \<in> 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 ist noch experimentell.