%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\ENCan}[1]{\langle #1 \rangle}

% Newtheorem
\newtheorem{DUM}{dummy}[section]{}{}
\newtheorem{DEF}[DUM]{Definition}{}{}
\newtheorem{EX}[DUM]{Example}{}{}
\newtheorem{COM}[DUM]{Comment}{\rmfamily}{\rmfamily}
\newtheorem{THM}[DUM]{Theorem}{}{}
\newtheorem{LEM}[DUM]{Lemma}{}{}
\newtheorem{PROP}[DUM]{Proposition}{}{}
\newtheorem{COR}[DUM]{Corollary}{}{}
\newtheorem{REM}[DUM]{Remark}{}{}
\newtheorem{CON}[DUM]{Conventions}{}{}

%% \spnewtheorem{DUM}{dummy}[section]{\bfseries}{\rmfamily}
%% \spnewtheorem{DEF}{Definition}[DUM]{\bfseries}{\rmfamily}
%% \spnewtheorem{THM}{Theorem}[DUM]{\bfseries}{\itshape}
%% \spnewtheorem{LEM}{Lemma}[DUM]{\bfseries}{\itshape}
%% \spnewtheorem{PROP}{Proposition}[DUM]{\bfseries}{\itshape}
%% \spnewtheorem{COR}{Corollary}[DUM]{\bfseries}{\itshape}
%% \spnewtheorem{REM}{Remark}[DUM]{\bfseries}{\rmfamily}
%% \spnewtheorem{CON}{Convention}[DUM]{\bfseries}{\rmfamily}

%% \newtheorem{THM}[DUM]{Theorem}{}{}
%% \newtheorem{LEM}[DUM]{Lemma}{}{}
%% \newtheorem{PROP}[DUM]{Proposition}{}{}
%% \newtheorem{COR}[DUM]{Corollary}{}{}
%% \newtheorem{EX}[DUM]{Example}{}{}
%% \newtheorem{REM}[DUM]{Remark}{}{}
%% \newtheorem{CON}[DUM]{Conventions}{}{}


%\newcommand{\Paragraph}[1]{\noindent\textbf{#1.}}

% New Environments

\newenvironment{myfiguretwo}{\begin{figure*}}{\end{figure*}}
\newenvironment{mytabletwo}{\begin{table*}}{\end{table*}}

\newenvironment{myfigure}{
  \begin{figure}
%   \centering
  }{
  \end{figure}
}

%\newenvironment{proof}{\textit{Proof.}}{\hfill$\Box$\\ }
%\newenvironment{ITEML}{\begin{enumerate}}{\end{enumerate}}
% \newcounter{analphabet}
\newenvironment{ITEML}%
{\rm%
 \begin{list}%
 {$\bullet$}%
 {\addtolength{\labelwidth}{5mm}% 
  \addtolength{\leftmargin}{-2mm}%
  \setlength{\rightmargin}{0pt}%
  \setlength{\itemsep}{1mm}%
  \setlength{\parsep}{1pt}}}%
 {\end{list}}

\newenvironment{ITEMLL}%
{\rm%
 \begin{list}%
 {$\bullet$}%
 {\addtolength{\labelwidth}{7mm}% 
  \addtolength{\leftmargin}{2mm}%
  \setlength{\rightmargin}{0pt}%
  \setlength{\itemsep}{1mm}%
  \setlength{\parsep}{1pt}}}%
 {\end{list}}

\newenvironment{ITEM}%
{\rm%
 \begin{list}%
 {$\bullet$}%
 {\addtolength{\labelwidth}{5mm}% 
  \addtolength{\leftmargin}{-2mm}%
  \setlength{\rightmargin}{0pt}%
  \setlength{\itemsep}{1mm}%
  \setlength{\parsep}{1pt}}}%
 {\end{list}}

% Shortcuts
\newcommand{\NI}{\noindent}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SYNTAX

% Keywords
%%\newcommand{\keyword}[1]{\textsf{\upshape\small #1}\xspace}
\newcommand{\AOUTPUT}[2]{\overline{#1}\ENCan{#2}}
\newcommand{\ifthenelse}[3]{\ifk\ #1\ \thenk\ #2\ \elsek\ #3}
\newcommand{\VECw}{\widetilde}
\newcommand{\NULL}{\varepsilon}
\newcommand{\keyword}[1]{\textsf{\upshape #1}}
\newcommand{\defk}{\keyword{def}}
\newcommand{\ink}{\keyword{in}}
\newcommand{\andk}{\keyword{and}}
\newcommand{\ork}{\keyword{or}}
\newcommand{\truek}{\keyword{true}}
\newcommand{\falsek}{\keyword{false}}
\newcommand{\acceptk}{\keyword{accept}}
\newcommand{\requestk}{\keyword{request}}
\newcommand{\ifk}{\keyword{if}}
\newcommand{\thenk}{\keyword{then}}
\newcommand{\elsek}{\keyword{else}}
% \newcommand{\throwk}{\keyword{throw}}
% \newcommand{\catchk}{\keyword{catch}}
\newcommand{\notk}{\keyword{not}}
% Symbols
\newcommand{\BBAR}{[\!]}         % Branch BAR
\newcommand{\PAR}{\mid}

\newcommand{\INFER}[2]{\frac{\displaystyle{#1}%
\vspace{2mm}%
}{
\vspace{2mm}%
\displaystyle{#2}
}}

% Process Constructors
\newcommand{\participant}[1]{\mathtt{#1}}

\newcommand{\BUFFER}[2]{#1\!:\! #2}
%\newcommand{\TBUFFER}[3]{#1\mbox{\small $\hookrightarrow$} #2\!:\! #3}
\newcommand{\TBUFFER}[3]{\ASET{#1,#2}\!:\! #3}
\newcommand{\INACT}{\mathbf 0}
\newcommand{\ACCEPT}[2]{#1(#2). }
\newcommand{\MACCEPT}[3]{#1{\mbox{\scriptsize [$\participant{#2}$]}\,}(\VEC{#3}). }
\newcommand{\REP}[2]{\repk\ #1(#2)\ \ink\ }
\newcommand{\MREQUEST}[2]{\overline{#1}{\mbox{\scriptsize [$\participant{2..n}$]}\,}(\VEC{#2}). }

\newcommand{\MREQ}[3]{\overline{#1}{\mbox{\scriptsize [$\participant{#2}$]}\,}({#3}). }
\newcommand{\MACC}[3]{#1{\mbox{\scriptsize [$\participant{#2}$]}\,}({#3}). }

\newcommand{\REQUEST}[2]{#1(#2); }
\newcommand{\SEND}[2]{#1 ! \ENCan{\VEC{#2}};}
\newcommand{\SENDnovec}[2]{#1 ! \ENCan{{#2}};}
\newcommand{\MSEND}[2]{\ASET{#1_i}_{i\in I} ! \ENCan{\VEC{#2}};}
\newcommand{\RECEIVE}[2]{#1 ? (\VEC{#2}); }
\newcommand{\RECnovec}[2]{#1\! ? ({#2}); }
\newcommand{\SEL}[2]{#1 \lhd #2;}
\newcommand{\MSEL}[2]{\ASET{#1_i}_{i\in I} \lhd #2;}
\newcommand{\BRANCH}[4]{{#1}\rhd\{{#2}\colon{#3}\}_{#4}} % short version
%\newcommand{\BRANCH}[5]{#1 \rhd \{ #2 : #3 \BBAR\cdots\BBAR #4 : #5 \}}
\newcommand{\BRANCHL}[5]{{#1}\rhd\{{#2}\colon{#3},\dots,{#4}\colon{#5}\}} 
% long version
\newcommand{\IF}[2]{\ifk\ #1\ \thenk\ #2\ \elsek\ }
\newcommand{\new}{{\boldsymbol\nu}}
\newcommand{\NR}[1]{(\new\, #1)}
\newcommand{\DEFF}[3]{\defk\ #1(#2)=#3\ \ink\ }
\newcommand{\MTHROW}[2]{\ASET{#1}_{i\in I}!\langle\!\!\langle \VEC{#2} \rangle \!\! \rangle;}
\newcommand{\THROW}[2]{#1!\langle\!\!\langle \VEC{#2} \rangle \!\! \rangle;}
\newcommand{\CATCH}[2]{#1?(\!\!(\VEC{#2})\!\!);}
\newcommand{\THROWs}[2]{#1!\langle\!\!\langle #2 \rangle \!\! \rangle;}
\newcommand{\CATCHs}[2]{#1?(\!\!(#2)\!\!);}
\newcommand{\VAR}[2]{#1\ENCan{#2}}

\newcommand{\BRANCHa}[3]{{#1}\rhd{#2}\colon{#3}}
\newcommand{\BRANCHb}[5]{{#1}\rhd\{{#2}\colon{#3}{\,},\quad{#4}\colon{#5}\}}
% Standard Processes
\newcommand{\typevar}{\mathbf{t}}
\newcommand{\acceptp}{\ACCEPT asP}
\newcommand{\acceptq}{\ACCEPT asQ}
\newcommand{\macceptp}{\MACCEPT{a}{p}{s}{P}}
\newcommand{\macceptq}{\MACCEPT{a}{p}{s}{Q}}
\newcommand{\requestp}{\REQUEST axP}
\newcommand{\requestq}{\REQUEST ayQ}
\newcommand{\mrequestp}{\MREQUEST{a}{s}{P}}
\newcommand{\mrequestq}{\MREQUEST{a}{s}{Q}}
\newcommand{\sendp}{\SEND seP}
\newcommand{\sendq}{\SEND seQ}
\newcommand{\msendp}{\MSEND seP}
\newcommand{\msendq}{\MSEND seQ}
\newcommand{\receivep}{\RECEIVE sxP}
\newcommand{\receiveq}{\RECEIVE syQ}
\newcommand{\catchp}{\CATCH{s}{s}{P}}
\newcommand{\catchq}{\CATCH{s}{s}{Q}}
\newcommand{\mthrowp}{\MTHROW{s}{s}{P}}
\newcommand{\mthrowq}{\MTHROW{s}{s}{Q}}
\newcommand{\throwp}{\THROW{s}{s}{P}}
\newcommand{\throwq}{\THROW{s}{s}{Q}}
\newcommand{\selp}{\SEL slP}
\newcommand{\selq}{\SEL slQ}
\newcommand{\mselp}{\MSEL slP}
\newcommand{\mselq}{\MSEL slQ}
\newcommand{\branchp}{\BRANCH{s}{l_i}{P_i}{i\in I}}    % short version
\newcommand{\branchq}{\BRANCH{s}{l_i}{Q_i}{i\in I}}    % short version
\newcommand{\branchpl}{\BRANCHL{s}{l_1}{P_1}{l_n}{P_n}}
\newcommand{\ifp}{\IF ePQ}
\newcommand{\parp}{P_1\PAR P_2}
\newcommand{\resp}{\NR nP}               % REStriction Process
\newcommand{\nresp}{\NR aP}              % Name REStriction Process
\newcommand{\cresp}{\NR sP}              % Channel REStriction Process
\newcommand{\dresp}{\NR{kk}P}              % Double channel REStriction Process
\newcommand{\defsp}{\{X_i({\tilde x_i}{\tilde s_i})=P_i\}_{i\in I}}
\newcommand{\defp}{\defk\ D\ \ink\ P}
\newcommand{\defpl}{\defk\ \defsp\ \ink\ P}      % long version
\newcommand{\varp}{\VAR X{\tilde e\tilde s}}

% Variables over process abstractions
\newcommand{\varname}[1]{\keyword{#1}}
\newcommand{\factv}{\varname{Fact}}
\newcommand{\cellv}{\varname{Cell}}
\newcommand{\atmv}{\varname{ATM}}
\newcommand{\ftpdv}{\varname{Ftpd}}
\newcommand{\ftpthreadv}{\varname{FtpThread}}
\newcommand{\actionsv}{\varname{Actions}}
\newcommand{\initv}{\varname{Init}}
\newcommand{\serverv}{\varname{Server}}

% Names in programs
\newcommand{\name}[1]{{\tt #1}}
\def\amountn{\name{amt}}
\def\idn{\name{id}}
\def\myidn{\name{myId}}
\def\filen{\name{file}}
\def\usern{\name{userid}}
\def\passwdn{\name{passwd}}
\def\nisn{\name{nis}}
\def\pidn{\name{pid}}
\def\useridn{\name{userid}}
\def\idn{\name{id}}
\def\idn{\name{id}}

% Labels
\def\Label#1{\texttt{#1}}
\def\readl{\Label{read}}
\def\writel{\Label{write}}
\def\depositl{\Label{deposit}}
\def\withdrawl{\Label{withdraw}}
\def\balancel{\Label{balance}}
\def\okl{\Label{ok}}
\def\overdraftl{\Label{overdraft}}
\def\writel{\Label{write}}
\def\dispensel{\Label{dispense}}
\def\sorryl{\Label{sorry}}
\def\successl{\Label{success}}
\def\failurel{\Label{failure}}
\def\putl{\Label{put}}
\def\getl{\Label{get}}
\def\byel{\Label{bye}}
\def\checkuserl{\Label{checkUser}}
\def\invalidl{\Label{invalid}}
\def\validl{\Label{valid}}
\def\welcomel{\Label{welcome}}
\def\writel{\Label{write}}
\def\vall{\Label{val}}
\def\quitl{\Label{quit}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SEMANTICS

% Reduction
\newcommand{\osred}{\rightarrow}                % one-step reduction relation
\newcommand{\R}{\osred}
\newcommand{\Rlarge}{\ \osred\ }
\newcommand{\msred}{\osred^\ast}     % multi-step reduction
\newcommand{\RR}{\msred}

% Substitution
\newcommand{\subs}[2]{[{#1}/{#2}]}
%\newcommand{\subsv}[2]{\{{#1}\mapsto{#2}\}}
%\newcommand{\operatorname}{\mathsf}
% Operators
%\newcommand{\fn}{\operatorname{fn}}      % Free Names
\newcommand{\fs}{\operatorname{fs}}      % Free Session Channels
\newcommand{\fsi}{\operatorname{fsi}}      % Free Session Index 
\newcommand{\fpv}{\operatorname{fpv}}    % Free Process-Variables
\newcommand{\fn}{\operatorname{fn}}      % Free shared/session channels
\newcommand{\dv}{\operatorname{dpv}}    % Process variables introduced in declarations
\newcommand{\dom}{\operatorname{dom}}



% Rule Names
\newcommand{\rulename}[1]{[\text{\sc #1}]\xspace}
% type system
\newcommand{\nameir}{\rulename{Name}}
\newcommand{\varir}{\rulename{VarI}}
\newcommand{\natr}{\rulename{Nat}}
\newcommand{\boolr}{\rulename{Bool}}
\newcommand{\orr}{\rulename{Or}}
\newcommand{\accr}{\rulename{Acc}}
\newcommand{\reqr}{\rulename{Req}}
\newcommand{\sendr}{\rulename{Send}}
\newcommand{\getr}{\rulename{Recv}}
\newcommand{\recvr}{\rulename{Rcv}}
\newcommand{\branchr}{\rulename{Branch}}
\newcommand{\selr}{\rulename{Sel}}
\newcommand{\throwr}{\rulename{Deleg}}
\newcommand{\catchr}{\rulename{SRec}}
\newcommand{\nresr}{\rulename{NRes}}
\newcommand{\cresr}{\rulename{CRes}}
\newcommand{\subsr}{\rulename{Subs}}
\newcommand{\cresdr}{\rulename{CResD}}
\newcommand{\cresndr}{\rulename{CResD'}}
\newcommand{\recr}{\rulename{Rec}}
\newcommand{\recurr}{\rulename{Rec}}
\newcommand{\botr}{\rulename{Bot}}
%\newcommand{\nweakr}{\rulename{NWeak}}
%\newcommand{\cweakr}{\rulename{CWeak}}
%\newcommand{\vweakr}{\rulename{VWeak}}
%\newcommand{\mover}{\rulename{Move}}
\newcommand{\inactr}{\rulename{Inact}}
\newcommand{\concr}{\rulename{Conc}} % Typing rule
\newcommand{\concdr}{\rulename{ConcD}} % Typing rule
\newcommand{\varr}{\rulename{Var}}
\newcommand{\defr}{\rulename{Def}}
\newcommand{\definr}{\rulename{Defin}}
\newcommand{\ifr}{\rulename{If}}
% reduction
\newcommand{\linkr}{\rulename{Link}}
\def\qnilr{\rulename{Qnil}}
\def\qvalr{\rulename{Qval}}
\def\qsessr{\rulename{Qsess}}
\def\qselr{\rulename{Qsel}}
\def\qvaldqr{\rulename{Qvaldq}}
\def\qsessdqr{\rulename{Qsessdq}}
\def\qseldqr{\rulename{Qseldq}}
\def\mcastr{\rulename{Mcast}}
\def\macceptr{\rulename{Macc}}
\newcommand{\linkdr}{\rulename{LinkD}}
\newcommand{\comr}{\rulename{Com}}
\newcommand{\comdr}{\rulename{ComD}}
\newcommand{\labelr}{\rulename{Label}}
\newcommand{\labeldr}{\rulename{LabelD}}
\newcommand{\scopr}{\rulename{Scop}}
% \newcommand{\cscopr}{\rulename{CScop}}
% \newcommand{\cscopdr}{\rulename{CScopD}}
\newcommand{\condtr}{\rulename{IfT}}   % Cond-then
\newcommand{\conder}{\rulename{IfF}}   % Cond-else
\newcommand{\parr}{\rulename{Par}}	% Reduction rule
\newcommand{\strr}{\rulename{Str}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TYPES

% Symbols
\newcommand{\bottom}{\perp}
\newcommand{\branch}{\&}
%\newcommand{\sel}{\,\oplus\,}
\newcommand{\sel}{\oplus}

% Type Constructors
\newcommand{\typeconst}[1]{\keyword{#1}}
\newcommand{\nat}{\typeconst{nat}}
\newcommand{\bool}{\typeconst{bool}}
\newcommand{\End}{\typeconst{end}}
\newcommand{\aset}[1]{\langle{#1}\rangle}
\def\recv#1{?\,\ENCan{#1}}
\def\send#1{!\,\ENCan{#1}}
\def\throw#1{!\,\ENCan{#1}}
\def\catch#1{?\,\ENCan{#1}}
\newcommand{\asett}{\aset T}

% Global types
\newcommand{\TO}[2]{\participant{#1}\to\participant{#2}}
\newcommand{\TAT}[2]{#1\,{\mbox{\small @\,$\participant{#2}$}}}
%\newcommand{\GINIT}[3]{\TO{#1}{\ASET{#2}}\colon \ASET{#3}.}
\newcommand{\GSORT}[4]{\TO{#1}{#2}\colon #3\:\ENCan{#4}.}
\newcommand{\GBRA}[6]{\TO{#1}{#2}\colon #3\:\ASET{#4\colon #5}_{#6}}
%\newcommand{\GSEL}[4]{\TO{#1}{#2}\colon #3.#4}
% Standard types
\newcommand{\rcdt}{\{l_i\colon T_i\}_{i\in I}}
\newcommand{\brancht}[1][\alpha]{\branch\rcdt}
\newcommand{\singlebranchj}{\branch l_j:T_j}
\newcommand{\selectt}{\sel\rcdt}
\newcommand{\singleselectt}{\sel l. T}
\newcommand{\singleselect}{\sel l}
\newcommand{\selst}{\sel\{l_i\colon\alpha_i\}_{i\in I}}
\newcommand{\recvt}{\recv{\VEC{S}};T}
\newcommand{\sendt}{\send{\VEC{S}};T}
\newcommand{\throwt}{\throw{\VEC{T}};T}
\newcommand{\catcht}{\catch{\VEC{T}};T}
\newcommand{\rect}{\mu \typevar.T}

% Type assignment
\newcommand{\proves}{\vdash}
\newcommand{\has}{\triangleright}   % process has type
\newcommand{\rem}{\backslash}
\newcommand{\compat}{\asymp}
\newcommand{\COH}{\asymp}
\newcommand{\AT}[2]{#1\colon\! #2}

\newcommand{\DB}{\textsf{\upshape db}}
\newcommand{\provesdb}{\proves_\DB}
\newcommand{\Rdb}{\R_\DB}

\newcommand{\parts}[1]{{\cal P}({#1})}
\newcommand{\types}{{\cal T}}   % The set of types
\newcommand{\sorts}{{\cal S}}   % The set of sorts
%\newcommand{\genfunction}{{\cal S}_m}
\newcommand{\genfunction}{F}
\newcommand{\sym}{\text{Sym}}
\newcommand{\Cdot}{\!\cdot\!}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MISCELLANEOUS

% TyCO logo
\newcommand{\tyco}{\mbox{T\hspace{-.4ex}\raisebox{-.2ex}{y}CO}}

% Grammar definition
\newcommand{\grmeq}{\; ::= \;}
\newcommand{\grmor}{\; \mid \;}

% Equality, Equivalence, ...
\newcommand{\eqdef}{\;\stackrel{\text{\scriptsize def}}{=}\;}
\newcommand{\ALEQ}{\equiv_\alpha}
\newcommand{\LITEQ}{\equiv}

% Misc
\newcommand{\MAP}[1]{\lbrack\!\lbrack #1 \rbrack\!\rbrack}
\newcommand{\co}{\overline}
\newcommand{\OL}{\co}

% Notes
\def\note#1#2{\textbf{#1's Note:} {#2}}
\def\vasco{\note{Vasco}}
\def\kohei{\note{Kohei}}
\def\ny{\note{NY}}
\def\macro{\note{Marco}}


\newcommand{\ASET}[1]{\{ #1 \}}
\newcommand{\VEC}{\tilde}

% A case in a proof
\newcommand{\Case}[1]{\vspace{.4ex}\noindent\textbf{Case} {#1}\textbf.}

\newcommand{\RSUM}{\underset{1 \leq i \leq n}{\prod}}
\newcommand{\UPROD}[1]{\underset{#1}{\prod}}
%\newcommand{\dspro}[3]{\prod\nolimits_{#1=#2}^{#3}}
\newcommand{\dspro}[3]{\Pi_{#1=#2}^{#3}}
\newcommand{\smallprod}[1]{\Pi_{#1}}
\newcommand{\spro}[3]{\Pi_{#1=#2}^{#3}}


%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "main"
%%% End: 
\def\SETRES{\!\upharpoonright\!}
% Set the location search rules for figure and table.
%
\def\fps@figure{tp}      % Top, or separate page.
\def\fps@table{tp}
%
\def\topfraction{.98}      % 98% of a page can be floats at the top of page
\def\bottomfraction{.98}   % or at bottom of a page.
\def\textfraction{.01}     % a page with text must be at least 1% text
\def\floatpagefraction{.9}
\setcounter{totalnumber}{2}
\setcounter{topnumber}{1}
\setcounter{bottomnumber}{1}

\newcommand{\TOP}[1]{\mathsf{top}(#1)}
\newcommand{\NUL}{\epsilon}

\newcommand{\node}{\mathsf{n}}
\newcommand{\GPREFIX}[3]{\TO{#1}{#2}:{#3}}
\newcommand{\SC}[1]{{\mbox{\scriptsize\tt #1}}}
\newcommand{\precO}{\prec_{\SC{OO}}}
\newcommand{\precI}{\prec_{\SC{II}}}
\newcommand{\precIO}{\prec_{\SC{IO}}}
\newcommand{\precOI}{\prec_{\SC{OI}}}

\newcommand{\tcontext}{{\mathcal{T}}}
\newcommand{\tcontexthole}[1]{\tcontext[#1]}
\newcommand{\Empty}{\NUL}
\newcommand{\DEFEQ}{\stackrel{\mbox{\scriptsize def}}{=}}  
\newcommand{\DEFEQs}{\!\!\!\stackrel{\mbox{\scriptsize def}}{=}\!\!\!}  


% variant of Global types
\newcommand{\TOb}[2]{{\mathsf #1}\to {\mathsf #2}}
\newcommand{\TATb}[2]{#1{\mbox{\small @$\participant{#2}$}}}
\newcommand{\GINITb}[3]{\TO{#1}{\ASET{#2}}\colon \ASET{#3}.}
\newcommand{\GSORTb}[4]{\TO{#1}{#2}\colon #3\:\ENCan{#4}.}
\newcommand{\GBRAb}[6]{\TO{#1}{#2}\colon #3\:\ASET{#4\colon #5}_{#6}}
\newcommand{\GBRAc}[5]{\TO{#1}{#2}\colon #3,\:\ASET{#4\colon #5}}
\newcommand{\GBRApair}[7]{\TO{#1}{#2}\colon #3\:\ASET{#4\colon #5,\ \  #6\colon #7}}
%\newcommand{\GINIT}[3]{\ENCan{#1,\participant{#2},#3}}
\newcommand{\GINIT}[1]{\ENCan{#1}}

 \newcommand{\WB}{\approx}                


\newcommand{\GSORTe}[4]{\TO{#1}{#2}\colon #3\:\ENCan{#4}}

\newcommand{\CD}{\cdot}
\newcommand{\SCHAN}[1]{\mathsf{sid}(#1)}
\newcommand{\SPID}[1]{\mathsf{pid}(#1)}
\newcommand{\MSUBS}[2]{[#1/#2]}

\newcommand{\hass}{\triangleright_{\VEC{s}'}}   % process has type strings
\newcommand{\hasemp}{\triangleright_{\emptyset}}
\newcommand{\CAL}[1]{\mathcal{#1}}
\newcommand{\Deltak}[1]{\Delta[\,#1\,]}
%%\newcommand{\Deltak}[1]{\Delta\ENCan{\,#1\,}}
%%\newcommand{\Deltak}[1]{\Delta\ENCan{\!\ENCan{\,#1\,}\!}}
\newcommand{\RED}{\to}

\newcommand{\hasA}{\triangleright_{\VEC{s}}} 
\newcommand{\hasB}{\triangleright_{\VEC{t}}} 
\newcommand{\hasC}{\triangleright_{\VEC{r}}} 
\newcommand{\hasE}{\triangleright_{\VEC{q}}} 

\newcommand{\PREFIX}[2]{#1\ENCan{#2}}
\newcommand{\PREFIXRECIEVE}[2]{#1\ENCan{#2?}}
\newcommand{\PREFIXEMIT}[2]{#1\ENCan{#2!}}

\newcommand{\ACTIVE}[2]{#1\ENCan{\!\!\ENCan{#2}\!\!}}
\newcommand{\ACTIVERECIEVE}[2]{#1\ENCan{\!\!\ENCan{#2?}\!\!}}
\newcommand{\ACTIVERECEIVE}[2]{#1\ENCan{\!\!\ENCan{#2?}\!\!}}
\newcommand{\ACTIVEEMIT}[2]{#1\ENCan{\!\!\ENCan{#2!}\!\!}}
\newcommand{\ptp}[1]{\mathtt{#1}}

\newcommand{\ENTAILS}{\Rightarrow}

\newcommand{\subleq}{\leq_{\mathsf{sub}}}
\newcommand{\subgeq}{\geq_{\mathsf{sub}}}
\newcommand{\PROPOSITION}{\NI{\bf Proposition.} }
 \newcommand{\REMARK}{\NI{\bf Remark.} }
 \newcommand{\PROOF}{\NI{\sc Proof:} }
 \newcommand{\COMMENT}{\NI{\bf Comment.} }
 \newcommand{\NOTATION}{\NI{\bf Notation.} }
 \newcommand{\EXAMPLE}{\NI{\bf Examples.} }
 \newcommand{\FACT}{\NI{\bf Fact.} }
 \newcommand{\LEMMA}{\NI{\bf Lemma.} }
 \newcommand{\COROLLARY}{\NI{\bf{Corollary.} }}
 \newcommand{\CONVENTION}{\NI{\bf Convention.} }
 \newcommand{\DEFINITION}{\NI{\bf Definition.} }
 \newcommand{\CLAIM}{\NI{\bf Claim.}  }
 \newcommand{\CONJECTURE}{\NI{\bf Conjecture.} }
 \newcommand{\IGNORE}[1]{}
 \newcommand{\FULLPROOF}[1]{\begin{proof} #1 \end{proof}}
 \newcommand{\THEOREM}{\NI {\bf Theorem.} }
 \newcommand{\FACTn}[1]{\NI{\bf Fact #1.} }
 \newcommand{\NB}{\NI{\bf NB}}

 \newcommand{\ENCda}[1]{\langle\!\langle #1 \rangle\!\rangle}
 \newcommand{\MAPB}[1]{\ENCda{#1}}
\newcommand{\IFF}{\Leftrightarrow}
\newcommand{\TC}{{\mathcal{T}}}

%%\newcommand{\PARA}[1]{{\paragraph{{\bf\em #1}} {\ }\\[-1.6mm]}}
%%\newcommand{\PARA}[1]{\paragraph{#1}}
\newcommand{\PARA}[1]{\paragraph{\textbf{\textit #1}}}
\newcommand{\DIF}{\!\setminus\!}

%% \newcommand{\QED}{\Box}  % {\hfill \rule{6pt}{6pt}}}
\newcommand{\QED}{\hfill\Box}  % {\hfill \rule{6pt}{6pt}}}

\newcommand{\SMALLSKIP}{\\[-3.2mm]}
\newcommand{\BIGSKIP}{\\[2.4mm]}

\newcommand{\CASE}{\NI {\bf Case\ }}

\newcommand{\COMMA}{,}
\newcommand{\PERIOD}{.}

\newcommand{\BR}{{\ }\\ }
\newcommand{\kw}[1]{\keyword{#1}}
\newcommand{\nm}[1]{\name{#1}}

\newcommand{\scribble}{{{\sf Scribble}}}

\newcommand{\scribbleIt}{{{\sf\em Scribble}}}

%\newcommand{\keyword}[1]{\textsf{\upshape #1}\xspace}
