\documentclass[a4paper]{report}

\usepackage{mathtools}
\usepackage{amsmath}

\date{2015}
\title{\sc Promise Theory with Latex\\please redistribute freely}
\author{Mark Burgess}

\def\union{{\cup}}
\def\intersect{{\cap}}
\def\join{{\circ}}

\def\impos{{\;\vcenter{\hbox{\rule{5mm}{0.2mm}}} \vcenter{\hbox{\rule{1.5mm}{1.5mm}}} \;}}

% 

\def\lrarrow{\leftrightarrow \kern-8pt \rightarrow}

\def\Unspec{A_{\rm ?}}

\def\lrarrow{\leftrightarrow \kern-8pt \rightarrow}
\def\imply{\Rightarrow}
\def\frightarrow{\rightarrow \kern-11pt /~~}

\def\Server{{\rm Server}}
\def\Client{{\rm Client}}
\def\Proxy{{\rm Proxy}}
\def\Dispatcher{{\rm Dispatcher}}


\renewcommand{\baselinestretch}{1.10}

\begin{document}
\newcommand{\strust}[1]{\stackrel{\tau:#1}{\longrightarrow}}
\newcommand{\trust}[1]{\stackrel{#1}{{\rm\bf ~Trusts~}}}
\newcommand{\promise}[1]{\xrightarrow{#1}}
\newcommand{\revpromise}[1]{\xleftarrow{#1} }
%\newcommand{\lrpromise}[1]{\stackrel{#1}{\longleftrightarrow} }
\newcommand{\lrpromise}[1]{{\xleftrightarrow{#1}} }
\newcommand{\imposition}[1]{\stackrel{#1}{\impos}}
\newcommand{\scopepromise}[2]{\xrightarrow[#2]{#1}}
\newcommand{\handshake}[1]{\xleftrightarrow{#1} \kern-8pt \xrightarrow{} }
\newcommand{\cpromise}[1]{\stackrel{#1}{\frightarrow}}
\newcommand{\policy}{\stackrel{P}{\equiv}}
\newcommand{\field}[1]{\mathbf{#1}}
\newcommand{\bundle}[1]{\stackrel{#1}{\Longrightarrow}}

\maketitle

A promise:
\begin{eqnarray}
A \promise{+b} A'
\end{eqnarray}


Promises stretch:
\begin{eqnarray}
A \promise{+\text{A rose garden}} A'
\end{eqnarray}


A conditional promise:
\begin{eqnarray}
A \promise{+b|C} A'
\end{eqnarray}


An imposition:
\begin{eqnarray}
A \imposition{+b} A'
\end{eqnarray}

A promise with scope $\sigma$:
\begin{eqnarray}
A \scopepromise{+b}{\sigma} A'
\end{eqnarray}

Sometimes handy to do reverse promises:
A promise:
\begin{eqnarray}
A' \revpromise{-b} A
\end{eqnarray}

A promise to keep a promise:
\begin{eqnarray}
A_1 \promise{+ A_3 \promise{+b} A_4} A_2
\end{eqnarray}

Trust:
\begin{eqnarray}
S[T]
\trust{b} R[U]
\end{eqnarray}
meaning that $S$ trusts $R$ to ensure that $T$
keeps a promise of $b$ to $U$.

Example:
\begin{eqnarray}
\Server \promise{+E(P)} \Client \label{pull1}\\  
\Server \promise{-P, +E} \Proxy \label{pull4}\\
\Proxy \promise{+P,-E} \Server \label{pull3}\\
\Proxy \promise{+P(E)} \Client \label{pull5}\\
\Client \promise{-E(P)} \Server \label{pull2}\\
\Client \promise{-P(E)} \Proxy\label{pull6}
\end{eqnarray}

\end{document}
