\section{Related Work and Conclusion}
\label{sec:conclusion}

In this section we discuss some of the related work,
with an emphasis on theoretical studies related to
\scribble, and conclude with further topics.

\PARA{Process Algebra.} 
Process algebras, such as ACP \cite{Baeton:book},
%  CCS
% \cite{MilnerR:comc} (from which the $\pi$-calculus
% \cite{MilnerR:calmp1} was born) and
CSP \cite{Hoare1978,HoareC:ComSP} and $\pi$-calculus
\cite{MilnerR:calmp1} 
(which extends CCS \cite{MilnerR:comc}),
present a semantic framework where interactional
behaviour of software systems can be captured on a
rigorous mathematical basis through a small set of
operators for constructing processes.  The fruits from
the studies on these and other models
of concurrency form an essential  engineering foundation
of {\scribble}. For example,
behavioural equivalences such as bisimulations, a
linchpin of theories of process algebras, offer the
mathematical basis of key engineering activities such
as optimisations, security, correctness of compiler,
correctness of runtime, and various semi-automatic
verifications.

\PARA{Session Types and Other Description Frameworks.}

Session types \cite{THK,honda.vasconcelos.kubo:language-primitives}
have been studied over the last decade as a typed foundation for
structured communication-centred programming using various programming
languages and process calculi.  The original binary session types have
been generalised to {\em multiparty session types}~\cite{HYC08}, in
order to guarantee stronger conformance to stipulated session
structures when a protocol involves more than two parties (see also
\cite{BC07} for a related and independent work).  Theories of
multiparty session types~\cite{HYC08,BettiniCDLDY08} give the
foundations of {\scribble}, together with their semantic basis given
by the $\pi$-calculus.  Validation and other algorithms from their
studies are used as the core elements of its tool chain.

