Theory CIMP_one_place_buffer
theory CIMP_one_place_buffer
imports
"../CIMP"
begin
section‹Example: a one-place buffer \label{sec:one_place_buffer}›
text‹
To demonstrate the CIMP reasoning infrastructure, we treat the trivial
one-place buffer example of \<^citet>‹‹\S3.3› in "DBLP:journals/toplas/LamportS84"›. Note that the
semantics for our language is different to \<^cite>‹"DBLP:journals/toplas/LamportS84" using "citeauthor"›'s, who
treated a historical variant of CSP (i.e., not the one in \<^cite>‹"Hoare:1985"›).
We introduce some syntax for fixed-topology (static channel-based)
scenarios.
›
abbreviation
rcv_syn :: "'location ⇒ 'channel ⇒ ('val ⇒ 'state ⇒ 'state)
⇒ (unit, 'location, 'channel × 'val, 'state) com" ("⦃_⦄/ _▹_" [0,0,81] 81)
where
"⦃l⦄ ch▹f ≡ ⦃l⦄ Response (λq s. if fst q = ch then {(f (snd q) s, ())} else {})"
abbreviation
snd_syn :: "'location ⇒ 'channel ⇒ ('state ⇒ 'val)
⇒ (unit, 'location, 'channel × 'val, 'state) com" ("⦃_⦄/ _◃_" [0,0,81] 81)
where
"⦃l⦄ ch◃f ≡ ⦃l⦄ Request (λs. (ch, f s)) (λans s. {s})"
text‹
These definitions largely follow \<^citet>‹"DBLP:journals/toplas/LamportS84"›. We have three processes
communicating over two channels. We enumerate program locations.
›
datatype ex_chname = ξ12 | ξ23
type_synonym ex_val = nat
type_synonym ex_ch = "ex_chname × ex_val"