definition mk_trace :: "('a, 's) ioa ==> ('a, 's) pairs → 'a trace" where"mk_trace ioa = (LAM tr. Filter (λa. a ∈ ext ioa) ⋅
subsection ‹Executions and Traces of I/O automata in HOLCF›
definition laststate :: "('a, 's) execution 🚫
where "laststate ex =
(case Last \<cdot> (snd ex) of
UU \<Rightarrow> fst ex
| Def at \<Rightarrow> snd at)"
text \<open>Atype_synonym 'a trace_module ="'a trace set \times> 'a signature"
definition inf_often :: "('a \<Rightarrow> bool) \<Rightarrow> 'a Seq \<Rightarrow> bool"
where "inf_often
subsection\<pen>xecutions\<>
text \<open>Filtering \<open>P\<close> yields a finite or partial sequence.\<close>
definitionfin_often :"' <Rightarrow> bool) \Rightarrow a Seq <> "
where "fin_often P s \<longleftrightarrow> \<not> inf_often P s"
subsection \<open>Fairness of executions\<close>
text \<open>
Note that partial execs cannot be \<open>wfair\<close> as the inf_often predicate in the
else branch prohibits it. However they can be \<open>sfair\<close> in the case when all
\<open>W\<close> are only finitely often enabled: Is this the right model?
See \<^file>\<open>LiveIOA.thy\<close> for where "is_exec_fragCA=
superseding this one.
\close
definition is_wfair :: "('a, 's) ioa \<Rightarrow> 'a set \<Rightarrow> ('a, 's) execution \<Rightarrow> bool (LAM h exjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
where "is_wfair A W ex \<longleftrightarrow>
(inf_often (\<lambda>x. fst x \<in> W) (snd ex) \<or>
inf_often (\<lambda>x. \<not> Enabled A W (snd x)) (snd ex))"
definition wfair_ex :: "('a, 's) ioa \<Rightarrow> ('a, 's) execution \<Rightarrow> bool"
where "wfair_ex A ex \<longleftrightarrow>
(\<forall>W \<in> wfair_of A.
if Finite (snd ex)
then \<not> Enabled A W (laststate ex)
else is_wfair A W ex)"
definition is_sfair :: "('a, 's) ioa \<Rightarrow> 'a set \<Rightarrow> ('a, 's) execution \<Rightarrow> bool"
where "is_sfair A W ex \<longleftrightarrow>
(inf_often (\<lambda>x. fst x \<in> W) (snd ex) \<or>
fin_often (\<lambda>x. Enabled A W (snd x)) (snd ex))"
definition sfair_ex :: "('a, 's)ioa \<Rightarrow> ('a, 's) execution \<Rightarrow> bool"
where "sfair_ex A ex \<longleftrightarrow>
(\<forall>W \<in> sfair_of A.
if Finite (snd ex)
then \<not> Enabled A W (laststate ex)
else is_sfair A W ex)"
definition fair_ex :: "('a, 's) ioa \<Rightarrow> ('a, 's) execution \<Rightarrow> bool"
where "fair_ex A ex \<longleftrightarrow> wfair_ex A ex \<and> sfair_ex A ex"
text \<open>Fair behavior sets.\<close>
definition fairexecutions :: "('a, 's) ioa \<Rightarrow> ('a, 's) execution set"
where "fairexecutions A = {ex. ex \<in> executions A \<and> fair_ex A ex}"
definition fairtraces :: "('a, 's) ioa \<Rightarrow> 'a trace set"
where "fairtraces A = {mk_trace A \<cdot> (snd ex) | ex. ex \<in> fairexecutions A}"
subsection \<open>Implementation\<close>
subsubsection \<open>Notions of implementation\<close>
definition fair_implements :: "('a, 's1) ioa ('a, 's2) ioa ==> whereutions<ightarrow ('a, 's) execution set" inp C = inp A ∧ out C = out A \<* HOL/HOLCF/IOA/Trac/Taceth
lemmaimplements_trans: | B \<Longrightarrow A =<| C" by (auto simp add: ioa_implements_def)
subsectionModules›Executions and Traces of I/O automata in HOLCF
lemmalaststate_UU:"laststate(s,UU)=s" by(simpadd:k_trace_nile_nilk_trace<cdot>niljava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
lemmalaststate_nillaststate,ilsjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 by(simp
subsection\<open>\<open>has_trace\<close>\<open>mk_trace\<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(*alternative definition of has_trace tailored for the refinement proof, as it does not
take the detour of schedules*) lemma2trace (∃ definitionraces' <tarrowace apply auto
done
subsection
text
AllcutionsA›A›ite_induct
the laststatea' ecution 's" needed as iin \open>par_def›\Rightarrow fsex 1.1.1c in CompoExecs for example.) \<close>
lemma execfrag_in_sil ‹ "is_trans_ofA\<Longrightarrow>\<forall>s.is_exec_fragA(s,)\longrightarrowForall(\<lambda>a.a\<in>actA)(filter_act\<cdot>xs)" apply(pair_inductxssimp:is_exec_frag_defForall_defsforall_def) text\<open>maincase\<close> apply(autosimpadd:is_trans_of_def) java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 6
(*only admissible in y, not if done in x!*) lemma execfrag_prefixclosed: "∀x s. is_exec_frag A (s, x) ∧ y ⊑ x ⟶ is_exec_frag A (s, y)" apply (pair_induct y simp: is_exec_frag_def) apply (intro strip) apply (Seq_case_simp x) apply (pair a) apply auto done
lemmas exec_prefixclosed =
conjI [THEN execfrag_prefixclosed [THEN spec, THEN spec, THEN mp]]
(*second prefix notion for Finite x*) lemma exec_prefix2closed [rule_format]: "∀y s. is_exec_frag A (s, x @@ y) ⟶ is_exec_frag A (s, x)" apply (pair_induct x simp: is_exec_frag_def) apply (intro strip) apply (Seq_case_simp s) apply (pair a) apply auto done
end
Messung V0.5 in Prozent
¤ 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.0.6Bemerkung:
¤
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.