Since \cite{HYC08}, the theory of multiparty session
types has been extended in different directions,
including a theory which ensures the progress property
for interleaved multiparty sessions
\cite{BettiniCDLDY08} (which also gave the formal
basis of the {\scribble}'s syntax); generalised type
structures which allow communication optimisation
through permutation
\cite{mostrous_yoshida_honda_esop09}; and a static
analysis for communication buffer overflows
\cite{Bufferfull}.
%%%
The existing notations for describing protocols include message
sequence charts \cite{MSC,BroyKrugerMeisinger2007} and UML sequence
diagrams \cite{UML} (the latter when method calls are replaced by
asynchronous signals). These notations are different in that they are
not based on the abstraction of protocols as type signatures. Protocol
descriptions from a different viewpoint are studied in \cite{FX},
where one stipulates possible communication events among endpoints
using a logic of commitment. WS-CDL \cite{CDL} (discussed in Section
2) is one of the first expressive languages which allow description of
interactions from a global viewpoint.  WS-CDL is also a basis of the
preceding validation tool by one of the authors (G.B.), pi4soa
\cite{pi4soa}, on whose experience the design of the \scribble-based
development environment is being carried out. A theoretical inquiry
on WS-CDL~\cite{CDLa,carbone.honda.yoshida:esop07} is one of the key
inspirations to \cite{HYC08}.  In comparison with these notations,
the multiparty generalisation of
session types offer, for the first time, a framework of protocol
descriptions where they are formally captured as type signature,
together with a notion of type conformance through formal projection
to endpoints.

Recently the theory of multiparty session types has
been applied in different contexts, including protocol
optimisation for distributed
objects~\cite{SivaramakrishnanNZE10}; integrity of
session interactions~\cite{CorinDFBL09,ccdr10};
type-safe asynchronous event programming~\cite{event};
safe and efficient parallel
programming~\cite{Ng10,yoshida.denielou.bejleri.hu10};
multicore programming \cite{YoshidaVPH08}; and medical
guidelines~\cite{NYH09}. Many of these studies are
inspired by and/or inspire our industrial
collaborations.

\PARA{Communication-Centred Programming Languages and \scribble.} 

Occam-Pi \cite{WelchBarnes04} is a highly efficient
systems-level concurrent programming language centring on
synchronous communication channels, based on CSP and
the $\pi$-calculus.  Hewitt's Actor
Model~\cite{AghaActors} is an influential programming 
model centring on asynchronous unordered message
passing.  Erlang \cite{Erlang} is a
communication-centred programming language with
emphasis on reliability based on actors. 
%% Go \cite{Go} is a
%% language developed by Bob Pike and others,  
%% intended for 
{\scribble} differs from these languages 
in that it is a protocol description language rather than
a programming language, with
formal foundations coming from the $\pi$-calculus and
session types, intended to be used 
across multiple programming languages
through different stages of software development.

% While the transport characteristics we
% currently assume (cf.~Section 3) is order-preserving
% asynchrony for in-session communications and
% order-non-preserving asynchrony across sessions (which
% may be relevant in many execution environments), the
% framework is extensible to other transport modes.
% Components in a distributed application may well be
% implemented with multiple languages: {\scribble} aims
% to offer an engineering basis for such applications,
% with clear engineering merits and formal foundations
% coming from the $\pi$-calculus and session types.

\PARA{Further Topics.}

To realise the full potential of the proposed approach
in general and {\scribble} in particular, the
incorporation of several recent advances of the theory
of session types into the description language would
be relevant. First, {\scribble} can be extended to the
type-safe multiparty session exceptions recently
developed in \cite{CGY10}, in order to handle system
failure and fault-tolerance in a larger class of
distributed protocols, preserving type safety.  The
incorporation of the parametrised dependent type
theory from \cite{yoshida.denielou.bejleri.hu10}
enables us to directly express more complex
communication topologies.  More recently, we studied a
dynamic multirole session type in \cite{DY11} where an
arbitrary number of participants can dynamically join
and leave an active session under a given role.  This
solved an open problem in the theory of multiparty
session types, providing a new framework to handle
common distributed communication patterns such as
publisher-subscriber or P2P and chat protocols within
the theory.  The notion of the role with dynamic join
capabilities in \cite{DY11} was motivated by
{\scribble} and protocol descriptions in it,
demonstrating an interaction between practice centring
on {\scribble} and academia brings a new theory which
can be used to enrich type structures of {\scribble}.
Another significant extension of the theory of
multiparty session types, again motivated by a
dialogue with practice, is our recent work
\cite{BHTY10} on an assertion framework built on
session types. The incorporation of the
assertion-based framework will enrich the
expressiveness of {\scribble} as a tool for
description by enabling the specification of
fine-grained constraints.  The framework generalises
the traditional Design-by-Contract, offering a refined
modular development framework for distributed
communicating processes based on multiparty
behavioural contracts.

%%%% 
%% How and where to put this.
%%%%
% One of the areas that Scribble will be used is in the
% context of a new methodology called Testable
% Architecture, as implemented in the Savara
% project[1]. Testable Architecture is concerned with
% ensuring that all artifacts, defined throughout the
% software development lifecycle, can be verified to
% ensure that they are valid in respect of artifacts
% defined in preceding stages. Ultimately this means
% that a deployed system can be show to meet the
% original requirements."
% [1] www.savara.org The SAVARA project provides tools
% to support the Testable Architecture methodology using
% Scribble to validate the behavioural aspects of a
% system.

% through the projection of global types to
% each endpoint, analogous to the notion of APIs in
% object-oriented languages. As we briefly discussed in
% Section 5, 

% Design-by-Contract gives the same to the type
% signatures for objects. 

%%%% 
%% How and where to put this.
%%%%
% "One of the areas that Scribble will be used is in the
% context of a new methodology called Testable
% Architecture, as implemented in the Savara
% project[1]. Testable Architecture is concerned with
% ensuring that all artifacts, defined throughout the
% software development lifecycle, can be verified to
% ensure that they are valid in respect of artifacts
% defined in preceding stages. Ultimately this means
% that a deployed system can be show to meet the
% original requirements."
% [1] www.savara.org The SAVARA project provides tools to support the
% Testable Architecture methodology using Scribble to validate the
% behavioural aspects of a system.



%% As a foundation for structuring communication-centred
%% distributed software, session types
%% \cite{THK,honda.vasconcelos.kubo:language-primitives}
%% have been studied over the last decade in a wide
%% range of programming languages and process calculi.
%% The original binary session types have been
%% generalised to {\em multiparty session
%%   types}~\cite{HYC08} in order to guarantee stronger
%% conformance to stipulated session structures when a
%% protocol involves more than two parties.
%% %% The central idea is the {\em
%% %%  global types}, which can describe multiparty protocols from a
%% %% global viewpoint; these global protocols are then projected to end-point
%% %% types against which programs can be efficiently
%% %% type-checked,  
%% %% offering an effective methodology for programming
%% %% multiparty interactions in distributed environments. 
%% This idea has been reflected to the design of
%% {\scribble} and validation and other algorithms are
%% being used as the core elements of its toolchain.

%% Since the first work \cite{HYC08} was proposed, the
%% theory of multiparty session types has been developed
%% in process calculi, in order to provide a progress
%% for interleaved multiparty sessions
%% \cite{BettiniCDLDY08}, messaging optimisation
%% \cite{mostrous_yoshida_honda_esop09} and a static
%% analysis for communication buffer overflows
%% \cite{Bufferfull}. While the diagrams for describing
%% protocols do exist in the forms of message sequence
%% charts (MSC) \cite{MSC}
%% and UML sequence diagrams \cite{UML} (the latter when
%% method calls are replaced by asynchronous signals),
%% these notations do not have a clear abstraction unit
%% and its abstraction as a type signature.  Multiparty
%% generalisation of session types offer, for the first
%% time, a framework of protocol descriptions where
%% they are abstracted as type signature, together with
%% a notion of type conformance through formal projection
%% to endpoints.

%% The theory of multiparty session types has been
%% applied in several different contexts such as
%% protocol optimisation for distributed
%% objects~\cite{SivaramakrishnanNZE10},
%% security~\cite{CorinDFBL09,ccdr10}, design by
%% contract~\cite{BHTY10}, parallel
%% programming~\cite{Ng10,yoshida.denielou.bejleri.hu10},
%% multicore programming \cite{YoshidaVPH08} and medical
%% guidelines~\cite{NYH09}. Many of these studies are
%% inspited and/or inspire industrial collaborations, as
%% recorded in this paper.

%% To realise the full potential of session types
%% in \scribble, several recent advances from the
%% theory are relevant. First, {\scribble} can
%% be extended to the multiparty session exceptions
%% recently developed in \cite{CGY10}, in order to
%% handle system failure and fault-tolerance in a larger
%% class of distributed protocols, preserving type
%% safety.  Incoporation with the parameterised
%% dependent type theory from
%% \cite{yoshida.denielou.bejleri.hu10} enables us to
%% directly express more complex communication
%% topologies. Recently we proposed a dynamic multirole
%% session type in \cite{DY11} where an arbitrary number
%% of participants can dynamically join and leave an
%% active session under a given role.  This solved an
%% open problem in the previous multiparty session
%% theory, providing a new framework to handle common
%% distributed communication patterns such as
%% publisher-subscriber or P2P and chat protocols.  The
%% notion of the role in \cite{DY11} was motivated by
%% {\scribble}, which demonstrates an interaction between
%% practice centring on {\scribble} and academia brings
%% a new theory which can be used to enrich type
%% structures of {\scribble}.

%% %%%% 
%% %% How and where to put this.
%% %%%%
%% % One of the areas that Scribble will be used is in the
%% % context of a new methodology called Testable
%% % Architecture, as implemented in the Savara
%% % project[1]. Testable Architecture is concerned with
%% % ensuring that all artifacts, defined throughout the
%% % software development lifecycle, can be verified to
%% % ensure that they are valid in respect of artifacts
%% % defined in preceding stages. Ultimately this means
%% % that a deployed system can be show to meet the
%% % original requirements."
%% % [1] www.savara.org The SAVARA project provides tools
%% % to support the Testable Architecture methodology using
%% % Scribble to validate the behavioural aspects of a
%% % system.

%% %%%% 
%% %% How and where to put this.
%% %%%%
%% % "One of the areas that Scribble will be used is in the
%% % context of a new methodology called Testable
%% % Architecture, as implemented in the Savara
%% % project[1]. Testable Architecture is concerned with
%% % ensuring that all artifacts, defined throughout the
%% % software development lifecycle, can be verified to
%% % ensure that they are valid in respect of artifacts
%% % defined in preceding stages. Ultimately this means
%% % that a deployed system can be show to meet the
%% % original requirements."
%% % [1] www.savara.org The SAVARA project provides tools to support the
%% % Testable Architecture methodology using Scribble to validate the
%% % behavioural aspects of a system.

