diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2011-08-16  John D. Ramsdell  <ramsdell@mitre.org>
+
+	* cpsa.cabal (Version):  Tagged as version 2.2.5.
+
+2011-08-15  John D. Ramsdell  <ramsdell@mitre.org>
+
+	* src/cpsa.pl: Changed the internal form so that compound terms
+	are represented as function symbols applied to terms, not as
+	S-expressions.
+
+2011-08-12  John D. Ramsdell  <ramsdell@mitre.org>
+
+	* doc/*: Updated documentation to reflect support for hashing.
+
+2011-08-11  Paul Rowe  <prowe@mitre.org>
+
+	* src/CPSA/Basic/Algebra.hs: Added support for hashing.
+
+2011-07-26  John D. Ramsdell  <ramsdell@mitre.org>
+
+	* src/CPSA/Lib/Strand.hs (ksubst): Made the flag validate the
+	first argument.
+
+	* src/CPSA/Lib/Strand.hs (compress): Added a flag validate.  When
+	false, compression does not check for intrastrand orderings that
+	create cycles.  Used in thinning.
+
 2011-05-18  John D. Ramsdell  <ramsdell@mitre.org>
 
 	* cpsa.cabal (Version):  Tagged as version 2.2.4.
diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,13 @@
 CPSA NEWS -- history of user-visible changes.
 
+* Changes in version 2.2.5
+
+** Support for hashing added
+   Both the Basic and Diffie-Hellman term algebras have a new function
+   symbol hash that provides support for hashing.  The term (hash X)
+   is treated as a kind of encryption in which the term X is the
+   encryption key.
+
 * Changes in version 2.2.4
 
 ** GHC link time option added
diff --git a/cpsa.cabal b/cpsa.cabal
--- a/cpsa.cabal
+++ b/cpsa.cabal
@@ -1,5 +1,5 @@
 Name:			cpsa
-Version:		2.2.4
+Version:		2.2.5
 Maintainer:		ramsdell@mitre.org
 Cabal-Version:		>= 1.6
 License:		BSD3
@@ -44,7 +44,8 @@
 Build-Type:		Simple
 Data-Files:
    index.html cpsauser.html cpsa.mk Make.hs cpsaprimer.pdf
-   cpsaoverview.pdf ffgg.scm ns.scm or.scm woolam.scm yahalom.scm
+   cpsaoverview.pdf cpsaspec.pdf cpsadesign.pdf ffgg.scm ns.scm or.scm
+   woolam.scm yahalom.scm
 Data-Dir:	    	doc
 Extra-Source-Files:
   Makefile ChangeLog README NEWS ghci cpsatst setup.bat doc/README
@@ -95,7 +96,11 @@
   tst/tor.tst tst/dh_cert.scm tst/dh_cert.tst
   tst/epmo_acctnum-key-hash.scm tst/epmo_acctnum-key-hash.tst
   tst/epmo-key-hash.scm tst/epmo-key-hash.tst tst/wang.lisp
-  tst/pkinit.scm tst/pkinit.tst
+  tst/pkinit.scm tst/pkinit.tst tst/print.scm tst/print.tst
+  tst/epmo-hash.scm tst/epmo-hash.tst tst/hashtest-key-hash.scm
+  tst/hashtest-key-hash.tst tst/hashtest.scm tst/hashtest.tst
+  tst/wang-key-hash.scm tst/wang-key-hash.tst tst/wang-hash.scm
+  tst/wang-hash.tst
 
 -- Algebra implementations must import CPSA.Lib.CPSA.
 -- Tools may additionally import CPSA.Lib.Entry.
diff --git a/doc/README b/doc/README
--- a/doc/README
+++ b/doc/README
@@ -14,11 +14,10 @@
 * cpsatheory.pdf: CPSA Theory, the beginnings of a connectness proof
   of the CPSA algorithm
 
-To build the documentation, the file supp-pdf.tex must be installed.
-It is part of the TexLive texmf ConTeXt package.  On Linux, the name
-of the package is context or texlive-context.  The design document and
-the specification document require the xy-pic package, which is
-included in texlive-pictures.
+To build the documentation, you need Metapost and XY-pic.  On Linux,
+Metapost is supplied via the package texlive-metapost, and XY-pic is
+supplied in package texlive-pictures.  On some older versions of
+Linux, you may also have to install texlive-context.
 
 If you want to build the documentation from the sources, and you don't
 have and want to install the cmarrows package for Metapost, comment
diff --git a/doc/bcasyntax.tex b/doc/bcasyntax.tex
--- a/doc/bcasyntax.tex
+++ b/doc/bcasyntax.tex
@@ -45,7 +45,7 @@
 \\ &$\mid$&$(\sym{pubk}\mbox{ id}\mbox{ string})
 \mid(\sym{privk}\mbox{ id}\mbox{ string})$
 \\ &$\mid$&$(\sym{ltk}\mbox{ id id})\mid\mbox{string}\mid(\sym{cat}\mbox{ term+})$
-\\ &$\mid$&$(\sym{enc}\mbox{ term+ term})$
+\\ &$\mid$&$(\sym{enc}\mbox{ term+ term})\mid(\sym{hash}\mbox{ term+})$
 \\ role-alist&$\leftarrow$&$
 (\sym{non-orig}\mbox{ ht-term}\ast)\mbox{ role-alist}$
 \\ &$\mid$&$(\sym{uniq-orig}\mbox{ term}\ast)\mbox{ role-alist}\mid\ldots$
diff --git a/doc/cpsa.bib b/doc/cpsa.bib
--- a/doc/cpsa.bib
+++ b/doc/cpsa.bib
@@ -225,11 +225,11 @@
   OPTannote = 	 {}
 }
 
-@unpublished{algimpl,
+@unpublished{algimpl11,
   author = {Moses Liskov and John D. Ramsdell},
   title = {Implementing Strand Space Algebras},
-  note = {Unpublished manuscript, submitted to {ESORICS} 2011},
-  year = 2010
+  note = {\url{http://www.ccs.neu.edu/home/ramsdell/papers/algimpl.pdf}},
+  year = 2011
 }
 
 @incollection{ComonLundhMillen10,
@@ -270,7 +270,9 @@
    publisher = {Springer Berlin / Heidelberg},
    issn = {1615-5262},
    keyword = {Computer Science},
-   pages = {1--19},
+   pages = {63-81},
+   volume = {10},
+   issue = {2},
    url = {http://dx.doi.org/10.1007/s10207-011-0124-7},
    note = {10.1007/s10207-011-0124-7},
    year = {2011}
diff --git a/doc/cpsadesign.pdf b/doc/cpsadesign.pdf
Binary files a/doc/cpsadesign.pdf and b/doc/cpsadesign.pdf differ
diff --git a/doc/cpsadesign.tex b/doc/cpsadesign.tex
--- a/doc/cpsadesign.tex
+++ b/doc/cpsadesign.tex
@@ -124,6 +124,8 @@
 \begin{tabular}{@{}ll}
 $\enc{\cdot}{(\cdot)}\colon\dom{mesg}\times\dom{mesg}\rightarrow\dom{mesg}$
 &Encryption\\
+$\#\colon\dom{mesg}\rightarrow\dom{mesg}$
+&Hashing\\
 $(\cdot,\cdot)\colon\dom{mesg}\times\dom{mesg}\rightarrow\dom{mesg}$
 &Pairing\\
 ``\ldots''$\colon\dom{mesg}$& Tag constants\\
@@ -165,6 +167,8 @@
 \sembrack{\texttt{"}\ldots\texttt{"}}&{}={}&\mbox{``\ldots''}\\
 \sembrack{\texttt{(enc~}t_0~\ldots~t_{n-1}~t_n\texttt{)}}&{}={}&
 \enc{\sembrack{\texttt{(cat~}t_0~\ldots~t_{n-1}\texttt{)}}}{\sembrack{t_n}}\\
+\sembrack{\texttt{(hash~}t_0~\ldots~t_{n-1}\texttt{)}}&{}={}&
+\hash{\sembrack{\texttt{(cat~}t_0~\ldots~t_{n-1}\texttt{)}}}\\
 \sembrack{\texttt{(cat~}t\texttt{)}}&{}={}&\sembrack{t}\\
 \sembrack{\texttt{(cat~}t_0~t_1~\ldots\texttt{)}}&{}={}&
 (\sembrack{t_0},\sembrack{\texttt{(cat~}t_1~\ldots\texttt{)}})
@@ -296,20 +300,23 @@
 \emph{decryption key} function returns the key used to decrypt a term
 if it is an encryption, otherwise it returns an error indicator.  The
 \emph{encryptions} function returns the set of encryption terms
-carried by a term, each one paired with its encryption key.  The
-penetrator derivable function from the section in the specification of
-the same name is in the interface.  Given a derivable predicate that
-has been specialized with a given set of supported terms and a set of
-atoms to avoid, a target term, and a source term, the
-\emph{protectors} function returns an error indicator if the target is
-carried by the source outside of an encryption, where the derivable
-predicate is used to determine if a decryption key can be used to
-expose the target.  Otherwise, it returns a set of encryptions in the
-source that carry the target and have underivable decryption keys.  If
-two encryptions protect the target, only the outside one is returned.
-The inside encryption is the one that is carried by the outside
-encryption.  Pseudo code for the decryption key and the protectors
-functions is in the specification.
+carried by a term, each one paired with its encryption key.  {\cpsa}
+treats a hashed term as if it were an encryption in which the term
+that is hashed is the encryption key, so hashes with their content is
+also returned by this function.  The penetrator derivable function
+from the section in the specification of the same name is in the
+interface.  Given a derivable predicate that has been specialized with
+a given set of supported terms and a set of atoms to avoid, a target
+term, and a source term, the \emph{protectors} function returns an
+error indicator if the target is carried by the source outside of an
+encryption, where the derivable predicate is used to determine if a
+decryption key can be used to expose the target.  Otherwise, it
+returns a set of encryptions in the source that carry the target and
+have underivable decryption keys.  If two encryptions protect the
+target, only the outside one is returned.  The inside encryption is
+the one that is carried by the outside encryption.  Pseudo code for
+the decryption key and the protectors functions is in the
+specification.
 
 \chapter{Protocols and Preskeletons}\label{cha:prots and preskels}
 
@@ -1043,7 +1050,8 @@
 \cn{ltk}\colon\dom{name}\times\dom{name}\rightarrow\dom{skey}$\\
 $\cn{enc}\colon\dom{mesg}
 \times\dom{mesg}\rightarrow\dom{mesg}\quad
-\cn{cat}\colon\dom{mesg}
+\cn{hash}\colon\dom{mesg}\rightarrow\dom{mesg}$\\
+$\cn{cat}\colon\dom{mesg}
 \times\dom{mesg}\rightarrow\dom{mesg}\quad C_i\colon\dom{mesg}$\\[1ex]
 Axiom: $\cn{invk}(\cn{invk}(x))\approx x$ for $x\colon\dom{akey}$\\
 \caption{Basic Crypto Order-Sorted Signature}\label{tab:order-sorted}
@@ -1052,10 +1060,11 @@
 
 Terms are constructed from a set $I$ of identifiers\index{identifiers}
 and a set of functions symbols.  The symbols of arity one are
-\cn{text}, \cn{data}, \cn{name}, \cn{skey}, \cn{akey}, \cn{pubk}, and
-\cn{invk}.  The symbols of arity two are \cn{ltk}, \cn{cat}, and
-\cn{enc}.  The signature is given in Table~\ref{tab:many-sorted}.
-Grammar rules define the terms used by this algebra.
+\cn{text}, \cn{data}, \cn{name}, \cn{skey}, \cn{akey}, \cn{pubk},
+\cn{invk}, and \cn{hash}.  The symbols of arity two are \cn{ltk},
+\cn{cat}, and \cn{enc}.  The signature is given in
+Table~\ref{tab:many-sorted}.  Grammar rules define the terms used by
+this algebra.
 
 \begin{table}
 \begin{center}
@@ -1066,7 +1075,9 @@
 \cn{ltk}\colon\dom{name}\times\dom{name}\rightarrow\dom{skey}$\\
 $\cn{enc}\colon\dom{mesg}
 \times\dom{mesg}\rightarrow\dom{mesg}\quad
-\cn{cat}\colon\dom{mesg}
+\cn{hash}\colon\dom{mesg}
+\rightarrow\dom{mesg}$\\
+$\cn{cat}\colon\dom{mesg}
 \times\dom{mesg}\rightarrow\dom{mesg}\quad C_i\colon\dom{mesg}$\\
 $\cn{name}\colon\dom{name}\rightarrow\dom{mesg}\quad
 \cn{text}\colon\dom{text}\rightarrow\dom{mesg}\quad
@@ -1103,10 +1114,10 @@
 
 The set of terms $T$ is defined as follows.
 $$ T \leftarrow I \mid B \mid Q \mid \cn{cat}(T, T) \mid \cn{enc}(T,
-T)$$ where $Q$ is the set of tags, represented by quoted string
-literals.  The second argument in \cn{enc} is a term for a key.  A
-term of the form $x$ is called an indeterminate, and the identifier
-occurrence has sort~\dom{mesg}.
+T) \mid \cn{hash}(T)$$ where $Q$ is the set of tags, represented by
+quoted string literals.  The second argument in \cn{enc} is a term for
+a key.  A term of the form $x$ is called an indeterminate, and the
+identifier occurrence has sort~\dom{mesg}.
 
 The terms of interest are \index{well-formed term}well-formed.  A term
 is \emph{well-formed} if every occurrence of each identifier has the
@@ -1232,6 +1243,8 @@
 \begin{tabular}{@{}ll}
 $\enc{\cdot}{(\cdot)}\colon\dom{mesg}\times\dom{mesg}\rightarrow\dom{mesg}$
 &Encryption\\
+$\#\colon\dom{mesg}\rightarrow\dom{mesg}$
+&Hashing\\
 $(\cdot,\cdot)\colon\dom{mesg}\times\dom{mesg}\rightarrow\dom{mesg}$
 &Pairing\\
 ``\ldots''$\colon\dom{mesg}$& Tag constants\\
diff --git a/doc/cpsaoverview.pdf b/doc/cpsaoverview.pdf
Binary files a/doc/cpsaoverview.pdf and b/doc/cpsaoverview.pdf differ
diff --git a/doc/cpsaoverview.tex b/doc/cpsaoverview.tex
--- a/doc/cpsaoverview.tex
+++ b/doc/cpsaoverview.tex
@@ -38,11 +38,12 @@
 construct~\texttt{k}.
 
 Non-atomic terms are constructed by applications of encryption
-(\texttt{enc}) and pairing (\texttt{cat}), where $n$-ary concatenation
-is parsed right-associatively.  The second argument of an encryption
-is the key. Encryption may also be written in an $n$-ary form where
-the last argument is the key and the arguments preceding it are
-implicitly concatenated.
+(\texttt{enc}), hashing (\texttt{hash}), and pairing (\texttt{cat}),
+where $n$-ary concatenation is parsed right-associatively.  The second
+argument of an encryption is the key. Encryption may also be written
+in an $n$-ary form where the last argument is the key and the
+arguments preceding it are implicitly concatenated.  Hashing also may
+written in an $n$-ary form and its arguments are implicitly concatenated.
 
 A term carries one of its subterms if the possession of the right set
 of keys allows the extraction of the subterm.  The carries relation is
diff --git a/doc/cpsaprimer.pdf b/doc/cpsaprimer.pdf
Binary files a/doc/cpsaprimer.pdf and b/doc/cpsaprimer.pdf differ
diff --git a/doc/cpsaprimer.tex b/doc/cpsaprimer.tex
--- a/doc/cpsaprimer.tex
+++ b/doc/cpsaprimer.tex
@@ -193,22 +193,27 @@
 \texttt{(invk~k)} will be written as $K^{-1}$, and \texttt{(pubk~n)}
 as $K_{N}$.
 
-The terms in this algebra are freely generated from the atoms,
-tags, encryption, and concatenation.  A tag is a quoted constant.
+The terms in this algebra are freely generated from the atoms, tags,
+concatenation, encryption, and hashing.  A tag is a quoted constant.
+The concatenation of terms~$t$ and~$t'$ is~$t,t'$ in traditional infix
+notation and \texttt{(cat $t$ $t'$)} in S-expression syntax.  The
+comma operator is right associative and \texttt{(cat $a$ $b$ $c$ $d$)}
+is equivalent to \texttt{(cat $a$ (cat $b$ (cat $c$ $d$)))}.
 Given~$t$, the term to be protected, and key term~$k$, the encryption
 of~$t$ using~$k$ is~$\enc{t}{k}$ in traditional notation and
 \texttt{(enc $t$ $k$)} in S-expression syntax.  The term represents
 asymmetric encryption when the key is of sort \dom{akey}, otherwise it
-represents symmetric encryption.  The concatenation of terms~$t$
-and~$t'$ is~$t,t'$ in traditional infix notation and \texttt{(cat $t$
-  $t'$)} in S-expression syntax.  The comma operator is right
-associative and \texttt{(cat $a$ $b$ $c$ $d$)} is equivalent to
-\texttt{(cat $a$ (cat $b$ (cat $c$ $d$)))}.  Finally, \texttt{(enc $a$
-  $b$ $c$ $d$ $k$)} is equivalent to \texttt{(enc (cat $a$ $b$ $c$
-  $d$) $k$)}.  Figure~\ref{fig:ns responder} on Page~\pageref{fig:ns
-  responder} contains examples of \textsc{bca} message terms.  Also
-see \textsc{term} in Table~\ref{tab:syntax}, Appendix~\ref{sec:syntax
-  reference}.
+represents symmetric encryption.  Additionally, \texttt{(enc $a$ $b$
+  $c$ $d$ $k$)} is equivalent to \texttt{(enc (cat $a$ $b$ $c$ $d$)
+  $k$)}.  Given~$t$, the term to be hashed, its hash is $\hash{t}$ in
+traditional notation and \texttt{(hash $t$)} in S-expression syntax.
+{\cpsa} treats a hashed term as if it were an encryption in which the
+term that is hashed is the encryption key.  As with encryption,
+\texttt{(hash $a$ $b$ $c$ $d$)} is equivalent to \texttt{hash (cat $a$
+  $b$ $c$ $d$))}.  Figure~\ref{fig:ns responder} on
+Page~\pageref{fig:ns responder} contains examples of \textsc{bca}
+message terms.  Also see \textsc{term} in Table~\ref{tab:syntax},
+Appendix~\ref{sec:syntax reference}.
 
 A message term \emph{carries}\index{carries} a subterm of the message
 if the possession of the right set of keys allows the extraction of
@@ -1123,19 +1128,6 @@
 originating data is carried in fields with predictable values, the
 convention is to use the sort \dom{data} for uniquely originating
 data, and sort \dom{text} for the other fields.
-
-Protocols that make use of \index{hashing}hashing can be handled by
-encrypting the tag \texttt{"hash"} using the value to be hashed as the
-key.  If the hash value is a variable of sort \dom{mesg}, a tag must
-be added to the key so as to force {\cpsa} to use symmetric
-encryption.  The following {\cpsa} macro captures the usage pattern.
-
-\begin{quote}
-\begin{verbatim}
-(defmacro (hash x)
-  (enc "hash" (cat "hash" x)))
-\end{verbatim}
-\end{quote}
 
 When looking at the output, try extracting the shapes first.  If the
 shapes only version of the output does not answer your questions, try
diff --git a/doc/cpsaspec.pdf b/doc/cpsaspec.pdf
Binary files a/doc/cpsaspec.pdf and b/doc/cpsaspec.pdf differ
diff --git a/doc/cpsaspec.tex b/doc/cpsaspec.tex
--- a/doc/cpsaspec.tex
+++ b/doc/cpsaspec.tex
@@ -50,6 +50,7 @@
 \newcommand{\role}{\mathsf{r}}
 \newcommand{\skel}{\mathsf{k}}
 \newcommand{\rl}{\fn{rl}}
+\newcommand{\inst}{\mathsf{i}}
 \newcommand{\nodes}{\fn{nodes}}
 \newcommand{\lsn}{\fn{lsn}}
 \newcommand{\init}{\fn{init}}
@@ -187,6 +188,8 @@
 \begin{tabular}{@{}ll}
 $\enc{\bullet}{(\cdot)}\colon\dom{mesg}\times\dom{mesg}\rightarrow\dom{mesg}
 $&Encryption\\
+$\hash{(\cdot)}\colon\dom{mesg}\rightarrow\dom{mesg}
+$&Hashing\\
 $(\bullet,\bullet)\colon\dom{mesg}\times\dom{mesg}\rightarrow\dom{mesg}$
 &Pairing\\
 ``\ldots''$\colon{}\dom{mesg}$& Tag constants\\
@@ -240,7 +243,8 @@
 {}\cup\{\{(t_0,t_1)\mid t_0\in T_0, t_1\in T_1\}\mid
  T_0\in\alga^n,T_1\in\alga^n\}\\
 {}\cup\{\{\enc{t_0}{t_1}\mid t_0\in T_0, t_1\in T_1\}\mid
- T_0\in\alga^n,T_1\in\alga^n\}
+ T_0\in\alga^n,T_1\in\alga^n\}\\
+{}\cup\{\{\hash{t}\mid t\in T\}\mid T\in\alga^n\}
 \end{array}\\
 \alga = \alga_{\dom{mesg}}&\bigcup_{n\in\nat}\alga^n
 \end{array}$$
@@ -280,12 +284,15 @@
 t&\mbox{otherwise.}
 \end{array}\right.$$
 
-An important property possessed by the algebra is that for all $T\in\alga$,
-if there are any encryptions in $T$ then all members of $T$ are encryptions.
-As a result, a message can be identified as representing an encryption
-and if it is, decomposed into its plaintext and its decryption key.
-This property is a consequence of the fact that equations relate
-atoms, not arbitrary messages.  A similar property holds for pairs.
+An important property possessed by the algebra is that for all
+$T\in\alga$, if there are any encryptions in $T$ then all members of
+$T$ are encryptions.  As a result, a message can be identified as
+representing an encryption and if it is, decomposed into its plaintext
+and its decryption key.  This property is a consequence of the fact
+that equations relate atoms, not arbitrary messages.  A similar
+property holds for pairs and hashes.  A hash\index{hash} is treated as
+a kind of encryption in which the term that is hashed is the
+encryption key.
 
 We write $\alga_X$ when it is important to identify the variable
 set~$X$ that generates the algebra.  Given two variable sets~$X$
@@ -470,7 +477,9 @@
 \seq{\inbnd(x, y),\outbnd x,\outbnd y}\\
 \mbox{Encrypt}(x,y\colon\top)&
 \seq{\inbnd x,\inbnd y,\outbnd\enc{x}{y}}&
-\seq{\inbnd\enc{x}{y},\inbnd \fn{inv}(y),\outbnd x}
+\seq{\inbnd\enc{x}{y},\inbnd \fn{inv}(y),\outbnd x}\\
+\mbox{Hash}(x\colon\top)&
+\seq{\inbnd x,\outbnd\hash{x}}
 \end{array}$$
 \caption{Basic Crypto Algebra Penetrator Role Traces}\label{fig:pen}
 \end{figure}
@@ -590,12 +599,12 @@
 strands, and adjusting the communication ordering $\to$ appropriately.
 
 The set of bundles denoted by preskeleton~$k$, $\sembrack{k}$, is:
-$$\sembrack{k_0} = \{\Upsilon\mid
-\mbox{$k_0\homomorphism{\phi,\sigma}k_1$ and $k_1$ realizes modulo
+$$\sembrack{k} = \{\Upsilon\mid
+\mbox{$k\homomorphism{\phi,\sigma}k'$ and $k'$ realizes modulo
   listeners $\Upsilon$}\}$$ A {\cpsa} algorithm is \emph{complete} if
-when given a preskeleton~$k_0$, either the algorithm diverges, or else it
+when given a preskeleton~$k$, either the algorithm diverges, or else it
 terminates and produces a finite set of realized skeletons~$K$, such
-that $\sembrack{k_0}=\bigcup_{k_1\in K}\sembrack{k_1}$.
+that $\sembrack{k}=\bigcup_{k'\in K}\sembrack{k'}$.
 \label{def:preskeleton denotation}
 
 \section{Blanchet's Simple Example Protocol}\label{sec:blanchet's
@@ -640,7 +649,7 @@
 &\{\init(a_0,b_0,s_0,d_0),\resp(a_1,b_1,s_1,d_1)\},
 &\mbox{Protocol}\\
 &\seq{\seq{\outbnd\enc{\enc{s}{a^{-1}}}{b},\inbnd\enc{d}{s}}},
-&\mbox{Strands}\\
+&\mbox{Traces}\\
 &\emptyset,
 &\mbox{Node orderings}\\
 &\{a^{-1},b^{-1}\},
@@ -667,7 +676,7 @@
 \seq{\outbnd\enc{\enc{s}{a^{-1}}}{b},\inbnd\enc{d}{s}},\\
 \seq{\inbnd\enc{\enc{s}{a^{-1}}}{b},\outbnd\enc{d}{s}}\rangle,
 \end{array}
-&\mbox{Strands}\\
+&\mbox{Traces}\\
 &\{(1,1)\prec(2,1),(2,2)\prec(1,2)\},
 &\mbox{Node orderings}\\
 &\{a^{-1},b^{-1}\},
@@ -706,7 +715,7 @@
 &\{\init(a_0,b_0,s_0,d_0),\resp(a_1,b_1,s_1,d_1)\},
 &\mbox{Protocol}\\
 &\seq{\seq{\inbnd\enc{\enc{s}{a^{-1}}}{b},\outbnd\enc{d}{s}}},
-&\mbox{Strands}\\
+&\mbox{Traces}\\
 &\emptyset,
 &\mbox{Node orderings}\\
 &\{a^{-1},b^{-1}\},
@@ -730,7 +739,7 @@
 \seq{\outbnd\enc{\enc{s}{a^{-1}}}{b'}}\rangle,
 \end{array}
 &\begin{array}[t]{@{}l}
-\mbox{Strands}\\
+\mbox{Traces}\\
 \mbox{\emph{Note key is $b'$ not $b$!}}
 \end{array}\\
 &\{(2,1)\prec(1,1)\},
@@ -755,7 +764,7 @@
 &\seq{
 \seq{\inbnd\enc{\enc{s}{a^{-1}}}{b},\outbnd\enc{d}{s}},
 \seq{\inbnd d,\outbnd d}},
-&\mbox{Strands}\\
+&\mbox{Traces}\\
 &\{(1,2)\prec(2,1),
 &\mbox{Node orderings}\\
 &\{a^{-1},b^{-1}\},
@@ -797,7 +806,7 @@
 &\{\init(a_0,b_0,m_0),\resp(a_1,b_1,m_1),\lsn(x)\},
 &\mbox{Protocol}\\
 &\seq{\seq{\outbnd\enc{\enc{m}{b},a}{b}},\seq{\inbnd m}},
-&\mbox{Strands}\\
+&\mbox{Traces}\\
 &\emptyset,
 &\mbox{Node orderings}\\
 &\{a^{-1},b^{-1}\},
@@ -888,6 +897,27 @@
 \caption{A Bundle Realized by the Example Skeleton}\label{fig:bundle}
 \end{figure}
 
+\section{External Syntax and Instances}\label{sec:instances}
+
+The external syntax used by {\cpsa} is a little different than what
+has been described here.  In the external syntax, the trace and the
+role associated with a strand is specified by an
+\index{instance}\emph{instance}.  An instance is of the form
+$\inst(r,h,\sigma)$, where~$r$ is a role, $h$ specifies the length of
+a trace instantiated from the role, and~$\sigma$ specifies how to
+instantiate the variables in the role to obtain the trace.  Thus when
+$r=\role_Y(C,N,U)$, the trace associated with $\inst(r,h,\sigma)$ is
+$\sigma\circ\prefix{C}{h}$.  An instance is well-formed if $1\leq
+h\leq|C|$, and $\sdom(\sigma)$ is the set of variables that occur
+in~$\prefix{C}{h}$.
+
+In the external syntax, the role map and sequence of traces are
+replaced by a sequence of instances.  So for preskeleton
+$\skel_X(\rl,P,\Theta_X,\prec,N,U)$ the external syntax is
+$\skel_X(P,I,\prec,N,U)$, where for each $s\in\sdom(\Theta_x)$,
+$I(s)=\inst(r,h,\sigma)$, $r=\rl(s)$, and the trace of
+$\inst(r,h,\sigma)$ is $\Theta_X(s)$.
+
 \chapter{Algorithms as Reduction Systems}\label{chp:algorithms}
 
 Algorithms in this paper are specified as abstract reduction
@@ -1101,11 +1131,14 @@
 $k_0\reduction{\ops{S}_\sigma}k\reduction{\ops{C}_{s,s'}}k_1$,
 $k_0\homomorphism{\phi,\sigma}k_1$, and
 $k_1\homomorphism{\phi',\sigma'}k_0$, where
-$\comp{\phi}{\phi'}=\idphi$ and $\comp{\sigma}{\sigma'}=\idsigma$.
-In particular $\phi=\phi_{s,s'}$ and $\phi'=\phi'_s$
-with~$\phi_{s,s'}$ and~$\phi'_s$ as in Definition~\ref{def:compression
-  operator}.  The bidirectional homomorphism requirement leads to the
-following definition.
+$\comp{\phi}{\phi'}=\idphi$ and
+$\comp{\sigma}{\sigma'}=\idsigma$.\footnote{In category theory,
+  $(\phi',\sigma')$ is a section of $(\phi,\sigma)$, and
+  $(\phi,\sigma)$ is a retraction of $(\phi',\sigma')$.}  In
+particular $\phi=\phi_{s,s'}$ and $\phi'=\phi'_s$ with~$\phi_{s,s'}$
+and~$\phi'_s$ as in Definition~\ref{def:compression operator}.  The
+bidirectional homomorphism requirement leads to the following
+definition.
 
 \begin{defn}[Pruning]\label{def:pruning}
 Suppose skeleton~$k_0$ has a redundant strand~$s$.  Then there exists
@@ -1145,6 +1178,18 @@
 point-of-view skeleton, but the notation in the chapter on generalization
 shows how it might be done.
 
+\begin{defn}[Thinning]
+Two strands $s$ and $s'$ in a skeleton $k$ are \emph{effectively
+  equivalent} if $k$ with $s$ removed and $k$ with $s'$ removed are
+isomorphic.  We can define a different form of pruning based on this
+idea.  Skeleton $k_0$ reduces to skeleton $k_1$ by pruning, written
+$k_0\reduction{\ops{P}_s}k_1$, if and only if there exists a strand
+$s'$ that is effectively equivalent to $s$ in $k_0$ and $k_1$ is
+isomorphic to both $k_0$ with $s$ removed and $k_0$ with $s'$ removed.
+\end{defn}
+
+Thinning is not used yet.
+
 \section{Reduction Systems}
 
 Notice that a setwise hulling reduction may produce the empty set, but
@@ -1194,7 +1239,8 @@
 \fn{enc}(t_0,t_1)=\seq{\inbnd t_0,\inbnd t_1,
 \outbnd\enc{t_0}{t_1}}\\
 \fn{dec}(t_0,t_1)=\seq{\inbnd\enc{t_0}{t_1},
-\inbnd t_2,\outbnd t_0},\mbox{ where $t_2=\fn{inv}(t_1)$}
+\inbnd t_2,\outbnd t_0},\mbox{ where $t_2=\fn{inv}(t_1)$}\\
+\fn{hash}(t)=\seq{\inbnd t,\outbnd\hash t}
 \end{array}$$
 \caption{Penetrator Traces}\label{fig:pen traces}
 \end{figure}
@@ -1234,13 +1280,16 @@
 [\mbox{by $\fn{dec}(t_0,t_1)$}]
 \end{equation}
 
-There are two constructive steps.
+There are three constructive steps.
 $$\infer{\der{t_0}{T_p}{T_a}\qquad\der{t_1}{T_p}{T_a}}%
 {\der{(t_0,t_1)}{T_p}{T_a}}\quad
 [\mbox{by $\fn{cat}(t_0,t_1)$}]$$
 $$\infer{\der{t_0}{T_p}{T_a}\qquad\der{t_1}{T_p}{T_a}}%
 {\der{\enc{t_0}{t_1}}{T_p}{T_a}}\quad
 [\mbox{by $\fn{enc}(t_0,t_1)$}]$$
+$$\infer{\der{t}{T_p}{T_a}}%
+{\der{\hash{t}}{T_p}{T_a}}\quad
+[\mbox{by $\fn{hash}(t)$}]$$
 
 There are three rules for indivisible messages.
 $$\der{C_i}{T_p}{T_a}\quad
@@ -1444,7 +1493,7 @@
 Figure~\ref{fig:cows} displays the iterative procedure that breaks the
 cyclic dependencies.  Each step of the iteration improves an
 approximation of a solution to the problem.  The correctness of this
-function is shown in~\cite{algimpl}, although for a version of the
+function is shown in~\cite{algimpl11}, although for a version of the
 algorithm with the alternate definition for the function~$\fn{fold}$ in
 Figure~\ref{fig:fold}.
 
@@ -1502,8 +1551,8 @@
 $t=\msg_k(n)$ if
 \begin{enumerate}
 \item $p$ is a carried position in~$t$,
-\item either $t\termat p\in U_k$ or $t\termat p=\enc{t_0}{t_1}$
-  and~$t_1$ is not derivable before~$n$ in~$k$,
+\item either $t\termat p\in U_k$, $t\termat p=\hash t_1$, or $t\termat
+  p=\enc{t_0}{t_1}$ and~$t_1$ is not derivable before~$n$ in~$k$,
 \item $\fn{esc}(k,n,t\termat p)$ is defined, and
 \item $\fn{anc}(t,p)\cap \fn{esc}(k,n,t\termat p)=\emptyset$.
 \end{enumerate}
@@ -1512,8 +1561,10 @@
 The message at a critical position is called an \emph{authentication
   test}.  It is a \index{nonce test}\emph{nonce test} if the message
 is an atom, otherwise it is a \index{encryption test}\emph{encryption
-  test}.  Observe that every critical message at a node in a skeleton
-is not derivable at the node.
+  test}.  (A hash\index{hash} is treated as a kind of encryption in
+which the term that is hashed is the encryption key.)  Observe that
+every critical message at a node in a skeleton is not derivable at the
+node.
 
 \begin{conj}
 A reception node is unrealized iff it has a critical position.
@@ -1538,7 +1589,7 @@
 \item for some~$t_p\in\outpred(k_1,n_1)$, $t_1$ is not carried
   only within~$T_1$ in~$t_p$, or
 \item
-  $\fn{targ}(t_1,T_1)\setminus\sigma(\fn{targ}(t_0,T_0))\neq\emptyset$
+  $\fn{targ}(t_1,\fn{esc}(k_1,n_1,t_1))\setminus\sigma(\fn{targ}(t_0,T_0))\neq\emptyset$
   and there are variables in $k$'s protocol that are not atoms, or
 \item the decryption key of a member of~$T_1$ is derivable
   before~$n_1$ in~$k_1$, or
@@ -1919,11 +1970,12 @@
 message is the same as the expected message, and abort the run if not.
 
 Here is an example of when the second behavior is desired.  In
-{\cpsa}, encryption can be used to represent hashing.  The hash of~$t$,
-$\#t$, expands to $\enc{\mbox{``hash''},t}{h}$, where~$h$ is an
-asymmetric key known to all, but no one knows~$h^{-1}$.  The tag
-``hash'' is added to the encryption so as to ensure a hash is never
-confused with other uses of encryption.
+{\cpsa}, before hashing was part of the algebra, an encryption was
+used to represent hashing.  The hash of~$t$, $\#t$, expanded to
+$\enc{\mbox{``hash''},t}{h}$, where~$h$ was an asymmetric key known to
+all, but no one knew~$h^{-1}$.  The tag ``hash'' was added to the
+encryption so as to ensure a hash was never confused with other uses of
+encryption.
 
 A role does not specify a valid program if the only possible way of
 interpreting the event~$\inbnd\#t$ is by using~$h^{-1}$ to decrypt
@@ -2040,12 +2092,12 @@
 is a formula in the language of order-sorted first-order logic called
 a \index{shape analysis sentence}\emph{shape analysis sentence,} often
 shortened to a shape sentence.  The sentence has a special form,
-$\all{X}\Psi\rightarrow\bigvee_i\some{Y_i}\Delta_i\wedge\Phi_i$,
+$\all{X}(\Psi\supset\bigvee_i\some{Y_i}(\Delta_i\wedge\Phi_i$)),
 where~$\Psi$ and~$\Phi_i$ are conjunctions of atomic formulas and~$X$
 and~$Y_i$ are variable sets.  This fragment of first-order logic is
 called coherent logic.  Formula~$\Psi$ describes the point-of-view
-skeleton~$k$.  For each homomorphism to a shape,
-$k\homomorphism{\delta_i}k_i$, formula~$\Delta_i$ describes the
+skeleton~$k_0$.  For each homomorphism to a shape,
+$k_0\homomorphism{\delta_i}k_i$, formula~$\Delta_i$ describes the
 structure preserving maps~$\delta_i$, and the shape~$k_i$ is
 described by~$\Phi_i$.
 
@@ -2077,19 +2129,17 @@
 zero and, of course, equality is binary.
 
 We define~$\form(k)=(Y,\Phi)$, where~$\Phi$ is $k$'s skeleton formula,
-and~$Y$ is the formula's variable set.  Let
-$k=\skel_X(\rl,P,\Theta,\prec,N,U)$.  The variable set~$Y$ is~$X$
-augmented with a variable~$z_s\colon\dom{nat}$ for each strand
-$s\in\sdom(\Theta)$.  The formula~$\Phi$ is a conjunction of atomic
+and~$Y$ is the formula's variable set.  Using the external syntax
+presented in Section~\ref{sec:instances}, let
+$k=\skel_X(P,I,\prec,N,U)$.  The variable set~$Y$ is~$X$ augmented
+with a variable~$z_s\colon\dom{nat}$ for each strand
+$s\in\sdom(I)$.  The formula~$\Phi$ is a conjunction of atomic
 formulas composed as follows.
 
 \begin{itemize}
-\item For each $s\in\sdom(\Theta)$, let $r=\rl(s)=\role_Y(C,N,U)$,
-  $\comp{\sigma}{C|_h}=\Theta(s)$, and $h=|\Theta(s)|$.  For each
-  variable $x\in\sdom(\sigma)$ and term $t=\sigma(x)$, assert
-  $P[r,h,x](z_s,t)$.  Note $\sigma\colon\alga_Y\to\alga_X$ is the
-  homomorphism described near the end of Chapter~\ref{chp:strand
-    spaces and bundles}.
+\item For each $s\in\sdom(I)$, let $I(s)=\inst(r,h,\sigma)$.  For
+  each variable $x\in\sdom(\sigma)$ and term $t=\sigma(x)$, assert
+  $P[r,h,x](z_s,t)$.
 \item For each $(s,i)\prec(s',i')$, assert
   $\cn{prec}(z_s,i,z_{s'},i')$.
 \item For each $t\in N$, assert $\cn{non}(t)$.
@@ -2104,20 +2154,20 @@
 the~$\prec$ relation.  The missing relations must be asserted as axioms
 for proper handling of a shape sentence.
 
-Given a set of homomorphisms $k\homomorphism{\delta_i}k_i$, its shape
+Given a set of homomorphisms $k_0\homomorphism{\delta_i}k_i$, its shape
 sentence is
 \begin{equation}
-\sent(k\homomorphism{\delta_i}k_i)=\all{X}\Psi\rightarrow
-\bigvee_i\some{Y_i}\Delta_i\wedge\Phi_i,\label{eq:shape sentence}
+\sent(k_0\homomorphism{\delta_i}k_i)=\all{X}(\Psi\supset
+\bigvee_i\some{Y_i}(\Delta_i\wedge\Phi_i)),\label{eq:shape sentence}
 \end{equation}
-where $\form(k)=(X,\Psi)$.  The same procedure produces~$Y_i$
+where $\form(k_0)=(X,\Psi)$.  The same procedure produces~$Y_i$
 and~$\Phi_i$ for shape~$k_i$ with one proviso---the variables in
 $Y_i$ that also occur in~$X$ must be renamed to avoid trouble while
 encoding the structure preserving maps~$\delta_i$.
 
 \begin{figure}
 $$\begin{array}{l}
-\all{a_0,b_0\colon A, s_0\colon S, d_0\colon D, z_0\colon N}\\
+\all{a_0,b_0\colon A, s_0\colon S, d_0\colon D, z_0\colon N}(\\
 \quad\init_{2,a}(z_0,a_0)\wedge
 \init_{2,b}(z_0,b_0)\wedge
 \init_{2,s}(z_0,s_0)\wedge
@@ -2125,9 +2175,9 @@
 \quad\cn{non}(a_0^{-1})\wedge
 \cn{non}(b_0^{-1})\wedge
 \cn{uniq}(s_0)\wedge\cn{orig}(s_0,z_0,1)\\
-\quad\rightarrow\\
+\quad\supset\\
 \quad\some{a_1,b_1\colon A, s_1\colon S, d_1\colon D, z_1,z_2\colon
-  N}\\
+  N}(\\
 \qquad z_0=z_1\wedge a_0=a_1\wedge b_0=b_1\wedge s_0=s_1\wedge d_0=d_1\wedge{}\\
 \qquad\init_{2,a}(z_1,a_1)\wedge
 \init_{2,b}(z_1,b_1)\wedge
@@ -2141,7 +2191,7 @@
 \cn{prec}(z_2,2,z_1,2)\wedge{}\\
 \qquad\cn{non}(a_1^{-1})\wedge
 \cn{non}(b_1^{-1})\wedge
-\cn{uniq}(s_1)\wedge\cn{orig}(s_1,z_1,1)
+\cn{uniq}(s_1)\wedge\cn{orig}(s_1,z_1,1)))
 \end{array}$$
 \caption{A Shape Analysis Sentence for Blanchet's
   Protocol}\label{fig:blanchet's shape analysis sentence}
@@ -2153,7 +2203,7 @@
 of~$\sigma_i$ and the term it maps to.  Map~$\phi_i$ is coded as
 equalities between strand variables in~$\Psi$ and strand variables
 in~$\Phi_i$.  Let~$Z$ be the sequence of strand variables freshly
-generated for~$k$, and~$Z_i$ be the ones generated for~$k_i$.  The
+generated for~$k_0$, and~$Z_i$ be the ones generated for~$k_i$.  The
 strand mapping part of~$\Delta_i$ is
 $\bigwedge_{j\in\sdom(\Theta)}Z(j)=Z_i(\phi_i(j))$.
 
@@ -2166,21 +2216,21 @@
 
 \section{Semantics of Shape Formulas}
 
-Once again, let $k=\skel_X(\rl,P,\Theta,\prec,N,U)$.  The universe of
-discourse is $\alg{D}=\nat\cup\alga_X$.  When formula~$\Psi$ is
-satisfied in skeleton~$k$ with variable assignment $\alpha\colon Y\to
-\alg{D}$, we write $k,\alpha\models\Psi$.  When sentence~$\Sigma$ is
-satisfied in skeleton~$k$, we write $k\models\Sigma$.
+Let $k=\skel_X(\rl,P,\Theta,\prec,N,U)$.  The universe of discourse is
+$\alg{D}=\nat\cup\alga_X$.  When formula~$\Psi$ is satisfied in
+skeleton~$k$ with variable assignment $\alpha\colon Y\to \alg{D}$, we
+write $k,\alpha\models\Psi$.  When sentence~$\Sigma$ is satisfied in
+skeleton~$k$, we write $k\models\Sigma$.
 
 For each protocol specific predicate $P[r,h,x]$, $k,\alpha\models
 P[r,h,x](y,z)$ iff $\alpha(y)\in\nat$, $\alpha(z)\in\alga$, and with
-$\alpha(y)=s$,
+$\alpha(y)=s$ and $r=\role(C,N,U)$,
 
 \begin{enumerate}
 \item $s\in\sdom(\Theta)$,
 \item $h\in\sdom(\Theta(s))$, and
-\item $\alpha(z)=\sigma(x)$, where $\rl(s)=\role(C,N,U)$,
-$\comp{\sigma}{C|_\ell}=\Theta(s)$, and $\ell=|\Theta(s)|$.
+\item $\prefix{\Theta(s)}{h}=\sigma\circ\{x\mapsto\alpha(z)\}\circ\prefix{C}{h}$
+  for some~$\sigma$.
 \end{enumerate}
 
 In an interpretation, $\rl(s)$ need not be~$r$.  The events that make
@@ -2204,10 +2254,10 @@
 \end{itemize}
 
 \begin{thm}\label{thm:skeleton models}
-Let $\form(k)=(X,\Psi)$ and $\Phi=\some{X}\Psi$.  Formula~$\Phi$ is
-satisfied in~$k'$ iff there is a homomorphism from~$k$ to
-$k'$, i.e.\ $k'\models\Phi$ iff
-$\some{\delta}k\homomorphism{\delta}k'$.
+Let $\form(k_0)=(X,\Psi)$ and $\Phi=\some{X}\Psi$.  Formula~$\Phi$ is
+satisfied in~$k$ iff there is a homomorphism from~$k_0$ to
+$k$, i.e.\ $k\models\Phi$ iff
+$\some{\delta}k_0\homomorphism{\delta}k$.
 \end{thm}
 
 This theorem corrects the first of the two main results
@@ -2215,16 +2265,16 @@
 
 \begin{proof}
 For the forward direction, assume~$\alpha$ is a variable assignment
-for the variables in~$X$ such that $k',\alpha\models\Psi$, and let~$Z$
+for the variables in~$X$ such that $k,\alpha\models\Psi$, and let~$Z$
 be the sequence of strand variables constructed while
-generating~$\Psi$ from~$k$.  Then the pair of maps
-$\delta=(\comp{\alpha}{Z},\alpha)$ demonstrate a homomorphism from~$k$
-to~$k'$, i.e.\ each item in the definition of a preskeleton
+generating~$\Psi$ from~$k_0$.  Then the pair of maps
+$\delta=(\comp{\alpha}{Z},\alpha)$ demonstrate a homomorphism from~$k_0$
+to~$k$, i.e.\ each item in the definition of a preskeleton
 homomorphism on Page~\pageref{def:preskeleton homomorphism} is
 satisfied.
 
 For the reverse direction, assume maps $\delta=(\phi,\sigma)$ are such
-that $k\homomorphism{\delta}k'$.  Then the desired variable assigment is
+that $k_0\homomorphism{\delta}k$.  Then the desired variable assigment is
 $$\alpha(x)=\left\{
 \begin{array}{ll}
 \phi(Z^{-1}(x))&x\in\sran(Z)\\
@@ -2236,10 +2286,10 @@
 defined on Page~\pageref{def:preskeleton denotation}.
 
 \begin{thm}\label{thm:sentence implies}
-Let $k\homomorphism{\delta_i}k_i$ be a complete set of homomorphisms
-for shapes $k_i\in K$, and assume $\sembrack{k}=\bigcup_{k'\in
-  K}\sembrack{k'}$.  Then the shape analysis
-sentence~$\Sigma=\sent(k\homomorphism{\delta_i}k_i)$ is satisfied in
+Let $k_0\homomorphism{\delta_i}k_i$ be a complete set of homomorphisms
+for shapes $k_i\in K$, and assume $\sembrack{k_0}=\bigcup_{k\in
+  K}\sembrack{k}$.  Then the shape analysis
+sentence~$\Sigma=\sent(k_0\homomorphism{\delta_i}k_i)$ is satisfied in
 all realized skeletons~$k$, i.e.\ $k\models\Sigma$.
 \end{thm}
 
@@ -2248,7 +2298,7 @@
 skeleton in the image of~$k$ that is not in the image of one of the
 shapes.  Therefore, by Theorem~\ref{thm:skeleton models}, the negation
 of the hypothesis of the implication is satisfied in all realized
-skeletons that are not in the image of~$k$, and the disjunction is
+skeletons that are not in the image of~$k_0$, and the disjunction is
 satisfied in the remaining realized skeletons.
 \end{proof}
 
diff --git a/doc/cpsatheory.pdf b/doc/cpsatheory.pdf
Binary files a/doc/cpsatheory.pdf and b/doc/cpsatheory.pdf differ
diff --git a/doc/cpsauser.html b/doc/cpsauser.html
--- a/doc/cpsauser.html
+++ b/doc/cpsauser.html
@@ -5,7 +5,7 @@
 <head>
   <meta http-equiv="content-type"
   content="application/xhtml+xml; charset=UTF-8" />
-  <title>CPSA 2.0 User Guide</title>
+  <title>CPSA 2.2 User Guide</title>
   <meta name="generator" content="Amaya 9.54, see http://www.w3.org/Amaya/" />
   <style type="text/css">
     h1 { text-align: center }
@@ -14,7 +14,7 @@
 </head>
 
 <body>
-<h1>CPSA 2.0 User Guide</h1>
+<h1>CPSA 2.2 User Guide</h1>
 
 <p>The Cryptographic Protocol Shapes Analyzer (CPSA) attempts to enumerate all
 essentially different executions possible for a cryptographic protocol. We call
@@ -157,7 +157,7 @@
 
 <blockquote>
   <pre>SORT ::= text | data | name | skey | akey | mesg
-TERM ::= ID | STRING | (cat TERM+) | (enc TERM+ TERM)
+TERM ::= ID | STRING | (cat TERM+) | (enc TERM+ TERM) | (hash TERM+)
       |  (pubk ID) | (privk ID) | (invk ID) | (ltk ID ID)
       |  (pubk STRING ID) | (privk STRING ID)</pre>
 </blockquote>
diff --git a/doc/macros.tex b/doc/macros.tex
--- a/doc/macros.tex
+++ b/doc/macros.tex
@@ -1,5 +1,5 @@
 \newcommand{\cpsa}{\textsc{cpsa}}
-\newcommand{\version}{2.2.4}
+\newcommand{\version}{2.2.5}
 \newcommand{\cpsacopying}{\begingroup
   \renewcommand{\thefootnote}{}\footnotetext{{\copyright} 2010 The
     MITRE Corporation.  Permission to copy without fee all or part of
@@ -15,6 +15,7 @@
 \newcommand{\fn}[1]{\ensuremath{\operatorname{\mathit{#1}}}}
 \newcommand{\seq}[1]{\ensuremath{\langle#1\rangle}}
 \newcommand{\enc}[2]{\ensuremath{\{\!|#1|\!\}_{#2}}}
+\newcommand{\hash}[1]{\ensuremath{\##1}}
 \newcommand{\comp}[2]{{\mathord{#1}}\circ{\mathord{#2}}}
 \newcommand{\sembrack}[1]{[\![#1]\!]}
 \newcommand{\semfn}[1]{\mathcal{#1}}
@@ -25,8 +26,8 @@
 \newcommand{\inbnd}{\mathord -}
 \newcommand{\outbnd}{\mathord +}
 \newcommand{\nat}{\mathbb{N}}
-\newcommand{\all}[1]{\forall#1\mathpunct{.}}
-\newcommand{\some}[1]{\exists#1\mathpunct{.}}
+\newcommand{\all}[1]{\mathop{\forall#1}}
+\newcommand{\some}[1]{\mathop{\exists#1}}
 \newcommand{\baseterms}{\mathbb{B}}
 \newcommand{\cons}{\mathbin{::}}
 \newcommand{\ith}{\imath^\mathrm{th}}
diff --git a/src/CPSA/Basic/Algebra.hs b/src/CPSA/Basic/Algebra.hs
--- a/src/CPSA/Basic/Algebra.hs
+++ b/src/CPSA/Basic/Algebra.hs
@@ -64,6 +64,7 @@
 -- Operations:
 --   cat : mesg X mesg -> mesg               Pairing
 --   enc : mesg X mesg -> mesg               Encryption
+--   hash : mesg X mesg -> mesg              Hashing
 --   string : mesg                           Tag constants
 --   ltk : name X name -> skey               Long term shared key
 --   pubk : name -> akey                     Public key of principal
@@ -82,6 +83,7 @@
 -- Operations:
 --   cat : mesg X mesg -> mesg               Pairing
 --   enc : mesg X mesg -> mesg               Encryption
+--   hash : mesg -> mesg                     Hashing
 --   string : mesg                           Tag constants
 --   ltk : name X name -> skey               Long term shared key
 --   pubk : name -> akey                     Public key of principal
@@ -107,6 +109,7 @@
     | Pubk                      -- Public asymmetric key of a principal
     | Cat                       -- Term concatenation (Pairing really)
     | Enc                       -- Encryption
+    | Hash                      -- Hashing
       deriving (Show, Eq, Ord, Enum, Bounded)
 
 -- A Basic Crypto Algebra Term
@@ -175,7 +178,7 @@
 -- The non-terminal symbols are B, K, and T.  Symbol B is for base
 -- sorted terms, and K is for asymmetric keys.
 --
---     T ::= I | C | B | cat(T, T) | enc(T, T)
+--     T ::= I | C | B | cat(T, T) | enc(T, T) | hash(T)
 --
 --     B ::= text(I) | data(I) | name(I) | skey(I)
 --        |  skey(I) | skey(ltk(I, I)) | akey(K)
@@ -212,6 +215,8 @@
     doubleTermWellFormed xts t0 t1  -- Concatenation
 termWellFormed xts (F Enc [t0, t1]) =
     doubleTermWellFormed xts t0 t1  -- Encryption
+termWellFormed xts (F Hash [t])     =
+    termWellFormed xts t            -- Hashing
 termWellFormed _ _ = Nothing
 
 -- Extend when sorts agree
@@ -262,6 +267,8 @@
     foldVars f (foldVars f acc t0) t1
 foldVars f acc (F Enc [t0, t1]) = -- Encryption
     foldVars f (foldVars f acc t0) t1
+foldVars f acc (F Hash [t])     = -- Hashing
+    foldVars f acc t
 foldVars _ _ t = error $ "Algebra.foldVars: Bad term " ++ show t
 
 -- Fold f through a term applying it to each term that is carried by the term.
@@ -296,6 +303,8 @@
           ba t0 && ba t1
       ba t@(F Enc [t0, t1]) =
           S.member t knowns || ba t0 && ba t1
+      ba t@(F Hash [t1]) =
+          S.member t knowns || ba t1
       ba t = isAtom t && not (S.member t unguessable)
 
 -- Compute the decomposition given some known terms and some unguessable
@@ -315,6 +324,8 @@
           | buildable knowns unguessable (inv t1) = -- Add plaintext
               loop unguessable (decat t0 knowns) old todo
           | otherwise = loop unguessable knowns old todo
+      loop unguessable knowns old ((F Hash [_]) : todo) =
+          loop unguessable knowns old todo -- Hash can't be decomposed
       loop unguessable knowns old (t : todo) =
           loop (S.delete t unguessable) (S.delete t knowns) old todo
       -- Decat
@@ -329,7 +340,8 @@
 inv t = t
 
 -- Extracts every encryption that is carried by a term along with its
--- encryption key.
+-- encryption key.  Note that a hash is treated as a kind of
+-- encryption in which the term that is hashed is the encryption key.
 encryptions :: Term -> [(Term, Term)]
 encryptions t =
     reverse $ loop t []
@@ -338,6 +350,8 @@
           loop t' (loop t acc)
       loop t@(F Enc [t', t'']) acc =
           loop t' (adjoin (t, t'') acc)
+      loop t@(F Hash [t']) acc =
+          adjoin (t, t') acc
       loop _ acc = acc
       adjoin x xs
           | x `elem` xs = xs
@@ -388,6 +402,8 @@
     comb (outFlow t1) (outFlow t0) a
 outFlow (F Enc [t0, t1]) a =
     comb (outFlow t1) (outFlow t0) a
+outFlow (F Hash [t]) a =
+    outFlow t a
 outFlow t (initial, available) = -- Don't look inside atoms
     S.singleton (S.insert t initial, S.insert t available)
 
@@ -399,11 +415,13 @@
          (comb (inFlow t1) (inFlow t0) a)
          (comb (inFlow t0) (inFlow t1) a)
 inFlow t@(F Enc [t0, t1]) (initial, available) =
-    S.union                     -- Encryption can be built
-         (outFlow t (initial, available)) -- or decrypted
-         (comb (inFlow t0) (outFlow (inv t1)) a)
+    S.union
+         (outFlow t (initial, available)) -- Encryption can be built
+         (comb (inFlow t0) (outFlow (inv t1)) a) -- or decrypted
     where                       -- Derive decryption key first
       a = (initial, S.insert t available)
+inFlow (F Hash [t0]) (initial, available) =
+    outFlow t0 (initial, available)
 inFlow t (initial, available) =
     S.singleton (initial, S.insert t available)
 
@@ -467,9 +485,9 @@
       f paths path source
           | target == source = Place (reverse path) : paths
       f paths path (F Cat [t, t']) =
-	  f (f paths  (0 : path) t) (1 : path) t'
+          f (f paths  (0 : path) t) (1 : path) t'
       f paths path (F Enc [t, _]) =
-	  f paths (0 : path) t
+          f paths (0 : path) t
       f paths _ _ = paths
 
 -- Return the ancestors of the term at the given place.
@@ -877,6 +895,7 @@
     ,("ltk", loadLtk)
     ,("cat", loadCat)
     ,("enc", loadEnc)
+    ,("hash", loadHash)
     ]
 
 -- Atom constructors: pubk privk invk ltk
@@ -943,6 +962,13 @@
       loop z x [] = (reverse z, x)
       loop z x (y : ys) = loop (x : z) y ys
 
+loadHash :: Monad m => LoadFunction m
+loadHash _ vars (l : ls) =
+   do
+     ts <- mapM (loadTerm vars) (l : ls)
+     return $ F Hash [foldr1 (\a b -> F Cat [a, b]) ts]
+loadHash pos _ _ = fail (shows pos "Malformed hash")
+
 -- Term specific displaying functions
 
 newtype Context = Context [(Id, String)] deriving Show
@@ -1002,6 +1028,8 @@
     L () (S () "cat" : displayTerm ctx t0 : displayList ctx t1)
 displayTerm ctx (F Enc [t0, t1]) =
     L () (S () "enc" : displayEnc ctx t0 t1)
+displayTerm ctx (F Hash [t]) =
+    L () (S () "hash" : displayList ctx t)
 displayTerm _ t = error ("Algebra.displayTerm: Bad term " ++ show t)
 
 displayList :: Context -> Term -> [SExpr ()]
diff --git a/src/CPSA/Lib/Displayer.hs b/src/CPSA/Lib/Displayer.hs
--- a/src/CPSA/Lib/Displayer.hs
+++ b/src/CPSA/Lib/Displayer.hs
@@ -71,7 +71,7 @@
 displayPreskel k rest =
     L () (S () "defskeleton" :
           S () (pname (protocol k)) :
-          L () (S () "vars" : displayVars ctx (L.sort vars)) :
+          L () (S () "vars" : displayVars ctx vars) :
           foldr f (displayRest k ctx rest) (insts k))
     where
       ctx = varsContext vars
diff --git a/src/CPSA/Lib/Strand.hs b/src/CPSA/Lib/Strand.hs
--- a/src/CPSA/Lib/Strand.hs
+++ b/src/CPSA/Lib/Strand.hs
@@ -72,6 +72,9 @@
 useCheckVars :: Bool
 useCheckVars = False
 
+useThinning :: Bool
+useThinning = False -- True
+
 usePruningDuringCollapsing :: Bool
 usePruningDuringCollapsing = False -- True
 
@@ -836,9 +839,9 @@
 -- at which each maybe uniquely originating term originates are filter
 -- out.
 
-ksubst :: Algebra t p g s e c => PRS t p g s e c ->
-          Bool -> (g, s) -> [PRS t p g s e c]
-ksubst (k0, k, n, phi, hsubst) validate (gen, subst) =
+ksubst :: Algebra t p g s e c => Bool -> PRS t p g s e c ->
+          (g, s) -> [PRS t p g s e c]
+ksubst validate (k0, k, n, phi, hsubst) (gen, subst) =
     do
       (gen', insts') <- foldMapM (substInst subst) gen (insts k)
       let non' = map (substitute subst) (knon k)
@@ -886,12 +889,13 @@
     Cause dir n (substitute subst t) (S.map (substitute subst) escape)
 
 -- A compression (s is to be eliminated)
-compress :: Algebra t p g s e c => PRS t p g s e c ->
+compress :: Algebra t p g s e c => Bool -> PRS t p g s e c ->
             Sid -> Sid -> [PRS t p g s e c]
-compress (k0, k, n, phi, hsubst) s s' =
+compress validate (k0, k, n, phi, hsubst) s s' =
     do
       let perm = updatePerm s s' (strandids k)
-      orderings' <- normalizeOrderings (permuteOrderings perm (orderings k))
+      orderings' <- normalizeOrderings validate
+                    (permuteOrderings perm (orderings k))
       let k' =
               newPreskel
               (gen k)
@@ -918,9 +922,9 @@
           if j > old then j - 1 else j
 
 -- Eliminates implied intrastrand orderings and fails if it finds a
--- reverse intrastrand ordering.
-normalizeOrderings :: [Pair] -> [[Pair]]
-normalizeOrderings orderings =
+-- reverse intrastrand ordering when flag is true.
+normalizeOrderings :: Bool -> [Pair] -> [[Pair]]
+normalizeOrderings True orderings =
     loop [] orderings
     where
       loop acc [] = [acc]
@@ -928,6 +932,8 @@
           | s0 /= s1 = loop (p : acc) ps
           | p0 < p1 = loop acc ps
           | otherwise = []
+normalizeOrderings False orderings =
+    [filter (\ ((s0, _), (s1, _)) -> s0 /= s1) orderings]
 
 updateProb :: [Sid] -> [Sid] -> [Sid]
 updateProb mapping prob =
@@ -957,8 +963,8 @@
 hullByCompressing prune prs s s' =
     do
       (s'', s''', subst) <- unifyStrands (skel prs) s s'
-      prs <- ksubst prs False subst
-      prs' <- compress prs s'' s'''
+      prs <- ksubst False prs subst
+      prs' <- compress True prs s'' s'''
       hull prune prs'
 
 -- See if two strands unify.  They can be of differing heights.  The
@@ -997,7 +1003,7 @@
 hullByDeOrigination  prune prs u (s, p) (s', p') =
     do
       subst <- deOrig (skel prs) u (s, p) ++ deOrig (skel prs) u (s', p')
-      prs <- ksubst prs False subst
+      prs <- ksubst False prs subst
       hull prune prs
 
 deOrig :: Algebra t p g s e c => Preskel t p g s e c -> t -> Node -> [(g, s)]
@@ -1043,7 +1049,9 @@
 
 maybePrune :: Algebra t p g s e c => Bool -> PRS t p g s e c ->
               [PRS t p g s e c]
-maybePrune True prs = prune prs
+maybePrune True prs
+  | useThinning = thin prs
+  | otherwise = prune prs
 maybePrune False prs = reduce prs
 
 origNode :: Algebra t p g s e c => Preskel t p g s e c ->
@@ -1138,8 +1146,8 @@
       case not usePruningUnboundCheck || unboundCheck k s s' env' of
         True -> return ()
         False -> fail ""
-      prs <- ksubst prs True (gen', substitution env')
-      compress prs s s'
+      prs <- ksubst True prs (gen', substitution env')
+      compress True prs s s'
 
 matchTraces :: Algebra t p g s e c => Trace t p g s e c ->
                Trace t p g s e c -> (g, e) -> [(g, e)]
@@ -1205,6 +1213,58 @@
           | otherwise =
               loop (addIvars xs i) is (s'' + 1)
 
+-- Thinning
+
+thin :: Algebra t p g s e c => PRS t p g s e c -> [PRS t p g s e c]
+thin prs =
+    thinStrands prs $ reverse ss
+    where                       -- Remove strands in image of POV
+      ss = filter (\s -> notElem s (prob $ skel prs)) (strandids $ skel prs)
+
+
+thinStrands :: Algebra t p g s e c => PRS t p g s e c ->
+               [Sid] -> [PRS t p g s e c]
+thinStrands prs [] =
+  reduce prs
+thinStrands prs (s:ss) =
+  thinStrandPairs prs s ss ss
+
+thinStrandPairs :: Algebra t p g s e c => PRS t p g s e c ->
+                   Sid -> [Sid] -> [Sid] -> [PRS t p g s e c]
+thinStrandPairs prs _ ss [] =
+  thinStrands prs ss
+thinStrandPairs prs s ss (s':ss') =
+  case thinStrand prs s s' of
+    [] -> thinStrandPairs prs s ss ss' -- Try next pair
+    prss ->                           -- Success
+      do
+        prs <- prss
+        thin prs
+
+thinStrand :: Algebra t p g s e c => PRS t p g s e c ->
+              Sid -> Sid -> [PRS t p g s e c]
+thinStrand prs s s' =
+  do
+    let k = skel prs
+    let i = strandInst k s
+    let i' = strandInst k s'
+    case height i /= height i' of
+      True -> fail ""
+      False -> return ()
+    env <- matchTraces (trace i) (trace i') (gen k, emptyEnv)
+    (gen', env') <- idempotentEnvFor env
+                    (concatMap (tterms . trace) $ deleteNth s $ insts k)
+    case matchRenaming (gen', env') of
+      True -> return ()
+      False -> fail ""
+    case origCheck k env' of
+      True -> return ()
+      False -> fail ""
+    [ prs' | prs <- ksubst False prs (gen', substitution env'),
+             prs' <- compress False prs s s',
+             prs'' <- compress False prs s' s,
+             gist (skel prs') == gist (skel prs'')]
+
 -- Transitive Reduction
 
 -- An edge is essential if its removal eliminates all paths from its
@@ -1274,8 +1334,8 @@
             Cause t p g s e c -> (g, s) -> [Ans t p g s e c]
 contract k n cause subst =
     do
-      prs <- ksubst (k, k { operation = Contracted emptySubst cause },
-                     n, strandids k, emptySubst) False subst
+      prs <- ksubst False (k, k { operation = Contracted emptySubst cause },
+                           n, strandids k, emptySubst) subst
       prs' <- hull usePruningWhileSolving prs
       homomorphismFilter prs'
 
@@ -1324,8 +1384,8 @@
 substAndAugment k n cause role subst inst =
     do
       let operation' = AddedStrand (rname role) (height inst) cause
-      prs <- ksubst (k, k { operation = operation' }, n,
-                     strandids k, emptySubst) False subst
+      prs <- ksubst False (k, k { operation = operation' }, n,
+                           strandids k, emptySubst) subst
       aug prs inst
 
 -- Apply the augmentation operator by adding an instance and one
@@ -1375,8 +1435,8 @@
     do
       (s, s', subst) <- unifyStrands k s s'
       let op = addedToDisplaced (operation k) s s'
-      prs <- ksubst (k0, k { operation = op}, n, phi, hsubst) False subst
-      prs <- compress prs s s'
+      prs <- ksubst False (k0, k { operation = op}, n, phi, hsubst) subst
+      prs <- compress True prs s s'
       hull usePruningWhileSolving prs
 
 addedToDisplaced :: Algebra t p g s e c => Operation t p g s e c ->
@@ -1783,8 +1843,8 @@
 collapseStrands k s s' =
     do
       (s, s', subst) <- unifyStrands k s s'
-      prs <- ksubst (k, k { operation = Collapsed s s' },
-                     (0, 0), strandids k, emptySubst) False subst
-      prs <- compress prs s s'
+      prs <- ksubst False (k, k { operation = Collapsed s s' },
+                           (0, 0), strandids k, emptySubst) subst
+      prs <- compress True prs s s'
       prs <- hull usePruningDuringCollapsing prs
       return $ skel prs
diff --git a/src/CPSA/SimpleDiffieHellman/Algebra.hs b/src/CPSA/SimpleDiffieHellman/Algebra.hs
--- a/src/CPSA/SimpleDiffieHellman/Algebra.hs
+++ b/src/CPSA/SimpleDiffieHellman/Algebra.hs
@@ -72,6 +72,7 @@
 -- Operations:
 --   cat : mesg X mesg -> mesg               Pairing
 --   enc : mesg X mesg -> mesg               Encryption
+--   hash : mesg X mesg -> mesg              Hashing
 --   string : mesg                           Tag constants
 --   ltk : name X name -> skey               Long term shared key
 --   pubk : name -> akey                     Public key of principal
@@ -92,6 +93,7 @@
 -- Operations:
 --   cat : mesg X mesg -> mesg               Pairing
 --   enc : mesg X mesg -> mesg               Encryption
+--   hash : mesg -> mesg                     Hashing
 --   string : mesg                           Tag constants
 --   ltk : name X name -> skey               Long term shared key
 --   pubk : name -> akey                     Public key of principal
@@ -127,6 +129,7 @@
     | Exp                       -- Exponentiation function symbol
     | Cat                       -- Term concatenation (Pairing really)
     | Enc                       -- Encryption
+    | Hash                      -- Hashing
       deriving (Show, Eq, Ord, Enum, Bounded)
 
 -- A Basic Crypto Algebra Term
@@ -242,7 +245,7 @@
 -- sorted terms, K is for asymmetric keys, E is for the base of an
 -- exponent.
 --
---     T ::= I | C | B | cat(T, T) | enc(T, T)
+--     T ::= I | C | B | cat(T, T) | enc(T, T) | hash(T)
 --
 --     B ::= text(I) | data(I) | name(I) | skey(I)
 --        |  skey(I) | skey(ltk(I, I)) | akey(K) | base(E) | expn(I)
@@ -292,6 +295,8 @@
     doubleTermWellFormed xts t0 t1  -- Concatenation
 termWellFormed xts (F Enc [t0, t1]) =
     doubleTermWellFormed xts t0 t1  -- Encryption
+termWellFormed xts (F Hash [t])     =
+    termWellFormed xts t            -- Hashing
 termWellFormed _ _ = Nothing
 
 -- Extend when sorts agree
@@ -348,6 +353,8 @@
     foldVars f (foldVars f acc t0) t1
 foldVars f acc (F Enc [t0, t1]) = -- Encryption
     foldVars f (foldVars f acc t0) t1
+foldVars f acc (F Hash [t])     = -- Hashing
+    foldVars f acc t
 foldVars _ _ t = error $ "Algebra.foldVars: Bad term " ++ show t
 
 -- Fold f through a term applying it to each term that is held by the
@@ -403,6 +410,8 @@
       ba (C _) = True           -- So is a tag
       ba (F Cat [t0, t1]) =
           ba t0 && ba t1
+      ba t@(F Hash [t1]) =
+          S.member t knowns || ba t1
       ba t@(F Enc [t0, t1]) =
           S.member t knowns || ba t0 && ba t1
       ba t@(F Base [t0]) =
@@ -434,6 +443,8 @@
           | buildable knowns unguessable (inv t1) = -- Add plaintext
               loop unguessable (decat t0 knowns) old todo
           | otherwise = loop unguessable knowns old todo
+      loop unguessable knowns old ((F Hash [_]) : todo) =
+          loop unguessable knowns old todo -- Hash can't be decomposed
       loop unguessable knowns old ((F Base [F Exp [_, _]]) : todo) =
           loop unguessable knowns old todo
       loop unguessable knowns old (t : todo) =
@@ -450,7 +461,9 @@
 inv t = t
 
 -- Extracts every encryption that is carried by a term along with its
--- encryption key.  (This needs more work.)
+-- encryption key.  Note that a hash is treated as a kind of
+-- encryption in which the term that is hashed is the encryption key.
+-- (This needs more work.)
 encryptions :: Term -> [(Term, Term)]
 encryptions t =
     reverse $ loop t []
@@ -459,6 +472,8 @@
           loop t' (loop t acc)
       loop t@(F Enc [t', t'']) acc =
           loop t' (adjoin (t, t'') acc)
+      loop t@(F Hash [t']) acc =
+          adjoin (t, t') acc
       loop t@(F Base [F Exp [F Exp [t', t''], t''']]) acc =
           adjoin (e, F Expn [t'']) (adjoin (t, F Expn [t''']) acc)
           where
@@ -522,6 +537,8 @@
     comb (outFlow t1) (outFlow t0) a
 outFlow (F Enc [t0, t1]) a =
     comb (outFlow t1) (outFlow t0) a
+outFlow (F Hash [t]) a =
+    outFlow t a
 outFlow (F Base [F Exp [t0, t1]]) a =
     comb (outFlow (F Base [t0])) (outFlow (F Expn [t1])) a
 outFlow t (initial, available) = -- Don't look inside atoms
@@ -536,13 +553,15 @@
          (comb (inFlow t1) (inFlow t0) a)
          (comb (inFlow t0) (inFlow t1) a)
 inFlow t@(F Enc [t0, t1]) (initial, available) =
-    S.union                     -- Encryption can be built
-         (outFlow t (initial, available)) -- or decrypted
-         (comb (inFlow t0) (outFlow (inv t1)) a)
+    S.union
+         (outFlow t (initial, available)) -- Encryption can be built
+         (comb (inFlow t0) (outFlow (inv t1)) a) -- or decrypted
     where                       -- Derive decryption key first
       a = (initial, S.insert t available)
 inFlow t@(F Base [F Exp [_, _]]) a =
     outFlow t a                 -- Can be built
+inFlow (F Hash [t0]) (initial, available) =
+    outFlow t0 (initial, available)
 inFlow t (initial, available) =
     S.singleton (initial, S.insert t available)
 
@@ -609,9 +628,9 @@
       f paths path source
           | target == source = Place (reverse path) : paths
       f paths path (F Cat [t, t']) =
-	  f (f paths  (0 : path) t) (1 : path) t'
+          f (f paths  (0 : path) t) (1 : path) t'
       f paths path (F Enc [t, _]) =
-	  f paths (0 : path) t
+          f paths (0 : path) t
       f paths path (F Base [t]) =
           exp paths (0 : path) t
           where
@@ -1056,6 +1075,7 @@
     ,("exp", loadExp)
     ,("cat", loadCat)
     ,("enc", loadEnc)
+    ,("hash", loadHash)
     ]
 
 -- Atom constructors: pubk privk invk ltk
@@ -1153,6 +1173,13 @@
       loop z x [] = (reverse z, x)
       loop z x (y : ys) = loop (x : z) y ys
 
+loadHash :: Monad m => LoadFunction m
+loadHash _ vars (l : ls) =
+   do
+     ts <- mapM (loadTerm vars) (l : ls)
+     return $ F Hash [foldr1 (\a b -> F Cat [a, b]) ts]
+loadHash pos _ _ = fail (shows pos "Malformed hash")
+
 -- Term specific displaying functions
 
 newtype Context = Context [(Id, String)] deriving Show
@@ -1227,6 +1254,8 @@
     L () (S () "cat" : displayTerm ctx t0 : displayList ctx t1)
 displayTerm ctx (F Enc [t0, t1]) =
     L () (S () "enc" : displayEnc ctx t0 t1)
+displayTerm ctx (F Hash [t]) =
+    L () (S () "hash" : displayList ctx t)
 displayTerm _ t = error ("Algebra.displayTerm: Bad term " ++ show t)
 
 displayList :: Context -> Term -> [SExpr ()]
diff --git a/src/cpsa.pl b/src/cpsa.pl
--- a/src/cpsa.pl
+++ b/src/cpsa.pl
@@ -84,6 +84,12 @@
 	sexpr:sexpr_to_pretty(Sexpr, Pretty),
 	sexprs_to_cpsa_pretty(Sexprs, Pretties).
 
+%% Programmer's hint--test translations with the query:
+%%   cpsa:cpsa('../tst/blanchet.scm',A),
+%%   cpsa:cpsas_to_sexprs(A, B),
+%%   current_output(Out),
+%%   cpsa:cpsa_sexprs_pp(Out, B).
+
 %% Translate between S-expressions and an internal form.
 
 %% Currently, you have to read the code or look at output to
@@ -111,8 +117,10 @@
 	sexpr_to_strands(Rest, Strands, Alist),
 	lookup(precedes, Alist, Values),
 	edges(Values, Precedes),
-	lookup('non-orig', Alist, Nons),
-	lookup('uniq-orig', Alist, Uniqs).
+	lookup('non-orig', Alist, Snons),
+	sexprs_to_terms(Snons, Nons),
+	lookup('uniq-orig', Alist, Suniqs),
+	sexprs_to_terms(Suniqs, Uniqs).
 
 sexpr_to_roles([[defrole|Sexpr]|Rest], [Role|Roles]) :-
 	!,
@@ -120,12 +128,55 @@
 	sexpr_to_roles(Rest, Roles).
 sexpr_to_roles(_, []).
 
-sexpr_to_role([Name, [vars|Vars], [trace|Trace]|Alist],
+sexpr_to_role([Name, [vars|Vars], [trace|Strace]|Alist],
 	r(Name, Decls, Trace, Nons, Uniqs)) :-
 	decls(Vars, Decls),
-	lookup('non-orig', Alist, Nons),
-	lookup('uniq-orig', Alist, Uniqs).
+	sexprs_to_trace(Strace, Trace),
+	lookup('non-orig', Alist, Snons),
+	sexprs_to_terms(Snons, Nons),
+	lookup('uniq-orig', Alist, Suniqs),
+	sexprs_to_terms(Suniqs, Uniqs).
 
+sexprs_to_trace([], []).
+sexprs_to_trace([[send, Sexpr]|Strace], [send(Term)|Trace]) :-
+	sexpr_to_term(Sexpr, Term),
+	sexprs_to_trace(Strace, Trace).
+sexprs_to_trace([[recv, Sexpr]|Strace], [recv(Term)|Trace]) :-
+	sexpr_to_term(Sexpr, Term),
+	sexprs_to_trace(Strace, Trace).
+
+sexprs_to_terms([], []).
+sexprs_to_terms([Sterm|Sterms], [Term|Terms]) :-
+	sexpr_to_term(Sterm, Term),
+	sexprs_to_terms(Sterms, Terms).
+
+sexpr_to_term(Term, Term) :-
+	atom(Term).
+sexpr_to_term(Term, Term) :-
+	string(Term).
+sexpr_to_term([cat, Sterm], Term) :-
+	sexpr_to_term(Sterm, Term).
+sexpr_to_term([cat, Sterm1, Sterm2|Sterms], cat(Term1, Term)) :-
+	sexpr_to_term(Sterm1, Term1),
+	sexpr_to_term([cat, Sterm2|Sterms], Term).
+sexpr_to_term([hash|Sterms], hash(Term)) :-
+	sexpr_to_term([cat|Sterms], Term).
+sexpr_to_term([enc|Sterms], enc(Term, Key)) :-
+	split(Sterms, Cats, Sexpr),
+	sexpr_to_term(Sexpr, Key),
+	sexpr_to_term([cat|Cats], Term).
+sexpr_to_term([Fun|Sterms], Term) :-
+	atom(Fun),
+	Fun \= cat,
+	Fun \= hash,
+	Fun \= enc,
+	sexprs_to_terms(Sterms, Terms),
+	Term =.. [Fun|Terms].
+
+split([X, Y], [X], Y).
+split([X, Y|Z], [X|U], V) :-
+	split([Y|Z], U, V).
+
 sexpr_to_strands([[defstrand|Sexpr]|Rest], [Strand|Strands], Alist) :-
 	!,
 	sexpr_to_strand([defstrand|Sexpr], Strand),
@@ -139,8 +190,9 @@
 sexpr_to_strand([defstrand, Role, Height|Sexprs], s(Role, Height, Map)) :-
 	atom(Role),
 	integer(Height),
-	maplets(Sexprs, Map).
-sexpr_to_strand([deflistener, Term], l(Term)).
+	sexprs_to_map(Sexprs, Map).
+sexpr_to_strand([deflistener, Sexpr], l(Term)) :-
+	sexpr_to_term(Sexpr, Term).
 
 decls([], []).
 decls([Sexpr|Sexprs], [Decl|Decls]) :-
@@ -157,9 +209,10 @@
 	atom(Var),
 	decl_vars(Decl, Type, Vars).
 
-maplets([], []).
-maplets([[Key, Value]|Sexprs], [[Key|Value]|Map]) :-
-	maplets(Sexprs, Map).
+sexprs_to_map([], []).
+sexprs_to_map([[Key, Svalue]|Sexprs], [[Key|Value]|Map]) :-
+	sexpr_to_term(Svalue, Value),
+	sexprs_to_map(Sexprs, Map).
 
 lookup(_, [], []).
 lookup(Key, [[Key|Value]|Alist], Values) :-
@@ -208,24 +261,77 @@
 
 strands_to_sexprs([], Alist, Alist).
 strands_to_sexprs([Strand|Strands], Alist, [Sexpr|Sexprs]) :-
-	sexpr_to_strand(Sexpr, Strand),
+	strand_to_sexpr(Strand, Sexpr),
 	strands_to_sexprs(Strands, Alist, Sexprs).
 
+strand_to_sexpr(s(Role, Height, Map), [defstrand, Role, Height|Sexprs]) :-
+	map_to_sexprs(Map, Sexprs).
+strand_to_sexpr(l(Term), [deflistener, Sexpr]) :-
+	term_to_sexpr(Term, Sexpr).
+
+map_to_sexprs([], []).
+map_to_sexprs([[Key|Value]|Map], [[Key, Svalue]|Sexprs]) :-
+	term_to_sexpr(Value, Svalue),
+	map_to_sexprs(Map, Sexprs).
+
 roles_to_sexprs([], []).
 roles_to_sexprs([Role|Roles], [Sexpr|Sexprs]) :-
 	role_to_sexpr(Role, Sexpr),
 	roles_to_sexprs(Roles, Sexprs).
 
 role_to_sexpr(r(Name, Decls, Trace, Nons, Uniqs),
-	[defrole, Name, [vars|Vars], [trace|Trace]|Alist]) :-
+	[defrole, Name, [vars|Vars], [trace|Strace]|Alist]) :-
 	decls(Vars, Decls),
+	traces_to_sexprs(Trace, Strace),
 	origs(Nons, Uniqs, Alist).
 
+traces_to_sexprs([], []).
+traces_to_sexprs([send(Term)|Trace], [[send, Sterm]|Straces]) :-
+	term_to_sexpr(Term, Sterm),
+	traces_to_sexprs(Trace, Straces).
+traces_to_sexprs([recv(Term)|Trace], [[recv, Sterm]|Straces]) :-
+	term_to_sexpr(Term, Sterm),
+	traces_to_sexprs(Trace, Straces).
+
 origs([], Uniqs, Alist) :-
 	!,
 	uniq_origs(Uniqs, Alist).
-origs(Nons, Uniqs, [['non-orig'|Nons]|Alist]) :-
+origs(Nons, Uniqs, [['non-orig'|Snons]|Alist]) :-
+	terms_to_sexprs(Nons, Snons),
 	uniq_origs(Uniqs, Alist).
 
 uniq_origs([], []) :- !.
-uniq_origs(Uniqs, [['uniq-orig'|Uniqs]]).
+uniq_origs(Uniqs, [['uniq-orig'|Suniqs]]) :-
+	terms_to_sexprs(Uniqs, Suniqs).
+
+terms_to_sexprs([], []).
+terms_to_sexprs([Term|Terms], [Sexpr|Sexprs]) :-
+	term_to_sexpr(Term, Sexpr),
+	terms_to_sexprs(Terms, Sexprs).
+
+term_to_sexpr(Term, Term) :-
+	atom(Term).
+term_to_sexpr(Term, Term) :-
+	string(Term).
+term_to_sexpr(cat(Term1, Term2), [cat, Sterm1|Sterms]) :-
+	term_to_sexpr(Term1, Sterm1),
+	term_to_sexprs(Term2, Sterms).
+term_to_sexpr(hash(Term), [hash|Sterms]) :-
+	term_to_sexprs(Term, Sterms).
+term_to_sexpr(enc(Term, Key), [enc|All]) :-
+	term_to_sexpr(Key, Sexpr),
+	term_to_sexprs(Term, Sterms),
+	split(All, Sterms, Sexpr).
+term_to_sexpr(Term, [Fun|Sterms]) :-
+	Term =.. [Fun|Args],
+	Fun \= cat,
+	Fun \= hash,
+	Fun \= enc,
+	terms_to_sexprs(Args, Sterms).
+
+term_to_sexprs(cat(Term1, Term2), [Sterm1|Sterms]) :-
+	!,
+	term_to_sexpr(Term1, Sterm1),
+	term_to_sexprs(Term2, Sterms).
+term_to_sexprs(Term, [Sterm]) :-
+	term_to_sexpr(Term, Sterm).
diff --git a/tst/blanchet.scm b/tst/blanchet.scm
--- a/tst/blanchet.scm
+++ b/tst/blanchet.scm
@@ -3,52 +3,86 @@
 
 (defprotocol blanchet basic
   (defrole init
-    (vars (a b name) (s skey) (d text))
+    (vars (a b name) (s skey) (d data))
     (trace
      (send (enc (enc s (privk a)) (pubk b)))
      (recv (enc d s))))
   (defrole resp
-    (vars (a b name) (s skey) (d text))
+    (vars (a b name) (s skey) (d data))
     (trace
      (recv (enc (enc s (privk a)) (pubk b)))
-     (send (enc d s)))))
+     (send (enc d s))))
+  (comment "Blanchet's protocol using named asymmetric keys"))
 
 (defskeleton blanchet
-  (vars (a b name) (s skey) (d text))
+  (vars (a b name) (s skey) (d data))
   (defstrand init 2 (a a) (b b) (s s) (d d))
-  (non-orig (privk a) (privk b))
-  (uniq-orig s))
+  (non-orig (privk b))
+  (uniq-orig s)
+  (comment "Analyze from the initiator's perspective"))
 
 (defskeleton blanchet
-  (vars (a b name) (s skey) (d text))
+  (vars (a b name) (s skey) (d data))
   (defstrand init 2 (a a) (b b) (s s) (d d))
   (deflistener d)
-  (non-orig (privk a) (privk b))
-  (uniq-orig s d))
+  (non-orig (privk b))
+  (uniq-orig s d)
+  (comment "From the initiator's perspective, is the secret leaked?"))
 
 (defskeleton blanchet
-  (vars (a b name) (s skey) (d text))
+  (vars (a b name) (s skey) (d data))
   (defstrand resp 2 (a a) (b b) (s s) (d d))
   (non-orig (privk a) (privk b))
-  (uniq-orig s))
+  (uniq-orig s)
+  (comment "Analyze from the responder's perspective"))
 
 (defskeleton blanchet
-  (vars (a b name) (s skey) (d text))
+  (vars (a b name) (s skey) (d data))
   (defstrand resp 2 (a a) (b b) (s s) (d d))
   (deflistener d)
   (non-orig (privk a) (privk b))
-  (uniq-orig s d))
+  (uniq-orig s d)
+  (comment "From the responders's perspective, is the secret leaked?"))
 
-(defskeleton blanchet
-  (vars (a b name) (s skey) (d text))
-  (defstrand resp 2 (a a) (b b) (s s) (d d))
-  (deflistener d)
-  (non-orig (privk a))
-  (uniq-orig s d))
+(defprotocol blanchet-akey basic
+  (defrole init
+    (vars (a b akey) (s skey) (d data))
+    (trace
+     (send (enc (enc s (invk a)) b))
+     (recv (enc d s))))
+  (defrole resp
+    (vars (a b akey) (s skey) (d data))
+    (trace
+     (recv (enc (enc s (invk a)) b))
+     (send (enc d s))))
+  (comment "Blanchet's protocol using unnamed asymmetric keys"))
 
-(defskeleton blanchet
-  (vars (a b name) (s skey) (d text))
+(defskeleton blanchet-akey
+  (vars (a b akey) (s skey) (d data))
   (defstrand init 2 (a a) (b b) (s s) (d d))
+  (non-orig (invk b))
+  (uniq-orig s)
+  (comment "Analyze from the initiator's perspective"))
+
+(defskeleton blanchet-akey
+  (vars (a b akey) (s skey) (d data))
+  (defstrand init 2 (a a) (b b) (s s) (d d))
   (deflistener d)
-  (non-orig (privk b))
-  (uniq-orig s d))
+  (non-orig (invk b))
+  (uniq-orig s d)
+  (comment "From the initiator's perspective, is the secret leaked?"))
+
+(defskeleton blanchet-akey
+  (vars (a b akey) (s skey) (d data))
+  (defstrand resp 2 (a a) (b b) (s s) (d d))
+  (non-orig (invk a) (invk b))
+  (uniq-orig s)
+  (comment "Analyze from the responder's perspective"))
+
+(defskeleton blanchet-akey
+  (vars (a b akey) (s skey) (d data))
+  (defstrand resp 2 (a a) (b b) (s s) (d d))
+  (deflistener d)
+  (non-orig (invk a) (invk b))
+  (uniq-orig s d)
+  (comment "From the responders's perspective, is the secret leaked?"))
diff --git a/tst/blanchet.tst b/tst/blanchet.tst
--- a/tst/blanchet.tst
+++ b/tst/blanchet.tst
@@ -1,22 +1,24 @@
 (herald "Blanchet's Simple Example Protocol"
   (comment "There is a flaw in this protocol by design"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol blanchet basic
   (defrole init
-    (vars (a b name) (s skey) (d text))
+    (vars (a b name) (s skey) (d data))
     (trace (send (enc (enc s (privk a)) (pubk b))) (recv (enc d s))))
   (defrole resp
-    (vars (a b name) (s skey) (d text))
-    (trace (recv (enc (enc s (privk a)) (pubk b))) (send (enc d s)))))
+    (vars (a b name) (s skey) (d data))
+    (trace (recv (enc (enc s (privk a)) (pubk b))) (send (enc d s))))
+  (comment "Blanchet's protocol using named asymmetric keys"))
 
 (defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
+  (vars (d data) (a b name) (s skey))
   (defstrand init 2 (d d) (a a) (b b) (s s))
-  (non-orig (privk a) (privk b))
+  (non-orig (privk b))
   (uniq-orig s)
+  (comment "Analyze from the initiator's perspective")
   (traces ((send (enc (enc s (privk a)) (pubk b))) (recv (enc d s))))
   (label 0)
   (unrealized (0 1))
@@ -24,11 +26,11 @@
   (comment "2 in cohort - 2 not yet seen"))
 
 (defskeleton blanchet
-  (vars (d text) (a b a-0 b-0 name) (s skey))
+  (vars (d data) (a b a-0 b-0 name) (s skey))
   (defstrand init 2 (d d) (a a) (b b) (s s))
   (defstrand resp 2 (d d) (a a-0) (b b-0) (s s))
   (precedes ((0 0) (1 0)) ((1 1) (0 1)))
-  (non-orig (privk a) (privk b))
+  (non-orig (privk b))
   (uniq-orig s)
   (operation encryption-test (added-strand resp 2) (enc d s) (0 1))
   (traces ((send (enc (enc s (privk a)) (pubk b))) (recv (enc d s)))
@@ -39,11 +41,11 @@
   (comment "1 in cohort - 1 not yet seen"))
 
 (defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
+  (vars (d data) (a b name) (s skey))
   (defstrand init 2 (d d) (a a) (b b) (s s))
   (deflistener s)
   (precedes ((0 0) (1 0)) ((1 1) (0 1)))
-  (non-orig (privk a) (privk b))
+  (non-orig (privk b))
   (uniq-orig s)
   (operation encryption-test (added-listener s) (enc d s) (0 1))
   (traces ((send (enc (enc s (privk a)) (pubk b))) (recv (enc d s)))
@@ -54,11 +56,11 @@
   (comment "empty cohort"))
 
 (defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
+  (vars (d data) (a b name) (s skey))
   (defstrand init 2 (d d) (a a) (b b) (s s))
   (defstrand resp 2 (d d) (a a) (b b) (s s))
   (precedes ((0 0) (1 0)) ((1 1) (0 1)))
-  (non-orig (privk a) (privk b))
+  (non-orig (privk b))
   (uniq-orig s)
   (operation nonce-test (contracted (a-0 a) (b-0 b)) s (1 0)
     (enc (enc s (privk a)) (pubk b)))
@@ -75,18 +77,20 @@
 
 (defprotocol blanchet basic
   (defrole init
-    (vars (a b name) (s skey) (d text))
+    (vars (a b name) (s skey) (d data))
     (trace (send (enc (enc s (privk a)) (pubk b))) (recv (enc d s))))
   (defrole resp
-    (vars (a b name) (s skey) (d text))
-    (trace (recv (enc (enc s (privk a)) (pubk b))) (send (enc d s)))))
+    (vars (a b name) (s skey) (d data))
+    (trace (recv (enc (enc s (privk a)) (pubk b))) (send (enc d s))))
+  (comment "Blanchet's protocol using named asymmetric keys"))
 
 (defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
+  (vars (d data) (a b name) (s skey))
   (defstrand init 2 (d d) (a a) (b b) (s s))
   (deflistener d)
-  (non-orig (privk a) (privk b))
+  (non-orig (privk b))
   (uniq-orig d s)
+  (comment "From the initiator's perspective, is the secret leaked?")
   (traces ((send (enc (enc s (privk a)) (pubk b))) (recv (enc d s)))
     ((recv d) (send d)))
   (label 4)
@@ -95,12 +99,12 @@
   (comment "2 in cohort - 2 not yet seen"))
 
 (defskeleton blanchet
-  (vars (d text) (a b a-0 b-0 name) (s skey))
+  (vars (d data) (a b a-0 b-0 name) (s skey))
   (defstrand init 2 (d d) (a a) (b b) (s s))
   (deflistener d)
   (defstrand resp 2 (d d) (a a-0) (b b-0) (s s))
   (precedes ((0 0) (2 0)) ((2 1) (0 1)) ((2 1) (1 0)))
-  (non-orig (privk a) (privk b))
+  (non-orig (privk b))
   (uniq-orig d s)
   (operation encryption-test (added-strand resp 2) (enc d s) (0 1))
   (traces ((send (enc (enc s (privk a)) (pubk b))) (recv (enc d s)))
@@ -112,12 +116,12 @@
   (comment "1 in cohort - 1 not yet seen"))
 
 (defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
+  (vars (d data) (a b name) (s skey))
   (defstrand init 2 (d d) (a a) (b b) (s s))
   (deflistener d)
   (deflistener s)
   (precedes ((0 0) (2 0)) ((2 1) (0 1)))
-  (non-orig (privk a) (privk b))
+  (non-orig (privk b))
   (uniq-orig d s)
   (operation encryption-test (added-listener s) (enc d s) (0 1))
   (traces ((send (enc (enc s (privk a)) (pubk b))) (recv (enc d s)))
@@ -128,12 +132,12 @@
   (comment "empty cohort"))
 
 (defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
+  (vars (d data) (a b name) (s skey))
   (defstrand init 2 (d d) (a a) (b b) (s s))
   (deflistener d)
   (defstrand resp 2 (d d) (a a) (b b) (s s))
   (precedes ((0 0) (2 0)) ((2 1) (0 1)) ((2 1) (1 0)))
-  (non-orig (privk a) (privk b))
+  (non-orig (privk b))
   (uniq-orig d s)
   (operation nonce-test (contracted (a-0 a) (b-0 b)) s (2 0)
     (enc (enc s (privk a)) (pubk b)))
@@ -146,14 +150,14 @@
   (comment "1 in cohort - 1 not yet seen"))
 
 (defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
+  (vars (d data) (a b name) (s skey))
   (defstrand init 2 (d d) (a a) (b b) (s s))
   (deflistener d)
   (defstrand resp 2 (d d) (a a) (b b) (s s))
   (deflistener s)
   (precedes ((0 0) (2 0)) ((0 0) (3 0)) ((2 1) (0 1)) ((2 1) (1 0))
     ((3 1) (1 0)))
-  (non-orig (privk a) (privk b))
+  (non-orig (privk b))
   (uniq-orig d s)
   (operation nonce-test (added-listener s) d (1 0) (enc d s))
   (traces ((send (enc (enc s (privk a)) (pubk b))) (recv (enc d s)))
@@ -169,17 +173,19 @@
 
 (defprotocol blanchet basic
   (defrole init
-    (vars (a b name) (s skey) (d text))
+    (vars (a b name) (s skey) (d data))
     (trace (send (enc (enc s (privk a)) (pubk b))) (recv (enc d s))))
   (defrole resp
-    (vars (a b name) (s skey) (d text))
-    (trace (recv (enc (enc s (privk a)) (pubk b))) (send (enc d s)))))
+    (vars (a b name) (s skey) (d data))
+    (trace (recv (enc (enc s (privk a)) (pubk b))) (send (enc d s))))
+  (comment "Blanchet's protocol using named asymmetric keys"))
 
 (defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
+  (vars (d data) (a b name) (s skey))
   (defstrand resp 2 (d d) (a a) (b b) (s s))
   (non-orig (privk a) (privk b))
   (uniq-orig s)
+  (comment "Analyze from the responder's perspective")
   (traces ((recv (enc (enc s (privk a)) (pubk b))) (send (enc d s))))
   (label 9)
   (unrealized (0 0))
@@ -187,7 +193,7 @@
   (comment "1 in cohort - 1 not yet seen"))
 
 (defskeleton blanchet
-  (vars (d text) (a b b-0 name) (s skey))
+  (vars (d data) (a b b-0 name) (s skey))
   (defstrand resp 2 (d d) (a a) (b b) (s s))
   (defstrand init 1 (a a) (b b-0) (s s))
   (precedes ((1 0) (0 0)))
@@ -208,18 +214,20 @@
 
 (defprotocol blanchet basic
   (defrole init
-    (vars (a b name) (s skey) (d text))
+    (vars (a b name) (s skey) (d data))
     (trace (send (enc (enc s (privk a)) (pubk b))) (recv (enc d s))))
   (defrole resp
-    (vars (a b name) (s skey) (d text))
-    (trace (recv (enc (enc s (privk a)) (pubk b))) (send (enc d s)))))
+    (vars (a b name) (s skey) (d data))
+    (trace (recv (enc (enc s (privk a)) (pubk b))) (send (enc d s))))
+  (comment "Blanchet's protocol using named asymmetric keys"))
 
 (defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
+  (vars (d data) (a b name) (s skey))
   (defstrand resp 2 (d d) (a a) (b b) (s s))
   (deflistener d)
   (non-orig (privk a) (privk b))
   (uniq-orig d s)
+  (comment "From the responders's perspective, is the secret leaked?")
   (traces ((recv (enc (enc s (privk a)) (pubk b))) (send (enc d s)))
     ((recv d) (send d)))
   (label 11)
@@ -228,7 +236,7 @@
   (comment "Not a skeleton"))
 
 (defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
+  (vars (d data) (a b name) (s skey))
   (defstrand resp 2 (d d) (a a) (b b) (s s))
   (deflistener d)
   (precedes ((0 1) (1 0)))
@@ -243,7 +251,7 @@
   (comment "1 in cohort - 1 not yet seen"))
 
 (defskeleton blanchet
-  (vars (d text) (a b b-0 name) (s skey))
+  (vars (d data) (a b b-0 name) (s skey))
   (defstrand resp 2 (d d) (a a) (b b) (s s))
   (deflistener d)
   (defstrand init 1 (a a) (b b-0) (s s))
@@ -263,153 +271,269 @@
 
 (comment "Nothing left to do")
 
-(defprotocol blanchet basic
+(defprotocol blanchet-akey basic
   (defrole init
-    (vars (a b name) (s skey) (d text))
-    (trace (send (enc (enc s (privk a)) (pubk b))) (recv (enc d s))))
+    (vars (a b akey) (s skey) (d data))
+    (trace (send (enc (enc s (invk a)) b)) (recv (enc d s))))
   (defrole resp
-    (vars (a b name) (s skey) (d text))
-    (trace (recv (enc (enc s (privk a)) (pubk b))) (send (enc d s)))))
+    (vars (a b akey) (s skey) (d data))
+    (trace (recv (enc (enc s (invk a)) b)) (send (enc d s))))
+  (comment "Blanchet's protocol using unnamed asymmetric keys"))
 
-(defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
-  (defstrand resp 2 (d d) (a a) (b b) (s s))
-  (deflistener d)
-  (non-orig (privk a))
-  (uniq-orig d s)
-  (traces ((recv (enc (enc s (privk a)) (pubk b))) (send (enc d s)))
-    ((recv d) (send d)))
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b akey))
+  (defstrand init 2 (d d) (s s) (a a) (b b))
+  (non-orig (invk b))
+  (uniq-orig s)
+  (comment "Analyze from the initiator's perspective")
+  (traces ((send (enc (enc s (invk a)) b)) (recv (enc d s))))
   (label 14)
-  (unrealized (0 0) (1 0))
-  (preskeleton)
-  (comment "Not a skeleton"))
+  (unrealized (0 1))
+  (origs (s (0 0)))
+  (comment "2 in cohort - 2 not yet seen"))
 
-(defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
-  (defstrand resp 2 (d d) (a a) (b b) (s s))
-  (deflistener d)
-  (precedes ((0 1) (1 0)))
-  (non-orig (privk a))
-  (uniq-orig d s)
-  (traces ((recv (enc (enc s (privk a)) (pubk b))) (send (enc d s)))
-    ((recv d) (send d)))
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b a-0 b-0 akey))
+  (defstrand init 2 (d d) (s s) (a a) (b b))
+  (defstrand resp 2 (d d) (s s) (a a-0) (b b-0))
+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))
+  (non-orig (invk b))
+  (uniq-orig s)
+  (operation encryption-test (added-strand resp 2) (enc d s) (0 1))
+  (traces ((send (enc (enc s (invk a)) b)) (recv (enc d s)))
+    ((recv (enc (enc s (invk a-0)) b-0)) (send (enc d s))))
   (label 15)
   (parent 14)
-  (unrealized (0 0))
-  (origs (d (0 1)))
+  (unrealized (1 0))
   (comment "1 in cohort - 1 not yet seen"))
 
-(defskeleton blanchet
-  (vars (d text) (a b b-0 name) (s skey))
-  (defstrand resp 2 (d d) (a a) (b b) (s s))
-  (deflistener d)
-  (defstrand init 1 (a a) (b b-0) (s s))
-  (precedes ((0 1) (1 0)) ((2 0) (0 0)))
-  (non-orig (privk a))
-  (uniq-orig d s)
-  (operation encryption-test (added-strand init 1) (enc s (privk a))
-    (0 0))
-  (traces ((recv (enc (enc s (privk a)) (pubk b))) (send (enc d s)))
-    ((recv d) (send d)) ((send (enc (enc s (privk a)) (pubk b-0)))))
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b akey))
+  (defstrand init 2 (d d) (s s) (a a) (b b))
+  (deflistener s)
+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))
+  (non-orig (invk b))
+  (uniq-orig s)
+  (operation encryption-test (added-listener s) (enc d s) (0 1))
+  (traces ((send (enc (enc s (invk a)) b)) (recv (enc d s)))
+    ((recv s) (send s)))
   (label 16)
+  (parent 14)
+  (unrealized (1 0))
+  (comment "empty cohort"))
+
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b akey))
+  (defstrand init 2 (d d) (s s) (a a) (b b))
+  (defstrand resp 2 (d d) (s s) (a a) (b b))
+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))
+  (non-orig (invk b))
+  (uniq-orig s)
+  (operation nonce-test (contracted (a-0 a) (b-0 b)) s (1 0)
+    (enc (enc s (invk a)) b))
+  (traces ((send (enc (enc s (invk a)) b)) (recv (enc d s)))
+    ((recv (enc (enc s (invk a)) b)) (send (enc d s))))
+  (label 17)
   (parent 15)
   (unrealized)
   (shape)
-  (maps ((0 1) ((a a) (b b) (s s) (d d))))
-  (origs (s (2 0)) (d (0 1))))
+  (maps ((0) ((a a) (b b) (s s) (d d))))
+  (origs (s (0 0))))
 
 (comment "Nothing left to do")
 
-(defprotocol blanchet basic
+(defprotocol blanchet-akey basic
   (defrole init
-    (vars (a b name) (s skey) (d text))
-    (trace (send (enc (enc s (privk a)) (pubk b))) (recv (enc d s))))
+    (vars (a b akey) (s skey) (d data))
+    (trace (send (enc (enc s (invk a)) b)) (recv (enc d s))))
   (defrole resp
-    (vars (a b name) (s skey) (d text))
-    (trace (recv (enc (enc s (privk a)) (pubk b))) (send (enc d s)))))
+    (vars (a b akey) (s skey) (d data))
+    (trace (recv (enc (enc s (invk a)) b)) (send (enc d s))))
+  (comment "Blanchet's protocol using unnamed asymmetric keys"))
 
-(defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
-  (defstrand init 2 (d d) (a a) (b b) (s s))
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b akey))
+  (defstrand init 2 (d d) (s s) (a a) (b b))
   (deflistener d)
-  (non-orig (privk b))
+  (non-orig (invk b))
   (uniq-orig d s)
-  (traces ((send (enc (enc s (privk a)) (pubk b))) (recv (enc d s)))
+  (comment "From the initiator's perspective, is the secret leaked?")
+  (traces ((send (enc (enc s (invk a)) b)) (recv (enc d s)))
     ((recv d) (send d)))
-  (label 17)
+  (label 18)
   (unrealized (0 1))
   (origs (s (0 0)))
   (comment "2 in cohort - 2 not yet seen"))
 
-(defskeleton blanchet
-  (vars (d text) (a b a-0 b-0 name) (s skey))
-  (defstrand init 2 (d d) (a a) (b b) (s s))
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b a-0 b-0 akey))
+  (defstrand init 2 (d d) (s s) (a a) (b b))
   (deflistener d)
-  (defstrand resp 2 (d d) (a a-0) (b b-0) (s s))
+  (defstrand resp 2 (d d) (s s) (a a-0) (b b-0))
   (precedes ((0 0) (2 0)) ((2 1) (0 1)) ((2 1) (1 0)))
-  (non-orig (privk b))
+  (non-orig (invk b))
   (uniq-orig d s)
   (operation encryption-test (added-strand resp 2) (enc d s) (0 1))
-  (traces ((send (enc (enc s (privk a)) (pubk b))) (recv (enc d s)))
+  (traces ((send (enc (enc s (invk a)) b)) (recv (enc d s)))
     ((recv d) (send d))
-    ((recv (enc (enc s (privk a-0)) (pubk b-0))) (send (enc d s))))
-  (label 18)
-  (parent 17)
+    ((recv (enc (enc s (invk a-0)) b-0)) (send (enc d s))))
+  (label 19)
+  (parent 18)
   (unrealized (1 0) (2 0))
   (comment "1 in cohort - 1 not yet seen"))
 
-(defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
-  (defstrand init 2 (d d) (a a) (b b) (s s))
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b akey))
+  (defstrand init 2 (d d) (s s) (a a) (b b))
   (deflistener d)
   (deflistener s)
   (precedes ((0 0) (2 0)) ((2 1) (0 1)))
-  (non-orig (privk b))
+  (non-orig (invk b))
   (uniq-orig d s)
   (operation encryption-test (added-listener s) (enc d s) (0 1))
-  (traces ((send (enc (enc s (privk a)) (pubk b))) (recv (enc d s)))
+  (traces ((send (enc (enc s (invk a)) b)) (recv (enc d s)))
     ((recv d) (send d)) ((recv s) (send s)))
-  (label 19)
-  (parent 17)
+  (label 20)
+  (parent 18)
   (unrealized (2 0))
   (comment "empty cohort"))
 
-(defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
-  (defstrand init 2 (d d) (a a) (b b) (s s))
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b akey))
+  (defstrand init 2 (d d) (s s) (a a) (b b))
   (deflistener d)
-  (defstrand resp 2 (d d) (a a) (b b) (s s))
+  (defstrand resp 2 (d d) (s s) (a a) (b b))
   (precedes ((0 0) (2 0)) ((2 1) (0 1)) ((2 1) (1 0)))
-  (non-orig (privk b))
+  (non-orig (invk b))
   (uniq-orig d s)
   (operation nonce-test (contracted (a-0 a) (b-0 b)) s (2 0)
-    (enc (enc s (privk a)) (pubk b)))
-  (traces ((send (enc (enc s (privk a)) (pubk b))) (recv (enc d s)))
+    (enc (enc s (invk a)) b))
+  (traces ((send (enc (enc s (invk a)) b)) (recv (enc d s)))
     ((recv d) (send d))
-    ((recv (enc (enc s (privk a)) (pubk b))) (send (enc d s))))
-  (label 20)
-  (parent 18)
+    ((recv (enc (enc s (invk a)) b)) (send (enc d s))))
+  (label 21)
+  (parent 19)
   (unrealized (1 0))
   (comment "1 in cohort - 1 not yet seen"))
 
-(defskeleton blanchet
-  (vars (d text) (a b name) (s skey))
-  (defstrand init 2 (d d) (a a) (b b) (s s))
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b akey))
+  (defstrand init 2 (d d) (s s) (a a) (b b))
   (deflistener d)
-  (defstrand resp 2 (d d) (a a) (b b) (s s))
+  (defstrand resp 2 (d d) (s s) (a a) (b b))
   (deflistener s)
   (precedes ((0 0) (2 0)) ((0 0) (3 0)) ((2 1) (0 1)) ((2 1) (1 0))
     ((3 1) (1 0)))
-  (non-orig (privk b))
+  (non-orig (invk b))
   (uniq-orig d s)
   (operation nonce-test (added-listener s) d (1 0) (enc d s))
-  (traces ((send (enc (enc s (privk a)) (pubk b))) (recv (enc d s)))
+  (traces ((send (enc (enc s (invk a)) b)) (recv (enc d s)))
     ((recv d) (send d))
-    ((recv (enc (enc s (privk a)) (pubk b))) (send (enc d s)))
+    ((recv (enc (enc s (invk a)) b)) (send (enc d s)))
     ((recv s) (send s)))
-  (label 21)
-  (parent 20)
+  (label 22)
+  (parent 21)
   (unrealized (3 0))
   (comment "empty cohort"))
+
+(comment "Nothing left to do")
+
+(defprotocol blanchet-akey basic
+  (defrole init
+    (vars (a b akey) (s skey) (d data))
+    (trace (send (enc (enc s (invk a)) b)) (recv (enc d s))))
+  (defrole resp
+    (vars (a b akey) (s skey) (d data))
+    (trace (recv (enc (enc s (invk a)) b)) (send (enc d s))))
+  (comment "Blanchet's protocol using unnamed asymmetric keys"))
+
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b akey))
+  (defstrand resp 2 (d d) (s s) (a a) (b b))
+  (non-orig (invk a) (invk b))
+  (uniq-orig s)
+  (comment "Analyze from the responder's perspective")
+  (traces ((recv (enc (enc s (invk a)) b)) (send (enc d s))))
+  (label 23)
+  (unrealized (0 0))
+  (origs)
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b b-0 akey))
+  (defstrand resp 2 (d d) (s s) (a a) (b b))
+  (defstrand init 1 (s s) (a a) (b b-0))
+  (precedes ((1 0) (0 0)))
+  (non-orig (invk a) (invk b))
+  (uniq-orig s)
+  (operation encryption-test (added-strand init 1) (enc s (invk a))
+    (0 0))
+  (traces ((recv (enc (enc s (invk a)) b)) (send (enc d s)))
+    ((send (enc (enc s (invk a)) b-0))))
+  (label 24)
+  (parent 23)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (s s) (d d))))
+  (origs (s (1 0))))
+
+(comment "Nothing left to do")
+
+(defprotocol blanchet-akey basic
+  (defrole init
+    (vars (a b akey) (s skey) (d data))
+    (trace (send (enc (enc s (invk a)) b)) (recv (enc d s))))
+  (defrole resp
+    (vars (a b akey) (s skey) (d data))
+    (trace (recv (enc (enc s (invk a)) b)) (send (enc d s))))
+  (comment "Blanchet's protocol using unnamed asymmetric keys"))
+
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b akey))
+  (defstrand resp 2 (d d) (s s) (a a) (b b))
+  (deflistener d)
+  (non-orig (invk a) (invk b))
+  (uniq-orig d s)
+  (comment "From the responders's perspective, is the secret leaked?")
+  (traces ((recv (enc (enc s (invk a)) b)) (send (enc d s)))
+    ((recv d) (send d)))
+  (label 25)
+  (unrealized (0 0) (1 0))
+  (preskeleton)
+  (comment "Not a skeleton"))
+
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b akey))
+  (defstrand resp 2 (d d) (s s) (a a) (b b))
+  (deflistener d)
+  (precedes ((0 1) (1 0)))
+  (non-orig (invk a) (invk b))
+  (uniq-orig d s)
+  (traces ((recv (enc (enc s (invk a)) b)) (send (enc d s)))
+    ((recv d) (send d)))
+  (label 26)
+  (parent 25)
+  (unrealized (0 0))
+  (origs (d (0 1)))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton blanchet-akey
+  (vars (d data) (s skey) (a b b-0 akey))
+  (defstrand resp 2 (d d) (s s) (a a) (b b))
+  (deflistener d)
+  (defstrand init 1 (s s) (a a) (b b-0))
+  (precedes ((0 1) (1 0)) ((2 0) (0 0)))
+  (non-orig (invk a) (invk b))
+  (uniq-orig d s)
+  (operation encryption-test (added-strand init 1) (enc s (invk a))
+    (0 0))
+  (traces ((recv (enc (enc s (invk a)) b)) (send (enc d s)))
+    ((recv d) (send d)) ((send (enc (enc s (invk a)) b-0))))
+  (label 27)
+  (parent 26)
+  (unrealized)
+  (shape)
+  (maps ((0 1) ((a a) (b b) (s s) (d d))))
+  (origs (s (2 0)) (d (0 1))))
 
 (comment "Nothing left to do")
diff --git a/tst/completeness-test.tst b/tst/completeness-test.tst
--- a/tst/completeness-test.tst
+++ b/tst/completeness-test.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol completeness-test basic
diff --git a/tst/crushing.tst b/tst/crushing.tst
--- a/tst/crushing.tst
+++ b/tst/crushing.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol crushing basic
diff --git a/tst/dass_simple.tst b/tst/dass_simple.tst
--- a/tst/dass_simple.tst
+++ b/tst/dass_simple.tst
@@ -1,6 +1,6 @@
 (herald "Distributed Authentication Security Service Protocol Variants")
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol dass-simple basic
diff --git a/tst/denning-sacco.tst b/tst/denning-sacco.tst
--- a/tst/denning-sacco.tst
+++ b/tst/denning-sacco.tst
@@ -1,6 +1,6 @@
 (herald "Denning-Sacco Protocol")
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol denning-sacco basic
diff --git a/tst/deorig_contract.tst b/tst/deorig_contract.tst
--- a/tst/deorig_contract.tst
+++ b/tst/deorig_contract.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol deorig-contract basic
diff --git a/tst/deorig_simple.tst b/tst/deorig_simple.tst
--- a/tst/deorig_simple.tst
+++ b/tst/deorig_simple.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol deorig-simple basic
diff --git a/tst/dh_cert.tst b/tst/dh_cert.tst
--- a/tst/dh_cert.tst
+++ b/tst/dh_cert.tst
@@ -1,6 +1,6 @@
 (herald "Diffie-Hellman with Certificate" (algebra diffie-hellman))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol dh-cert diffie-hellman
diff --git a/tst/dhke.tst b/tst/dhke.tst
--- a/tst/dhke.tst
+++ b/tst/dhke.tst
@@ -1,6 +1,6 @@
 (herald "Diffie-Hellman Key Exchange" (algebra diffie-hellman))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol dhke diffie-hellman
diff --git a/tst/dy.tst b/tst/dy.tst
--- a/tst/dy.tst
+++ b/tst/dy.tst
@@ -1,6 +1,6 @@
 (herald "Example 1.3 from 1983 Dolev-Yao Paper")
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol dy basic
diff --git a/tst/encsig.tst b/tst/encsig.tst
--- a/tst/encsig.tst
+++ b/tst/encsig.tst
@@ -1,7 +1,7 @@
 (herald "Encrypted Signed Message Example"
   (comment "Shows examples of key usage of asymmetric keys"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol mult-keys-enc-sig basic
diff --git a/tst/epmo-hash.scm b/tst/epmo-hash.scm
new file mode 100644
--- /dev/null
+++ b/tst/epmo-hash.scm
@@ -0,0 +1,77 @@
+(herald "Electronic Purchase with Money Order Protocol with Key Hashing"
+  (comment "Annotated with trust management formulas"))
+
+(defprotocol epmo basic
+  (defrole bank
+    (vars (b c m name) (nc nm nb data) (price text))
+    (trace
+     (recv (enc c nc nm price (pubk b)))
+     (send (cat (enc (hash c nc nb nm price) (privk b))
+		(enc nc nb (pubk c))))
+     (recv (enc (hash b nb nm) (privk m))))
+    (uniq-orig nb)
+    (annotations b
+      (1
+        (implies
+          (and (forall ((pm name)) (says c (transfer b price pm nm)))
+            (forall ((pm name)) (says pm (transfer b price pm nm))))
+          (forall ((pm name)) (transfer b price pm nm))))
+      (2
+        (and (says c (transfer b price m nm))
+          (says m (transfer b price m nm))))))
+  (defrole customer
+    (vars (b c m name) (nb nc nm data) (goods price text))
+    (trace
+     (send (enc c nc goods price (pubk m)))
+     (recv (enc nc nm m goods price (pubk c)))
+     (send (enc c nc nm price (pubk b)))
+     (recv (cat (enc (hash c nc nb nm price) (privk b))
+		(enc nc nb (pubk c))))
+     (send (cat (enc (hash c nc nb nm price) (privk b)) nb)))
+    (uniq-orig nc)
+    (annotations c
+      (1
+        (says m
+          (forall ((pb name))
+            (implies (transfer pb price m nm) (ship m goods c)))))
+      (3
+        (says b
+          (implies
+            (and (forall ((pm name)) (says c (transfer b price pm nm)))
+              (forall ((pm name)) (says m (transfer b price pm nm))))
+            (transfer b price m nm))))
+      (4 (transfer b price m nm))))
+  (defrole merchant
+    (vars (b c m name) (nb nc nm data) (goods price text))
+    (trace
+     (recv (enc c nc goods price (pubk m)))
+     (send (enc nc nm m goods price (pubk c)))
+     (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+     (send (enc (hash b nb nm) (privk m))))
+    (uniq-orig nm)
+    (annotations m
+      (1
+        (forall ((pb name))
+          (implies (transfer pb price m nm) (ship m goods c))))
+      (2
+        (and
+          (says b
+            (implies
+              (and
+                (forall ((pm name)) (says c (transfer b price pm nm)))
+                (forall ((pm name)) (says m (transfer b price pm nm))))
+              (transfer b price m nm)))
+          (says c (transfer b price m nm))))
+      (3 (and (transfer b price m nm) (ship m goods c))))))
+
+(defskeleton epmo (vars (b c m name))
+  (defstrand customer 5 (b b) (c c) (m m))
+  (non-orig (privk b) (privk c) (privk m)))
+
+(defskeleton epmo (vars (b c m name) (goods name))
+  (defstrand bank 3 (b b) (c c) (m m))
+  (non-orig (privk b) (privk c) (privk m)))
+
+(defskeleton epmo (vars (b c m name))
+  (defstrand merchant 4 (b b) (c c) (m m))
+  (non-orig (privk b) (privk c) (privk m)))
diff --git a/tst/epmo-hash.tst b/tst/epmo-hash.tst
new file mode 100644
--- /dev/null
+++ b/tst/epmo-hash.tst
@@ -0,0 +1,691 @@
+(herald "Electronic Purchase with Money Order Protocol with Key Hashing"
+  (comment "Annotated with trust management formulas"))
+
+(comment "CPSA 2.2.5")
+(comment "All input read")
+
+(defprotocol epmo basic
+  (defrole bank
+    (vars (b c m name) (nc nm nb data) (price text))
+    (trace (recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))) (recv (enc (hash b nb nm) (privk m))))
+    (uniq-orig nb)
+    (annotations b
+      (1
+        (implies
+          (and (forall ((pm name)) (says c (transfer b price pm nm)))
+            (forall ((pm name)) (says pm (transfer b price pm nm))))
+          (forall ((pm name)) (transfer b price pm nm))))
+      (2
+        (and (says c (transfer b price m nm))
+          (says m (transfer b price m nm))))))
+  (defrole customer
+    (vars (b c m name) (nb nc nm data) (goods price text))
+    (trace (send (enc c nc goods price (pubk m)))
+      (recv (enc nc nm m goods price (pubk c)))
+      (send (enc c nc nm price (pubk b)))
+      (recv
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm price) (privk b)) nb)))
+    (uniq-orig nc)
+    (annotations c
+      (1
+        (says m
+          (forall ((pb name))
+            (implies (transfer pb price m nm) (ship m goods c)))))
+      (3
+        (says b
+          (implies
+            (and (forall ((pm name)) (says c (transfer b price pm nm)))
+              (forall ((pm name)) (says m (transfer b price pm nm))))
+            (transfer b price m nm)))) (4 (transfer b price m nm))))
+  (defrole merchant
+    (vars (b c m name) (nb nc nm data) (goods price text))
+    (trace (recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m))))
+    (uniq-orig nm)
+    (annotations m
+      (1
+        (forall ((pb name))
+          (implies (transfer pb price m nm) (ship m goods c))))
+      (2
+        (and
+          (says b
+            (implies
+              (and
+                (forall ((pm name)) (says c (transfer b price pm nm)))
+                (forall ((pm name)) (says m (transfer b price pm nm))))
+              (transfer b price m nm)))
+          (says c (transfer b price m nm))))
+      (3 (and (transfer b price m nm) (ship m goods c))))))
+
+(defskeleton epmo
+  (vars (goods price text) (nb nc nm data) (b c m name))
+  (defstrand customer 5 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nc)
+  (traces
+    ((send (enc c nc goods price (pubk m)))
+      (recv (enc nc nm m goods price (pubk c)))
+      (send (enc c nc nm price (pubk b)))
+      (recv
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm price) (privk b)) nb))))
+  (label 0)
+  (unrealized (0 1) (0 3))
+  (origs (nc (0 0)))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton epmo
+  (vars (goods price text) (nb nc nm nm-0 data) (b c m name))
+  (defstrand customer 5 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (defstrand merchant 2 (goods goods) (price price) (nc nc) (nm nm-0)
+    (c c) (m m))
+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nc nm-0)
+  (operation nonce-test (added-strand merchant 2) nc (0 1)
+    (enc c nc goods price (pubk m)))
+  (traces
+    ((send (enc c nc goods price (pubk m)))
+      (recv (enc nc nm m goods price (pubk c)))
+      (send (enc c nc nm price (pubk b)))
+      (recv
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm price) (privk b)) nb)))
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm-0 m goods price (pubk c)))))
+  (label 1)
+  (parent 0)
+  (unrealized (0 1) (0 3))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton epmo
+  (vars (goods price text) (nb nc nm data) (b c m name))
+  (defstrand customer 5 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (defstrand merchant 2 (goods goods) (price price) (nc nc) (nm nm)
+    (c c) (m m))
+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nc nm)
+  (operation nonce-test (contracted (nm-0 nm)) nc (0 1)
+    (enc nc nm m goods price (pubk c)) (enc c nc goods price (pubk m)))
+  (traces
+    ((send (enc c nc goods price (pubk m)))
+      (recv (enc nc nm m goods price (pubk c)))
+      (send (enc c nc nm price (pubk b)))
+      (recv
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm price) (privk b)) nb)))
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))))
+  (label 2)
+  (parent 1)
+  (unrealized (0 3))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton epmo
+  (vars (goods price text) (nb nc nm data) (b c m name))
+  (defstrand customer 5 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (defstrand merchant 2 (goods goods) (price price) (nc nc) (nm nm)
+    (c c) (m m))
+  (defstrand bank 2 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c))
+  (precedes ((0 0) (1 0)) ((1 1) (0 1)) ((1 1) (2 0)) ((2 1) (0 3)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nb nc nm)
+  (operation encryption-test (added-strand bank 2)
+    (enc (hash c nc nb nm price) (privk b)) (0 3))
+  (traces
+    ((send (enc c nc goods price (pubk m)))
+      (recv (enc nc nm m goods price (pubk c)))
+      (send (enc c nc nm price (pubk b)))
+      (recv
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm price) (privk b)) nb)))
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c))))
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c))))))
+  (label 3)
+  (parent 2)
+  (seen 4)
+  (unrealized (2 0))
+  (comment "2 in cohort - 1 not yet seen"))
+
+(defskeleton epmo
+  (vars (goods price text) (nb nc nm data) (b c m name))
+  (defstrand customer 5 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (defstrand merchant 2 (goods goods) (price price) (nc nc) (nm nm)
+    (c c) (m m))
+  (defstrand bank 2 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c))
+  (precedes ((0 0) (1 0)) ((0 2) (2 0)) ((1 1) (0 1)) ((2 1) (0 3)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nb nc nm)
+  (operation nonce-test (added-strand customer 3) nc (2 0)
+    (enc nc nm m goods price (pubk c)) (enc c nc goods price (pubk m)))
+  (traces
+    ((send (enc c nc goods price (pubk m)))
+      (recv (enc nc nm m goods price (pubk c)))
+      (send (enc c nc nm price (pubk b)))
+      (recv
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm price) (privk b)) nb)))
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c))))
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c))))))
+  (label 4)
+  (parent 3)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((b b) (c c) (m m) (nb nb) (nc nc) (nm nm) (goods goods)
+        (price price))))
+  (origs (nc (0 0)) (nb (2 1)) (nm (1 1))))
+
+(comment "Nothing left to do")
+
+(defprotocol epmo basic
+  (defrole bank
+    (vars (b c m name) (nc nm nb data) (price text))
+    (trace (recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))) (recv (enc (hash b nb nm) (privk m))))
+    (uniq-orig nb)
+    (annotations b
+      (1
+        (implies
+          (and (forall ((pm name)) (says c (transfer b price pm nm)))
+            (forall ((pm name)) (says pm (transfer b price pm nm))))
+          (forall ((pm name)) (transfer b price pm nm))))
+      (2
+        (and (says c (transfer b price m nm))
+          (says m (transfer b price m nm))))))
+  (defrole customer
+    (vars (b c m name) (nb nc nm data) (goods price text))
+    (trace (send (enc c nc goods price (pubk m)))
+      (recv (enc nc nm m goods price (pubk c)))
+      (send (enc c nc nm price (pubk b)))
+      (recv
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm price) (privk b)) nb)))
+    (uniq-orig nc)
+    (annotations c
+      (1
+        (says m
+          (forall ((pb name))
+            (implies (transfer pb price m nm) (ship m goods c)))))
+      (3
+        (says b
+          (implies
+            (and (forall ((pm name)) (says c (transfer b price pm nm)))
+              (forall ((pm name)) (says m (transfer b price pm nm))))
+            (transfer b price m nm)))) (4 (transfer b price m nm))))
+  (defrole merchant
+    (vars (b c m name) (nb nc nm data) (goods price text))
+    (trace (recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m))))
+    (uniq-orig nm)
+    (annotations m
+      (1
+        (forall ((pb name))
+          (implies (transfer pb price m nm) (ship m goods c))))
+      (2
+        (and
+          (says b
+            (implies
+              (and
+                (forall ((pm name)) (says c (transfer b price pm nm)))
+                (forall ((pm name)) (says m (transfer b price pm nm))))
+              (transfer b price m nm)))
+          (says c (transfer b price m nm))))
+      (3 (and (transfer b price m nm) (ship m goods c))))))
+
+(defskeleton epmo
+  (vars (price text) (nc nm nb data) (b c m name))
+  (defstrand bank 3 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c)
+    (m m))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nb)
+  (traces
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))) (recv (enc (hash b nb nm) (privk m)))))
+  (label 5)
+  (unrealized (0 2))
+  (origs (nb (0 1)))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton epmo
+  (vars (price goods price-0 text) (nc nm nb nc-0 data)
+    (b c m c-0 name))
+  (defstrand bank 3 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c)
+    (m m))
+  (defstrand merchant 4 (goods goods) (price price-0) (nb nb) (nc nc-0)
+    (nm nm) (b b) (c c-0) (m m))
+  (precedes ((0 1) (1 2)) ((1 1) (0 0)) ((1 3) (0 2)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nm nb)
+  (operation encryption-test (added-strand merchant 4)
+    (enc (hash b nb nm) (privk m)) (0 2))
+  (traces
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))) (recv (enc (hash b nb nm) (privk m))))
+    ((recv (enc c-0 nc-0 goods price-0 (pubk m)))
+      (send (enc nc-0 nm m goods price-0 (pubk c-0)))
+      (recv (cat (enc (hash c-0 nc-0 nb nm price-0) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m)))))
+  (label 6)
+  (parent 5)
+  (seen 7)
+  (unrealized (1 2))
+  (comment "2 in cohort - 1 not yet seen"))
+
+(defskeleton epmo
+  (vars (price goods text) (nc nm nb data) (b c m name))
+  (defstrand bank 3 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c)
+    (m m))
+  (defstrand merchant 4 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (precedes ((0 1) (1 2)) ((1 1) (0 0)) ((1 3) (0 2)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nm nb)
+  (operation encryption-test (added-strand bank 2)
+    (enc (hash c nc nb nm price) (privk b)) (1 2))
+  (traces
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))) (recv (enc (hash b nb nm) (privk m))))
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m)))))
+  (label 7)
+  (parent 6)
+  (unrealized (0 0) (1 2))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton epmo
+  (vars (price goods goods-0 price-0 text) (nc nm nb nm-0 data)
+    (b c m b-0 m-0 name))
+  (defstrand bank 3 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c)
+    (m m))
+  (defstrand merchant 4 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (defstrand customer 5 (goods goods-0) (price price-0) (nb nb) (nc nc)
+    (nm nm-0) (b b-0) (c c) (m m-0))
+  (precedes ((0 1) (2 3)) ((1 1) (0 0)) ((1 3) (0 2)) ((2 0) (1 0))
+    ((2 4) (1 2)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nc nm nb)
+  (operation nonce-test (added-strand customer 5) nb (1 2)
+    (enc nc nb (pubk c)))
+  (traces
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))) (recv (enc (hash b nb nm) (privk m))))
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m))))
+    ((send (enc c nc goods-0 price-0 (pubk m-0)))
+      (recv (enc nc nm-0 m-0 goods-0 price-0 (pubk c)))
+      (send (enc c nc nm-0 price-0 (pubk b-0)))
+      (recv
+        (cat (enc (hash c nc nb nm-0 price-0) (privk b-0))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm-0 price-0) (privk b-0)) nb))))
+  (label 8)
+  (parent 7)
+  (seen 9)
+  (unrealized (0 0) (2 3))
+  (comment "3 in cohort - 2 not yet seen"))
+
+(defskeleton epmo
+  (vars (price goods goods-0 text) (nc nm nb data) (b c m b-0 m-0 name))
+  (defstrand bank 3 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c)
+    (m m))
+  (defstrand merchant 4 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (defstrand customer 5 (goods goods-0) (price price) (nb nb) (nc nc)
+    (nm nm) (b b-0) (c c) (m m-0))
+  (precedes ((0 1) (2 3)) ((1 1) (0 0)) ((1 1) (2 1)) ((1 3) (0 2))
+    ((2 0) (1 0)) ((2 4) (1 2)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nc nm nb)
+  (operation encryption-test (added-strand bank 2)
+    (hash c nc nb nm price) (2 3))
+  (traces
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))) (recv (enc (hash b nb nm) (privk m))))
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m))))
+    ((send (enc c nc goods-0 price (pubk m-0)))
+      (recv (enc nc nm m-0 goods-0 price (pubk c)))
+      (send (enc c nc nm price (pubk b-0)))
+      (recv
+        (cat (enc (hash c nc nb nm price) (privk b-0))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm price) (privk b-0)) nb))))
+  (label 9)
+  (parent 8)
+  (unrealized (0 0) (2 1))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton epmo
+  (vars (price goods goods-0 price-0 text) (nc nm nb nm-0 data)
+    (b c m b-0 m-0 name))
+  (defstrand bank 3 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c)
+    (m m))
+  (defstrand merchant 4 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (defstrand customer 5 (goods goods-0) (price price-0) (nb nb) (nc nc)
+    (nm nm-0) (b b-0) (c c) (m m-0))
+  (deflistener (cat c nc nb nm-0 price-0))
+  (precedes ((0 1) (3 0)) ((1 1) (0 0)) ((1 3) (0 2)) ((2 0) (1 0))
+    ((2 4) (1 2)) ((3 1) (2 3)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nc nm nb)
+  (operation encryption-test (added-listener (cat c nc nb nm-0 price-0))
+    (hash c nc nb nm-0 price-0) (2 3))
+  (traces
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))) (recv (enc (hash b nb nm) (privk m))))
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m))))
+    ((send (enc c nc goods-0 price-0 (pubk m-0)))
+      (recv (enc nc nm-0 m-0 goods-0 price-0 (pubk c)))
+      (send (enc c nc nm-0 price-0 (pubk b-0)))
+      (recv
+        (cat (enc (hash c nc nb nm-0 price-0) (privk b-0))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm-0 price-0) (privk b-0)) nb)))
+    ((recv (cat c nc nb nm-0 price-0))
+      (send (cat c nc nb nm-0 price-0))))
+  (label 10)
+  (parent 8)
+  (unrealized (0 0) (3 0))
+  (comment "empty cohort"))
+
+(defskeleton epmo
+  (vars (price goods text) (nc nm nb data) (b c m b-0 name))
+  (defstrand bank 3 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c)
+    (m m))
+  (defstrand merchant 4 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (defstrand customer 5 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b-0) (c c) (m m))
+  (precedes ((0 1) (2 3)) ((1 1) (0 0)) ((1 1) (2 1)) ((1 3) (0 2))
+    ((2 0) (1 0)) ((2 4) (1 2)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nc nm nb)
+  (operation nonce-test (contracted (m-0 m) (goods-0 goods)) nm (2 1)
+    (enc nc nm m goods price (pubk c)))
+  (traces
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))) (recv (enc (hash b nb nm) (privk m))))
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m))))
+    ((send (enc c nc goods price (pubk m)))
+      (recv (enc nc nm m goods price (pubk c)))
+      (send (enc c nc nm price (pubk b-0)))
+      (recv
+        (cat (enc (hash c nc nb nm price) (privk b-0))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm price) (privk b-0)) nb))))
+  (label 11)
+  (parent 9)
+  (seen 12)
+  (unrealized (0 0))
+  (comment "2 in cohort - 1 not yet seen"))
+
+(defskeleton epmo
+  (vars (price goods text) (nc nm nb data) (b c m b-0 name))
+  (defstrand bank 3 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c)
+    (m m))
+  (defstrand merchant 4 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (defstrand customer 5 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b-0) (c c) (m m))
+  (precedes ((0 1) (2 3)) ((1 1) (2 1)) ((1 3) (0 2)) ((2 0) (1 0))
+    ((2 2) (0 0)) ((2 4) (1 2)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nc nm nb)
+  (operation nonce-test (added-strand customer 3) nm (0 0)
+    (enc nc nm m goods price (pubk c)))
+  (traces
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))) (recv (enc (hash b nb nm) (privk m))))
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m))))
+    ((send (enc c nc goods price (pubk m)))
+      (recv (enc nc nm m goods price (pubk c)))
+      (send (enc c nc nm price (pubk b-0)))
+      (recv
+        (cat (enc (hash c nc nb nm price) (privk b-0))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm price) (privk b-0)) nb))))
+  (label 12)
+  (parent 11)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (c c) (m m) (nc nc) (nm nm) (nb nb) (price price))))
+  (origs (nc (2 0)) (nb (0 1)) (nm (1 1))))
+
+(comment "Nothing left to do")
+
+(defprotocol epmo basic
+  (defrole bank
+    (vars (b c m name) (nc nm nb data) (price text))
+    (trace (recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))) (recv (enc (hash b nb nm) (privk m))))
+    (uniq-orig nb)
+    (annotations b
+      (1
+        (implies
+          (and (forall ((pm name)) (says c (transfer b price pm nm)))
+            (forall ((pm name)) (says pm (transfer b price pm nm))))
+          (forall ((pm name)) (transfer b price pm nm))))
+      (2
+        (and (says c (transfer b price m nm))
+          (says m (transfer b price m nm))))))
+  (defrole customer
+    (vars (b c m name) (nb nc nm data) (goods price text))
+    (trace (send (enc c nc goods price (pubk m)))
+      (recv (enc nc nm m goods price (pubk c)))
+      (send (enc c nc nm price (pubk b)))
+      (recv
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm price) (privk b)) nb)))
+    (uniq-orig nc)
+    (annotations c
+      (1
+        (says m
+          (forall ((pb name))
+            (implies (transfer pb price m nm) (ship m goods c)))))
+      (3
+        (says b
+          (implies
+            (and (forall ((pm name)) (says c (transfer b price pm nm)))
+              (forall ((pm name)) (says m (transfer b price pm nm))))
+            (transfer b price m nm)))) (4 (transfer b price m nm))))
+  (defrole merchant
+    (vars (b c m name) (nb nc nm data) (goods price text))
+    (trace (recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m))))
+    (uniq-orig nm)
+    (annotations m
+      (1
+        (forall ((pb name))
+          (implies (transfer pb price m nm) (ship m goods c))))
+      (2
+        (and
+          (says b
+            (implies
+              (and
+                (forall ((pm name)) (says c (transfer b price pm nm)))
+                (forall ((pm name)) (says m (transfer b price pm nm))))
+              (transfer b price m nm)))
+          (says c (transfer b price m nm))))
+      (3 (and (transfer b price m nm) (ship m goods c))))))
+
+(defskeleton epmo
+  (vars (goods price text) (nb nc nm data) (b c m name))
+  (defstrand merchant 4 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nm)
+  (traces
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m)))))
+  (label 13)
+  (unrealized (0 2))
+  (origs (nm (0 1)))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton epmo
+  (vars (goods price text) (nb nc nm data) (b c m name))
+  (defstrand merchant 4 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (defstrand bank 2 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c))
+  (precedes ((0 1) (1 0)) ((1 1) (0 2)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nb nm)
+  (operation encryption-test (added-strand bank 2)
+    (enc (hash c nc nb nm price) (privk b)) (0 2))
+  (traces
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m))))
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c))))))
+  (label 14)
+  (parent 13)
+  (unrealized (0 2) (1 0))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton epmo
+  (vars (goods price text) (nb nc nm data) (b c m b-0 name))
+  (defstrand merchant 4 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (defstrand bank 2 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c))
+  (defstrand customer 3 (goods goods) (price price) (nc nc) (nm nm)
+    (b b-0) (c c) (m m))
+  (precedes ((0 1) (2 1)) ((1 1) (0 2)) ((2 0) (0 0)) ((2 2) (1 0)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nb nc nm)
+  (operation nonce-test (added-strand customer 3) nm (1 0)
+    (enc nc nm m goods price (pubk c)))
+  (traces
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m))))
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))))
+    ((send (enc c nc goods price (pubk m)))
+      (recv (enc nc nm m goods price (pubk c)))
+      (send (enc c nc nm price (pubk b-0)))))
+  (label 15)
+  (parent 14)
+  (seen 16)
+  (unrealized (0 2))
+  (comment "2 in cohort - 1 not yet seen"))
+
+(defskeleton epmo
+  (vars (goods price text) (nb nc nm data) (b c b-0 m name))
+  (defstrand merchant 4 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b) (c c) (m m))
+  (defstrand bank 2 (price price) (nc nc) (nm nm) (nb nb) (b b) (c c))
+  (defstrand customer 5 (goods goods) (price price) (nb nb) (nc nc)
+    (nm nm) (b b-0) (c c) (m m))
+  (precedes ((0 1) (2 1)) ((1 1) (2 3)) ((2 0) (0 0)) ((2 2) (1 0))
+    ((2 4) (0 2)))
+  (non-orig (privk b) (privk c) (privk m))
+  (uniq-orig nb nc nm)
+  (operation nonce-test (added-strand customer 5) nb (0 2)
+    (enc nc nb (pubk c)))
+  (traces
+    ((recv (enc c nc goods price (pubk m)))
+      (send (enc nc nm m goods price (pubk c)))
+      (recv (cat (enc (hash c nc nb nm price) (privk b)) nb))
+      (send (enc (hash b nb nm) (privk m))))
+    ((recv (enc c nc nm price (pubk b)))
+      (send
+        (cat (enc (hash c nc nb nm price) (privk b))
+          (enc nc nb (pubk c)))))
+    ((send (enc c nc goods price (pubk m)))
+      (recv (enc nc nm m goods price (pubk c)))
+      (send (enc c nc nm price (pubk b-0)))
+      (recv
+        (cat (enc (hash c nc nb nm price) (privk b-0))
+          (enc nc nb (pubk c))))
+      (send (cat (enc (hash c nc nb nm price) (privk b-0)) nb))))
+  (label 16)
+  (parent 15)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((b b) (c c) (m m) (nb nb) (nc nc) (nm nm) (goods goods)
+        (price price))))
+  (origs (nc (2 0)) (nb (1 1)) (nm (0 1))))
+
+(comment "Nothing left to do")
diff --git a/tst/epmo-key-hash.tst b/tst/epmo-key-hash.tst
--- a/tst/epmo-key-hash.tst
+++ b/tst/epmo-key-hash.tst
@@ -1,7 +1,7 @@
 (herald "Electronic Purchase with Money Order Protocol with Key Hashing"
   (comment "Annotated with trust management formulas"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol epmo basic
diff --git a/tst/epmo.tst b/tst/epmo.tst
--- a/tst/epmo.tst
+++ b/tst/epmo.tst
@@ -1,7 +1,7 @@
 (herald "Electronic Purchase with Money Order Protocol"
   (comment "Annotated with trust management formulas"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol epmo basic
diff --git a/tst/epmo_acctnum-key-hash.tst b/tst/epmo_acctnum-key-hash.tst
--- a/tst/epmo_acctnum-key-hash.tst
+++ b/tst/epmo_acctnum-key-hash.tst
@@ -3,7 +3,7 @@
   (displacement)
   (comment "This version includes account numbers in exchanges"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 (comment "Displacement disabled")
 
diff --git a/tst/epmo_acctnum.tst b/tst/epmo_acctnum.tst
--- a/tst/epmo_acctnum.tst
+++ b/tst/epmo_acctnum.tst
@@ -2,7 +2,7 @@
   (displacement)
   (comment "This version includes account numbers in exchanges"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 (comment "Displacement disabled")
 
diff --git a/tst/ffgg.tst b/tst/ffgg.tst
--- a/tst/ffgg.tst
+++ b/tst/ffgg.tst
@@ -1,7 +1,7 @@
 (herald "The ffgg Protocol"
   (comment "From A Necessarily Parallel Attack by Jon K. Millen"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol ffgg basic
diff --git a/tst/fragile_pruning.tst b/tst/fragile_pruning.tst
--- a/tst/fragile_pruning.tst
+++ b/tst/fragile_pruning.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol fragile_pruning basic
diff --git a/tst/hashtest-key-hash.scm b/tst/hashtest-key-hash.scm
new file mode 100644
--- /dev/null
+++ b/tst/hashtest-key-hash.scm
@@ -0,0 +1,25 @@
+;;; Hashtest.scm is designed to test if the
+;;; hash is working properly.
+(herald "Hashtest")
+
+(defprotocol hashtest basic
+  (defrole init (vars (n data) (k akey))
+     (trace
+       (send (enc n k))
+       (recv (enc "h" n))
+     )
+     (uniq-orig n)
+     (non-orig (invk k))
+   )
+   (defrole resp (vars (k akey) (n data))
+     (trace
+       (recv (enc n k))
+       (send (enc "h" n))
+     )
+   )
+)
+
+(defskeleton hashtest
+   (vars)
+   (defstrand init 2)
+)
diff --git a/tst/hashtest-key-hash.tst b/tst/hashtest-key-hash.tst
new file mode 100644
--- /dev/null
+++ b/tst/hashtest-key-hash.tst
@@ -0,0 +1,73 @@
+(herald "Hashtest")
+
+(comment "CPSA 2.2.5")
+(comment "All input read")
+
+(defprotocol hashtest basic
+  (defrole init
+    (vars (n data) (k akey))
+    (trace (send (enc n k)) (recv (enc "h" n)))
+    (non-orig (invk k))
+    (uniq-orig n))
+  (defrole resp
+    (vars (k akey) (n data))
+    (trace (recv (enc n k)) (send (enc "h" n)))))
+
+(defskeleton hashtest
+  (vars (n data) (k akey))
+  (defstrand init 2 (n n) (k k))
+  (non-orig (invk k))
+  (uniq-orig n)
+  (traces ((send (enc n k)) (recv (enc "h" n))))
+  (label 0)
+  (unrealized (0 1))
+  (origs (n (0 0)))
+  (comment "2 in cohort - 2 not yet seen"))
+
+(defskeleton hashtest
+  (vars (n data) (k k-0 akey))
+  (defstrand init 2 (n n) (k k))
+  (defstrand resp 2 (n n) (k k-0))
+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))
+  (non-orig (invk k))
+  (uniq-orig n)
+  (operation encryption-test (added-strand resp 2) (enc "h" n) (0 1))
+  (traces ((send (enc n k)) (recv (enc "h" n)))
+    ((recv (enc n k-0)) (send (enc "h" n))))
+  (label 1)
+  (parent 0)
+  (unrealized (1 0))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton hashtest
+  (vars (n data) (k akey))
+  (defstrand init 2 (n n) (k k))
+  (deflistener n)
+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))
+  (non-orig (invk k))
+  (uniq-orig n)
+  (operation encryption-test (added-listener n) (enc "h" n) (0 1))
+  (traces ((send (enc n k)) (recv (enc "h" n))) ((recv n) (send n)))
+  (label 2)
+  (parent 0)
+  (unrealized (1 0))
+  (comment "empty cohort"))
+
+(defskeleton hashtest
+  (vars (n data) (k akey))
+  (defstrand init 2 (n n) (k k))
+  (defstrand resp 2 (n n) (k k))
+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))
+  (non-orig (invk k))
+  (uniq-orig n)
+  (operation nonce-test (contracted (k-0 k)) n (1 0) (enc n k))
+  (traces ((send (enc n k)) (recv (enc "h" n)))
+    ((recv (enc n k)) (send (enc "h" n))))
+  (label 3)
+  (parent 1)
+  (unrealized)
+  (shape)
+  (maps ((0) ((n n) (k k))))
+  (origs (n (0 0))))
+
+(comment "Nothing left to do")
diff --git a/tst/hashtest.scm b/tst/hashtest.scm
new file mode 100644
--- /dev/null
+++ b/tst/hashtest.scm
@@ -0,0 +1,25 @@
+;;; Hashtest.scm is designed to test if the
+;;; hash is working properly.
+(herald "Hashtest")
+
+(defprotocol hashtest basic
+  (defrole init (vars (n data) (k akey))
+     (trace
+       (send (enc n k))
+       (recv (hash n))
+     )
+     (uniq-orig n)
+     (non-orig (invk k))
+   )
+   (defrole resp (vars (k akey) (n data))
+     (trace
+       (recv (enc n k))
+       (send (hash n))
+     )
+   )
+)
+
+(defskeleton hashtest
+   (vars)
+   (defstrand init 2)
+)
diff --git a/tst/hashtest.tst b/tst/hashtest.tst
new file mode 100644
--- /dev/null
+++ b/tst/hashtest.tst
@@ -0,0 +1,73 @@
+(herald "Hashtest")
+
+(comment "CPSA 2.2.5")
+(comment "All input read")
+
+(defprotocol hashtest basic
+  (defrole init
+    (vars (n data) (k akey))
+    (trace (send (enc n k)) (recv (hash n)))
+    (non-orig (invk k))
+    (uniq-orig n))
+  (defrole resp
+    (vars (k akey) (n data))
+    (trace (recv (enc n k)) (send (hash n)))))
+
+(defskeleton hashtest
+  (vars (n data) (k akey))
+  (defstrand init 2 (n n) (k k))
+  (non-orig (invk k))
+  (uniq-orig n)
+  (traces ((send (enc n k)) (recv (hash n))))
+  (label 0)
+  (unrealized (0 1))
+  (origs (n (0 0)))
+  (comment "2 in cohort - 2 not yet seen"))
+
+(defskeleton hashtest
+  (vars (n data) (k k-0 akey))
+  (defstrand init 2 (n n) (k k))
+  (defstrand resp 2 (n n) (k k-0))
+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))
+  (non-orig (invk k))
+  (uniq-orig n)
+  (operation encryption-test (added-strand resp 2) (hash n) (0 1))
+  (traces ((send (enc n k)) (recv (hash n)))
+    ((recv (enc n k-0)) (send (hash n))))
+  (label 1)
+  (parent 0)
+  (unrealized (1 0))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton hashtest
+  (vars (n data) (k akey))
+  (defstrand init 2 (n n) (k k))
+  (deflistener n)
+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))
+  (non-orig (invk k))
+  (uniq-orig n)
+  (operation encryption-test (added-listener n) (hash n) (0 1))
+  (traces ((send (enc n k)) (recv (hash n))) ((recv n) (send n)))
+  (label 2)
+  (parent 0)
+  (unrealized (1 0))
+  (comment "empty cohort"))
+
+(defskeleton hashtest
+  (vars (n data) (k akey))
+  (defstrand init 2 (n n) (k k))
+  (defstrand resp 2 (n n) (k k))
+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))
+  (non-orig (invk k))
+  (uniq-orig n)
+  (operation nonce-test (contracted (k-0 k)) n (1 0) (enc n k))
+  (traces ((send (enc n k)) (recv (hash n)))
+    ((recv (enc n k)) (send (hash n))))
+  (label 3)
+  (parent 1)
+  (unrealized)
+  (shape)
+  (maps ((0) ((n n) (k k))))
+  (origs (n (0 0))))
+
+(comment "Nothing left to do")
diff --git a/tst/isoreject.tst b/tst/isoreject.tst
--- a/tst/isoreject.tst
+++ b/tst/isoreject.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol isoreject basic
diff --git a/tst/kelly1.tst b/tst/kelly1.tst
--- a/tst/kelly1.tst
+++ b/tst/kelly1.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol kelly1 basic
diff --git a/tst/kerberos.tst b/tst/kerberos.tst
--- a/tst/kerberos.tst
+++ b/tst/kerberos.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol kerberos basic
diff --git a/tst/missing_contraction.tst b/tst/missing_contraction.tst
--- a/tst/missing_contraction.tst
+++ b/tst/missing_contraction.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol missing-contraction basic
diff --git a/tst/neuman-stubblebine-reauth.tst b/tst/neuman-stubblebine-reauth.tst
--- a/tst/neuman-stubblebine-reauth.tst
+++ b/tst/neuman-stubblebine-reauth.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol neuman-stubblebine-reauth basic
diff --git a/tst/neuman-stubblebine.tst b/tst/neuman-stubblebine.tst
--- a/tst/neuman-stubblebine.tst
+++ b/tst/neuman-stubblebine.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol neuman-stubblebine basic
diff --git a/tst/no_contraction.tst b/tst/no_contraction.tst
--- a/tst/no_contraction.tst
+++ b/tst/no_contraction.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol no-contraction basic
diff --git a/tst/non_transforming.tst b/tst/non_transforming.tst
--- a/tst/non_transforming.tst
+++ b/tst/non_transforming.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol non_transforming basic
diff --git a/tst/nonaug-prune.tst b/tst/nonaug-prune.tst
--- a/tst/nonaug-prune.tst
+++ b/tst/nonaug-prune.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol nonaug-prune basic
diff --git a/tst/ns.tst b/tst/ns.tst
--- a/tst/ns.tst
+++ b/tst/ns.tst
@@ -1,6 +1,6 @@
 (herald "Needham-Schroeder Public-Key Protocol Variants")
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol ns basic
diff --git a/tst/nsl3.tst b/tst/nsl3.tst
--- a/tst/nsl3.tst
+++ b/tst/nsl3.tst
@@ -1,6 +1,6 @@
 (herald "Three Party Needham-Schroeder-Lowe Protocol")
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol nsl3 basic
diff --git a/tst/nsl4cm1.tst b/tst/nsl4cm1.tst
--- a/tst/nsl4cm1.tst
+++ b/tst/nsl4cm1.tst
@@ -1,6 +1,6 @@
 (herald "Four Party Needham-Schroeder-Lowe Protocol")
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol nsl4cm basic
diff --git a/tst/nslsk.tst b/tst/nslsk.tst
--- a/tst/nslsk.tst
+++ b/tst/nslsk.tst
@@ -1,6 +1,6 @@
 (herald "Needham-Schroeder-Lowe Protocol with symmetric encryption")
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol nslsk basic
diff --git a/tst/or.tst b/tst/or.tst
--- a/tst/or.tst
+++ b/tst/or.tst
@@ -1,7 +1,7 @@
 (herald "Otway-Rees Protocol"
   (comment "Standard version using variables of sort mesg"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol or basic
diff --git a/tst/pca.tst b/tst/pca.tst
--- a/tst/pca.tst
+++ b/tst/pca.tst
@@ -1,7 +1,7 @@
 (herald "Privacy Certificate Authority"
   (comment "Generation of an Attestation Identity Certificate"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol pca basic
diff --git a/tst/pkinit.tst b/tst/pkinit.tst
--- a/tst/pkinit.tst
+++ b/tst/pkinit.tst
@@ -1,6 +1,6 @@
 (herald "Kerberos PK init")
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol pkinit basic
diff --git a/tst/print.scm b/tst/print.scm
new file mode 100644
--- /dev/null
+++ b/tst/print.scm
@@ -0,0 +1,13 @@
+(herald "Print Test"
+  (comment "See if read forms look like printed ones"))
+
+(defprotocol print-test basic
+  (defrole role
+    (vars (a b akey) (f g skey) (x y data))
+    (trace (recv (cat a b f g x y)))
+    (comment "Check the order in which variables are printed")))
+
+(defskeleton print-test
+  (vars (a b akey) (f g skey) (x y data))
+  (defstrand role 1 (a a) (b b) (f f) (g g) (x x) (y y))
+  (comment "Check the order in which variables are printed"))
diff --git a/tst/print.tst b/tst/print.tst
new file mode 100644
--- /dev/null
+++ b/tst/print.tst
@@ -0,0 +1,24 @@
+(herald "Print Test"
+  (comment "See if read forms look like printed ones"))
+
+(comment "CPSA 2.2.5")
+(comment "All input read")
+
+(defprotocol print-test basic
+  (defrole role
+    (vars (a b akey) (f g skey) (x y data))
+    (trace (recv (cat a b f g x y)))
+    (comment "Check the order in which variables are printed")))
+
+(defskeleton print-test
+  (vars (x y data) (f g skey) (a b akey))
+  (defstrand role 1 (x x) (y y) (f f) (g g) (a a) (b b))
+  (comment "Check the order in which variables are printed")
+  (traces ((recv (cat a b f g x y))))
+  (label 0)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (f f) (g g) (x x) (y y))))
+  (origs))
+
+(comment "Nothing left to do")
diff --git a/tst/pruning1.tst b/tst/pruning1.tst
--- a/tst/pruning1.tst
+++ b/tst/pruning1.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol prune basic
diff --git a/tst/sigenc.tst b/tst/sigenc.tst
--- a/tst/sigenc.tst
+++ b/tst/sigenc.tst
@@ -1,7 +1,7 @@
 (herald "Signed Encrypted Message Example"
   (comment "Shows examples of key usage of asymmetric keys"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol mult-keys-sig-enc basic
diff --git a/tst/sorted_epmo_acctnum.tst b/tst/sorted_epmo_acctnum.tst
--- a/tst/sorted_epmo_acctnum.tst
+++ b/tst/sorted_epmo_acctnum.tst
@@ -4,7 +4,7 @@
     "This version uses sorts to avoid confusion"
     "between a nonce and other data"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 (comment "Displacement disabled")
 
diff --git a/tst/targetterms2.tst b/tst/targetterms2.tst
--- a/tst/targetterms2.tst
+++ b/tst/targetterms2.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol targetterms2 basic
diff --git a/tst/targetterms6.tst b/tst/targetterms6.tst
--- a/tst/targetterms6.tst
+++ b/tst/targetterms6.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol targetterms6 basic
diff --git a/tst/targetterms8.tst b/tst/targetterms8.tst
--- a/tst/targetterms8.tst
+++ b/tst/targetterms8.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol targetterms8 basic
diff --git a/tst/tor.scm b/tst/tor.scm
--- a/tst/tor.scm
+++ b/tst/tor.scm
@@ -9,14 +9,14 @@
 (defprotocol tor diffie-hellman
   (defrole init
     (vars (x y expn) (b name) (n text) (kh akey))
-    (trace 
+    (trace
      (send (enc (exp (gen) x) (pubk b)))
      (recv (cat (exp (gen) y) (hash (cat (exp (exp (gen) x) y)))))
      (send (enc n (exp (exp (gen) y) x))))
     (uniq-orig x n))
   (defrole resp
     (vars (x y expn) (b name) (n text) (kh akey))
-    (trace 
+    (trace
      (recv (enc (exp (gen) x) (pubk b)))
      (send (cat (exp (gen) y) (hash (cat (exp (exp (gen) x) y)))))
      (recv (enc n (exp (exp (gen) x) y))))
diff --git a/tst/tor.tst b/tst/tor.tst
--- a/tst/tor.tst
+++ b/tst/tor.tst
@@ -1,7 +1,7 @@
 (herald "Tor Circuit-Level Handshake Protocol" (algebra diffie-hellman)
   (comment "Achieves unilateral authentication"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol tor diffie-hellman
diff --git a/tst/uncarried_keys.tst b/tst/uncarried_keys.tst
--- a/tst/uncarried_keys.tst
+++ b/tst/uncarried_keys.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol uncarried-keys basic
diff --git a/tst/uo.tst b/tst/uo.tst
--- a/tst/uo.tst
+++ b/tst/uo.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol uniq-orig basic
diff --git a/tst/wang-hash.scm b/tst/wang-hash.scm
new file mode 100644
--- /dev/null
+++ b/tst/wang-hash.scm
@@ -0,0 +1,434 @@
+(herald "Wang's Fair Exchange Protocol" (bound 10))
+
+;; CPSA input file to represent
+;; Wang's Fair Exchange Protocol
+
+;; This macro implements the CPSA
+;; convention of regarding a hash as
+;; an asymmetric encryption.  The
+;; decryption key inverse to (pubk
+;; hash) is assumed non-originating
+;; in roles using hashing.
+
+;; (defmacro (hash x)
+;;  (enc "h" (cat "h" x)))
+
+;; Wang's encrypted format for the
+;; message payload.  Observe that m,
+;; k get their values from the
+;; like-named messages in the context
+;; where the macro is expanded.
+
+(defmacro (em)
+  (enc m k))
+
+;; The session label L as a fn of
+;; the values that *should be* the
+;; hashes of the encrypted message EM
+;; and the session key K.
+
+(defmacro (l-prime y x)
+  (cat a b t y x))
+
+;; The recipient can check that a
+;; session label has an l-prime where
+;; y is the hash of another parameter.
+;; Hence recipient roles use l-star.
+
+(defmacro (l-star e1 x)
+  (l-prime (hash e1) x))
+
+;; The Evidence of Origin is checked
+;; to be this fn of other parameters
+;; available to the recipient.
+
+(defmacro (eoo-star x e1 e2)
+  (enc (cat "eootag"
+	    (hash (l-star e1 x)) e2)
+       (privk "sign" a)))
+
+;; The Evidence of Receipt is computed
+;; as this fn of other parameters
+;; available to the recipient.
+
+(defmacro (eor-star x e1 e2)
+  (enc (cat "eortag"
+	    (hash (l-star e1 x)) e2)
+       (privk "sign" b)))
+
+;; The Recovery Request as computed by
+;; the recipient.
+
+(defmacro (rr-star x e1 e2)
+  (cat (l-star e1 x) e2
+       (eoo-star x e1 e2)
+       (eor-star x e1 e2)
+       (enc (cat "rcrq" (l-star e1 x) e2)
+            (privk "sign" b))))
+
+;; The Abort Token is checked
+;; to be this fn of other parameters
+;; available to the recipient.
+
+(defmacro (at-star e1 x)
+  (enc (enc "abrq" (l-star e1 x)
+            (privk "sign" a))
+       (privk "sign" t)))
+
+;; How the initiator computes the
+;; encrypted key package:
+
+(defmacro (ek l)
+  (enc (cat "keytag" (hash l) k r)
+       (pubk "encr" t)))
+
+;; The Initiator's computed
+;; version of L.
+
+(defmacro (l)
+  (l-prime (hash (enc m k)) (hash k)))
+
+;; The TTP can check that the session
+;; label L is this fn of other
+;; parameters available to the TTP.
+
+(defmacro (l-prime-prime y)
+  (cat a b t y (hash k)))
+
+;; The TTP can check that the EOO
+;; is this fn of other parameters
+;; available to the TTP.
+
+(defmacro (eoo-prime-prime y)
+  (enc (cat "eootag"
+            (hash (l-prime-prime y))
+	    (ek (l-prime-prime y)))
+       (privk "sign" a)))
+
+;; The TTP can check that the EOR
+;; is this fn of other parameters
+;; available to the TTP.
+
+(defmacro (eor-prime-prime y)
+  (enc (cat "eortag"
+	    (hash (l-prime-prime y))
+	    (ek (l-prime-prime y)))
+       (privk "sign" b)))
+
+;; The TTP can check that the RR
+;; is this fn of other parameters
+;; available to the TTP.
+
+(defmacro (rr-prime-prime y)
+  (cat (l-prime-prime y)
+       (ek (l-prime-prime y))
+       (eoo-prime-prime y)
+       (eor-prime-prime y)
+       (enc "rcrq" (l-prime-prime y)
+	    (ek (l-prime-prime y))
+            (privk "sign" b))))
+
+;; The TTP can check that the Confirmation
+;; Request is this fn of other parameters
+;; available to the TTP.
+
+(defmacro (cf-prime-prime y)
+  (cat (l-prime-prime y) (ek (l-prime-prime y))
+       (eoo-prime-prime y) (eor-prime-prime y)
+       (enc "cfrq" (l-prime-prime y)
+	    (ek (l-prime-prime y))
+            (privk "sign" b))))
+
+;; Defn of Wang's Fair Exchange Protocol.
+;; Closely follows the presentation in the
+;; figures in Section 3.  In the TTP roles,
+;; we have put a dummy send or receive in place
+;; of the state synchronization event to keep
+;; the indices matching the spec.
+
+(defprotocol wang basic
+
+  ;; Successful initiator run with no TTP involvement
+
+  (defrole init1
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (send (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (recv (eor-star (hash k) (enc m k) (ek (l))))
+     (send (cat k r)))
+    (non-orig (privk hash_id)))
+
+  ;; Aborted initiator run
+
+  (defrole init2
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (send (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (send (enc "abrq" (l) (privk "sign" a)))
+     (recv (enc "abcf"
+                (enc "abrq" (l) (privk "sign" a))
+                (privk "sign" t))))
+    (non-orig (privk hash_id)))
+
+  ;; Initiator run with abort request and forced recovery
+
+  (defrole init3
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (send (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (send (enc "abrq" (l) (privk "sign" a)))
+     (recv (eor-star (hash k) (enc m k) (ek (l)))))
+    (non-orig (privk hash_id)))
+
+  ;; Aborted initiator run, but with EOR received
+
+  (defrole init4
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (send (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (recv (eor-star (hash k) (enc m k) (ek (l))))
+     (send (enc "abrq" (l) (privk "sign" a)))
+     (recv (enc "abcf"
+                (enc "abrq" (l) (privk "sign" a))
+                (privk "sign" t))))
+    (non-orig (privk hash_id)))
+
+  ;; Initiator run with abort requested after EOR received,
+  ;; but recovery forced
+
+  (defrole init5
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (send (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (recv (eor-star (hash k) (enc m k) (ek (l))))
+     (send (enc "abrq" (l) (privk "sign" a)))
+     (recv (eor-star (hash k) (enc m k) (ek (l)))))
+    (non-orig (privk hash_id)))
+
+  ;; Successful responder run with no TTP involvement
+
+  (defrole resp1
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (recv (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (send (eor-star (hash k) (enc m k) (ek (l))))
+     (recv (cat k r)))
+    (non-orig (privk hash_id)))
+
+  ;;Responder run with recovery via TTP
+
+  (defrole resp2
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (recv (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (send (cat (l) (ek (l)) (eoo-star (hash k) (enc m k) (ek (l)))
+                (eor-star (hash k) (enc m k) (ek (l)))))
+     (send (cat (l) (ek (l)) (eoo-star (hash k) (enc m k) (ek (l)))
+                (eor-star (hash k) (enc m k) (ek (l)))
+                (enc "rcrq" (l) (ek (l)) (privk "sign" b))))
+     (recv (cat k r)))
+    (non-orig (privk hash_id)))
+
+  ;; Responder run with recovery request and forced abort
+
+  (defrole resp3
+    (vars (a b t hash_id name) (e1 e2 x mesg))
+    (trace
+     (recv (cat (l-star e1 x) e1 e2 (eoo-star x e1 e2)))
+     (send (cat (l-star e1 x) e2 (eoo-star x e1 e2) (eor-star x e1 e2)))
+     (send (cat (l-star e1 x) e2 (eoo-star x e1 e2) (eor-star x e1 e2)
+                (enc "rcrq" (l-star e1 x) e2 (privk "sign" b))))
+     (recv (enc "abcf"
+                (enc "abrq" (l-star e1 x) (privk "sign" a))
+                (privk "sign" t))))
+    (non-orig (privk hash_id)))
+
+  ;; TTP handles an abort
+
+  (defrole ttp-ab1
+    (vars (a b t hash_id name) (y x mesg))
+    (trace
+     (recv (enc "abrq" (l-prime y x) (privk "sign" a)))
+     (send (cat "sync-abrq"
+                (enc "abrq" (l-prime y x) (privk "sign" a))))
+     (send (enc "abcf"
+                (enc "abrq" (l-prime y x) (privk "sign" a))
+                (privk "sign" t))))
+    (non-orig (privk hash_id)))
+
+  ;; TTP forces recovery in response to an abort request
+
+  (defrole ttp-ab2
+    (vars (a b t hash_id name) (y x e mesg))
+    (trace
+     (recv (enc "abrq" (l-prime y x) (privk "sign" a)))
+     (recv (cat "sync-abrq"
+                (enc "eortag" (hash (l-prime y x)) e
+                     (privk "sign" b))))
+     (send (enc "eortag" (hash (l-prime y x)) e
+                (privk "sign" b))))
+    (non-orig (privk hash_id)))
+
+  ;; TTP handles a recovery
+
+  (defrole ttp-rc1
+    (vars (a b t hash_id name) (r text) (k skey) (y mesg))
+    (trace
+     (recv (rr-prime-prime y))
+     (send (cat "sync-rc-req"
+                (rr-prime-prime y)))
+     (send (cat k r)))
+    (non-orig (privk hash_id)))
+
+  ;; TTP forces abort in response to a recovery request
+
+  (defrole ttp-rc2
+    (vars (a b t hash_id name) (r text) (k skey) (y mesg))
+    (trace
+     (recv (rr-prime-prime y))
+     (recv (cat "sync-rc-req"
+		(enc "abrq" (l-prime-prime y) (privk "sign" a))))
+     (send (enc "abcf"
+                (enc "abrq" (l-prime-prime y) (privk "sign" a))
+                (privk "sign" t))))
+    (non-orig (privk hash_id)))
+
+  ;; TTP handles a confirm request
+
+  (defrole ttp-cf1
+    (vars (a b t hash_id name) (r text) (k skey) (y mesg))
+    (trace
+     (recv (cf-prime-prime y))
+     (send (cat "sync-cf-req"
+                (cf-prime-prime y)))
+     (send (enc (cf-prime-prime y) (privk "sign" t))))
+    (non-orig (privk hash_id)))
+
+  ;; TTP replies with abort token given confirm request
+
+  (defrole ttp-cf2
+    (vars (a b t hash_id name) (r text) (k skey) (y mesg))
+    (trace
+     (recv (cf-prime-prime y))
+     (recv (cat "sync-cf-req"
+                (enc "abrq"(l-prime-prime y) (privk "sign" a))))
+     (send (enc "abcf"
+                (enc "abrq"(l-prime-prime y) (privk "sign" a))
+                (privk "sign" t))))
+    (non-orig (privk hash_id))))
+
+;; End of Wang's protocol defn.
+
+;; Two experiments to prove Lemma 4.1
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand init1 1 (b b) (t t) (m m) (r r) (k k))
+  (deflistener m)
+  (non-orig
+   (privk "encr" t))
+  (uniq-orig m k)
+  (comment "Experiment 1 to prove Lemma 4.1."))
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand init1 1 (b b) (t t) (m m) (r r) (k k))
+  (deflistener k)
+  (non-orig
+   (privk "encr" t))
+  (uniq-orig m k)
+  (comment "Experiment 2 to prove Lemma 4.1."))
+
+;; We now have three experiments
+;; to prove Lemma 4.2, clause 1.
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand init1 3 (b b) (t t) (m m) (r r) (k k))
+  (non-orig
+   (privk "sign" b))
+  (comment "First of three experiments to prove Lemma 4.2, clause 1."))
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand init3 3 (b b) (t t) (m m) (r r) (k k))
+  (non-orig
+   (privk "sign" b))
+  (comment "Second of three experiments to prove Lemma 4.2, clause 1."))
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand init5 4 (b b) (t t) (m m) (r r) (k k))
+  (non-orig
+   (privk "sign" b))
+  (comment "Third of three experiments to prove Lemma 4.2, clause 1."))
+
+;; Two experiments to prove 4.2, Clause 2.
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand resp1 3 (a a) (t t) (m m) (r r) (k k))
+  (non-orig
+   (privk "sign" a))
+  (comment
+   "First of two experiments to prove Lemma 4.2, clause 2."))
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand resp2 4 (a a) (t t) (m m) (r r) (k k))
+  (non-orig
+   (privk "sign" a))
+  (comment
+   "Second of two experiments to prove Lemma 4.2, clause 2."))
+
+;; Experiment to prove Lemma 4.2, clause 3.
+
+(defskeleton wang
+  (vars (a b t hash_id name) (e1 e2 x mesg))
+  (defstrand resp3 4 (a a) (t t))
+  (non-orig
+   (privk "sign" a))
+  (comment
+   "Experiments to prove Lemma 4.2, clause 3."))
+
+;; One experiment to prove Lemma 4.3, Clause 1.
+
+(defskeleton wang
+  (vars (a b t hash_id name) (y x mesg))
+  (deflistener
+    (enc "abcf" (enc "abrq" (l-prime y x) (privk "sign" a))
+	 (privk "sign" t)))
+  (non-orig
+   (privk "sign" t))
+  (comment
+   "Experiments to prove Lemma 4.3, clause 1."))
+
+;; Three experiments to prove Lemma 4.3, Clause 2.
+
+(defskeleton wang
+  (vars (y x mesg) (a b t name))
+  (defstrand ttp-ab1 3 (y y) (x x) (a a) (b b) (t t))
+  (non-orig (privk "sign" a)  (privk "encr" t))
+  (comment
+   "Experiment 1 to prove Lemma 4.3, clause 2."))
+
+(defskeleton wang
+  (vars (a b t hash_id name) (r text) (k skey) (y mesg))
+  (defstrand ttp-rc2 3 (a a) (b b) (t t))
+  (non-orig (privk "sign" a)  (privk "encr" t))
+  (comment
+   "Experiment 2 to prove Lemma 4.3, clause 2."))
+
+(defskeleton wang
+  (vars (a b t hash_id name) (r text) (k skey) (y mesg))
+  (defstrand ttp-cf2 3 (a a) (b b) (t t))
+  (non-orig (privk "sign" a)  (privk "encr" t))
+  (comment
+   "Experiment 3 to prove Lemma 4.3, clause 2."))
diff --git a/tst/wang-hash.tst b/tst/wang-hash.tst
new file mode 100644
--- /dev/null
+++ b/tst/wang-hash.tst
@@ -0,0 +1,5380 @@
+(herald "Wang's Fair Exchange Protocol" (bound 10))
+
+(comment "CPSA 2.2.5")
+(comment "All input read")
+(comment "Strand count bounded at 10")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (hash e1) x) e1 e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (hash a b t y x) e (privk "sign" b))))
+      (send (enc "eortag" (hash a b t y x) e (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (enc (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener m)
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (comment "Experiment 1 to prove Lemma 4.1.")
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))) ((recv m) (send m)))
+  (label 0)
+  (unrealized (1 0))
+  (preskeleton)
+  (comment "Not a skeleton"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener m)
+  (precedes ((0 0) (1 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))) ((recv m) (send m)))
+  (label 1)
+  (parent 0)
+  (unrealized (1 0))
+  (origs (m (0 0)) (k (0 0)))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener m)
+  (deflistener k)
+  (precedes ((0 0) (2 0)) ((2 1) (1 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation nonce-test (added-listener k) m (1 0) (enc m k))
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))) ((recv m) (send m))
+    ((recv k) (send k)))
+  (label 2)
+  (parent 1)
+  (seen 3)
+  (unrealized (2 0))
+  (comment "3 in cohort - 2 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (deflistener m)
+  (deflistener k)
+  (defstrand init1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 0)) ((2 2) (1 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation nonce-test (added-strand init1 3) k (2 0)
+    (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+      (pubk "encr" t)))
+  (traces ((recv m) (send m)) ((recv k) (send k))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (label 3)
+  (parent 2)
+  (unrealized)
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener m)
+  (deflistener k)
+  (defstrand ttp-rc1 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (precedes ((0 0) (3 0)) ((2 1) (1 0)) ((3 2) (2 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation nonce-test (added-strand ttp-rc1 3) k (2 0)
+    (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+      (pubk "encr" t)))
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))) ((recv m) (send m))
+    ((recv k) (send k))
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (label 4)
+  (parent 2)
+  (unrealized)
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (deflistener m)
+  (defstrand init1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 2) (0 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation generalization deleted (1 0))
+  (traces ((recv m) (send m))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (label 5)
+  (parent 3)
+  (unrealized)
+  (shape)
+  (maps ((1 0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs (m (1 0)) (k (1 0))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener m)
+  (defstrand ttp-rc1 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (precedes ((0 0) (2 0)) ((2 2) (1 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation generalization deleted (2 0))
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))) ((recv m) (send m))
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (label 6)
+  (parent 4)
+  (unrealized)
+  (shape)
+  (maps ((0 1) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs (m (0 0)) (k (0 0))))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (hash e1) x) e1 e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (hash a b t y x) e (privk "sign" b))))
+      (send (enc "eortag" (hash a b t y x) e (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (enc (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener k)
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (comment "Experiment 2 to prove Lemma 4.1.")
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))) ((recv k) (send k)))
+  (label 7)
+  (unrealized (1 0))
+  (preskeleton)
+  (comment "Not a skeleton"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener k)
+  (precedes ((0 0) (1 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))) ((recv k) (send k)))
+  (label 8)
+  (parent 7)
+  (seen 9)
+  (unrealized (1 0))
+  (origs (m (0 0)) (k (0 0)))
+  (comment "3 in cohort - 2 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (deflistener k)
+  (defstrand init1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 2) (0 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation nonce-test (added-strand init1 3) k (1 0)
+    (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+      (pubk "encr" t)))
+  (traces ((recv k) (send k))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (label 9)
+  (parent 8)
+  (unrealized)
+  (shape)
+  (maps ((1 0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs (m (1 0)) (k (1 0))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener k)
+  (defstrand ttp-rc1 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (precedes ((0 0) (2 0)) ((2 2) (1 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation nonce-test (added-strand ttp-rc1 3) k (1 0)
+    (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+      (pubk "encr" t)))
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))) ((recv k) (send k))
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (label 10)
+  (parent 8)
+  (unrealized)
+  (shape)
+  (maps ((0 1) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs (m (0 0)) (k (0 0))))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (hash e1) x) e1 e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (hash a b t y x) e (privk "sign" b))))
+      (send (enc "eortag" (hash a b t y x) e (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (enc (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (non-orig (privk "sign" b))
+  (comment "First of three experiments to prove Lemma 4.2, clause 1.")
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (label 11)
+  (seen 13)
+  (unrealized (0 1))
+  (origs)
+  (comment "3 in cohort - 2 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand resp1 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 1)))
+  (non-orig (privk "sign" b))
+  (operation encryption-test (added-strand resp1 2)
+    (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t)) (privk "sign" b)) (0 1))
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r)))
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (label 12)
+  (parent 11)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand resp2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 1)))
+  (non-orig (privk "sign" b))
+  (operation encryption-test (added-strand resp2 2)
+    (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t)) (privk "sign" b)) (0 1))
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r)))
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))))
+  (label 13)
+  (parent 11)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (hash e1) x) e1 e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (hash a b t y x) e (privk "sign" b))))
+      (send (enc "eortag" (hash a b t y x) e (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (enc (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init3 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (non-orig (privk "sign" b))
+  (comment "Second of three experiments to prove Lemma 4.2, clause 1.")
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (label 14)
+  (seen 16)
+  (unrealized (0 2))
+  (origs)
+  (comment "3 in cohort - 2 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init3 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand resp1 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 2)))
+  (non-orig (privk "sign" b))
+  (operation encryption-test (added-strand resp1 2)
+    (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t)) (privk "sign" b)) (0 2))
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))))
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (label 15)
+  (parent 14)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init3 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand resp2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 2)))
+  (non-orig (privk "sign" b))
+  (operation encryption-test (added-strand resp2 2)
+    (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t)) (privk "sign" b)) (0 2))
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))))
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))))
+  (label 16)
+  (parent 14)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (hash e1) x) e1 e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (hash a b t y x) e (privk "sign" b))))
+      (send (enc "eortag" (hash a b t y x) e (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (enc (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init5 4 (r r) (m m) (a a) (b b) (t t) (k k))
+  (non-orig (privk "sign" b))
+  (comment "Third of three experiments to prove Lemma 4.2, clause 1.")
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (label 17)
+  (seen 19)
+  (unrealized (0 1) (0 3))
+  (origs)
+  (comment "3 in cohort - 2 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init5 4 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand resp1 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 1)))
+  (non-orig (privk "sign" b))
+  (operation encryption-test (added-strand resp1 2)
+    (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t)) (privk "sign" b)) (0 1))
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))))
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (label 18)
+  (parent 17)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init5 4 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand resp2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 1)))
+  (non-orig (privk "sign" b))
+  (operation encryption-test (added-strand resp2 2)
+    (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t)) (privk "sign" b)) (0 1))
+  (traces
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))))
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))))
+  (label 19)
+  (parent 17)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (hash e1) x) e1 e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (hash a b t y x) e (privk "sign" b))))
+      (send (enc "eortag" (hash a b t y x) e (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (enc (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (non-orig (privk "sign" a))
+  (comment "First of two experiments to prove Lemma 4.2, clause 2.")
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (label 20)
+  (seen 21)
+  (unrealized (0 0))
+  (origs)
+  (comment "5 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (added-strand init1 1)
+    (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t)) (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r)))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))))
+  (label 21)
+  (parent 20)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (t t) (m m) (r r) (k k) (b b))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (hash e1) x) e1 e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (hash a b t y x) e (privk "sign" b))))
+      (send (enc "eortag" (hash a b t y x) e (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (enc (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp2 4 (r r) (m m) (a a) (b b) (t t) (k k))
+  (non-orig (privk "sign" a))
+  (comment "Second of two experiments to prove Lemma 4.2, clause 2.")
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (label 22)
+  (seen 23)
+  (unrealized (0 0))
+  (origs)
+  (comment "5 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp2 4 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (added-strand init1 1)
+    (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t)) (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r)))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))))
+  (label 23)
+  (parent 22)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (t t) (m m) (r r) (k k) (b b))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (hash e1) x) e1 e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (hash a b t y x) e (privk "sign" b))))
+      (send (enc "eortag" (hash a b t y x) e (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (enc (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (e1 e2 x mesg) (a t b name))
+  (defstrand resp3 4 (e1 e1) (e2 e2) (x x) (a a) (b b) (t t))
+  (non-orig (privk "sign" a))
+  (comment "Experiments to prove Lemma 4.2, clause 3.")
+  (traces
+    ((recv
+       (cat (cat a b t (hash e1) x) e1 e2
+         (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (label 24)
+  (seen 25)
+  (unrealized (0 0) (0 3))
+  (origs)
+  (comment "5 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp3 4 (e1 (enc m k))
+    (e2
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t))) (x (hash k)) (a a) (b b) (t t))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (added-strand init1 1)
+    (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t)) (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))))
+  (label 25)
+  (parent 24)
+  (seen 26 27 28 29)
+  (unrealized (0 3))
+  (comment "8 in cohort - 4 not yet seen"))
+
+(defskeleton wang
+  (vars (r r-0 text) (m data) (a t b name) (k skey))
+  (defstrand resp3 4 (e1 (enc m k))
+    (e2
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t))) (x (hash k)) (a a) (b b) (t t))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init2 2 (r r-0) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((2 1) (0 3)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (added-strand init2 2)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 3))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a)))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 26)
+  (parent 25)
+  (seen 27)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (t t) (b b) (e1 (enc m k))
+        (e2
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))) (x (hash k)))))
+  (origs)
+  (comment "1 in cohort - 0 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp3 4 (e1 (enc m k))
+    (e2
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t))) (x (hash k)) (a a) (b b) (t t))
+  (defstrand init2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((1 1) (0 3)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (displaced 1 2 init2 2)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 3))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 27)
+  (parent 25)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (t t) (b b) (e1 (enc m k))
+        (e2
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))) (x (hash k)))))
+  (origs))
+
+(defskeleton wang
+  (vars (r r-0 text) (m data) (a t b name) (k skey))
+  (defstrand resp3 4 (e1 (enc m k))
+    (e2
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t))) (x (hash k)) (a a) (b b) (t t))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init4 3 (r r-0) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((2 2) (0 3)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (added-strand init4 3)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 3))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a)))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 28)
+  (parent 25)
+  (seen 29)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (t t) (b b) (e1 (enc m k))
+        (e2
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))) (x (hash k)))))
+  (origs)
+  (comment "1 in cohort - 0 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp3 4 (e1 (enc m k))
+    (e2
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t))) (x (hash k)) (a a) (b b) (t t))
+  (defstrand init4 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((1 2) (0 3)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (displaced 1 2 init4 3)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 3))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 29)
+  (parent 25)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (t t) (b b) (e1 (enc m k))
+        (e2
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))) (x (hash k)))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (hash e1) x) e1 e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (hash a b t y x) e (privk "sign" b))))
+      (send (enc "eortag" (hash a b t y x) e (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (enc (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (y x mesg) (a b t name))
+  (deflistener
+    (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+      (privk "sign" t)))
+  (non-orig (privk "sign" t))
+  (comment "Experiments to prove Lemma 4.3, clause 1.")
+  (traces
+    ((recv
+       (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+         (privk "sign" t)))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (label 30)
+  (unrealized (0 0))
+  (origs)
+  (comment "3 in cohort - 3 not yet seen"))
+
+(defskeleton wang
+  (vars (y x mesg) (a b t name))
+  (deflistener
+    (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+      (privk "sign" t)))
+  (defstrand ttp-ab1 3 (y y) (x x) (a a) (b b) (t t))
+  (precedes ((1 2) (0 0)))
+  (non-orig (privk "sign" t))
+  (operation encryption-test (added-strand ttp-ab1 3)
+    (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+      (privk "sign" t)) (0 0))
+  (traces
+    ((recv
+       (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+         (privk "sign" t)))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t))))
+    ((recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (label 31)
+  (parent 30)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (y y) (x x))))
+  (origs))
+
+(defskeleton wang
+  (vars (y mesg) (r text) (a b t name) (k skey))
+  (deflistener
+    (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+      (privk "sign" t)))
+  (defstrand ttp-rc2 3 (y y) (r r) (a a) (b b) (t t) (k k))
+  (precedes ((1 2) (0 0)))
+  (non-orig (privk "sign" t))
+  (operation encryption-test (added-strand ttp-rc2 3)
+    (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+      (privk "sign" t)) (0 0))
+  (traces
+    ((recv
+       (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+         (privk "sign" t)))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((recv
+       (cat (cat a b t y (hash k))
+         (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+         (enc "eootag" (hash a b t y (hash k))
+           (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag" (hash a b t y (hash k))
+           (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "rcrq" (cat a b t y (hash k))
+           (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (label 32)
+  (parent 30)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (y y) (x (hash k)))))
+  (origs))
+
+(defskeleton wang
+  (vars (y mesg) (r text) (a b t name) (k skey))
+  (deflistener
+    (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+      (privk "sign" t)))
+  (defstrand ttp-cf2 3 (y y) (r r) (a a) (b b) (t t) (k k))
+  (precedes ((1 2) (0 0)))
+  (non-orig (privk "sign" t))
+  (operation encryption-test (added-strand ttp-cf2 3)
+    (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+      (privk "sign" t)) (0 0))
+  (traces
+    ((recv
+       (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+         (privk "sign" t)))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((recv
+       (cat (cat a b t y (hash k))
+         (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+         (enc "eootag" (hash a b t y (hash k))
+           (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag" (hash a b t y (hash k))
+           (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "cfrq" (cat a b t y (hash k))
+           (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (label 33)
+  (parent 30)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (y y) (x (hash k)))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (hash e1) x) e1 e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (hash a b t y x) e (privk "sign" b))))
+      (send (enc "eortag" (hash a b t y x) e (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (enc (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (y x mesg) (a b t name))
+  (defstrand ttp-ab1 3 (y y) (x x) (a a) (b b) (t t))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (comment "Experiment 1 to prove Lemma 4.3, clause 2.")
+  (traces
+    ((recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (label 34)
+  (seen 35 36)
+  (unrealized (0 0))
+  (origs)
+  (comment "4 in cohort - 2 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-ab1 3 (y (hash (enc m k))) (x (hash k)) (a a) (b b)
+    (t t))
+  (defstrand init2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 0)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init2 2)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (send
+        (cat "sync-abrq"
+          (enc "abrq" a b t (hash (enc m k)) (hash k)
+            (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 35)
+  (parent 34)
+  (unrealized)
+  (shape)
+  (maps ((0) ((y (hash (enc m k))) (x (hash k)) (a a) (b b) (t t))))
+  (origs))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-ab1 3 (y (hash (enc m k))) (x (hash k)) (a a) (b b)
+    (t t))
+  (defstrand init4 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 2) (0 0)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init4 3)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (send
+        (cat "sync-abrq"
+          (enc "abrq" a b t (hash (enc m k)) (hash k)
+            (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 36)
+  (parent 34)
+  (unrealized)
+  (shape)
+  (maps ((0) ((y (hash (enc m k))) (x (hash k)) (a a) (b b) (t t))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (hash e1) x) e1 e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (hash a b t y x) e (privk "sign" b))))
+      (send (enc "eortag" (hash a b t y x) e (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (enc (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (y mesg) (r text) (a b t name) (k skey))
+  (defstrand ttp-rc2 3 (y y) (r r) (a a) (b b) (t t) (k k))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (comment "Experiment 2 to prove Lemma 4.3, clause 2.")
+  (traces
+    ((recv
+       (cat (cat a b t y (hash k))
+         (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+         (enc "eootag" (hash a b t y (hash k))
+           (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag" (hash a b t y (hash k))
+           (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "rcrq" (cat a b t y (hash k))
+           (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (label 37)
+  (seen 38)
+  (unrealized (0 0) (0 1))
+  (origs)
+  (comment "5 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-rc2 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init1 1)
+    (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t)) (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t (hash (enc m k)) (hash k)
+            (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))))
+  (label 38)
+  (parent 37)
+  (seen 39 40 41 42)
+  (unrealized (0 1))
+  (comment "8 in cohort - 4 not yet seen"))
+
+(defskeleton wang
+  (vars (r r-0 text) (m data) (a b t name) (k skey))
+  (defstrand ttp-rc2 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init2 2 (r r-0) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((2 1) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init2 2)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t (hash (enc m k)) (hash k)
+            (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a)))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 39)
+  (parent 38)
+  (seen 40)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (r r) (k k) (y (hash (enc m k))))))
+  (origs)
+  (comment "1 in cohort - 0 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-rc2 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (defstrand init2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((1 1) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (displaced 1 2 init2 2)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t (hash (enc m k)) (hash k)
+            (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 40)
+  (parent 38)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (r r) (k k) (y (hash (enc m k))))))
+  (origs))
+
+(defskeleton wang
+  (vars (r r-0 text) (m data) (a b t name) (k skey))
+  (defstrand ttp-rc2 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init4 3 (r r-0) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((2 2) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init4 3)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t (hash (enc m k)) (hash k)
+            (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a)))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 41)
+  (parent 38)
+  (seen 42)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (r r) (k k) (y (hash (enc m k))))))
+  (origs)
+  (comment "1 in cohort - 0 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-rc2 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (defstrand init4 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((1 2) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (displaced 1 2 init4 3)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t (hash (enc m k)) (hash k)
+            (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 42)
+  (parent 38)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (r r) (k k) (y (hash (enc m k))))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t))
+          (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash (enc m k)) (hash k))
+            (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+              (pubk "encr" t)) (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (hash e1) x) e1 e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))))
+      (send
+        (cat (cat a b t (hash e1) x) e2
+          (enc "eootag" (hash a b t (hash e1) x) e2 (privk "sign" a))
+          (enc "eortag" (hash a b t (hash e1) x) e2 (privk "sign" b))
+          (enc "rcrq" (cat a b t (hash e1) x) e2 (privk "sign" b))))
+      (recv
+        (enc "abcf" (enc "abrq" a b t (hash e1) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (hash a b t y x) e (privk "sign" b))))
+      (send (enc "eortag" (hash a b t y x) e (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (enc (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (hash k))
+          (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+          (enc "eootag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag" (hash a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "cfrq" (cat a b t y (hash k))
+            (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (y mesg) (r text) (a b t name) (k skey))
+  (defstrand ttp-cf2 3 (y y) (r r) (a a) (b b) (t t) (k k))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (comment "Experiment 3 to prove Lemma 4.3, clause 2.")
+  (traces
+    ((recv
+       (cat (cat a b t y (hash k))
+         (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+         (enc "eootag" (hash a b t y (hash k))
+           (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag" (hash a b t y (hash k))
+           (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "cfrq" (cat a b t y (hash k))
+           (enc "keytag" (hash a b t y (hash k)) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (hash k) (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y (hash k) (privk "sign" a))
+          (privk "sign" t)))))
+  (label 43)
+  (seen 44)
+  (unrealized (0 0) (0 1))
+  (origs)
+  (comment "5 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-cf2 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init1 1)
+    (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+      (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+        (pubk "encr" t)) (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "cfrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t (hash (enc m k)) (hash k)
+            (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))))
+  (label 44)
+  (parent 43)
+  (seen 45 46 47 48)
+  (unrealized (0 1))
+  (comment "8 in cohort - 4 not yet seen"))
+
+(defskeleton wang
+  (vars (r r-0 text) (m data) (a b t name) (k skey))
+  (defstrand ttp-cf2 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init2 2 (r r-0) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((2 1) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init2 2)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "cfrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t (hash (enc m k)) (hash k)
+            (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a)))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 45)
+  (parent 44)
+  (seen 46)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (r r) (k k) (y (hash (enc m k))))))
+  (origs)
+  (comment "1 in cohort - 0 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-cf2 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (defstrand init2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((1 1) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (displaced 1 2 init2 2)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "cfrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t (hash (enc m k)) (hash k)
+            (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 46)
+  (parent 44)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (r r) (k k) (y (hash (enc m k))))))
+  (origs))
+
+(defskeleton wang
+  (vars (r r-0 text) (m data) (a b t name) (k skey))
+  (defstrand ttp-cf2 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init4 3 (r r-0) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((2 2) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init4 3)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "cfrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t (hash (enc m k)) (hash k)
+            (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a)))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r-0
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 47)
+  (parent 44)
+  (seen 48)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (r r) (k k) (y (hash (enc m k))))))
+  (origs)
+  (comment "1 in cohort - 0 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-cf2 3 (y (hash (enc m k))) (r r) (a a) (b b) (t t)
+    (k k))
+  (defstrand init4 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((1 2) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (displaced 1 2 init4 3)
+    (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat (cat a b t (hash (enc m k)) (hash k))
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "cfrq" (cat a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t (hash (enc m k)) (hash k)
+            (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a))
+          (privk "sign" t))))
+    ((send
+       (cat (cat a b t (hash (enc m k)) (hash k)) (enc m k)
+         (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+           (pubk "encr" t))
+         (enc "eootag" (hash a b t (hash (enc m k)) (hash k))
+           (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+             (pubk "encr" t)) (privk "sign" a))))
+      (recv
+        (enc "eortag" (hash a b t (hash (enc m k)) (hash k))
+          (enc "keytag" (hash a b t (hash (enc m k)) (hash k)) k r
+            (pubk "encr" t)) (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (hash (enc m k)) (hash k) (privk "sign" a)))))
+  (label 48)
+  (parent 44)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (r r) (k k) (y (hash (enc m k))))))
+  (origs))
+
+(comment "Nothing left to do")
diff --git a/tst/wang-key-hash.scm b/tst/wang-key-hash.scm
new file mode 100644
--- /dev/null
+++ b/tst/wang-key-hash.scm
@@ -0,0 +1,434 @@
+(herald "Wang's Fair Exchange Protocol" (bound 10))
+
+;; CPSA input file to represent
+;; Wang's Fair Exchange Protocol
+
+;; This macro implements the CPSA
+;; convention of regarding a hash as
+;; an asymmetric encryption.  The
+;; decryption key inverse to (pubk
+;; hash) is assumed non-originating
+;; in roles using hashing.
+
+(defmacro (hash x)
+  (enc "h" (cat "h" x)))
+
+;; Wang's encrypted format for the
+;; message payload.  Observe that m,
+;; k get their values from the
+;; like-named messages in the context
+;; where the macro is expanded.
+
+(defmacro (em)
+  (enc m k))
+
+;; The session label L as a fn of
+;; the values that *should be* the
+;; hashes of the encrypted message EM
+;; and the session key K.
+
+(defmacro (l-prime y x)
+  (cat a b t y x))
+
+;; The recipient can check that a
+;; session label has an l-prime where
+;; y is the hash of another parameter.
+;; Hence recipient roles use l-star.
+
+(defmacro (l-star e1 x)
+  (l-prime (hash e1) x))
+
+;; The Evidence of Origin is checked
+;; to be this fn of other parameters
+;; available to the recipient.
+
+(defmacro (eoo-star x e1 e2)
+  (enc (cat "eootag"
+	    (hash (l-star e1 x)) e2)
+       (privk "sign" a)))
+
+;; The Evidence of Receipt is computed
+;; as this fn of other parameters
+;; available to the recipient.
+
+(defmacro (eor-star x e1 e2)
+  (enc (cat "eortag"
+	    (hash (l-star e1 x)) e2)
+       (privk "sign" b)))
+
+;; The Recovery Request as computed by
+;; the recipient.
+
+(defmacro (rr-star x e1 e2)
+  (cat (l-star e1 x) e2
+       (eoo-star x e1 e2)
+       (eor-star x e1 e2)
+       (enc (cat "rcrq" (l-star e1 x) e2)
+            (privk "sign" b))))
+
+;; The Abort Token is checked
+;; to be this fn of other parameters
+;; available to the recipient.
+
+(defmacro (at-star e1 x)
+  (enc (enc "abrq" (l-star e1 x)
+            (privk "sign" a))
+       (privk "sign" t)))
+
+;; How the initiator computes the
+;; encrypted key package:
+
+(defmacro (ek l)
+  (enc (cat "keytag" (hash l) k r)
+       (pubk "encr" t)))
+
+;; The Initiator's computed
+;; version of L.
+
+(defmacro (l)
+  (l-prime (hash (enc m k)) (hash k)))
+
+;; The TTP can check that the session
+;; label L is this fn of other
+;; parameters available to the TTP.
+
+(defmacro (l-prime-prime y)
+  (cat a b t y (hash k)))
+
+;; The TTP can check that the EOO
+;; is this fn of other parameters
+;; available to the TTP.
+
+(defmacro (eoo-prime-prime y)
+  (enc (cat "eootag"
+            (hash (l-prime-prime y))
+	    (ek (l-prime-prime y)))
+       (privk "sign" a)))
+
+;; The TTP can check that the EOR
+;; is this fn of other parameters
+;; available to the TTP.
+
+(defmacro (eor-prime-prime y)
+  (enc (cat "eortag"
+	    (hash (l-prime-prime y))
+	    (ek (l-prime-prime y)))
+       (privk "sign" b)))
+
+;; The TTP can check that the RR
+;; is this fn of other parameters
+;; available to the TTP.
+
+(defmacro (rr-prime-prime y)
+  (cat (l-prime-prime y)
+       (ek (l-prime-prime y))
+       (eoo-prime-prime y)
+       (eor-prime-prime y)
+       (enc "rcrq" (l-prime-prime y)
+	    (ek (l-prime-prime y))
+            (privk "sign" b))))
+
+;; The TTP can check that the Confirmation
+;; Request is this fn of other parameters
+;; available to the TTP.
+
+(defmacro (cf-prime-prime y)
+  (cat (l-prime-prime y) (ek (l-prime-prime y))
+       (eoo-prime-prime y) (eor-prime-prime y)
+       (enc "cfrq" (l-prime-prime y)
+	    (ek (l-prime-prime y))
+            (privk "sign" b))))
+
+;; Defn of Wang's Fair Exchange Protocol.
+;; Closely follows the presentation in the
+;; figures in Section 3.  In the TTP roles,
+;; we have put a dummy send or receive in place
+;; of the state synchronization event to keep
+;; the indices matching the spec.
+
+(defprotocol wang basic
+
+  ;; Successful initiator run with no TTP involvement
+
+  (defrole init1
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (send (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (recv (eor-star (hash k) (enc m k) (ek (l))))
+     (send (cat k r)))
+    (non-orig (privk hash_id)))
+
+  ;; Aborted initiator run
+
+  (defrole init2
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (send (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (send (enc "abrq" (l) (privk "sign" a)))
+     (recv (enc "abcf"
+                (enc "abrq" (l) (privk "sign" a))
+                (privk "sign" t))))
+    (non-orig (privk hash_id)))
+
+  ;; Initiator run with abort request and forced recovery
+
+  (defrole init3
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (send (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (send (enc "abrq" (l) (privk "sign" a)))
+     (recv (eor-star (hash k) (enc m k) (ek (l)))))
+    (non-orig (privk hash_id)))
+
+  ;; Aborted initiator run, but with EOR received
+
+  (defrole init4
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (send (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (recv (eor-star (hash k) (enc m k) (ek (l))))
+     (send (enc "abrq" (l) (privk "sign" a)))
+     (recv (enc "abcf"
+                (enc "abrq" (l) (privk "sign" a))
+                (privk "sign" t))))
+    (non-orig (privk hash_id)))
+
+  ;; Initiator run with abort requested after EOR received,
+  ;; but recovery forced
+
+  (defrole init5
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (send (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (recv (eor-star (hash k) (enc m k) (ek (l))))
+     (send (enc "abrq" (l) (privk "sign" a)))
+     (recv (eor-star (hash k) (enc m k) (ek (l)))))
+    (non-orig (privk hash_id)))
+
+  ;; Successful responder run with no TTP involvement
+
+  (defrole resp1
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (recv (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (send (eor-star (hash k) (enc m k) (ek (l))))
+     (recv (cat k r)))
+    (non-orig (privk hash_id)))
+
+  ;;Responder run with recovery via TTP
+
+  (defrole resp2
+    (vars (a b t hash_id name) (m data) (r text) (k skey))
+    (trace
+     (recv (cat (l) (enc m k) (ek (l))
+                (eoo-star (hash k) (enc m k) (ek (l)))))
+     (send (cat (l) (ek (l)) (eoo-star (hash k) (enc m k) (ek (l)))
+                (eor-star (hash k) (enc m k) (ek (l)))))
+     (send (cat (l) (ek (l)) (eoo-star (hash k) (enc m k) (ek (l)))
+                (eor-star (hash k) (enc m k) (ek (l)))
+                (enc "rcrq" (l) (ek (l)) (privk "sign" b))))
+     (recv (cat k r)))
+    (non-orig (privk hash_id)))
+
+  ;; Responder run with recovery request and forced abort
+
+  (defrole resp3
+    (vars (a b t hash_id name) (e1 e2 x mesg))
+    (trace
+     (recv (cat (l-star e1 x) e1 e2 (eoo-star x e1 e2)))
+     (send (cat (l-star e1 x) e2 (eoo-star x e1 e2) (eor-star x e1 e2)))
+     (send (cat (l-star e1 x) e2 (eoo-star x e1 e2) (eor-star x e1 e2)
+                (enc "rcrq" (l-star e1 x) e2 (privk "sign" b))))
+     (recv (enc "abcf"
+                (enc "abrq" (l-star e1 x) (privk "sign" a))
+                (privk "sign" t))))
+    (non-orig (privk hash_id)))
+
+  ;; TTP handles an abort
+
+  (defrole ttp-ab1
+    (vars (a b t hash_id name) (y x mesg))
+    (trace
+     (recv (enc "abrq" (l-prime y x) (privk "sign" a)))
+     (send (cat "sync-abrq"
+                (enc "abrq" (l-prime y x) (privk "sign" a))))
+     (send (enc "abcf"
+                (enc "abrq" (l-prime y x) (privk "sign" a))
+                (privk "sign" t))))
+    (non-orig (privk hash_id)))
+
+  ;; TTP forces recovery in response to an abort request
+
+  (defrole ttp-ab2
+    (vars (a b t hash_id name) (y x e mesg))
+    (trace
+     (recv (enc "abrq" (l-prime y x) (privk "sign" a)))
+     (recv (cat "sync-abrq"
+                (enc "eortag" (hash (l-prime y x)) e
+                     (privk "sign" b))))
+     (send (enc "eortag" (hash (l-prime y x)) e
+                (privk "sign" b))))
+    (non-orig (privk hash_id)))
+
+  ;; TTP handles a recovery
+
+  (defrole ttp-rc1
+    (vars (a b t hash_id name) (r text) (k skey) (y mesg))
+    (trace
+     (recv (rr-prime-prime y))
+     (send (cat "sync-rc-req"
+                (rr-prime-prime y)))
+     (send (cat k r)))
+    (non-orig (privk hash_id)))
+
+  ;; TTP forces abort in response to a recovery request
+
+  (defrole ttp-rc2
+    (vars (a b t hash_id name) (r text) (k skey) (y mesg))
+    (trace
+     (recv (rr-prime-prime y))
+     (recv (cat "sync-rc-req"
+		(enc "abrq" (l-prime-prime y) (privk "sign" a))))
+     (send (enc "abcf"
+                (enc "abrq" (l-prime-prime y) (privk "sign" a))
+                (privk "sign" t))))
+    (non-orig (privk hash_id)))
+
+  ;; TTP handles a confirm request
+
+  (defrole ttp-cf1
+    (vars (a b t hash_id name) (r text) (k skey) (y mesg))
+    (trace
+     (recv (cf-prime-prime y))
+     (send (cat "sync-cf-req"
+                (cf-prime-prime y)))
+     (send (enc (cf-prime-prime y) (privk "sign" t))))
+    (non-orig (privk hash_id)))
+
+  ;; TTP replies with abort token given confirm request
+
+  (defrole ttp-cf2
+    (vars (a b t hash_id name) (r text) (k skey) (y mesg))
+    (trace
+     (recv (cf-prime-prime y))
+     (recv (cat "sync-cf-req"
+                (enc "abrq"(l-prime-prime y) (privk "sign" a))))
+     (send (enc "abcf"
+                (enc "abrq"(l-prime-prime y) (privk "sign" a))
+                (privk "sign" t))))
+    (non-orig (privk hash_id))))
+
+;; End of Wang's protocol defn.
+
+;; Two experiments to prove Lemma 4.1
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand init1 1 (b b) (t t) (m m) (r r) (k k))
+  (deflistener m)
+  (non-orig
+   (privk "encr" t))
+  (uniq-orig m k)
+  (comment "Experiment 1 to prove Lemma 4.1."))
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand init1 1 (b b) (t t) (m m) (r r) (k k))
+  (deflistener k)
+  (non-orig
+   (privk "encr" t))
+  (uniq-orig m k)
+  (comment "Experiment 2 to prove Lemma 4.1."))
+
+;; We now have three experiments
+;; to prove Lemma 4.2, clause 1.
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand init1 3 (b b) (t t) (m m) (r r) (k k))
+  (non-orig
+   (privk "sign" b))
+  (comment "First of three experiments to prove Lemma 4.2, clause 1."))
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand init3 3 (b b) (t t) (m m) (r r) (k k))
+  (non-orig
+   (privk "sign" b))
+  (comment "Second of three experiments to prove Lemma 4.2, clause 1."))
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand init5 4 (b b) (t t) (m m) (r r) (k k))
+  (non-orig
+   (privk "sign" b))
+  (comment "Third of three experiments to prove Lemma 4.2, clause 1."))
+
+;; Two experiments to prove 4.2, Clause 2.
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand resp1 3 (a a) (t t) (m m) (r r) (k k))
+  (non-orig
+   (privk "sign" a))
+  (comment
+   "First of two experiments to prove Lemma 4.2, clause 2."))
+
+(defskeleton wang
+  (vars (a b t hash_id name) (m data) (r text) (k skey))
+  (defstrand resp2 4 (a a) (t t) (m m) (r r) (k k))
+  (non-orig
+   (privk "sign" a))
+  (comment
+   "Second of two experiments to prove Lemma 4.2, clause 2."))
+
+;; Experiment to prove Lemma 4.2, clause 3.
+
+(defskeleton wang
+  (vars (a b t hash_id name) (e1 e2 x mesg))
+  (defstrand resp3 4 (a a) (t t))
+  (non-orig
+   (privk "sign" a))
+  (comment
+   "Experiments to prove Lemma 4.2, clause 3."))
+
+;; One experiment to prove Lemma 4.3, Clause 1.
+
+(defskeleton wang
+  (vars (a b t hash_id name) (y x mesg))
+  (deflistener
+    (enc "abcf" (enc "abrq" (l-prime y x) (privk "sign" a))
+	 (privk "sign" t)))
+  (non-orig
+   (privk "sign" t))
+  (comment
+   "Experiments to prove Lemma 4.3, clause 1."))
+
+;; Three experiments to prove Lemma 4.3, Clause 2.
+
+(defskeleton wang
+  (vars (y x mesg) (a b t name))
+  (defstrand ttp-ab1 3 (y y) (x x) (a a) (b b) (t t))
+  (non-orig (privk "sign" a)  (privk "encr" t))
+  (comment
+   "Experiment 1 to prove Lemma 4.3, clause 2."))
+
+(defskeleton wang
+  (vars (a b t hash_id name) (r text) (k skey) (y mesg))
+  (defstrand ttp-rc2 3 (a a) (b b) (t t))
+  (non-orig (privk "sign" a)  (privk "encr" t))
+  (comment
+   "Experiment 2 to prove Lemma 4.3, clause 2."))
+
+(defskeleton wang
+  (vars (a b t hash_id name) (r text) (k skey) (y mesg))
+  (defstrand ttp-cf2 3 (a a) (b b) (t t))
+  (non-orig (privk "sign" a)  (privk "encr" t))
+  (comment
+   "Experiment 3 to prove Lemma 4.3, clause 2."))
diff --git a/tst/wang-key-hash.tst b/tst/wang-key-hash.tst
new file mode 100644
--- /dev/null
+++ b/tst/wang-key-hash.tst
@@ -0,0 +1,9533 @@
+(herald "Wang's Fair Exchange Protocol" (bound 10))
+
+(comment "CPSA 2.2.5")
+(comment "All input read")
+(comment "Strand count bounded at 10")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+            (privk "sign" b))))
+      (send
+        (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+          (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (enc (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener m)
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (comment "Experiment 1 to prove Lemma 4.1.")
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))) ((recv m) (send m)))
+  (label 0)
+  (unrealized (1 0))
+  (preskeleton)
+  (comment "Not a skeleton"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener m)
+  (precedes ((0 0) (1 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))) ((recv m) (send m)))
+  (label 1)
+  (parent 0)
+  (unrealized (1 0))
+  (origs (m (0 0)) (k (0 0)))
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener m)
+  (deflistener k)
+  (precedes ((0 0) (2 0)) ((2 1) (1 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation nonce-test (added-listener k) m (1 0) (enc m k))
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))) ((recv m) (send m)) ((recv k) (send k)))
+  (label 2)
+  (parent 1)
+  (seen 3)
+  (unrealized (2 0))
+  (comment "3 in cohort - 2 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (deflistener m)
+  (deflistener k)
+  (defstrand init1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 0)) ((2 2) (1 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation nonce-test (added-strand init1 3) k (2 0)
+    (enc "keytag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+  (traces ((recv m) (send m)) ((recv k) (send k))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (label 3)
+  (parent 2)
+  (unrealized)
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener m)
+  (deflistener k)
+  (defstrand ttp-rc1 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (precedes ((0 0) (3 0)) ((2 1) (1 0)) ((3 2) (2 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation nonce-test (added-strand ttp-rc1 3) k (2 0)
+    (enc "keytag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))) ((recv m) (send m)) ((recv k) (send k))
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "rcrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (send
+        (cat "sync-rc-req"
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (label 4)
+  (parent 2)
+  (unrealized)
+  (comment "1 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (deflistener m)
+  (defstrand init1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 2) (0 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation generalization deleted (1 0))
+  (traces ((recv m) (send m))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (label 5)
+  (parent 3)
+  (unrealized)
+  (shape)
+  (maps ((1 0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs (m (1 0)) (k (1 0))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener m)
+  (defstrand ttp-rc1 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (precedes ((0 0) (2 0)) ((2 2) (1 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation generalization deleted (2 0))
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))) ((recv m) (send m))
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "rcrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (send
+        (cat "sync-rc-req"
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (label 6)
+  (parent 4)
+  (unrealized)
+  (shape)
+  (maps ((0 1) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs (m (0 0)) (k (0 0))))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+            (privk "sign" b))))
+      (send
+        (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+          (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (enc (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener k)
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (comment "Experiment 2 to prove Lemma 4.1.")
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))) ((recv k) (send k)))
+  (label 7)
+  (unrealized (1 0))
+  (preskeleton)
+  (comment "Not a skeleton"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener k)
+  (precedes ((0 0) (1 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))) ((recv k) (send k)))
+  (label 8)
+  (parent 7)
+  (seen 9)
+  (unrealized (1 0))
+  (origs (m (0 0)) (k (0 0)))
+  (comment "3 in cohort - 2 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (deflistener k)
+  (defstrand init1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 2) (0 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation nonce-test (added-strand init1 3) k (1 0)
+    (enc "keytag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+  (traces ((recv k) (send k))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (label 9)
+  (parent 8)
+  (unrealized)
+  (shape)
+  (maps ((1 0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs (m (1 0)) (k (1 0))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (deflistener k)
+  (defstrand ttp-rc1 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (precedes ((0 0) (2 0)) ((2 2) (1 0)))
+  (non-orig (privk "encr" t))
+  (uniq-orig m k)
+  (operation nonce-test (added-strand ttp-rc1 3) k (1 0)
+    (enc "keytag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))) ((recv k) (send k))
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "rcrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (send
+        (cat "sync-rc-req"
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (send (cat k r))))
+  (label 10)
+  (parent 8)
+  (unrealized)
+  (shape)
+  (maps ((0 1) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs (m (0 0)) (k (0 0))))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+            (privk "sign" b))))
+      (send
+        (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+          (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (enc (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (non-orig (privk "sign" b))
+  (comment "First of three experiments to prove Lemma 4.2, clause 1.")
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (label 11)
+  (seen 13)
+  (unrealized (0 1))
+  (origs)
+  (comment "3 in cohort - 2 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand resp1 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 1)))
+  (non-orig (privk "sign" b))
+  (operation encryption-test (added-strand resp1 2)
+    (enc "eortag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k))))
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+      (privk "sign" b)) (0 1))
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r)))
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (label 12)
+  (parent 11)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand resp2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 1)))
+  (non-orig (privk "sign" b))
+  (operation encryption-test (added-strand resp2 2)
+    (enc "eortag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k))))
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+      (privk "sign" b)) (0 1))
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r)))
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))))
+  (label 13)
+  (parent 11)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+            (privk "sign" b))))
+      (send
+        (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+          (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (enc (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init3 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (non-orig (privk "sign" b))
+  (comment "Second of three experiments to prove Lemma 4.2, clause 1.")
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (label 14)
+  (seen 16)
+  (unrealized (0 2))
+  (origs)
+  (comment "3 in cohort - 2 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init3 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand resp1 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 2)))
+  (non-orig (privk "sign" b))
+  (operation encryption-test (added-strand resp1 2)
+    (enc "eortag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k))))
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+      (privk "sign" b)) (0 2))
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))))
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (label 15)
+  (parent 14)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init3 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand resp2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 2)))
+  (non-orig (privk "sign" b))
+  (operation encryption-test (added-strand resp2 2)
+    (enc "eortag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k))))
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+      (privk "sign" b)) (0 2))
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))))
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))))
+  (label 16)
+  (parent 14)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+            (privk "sign" b))))
+      (send
+        (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+          (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (enc (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init5 4 (r r) (m m) (a a) (b b) (t t) (k k))
+  (non-orig (privk "sign" b))
+  (comment "Third of three experiments to prove Lemma 4.2, clause 1.")
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (label 17)
+  (seen 19)
+  (unrealized (0 1) (0 3))
+  (origs)
+  (comment "3 in cohort - 2 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init5 4 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand resp1 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 1)))
+  (non-orig (privk "sign" b))
+  (operation encryption-test (added-strand resp1 2)
+    (enc "eortag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k))))
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+      (privk "sign" b)) (0 1))
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))))
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (label 18)
+  (parent 17)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs))
+
+(defskeleton wang
+  (vars (r text) (m data) (b t a name) (k skey))
+  (defstrand init5 4 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand resp2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 1)))
+  (non-orig (privk "sign" b))
+  (operation encryption-test (added-strand resp2 2)
+    (enc "eortag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k))))
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+      (privk "sign" b)) (0 1))
+  (traces
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))))
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))))
+  (label 19)
+  (parent 17)
+  (unrealized)
+  (shape)
+  (maps ((0) ((b b) (t t) (m m) (r r) (k k) (a a))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+            (privk "sign" b))))
+      (send
+        (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+          (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (enc (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (non-orig (privk "sign" a))
+  (comment "First of two experiments to prove Lemma 4.2, clause 2.")
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (label 20)
+  (seen 21)
+  (unrealized (0 0))
+  (origs)
+  (comment "5 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp1 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (added-strand init1 1)
+    (enc "eootag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k))))
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+      (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r)))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))))
+  (label 21)
+  (parent 20)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (t t) (m m) (r r) (k k) (b b))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+            (privk "sign" b))))
+      (send
+        (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+          (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (enc (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp2 4 (r r) (m m) (a a) (b b) (t t) (k k))
+  (non-orig (privk "sign" a))
+  (comment "Second of two experiments to prove Lemma 4.2, clause 2.")
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (label 22)
+  (seen 23)
+  (unrealized (0 0))
+  (origs)
+  (comment "5 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp2 4 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (added-strand init1 1)
+    (enc "eootag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k))))
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+      (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r)))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))))
+  (label 23)
+  (parent 22)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (t t) (m m) (r r) (k k) (b b))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+            (privk "sign" b))))
+      (send
+        (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+          (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (enc (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (e1 e2 x mesg) (a t b name))
+  (defstrand resp3 4 (e1 e1) (e2 e2) (x x) (a a) (b b) (t t))
+  (non-orig (privk "sign" a))
+  (comment "Experiments to prove Lemma 4.2, clause 3.")
+  (traces
+    ((recv
+       (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+         (enc "eootag"
+           (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+           (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (label 24)
+  (seen 25)
+  (unrealized (0 0) (0 3))
+  (origs)
+  (comment "5 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp3 4 (e1 (enc m k))
+    (e2
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+    (x (enc "h" (cat "h" k))) (a a) (b b) (t t))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (added-strand init1 1)
+    (enc "eootag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k))))
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+      (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))))
+  (label 25)
+  (parent 24)
+  (seen 26 27 28 29)
+  (unrealized (0 3))
+  (comment "8 in cohort - 4 not yet seen"))
+
+(defskeleton wang
+  (vars (r r-0 text) (m data) (a t b name) (k skey))
+  (defstrand resp3 4 (e1 (enc m k))
+    (e2
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+    (x (enc "h" (cat "h" k))) (a a) (b b) (t t))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init2 2 (r r-0) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((2 1) (0 3)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (added-strand init2 2)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 3))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a)))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 26)
+  (parent 25)
+  (seen 27)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (t t) (b b) (e1 (enc m k))
+        (e2
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+        (x (enc "h" (cat "h" k))))))
+  (origs)
+  (comment "1 in cohort - 0 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp3 4 (e1 (enc m k))
+    (e2
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+    (x (enc "h" (cat "h" k))) (a a) (b b) (t t))
+  (defstrand init2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((1 1) (0 3)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (displaced 1 2 init2 2)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 3))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 27)
+  (parent 25)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (t t) (b b) (e1 (enc m k))
+        (e2
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+        (x (enc "h" (cat "h" k))))))
+  (origs))
+
+(defskeleton wang
+  (vars (r r-0 text) (m data) (a t b name) (k skey))
+  (defstrand resp3 4 (e1 (enc m k))
+    (e2
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+    (x (enc "h" (cat "h" k))) (a a) (b b) (t t))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init4 3 (r r-0) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((2 2) (0 3)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (added-strand init4 3)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 3))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a)))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 28)
+  (parent 25)
+  (seen 29)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (t t) (b b) (e1 (enc m k))
+        (e2
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+        (x (enc "h" (cat "h" k))))))
+  (origs)
+  (comment "1 in cohort - 0 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a t b name) (k skey))
+  (defstrand resp3 4 (e1 (enc m k))
+    (e2
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+    (x (enc "h" (cat "h" k))) (a a) (b b) (t t))
+  (defstrand init4 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((1 2) (0 3)))
+  (non-orig (privk "sign" a))
+  (operation encryption-test (displaced 1 2 init4 3)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 3))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 29)
+  (parent 25)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (t t) (b b) (e1 (enc m k))
+        (e2
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t)))
+        (x (enc "h" (cat "h" k))))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+            (privk "sign" b))))
+      (send
+        (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+          (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (enc (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (y x mesg) (a b t name))
+  (deflistener
+    (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+      (privk "sign" t)))
+  (non-orig (privk "sign" t))
+  (comment "Experiments to prove Lemma 4.3, clause 1.")
+  (traces
+    ((recv
+       (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+         (privk "sign" t)))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (label 30)
+  (unrealized (0 0))
+  (origs)
+  (comment "3 in cohort - 3 not yet seen"))
+
+(defskeleton wang
+  (vars (y x mesg) (a b t name))
+  (deflistener
+    (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+      (privk "sign" t)))
+  (defstrand ttp-ab1 3 (y y) (x x) (a a) (b b) (t t))
+  (precedes ((1 2) (0 0)))
+  (non-orig (privk "sign" t))
+  (operation encryption-test (added-strand ttp-ab1 3)
+    (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+      (privk "sign" t)) (0 0))
+  (traces
+    ((recv
+       (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+         (privk "sign" t)))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t))))
+    ((recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (label 31)
+  (parent 30)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (y y) (x x))))
+  (origs))
+
+(defskeleton wang
+  (vars (y mesg) (r text) (a b t name) (k skey))
+  (deflistener
+    (enc "abcf"
+      (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+      (privk "sign" t)))
+  (defstrand ttp-rc2 3 (y y) (r r) (a a) (b b) (t t) (k k))
+  (precedes ((1 2) (0 0)))
+  (non-orig (privk "sign" t))
+  (operation encryption-test (added-strand ttp-rc2 3)
+    (enc "abcf"
+      (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+      (privk "sign" t)) (0 0))
+  (traces
+    ((recv
+       (enc "abcf"
+         (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+         (privk "sign" t)))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))
+    ((recv
+       (cat (cat a b t y (enc "h" (cat "h" k)))
+         (enc "keytag" (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+           k r (pubk "encr" t))
+         (enc "eootag" (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (label 32)
+  (parent 30)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (y y) (x (enc "h" (cat "h" k))))))
+  (origs))
+
+(defskeleton wang
+  (vars (y mesg) (r text) (a b t name) (k skey))
+  (deflistener
+    (enc "abcf"
+      (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+      (privk "sign" t)))
+  (defstrand ttp-cf2 3 (y y) (r r) (a a) (b b) (t t) (k k))
+  (precedes ((1 2) (0 0)))
+  (non-orig (privk "sign" t))
+  (operation encryption-test (added-strand ttp-cf2 3)
+    (enc "abcf"
+      (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+      (privk "sign" t)) (0 0))
+  (traces
+    ((recv
+       (enc "abcf"
+         (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+         (privk "sign" t)))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))
+    ((recv
+       (cat (cat a b t y (enc "h" (cat "h" k)))
+         (enc "keytag" (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+           k r (pubk "encr" t))
+         (enc "eootag" (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (label 33)
+  (parent 30)
+  (unrealized)
+  (shape)
+  (maps ((0) ((a a) (b b) (t t) (y y) (x (enc "h" (cat "h" k))))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+            (privk "sign" b))))
+      (send
+        (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+          (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (enc (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (y x mesg) (a b t name))
+  (defstrand ttp-ab1 3 (y y) (x x) (a a) (b b) (t t))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (comment "Experiment 1 to prove Lemma 4.3, clause 2.")
+  (traces
+    ((recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (label 34)
+  (seen 35 36)
+  (unrealized (0 0))
+  (origs)
+  (comment "4 in cohort - 2 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-ab1 3 (y (enc "h" (cat "h" (enc m k))))
+    (x (enc "h" (cat "h" k))) (a a) (b b) (t t))
+  (defstrand init2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 1) (0 0)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init2 2)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+         (enc "h" (cat "h" k)) (privk "sign" a)))
+      (send
+        (cat "sync-abrq"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 35)
+  (parent 34)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((y (enc "h" (cat "h" (enc m k)))) (x (enc "h" (cat "h" k))) (a a)
+        (b b) (t t))))
+  (origs))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-ab1 3 (y (enc "h" (cat "h" (enc m k))))
+    (x (enc "h" (cat "h" k))) (a a) (b b) (t t))
+  (defstrand init4 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 2) (0 0)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init4 3)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+         (enc "h" (cat "h" k)) (privk "sign" a)))
+      (send
+        (cat "sync-abrq"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 36)
+  (parent 34)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((y (enc "h" (cat "h" (enc m k)))) (x (enc "h" (cat "h" k))) (a a)
+        (b b) (t t))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+            (privk "sign" b))))
+      (send
+        (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+          (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (enc (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (y mesg) (r text) (a b t name) (k skey))
+  (defstrand ttp-rc2 3 (y y) (r r) (a a) (b b) (t t) (k k))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (comment "Experiment 2 to prove Lemma 4.3, clause 2.")
+  (traces
+    ((recv
+       (cat (cat a b t y (enc "h" (cat "h" k)))
+         (enc "keytag" (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+           k r (pubk "encr" t))
+         (enc "eootag" (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (label 37)
+  (seen 38)
+  (unrealized (0 0) (0 1))
+  (origs)
+  (comment "5 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-rc2 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init1 1)
+    (enc "eootag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k))))
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+      (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "rcrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))))
+  (label 38)
+  (parent 37)
+  (seen 39 40 41 42)
+  (unrealized (0 1))
+  (comment "8 in cohort - 4 not yet seen"))
+
+(defskeleton wang
+  (vars (r r-0 text) (m data) (a b t name) (k skey))
+  (defstrand ttp-rc2 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init2 2 (r r-0) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((2 1) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init2 2)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "rcrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a)))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 39)
+  (parent 38)
+  (seen 40)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (b b) (t t) (r r) (k k)
+        (y (enc "h" (cat "h" (enc m k)))))))
+  (origs)
+  (comment "1 in cohort - 0 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-rc2 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (defstrand init2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((1 1) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (displaced 1 2 init2 2)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "rcrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 40)
+  (parent 38)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (b b) (t t) (r r) (k k)
+        (y (enc "h" (cat "h" (enc m k)))))))
+  (origs))
+
+(defskeleton wang
+  (vars (r r-0 text) (m data) (a b t name) (k skey))
+  (defstrand ttp-rc2 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init4 3 (r r-0) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((2 2) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init4 3)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "rcrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a)))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 41)
+  (parent 38)
+  (seen 42)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (b b) (t t) (r r) (k k)
+        (y (enc "h" (cat "h" (enc m k)))))))
+  (origs)
+  (comment "1 in cohort - 0 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-rc2 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (defstrand init4 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((1 2) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (displaced 1 2 init4 3)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "rcrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 42)
+  (parent 38)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (b b) (t t) (r r) (k k)
+        (y (enc "h" (cat "h" (enc m k)))))))
+  (origs))
+
+(comment "Nothing left to do")
+
+(defprotocol wang basic
+  (defrole init1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (send (cat k r))))
+  (defrole init2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init3
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole init4
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t)))))
+  (defrole init5
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))))
+  (defrole resp1
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b))) (recv (cat k r))))
+  (defrole resp2
+    (vars (a b t name) (m data) (r text) (k skey))
+    (trace
+      (recv
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k))) (enc m k)
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))))
+      (send
+        (cat
+          (cat a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (enc "eootag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b))
+          (enc "rcrq"
+            (cat a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h"
+                (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                  (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+            (privk "sign" b)))) (recv (cat k r))))
+  (defrole resp3
+    (vars (a b t name) (e1 e2 x mesg))
+    (trace
+      (recv
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e1 e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))))
+      (send
+        (cat (cat a b t (enc "h" (cat "h" e1)) x) e2
+          (enc "eootag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t (enc "h" (cat "h" e1)) x)) e2
+            (privk "sign" b))
+          (enc "rcrq" (cat a b t (enc "h" (cat "h" e1)) x) e2
+            (privk "sign" b))))
+      (recv
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" e1)) x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab1
+    (vars (a b t name) (y x mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (send (cat "sync-abrq" (enc "abrq" a b t y x (privk "sign" a))))
+      (send
+        (enc "abcf" (enc "abrq" a b t y x (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-ab2
+    (vars (a b t name) (y x e mesg))
+    (trace (recv (enc "abrq" a b t y x (privk "sign" a)))
+      (recv
+        (cat "sync-abrq"
+          (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+            (privk "sign" b))))
+      (send
+        (enc "eortag" (enc "h" (cat "h" a b t y x)) e
+          (privk "sign" b)))))
+  (defrole ttp-rc1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-rc-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)))) (send (cat k r))))
+  (defrole ttp-rc2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "rcrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-rc-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (defrole ttp-cf1
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (cat "sync-cf-req" (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (send
+        (enc (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b)) (privk "sign" t)))))
+  (defrole ttp-cf2
+    (vars (a b t name) (r text) (k skey) (y mesg))
+    (trace
+      (recv
+        (cat (cat a b t y (enc "h" (cat "h" k)))
+          (enc "keytag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+            (pubk "encr" t))
+          (enc "eootag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" a))
+          (enc "eortag"
+            (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))
+          (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+            (enc "keytag"
+              (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+              (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t))))))
+
+(defskeleton wang
+  (vars (y mesg) (r text) (a b t name) (k skey))
+  (defstrand ttp-cf2 3 (y y) (r r) (a a) (b b) (t t) (k k))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (comment "Experiment 3 to prove Lemma 4.3, clause 2.")
+  (traces
+    ((recv
+       (cat (cat a b t y (enc "h" (cat "h" k)))
+         (enc "keytag" (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+           k r (pubk "encr" t))
+         (enc "eootag" (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+             (pubk "encr" t)) (privk "sign" a))
+         (enc "eortag" (enc "h" (cat "h" a b t y (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+             (pubk "encr" t)) (privk "sign" b))
+         (enc "cfrq" (cat a b t y (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h" (cat "h" a b t y (enc "h" (cat "h" k)))) k r
+             (pubk "encr" t)) (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t y (enc "h" (cat "h" k)) (privk "sign" a))
+          (privk "sign" t)))))
+  (label 43)
+  (seen 44)
+  (unrealized (0 0) (0 1))
+  (origs)
+  (comment "5 in cohort - 1 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-cf2 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init1 1)
+    (enc "eootag"
+      (enc "h"
+        (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k))))
+      (enc "keytag"
+        (enc "h"
+          (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+      (privk "sign" a)) (0 0))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "cfrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))))
+  (label 44)
+  (parent 43)
+  (seen 45 46 47 48)
+  (unrealized (0 1))
+  (comment "8 in cohort - 4 not yet seen"))
+
+(defskeleton wang
+  (vars (r r-0 text) (m data) (a b t name) (k skey))
+  (defstrand ttp-cf2 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init2 2 (r r-0) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((2 1) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init2 2)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "cfrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a)))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 45)
+  (parent 44)
+  (seen 46)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (b b) (t t) (r r) (k k)
+        (y (enc "h" (cat "h" (enc m k)))))))
+  (origs)
+  (comment "1 in cohort - 0 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-cf2 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (defstrand init2 2 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((1 1) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (displaced 1 2 init2 2)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "cfrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 46)
+  (parent 44)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (b b) (t t) (r r) (k k)
+        (y (enc "h" (cat "h" (enc m k)))))))
+  (origs))
+
+(defskeleton wang
+  (vars (r r-0 text) (m data) (a b t name) (k skey))
+  (defstrand ttp-cf2 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (defstrand init1 1 (r r) (m m) (a a) (b b) (t t) (k k))
+  (defstrand init4 3 (r r-0) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((2 2) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (added-strand init4 3)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "cfrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a)))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r-0 (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 47)
+  (parent 44)
+  (seen 48)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (b b) (t t) (r r) (k k)
+        (y (enc "h" (cat "h" (enc m k)))))))
+  (origs)
+  (comment "1 in cohort - 0 not yet seen"))
+
+(defskeleton wang
+  (vars (r text) (m data) (a b t name) (k skey))
+  (defstrand ttp-cf2 3 (y (enc "h" (cat "h" (enc m k)))) (r r) (a a)
+    (b b) (t t) (k k))
+  (defstrand init4 3 (r r) (m m) (a a) (b b) (t t) (k k))
+  (precedes ((1 0) (0 0)) ((1 2) (0 1)))
+  (non-orig (privk "encr" t) (privk "sign" a))
+  (operation encryption-test (displaced 1 2 init4 3)
+    (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+      (enc "h" (cat "h" k)) (privk "sign" a)) (0 1))
+  (traces
+    ((recv
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))
+         (enc "eortag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))
+         (enc "cfrq"
+           (cat a b t (enc "h" (cat "h" (enc m k)))
+             (enc "h" (cat "h" k)))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" b))))
+      (recv
+        (cat "sync-cf-req"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a))))
+      (send
+        (enc "abcf"
+          (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+            (enc "h" (cat "h" k)) (privk "sign" a)) (privk "sign" t))))
+    ((send
+       (cat
+         (cat a b t (enc "h" (cat "h" (enc m k))) (enc "h" (cat "h" k)))
+         (enc m k)
+         (enc "keytag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+         (enc "eootag"
+           (enc "h"
+             (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+               (enc "h" (cat "h" k))))
+           (enc "keytag"
+             (enc "h"
+               (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                 (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+           (privk "sign" a))))
+      (recv
+        (enc "eortag"
+          (enc "h"
+            (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+              (enc "h" (cat "h" k))))
+          (enc "keytag"
+            (enc "h"
+              (cat "h" a b t (enc "h" (cat "h" (enc m k)))
+                (enc "h" (cat "h" k)))) k r (pubk "encr" t))
+          (privk "sign" b)))
+      (send
+        (enc "abrq" a b t (enc "h" (cat "h" (enc m k)))
+          (enc "h" (cat "h" k)) (privk "sign" a)))))
+  (label 48)
+  (parent 44)
+  (unrealized)
+  (shape)
+  (maps
+    ((0)
+      ((a a) (b b) (t t) (r r) (k k)
+        (y (enc "h" (cat "h" (enc m k)))))))
+  (origs))
+
+(comment "Nothing left to do")
diff --git a/tst/weird.tst b/tst/weird.tst
--- a/tst/weird.tst
+++ b/tst/weird.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol weird basic
diff --git a/tst/wide-mouth-frog.tst b/tst/wide-mouth-frog.tst
--- a/tst/wide-mouth-frog.tst
+++ b/tst/wide-mouth-frog.tst
@@ -1,7 +1,7 @@
 (herald "Wide-Mouth Frog Protocol"
   (comment "This protocol has an infinite number of shapes"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol wide-mouth-frog basic
diff --git a/tst/wonthull.tst b/tst/wonthull.tst
--- a/tst/wonthull.tst
+++ b/tst/wonthull.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol wonthull basic
diff --git a/tst/wonthull2.tst b/tst/wonthull2.tst
--- a/tst/wonthull2.tst
+++ b/tst/wonthull2.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol wonthull2 basic
diff --git a/tst/wonthull3.tst b/tst/wonthull3.tst
--- a/tst/wonthull3.tst
+++ b/tst/wonthull3.tst
@@ -1,4 +1,4 @@
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol wonthull3 basic
diff --git a/tst/woolam.tst b/tst/woolam.tst
--- a/tst/woolam.tst
+++ b/tst/woolam.tst
@@ -1,6 +1,6 @@
 (herald "Woo-Lam Protocol")
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol woolam basic
diff --git a/tst/yahalom-6.3.6.tst b/tst/yahalom-6.3.6.tst
--- a/tst/yahalom-6.3.6.tst
+++ b/tst/yahalom-6.3.6.tst
@@ -4,7 +4,7 @@
     "Yahalom Protocol, Section 6.3.6, Page 49")
   (url "http://www.eecs.umich.edu/acal/swerve/docs/49-1.pdf"))
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol yahalom basic
diff --git a/tst/yahalom.tst b/tst/yahalom.tst
--- a/tst/yahalom.tst
+++ b/tst/yahalom.tst
@@ -1,6 +1,6 @@
 (herald "Yahalom Protocol Without Forwarding")
 
-(comment "CPSA 2.2.4")
+(comment "CPSA 2.2.5")
 (comment "All input read")
 
 (defprotocol yahalom basic
