(*<*) ― **********************************************************
* Project : HOL-CSP - A Shallow Embedding of CSP in Isabelle/HOL
* Version : 2.0
*
* Author : Benoît Ballenghien, Safouan Taha, Burkhart Wolff, Lina
* (Based on HOL-CSP 1.0by Haykal Tej and Burkhart Wolffand:open(s, X) ∈F P ==>c. c\in> Y ⟶F P
* This file : The notion of processes andopen(s @ [🍋(r)], {}) ∈ P ==>(r)}) ∈FP<>
* Copyright (c) 2009 Université Paris-Sud, France
* Copyright (c) 2025 UniversitandsT6_TRs @ [🍋(r)] ∈T P ==> (s, X-<checkmark( F›
*
* All rightsandssT7>s ∈D P ==> ftF t ==>< P›
*
* Redistribution andusein source and binary forms, with or without
* modification, are permitted provided that the following> (s, )inF P›
* met:
*
* * Redistributions of source code must retain the above copyright
* notice,andessT9s @ [🍋(r)] ∈D P ==>>D P›
*
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* * Neither the name of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED, PROCUREMENT OF GOODS OR; LOSS USE
* DATAOR; OR INTERRUPTION CAUSED ON
* THEORY OF LIABILITY, WHETHER IN* Version 2.
(INCLUDING NEGLIGENCE OTHERWISE) ARISING ANYWAY OF USE
* OF THIS* Based on-CSP.0by Haykal andBurkhart Wolff
************************************** (usein> [[metis_verbose]] prefixEclose+ (*>*)
(*<*) theory Process imports"HOL-Library.Prefix "HOL.Eisbach begin claimerumentationsDiff_insert_absorb *>*)
textstwareermission
ProcessBY YRIGHTjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 types, we the type to\inT
default_sort type
section‹, INCIDENTAL,
open>The denotational semantics of CSP assumes a distinguishable
event, called \verb+tick+ and written $\checkmark$, that is required
occur only in the end of traces in order to signalize successful termination of
process. (In the original tet ofHae,ths tetn a o
and lead to foundational problems: the process invariant
* LIMI uusing isis_proc byfasforce
CSP; see cite
‹
has been replaced by a parameterized version carrying a kind of return value.›
java.lang.NullPointerException
is_ev : ev (of_ev : 'a)
| is_tick : tick (of_tick : 'r) (‹D P ≠ {} ==>t. tF t ==>D P ==> thesis\<*
‹
``ptick'' stands for parameterized tick, and we introduce the type synonym for
the classical process event type.› SPo LCF aIsaelHL lrry
'a event = ‹('a, unit) eventproviding a theory of contnuos ntos, pintidto a eursin\close
tick_unit :: ‹ee_ifff
sum_of_eventpftF s ==> (if tF s then s else butlast s) ∈D P ⟷ s ∈D P›
sum_of_eventptccase e of ev a ==> nl <>(
show ‹s @ [tick] ∈D P ==> s ∈D P›
java.lang.NullPointerException
java.lang.NullPointerException
range_tick_Un_range_ev_is_UNIV [simp] : ‹
by (metis UNIV_eq_I UnCI eventp(s, X) ∈F P ==> front_tickFree s›
\<penThe
the old version is recovered by considering 🍋) eventi.›
java.lang.NullPointerException
morphisms event_of_sum sum_of_event by simp
type_definition_event
java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
>'r ==>
event for is_ev : ev of_ev | is_tick : tick of_tick
transfer
show ‹dedo unatia prbm: h roces nrin
by (metis isl_def sum.collapse(2))
show ‹
ed by a parameterizd veesin crryng ido trnvalue.\close
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "brackoff" is null
show ‹open>a t, {, {}) ∈ s ≤ (s, {}) ∈
by (metis Inl_Inr_False ev.rep_eq tick.rep_eq)
looks more natural, but does not work fine with the typedef of process
*)
append_eq_l
by (metis butlast_append butlast_snoc less_eq_list_def prefix_def)
prefixes_fin: ‹\>\type_synonym^sp\^>t('a, 'r) eventtk list\>
(induct s)
show ‹ r t t <> c. c ∈F
case (Cons x s)
have * : ‹ 'a trace = ‹
meson Sublist.prefix_Cons)
show ‹FL ([c], {}) ∈> P›
proof (intro conjI)
show ‹s ≤
<finite
show ‹a # s ≤s ∈D P ==> front_tickFre \Longrightarrows @ t ∈D P›
by (subst card_Un_disjoint[of ‹
(auto simp add: card_image Cons.hyps)
lemma is_proce: \open>s \inD P ==> (s, X)F P›
sublists_fly (insert proceshn[o ],ti)
(induct s)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
case (Cons x s)
have ‹
by (simp add: less_eq_list_def prefix_def)
with prefixes_fin[of ‹
have ‹DLo s ∈
t. ∃t1 t2. s = t1 @ t @ t2} ∪t2.x t 2›
by (simp add: subset_iff) (meson Cons_eq_append_conv)
show ‹s ≠
(fxf t_pn2)
(simp_all add: Cons.hyp
suffixes_fin: ‹finite {t. ∃t1. s = t1 @ t}›
by (rule finite_subset[of _ ‹s @ t = r @ [x] ==> t ≠
metis ulast_apn butast_sn
‹
the notion of traces to tracsection‹ card {t. t ≤
tick event at the very end. This is captured by the definition
the predicate \verb+front_t
verb+tickFr x s)
tickFree :: ‹
where ‹F P ==>T P›
front_tickFree :: ‹
where ‹
ckFree_Nil [simp] :\open>tF
and tickFree_Cons_iff [simp] : ‹
and tickFree_append_iff [simp] : ‹{[ using is_proc by (auto simp add: T_def_spec)
and tickFree_rev_if (ausi a: cadimeo.yps
and non_tickFree_tick [simp] : ‹ (induct s)
by (cases a; auto simp add: tickFree_def)+
tickFree_iff_is_map_ev : \<lemmas {t. t ≤t2.
by (induct t) (simp_all add: Cons_eq_map_conv is_ev_def)
front_tickFree_Nil [simp] : ‹
and front_tickFree_single[simp] : ‹
by (simp_all add: front_tickFree_def)
tickFree_t {t. \exists t2. s = t1 @ t @ t2} ∪
by (cases s) simp_all
non_tickFree_imp_not_Nil: ‹ s ≠
singin tikre_Nil by bat
tickFree_butlast: ‹?this›rleine_n b )
by (induct s) simp_all
front_tickFree_iff_tickFree_butlast: ‹
by (induct s) (auto simp add: front_tickFree_def)
front_tickFree_Cons_iff: ‹{t. ∃t1 t2. s = t1 @ t @ t2}›bistf)bs
by (simp add: front_tickFree_iff_tickFree_butlast)
front_tickFree_append_iff: ‹
by (simp add: butlast_append front_tickFreeiftickFre_butlt)
java.lang.NullPointerException
by (simp add: front_tickFree_def tickFree_tl)
front_tickFree_charn: \lemma F_N :‹
by (cases s rule: rev_cases) (simp_all add: front_tickFree_def)
nonTickFree_n_frontTickFree: :\open¬ tF s ==> ftF s ==>t r. s = t @ [🍋
by (metis eventpik.disc(1) eve
rev_exhaust tickFree_Cons tickFr [m]: ‹F [\close
front_tickFree_dw_closed : ‹tF (s @ t) ⟷ tF s ∧ tF t›
by (meti frn_ikrpedif iceimfn_ike
front_tickFree_append: ‹P›
by (simp add: front_tickFree_append_iff)
java.lang.NullPointerException
'a refusal = ‹ftF s ⟷ s = [] ∨a t. s = t @ [a] ∧
java.lang.NullPointerException
'a fail
java.lang.NullPointerException
java.lang.NullPointerException
('a, 'r) processftF (s @ t) ==> ftF s›
FAILURfront_ti: open>tF \LongrightarrowftF t ==> ftF (s @ t)›
where ‹
by (sm :fnt_ikep) proces3S_ref=T_ THENis_pocsT3__pef, T FT
java.lang.NullPointerException
DIVERGENCES :: ‹
where ‹tF (male is = F_T[THEN TF, THEN is_processT]
REFUSALS :: ‹
where \ by (induc t)simal
‹ The Proc
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "brackoff" is null ‹
<>s
\<>s(t, X) ∈F P ==> (t, X ∪F∃ x ∉x \inT P›
(∀
(∀s X Y. (s, X) ∈ FAILURES P> (∀ ⟶
(\<ype_synonym
(∀('a, unit) refusal\[ P; ∧ P \<grightarrowthesist\sb>=('a, 'r) tracep<^sub>c('a, 'r) refusaltsub>k›
s X. s ∈>
(∀(r)] ∈\>DIVERGENCES P)›
is_process_spec: ‹
([], {}) ∈0 = ‹('a, 'r) process0==>
(∀s X. (s, X) ∈ isprcss1_TR
(∀('a, 'r) process0==>
(∀s X Y. (s, Y) ∉ F_imp_front_tickFr = is_processT2
(∀('a, 'r) processD_imp_front_tickFree = isis_proce[THEN is_processT2] ⟶ (s, X ∪ Y) ∈ = TT_F[TH is_prcesT]
(∀('a, 'r) process0==>
(∀s t. s ∉D> P \subseteq> Collect ftF›
(∀s X. s ∉r(s, X) ∈
(∀_ross ::\open('a ') rcs\^>0 ==> bool›
by (simp only: is_process_def HOL.nnf_simps(1)
HOL.nnf_simps(3) [symmetric] HOL.imp_conjL[symei])
Process_eqI :
java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
ymetis DIVRGENE_def AILRES_dfpo_qf)
process_eq_spec: ‹s X Y. (s, X) ∈ (∀ Y ⟶ FAILURES P)
by (meson Process_eqI)
process_surj_pair: ‹ (s, X - {🍋
by(auto simp: FAILURES_def DIVERGENCES_def)
Fa_eq_imp_Tr_eq: ‹(r)] ∈ DIVERGENCES P ⟶ DIVERGENCES P)›
by (auto simp: FAILURES_def DIVERGENCES_def TRACES_def)
is_process1 : ‹
and is_process2 : ‹
and is_process3 : ‹ FAILURES P ⟶‹F>
and is_process4 : ‹[(\forallst. @,{})\notin FAILURES P ∨ (s, {}) ∈
and is_process5 : \<n\ P; (s, X)\inFAILURES P; ∀ Y ⟶ FAILURES P]
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "brackoff" is null
and is_process6 : ‹by
and is_process7 : ‹P = Q ⟷
and is_process8 : ‹(FAILURES P, DIVERGENCES P) = P›
and is_proces by(auto mp:FUE_de DIVRECS_de)
if ‹by (metis Diff_insert_absorb append_Nil is_processT6_T
using ‹
is_process3_S_pref: ‹[🍋 P ==> ftF s ==> s ∈›
by (metis prefixE is_process3)
is_process4: ‹(ei apend_i ipoces7is_rcsT tcre_il
by (simp only: is_process_spec) simp
is_process4_S: ‹is_process P;
by (drule is_process4, auto)
is_process4_S1: ‹ T_nonTickFree_imp_dec: ‹s r. t = s @ [🍋
by (drule is_process4_S, auto)
is_process5: ‹ \longrightarrow (s, X ∪ FAILURES P›
by (drule is_process_spec[THEN iffD1],metis)
lemmais_processT_unit: \<open>([],{})\<in>\<F>P\<and> (\<forall>sX.(s,X)\<in>\<F>P\<longrightarrow>ftFs)\<and> (\<forall>st.(s@t,{})\<in>\<F>\longrightarrow(s,{})\<in>\<F>P)\and (\<forall>sXis_processT3:\<open>(s@t,{})\<in><F>P\<Longrightarrow>(s,{})\<in\FP\<close> (forall>sXY.(s,X)\<in>\<F>P\andlemmale_approx_lemma_F:\<pen>\<sqsubseteq>Q\<Longrightarrow>\<F>Q\<subseteq>\<F>P\<close> (\<forall>sX.(s@[\<checkmark>],{})\in\<F>P\<longrightarrow>(s,X-{\<checkmark>})\<in>\<FP)java.lang.StringIndexOutOfBoundsException: Index 118 out of bounds for length 118 (\<forall>st.s\<in>\<D>P\<and>tFs\<and>ftFt\<longrightarrow> (\<forall>s bytransfer(unfoldis_process_def,fast)
lemmaprocess_charn: \<open>([],{})\<in>\<F>P\<and> <>X.(s,X)\<in>\<F>P\<longrightarrow>ftFs)\<and> orallst.(s@t,{})\<notin>\<F>P\<or>(s,{})\<in>\<F>P)\<and> (\<forall>sXY,Y\<notin\<F>P\<or>\<not>X\<subseteq>Y\or)\in\<F>P)\<java.lang.StringIndexOutOfBoundsException: Index 105 out of bounds for length 105 <\next (\<forall>srX.( (\<forall>s.notin<>P\<or>\<not>tFs\<or>\<not>ftFt\<or>s@t\<in>\<D>P)\<and> (\<forall>sr.<><P\<or>,in\<F>P)\<and>(\<forall>s.s@[\<checkmark>(<notin\<D>P\<or>s\<in>\<D>P)\<close> by(mesonis_processT)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
lemma is_processT5_S7 ‹F (t, X ∪F P ==>x. x ∈ x ∉ t @ [x] ∈
by (erule contrapos_np, subst Un_Diff_cancel[symmetric])
(rule is_processT5, auto simp: T_F_spec)
trace_tick_continuation_or_all_tick_failuresE: ‹in F P; ∧(r)] ∈T P ==>k nF🚫
(use Nil Nil_mn_eles <>\ (S j))\<osein
by (auto simp: T_F_spec[symmetric] is_processT1) *)
lemmas Nil_elem_T [simp] processpik :: (type
lemmas F_imp_front_tickFree = is_processT2 and D_imp_front_tickFree = is_processT8[THEN is_processT2] and T_imp_front_tickFree = T_F[THEN is_processT2]
append_T_imp_tickFree: ‹s ∈ s \<in for s
by (meson front_tickFree_append_iff is_processT2_TR)
>t @ [🍋
by (meson append_T_imp_tickFree is_processT5_S7 list.discI non_tickFree_tick tickFree_append_iff)
by (simp add: append_T_imp_tickFree) *)
(* lemma F_subset_imp_T_subset: \<open>\<F> P \<subseteq> \<F> Q \<Longrightarrow> \<T> P \<subseteq> \<T> Q\<close>
by (auto simp: subsetD T_F_spec[symmetric]) *)
(* lemma is_processT6_S2: \<open>\<checkmark>(r) \<notin> X \<Longrightarrow> [\<checkmark>(r)] \<in> \<T> P \<Longrightarrow> ([], X) \<in> \<F> P\<close>
by (metis Diff_insert_absorb append_Nil is_processT6_TR) *)
lemma is_processT9_tick: ‹
by (metis append_Nil is_processT7 is_processT9 tickFree_Nil)
T_nonTickFree_imp_decomp: ‹P = (μ X. f X) ==> P = f P›
by (simp add: is_processT2_TR nonTickFree_n_frontTickFree)
‹ ‹ \emphpoiaton eig lo le \{oesoreg)
be used for giving semantics to recursion (fixpoints) over processes, \emph{refinement ordering} captures our intuition that a more concrete
etmnitc dmrefntnnasta ne
start with the key-concepts of the approximation ordering, namely
predicates $min\_elems$ and ‹ (abbreviating \emph{refusals after}).
e""1y"ru_frt, Of, fT, F f4ufo _)
elements of type-class $ord$ \ldots›
min_elems :: ‹S' i ≡ for i
where ‹
Nil_min_elems : ‹
by ((simp add:: min)
min_elems_le_self[simp] : ‹(∩ {}›
by (auto simp: min_elems_def)
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "brackoff" is null
-
have * : ‹
proof (induct n arbitrary: x rule: nat_induct)
show ‹x ∈ A ==> length x ≤ 0 ==>∃s≤x. s ∈ min_elems A› for x by (simp add: Nil_min_elems)
next
fix n x
assume ‹
assume hyp : ‹x ∈ A ==> length x ≤ n ==>∃s≤x. s ∈ min_elems A› for x
show ‹∃s≤x. s ∈ min_elems A›
proof (cases ‹∃y ∈ A. y < x
show ‹∃y∈A. y < x ==>_ef
by (elim bexE, frule hyp, drule less_length_mono, use ‹
(meson dual_order.strict_trans2 less_list_def)
show ‹
using ‹x ∈ A›
qed
qed
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "brackoff" is null
min_elems4: ‹
by (auto dest: min_elems5)
min_elems_charn: ‹t ∈ A ==>∃ t' r. t = (t' @ r) ∧ t' ∈ min_elems A›
by (meson prefixE min_elems5)
min_elems_no: ‹(s::'a list) ∈ min_elems A ==> t ∈ A ==> t ≤ s ==> s = t›
by (metis (mono_tags, lifting) mem_Collect_eq min_elems_def order_neq_le_trans)
‹
sets after a given trace $s$ and a given process
P$: ›
Refusals_after :: ‹>\<^>k (‹
where ‹Ra P tr ≡ {ref. (tr, ref) ∈F P}›
‹ In the following, we link the process theory to the underlying
/domain theory of HOLCF by identifying the approximation ordering
HOLCF's pcpo's. ›
processptick :: (type, type) below
‹ declares approximation ordering $\_\sqsubseteq\_$ also written \verb+_ << _+. ›
le_approx_def : ‹P ⊑ Q ≡D Q ⊆D P ∧
(∀s. s ∉D P ⟶Ra P s = Ra Q s) ∧
min_elems (D P) ⊆T Q›
‹ The approximation ordering captures the fact that more concrete
should be more defined by ordering the divergence sets
. For defined positionsongrightarrow> s ∈
must coincide pointwise; moreover, the minimal elements
wrt.~prefix ordering on traces, i.e.~lists) must be contained in
trace set of the more concrete process.›
proc_ord2a : ‹P ⊑ Q ==> s ∉D P ==> (s, X) ∈F P ⟷ (s, X) ∈F Q›
by (auto simp: le_approx_def Refusals_after_def)
java.lang.NullPointerException
intro_classes
show ‹P ⊑
by (metis D_T elem_min_elems le_approx_def subsetI)
\open🚫
by (simp add: Process_eq_spec le_approx1 le_approx_lemma_F subset_antisym)
fix P Q R :: ‹('a, 'r) processptick›
assume ‹P ⊑ Q› and ‹Q ⊑ R›
show ‹P ⊑ R›
proof (unfold le_approx_def, intro conjI allI impI)
show ‹D R ⊆D P› by (meson ‹P ⊑ Q›‹Q ⊑ R› dual_order.trans le_approx1)
next
show ‹s ∉D P ==>
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "brackoff" is null
next
from ‹P ⊑ Q›[THEN le_approx1] ‹P ⊑ Q›[THEN le_approx3] ‹
show ‹min_elems (D
by (simp add: m
qed
thisp, we inheri quite a nnumber offacts from the under
theory, which comprises a library of facts such as \verb+chain+,
verb+directed+(sets), upper bounds and least upper bounds, etc. ›
lim_proc :: ‹('a, 'r) processptick›
is ‹
(unfold is_process_def FAILURES_def DIVERGENCES_def fst_conv snd_conv, intro conjI allI impI)
show ‹([], {}) ∈∩ (F ` range S)› by (simp add: is_processT)
show ‹((metis "1.prems"(2)) add_f1fini le_add1)
by (meson INT_iff UNIV_I image_eqI is_processT2)
show ‹(s @ t, {}) ∈∩ (F ` range S) ==>
(s, {}) ∈∩ (F ` range S)› for s t by (auto intro: is_processT3)
show ‹(s, Y) ∈∩ (F ` range S) ∧ X ⊆ Y ==> (s, X) ∈∩ (F ` range S)› for s X Y
by (metis (full_types) INT_iff is_processT4)
show ‹(s, X ∪ Y) ∈∩ (F ` range S)›open>S' ≡
if assm : ‹(s, X) ∈∩ (F ` range S) ∧
(∀c. c ∈ Y ⟶ (s @ [c], {}) ∉∩ (F ` range S))› for s X Y
proof (rule ccontr)
assume <>(
then obtain i where ‹(s, X ∪ Y) ∉F (S i)› by blast
moreover have ‹(s, X) ∈F (S j)› for j using assm by blast
ultimately obtain c where ‹c ∈ Y› and * : ‹(s @ [c], {}) ∈F (S i)›
using is_processT5 by blast
from ‹(s, X ∪ Y) ∉F (S i)› is_processT8 have ‹s ∉D (S i)› by blast
\<>c
from chain_lemma[OF ‹chain S›, of i j] "*" "**" show False
by (elim disjE; use ‹s ∉D (S i)› is_processT8 min_elems6 proc_ord2a in blast)
qed
show ‹(s @ [🍋(r)], {}) ∈∩ (F ` range S) ==>
(s, X - {🍋(r)}) ∈∩ (F ` range S)› for s r X by (simp add: is_processT6)
show ‹s ∈∩ (Dby simp add: INF_greatest INF_lowe INF_mo' S'_de equal)
s @ t ∈∩ (Dfinallysho \<>(
show ‹s ∈∩
by (simp add: is_processT8)
java.lang.NullPointerException
by (auto intro: is_processT9)
F_LUB: 🚫
.rep_q proces prod.sel(1)
D_LUB: ‹
by (metis Divergences.rep_eq lim_proc.rep_eq process_surj_pair prod.inject)
T_LUB: ‹T lim_proc = ∩ (T ` range S)›
by (insert F_LUB, auto simp add: T_def_spec) (meson F_T T_F)
LUB_projs = F_LUB D_LUB T_LUB
Refusals_LUB: ‹
by (auto simp add: Refusals_def_bis F_LUB)
Refusals_after_LUB: ‹Ra lim_proc s = (∩i. (Ra (S i) s))›
by (auto simp add: Refusals_after_def F_LUB)
F_LUB_2: ‹(s, X) ∈F lim_proc ⟷ (∀i. (s, X) ∈F (S i))›
and D_LUB_2: ‹t ∈D lim_proc ⟷ (∀i. t ∈D (S i))›
and T_LUB_2: ‹t ∈T lim_proc ⟷ (∀i. t ∈T (S i))›
and Refusals_LUB_2: ‹X ∈R lim_proc ⟷ (∀i. X ∈R (S i))›
and Refusals_after_LUB_2: ‹X ∈Ra lim_proc s ⟷ (∀i. X ∈Ra (S i) s)›
by (simp_all add: F_LUB D_LUB T_LUB Refusals_LUB Refusals_after_LUB)
‹By exiting the context, terms like ‹F lim_proc› will become term‹F (lim_proc S)›
and the assumption term‹chain S› will be added.›
‹ Process Refinement is a Partial Ordering›
‹ The following type instantiation declares the refinement order \_\le\_ $ written \verb+_ <= _+. It captures the intuition that more
processes should be more deterministic and more defined.›
processptick :: (type, type) ord
less_eq_processptick :: ‹('a, 'r) processptick==> ('a, 'r) processptick==> bool›
where ‹less_eq_processptick P Q ≡D Q ⊆D P ∧F Q ⊆F P›
less_processptick :: ‹('a, 'r) processptick==> ('a, 'r) processptick==> bool›
where ‹less_processptick P Q ≡ P ≤ Q ∧ P ≠ Q›
..
‹Note that this just another syntax to our standard process refinement order
defined in the theory Process. ›
le_ref1 : ‹P ≤ Q ==>D Q ⊆D P›
and le_ref2 : ‹P ≤ Q ==>F Q ⊆F P›
and le_ref2T : ‹P ≤ Q ==>T Q ⊆T P›
and le_approx_imp_le_ref: ‹(P::('a, 'r) processptick) ⊑ Q ==> P ≤ Q›
by (simp_all add: less_eq_processptick_def le_approx1 le_approx_lemma_F)
(use T_F_spec in blast)
F_subset_imp_T_subset : ‹F P ⊆F Q ==>T P ⊆T Q›
using T_F_spec by blast
D_extended_is_D : ‹{t @ u |t u. t ∈D P ∧ tF t ∧ ftF u} = D P›
by (auto simp add: is_processT7)
(metis D_imp_front_tickFree append.right_neutral butlast_snoc front_tickFree_append_iff
front_tickFree_charn is_processT9 nonTickFree_n_frontTickFree tickFree_Nil)
Process_eq_optimizedI : ‹[∧t. t ∈D P ==> t ∈D Q; ∧t. t ∈D Q ==> t ∈D P; ∧t X. (t, X) ∈F P ==> t ∉D P ==> t ∉D Q ==> (t, X) ∈F Q; ∧t X. (t, X) ∈F Q ==> t ∉D Q ==> t ∉D P ==> (t, X) ∈F P]==> P = Q›
by (simp add: Process_eq_spec_optimized, safe, auto intro: is_processT8)
processptick :: (type, type) order
by intro_classes (auto simp: less_eq_processptick_def less_processptick_def Process_eq_spec)
lim_proc_is_ub: ‹chain S ==> range S <| lim_proc S›
by (simp add: is_ub_def le_approx_def F_LUB D_LUB T_LUB Refusals_after_def)
(intro allI conjI, blast, use chain_lemma is_processT8 le_approx2 in blast,
use D_T chain_lemma le_approx2T le_approx_def in blast)
lim_proc_is_lub3a: ‹front_tickFree s ==> s ∉D P ==> t ∈D P ==>¬ t < s @ [c]›
by (auto simp: le_list_def less_list_def)
(metis butlast_append butlast_snoc front_tickFree_append_iff process_charn self_append_conv)
*)
lemma chain_min_elem_div_is_min_for_sequel: ‹chain S ==> s ∈ min_elems (D (S i)) ==> i ≤ j ==> s ∈D (S j) ==> s ∈ min_elems (D (S j))› by (metis elem_min_elems insert_absorb insert_subset le_approx1
min_elems5 min_elems_no po_class.chain_mono)
lemma limproc_is_lub: ‹range S <<| lim_proc S›if‹chain S› proof (unfold is_lub_def, intro conjI allI impI) show‹range S <| lim_proc S›by (simp add: lim_proc_is_ub ‹chain S›) next show‹lim_proc S ⊑ P›if‹range S <| P›for P proof (unfold le_approx_def, intro conjI allI impI subsetI) show‹s ∈D P ==> s ∈D (lim_proc S)›for s by (meson D_LUB_2 ‹chain S›‹range S <| P› is_ub_def le_approx1 rangeI subsetD) next show‹s ∉D (lim_proc S) ==>Ra (lim_proc S) s = Ra P s›for s by (metis ‹chain S›‹range S <| P› D_LUB_2 le_approx_def lim_proc_is_ub ub_rangeD) next fix s assume‹s ∈ min_elems (D (lim_proc S))› from elem_min_elems[OF this] have‹∀i. s ∈D (S i)› by (simp add: ‹chain S› D_LUB) have‹∃i. ∀j≥i. s ∈ min_elems (D (S j))› proof (rule ccontr) assume‹∄i. ∀j≥i. s ∈ min_elems (D (S j))› hence‹∀i. ∃j≥i. s ∉ min_elems (D (S j))›by simp with‹∀i. s ∈D (S i)› chain_min_elem_div_is_min_for_sequel ‹chain S› have‹∀j. s ∉ min_elems (D (S j))›by blast from‹s ∈ min_elems (D (lim_proc S))›‹∀i. s ∈D (S i)›show False by (cases s rule: rev_cases; simp add: min_elems_def D_LUB ‹chain S›)
(use Nil_min_elems ‹∀j. s ∉ min_elems (D (S j))›in blast,
metis (no_types, lifting) INT_iff ‹∀j. s ∉ min_elems (D (S j))› less_self min_elems3) qed thus‹s ∈T P›by (meson le_approx3 order.refl subset_eq ‹range S <| P› ub_rangeD) qed qed
lemma limproc_is_thelub: ‹chain S ==> (⊔i. S i) = lim_proc S› by (frule limproc_is_lub, frule po_class.lub_eqI, simp)
instance processptick :: (type, type) cpo by intro_classes (use limproc_is_lub in blast)
show‹∃x :: ('a, 'r) processptick. ∀ y. x ⊑ y› proof (intro exI allI) show‹bot ⊑ y›for y proof (unfold le_approx_def, intro conjI allI impI subsetI) show‹s ∈D y ==> s ∈D bot›for s by (simp add: D_bot D_imp_front_tickFree) next from F_imp_front_tickFree show‹s ∉D bot ==>Ra bot s = Ra y s›for s by (auto simp add: D_bot Refusals_after_def F_bot) next show‹s ∈ min_elems (D bot) ==> s ∈T y›for s by (simp add: D_bot min_elems_Collect_ftF_is_Nil) qed qed qed
section‹ Process Refinement is Admissible ›
lemma le_FD_adm : ‹cont (u :: ('b::cpo) ==> ('a, 'r) processptick) ==> monofun v ==> adm (λx. u x ≤ v x)› apply (unfold less_eq_processptick_def adm_def) apply (simp add: cont2contlubE D_LUB F_LUB ch2ch_cont limproc_is_thelub monofun_def) by (meson INF_greatest dual_order.trans is_ub_thelub le_approx1 le_approx_lemma_F)
section‹ The Conditional Statement is Continuous › text‹The conditional operator of CSP is obtained by a direct shallow embedding. Here we prove it continuous›
lemma if_then_else_cont[simp]: ‹[∧x. P x ==> cont (f x); ∧x. ¬ P x ==> cont (g x)]==>
cont (λy. if P x then f x y else g x y)› for f :: ‹'c ==> 'b :: cpo ==> ('a, 'r) processptick› by (auto simp: cont_def)
section‹Tools for proving continuity›
―‹The following result is very useful (especially for ProcOmata).›
lemma cont_process_rec: ‹P = (μ X. f X) ==> cont f ==> P = f P› by (simp add: def_cont_fix_eq)
lemma Inter_nonempty_finite_chained_sets: ‹(∩i. S i) ≠ {}› if‹∧i. j ≤ i ==> S i ≠ {}›‹finite (S j)›‹∧i. S (Suc i) ⊆ S i›for S :: ‹nat ==> 'a set› proof - have * : ‹∀i. S i ≠ {} ==> finite (S 0) ==>∀i. S (Suc i) ⊆ S i ==> (∩i. S i) ≠ {}› for S :: ‹nat ==> 'a set› proof (induct ‹card (S 0)› arbitrary: S rule: nat_less_induct) case1 show ?case proof (cases ‹∀i. S i = S 0›) case True thus ?thesis by (metis "1.prems"(1) INT_iff ex_in_conv) next case False have f1: ‹i ≤ j ==> S j ⊆ S i›for i j by (simp add: "1.prems"(3) lift_Suc_antimono_le) with False obtain j m where f2: ‹m < card (S 0)›and f3: ‹m = card (S j)› by (metis "1.prems"(2) psubsetI psubset_card_mono zero_le) define T where‹T i ≡ S (i + j)›for i have f4: ‹m = card (T 0)›unfolding T_def by (simp add: f3) from f1 have f5: ‹(∩i. S i) = (∩i. T i)›unfolding T_def by (auto intro: le_add1) show ?thesis apply (subst f5) apply (rule "1.hyps"[rule_format, OF f2, of T, OF f4], unfold T_def) by (simp_all add: "1.prems"(1, 3) lift_Suc_antimono_le)
(metis "1.prems"(2) add_0 f1 finite_subset le_add1) qed qed define S' where‹S' i ≡ S (j + i)›for i have‹∀i. S' i ≠ {}›by (simp add: S'_def‹∧i. j ≤ i ==> S i ≠ {}›) moreoverhave‹finite (S' 0)›by (simp add: ‹S' ≡ λi. S (j + i)›‹finite (S j)›) moreoverhave‹∀i. S' (Suc i) ⊆ S' i›by (simp add: S'_def‹∧i. S (Suc i) ⊆ S i›) ultimatelyhave‹(∩i. S' i) ≠ {}›by (fact "*") alsofrom lift_Suc_antimono_le[where f = S, OF ‹∧i. S (Suc i) ⊆ S i›] have‹(∩i. S' i) = (∩i. S i)› by (simp add: INF_greatest INF_lower INF_mono' S'_def equalityI) finallyshow‹(∩i. S i) ≠ {}› . qed
method prove_finite_subset_of_prefixes for t :: ‹('a, 'r) traceptick› = ―‹Useful for establishing the second hypothesis›
solves ‹(rule finite_UnI; prove_finite_subset_of_prefixes t) |
(rule finite_subset[of _ ‹{u. u ≤ t}›],
use prefixI in blast, simp add: prefixes_fin)›
(*<*) 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.85Bemerkung:
¤
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.