Theory utp_concurrency
section ‹ Concurrent Programming ›
theory utp_concurrency
  imports
    utp_hoare
    utp_rel
    utp_tactics
    utp_theory
begin
text ‹ In this theory we describe the UTP scheme for concurrency, \emph{parallel-by-merge},
  which provides a general parallel operator parametrised by a ``merge predicate'' that explains
  how to merge the after states of the composed predicates. It can thus be applied to many languages
  and concurrency schemes, with this theory providing a number of generic laws. The operator is
  explained in more detail in Chapter 7 of the UTP book~\<^cite>‹"Hoare&98"›. ›
  
subsection ‹ Variable Renamings ›
text ‹ In parallel-by-merge constructions, a merge predicate defines the behaviour following execution of
  of parallel processes, $P \parallel Q$, as a relation that merges the output of $P$ and $Q$. In order 
  to achieve this we need to separate the variable values output from $P$ and $Q$, and in addition the 
  variable values before execution. The following three constructs do these separations. The initial
  state-space before execution is @{typ "'α"}, the final state-space after the first parallel process
  is @{typ "'β⇩0"}, and the final state-space for the second is @{typ "'β⇩1"}. These three functions
  lift variables on these three state-spaces, respectively.
›