packages feed

cpsa 4.4.8 → 4.4.9

raw patch · 165 files changed

+6087/−555 lines, 165 filesdep ~basedep ~containersdep ~deepseq

Dependency ranges changed: base, containers, deepseq, directory, parallel

Files

ChangeLog view
@@ -1,3 +1,38 @@+2026-05-24 Paul D. Rowe <prowe@mitre.org>+	* doc/cpsa4manual.pdf: Document new features in manual++	* cpsa.cabal (Version): Tagged as version 4.4.9++2026-05-23 Paul D. Rowe <prowe@mitre.org>+	* src/CPSA/Signature.hs (defaultSig): Added dev as a default+	atomic sort. Also added locn and chan to be valid sorts in the+	message algebra that can appear in messages.++	* src/CPSA/Channel.hs (ChMsg, ChType, ...): Changed the structure+	of ChMsg to include an argument indicating if it is a channel or+	location.++	* src/CPSA/Algebra.hs (isChan, isLocn, ...): Allowed the channel+	and location positions of events to be any message term.++	* src/CPSA/{Algebra.hs,Channel.hs,Cohort.hs,Db/Loader.hs,+	Displayer.hs,GenRules.hs,LoadFormulas.hs,Loader.hs,Protocol.hs,+	Strand.hs}: Threaded necessary changes to ChMsg data type through+	all functions and fixed resulting incompatibilities.++2026-03-16 Paul D. Rowe <prowe@mitre.org>++	* src/CPSA/Loader.hs (loadSExpr): Added a deflemma as a new+	top-level form. A deflemma is marked as no-check (import as a rule+	into the protocol of the same name for subsequent queries) or as+	check (first add the lemma as a query, then add as a rule for+	subsequent queries regardless of whether or not the lemma is+	satisfied).++2026-02-27 Paul D. Rowe <prowe@mitre.org>++	* cpsa.cabal (Version): Tagged as version 4.4.8+ 2026-02-27 Paul D. Rowe <prowe@mitre.org>  	* src/CPSA/Strand.hs (rewrite): Fixed a bug that failed to check
NEWS view
@@ -1,4 +1,19 @@ CPSA NEWS -- history of user-visible changes.+* Changes in version 4.4.9++** Added top-level deflemma form. In addition to defskeleton and defgoal,+   a user may now also include a deflemma. Each deflemma has a name+   and a field to indicate whether it should be used as a goal, as a+   rule for subsequent queries, or both. The manual has been updated+   to document the usage.++** Changed the way channels and locations work. Previously the channel+   and location positions of events were required to be variables of+   sort chan or locn. Now they may be any message term. Additionally,+   the chan and locn sorts are now considered part of the message+   algebra and hence can be included in protocol messages outside of+   those specified locations. The manual has been updated to document+   this feature and new examples have been added to the test suite.  * Changes in version 4.4.8 
cpsa.cabal view
@@ -1,5 +1,5 @@ Name:                   cpsa-Version:                4.4.8+Version:                4.4.9 Maintainer:             prowe@mitre.org Cabal-Version:          >= 1.10 License:                BSD3@@ -161,16 +161,19 @@   tst/blanchet-strandmax.tst tst/blanchet.scm tst/blanchet.tst   tst/bug_example.scm tst/bug_example.tst tst/cert_lang.scm   tst/cert_lang.tst tst/chan-envelope.scm tst/chan-envelope.tst-  tst/chan-perrig-song.scm tst/chan-perrig-song.tst-  tst/chan-unilateral.scm tst/chan-unilateral.tst-  tst/chan-yahalom-role-decl.scm tst/chan-yahalom-role-decl.tst-  tst/chan-yahalom.scm tst/chan-yahalom.tst tst/commitment.scm-  tst/commitment.tst tst/comp_test.scm tst/comp_test.tst-  tst/completeness-test.scm tst/completeness-test.tst tst/crushing.scm-  tst/crushing.tst tst/dass_simple.scm tst/dass_simple.tst-  tst/denning-sacco.scm tst/denning-sacco.tst tst/deorig_contract.scm+  tst/chan-mesg.scm tst/chan-mesg.tst tst/chan-perrig-song.scm+  tst/chan-perrig-song.tst tst/chan-unilateral.scm+  tst/chan-unilateral.tst tst/chan-yahalom-role-decl.scm+  tst/chan-yahalom-role-decl.tst tst/chan-yahalom.scm+  tst/chan-yahalom.tst tst/commitment.scm tst/commitment.tst+  tst/comp_test.scm tst/comp_test.tst tst/completeness-test.scm+  tst/completeness-test.tst tst/crushing.scm tst/crushing.tst+  tst/dass_simple.scm tst/dass_simple.tst tst/denning-sacco.scm+  tst/denning-sacco.tst tst/deorig_contract.scm   tst/deorig_contract.tst tst/deorig_mesg.scm tst/deorig_mesg.tst-  tst/deorig_simple.scm tst/deorig_simple.tst tst/dh_encrypt_hack.scm+  tst/deorig_simple.scm tst/deorig_simple.tst+  tst/dev-subatomic-open-closed.scm tst/dev-subatomic-open-closed.tst+  tst/devlocn.scm tst/devlocn.tst tst/dh_encrypt_hack.scm   tst/dh_encrypt_hack.tst tst/dh_group_sig_auth_failure.scm   tst/dh_group_sig_auth_failure.tst tst/dh_group_sig.scm   tst/dh_group_sig.tst tst/DH_hack.scm tst/DH_hack.tst@@ -193,8 +196,9 @@   tst/incompleteness_example.tst tst/isoreject-corrected.scm   tst/isoreject-corrected.tst tst/isoreject.scm tst/isoreject.tst   tst/kelly1.scm tst/kelly1.tst tst/kerberos.scm tst/kerberos.tst-  tst/locn_envelope.scm tst/locn_envelope.tst tst/mass.lsp-  tst/mass.tst tst/mass2.lsp tst/mass2.tst tst/missing_contraction.scm+  tst/lemmas.scm tst/lemmas.tst tst/locn_envelope.scm+  tst/locn_envelope.tst tst/mass.lsp tst/mass.tst tst/mass2.lsp+  tst/mass2.tst tst/missing_contraction.scm   tst/missing_contraction.tst tst/neq_test.scm tst/neq_test.tst   tst/neuman-stubblebine-reauth.lsp tst/neuman-stubblebine-reauth.tst   tst/neuman-stubblebine.scm tst/neuman-stubblebine.tst@@ -273,7 +277,8 @@ Executable cpsa4   Main-Is:              CPSA/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 4.13 && < 5, containers, parallel, deepseq+  Build-Depends:        base >= 4.13 && < 5, containers >= 0.8 && < 0.9,+    parallel >= 3.3.0 && < 3.4, deepseq >= 1.4.8 && < 1.5   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports -threaded -rtsopts   Hs-Source-Dirs:       src@@ -288,7 +293,7 @@ Executable cpsa4sas   Main-Is:              CPSA/SAS/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 4.13 && < 5, containers+  Build-Depends:        base >= 4.13 && < 5, containers >= 0.8 && < 0.9   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -300,7 +305,7 @@ Executable cpsa4prot   Main-Is:              CPSA/Prot/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 3 && < 5, containers+  Build-Depends:        base >= 4.13 && < 5, containers >= 0.8 && < 0.9   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -311,7 +316,7 @@ Executable cpsa4goalsat   Main-Is:              CPSA/GoalSat/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 3 && < 5+  Build-Depends:        base >= 4.13 && < 5   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -322,7 +327,7 @@ Executable cpsa4diff   Main-Is:              CPSA/Diff/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 3 && < 5+  Build-Depends:        base >= 4.13 && < 5   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -333,7 +338,7 @@ Executable cpsa4graph   Main-Is:              CPSA/Graph/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 4.13 && < 5, containers+  Build-Depends:        base >= 4.13 && < 5, containers >= 0.8 && < 0.9   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -348,7 +353,7 @@ Executable cpsa4shapes   Main-Is:              CPSA/Shapes/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 4.13 && < 5, containers+  Build-Depends:        base >= 4.13 && < 5, containers >= 0.8 && < 0.9   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -370,7 +375,7 @@ Executable cpsa4json   Main-Is:              CPSA/JSON/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 3 && < 5+  Build-Depends:        base >= 4.13 && < 5   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -381,7 +386,7 @@ Executable cpsa4init   Main-Is:              CPSA/Init/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 3 && < 5, directory+  Build-Depends:        base >= 4.13 && < 5, directory >= 1.3.8 && < 1.4   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -391,7 +396,7 @@ Executable cpsa42latex   Main-Is:              CPSA/Latex/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 3 && < 5+  Build-Depends:        base >= 4.13 && < 5   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -402,7 +407,7 @@ Executable cpsa4roletran   Main-Is:              CPSA/Roletran/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 4.13 && < 5, containers+  Build-Depends:        base >= 4.13 && < 5, containers >= 0.8 && < 0.9   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -415,7 +420,7 @@ Executable cpsa4coq   Main-Is:              CPSA/Coq/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 4.13 && < 5, containers+  Build-Depends:        base >= 4.13 && < 5, containers >= 0.8 && < 0.9   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -426,7 +431,7 @@ Executable cpsa4rolecoq   Main-Is:              CPSA/RoleCoq/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 4.13 && < 5, containers+  Build-Depends:        base >= 4.13 && < 5, containers >= 0.8 && < 0.9   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -439,7 +444,7 @@ Executable cpsa4debranch   Main-Is:              CPSA/Debranch/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 3 && < 5+  Build-Depends:        base >= 4.13 && < 5   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -450,7 +455,7 @@ Executable cpsa4query   Main-Is:              CPSA/Query/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base  >= 3 && < 5, containers+  Build-Depends:        base  >= 4.13 && < 5, containers >= 0.8 && < 0.9   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -463,7 +468,7 @@ Executable cpsa4db   Main-Is:              CPSA/Db/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 4.13 && < 5, containers+  Build-Depends:        base >= 4.13 && < 5, containers >= 0.8 && < 0.9   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -476,7 +481,7 @@ Executable cpsa4dbprolog   Main-Is:              CPSA/DbProlog/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base  >= 3 && < 5, containers+  Build-Depends:        base  >= 4.13 && < 5, containers >= 0.8 && < 0.9   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src@@ -487,7 +492,7 @@ Executable cpsa4dl   Main-Is:              CPSA/DL/Main.hs   Default-Language:     Haskell2010-  Build-Depends:        base >= 3 && < 5, containers+  Build-Depends:        base >= 4.13 && < 5, containers >= 0.8 && < 0.9   GHC-Options:     -Wall -fno-warn-name-shadowing -fwarn-unused-imports   Hs-Source-Dirs:       src
doc/cpsa4manual.pdf view

binary file changed (1367913 → 1368272 bytes)

doc/src/cpsa4manual/algebra.tex view
@@ -1,27 +1,24 @@ \chapter{Algebra Features of CPSA} \label{ch:algebra} -\index{Diffie-Hellman!algebra}-The {\cpsa} distribution comes equipped with two cryptographic-alegbras, the \texttt{basic} cryptoalgebra and the-\texttt{diffie-hellman} cryptoalgebra.  The Diffie-Hellman algebra is-a pure extension of the basic algebra, so a user may always use the-Diffie-Hellman algebra to access all algebraic features.  However, the-performance of the tool is superior when using the basic algebra, so-users are advised to choose the basic algebra whenever they are not-making use of Diffie-Hellman features.--In Chapter~\ref{ch:basic}, we introduced the basic cryptoalgebra,-along with the \texttt{data, text, name, skey,} and \texttt{akey}-sorts, and the \texttt{pubk, privk, invk, enc,} and \texttt{cat}-function symbols.  In addition to these, the basic cryptoalgebra-contains the sorts \ttindex{tag} \texttt{tag} and \texttt{mesg}, and-the \texttt{ltk} and \texttt{hash} function symbols, and string-constants.+\index{Diffie-Hellman!algebra} The {\cpsa} distribution comes equipped+with one cryptographic algebra. For reasons of backwards compatibility+it has two names: the \texttt{basic} cryptoalgebra and the+\texttt{diffie-hellman} cryptoalgebra. Previous versions of {\cpsa}+had separate implementations, but since the Diffie-Hellman algebra was+a pure extension of the basic algebra, we have merged them back into+one. Thus, the Diffie-Hellman features are always available, even when+the user specifies the basic algebra. -The Diffie-Hellman cryptoalgebra introduces two further sorts,-\texttt{rndx} and \texttt{expt}, and six new function symbols,-\texttt{bltk, exp, rec, mul, gen,} and \texttt{one}.+In Chapter~\ref{ch:basic}, we introduced basic components of the+cryptoalgebra such as the \texttt{data, text, name, skey,} and+\texttt{akey} sorts, and the \texttt{pubk, privk, invk, enc,} and+\texttt{cat} function symbols.  In addition to these, there are the+sorts \ttindex{tag} \texttt{tag} and \texttt{mesg}, and the+\texttt{ltk}, \texttt{bltk}, and \texttt{hash} function symbols, and+string constants. To represent Diffie-Hellman values we include two+further sorts, \texttt{rndx} and \texttt{expt}, and five new function+symbols, \texttt{exp, rec, mul, gen,} and \texttt{one}.  At one time variables of sort \texttt{base} were also permitted, but a variable \texttt{b} of sort \texttt{base} has the same meaning as a@@ -315,17 +312,19 @@ partner's public value.  For instance, Alice can calculate $g^{ab} \equiv (g^b)^a \bmod p$. -Version 3 of {\cpsa} introduces the Diffie-Hellman algebra, which-allows for analysis of protocols that incorporate Diffie-Hellman-techniques.  The Diffie-Hellman algebra includes all the function-symbols and sorts available in the basic algebra, plus two additional-sorts of variable, namely the two sorts \texttt{rndx} and-\texttt{expt} for exponents such as $x$.+The cryptoalgebra for {\cpsa} includes features to represent values+that allow for analysis of protocols that incorporate Diffie-Hellman+techniques.  Whether the user asks for the basic algebra or the+Diffie-Hellman algebra, the result is the same: They get an algebra+that includes all the function symbols and sorts available in the+original basic algebra, plus two additional sorts of variable, namely+the two sorts \texttt{rndx} and \texttt{expt} for exponents such as+$x$. %    %   , for %   exponentiated values such as $g^x$. %   -The Diffie-Hellman specific functions symbols are as follows:+The Diffie-Hellman specific function symbols are as follows:  \begin{itemize} \item \texttt{exp} represents exponentation.  For example, $h^x$ is@@ -345,7 +344,11 @@ ${gen}$ is expected to be a variable.  Similarly, \texttt{(mul (one)   x)} represents $1 \cdot x$ while \texttt{(mul one x)} would represent $one \cdot x$ where the tool expects $one$ to be an exponent-variable.+variable. (In fact, using \texttt{(exp gen x)} would result in an+error message since {\cpsa} does not allow variables of the same sort+\texttt{base} as \texttt{(gen)}. But \texttt{(mul one x)} would+produce no error because \texttt{one} can be the name of an+\texttt{expt} variable.)  \item \texttt{rec} represents the multiplicative inverse in the group   of exponents.  So for instance \texttt{(exp (exp (gen) x) (rec x)) =@@ -486,7 +489,7 @@ \label{sec:other_algebra}  \subsection{Hashing}-\index{hash functions} \ttindex{hash} The {\cpsa} basic cryptoalgebra+\index{hash functions} \ttindex{hash} The {\cpsa} cryptoalgebra includes a \texttt{hash} function symbol that can be used to represent the use of a hash function.  The function takes a single input, but \texttt{(hash t1 t2 ... tn)} is interpreted as shorthand for@@ -507,10 +510,10 @@ protocols make use of magic numbers or string constants to disambiguate the purpose of various messages that occur during the protocol.  {\cpsa} includes constant strings in the basic-cryptoalgebra.  Such constants always appear as quoted strings,-e.g. \texttt{"foo"}.  These strings do not need to be declared in a-\texttt{vars} statement because they are not variables.  Tags are-messages, so that a variable of+cryptoalgebra.  Such constants, which we often call \emph{tags},+always appear as quoted strings, e.g. \texttt{"foo"}.  These strings+do not need to be declared in a \texttt{vars} statement because they+are not variables.  Tags are messages, so that a variable of \verb|mesg| sort may be instantiated by a tag.  %   The sort of@@ -554,24 +557,24 @@  In other words, {\cpsa} regards \texttt{(ltk a b)} and \texttt{(ltk b   a)} as distinct from each other; in fact, they are only considered-equal when $a = b$.--The \texttt{bltk} function symbol is available in {\cpsa} in \emph{the-  Diffie-Hellman algebra only},\footnote{This choice may seem odd; it-  was made for performance reasons.  The presence of \texttt{bltk} or-  of Diffie-Hellman elements complicates some basic algebraic-  operations.  The \texttt{basic} cryptoalgebra is provided for-  optimized performance when analyzing protocols that do not include-  these features.} and regards the two names as equivalent in order.-In the Kerberos example discussed in Section~\ref{sec:kerberos}, we-noted that the server's name $s$ always appears second in our-\texttt{ltk} expressions.  This is fine if participants never can act-as both client and server, but if a participant can act as both, the-use of \texttt{ltk} implies that the participant maintains a strict-separation between the keys they share with other servers when acting-as a client (in which their own name appears first), and keys they-share with clients when acting as a server (in which their own name-appears second).+equal when $a = b$. The \texttt{bltk} function+symbol % is available in {\cpsa} in \emph{the+  % Diffie-Hellman algebra only},\footnote{This choice may seem odd; it+  % was made for performance reasons.  The presence of \texttt{bltk} or+  % of Diffie-Hellman elements complicates some basic algebraic+  % operations.  The \texttt{basic} cryptoalgebra is provided for+  % optimized performance when analyzing protocols that do not include+  % these features.} and +regards the two orders of names as equivalent. That is, \texttt{(bltk+  a b) = (bltk b a)}.  In the Kerberos example discussed in+Section~\ref{sec:kerberos}, we noted that the server's name $s$ always+appears second in our \texttt{ltk} expressions.  This is fine if+participants never can act as both client and server, but if a+participant can act as both, the use of \texttt{ltk} implies that the+participant maintains a strict separation between the keys they share+with other servers when acting as a client (in which their own name+appears first), and keys they share with clients when acting as a+server (in which their own name appears second).  The use of \texttt{bltk} implies that participants can act as both servers and clients, and that they only share one key with other@@ -588,8 +591,8 @@ \begin{exercise} \label{ex:bltk_kerb} Make a version of the flawed Kerberos input file \texttt{kerb.scm}-that uses bi-directional long-term keys instead.  Remember to switch-the algebra to Diffie-Hellman!  What differences do you observe?+that uses bi-directional long-term keys instead.  What differences do+you observe? \end{exercise}  \index{examples!Yahalom!with bi-directional keys}
doc/src/cpsa4manual/algorithm.tex view
@@ -62,7 +62,7 @@  In addition, the attacker observes all of the transmissions made in a skeleton.  The attacker is also capable of manipulating messages in-certain specific ways -- these are the derivations present in+certain specific ways---these are the derivations present in Table~\ref{tab:basic_algebra_signature}.  When a reception message can be constructed by the attacker from the@@ -88,7 +88,7 @@ unless the key is compromised.  Only certain kinds of sub-values may be of interest as critical terms,-specifically, those which are \emph{carried} \index{carried subterm}.+specifically, those which are \emph{carried}\index{carried subterm}. The notion of a carried sub-term can be defined recursively: a term carries itself, a pair carries either of its components, and an encryption carries its plaintext.@@ -118,7 +118,7 @@  \end{itemize} -When examining a skeleton and one of its children in full {\cpsa}+When examining a skeleton and one of its children in a full {\cpsa} analysis it is often simple to determine which sort of strategy was used.  If a child has one more strand than its parent then it was produced by either augmentation (if the extra strand is a role@@ -131,7 +131,7 @@  \section{Flawed Kerberos, revisited} \label{sec:kerberos2}-In Section~\ref{sec:kerberos}, we worked through an example -- a+In Section~\ref{sec:kerberos}, we worked through an example---a flawed version of the Kerberos protocol.  The first attempt at modeling the protocol was flawed in a way that would prevent the tool from discovering the attack against the protocol.@@ -173,7 +173,7 @@  The first argument to the operation field is the general type of operation performed.  Typically this will be one of the following-three possibilities:+four possibilities:  \begin{itemize} \item \texttt{encryption-test} indicates that the critical term at the@@ -193,7 +193,7 @@ argument is the criticial term; here it was \texttt{(enc k n (ltk a s))}, the portion of the server's message intended for the initiator.  The last argument is a node, normally the test node, so in this case, the-\texttt{(0 1)} refers to strand 0, node 1 -- the second node of the+\texttt{(0 1)} refers to strand 0, node 1---the second node of the initiator strand in Item 1.  Returning to our example, Item 2's critical term is the encryption
doc/src/cpsa4manual/basic.tex view
@@ -317,17 +317,17 @@  \index{search tree}\index{search tree!colors} Numbers are normally displayed in black, but may also be displayed in other colors.  Blue-numbers represent \emph{realized} skeletons, that is, skeletons that-may represent an actual execution.\footnote{Note that while realized-  skeletons already represent complete executions, {\cpsa} does further-  analysis once a realized skeleton is reached in order to-  \emph{generalize} that skeleton as much as possible.  A skeleton-  that is both realized and cannot be further generalized is a-  \index{shape}\emph{shape}.  See page \pageref{anchor:generalization}-  for more detail on generalization.}  Red numbers represent-\emph{dead} skeletons, that is, skeletons that represent partial-executions that are not part of any actual execution -- in other-words, impossible scenarios.+numbers represent \emph{shapes}, that is, skeletons that represent a+minimal execution.\footnote{Note that sometimes {\cpsa} encounters a+  \emph{realized} skeleton representing an actual execution before a+  shape. It does further analysis once a realized skeleton is reached+  in order to \emph{generalize} that skeleton as much as possible to+  obtain a minimal execution (i.e., a shape).  Realized skeletons that+  are not shapes are displayed in gray. See page+  \pageref{anchor:generalization} for more detail on generalization.}+Red numbers represent \emph{dead} skeletons, that is, skeletons that+represent partial executions that are not part of any actual+execution---in other words, impossible scenarios.  \index{skeleton!realized}\index{skeleton!dead} Numbers may occur in the tree more than once, because it is possible that {\cpsa} will@@ -458,7 +458,7 @@ receive the proper value, note that we only assumed $SK_a$ and $SK_b$ are secure, but we did not assume $SK_{b_0}$ was secure.  It would have been hard to do so, since $b0$ is a value we know nothing about from-the initiator's point of view. The initiator's transmission of+the responder's point of view. The initiator's transmission of $\enc{n2}{K_{b_0}}$ thus does not protect $n2$ from decryption, so an attacker could have created the responder's received message by encrypting $n2$ under $K_b$.@@ -671,9 +671,9 @@ \label{fig:blanchet skel 13} \end{figure} -The \texttt{blanchet.scm} file also contains a second protocol with-the name \texttt{blanchet-corrected} in which the flaw that allows $d$-to be learned in the responder's point of view is eliminated.+The \texttt{blanchet.scm} file also contains a second protocol named+\texttt{blanchet-corrected} in which the flaw that allows $d$ to be+learned in the responder's point of view is eliminated.  \begin{exercise}   Modify the Blanchet protocol to add a role that is identical to the
doc/src/cpsa4manual/channels_state.tex view
@@ -161,6 +161,13 @@ instance of that role.  Since it is a much stronger assumption, it yields less precise analyses. +Starting with {\cpsa} version 4.4.9, when a \verb|send| or \verb|recv|+event has two arguments, the first channel argument can be any algebra+term, not just a variable of the \verb|chan| sort. If a variable of+sort \verb|mesg| is used, that variable must be acquired (i.e. its+first occurrence in the role must be in a carried position of an+inbound event). + \subsection{Yahalom with Channels} \label{sec:channels:state:ch:yahalom} @@ -182,7 +189,7 @@ individual channel property in a declaration in the \verb|defskeleton| query forms.  From the latter we learn a kind of \emph{session-independence\/}:  The security properties of a-particular session of the protocol depend only in the channels that+particular session of the protocol depend only on the channels that should be used in that protocol session, and the messages cannot leak from one session to undermine the security goals of another session. @@ -198,7 +205,7 @@ channel properties are met.  In the original Yahalom protocol (see e.g.~\cite{Paulson97c}), the channels are implemented via symmetric cryptography.  If the initiator and responder each share an-uncompromised long term key with the server, then an authenticated+uncompromised long-term key with the server, then an authenticated encryption mode certainly satisfies the channel properties.  However, other mechanisms are also possible, e.g.~asymmetric primitives or, indeed, TLS.@@ -330,8 +337,8 @@ \texttt{(auth ch1)} stipulation, since the adversary can still arrange for messages from legitimate responders to be delivered repeatedly. -We can infer from this analysis that symmetric authenticated-encryption long term key shared between the key server and each client+We can infer from this analysis that a symmetric authenticated+long-term encryption key shared between the key server and each client is a good way to implement the channels \verb|ch2| and \verb|ch3|, since the key server relies on their confidentiality property and the clients rely on their authentication property.@@ -394,13 +401,25 @@ The analysis from the initiator's point of view can then follow the same pattern. +\paragraph{Message terms as channels.} The test suite has a version of+the above channel-based description of Yahalom+(\texttt{tst/chan-mesg.scm}) in which, instead of using arbitrary+channel variables to name the channels, they are given names such as+\verb|(cat a b)| to indicate is a channel intended to go from \verb|a|+to \verb|b|. The user should be aware that if channel \verb|(cat a b)|+is marked as authentic, then when \verb|b| receives a message on that+channel, the sending party will necessarily agree with the values+\verb|a| and \verb|b| whether or not those names appear in the message+payload.+ \section{State} \label{sec:channels:state:state}  {\cpsa} models situations in which regular principals control devices with state registers or storage locations---we will henceforth use the-term \emph{location} for all such pieces of memory---that allow long-term storage and coordination among different local protocol sessions.%+term \emph{location} for all such pieces of memory---that allow+long-term storage and coordination among different local protocol+sessions.% % \footnote{Allowing the Dolev-Yao adversary to have devices does not   strengthen its powers, as it can already remember unbounded numbers@@ -626,7 +645,7 @@ $m$ follows $n_1$.  Again, their concrete form may be found in the output of {\cpsa}-specifications using state, such as~\texttt{examples/open-closed.tst}.+specifications using state, such as~\texttt{tst/open-closed.tst}.  \paragraph{Why these rules are consequences.}  Each of these rules is easily justified from the discrete-after and discrete-before rules,@@ -637,7 +656,7 @@   \item[Scissors rule:]  The scissors rule follows by two applications   of the discrete-after axiom.  Specifically, since $n\leadsto m_1$   implies $n\prec m_1$, we can apply the discrete-after axiom to infer-  that $m_0\preceq m_1$.  Symmetrically, observing thay+  that $m_0\preceq m_1$.  Symmetrically, observing that   $n\leadsto m_0$ implies $n\prec m_0$, we can again apply the   discrete-after axiom to infer that $m_1\preceq m_0$. @@ -709,22 +728,31 @@ by a sensor and an actuator in a real device.  Finally, it confirms success by sending the hash of the open request. -A \verb|load| or \verb|stor| event always contains a location variable-followed by a message term, just like a channel \verb|send| or-\verb|recv| (Section~\ref{sec:channels:state:ch}).+Starting with {\cpsa} version 4.4.9, a \verb|load| or \verb|stor|+event may be followed by any pair of message terms. The first acts as+a name for the location, just like a channel \verb|send| or+\verb|recv| (Section~\ref{sec:channels:state:ch}). A particularly+useful structure for a channel name is \verb|(cat d l)| where \verb|d|+is a variable of sort \verb|dev| and \verb|l| is a variable of sort+\verb|locn|. This can help to represent natural assumptions about+stateful devices such as the fact that no role will update one+location on one device and another location on another in the same+transaction. If the locations can be viewed as fixed addresses on a+device then one can even use \verb|(cat d "l")| with a constant to+represent the location.  \ttindex{load} \ttindex{stor}  -Observe that the \verb|stor| event immediately follows a \verb|load|-event, and this is in fact always the case.  Since together they-represent a transition that consumes an old value that will no longer-be available after the the transition, the \verb|stor| event always-follows a paired \verb|load| event.  Together, they form a \emph{state-  segment}.  However, state segments may be longer than a single pair-of events.+% Observe that the \verb|stor| event immediately follows a \verb|load|+% event, and this is in fact always the case.  Since together they+% represent a transition that consumes an old value that will no longer+% be available after the the transition, the \verb|stor| event always+% follows a paired \verb|load| event.  Together, they form a \emph{state+%   segment}.  However, state segments may be longer than a single pair+% of events. -In general, a state segment consists of one or more \verb|load|+In general, a state segment consists of zero or more \verb|load| events followed by zero or more \verb|stor| events, subject to the requirements that: %@@ -732,9 +760,9 @@   \item no two \verb|load| events in this state segment load from the   same location;   \item no two \verb|stor| events in this state segment store into the-  same location;-  \item each \verb|stor| event stores into a location from which a-  value was \verb|load|ed in this state segment.+  same location.+  % \item each \verb|stor| event stores into a location from which a+  % value was \verb|load|ed in this state segment. \end{enumerate} % A particular state segment is a \emph{transition for} a location@@ -743,19 +771,19 @@ \verb|load| from $\ell$ but no \verb|stor| into $\ell$ in this state segment. -We use state segments of length greater than two to represent events-that involve multiple locations.  If a transition for location-$\ell_1$ depends on the value present in $\ell_2$, then a state-segment can load $v_1$ and $v_2$ from $\ell_1$ and $\ell_2$-(resp.)~and then store a new value dependent on $v_1,v_2$ into-$\ell_1$.  In this case, the state segment is a transition for-$\ell_1$ but a pure observation for $\ell_2$.  If instead new values-are stored into both $\ell_1$ and $\ell_2$, then the state segment is-a transition for both.  In other cases, a state segment loads from-both $\ell_1$ and $\ell_2$, but instead of storing back to either of-them, it simply uses those values to control future message-transmissions and receptions.  In the latter cases, the state segment-is a pure observation for both $\ell_1$ and $\ell_2$.+State segments of length greater than two necessarily represent events+that involve multiple locations (given the constraints above).  If a+transition for location $\ell_1$ depends on the value present in+$\ell_2$, then a state segment can load $v_2$ from $\ell_2$ and then+store a new value dependent on $v_2$ into $\ell_1$.  In this case, the+state segment is a transition for $\ell_1$ but a pure observation for+$\ell_2$.  If instead new values are stored into both $\ell_1$ and+$\ell_2$, then the state segment is a transition for both.  In other+cases, a state segment loads from both $\ell_1$ and $\ell_2$, but+instead of storing back to either of them, it simply uses those values+to control future message transmissions and receptions.  In the latter+cases, the state segment is a pure observation for both $\ell_1$ and+$\ell_2$.  \paragraph{Rules for protocols with   state.}  \label{state:gen:rules:start} {\cpsa} generates three types
doc/src/cpsa4manual/declarations.tex view
@@ -39,10 +39,9 @@ message model; one matches each derivability rule in the algebra used. The create role consists of a one-event strand in which certain basic values may be transmitted.  This always includes all constants (such-as tag constants or the generator $g$ in the Diffie-Hellman algebra),-and also includes all values of basic sorts: the sorts other than-$\scap{mesg}$ in the basic algebra, and those sorts plus the-$\scap{rndx}$ sort in the Diffie-Hellman algebra.+as tag constants or the Diffie-Hellman generator $g$), and also+includes all values of basic sorts: $\scap{data, text, name, skey,+  akey, rndx}$.  \section{Secrecy assumptions} \label{sec:secrecy_assumptions}@@ -129,12 +128,12 @@ strands.  See Chapter~\ref{chap:channels:state} to understand how to store values explicitly, when that is desired. -In fact, because ``generation'' covers a wider set of occurrences than-``origination,'' when a value $v$ originates on a strand, declaring-$v$ \texttt{uniq-gen} is actually stronger than declaring it-\texttt{uniq-orig}.  The \texttt{uniq-gen} declaration prohibits-unexplained key usage, as opposed to the \texttt{uniq-orig}-declaration that permits it.  +% In fact, because ``generation'' covers a wider set of occurrences than+% ``origination,'' when a value $v$ originates on a strand, declaring+% $v$ \texttt{uniq-gen} is actually stronger than declaring it+% \texttt{uniq-orig}.  The \texttt{uniq-gen} declaration prohibits+% unexplained key usage, as opposed to the \texttt{uniq-orig}+% declaration that permits it.    \begin{exercise} Experiment with variants of your favorite simple protocol in which you@@ -233,8 +232,8 @@ When a single-strand authentication query gives some information about other local sessions, but we would like also to know whether additional conclusions follow if we assume unique origination or-non-origination for values in those local sessions, then we can would-use multiple \texttt{defstrand}s.+non-origination for values in those local sessions, then we would use+multiple \texttt{defstrand}s.  The bindings (aka ``maplets'') in a strand declaration are pairs \texttt{(p v)} where \texttt{p} is a parameter of the role being
doc/src/cpsa4manual/goals.tex view
@@ -173,9 +173,9 @@ are universally quantified.  The conclusion is a disjunction of existentially quantified conjunctions of atomic formulas. -Alternately, a \texttt{defskeleton} can be augmentend with a-\texttt{goal}, which may specify one or more geometric-formulas to check.+% Alternately, a \texttt{defskeleton} can be augmentend with a+% \texttt{goal}, which may specify one or more geometric+% formulas to check.   When the tool is run, a \texttt{defgoal} is converted to a \texttt{defskeleton} that represents as narrowly as possible the@@ -274,7 +274,7 @@  The antecedent in Figure~\ref{fig:ns init} contains two origination assertions.  The formula \texttt{(non (privk b))} is extracted as-\texttt{(privk b)}.  A skeleton~$k$ satisfies the formula if+\texttt{(non-orig (privk b))}.  A skeleton~$k$ satisfies the formula if \texttt{b} maps to a message algebra term~$t$ in~$k$ such that~$k$ assumes that~$t$ is non-originating.  The unique origination formula for \texttt{n1} is similarly extracted.@@ -288,7 +288,7 @@  The \texttt{prec} predicate is used to assert a node precedes another node.  The conclusion in Figure~\ref{fig:ns init} with \texttt{(prec-  z1 1 z0 2)} added is satisfied by the shape using the mapping+  z1 2 z0 2)} added is satisfied by the shape using the mapping $\mbox{\tt z0}\mapsto0$ and $\mbox{\tt z1}\mapsto1$.  The \texttt{uniq-at} predicate is used to assert not only that an atom@@ -330,9 +330,10 @@ \fi  Recall that our aim in analyzing a protocol is to find out what-security goals are true in all of its possible executions.  We are-interested in runs of {\cpsa} that show that when every shape-satisfies a goal, it is true in every execution.+security goals are true in all of its possible executions. When every+shape of a {\cpsa} run satisfies the goal specified in a+\texttt{defgoal} query, then that goal is satisfied in every+execution.   When {\cpsa} performs a shape analysis, every shape it generates refines the input skeleton.  Skeleton refinement is defined@@ -420,7 +421,7 @@ the mapping \texttt{(b b)} maps the initiator's \texttt{b} parameter to \texttt{b}, not \texttt{b-0} as is required to model the shape. -Galvin Lowe identified this authentication failure in+Gavin Lowe identified this authentication failure in Needham-Schroeder and provided a fix.  In the Needham-Schroeder-Lowe Protocol, the name \texttt{b} is included within the encryption in second message of both roles.  With this modification, the shape found by@@ -446,20 +447,25 @@ \caption{Needham-Schroeder Secrecy Goal}\label{fig:ns secrecy} \end{figure} -Figure~\ref{fig:ns secrecy} contains an analysis of Needham-Schroeder-from the point of view of a complete run of the initiator under the+Figure~\ref{fig:ns secrecy} contains a goal of Needham-Schroeder from+the point of view of a complete run of the initiator under the assumption that the responder's and its peer's private keys are uncompromised and the nonce~\texttt{n1} it generates uniquely-originates.  Futhermore, the point of view asserts that the nonce is-leaked using a listener.+originates.  Furthermore, the antecedent of the goal assumes that the+nonce is leaked using a listener (represented by the empty string+\texttt{""}). \begin{quote} \begin{verbatim} (p "" z1 1) (p "" "x" z1 n1)    ; Listener \end{verbatim} \end{quote}--{\cpsa} finds no shapes, so Needham-Schroeder achieves this secrecy-goal and does not leak~\texttt{n1}.+The conclusion of the goal is \texttt{false}, a predicate that is+satisfied by no executions. Essentially, this goal is saying that any+shape found by the analysis is evidence that the nonce can leak, and+therefore a counterexample to the secrecy goal. This is because any+shape found will satisfy the antecedent, but not the conclusion of+this goal. In this case, {\cpsa} finds no shapes, so Needham-Schroeder+achieves this secrecy goal and does not leak~\texttt{n1}.  \section{The Rest of the Story}\label{sec:whole story} @@ -474,8 +480,8 @@  It is wise to ensure that the antecedent in every sentence is identical.  When {\cpsa} performs satisfaction-checking on-sentence~$\Phi$, it only determines if each shape it finds is-satisfied.  If the point of view skeleton is not the characteristic+sentence~$\Phi$, it only determines if each shape +satisfies~$\Phi$.  If the point of view skeleton is not the characteristic skeleton of the antecedent of~$\Phi$, the fact that all skeletons satisfy~$\Phi$ cannot be used to conclude that~$\Phi$ is true in all executions of the protocol.@@ -619,7 +625,7 @@ \end{quote} When using GNU make, type ``\texttt{make goals\_sas.text}''.  The resulting shape analysis sentence is displayed in Figure~\ref{fig:ns-  sas}.+  sas}.   \begin{figure}\small \begin{verbatim}@@ -658,7 +664,7 @@  \section{Rules}\label{sec: rules} -Support for rules was introduced in version 3.6.0 of {\cpsa}.+%Support for rules was introduced in version 3.6.0 of {\cpsa}.  Each protocol includes a small collection of rules.  A rule is a sentence in the goal language presented in@@ -674,7 +680,7 @@ A rule is an axiom added to a protocol.  {\cpsa} uses the axiom as a rewrite rule to derive zero or more new skeletons from a skeleton produced during a step.  An example of a protocol with a rule is in-Figure~\ref{fig:doorsep} on Page~\pageref{fig:doorsep}.+Figure~\ref{fig:doorsep} on page~\pageref{fig:doorsep}.  The trust rule states that when CPSA finds a person strand of length at least one, and the inverse of it's \texttt{p} parameter is@@ -710,8 +716,8 @@ \begin{center}   \verb|(facts (neq a b))| \end{center}-to the point of view skeleton.  CPSA contains a rule governing-\texttt{neq} rule stating essentially:+to the point of view skeleton.  CPSA generates a default rule stating+essentially that \texttt{neq} can never apply to two equal terms:  %below, eliminates skeletons that %violate the constraint.@@ -972,8 +978,8 @@ user-defined rules, or anywhere else that an atomic formula may appear. -A good number of additional rules are generated to implement {\cpsa}-4's model of state (see Section~\ref{sec:channels:state:state},+A good number of additional rules are generated to implement {\cpsa}'s+model of state (see Section~\ref{sec:channels:state:state}, esp. Figs.~\ref{fig:leads:to}--\ref{fig:derived:state:rules} and pp.~\pageref{state:gen:rules:start}--\pageref{state:gen:rules:end}). @@ -1062,9 +1068,9 @@ \end{description} % All of these trace annotations will cause similar rules to be-generated.  However, when Zappa compiles role definitions to Rust-code, they are compiled to have different operational effects.  Trace-annotations do not add to the height of the trace.  They simply+generated.  % However, when Zappa compiles role definitions to Rust+% code, they are compiled to have different operational effects.+Trace annotations do not add to the height of the trace.  They simply express constraints on what happens in the ``real'' events around them. @@ -1149,7 +1155,7 @@ property ensures that $A$ really did say (i.e.~guarantee) $\phi$ in any execution in which $B$ relies on the claim.  The soundness of rely statements may be checked by analyzing the protocol with the rely-statements are omitted, and querying them as goal statements under the+statements omitted, and querying them as goal statements under the relevant non-compromise assumptions.  We will now assume that this soundness checking has been done, and that any relevant non-compromise assumptions are made in the protocol definition.@@ -1365,6 +1371,73 @@ We regard this rely-guarantee method as a systematic way to formalize the trust assumptions, and the effects, of protocols that accomplish real-world tasks, in this case purchase and payment.++\section{Lemmas}\label{sec:lemmas}+One common way in which rules have been used in {\cpsa} is as+lemmas. The analyst would define a goal as a query and run {\cpsa} to+check that the goal is satisfied. Then the goal can be added to the+protocol as a rule to help speed up the search for subsequent+queries. One common example is when {\cpsa} repeatedly undergoes a+long search to satisfy a listener for some key that cannot be+satisfied. Validating once and for all that the key cannot be leaked,+and then including that fact as a rule can drastically improve+performance. ++Unfortunately, the syntax for doing so was not particularly friendly+to the user. The formula stated as a \texttt{defgoal} query resides+outside the protocol, while the \texttt{defrule} version must be+included inside the protocol. Managing these lemmas could become+difficult as there was no built-in management to help determine which+rules had previously been validated as lemmas that hold. ++For this reason, {\cpsa} also includes a \texttt{deflemma} form. It+must be place outside the protocol at the top level, just as a+\texttt{defgoal} form. However, the syntax for a lemma differs+slightly from that of a goal in ways that allow {\cpsa} to help manage+the complexities that arise from sometimes wanting to validate a+formula as a goal and sometimes wanting to use it as a rule. The user+should look at \texttt{tst/lemmas.scm} for an example of the syntax. ++Compared to a \texttt{defgoal}, a \texttt{deflemma} has two extra+arguments that come at the beginning. The first is a flag that signals+to {\cpsa} whether or not it should include a query for the lemma in+order to validate that it is satisfied. There are three valid values:+\texttt{rule}, \texttt{goal}, and \texttt{both}. The second+is a name that will be used as the rule name when the lemma is used as+a rule.++When a lemma uses the \texttt{rule} flag, {\cpsa} will update the+protocol identified in the lemma to include the specified formula as a+rule. As a result, all subsequent queries for that protocol will+include the lemma as a rule. {\cpsa} will not generate a query for the+lemma. The result is the same as if a copy of the protocol with the+same name had been added in this location with an extra+\texttt{defrule} added to it (hence only subsequent queries would use+the rule).++The \texttt{goal} flag signals {\cpsa} to treat the lemma as if+it were a \texttt{defgoal}. A query will be added to the analysis, but+it will not be included as a rule in any subsequent queries. The+skeletons in the analysis contain a comment indicating the name of the+lemma the analysis is associated with.++When the \texttt{both} flag is used, the behavior is first to treat+the lemma as a goal, and then as a rule. {\cpsa} will first create a+query for the lemma against the specified protocol before updating the+protocol to include the lemma as a rule for subsequent queries.++Since {\cpsa} updates the protocol with a rule at load time, it cannot+know in advance whether the lemma is satisfied or not. That means that+subsequent queries will use the lemma as a rule, \emph{even if the+  query for the lemma shows that the lemma is not satisfied}! For this+reason, the added rule contains a comment to indicate whether or not+an associated query has been added to check its validity. When the+\texttt{both} flag is used for a lemma that is not satisfied, since a+query for the formula is generated as a goal, the output will contain+\texttt{(satisfies (no ...))} as evidence that some goal was not+satisfied.++  %%% Local Variables: %%% mode: latex
doc/src/cpsa4manual/input.tex view
@@ -42,7 +42,7 @@ replaced by  \begin{verbatim}-(enc "quote" (extend "refuse" (extend a b)) (env c d) e)+(enc "quote" (extend "refuse" (extend a b)) (enc c d) e) \end{verbatim}  \noindent@@ -101,7 +101,7 @@ (\sym{vars} vdecl$\ast$) \\ vdecl&$\leftarrow$&(id+ sort) \\ trace&$\leftarrow$&(\sym{trace} \{event $\mid$ annot\}+)-\\ event&$\leftarrow$&({dir id? term})+\\ event&$\leftarrow$&({dir term? term}) \\ dir&$\leftarrow$&$\sym{send}\mid\sym{recv}\mid\sym{load}\mid\sym{stor}$ \\ annot&$\leftarrow$&(\sym{cheq} id term) $\mid$                        (\sym{rely} conclusion) $\mid$ (\sym{guarantee} conclusion)@@ -122,6 +122,8 @@ \\ node-pair&$\leftarrow$&(node node) \\ node&$\leftarrow$&(integer integer) \\ goal&$\leftarrow$&(\sym{defgoal} id sentence+ alist)+\\ check&$\leftarrow$& \sym{rule} $\mid$ \sym{goal} $\mid$ \sym{both}+\\ lemma&$\leftarrow$&(\sym{deflemma} check id id sentence alist) \end{tabular} \end{center} \caption[{\cpsa} Input Syntax]{{\cpsa} Input Syntax.  See@@ -161,7 +163,7 @@   & \multicolumn{2}{l|}{\scap{name}, \scap{text},     \scap{data}, \scap{tag}, \scap{skey}, \scap{akey}  $<$     \scap{mesg}} \\-  &  \multicolumn{2}{l|}{\scap{chan}, \scap{locn} $<$ \scap{mesg}} \\+  &  \multicolumn{2}{l|}{\scap{dev}, \scap{chan}, \scap{locn} $<$ \scap{mesg}} \\   \hline \multicolumn{3}{c}{Operations}\\ \hline   $\enc{\cdot}{(\cdot)}\phantom{\colon}$ &   $\scap{mesg}\times\scap{mesg}\rightarrow\scap{mesg} $&@@ -198,9 +200,13 @@ \end{table}  The basic crypto algebra is an order-sorted algebra with signature-described in Table~\ref{tab:basic_algebra_signature}.  The algebra is-the free order-sorted algebra generated by the function symbols,-sorts, and constants given, modulo the one equation.+described in Table~\ref{tab:basic_algebra_signature}.  Historically it+was a distinct subset of the Diffie-Hellman crypto algebra, but they+have since been merged into a single algebra used by all+protocols. The presentation here starts with the basic crypto algebra+as the core, then describes the Diffie-Hellman-specific additions. The+basic algebra is the free order-sorted algebra generated by the function+symbols, sorts, and constants given, modulo the one equation.  Additionally, {\cpsa} reasons about derivability of values from other values, and the basic derivation rules are given in the table, where@@ -240,14 +246,14 @@ \\ alg&$\leftarrow$&$\sym{basic}$ \\   sort&$\leftarrow$&$\sym{text}\mid\sym{data}\mid\sym{name}\mid\sym{tag}\mid\sym{skey}\mid\sym{akey}$\\-  &$\mid$&$\sym{chan}\mid\sym{locn}\mid\sym{mesg}\mid$ id+  &$\mid$&$\sym{dev}\mid\sym{chan}\mid\sym{locn}\mid\sym{mesg}\mid$ id \\ id&$\leftarrow$&symbol \\ term&$\leftarrow$& $\mbox{id}\mid(\sym{pubk}\mbox{ id}) \mid(\sym{privk}\mbox{ id}) \mid(\sym{invk}\mbox{ id})$-\\ &$\mid$&$(\sym{pubk}\mbox{ id}\mbox{ string})-\mid(\sym{privk}\mbox{ id}\mbox{ string})$+\\ &$\mid$&$(\sym{pubk}\mbox{ string}\mbox{ id})+\mid(\sym{privk}\mbox{ string}\mbox{ id})$ \\ &$\mid$&$(\sym{ltk}\mbox{ id id})\mid\mbox{string}\mid(\sym{cat}\mbox{ term+})$ \\ &$\mid$&$(\sym{enc}\mbox{ term+ term})\mid(\sym{hash}\mbox{ term+})$ \\ &$\mid$&$(\mbox{id term+})$@@ -267,7 +273,8 @@ \subsection{The Diffie-Hellman crypto algebra} \label{sec:input:dh} -The Diffie-Hellman crypto algebra is an order-sorted algebra with signature+The Diffie-Hellman crypto algebra refers to the extra features on top+of the basic crypto algebra. It is an order-sorted algebra with signature described in Table~\ref{tab:dh_algebra_signature}.  The algebra is the free order-sorted algebra generated by the function symbols, sorts, and constants given, modulo the equations.@@ -281,7 +288,7 @@          \scap{tag}, \scap{skey}, \scap{akey}%, \scap{base}          $<$ \scap{mesg}} \\        & \multicolumn{2}{l|}{\scap{rndx} $<$ \scap{expt} $<$ \scap{mesg}} \\-  &  \multicolumn{2}{l|}{\scap{chan}, \scap{locn} $<$ \scap{mesg}}+  &  \multicolumn{2}{l|}{\scap{dev}, \scap{chan}, \scap{locn} $<$ \scap{mesg}} \\ \hline \multicolumn{3}{c}{Operations}\\ \hline $\enc{\cdot}{(\cdot)}\phantom{\colon}$ & $\scap{mesg}\times\scap{mesg}\rightarrow\scap{mesg} $& Encryption\\@@ -373,19 +380,19 @@ \\ alg&$\leftarrow$&$\sym{diffie-hellman}$ \\   sort&$\leftarrow$&$\sym{text}\mid\sym{data}\mid\sym{name}\mid\sym{tag}\mid\sym{skey}\mid\sym{akey}$-  \\ &$\mid$ & $\sym{rndx}~\mid\sym{expt}\mid%\sym{base}\mid+  \\ &$\mid$ & $\sym{rndx}~\mid\sym{expt}\mid\sym{dev}\mid                \sym{chan}\mid\sym{locn}\mid\sym{mesg}\mid$ id \\ id&$\leftarrow$&symbol \\ term&$\leftarrow$& $\mbox{id}\mid(\sym{pubk}\mbox{ id}) \mid(\sym{privk}\mbox{ id}) \mid(\sym{invk}\mbox{ id})$-\\ &$\mid$&$(\sym{pubk}\mbox{ id}\mbox{ string})-\mid(\sym{privk}\mbox{ id}\mbox{ string})$+\\ &$\mid$&$(\sym{pubk}\mbox{ string}\mbox{ id})+\mid(\sym{privk}\mbox{ string}\mbox{ id})$ \\ &$\mid$&$(\sym{ltk}\mbox{ id id})\mid\mbox{string}\mid(\sym{cat}\mbox{ term+})$ \\ &$\mid$&$(\sym{enc}\mbox{ term+ term})\mid(\sym{hash}\mbox{ term+})$ \\ &$\mid$&$(\sym{exp}\mbox{ term term })\mid(\sym{gen})\mid(\sym{mul}\mbox{ term term})$-\\ &$\mid$&$(\sym{rec}\mbox{ term})\mid (\mbox{id term+})$+\\ &$\mid$&$(\sym{rec}\mbox{ term})\mid(\sym{one})\mid (\mbox{id term+})$ \end{tabular}} \caption{{\cpsa} Diffie-Hellman Algebra Syntax}\label{tab:dh_term} \end{table}@@ -484,7 +491,8 @@   field (see Section~\ref{sec:kerberos2}) is displayed only for the   first time that skeleton is found.  Other instances are not   annotated with an operation field but instead simply link to the-  isomorphic skeleton.+  isomorphic skeleton. This usage is largely unnecessary due to the+  presence of the seen-ops field.  \index{options!check-nonces} \index{check-nonces option} \item `c' (``check-nonces'') -- check nonces first.  Normally, the   tool will consider the largest possible critical term when attempting@@ -517,12 +525,15 @@   the question: what are all the ways in which this goal may not be   satisfied? \index{options!algebra} \index{algebra} \index{Diffie-Hellman!algebra}-\item `a' (``algebra'') -- sets the algebra to use for the input.  The-  analysis tool expects to run with a single algebra for an entire-  session.  By default the tool uses the \texttt{basic} algebra; an-  input file using the Diffie-Hellman algebra will cause an error-  unless you specify the \texttt{diffie-hellman} algebra via this-  option.+\item `a' (``algebra'') -- sets the algebra to use for the+  input. Since the basic and diffie-hellman algebras have now been+  joined into a single algebra, this option should be considered+  deprecated. +  % The analysis tool expects to run with a single algebra for an+  % entire session.  By default the tool uses the \texttt{basic}+  % algebra; an input file using the Diffie-Hellman algebra will cause+  % an error unless you specify the \texttt{diffie-hellman} algebra+  % via this option.   Usage: \texttt{-a STRING} or \texttt{--algebra=STRING}. \index{options!show-algebras} \item `s' (``show-algebras'') -- causes the tool to print a list of the@@ -563,8 +574,8 @@ Options are included in the herald by constructing an S-expression with first element equal to the long name of an option, and the second element (if any) set to be the parameter for that option.  For instance,-\texttt{(algebra diffie-hellman)} is included for all the examples that-use the \texttt{diffie-hellman} algebra.+\texttt{(bound 20)} can be included to increase the strand bound for+every run of the analysis without having to add the flag manually.  Command-line options override the herald.  Also, certain command-line options are not allowed in the herald, specifically, ``output'',
doc/src/cpsa4manual/macros.tex view
@@ -3,7 +3,7 @@ {\setcounter{running}{\value{enumi}}\end{enumerate}}  \newcommand{\cpsa}{\textsc{cpsa}}-\newcommand{\version}{4.4.8}+\newcommand{\version}{4.4.9} \newcommand{\cpsacopying}{\begingroup   \renewcommand{\thefootnote}{}\footnotetext{{\copyright} 2016--2026 The     MITRE Corporation.  Permission to copy without fee all or part of
doc/src/cpsa4manual/troubleshooting.tex view
@@ -61,10 +61,11 @@ insecure protocol, it may just indicate a protocol where a more clever analysis is required than {\cpsa}'s automated one. -\subsection{Tweaking the search}+\subsection{Configuring the search} There are cases in which the default {\cpsa} analysis does not terminate, but a non-default analysis would terminate.  The tool has-several settings that influence the search but can be tweaked:+several default settings that influence the search but can be+configured:  \begin{itemize} \index{try-old-strands option}@@ -80,7 +81,8 @@   \texttt{try-old-strands} options.  The latter will prioritize the   leftmost strands over the rightmost, while the former will   prioritize the bottom-most unrealized node in the strand rather than-  the topmost.+  the topmost. These can be used individually or jointly, yielding+  three extra non-default search strategies.  \index{check-nonces option} \index{options!check-nonces}@@ -173,9 +175,10 @@ \item \textbf{``Close of unopened list''}.  Your input has an erroneous   close-paren. -\item \textbf{``Disallowed bare exponent''}.  See Section~\ref{sec:dh}.-  The tool requires that within roles and skeletons, exponents occur only-  inside an exponentiation function.+\item \textbf{``Disallowed bare exponent''}.  See+  Section~\ref{sec:dh}.  The tool requires that within roles and+  skeletons, any exponent occurring outside an exponentiation+  function must be of sort \texttt{rndx}.  \item \textbf{``Domain does not match range''}.  This error message   occurs when {\cpsa} is trying to understand the variable assignment@@ -186,13 +189,13 @@   then including \texttt{(a t)} in a defstrand will produce this   error. -\item \textbf{``Duplicate role [...] in protocol [...]''}.  Fairly-  self-explanatory: the roles in a protocol must have distinct names.-  This error occurs if you have two protocols with the same name.+\item \textbf{``Duplicate role [...] in protocol [...]''}.  The roles+  in a protocol must have distinct names.  This error occurs if you+  have two protocols with the same name. -\item \textbf{``Duplicate variable declaration for [...]''}.  Fairly-  self-explanatory: within any \texttt{vars} statement, any symbol may-  be used for a variable name, but each variable name can be declared only once.+\item \textbf{``Duplicate variable declaration for [...]''}.  Within+  any \texttt{vars} statement, any symbol may be used for a variable+  name, but each variable name can be declared only once.  \item \textbf{``End of input in string''}.  You included a quote-delimited   string but didn't close it before the end of the input file.@@ -220,17 +223,24 @@   the \texttt{uniq-orig}, \texttt{uniq-gen}, and \texttt{non-orig} ones,   are expected to be used on atomic terms rather than compound ones. -\item \textbf{``Expecting terms in algebra [...]''}.  The tool-  actually expects to know the message algebra to use up front, before-  it begins parsing.  The algebra is the basic one by default, or you-  may specify through a command-line argument or a herald to use the-  Diffie-Hellman algebra.  Each \texttt{defprotocol} in the input-  specifies an algebra to use, and this error occurs when that algebra-  doesn't match the one {\cpsa} is prepared to parse.  To resolve:-  check that you aren't requesting the wrong algebra, and check that-  you have properly spelled the name of the algebra in your-  \texttt{defprotocol}.+\item \textbf{``Expecting terms in algebra [...]''}. This is a+  historical artifact resulting from the fact that the algebra has two+  names. If you specify one name as a runtime parameter (or in the+  herald) that is different from the name used in the+  \texttt{defprotocol} form, this error will result. +\item \textbf{``Expts must first be received, rndxs first+    sent''}. If the first occurrence of a variables of the+  \texttt{expt} sort is in a transmission, it could resolve to any+  multiplication of exponents and so is underspecified. When receiving+  an exponent, there is no way to ensure it was not chosen to be some+  multiplication of other exponents, so we can assume its sort is+  \texttt{rndx}. Hence the rule described by the error. +% \item \textbf{``Role not well formed: variable [...] not+%     obtained''}.  Variables of the %$\scap{base}$ or+%   $\scap{expr}$ sort must be ``obtained'' when used in roles, meaning+%   that the first occurrence must be in a reception.+   \item \textbf{``Identifier [...] unknown''}.  This is a relatively common   user-caused error that occurs when you try to use a variable not declared   in your \texttt{vars} declaration.@@ -293,22 +303,24 @@   that is other than one of these, this is the error message you will   see. -\item \textbf{``Malformed pair -- nodes in same strand''}.  In a \texttt{defskeleton}-  you are prohibited from specifying orderings between nodes in the same strand.+\item \textbf{``Malformed pair -- nodes in same strand''}.  In a+  \texttt{defskeleton} you are prohibited from specifying orderings+  between nodes in the same strand.    This is not the case for \texttt{leadsto} relationships.  \item \textbf{``No strands''}.  Your \texttt{defskeleton} did not include   any strands at all; it must include at least one. -\item \textbf{``Node occurs in more than one role predicate''}.  Node variables-  in a goal must occur within a role position predicate, but should not occur within-  more than one within their defined scope.+\item \textbf{``Node occurs in more than one role predicate''}.  Node+  variables in a goal must occur within a role position predicate, but+  should not occur within more than one within their defined scope. -\item \textbf{``Priority declaration disallowed on [...]''}.  Prioritization-  has no effect except on events that need an explanation.  If you try to-  change the default priority of a send or state initialization event, this-  is assumed to be a mistake and the tool produces this error.+\item \textbf{``Priority declaration disallowed on [...]''}.+  Prioritization has no effect except on events that need an+  explanation.  If you try to change the default priority of a+  \texttt{send} or \texttt{stor} event, this is assumed to be a+  mistake and the tool produces this error.  \item \textbf{``Protocol [...] unknown''}.  This error occurs when you   have a \texttt{defskeleton} or \texttt{defgoal} with a protocol name@@ -325,53 +337,60 @@   match the role of the role position predicate the variable occurs   in. -\item \textbf{``Role not well formed: role trace is a prefix of a listener''}.  {\cpsa}-  disallows the use of roles that begin with the reception of some-  message followed by the transmission of that same message, because-  there is an ambiguity as to whether an instance is a listener or an-  instance of a protocol role.  This should not be a problem because-  beginning a role in this manner is quite unusual, but if it is-  necessary to you to do so we recommend the reception be paired with-  a tag constant such as \texttt{(cat "regular role" [...])}.+\item \textbf{``Role not well formed: role trace is a prefix of a+    listener''}.  {\cpsa} disallows the use of roles that begin with+  the reception of some message followed by the transmission of that+  same message, because there is an ambiguity as to whether an+  instance is a listener or an instance of a protocol role.  This+  should not be a problem because beginning a role in this manner is+  quite unusual, but if it is necessary for you to do so we recommend+  the reception be paired with a tag constant such as \texttt{(cat+    "regular role" [...])}. -\item \textbf{``Role not well formed: non-orig [...] carried''}.  The \texttt{non-orig}-  declaration specifies that a certain atomic value not be carried-  (see Section~\ref{sec:secrecy_assumptions}).  You have made such a declaration but a-  plain (full-height) instance of your role violates the rule.+\item \textbf{``Role not well formed: non-orig [...] carried''}.  The+  \texttt{non-orig} declaration specifies that a certain atomic value+  not be carried (see Section~\ref{sec:secrecy_assumptions}).  You+  have made such a declaration but a plain (full-height) instance of+  your role violates the rule. -  \item \textbf{``Role not well formed: uniq-orig [...] doesn't-    originate''}.  The \texttt{uniq-orig} declaration states not only-  that the declared value originates on a regular strand uniquely (see-  Section~\ref{sec:secrecy_assumptions}), but also states that the-  apparent origination point is the unique origination point of that-  value.  As such, you may only use the \texttt{uniq-orig} declaration-  on a value that does originate somewhere.  If you declare a value-  \texttt{uniq-orig} on a role but it does not originate on that role,-  you get this error.+\item \textbf{``Role not well formed: uniq-orig/uniq-gen [...] doesn't+    originate/generate''}. The \texttt{uniq-orig} declaration in a+  role requires the declared value to originate, i.e., its first+  carried occurrence is in a transmission. The role probably has an+  earlier carried reception of the value. Similarly \texttt{uniq-gen}+  requires the first occurrence (whether carried or not) to be in a+  transmission. See Section~\ref{sec:secrecy_assumptions} for an+  explanation of ``carried.''+  % The \texttt{uniq-orig} declaration states not only that the+  % declared value originates on a regular strand uniquely (see+  % Section~\ref{sec:secrecy_assumptions}), but also states that the+  % apparent origination point is the unique origination point of that+  % value.  As such, you may only use the \texttt{uniq-orig}+  % declaration on a value that does originate somewhere.  If you+  % declare a value \texttt{uniq-orig} on a role but it does not+  % originate on that role, you get this error. Similarly for+  % \texttt{uniq-gen}  \item \textbf{``Role not well formed: variable [...] not acquired''}.   Variables of the $\scap{mesg}$ sort must be ``acquired'' when used   in roles.  This means that the first occurrence of the variable must   be a \emph{carried} occurrence in a reception event.  See-  Section~\ref{sec:secrecy_assumptions} fr an explanation of-  ``carried.''+Section~\ref{sec:secrecy_assumptions} for an explanation of+``carried.'' -  \item \textbf{``Role not well formed: variable [...] not-    obtained''}.  Variables of the %$\scap{base}$ or-  $\scap{expr}$ sort must be ``obtained'' when used in roles, meaning-  that the first occurrence must be in a reception.  \item \textbf{``[Role / Skeleton] not well formed: inequality-  conditions violated''}.  A \texttt{neq} declaration is false where+    conditions violated''}.  A \texttt{neq} declaration is false where   it is first declared: in a role or skeleton definition. -\item \textbf{``[Role / Skeleton] not well formed: lt declarations form a cycle''}.  The-  \texttt{lt} declarations present in a role or in a skeleton are already violated in-  the role or skeleton definition.+\item \textbf{``[Role / Skeleton] not well formed: lt declarations+    form a cycle''}.  The \texttt{lt} declarations present in a role+  or in a skeleton are already violated in the role or skeleton+  definition. -\item \textbf{``[Role / Skeleton] not well formed: subsort requirements violated''}.  The-  \texttt{subsort} declarations present in the role or skeleton being defined are already-  violated.+\item \textbf{``[Role / Skeleton] not well formed: subsort+    requirements violated''}.  The \texttt{subsort} declarations+  present in the role or skeleton being defined are already violated.  \item \textbf{``Skeleton not well formed: a variable in [...] is not in some trace''}.   A \texttt{defskeleton} causes this error when a variable used in a declaration@@ -392,26 +411,26 @@   In {\cpsa}, an ordering must be such that the earlier node has an outgoing type, so   for instance an ordering directly between two reception events is disallowed. -  \item \textbf{``Skeleton not well formed: uniq-orig [...] doesn't-    originate''}.  The \texttt{uniq-orig} declaration states not only-  that the declared value originates on a regular strand uniquely (see-  Section~\ref{sec:secrecy_assumptions}), but also states that the-  apparent origination point is the unique origination point of that-  value.  As such, you may only use the \texttt{uniq-orig} declaration-  on a value that does originate somewhere.  If you declare a value-  \texttt{uniq-orig} on a skeleton but it does not originate in the-  skeleton, you get this error.+% \item \textbf{``Skeleton not well formed: uniq-orig [...] doesn't+%     originate''}.  The \texttt{uniq-orig} declaration states not only+%   that the declared value originates on a regular strand uniquely (see+%   Section~\ref{sec:secrecy_assumptions}), but also states that the+%   apparent origination point is the unique origination point of that+%   value.  As such, you may only use the \texttt{uniq-orig} declaration+%   on a value that does originate somewhere.  If you declare a value+%   \texttt{uniq-orig} on a skeleton but it does not originate in the+%   skeleton, you get this error. -  Similarly, \textbf{``...: uniq-gen [...] doesn't generate''}-  represents a detected error in that \texttt{uniq-gen} states that-  not only does the given value generate (see-  Section~\ref{sec:secrecy_assumptions}) uniquely, but that its apparent-  generation point is that generation point.  As such, a generation-  point is expected.+%   Similarly, \textbf{``...: uniq-gen [...] doesn't generate''}+%   represents a detected error in that \texttt{uniq-gen} states that+%   not only does the given value generate (see+%   Section~\ref{sec:secrecy_assumptions}) uniquely, but that its apparent+%   generation point is that generation point.  As such, a generation+%   point is expected.  \item \textbf{``Sort [...] not recognized''}.  You attempted to declare a variable-  to be of a sort not present in the algebra.  Check to ensure that if you are using-  Diffie-Hellman-related sorts that you are using the \texttt{diffie-hellman} algebra.+  to be of a sort not present in the algebra. There is likely a typo+  in one of the sorts.  \item \textbf{``Terms in [role/skeleton] not well formed''}.  This error occurs   when you have constructed a term using a function symbol that@@ -421,8 +440,8 @@   well-formed.  To resolve: double-check your variable declarations and   your use of function symbols. -  This may also occur if you use the \texttt{node} sort in a role or skeleton; that-  sort should only be used in a goal declaration.+  % This may also occur if you use the \texttt{node} sort in a role or skeleton; that+  % sort should only be used in a goal declaration.  \item \textbf{``Too many locations in declaration''}.  You have a   native declaration that appears to include two or more@@ -440,7 +459,7 @@   tool rejects for this reason.  \item \textbf{``Unexpected end of input in list''}.  One of the most frequent-  user errors - you didn't include close parens for all your S-expressions.+  user errors---you didn't include close parens for all your S-expressions.  \end{itemize} 
doc/src/macros.tex view
@@ -1,5 +1,5 @@ \newcommand{\cpsa}{\textsc{cpsa}}-\newcommand{\version}{4.4.8}+\newcommand{\version}{4.4.9} \newcommand{\cpsacopying}{\begingroup   \renewcommand{\thefootnote}{}\footnotetext{{\copyright} 2010 The     MITRE Corporation.  Permission to copy without fee all or part of
src/CPSA/Algebra.hs view
@@ -85,7 +85,9 @@     isAtom,     isStrdVar,     isChan,+    isChanSort,     isLocn,+    isLocnSort,     isIndxVar,     isIndxConst,     intOfIndex,@@ -540,14 +542,28 @@  -- Is term a channel variable isChan :: Term -> Bool-isChan (F Chan [I _]) = True+isChan (F _ _) = True+isChan (G _) = True+isChan (C _) = True+isChan (I _) = True isChan _ = False +isChanSort :: Term -> Bool+isChanSort (F Chan _) = True+isChanSort _ = False+ -- Is term a location variable isLocn :: Term -> Bool-isLocn (F Locn [I _]) = True+isLocn (F _ _) = True+isLocn (G _) = True+isLocn (C _) = True+isLocn (I _) = True isLocn _ = False +isLocnSort :: Term -> Bool+isLocnSort (F Locn _) = True+isLocnSort _ = False+ -- Note that isVar of (D _) is false. isStrdVar :: Term -> Bool isStrdVar (D _) = True@@ -620,6 +636,10 @@     extendVarEnv xts x t        -- Mesg variable termWellFormed xts t@(F (Data _) [I x]) =     extendVarEnv xts x t        -- Data variable+termWellFormed xts t@(F Locn [I x]) =+    extendVarEnv xts x t        -- Locn variable can also be a term. Why not?+termWellFormed xts t@(F Chan [I x]) =+    extendVarEnv xts x t        -- Chan variable can also be a term. Why not? termWellFormed xts (F (Data "skey") [F Ltk [I x, I y]]) =                                 -- Long term shared symmetric key     foldM termWellFormed xts [F Name [I x], F Name [I y]]@@ -965,7 +985,7 @@     isRndx _ = False     extrRndx (G t) = t     extrRndx _ = error ("Algebra.hs: extrRndx called on a non-exponent")-    indicatorBasis = S.fold mul M.empty numAvoid+    indicatorBasis = S.foldr mul M.empty numAvoid indicator _ t = error ("Algebra.hs: indicator called on a non-base " ++ show t)  escapeSet :: Set Term -> Set Term -> Term -> Maybe (Set Term)
src/CPSA/Channel.hs view
@@ -6,7 +6,7 @@ -- modify it under the terms of the BSD License as published by the -- University of California. -module CPSA.Channel (ChMsg (..), cmTerm, cmTerms, cmMap, cmChan,+module CPSA.Channel (ChType (..), ChMsg (..), cmTerm, cmTerms, cmMap, cmChan,                      cmMatch, cmMatchRename, cmUnify, cmtSubstitute,                      cmFoldCarriedTerms,                      CMT (..),@@ -24,47 +24,54 @@ -- A channel message is either a plain message or a channel and a -- message. +data ChType+  = Chan+  | Locn+  deriving (Show, Eq, Ord)+ data ChMsg   = Plain !Term                 -- Plain message-  | ChMsg !Term !Term           -- Channel and a message+  | ChMsg !ChType !Term !Term   -- Channel and a message   deriving (Show, Eq, Ord)  -- Get channel message term cmTerm :: ChMsg -> Term cmTerm (Plain t) = t-cmTerm (ChMsg _ t) = t+cmTerm (ChMsg _ _ t) = t  -- Get terms in channel message as a list cmTerms :: ChMsg -> [Term] cmTerms (Plain t) = [t]-cmTerms (ChMsg ch t) = [ch, t]+cmTerms (ChMsg _ ch t) = [ch, t]  -- Get channel message channel cmChan :: ChMsg -> Maybe Term cmChan (Plain _) = Nothing-cmChan (ChMsg ch _) = Just ch+cmChan (ChMsg _ ch _) = Just ch  -- Map term and the channel if its there in channel message cmMap :: (Term -> Term) -> ChMsg -> ChMsg cmMap f (Plain  t) = Plain $ f t-cmMap f (ChMsg ch t) = ChMsg (f ch) (f t)+cmMap f (ChMsg ct ch t) = ChMsg ct (f ch) (f t)  -- Matching  cmMatch :: ChMsg -> ChMsg -> (Gen, Env) -> [(Gen, Env)] cmMatch (Plain t) (Plain t') ge =   match t t' ge-cmMatch (ChMsg ch t) (ChMsg ch' t') ge =-  do-    ge <- match ch ch' ge-    match t t' ge+cmMatch (ChMsg ct ch t) (ChMsg ct' ch' t') ge+  | ct /= ct' = []+  | otherwise = do+      ge <- match ch ch' ge+      match t t' ge cmMatch _ _ _ = []  -- Match insisting on renamings cmMatchRename :: ChMsg -> ChMsg -> (Gen, Env) -> [(Gen, Env)] cmMatchRename (Plain t) (Plain t') ge =     matchRename t t' ge-cmMatchRename (ChMsg ch t) (ChMsg ch' t') ge =+cmMatchRename (ChMsg ct ch t) (ChMsg ct' ch' t') ge =+  if ct /= ct' then [] else     do       ge <- matchRename ch ch' ge       matchRename t t' ge@@ -75,17 +82,18 @@ cmUnify :: ChMsg -> ChMsg -> (Gen, Subst) -> [(Gen, Subst)] cmUnify (Plain t) (Plain t') gs =   unify t t' gs-cmUnify (ChMsg ch t) (ChMsg ch' t') gs =-  do-    gs <- unify ch ch' gs-    unify t t' gs+cmUnify (ChMsg ct ch t) (ChMsg ct' ch' t') gs =+  if ct /= ct' then [] else+    do+      gs <- unify ch ch' gs+      unify t t' gs cmUnify _ _ _ = []  cmSubstitute :: Subst -> ChMsg -> ChMsg cmSubstitute subst t = cmMap (substitute subst) t  cmFoldCarriedTerms :: (a -> CMT -> a) -> a -> ChMsg -> a-cmFoldCarriedTerms f acc cm@(ChMsg _ t) =+cmFoldCarriedTerms f acc cm@(ChMsg _ _ t) =   foldCarriedTerms g (f acc (CM cm)) t   where     g acc t = f acc (TM t)@@ -124,7 +132,7 @@ cmtCarriedPlaces :: CMT -> ChMsg -> [Place] cmtCarriedPlaces (TM ct) (Plain t) =   map (prefix 0) (carriedPlaces ct t)-cmtCarriedPlaces (TM ct) (ChMsg _ t) =+cmtCarriedPlaces (TM ct) (ChMsg _ _ t) =   map (prefix 1) (carriedPlaces ct t) cmtCarriedPlaces (CM ct) cm   | ct == cm = [Place []]@@ -137,7 +145,7 @@ cmtAncestors _ (Place []) = [] cmtAncestors cm@(Plain t) (Place (0 : path)) =   CM cm : map TM (ancestors t (Place path))-cmtAncestors cm@(ChMsg _ t) (Place (1 : path)) =+cmtAncestors cm@(ChMsg _ _ t) (Place (1 : path)) =   CM cm : map TM (ancestors t (Place path)) cmtAncestors _ _ = error "Channel.cmtAncestors: Bad path to term" 
src/CPSA/Cohort.hs view
@@ -266,7 +266,7 @@       vs = addSendingBefore S.empty v       ts = termsInNodes k vs     -- Outbound non-conf predecessors       (a, _) = avoid k-      encs = S.fold f S.empty escape'+      encs = S.foldr f S.empty escape'       f (CM _) ts = ts       f (TM t) ts = S.insert t ts @@ -680,7 +680,7 @@     else        S.difference targetTermsWithEscapeSet escape     where-      targetTermsWithEscapeSet = S.fold f (S.singleton ct) escape+      targetTermsWithEscapeSet = S.foldr f (S.singleton ct) escape       f (CM t) ts =           foldl (flip S.insert) ts                 (concatMap (cmtAncestors t) (cmtCarriedPlaces ct t))@@ -758,12 +758,12 @@            (k', n', phi, subst) <- addListener k n cause t',            maybeSolved ct pos eks escape k' n' subst (kabsent k) ]     where-      f (ChMsg _ _) _ = True+      f (ChMsg _ _ _) _ = True       f (Plain t) t' = t /= t'  escapeKeys :: [Term] -> Set CMT -> Set Term escapeKeys eks escape =-    S.fold f es escape+    S.foldr f es escape     where       f (TM e) s = maybe s (flip S.insert s) (decryptionKey e)       f (CM _) s = s
src/CPSA/Db/Loader.hs view
@@ -87,7 +87,7 @@     do       ch <- loadChan sig vars ch       t <- loadTerm sig vars False t-      return (In $ ChMsg ch t)+      return (In $ ChMsg Chan ch t) loadEvt sig vars (L _ [S _ "send", t]) =     do       t <- loadTerm sig vars False t@@ -96,17 +96,17 @@     do       ch <- loadChan sig vars ch       t <- loadTerm sig vars False t-      return (Out $ ChMsg ch t)+      return (Out $ ChMsg Chan ch t) loadEvt sig vars (L _ [S _ "load", ch, t]) =     do       ch <- loadLocn sig vars ch       t <- loadTerm sig vars False t-      return (In $ ChMsg ch t)+      return (In $ ChMsg Locn ch t) loadEvt sig vars (L _ [S _ "stor", ch, t]) =     do       ch <- loadLocn sig vars ch       t <- loadTerm sig vars False t-      return (Out $ ChMsg ch t)+      return (Out $ ChMsg Locn ch t) loadEvt _ _ (L pos [S _ dir, _]) =     fail (shows pos $ "Unrecognized direction " ++ dir) loadEvt _ _ x = fail (shows (annotation x) "Malformed event")
src/CPSA/Displayer.hs view
@@ -214,14 +214,14 @@     where       displayDt (In (Plain t)) =         L () [S () "recv", displayTerm ctx t]-      displayDt (In (ChMsg ch t)) =-          case isLocn ch of+      displayDt (In (ChMsg ct ch t)) =+          case ct == Locn of             True ->  L () [S () "load", displayTerm ctx ch, displayTerm ctx t]             False -> L () [S () "recv", displayTerm ctx ch, displayTerm ctx t]       displayDt (Out (Plain t)) =         L () [S () "send", displayTerm ctx t]-      displayDt (Out (ChMsg ch t)) =-          case isLocn ch of+      displayDt (Out (ChMsg ct ch t)) =+          case ct == Locn of             True ->  L () [S () "stor", displayTerm ctx ch, displayTerm ctx t]             False -> L () [S () "send", displayTerm ctx ch, displayTerm ctx t] @@ -231,14 +231,14 @@     where       displayDt (In (Plain t)) =         L () [S () "recv", displayTerm ctx t]-      displayDt (In (ChMsg ch t)) =-          case isLocn ch of+      displayDt (In (ChMsg ct ch t)) =+          case ct == Locn of             True ->  L () [S () "load", displayTerm ctx ch, displayTermNoPt ctx t]             False -> L () [S () "recv", displayTerm ctx ch, displayTerm ctx t]       displayDt (Out (Plain t)) =         L () [S () "send", displayTerm ctx t]-      displayDt (Out (ChMsg ch t)) =-          case isLocn ch of+      displayDt (Out (ChMsg ct ch t)) =+          case ct == Locn of             True ->  L () [S () "stor", displayTerm ctx ch, displayTermNoPt ctx t]             False -> L () [S () "send", displayTerm ctx ch, displayTerm ctx t] @@ -402,7 +402,7 @@  displayCmt :: Context -> CMT -> SExpr () displayCmt ctx (CM (Plain t)) = displayTerm ctx t-displayCmt ctx (CM (ChMsg ch t)) =+displayCmt ctx (CM (ChMsg _ ch t)) =   L () [S () "ch-msg", displayTerm ctx ch, displayTerm ctx t] displayCmt ctx (TM t) = displayTerm ctx t 
src/CPSA/GenRules.hs view
@@ -133,6 +133,17 @@      (g,[])      ["indx", "strd", "mesg"] +{- constRule :: Sig -> Gen -> (Gen, [Rule])+constRule sig g =+    let (g1, v1) = newVar sig g "v1" "mesg" in+    let (g2, v2) = newVar sig g1 "v2" "mesg" in+    let (g3, m) = newVar sig g2 "m" "mesg" in+    let (g4, r) = (ruleOfClauses sig g3 "constRl"+         [v1,v2,m]+         [(AFact "const" [v1, m]), (AFact "const" [v2,m])]+         [([],[Equals v1 v2])]) in+    (g4, [r])-}+ transRls :: Sig -> Gen -> Role -> [(Int,Int)] -> (Gen, [Rule]) transRls sig g rl =     L.foldl@@ -162,13 +173,13 @@     case drop start $ rtrace rl -- zero-based, so this retains the                                 -- start node     of-      (In (ChMsg ch _) : c)-          | start <= end && isLocn ch  -> loopLeft start c+      (In (ChMsg ct _ _) : c)+          | start <= end && ct == Locn -> loopLeft start c           | otherwise                  -> error ("lastRecvOrFirstSendInCS:  Huh? " ++                                                  (rname rl) ++ " at " ++ (show start) ++                                                  " should be a state event")-      (Out (ChMsg ch _) : _)-          | start <= end && isLocn ch  -> Right start+      (Out (ChMsg ct _ _) : _)+          | start <= end && ct == Locn  -> Right start           | otherwise                  -> error ("lastRecvOrFirstSendInCS:  Huh? " ++                                                  (rname rl) ++ " at " ++ (show start) ++                                                " should be a state event")@@ -177,8 +188,8 @@                   " should be a state event")     where -- i points to the index of a node that was definitely a           -- load -      loopLeft i ((In (ChMsg ch _)) : c)-          | i <= end && isLocn ch       = loopLeft (i+1) c+      loopLeft i ((In (ChMsg ct _ _)) : c)+          | i <= end && ct == Locn      = loopLeft (i+1) c           | otherwise                   = Left i       loopLeft i _                      = Left i        
src/CPSA/LoadFormulas.hs view
@@ -455,7 +455,7 @@ loadAlgTerm sig ts x =   do     t <- loadTerm sig ts False x-    case isStrdVar t || isIndxVar t || isIndxConst t || isChan t || isLocn t of+    case isStrdVar t || isIndxVar t || isIndxConst t of -- || isChan t || isLocn t of       True -> fail (shows (annotation x) "Expecting an algebra term")       False -> return t -- Load a term and make sure it does not have sort strd, or indx
src/CPSA/Loader.hs view
@@ -59,6 +59,21 @@     do       k <- findGoal pos ps xs       return (ps, k : ks)+loadSExpr sig _ g (ps, ks) (L pos (S _ "deflemma" : S _ flag : lname : name : xs)) =+    case (lemmaCheck flag, lemmaUse flag) of+        (True, True) -> do+          k <- findGoal pos ps (name : (xs ++ [(L pos [S pos "comment", S pos "Lemma:", lname])]))+          p <- findProt sig g pos ps lname name xs True+          return (p : ps, k : ks)+        (True, False) -> do+          k <- findGoal pos ps (name : (xs ++ [(L pos [S pos "comment", S pos "Lemma:", lname])]))+          return (ps, k : ks)+        (False, True) -> do+          p <- findProt sig g pos ps lname name xs False+          return (p : ps, ks)+        (False, False) ->+          fail (shows pos $ "lemma flag \"" ++ flag ++ "\" unknown. Must be " ++ +                "\"goal\", \"rule\", or \"both\"")   loadSExpr _ _ _ (ps, ks) (L _ (S _ "comment" : _)) = return (ps, ks) loadSExpr _ _ _ (ps, ks) (L _ (S _ "herald" : _)) = return (ps, ks) loadSExpr _ _ _ _ x = fail (shows (annotation x) "Malformed input")@@ -149,8 +164,8 @@       u <- loadBaseTerms sig vars (assoc "uniq-orig" rest)       g <- loadBaseTerms sig vars (assoc "uniq-gen" rest)       b <- mapM (loadAbsent sig vars) (assoc "absent" rest)-      d <- loadBaseTerms sig vars (assoc "conf" rest)-      h <- loadBaseTerms sig vars (assoc "auth" rest)+      d <- loadTerms sig vars (assoc "conf" rest)+      h <- loadTerms sig vars (assoc "auth" rest)       cs <- loadCritSecs (assoc "critical-sections" rest)       let genstates = (assoc "gen-st" rest)       let facts = (assoc "facts" rest)@@ -170,7 +185,7 @@         False -> fail (shows pos "Bad channel in role")         True -> return ()       -- Drop unused variable declarations-      let f v = elem v (varsInTerms ts) || elem v (tchans c)+      let f v = elem v (varsInTerms ts) || elem v (varsInTerms $ tchans c) --elem v (tchans c)       let vs = L.filter f vars       -- Drop rnons that refer to unused variable declarations       let ns = L.filter (varsSeen vs . snd) n@@ -363,15 +378,15 @@  locnsUnique :: Trace -> Bool locnsUnique [] = True-locnsUnique ((In (ChMsg ch _)) : c') =-    if isLocn ch+locnsUnique ((In (ChMsg ct ch _)) : c') =+    if ct == Locn     then         checkLoads c' [ch]     else         locnsUnique c'     where-      checkLoads ((In (ChMsg ch _)) : c') seen =-          if isLocn ch+      checkLoads ((In (ChMsg ct ch _)) : c') seen =+          if ct == Locn           then                not (ch `elem` seen) &&               checkLoads c' (ch : seen)@@ -379,14 +394,14 @@               locnsUnique c'       checkLoads c' _ = locnsUnique c'                         -locnsUnique ((Out (ChMsg ch _)) : c') =-    if isLocn ch+locnsUnique ((Out (ChMsg ct ch _)) : c') =+    if ct == Locn     then         checkStores c' [ch]     else locnsUnique c'     where-      checkStores ((Out (ChMsg ch _)) : c') seen =-          if isLocn ch+      checkStores ((Out (ChMsg ct ch _)) : c') seen =+          if ct == Locn           then                not (ch `elem` seen) &&               checkStores c' (ch : seen)@@ -426,11 +441,11 @@     reverse $ loop [] 0 c     where       loop so_far _ [] = so_far-      loop so_far i ((Out (ChMsg ch _)) : c')-           | isLocn ch              = loop ((i,i) : so_far) (i+1) c'+      loop so_far i ((Out (ChMsg ct _ _)) : c')+           | ct == Locn              = loop ((i,i) : so_far) (i+1) c'            | otherwise              = loop so_far (i+1) c'-      loop so_far i ((In (ChMsg ch _)) : c')-           | isLocn ch              =+      loop so_far i ((In (ChMsg ct ch _)) : c')+           | ct == Locn              =                case subseqSend (i+1) ch c' of                  Just j             -> loop ((i,j) : so_far) (i+1) c'                  Nothing            -> loop so_far (i+1) c'@@ -438,11 +453,11 @@       loop so_far i (_ : c')        = loop so_far (i+1) c'        subseqSend _ _ []             = Nothing-      subseqSend j ch ((In (ChMsg _ _)) : c')+      subseqSend j ch ((In (ChMsg _ _ _)) : c')                                     = subseqSend (j+1) ch c'-      subseqSend j ch ((Out (ChMsg ch' _)) : c')+      subseqSend j ch ((Out (ChMsg ct ch' _)) : c')           | ch == ch'               = Just j-          | isLocn ch'              = subseqSend (j+1) ch c'+          | ct == Locn              = subseqSend (j+1) ch c'           | otherwise               = Nothing       subseqSend _ _ (_ : _)        = Nothing @@ -467,12 +482,12 @@              findSegments soFar _ [] = soFar                                 -      findSegments soFar i (In (ChMsg ch _) : c)-          | isLocn ch           = findLower soFar i (i+1) c          +      findSegments soFar i (In (ChMsg ct _ _) : c)+          | ct == Locn          = findLower soFar i (i+1) c           | otherwise           = findSegments soFar (i+1) c -      findSegments soFar i ((Out (ChMsg ch _)) : c)-          | isLocn ch           = findUpper soFar i (i+1) c           +      findSegments soFar i ((Out (ChMsg ct _ _)) : c)+          | ct == Locn          = findUpper soFar i (i+1) c           | otherwise           = findSegments soFar (i+1) c        findSegments soFar i (_ : c) =@@ -480,8 +495,8 @@        findLower soFar i j [] = (i,j-1) : soFar                                -      findLower soFar i j (In (ChMsg ch _) : c')-          | isLocn ch           = findLower soFar i (j+1) c'+      findLower soFar i j (In (ChMsg ct _ _) : c')+          | ct == Locn           = findLower soFar i (j+1) c'           | otherwise           = findSegments ((i,j-1) : soFar) (j+1) c'                                          findLower soFar i j (In _ : c') = findSegments ((i,j-1) : soFar) (j+1) c'@@ -490,8 +505,8 @@        findUpper soFar i j [] = (i,j-1) : soFar -      findUpper soFar i j (Out (ChMsg ch _) : c')-          | isLocn ch           = findUpper soFar i (j+1) c'+      findUpper soFar i j (Out (ChMsg ct _ _) : c')+          | ct == Locn           = findUpper soFar i (j+1) c'           | otherwise           = findSegments ((i,j-1) : soFar) (j+1) c'                                          findUpper soFar i j (Out _ : c') = findSegments ((i,j-1) : soFar) (j+1) c'@@ -596,7 +611,8 @@ -- Are there any locations used in the role? hasLocn :: Role -> Bool hasLocn rl =-  any isLocn (tchans (rtrace rl))+  any evtIsLoad (rtrace rl)+  --any isLocn (tchans (rtrace rl))  initPreRuleCS :: MonadFail m => Sig -> Gen -> Prot -> Role -> PreRules -> m (Gen, [Rule]) initPreRuleCS sig gen _ rl pr =@@ -696,6 +712,7 @@     -- let (g'', trans) = transRules g' in     let anyState = any (\(rl,_) -> hasLocn rl) prs in     do+      --let (g1, const) = constRule sig g       let (g',neqs) = neqRules sig g       let (g,fixedStateRls) =               if anyState@@ -721,7 +738,8 @@       (g,gsRls) <- iterPreRules initPreRulesGensts sig g prot prs        return (g,-               neqs ++ fixedStateRls ++ fcRls +++               neqs ++ -- const ++ +                    fixedStateRls ++ fcRls ++                     asRls ++ trRls ++ csRls ++ gsRls,                rlRls ++ grRls ++ cqRls) @@ -830,7 +848,7 @@       checkGroupVar (Out _) v = isRndx v       -- See IMPORTANT note above       checkGroupVar (In (Plain _)) v = not (isRndx v) || True-      checkGroupVar (In (ChMsg c _)) v = not (isRndx v) || isLocn c || True+      checkGroupVar (In (ChMsg ct _ _)) v = not (isRndx v) || ct == Locn || True        loop _ [] _ = Nothing       loop gvs (e : evts) i =@@ -891,12 +909,12 @@             ch <- loadChan sig vars ch             t <- loadTerm sig vars -- True                  False t-            loadTraceLoop gen newVars uniqs pr ((In $ ChMsg ch t) : events) rest+            loadTraceLoop gen newVars uniqs pr ((In $ ChMsg Chan ch t) : events) rest       loadTraceLoop gen newVars uniqs pr events ((L _ [S _ "send", ch, t]) : rest) =           do             ch <- loadChan sig vars ch             t <- loadTerm sig vars True t-            loadTraceLoop gen newVars uniqs pr ((Out $ ChMsg ch t) : events) rest+            loadTraceLoop gen newVars uniqs pr ((Out $ ChMsg Chan ch t) : events) rest       loadTraceLoop gen newVars uniqs pr events ((L _ [S pos "load", ch, t]) : rest) =           do             ch <- loadLocn sig vars ch@@ -904,7 +922,7 @@                  False t             (gen, pt, pt_t) <- loadLocnTerm sig gen (S pos "pt") (S pos "pval") t             loadTraceLoop gen (pt : newVars) uniqs pr-                              ((In $ ChMsg ch pt_t) : events) rest+                              ((In $ ChMsg Locn ch pt_t) : events) rest        loadTraceLoop gen newVars uniqs pr events ((L _ [S pos "stor", ch, t]) : rest) =           do@@ -912,7 +930,7 @@             t <- loadTerm sig vars True t             (gen, pt, pt_t) <- loadLocnTerm sig gen (S pos "pt") (S pos "pval") t             loadTraceLoop gen (pt : newVars) (pt : uniqs) pr-                              ((Out $ ChMsg ch pt_t) : events) rest+                              ((Out $ ChMsg Locn ch pt_t) : events) rest        loadTraceLoop gen newVars uniqs pr events ((L _ [S pos "rely", form]) : rest) =           case events of@@ -1173,8 +1191,8 @@       ug <- loadBaseTerms sig vars ug       ab <- mapM (loadAbsent sig vars) ab       pr <- mapM (loadNode heights) pr-      cn <- loadBaseTerms sig vars cn-      au <- loadBaseTerms sig vars au+      cn <- loadTerms sig vars cn+      au <- loadTerms sig vars au       fs <- mapM (loadFact sig heights vars) fs       lds <- loadOrderings heights leads       genSts <- loadTerms sig vars genSts@@ -1314,3 +1332,42 @@     (g, goal, _) <- loadSentence sig RoleSpec pos prot g x     (g, goals) <- loadGoals sig pos prot g xs     return (g, goal : goals)++-- Used for loading lemmas as goals to be checked+findProt :: MonadFail m => Sig -> Gen -> Pos -> [Prot] -> SExpr Pos ->+            SExpr Pos -> [SExpr Pos] -> Bool -> m Prot+findProt sig g pos ps lname (S _ name) xs checked =+  case L.find (\p -> name == pname p) ps of+      Nothing -> fail (shows pos $ "Protocol " ++ name ++ " unknown")+      Just p -> addRule sig g pos p lname xs checked+findProt _ _ pos _ _ _ _ _ = fail (shows pos "Malformed lemma")++-- Boolean adds comment saying the rule is checked+addRule :: MonadFail m => Sig -> Gen -> Pos -> Prot -> SExpr Pos -> [SExpr Pos] -> Bool -> m Prot+addRule sig g pos p lname xs checked =+  do+    (_, r) <- loadRule sig p g pos (lname : xs)+    let r1 = if checked +             then r { rlcomment = S () "(comment Lemma has associated query)" : rlcomment r }+             else r { rlcomment = S () "(comment Lemma not checked)" : rlcomment r }+    let p1 = p { userrules = r1 : userrules p }+    case classifyRule r1 of+           NullaryRule -> return p1 { nullaryrules = r1 : nullaryrules p1}+           UnaryRule   -> return p1 { unaryrules = r1 : unaryrules p1 }+           GeneralRule -> return p1 { generalrules = r1 : generalrules p1 }+    +lemmaCheck :: String -> Bool+lemmaCheck flag =+  do+    case flag of+      "both" -> True+      "goal" -> True+      _ -> False++lemmaUse :: String -> Bool+lemmaUse flag =+  do+    case flag of+      "both" -> True+      "rule" -> True+      _ -> False
src/CPSA/Protocol.hs view
@@ -19,7 +19,7 @@     aFormOrder, aFreeVars, instantiateAForm, instantiateConj, Rule (..),     Prot, mkProt, pname, alg, pgen, psig, roles, checkForDivergenceInStoreSegments,     nullaryrules, unaryrules, generalrules, rules, userrules, generatedrules,-    listenerRole, varsAllAtoms, pcomment) where+    listenerRole, varsAllAtoms, pcomment, RuleKind (..), classifyRule) where  import qualified Data.List as L import qualified Data.Maybe as M@@ -123,11 +123,11 @@   evtIsLoad :: Event -> Bool-evtIsLoad (In (ChMsg ch _))  = isLocn ch+evtIsLoad (In (ChMsg Locn _ _))  = True -- isLocn ch evtIsLoad _ = False  evtIsStor :: Event -> Bool-evtIsStor (Out (ChMsg ch _))  = isLocn ch+evtIsStor (Out (ChMsg Locn _ _))  = True -- isLocn ch evtIsStor _ = False                evtIsState :: Event -> Bool@@ -480,39 +480,39 @@                | FullStore  divergeAgreeStore :: Event -> AgreeData-divergeAgreeStore (Out (ChMsg ch2 _))-    | isLocn ch2 = FullStore+divergeAgreeStore (Out (ChMsg ct _ _))+    | ct == Locn = FullStore     | otherwise = HalfStore  divergeAgreeStore _ = HalfStore  divergeAgreeOutChan :: Event -> AgreeData-divergeAgreeOutChan (Out (ChMsg ch2 _))-    | isLocn ch2 = HalfStore+divergeAgreeOutChan (Out (ChMsg ct _ _))+    | ct == Locn = HalfStore     | otherwise = NonStore  divergeAgreeOutChan _ = Disagree  divergeAgreeOutPlain :: Event -> AgreeData-divergeAgreeOutPlain (Out (ChMsg ch2 _))-    | isLocn ch2 = HalfStore+divergeAgreeOutPlain (Out (ChMsg ct _ _))+    | ct == Locn = HalfStore     | otherwise = Disagree  divergeAgreeOutPlain (Out (Plain _)) = NonStore divergeAgreeOutPlain _               = Disagree  divergeAgreeInChan :: Event -> AgreeData-divergeAgreeInChan (Out (ChMsg ch2 _))-    | isLocn ch2 = HalfStore+divergeAgreeInChan (Out (ChMsg ct _ _))+    | ct == Locn = HalfStore     | otherwise = Disagree  divergeAgreeInChan (Out (Plain _)) = Disagree-divergeAgreeInChan (In (ChMsg _ _)) = NonStore+divergeAgreeInChan (In (ChMsg _ _ _)) = NonStore divergeAgreeInChan _ = Disagree  divergeAgreeInPlain :: Event -> AgreeData-divergeAgreeInPlain (Out (ChMsg ch2 _))-    | isLocn ch2 = HalfStore+divergeAgreeInPlain (Out (ChMsg ct _ _))+    | ct == Locn = HalfStore     | otherwise = Disagree                    divergeAgreeInPlain (In (Plain _)) = NonStore@@ -521,12 +521,12 @@ --   divergeEventsAgree :: Event -> Event -> AgreeData-divergeEventsAgree (Out (ChMsg ch1 _))-    | isLocn ch1  = divergeAgreeStore+divergeEventsAgree (Out (ChMsg ct _ _))+    | ct == Locn  = divergeAgreeStore     | otherwise = divergeAgreeOutChan  divergeEventsAgree (Out _)              = divergeAgreeOutPlain-divergeEventsAgree (In (ChMsg _ _))     = divergeAgreeInChan+divergeEventsAgree (In (ChMsg _ _ _))   = divergeAgreeInChan divergeEventsAgree (In _)               = divergeAgreeInPlain  -- By a varTrail, we mean a list of terms without repetitions
src/CPSA/Signature.hs view
@@ -49,7 +49,7 @@ -- specially.  The same is true for "mesg". defaultSig :: Sig defaultSig = Sig {-  atoms = ["text", "data", "skey", "akey"],+  atoms = ["text", "data", "skey", "akey", "dev"],   akeys = ["akey"],   opers = [Enc("enc"), Hash("hash")]   }
src/CPSA/Strand.hs view
@@ -317,7 +317,7 @@           cm <- inbnd (trace inst !! 0) -- Get first term in trace           case cm of             Plain t -> Just t-            ChMsg _ _ -> Nothing+            ChMsg _ _ _ -> Nothing       _ -> Nothing              -- Not a listener strand  -- Graphs@@ -905,7 +905,7 @@       uniqgenCheck t = any (constituentModInv t) terms       absentCheck (x, y) = varSubset [x, y] vs && x /= y       genStCheck t = foldVars f True t-      chanCheck c = elem c vs+      chanCheck c = all ((flip elem) vs) (addVars [] c) --elem c vs --  -- Do notation friendly preskeleton well formed check. wellFormedPreskel :: MonadFail m => Preskel -> m Preskel@@ -960,13 +960,13 @@           failwith (showString "gen-st " $ showst t " not carried")                        $ any (carriedBy t) terms       confCheck c =-        failwith (showString "confidential channel "+        failwith (showString "some variable in confidential channel "                   $ showst c " not in some strand")-                 $ elem c (kvars k)+                 $ all ((flip elem) (kvars k)) (addVars [] c)--all ((flip elem) (kvars k)) (termVars c)--elem c (kvars k)       authCheck c =-        failwith (showString "authenticated channel "+        failwith (showString "some variable in authenticated channel "                   $ showst c " not in some strand")-                 $ elem c (kvars k)+                 $ all ((flip elem) (kvars k)) (addVars [] c)--elem c (kvars k)  failwith :: MonadFail m => String -> Bool -> m () failwith msg test =@@ -1091,21 +1091,16 @@  -- Channel functions confCm :: Preskel -> ChMsg -> Bool-confCm k e =-  case cmChan e of-    Just ch -> elem ch (kconf k) || isLocn ch-    Nothing -> False+confCm k (ChMsg ct ch _) =+  elem ch (kconf k) || ct == Locn+confCm _ (Plain _) = False  authCm :: Preskel -> ChMsg -> Bool-authCm k e =-  case cmChan e of-    Just ch -> elem ch (kauth k) ||-               (isLocn ch &&-                (let t = (cmTerm e) in-                 elem t (kgenSt k) ||-                 (isLocnMsg t &&-                  elem (locnMsgPayload t) (kgenSt k))))-    Nothing -> False+authCm k (ChMsg ct ch t) =+  elem ch (kauth k) ||+          (ct == Locn && (elem t (kgenSt k) ||+            isLocnMsg t && elem (locnMsgPayload t) (kgenSt k)))+authCm _ (Plain _) = False  -- Isomorphism Check @@ -2449,6 +2444,8 @@           all (flip elem (kunique k')) (map (instantiate env) (kunique k)) &&           all (flip elem (kuniqgen k')) (map (instantiate env) (kuniqgen k)) &&           all (flip elem (kabsent k')) (map (instantiatePair env) (kabsent k)) &&+          all (flip elem (kauth k')) (map (instantiate env) (kauth k)) &&+          all (flip elem (kconf k')) (map (instantiate env) (kconf k)) &&           -- all (flip elem (kprecur k')) (map (permuteNode mapping) (kprecur k)) &&           all (flip elem (kgenSt k')) (map (instantiate env) (kgenSt k)) &&           validateEnvOrig k k' mapping env &&@@ -3009,8 +3006,8 @@ -- For each variable, generate candidates by generating a fresh -- variable for subsets of the locations associated with the variable. separateVariable :: Preskel -> [(Term, Location)] -> Term -> [Candidate]-separateVariable _ _ t | isChan t = [] -- Ignore channels-separateVariable _ _ t | isLocn t = [] -- Ignore locations+separateVariable _ _ t | isChanSort t = [] -- Ignore channels+separateVariable _ _ t | isLocnSort t = [] -- Ignore locations -- Ignore group elements because of bugs in the algebra module separateVariable _ _ t | isExpr t = [] separateVariable k ps t =@@ -3630,7 +3627,7 @@  isStateChMsg :: ChMsg -> Bool isStateChMsg (Plain _) = False-isStateChMsg (ChMsg c _) = isLocn c+isStateChMsg (ChMsg ct _ _) = ct == Locn  nodeIsStateNode :: Preskel -> Node -> Bool nodeIsStateNode k p =@@ -3678,12 +3675,12 @@                  case m == m' of                    True -> [e]                    False -> nullSem k e-             ChMsg _ _ -> nullSem k e)-      ChMsg c m ->+             ChMsg _ _ _ -> nullSem k e)+      ChMsg ct c m ->           (case chmsg' of              Plain _ -> nullSem k e-             ChMsg c' m' ->-                 case c == c' && m == m' of+             ChMsg ct' c' m' ->+                 case ct == ct' && c == c' && m == m' of                    True -> [e]                    False -> nullSem k e) @@ -3741,9 +3738,8 @@     case dirChMsgOfNode (s,i) k of       Nothing -> []       Just (_, Plain _) -> []-      Just (_, ChMsg c _)-        | isLocn c -> [c]-        | otherwise -> []+      Just (_, ChMsg Chan _ _) -> []+      Just (_, ChMsg Locn c _) -> [c]  glocnSem :: NodeTerm -> Preskel -> (Gen,Env) -> [(Term,(Gen,Env))] glocnSem n k (g, e) =@@ -4360,10 +4356,11 @@                          Just (Send, _) -> None                          Just (Recv, chmsg') ->                              (case (chmsg, chmsg') of-                                (Plain _, ChMsg _ _) -> None-                                (ChMsg _ _, Plain _) -> None+                                (Plain _, ChMsg _ _ _) -> None+                                (ChMsg _ _ _, Plain _) -> None                                 (Plain m, Plain m')  -> ureq rule m m' k (g, e)-                                (ChMsg c m, ChMsg c' m') ->+                                (ChMsg ct c m, ChMsg ct' c' m') ->+                                    if ct /= ct' then None else                                     case ureq rule c c' k (g, e) of                                       None -> None                                       Failing st -> Failing st@@ -5086,10 +5083,11 @@                          Just (Send, _) -> []                          Just (Recv, chmsg') ->                              (case (chmsg, chmsg') of-                                (Plain _, ChMsg _ _) -> []-                                (ChMsg _ _, Plain _) -> []+                                (Plain _, ChMsg _ _ _) -> []+                                (ChMsg _ _ _, Plain _) -> []                                 (Plain m, Plain m')  -> req name m m' k (g, e)-                                (ChMsg c m, ChMsg c' m') ->+                                (ChMsg ct c m, ChMsg ct' c' m') ->+                                    if ct /= ct' then [] else                                     do                                       (k, (g,e)) <- req name c c' k (g, e)                                       (k, (g,e)) <- req name m m' k (g, e)
tst/DH_hack.tst view
@@ -1,6 +1,6 @@ (herald "DH Hack" (bound 15)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/DH_hack.scm") (comment "Strand count bounded at 15") 
tst/Makefile view
@@ -9,5 +9,8 @@ 	$(SRCS:%.prot=%_shapes.xhtml) $(SRCS:%.prot=%.xhtml) \ 	$(SRCS:%.lsp=%_shapes.xhtml) $(SRCS:%.lsp=%.xhtml) +trim:+	-rm *.xhtml *_shapes* *_sas*+ clean:-	-rm *.txt *.xhtml+	-rm *.txt *.xhtml *_shapes* *_sas*
tst/ab.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/ab.scm")  (defprotocol ab basic
tst/abc.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/abc.scm")  (defprotocol abc basic
tst/aik.tst view
@@ -1,6 +1,6 @@ (herald "Anonymous identity protocol from TCG") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/aik.scm")  (defprotocol aikprot basic
tst/atomic-open-closed.tst view
@@ -1,6 +1,6 @@ (herald atomic-open-closed (bound 44)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/atomic-open-closed.scm") (comment "Strand count bounded at 44") 
tst/attest.tst view
@@ -1,6 +1,6 @@ (herald attest-door) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/attest.scm")  (defprotocol attest-door basic
tst/auth-enc.tst view
@@ -1,6 +1,6 @@ (herald auth-enc) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/auth-enc.scm")  (defprotocol auth-enc basic
tst/auth-hash.tst view
@@ -1,6 +1,6 @@ (herald auth-hash) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/auth-hash.scm")  (defprotocol auth-hash basic
tst/blanchet-strandmax.tst view
@@ -1,7 +1,7 @@ (herald "Blanchet's Simple Example Protocol (strand max)"   (comment "There is a flaw in this protocol by design")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/blanchet-strandmax.scm")  (defprotocol blanchet-max basic
tst/blanchet.tst view
@@ -1,7 +1,7 @@ (herald "Blanchet's Simple Example Protocol"   (comment "There is a flaw in this protocol by design")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/blanchet.scm")  (defprotocol blanchet basic
tst/blanchet_doorsep.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read")  (defprotocol blanchet basic
tst/bug_example.tst view
@@ -1,6 +1,6 @@ (herald bug_example (bound 20)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/bug_example.scm") (comment "Strand count bounded at 20") 
tst/cert_lang.tst view
@@ -1,6 +1,6 @@ (herald cert-lang) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/cert_lang.scm")  (defprotocol cert-uni basic
tst/chan-envelope.tst view
@@ -1,6 +1,6 @@ (herald "Envelope Protocol With Channels" (bound 15)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/chan-envelope.scm") (comment "Strand count bounded at 15") 
+ tst/chan-mesg.scm view
@@ -0,0 +1,114 @@+(herald "Yahalom Protocol Without Forwarding" (bound 15)+	(comment "Testing channels as arbitrary messages."))++(defprotocol yahalom basic+  (defrole init+    (vars (a b c name) (n-a n-b text) (k skey))+    (trace (send (cat a n-a))+	   (recv (cat c a) (cat a b k n-a n-b))+	   (send (enc n-b k))))+  (defrole resp+    (vars (b a c name) (n-a n-b text) (k skey) (ch1 ch2 chan))+    (trace (recv (cat a n-a))+	   (send (cat b c) (cat a b n-a n-b))+	   (recv (cat c b) (cat a b k))+	   (recv (enc n-b k))))+  (defrole serv+    (vars (c a b name) (n-a n-b text) (k skey) (ch1 ch2 ch3 chan))+    (trace (recv (cat b c) (cat a b n-a n-b))+	   (send (cat c a) (cat a b k n-a n-b))+	   (send (cat c b) (cat a b k)))+    (uniq-orig k))+  (comment "Use (cat x y) as channel from x to y. Matching channel should force matching names."))++;;; How much do we know assuming that the resp had a run with an+;;; authenticated channel ch2?  We also assume the responder's nonce+;;; is freshly chosen.++(defskeleton yahalom+  (vars (a b c name) (n-b text))+  (defstrand resp 4 (a a) (b b) (c c) (n-b n-b))+  (auth (cat c b))+  (uniq-orig n-b))++;;; This is the answer to the previous question, to which we have+;;; added the assumptions ...++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (precedes ((1 2) (0 2)))+  (uniq-orig k n-b)+  (auth (cat c b))+  (conf (cat c b) (cat c a)))+++;;; This is the ...+(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (uniq-orig k n-b)+  (auth (cat c b) (cat b c))+  (conf (cat c b) (cat c a)))++;;; In particular, we can now check that the session key cannot be+;;; compromised, subject to the assumptions we have imposed, using+;;; (deflistener k).++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (deflistener k)+  (uniq-orig k n-b)+  (auth (cat c b) (cat b c))+  (conf (cat c b) (cat c a)))++;;; Let's turn now to the initiator's point of view:++(defskeleton yahalom+  (vars (a b c name) (n-a text) (k skey))+  (defstrand init 3 (n-a n-a) (c c) (a a))+  (uniq-orig n-a)+  (auth (cat c a)))++;;; The initiator infers the presence of the server.  We can now add+;;; the assumptions that the server's channels+;;; have the same trust properties as before, ie ch1 is auth and ch is+;;; conf, in addition to the auth previously assumed:+(defskeleton yahalom+  (vars (k skey) (n-a n-b text) (a c b c-0 name))+  (defstrand init 3 (k k) (n-a n-a) (n-b n-b) (a a) (b b) (c c))+  (defstrand serv 2 (k k) (n-a n-a) (n-b n-b) (c c-0) (a a) (b b))+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))+  (uniq-orig k n-a)+  (auth (cat c a) (cat b c-0))+  (conf (cat c-0 a)))++;;; This now authenticates the presence of the responder for the first+;;; two nodes, and its agreement on all of the values present there.++;;; Finally, let us consider the server's point of view, with an+;;; authenticated channel for the request, and confidential channels+;;; over which to transmit the session key.++(defskeleton yahalom+  (vars (c a b name) (n-a n-b text) (k skey))+  (defstrand serv 3 (a a) (b b) (c c))+  (auth (cat b c))+  (conf (cat c b) (cat c a)))++;;; This query confirms that the server has authenticated the first+;;; two nodes of the responder, but has not authenticated the+;;; initiator at all.++;;; However, the session key is safe:++(defskeleton yahalom+  (vars (c a b name) (n-a n-b text) (k skey))+  (defstrand serv 3 (k k) (a a) (b b) (c c))+  (deflistener k)+  (auth (cat b c))+  (conf (cat c b) (cat c a)))
+ tst/chan-mesg.tst view
@@ -0,0 +1,1185 @@+(herald "Yahalom Protocol Without Forwarding" (bound 15)+  (comment "Testing channels as arbitrary messages."))++(comment "CPSA 4.4.9")+(comment "All input read from tst/chan-mesg.scm")+(comment "Strand count bounded at 15")++(defprotocol yahalom basic+  (defrole init+    (vars (a b c name) (n-a n-b text) (k skey))+    (trace (send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k))))+  (defrole resp+    (vars (b a c name) (n-a n-b text) (k skey))+    (trace (recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k))))+  (defrole serv+    (vars (c a b name) (n-a n-b text) (k skey))+    (trace (recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    (uniq-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (comment+    "Use (cat x y) as channel from x to y. Matching channel should force matching names."))++(defskeleton yahalom+  (vars (k skey) (n-b n-a text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (uniq-orig n-b)+  (auth (cat c b))+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k))))+  (label 0)+  (unrealized (0 2))+  (maps ((0) ((a a) (b b) (c c) (n-b n-b) (n-a n-a) (k k))))+  (origs (n-b (0 1)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (precedes ((1 2) (0 2)))+  (uniq-orig k n-b)+  (auth (cat c b))+  (operation channel-test (added-strand serv 3)+    (ch-msg (cat c b) (cat a b k)) (0 2))+  (strand-map 0)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k))))+  (label 1)+  (parent 0)+  (realized)+  (shape)+  (maps ((0) ((a a) (b b) (c c) (n-b n-b) (n-a n-a) (k k))))+  (origs (k (1 1)) (n-b (0 1))))++(comment "Nothing left to do")++(defprotocol yahalom basic+  (defrole init+    (vars (a b c name) (n-a n-b text) (k skey))+    (trace (send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k))))+  (defrole resp+    (vars (b a c name) (n-a n-b text) (k skey))+    (trace (recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k))))+  (defrole serv+    (vars (c a b name) (n-a n-b text) (k skey))+    (trace (recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    (uniq-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (comment+    "Use (cat x y) as channel from x to y. Matching channel should force matching names."))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (precedes ((1 2) (0 2)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat c b))+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k))))+  (label 2)+  (unrealized (0 3))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (origs (k (1 1)) (n-b (0 1)))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 n-a-1 text)+    (a b c a-0 b-0 c-0 name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (defstrand init 3 (k k) (n-a n-a-1) (n-b n-b) (a a-0) (b b-0) (c c-0))+  (precedes ((0 1) (2 1)) ((1 1) (2 1)) ((1 2) (0 2)) ((2 2) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat c b))+  (operation encryption-test (added-strand init 3) (enc n-b k) (0 3))+  (strand-map 0 1)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k)))+    ((send (cat a-0 n-a-1))+      (recv (cat c-0 a-0) (cat a-0 b-0 k n-a-1 n-b))+      (send (enc n-b k))))+  (label 3)+  (parent 2)+  (unrealized (2 1))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (deflistener k)+  (precedes ((1 1) (2 0)) ((1 2) (0 2)) ((2 1) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat c b))+  (operation encryption-test (added-listener k) (enc n-b k) (0 3))+  (strand-map 0 1)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k))) ((recv k) (send k)))+  (label 4)+  (parent 2)+  (unrealized (2 0))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-a n-a-0 n-b text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b) (c c) (a a) (b b))+  (defstrand init 3 (k k) (n-a n-a-0) (n-b n-b) (a a) (b b) (c c))+  (precedes ((0 1) (1 0)) ((1 1) (2 1)) ((1 2) (0 2)) ((2 2) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat c b))+  (operation nonce-test+    (contracted (n-b-0 n-b) (a-0 a) (b-0 b) (c-0 c) (n-a-1 n-a-0)) k+    (2 1) (ch-msg (cat c a) (cat a b k n-a-0 n-b)))+  (strand-map 0 1 2)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b))+      (send (cat c a) (cat a b k n-a-0 n-b))+      (send (cat c b) (cat a b k)))+    ((send (cat a n-a-0)) (recv (cat c a) (cat a b k n-a-0 n-b))+      (send (enc n-b k))))+  (label 5)+  (parent 3)+  (realized)+  (shape)+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b) (a a) (b b)+        (c c))))+  (origs (k (1 1)) (n-b (0 1))))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 n-a-1 text)+    (a b c a-0 b-0 c-0 name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (defstrand init 3 (k k) (n-a n-a-1) (n-b n-b) (a a-0) (b b-0) (c c-0))+  (precedes ((0 1) (2 1)) ((1 2) (0 2)) ((1 2) (2 1)) ((2 2) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat c b))+  (operation nonce-test (displaced 3 1 serv 3) k (2 1)+    (ch-msg (cat c a) (cat a b k n-a-0 n-b-0)))+  (strand-map 0 1 2)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k)))+    ((send (cat a-0 n-a-1))+      (recv (cat c-0 a-0) (cat a-0 b-0 k n-a-1 n-b))+      (send (enc n-b k))))+  (label 6)+  (parent 3)+  (unrealized (2 1))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (deflistener k)+  (precedes ((1 2) (0 2)) ((1 2) (2 0)) ((2 1) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat c b))+  (operation nonce-test (displaced 3 1 serv 3) k (2 0)+    (ch-msg (cat c a) (cat a b k n-a-0 n-b-0)))+  (strand-map 0 1 2)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k))) ((recv k) (send k)))+  (label 7)+  (parent 4)+  (unrealized (2 0))+  (dead)+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (comment "empty cohort"))++(defskeleton yahalom+  (vars (k skey) (n-a n-a-0 n-b text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b) (c c) (a a) (b b))+  (defstrand init 3 (k k) (n-a n-a-0) (n-b n-b) (a a) (b b) (c c))+  (precedes ((0 1) (1 0)) ((1 2) (0 2)) ((1 2) (2 1)) ((2 2) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat c b))+  (operation nonce-test+    (contracted (n-b-0 n-b) (a-0 a) (b-0 b) (c-0 c) (n-a-1 n-a-0)) k+    (2 1) (ch-msg (cat c a) (cat a b k n-a-0 n-b))+    (ch-msg (cat c b) (cat a b k)))+  (strand-map 0 1 2)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b))+      (send (cat c a) (cat a b k n-a-0 n-b))+      (send (cat c b) (cat a b k)))+    ((send (cat a n-a-0)) (recv (cat c a) (cat a b k n-a-0 n-b))+      (send (enc n-b k))))+  (label 8)+  (parent 6)+  (seen 5)+  (seen-ops+    (5 (operation generalization weakened ((1 2) (2 1)))+      (strand-map 0 1 2)))+  (realized)+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b) (a a) (b b)+        (c c))))+  (comment "1 in cohort - 0 not yet seen"))++(comment "Nothing left to do")++(defprotocol yahalom basic+  (defrole init+    (vars (a b c name) (n-a n-b text) (k skey))+    (trace (send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k))))+  (defrole resp+    (vars (b a c name) (n-a n-b text) (k skey))+    (trace (recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k))))+  (defrole serv+    (vars (c a b name) (n-a n-b text) (k skey))+    (trace (recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    (uniq-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (comment+    "Use (cat x y) as channel from x to y. Matching channel should force matching names."))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k))))+  (label 9)+  (unrealized (0 2) (0 3) (1 0))+  (preskeleton)+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (origs (k (1 1)) (n-b (0 1)))+  (comment "Not a skeleton"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (precedes ((1 1) (0 2)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k))))+  (label 10)+  (parent 9)+  (unrealized (0 2) (0 3) (1 0))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (origs (k (1 1)) (n-b (0 1)))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (precedes ((0 1) (1 0)) ((1 1) (0 2)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation channel-test (displaced 2 0 resp 2)+    (ch-msg (cat b c) (cat a b n-a-0 n-b-0)) (1 0))+  (strand-map 0 1)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b))+      (send (cat c b) (cat a b k))))+  (label 11)+  (parent 10)+  (unrealized (0 2) (0 3))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a) (n-b-0 n-b) (a a) (b b)+        (c c))))+  (origs (k (1 1)) (n-b (0 1)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (defstrand resp 2 (n-a n-a-0) (n-b n-b-0) (b b) (a a) (c c))+  (precedes ((1 1) (0 2)) ((2 1) (1 0)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation channel-test (added-strand resp 2)+    (ch-msg (cat b c) (cat a b n-a-0 n-b-0)) (1 0))+  (strand-map 0 1)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k)))+    ((recv (cat a n-a-0)) (send (cat b c) (cat a b n-a-0 n-b-0))))+  (label 12)+  (parent 10)+  (unrealized (0 2) (0 3))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (precedes ((0 1) (1 0)) ((1 2) (0 2)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation channel-test (displaced 2 1 serv 3)+    (ch-msg (cat c b) (cat a b k)) (0 2))+  (strand-map 0 1)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b))+      (send (cat c b) (cat a b k))))+  (label 13)+  (parent 11)+  (unrealized (0 3))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a) (n-b-0 n-b) (a a) (b b)+        (c c))))+  (origs (k (1 1)) (n-b (0 1)))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (defstrand resp 2 (n-a n-a-0) (n-b n-b-0) (b b) (a a) (c c))+  (precedes ((1 2) (0 2)) ((2 1) (1 0)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation channel-test (displaced 3 1 serv 3)+    (ch-msg (cat c b) (cat a b k)) (0 2))+  (strand-map 0 1 2)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k)))+    ((recv (cat a n-a-0)) (send (cat b c) (cat a b n-a-0 n-b-0))))+  (label 14)+  (parent 12)+  (unrealized (0 3))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 text) (a b c a-0 b-0 c-0 name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (defstrand init 3 (k k) (n-a n-a-0) (n-b n-b) (a a-0) (b b-0) (c c-0))+  (precedes ((0 1) (1 0)) ((1 1) (2 1)) ((1 2) (0 2)) ((2 2) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation encryption-test (added-strand init 3) (enc n-b k) (0 3))+  (strand-map 0 1)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    ((send (cat a-0 n-a-0))+      (recv (cat c-0 a-0) (cat a-0 b-0 k n-a-0 n-b))+      (send (enc n-b k))))+  (label 15)+  (parent 13)+  (unrealized (2 1))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a) (n-b-0 n-b) (a a) (b b)+        (c c))))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (deflistener k)+  (precedes ((0 1) (1 0)) ((1 1) (2 0)) ((1 2) (0 2)) ((2 1) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation encryption-test (added-listener k) (enc n-b k) (0 3))+  (strand-map 0 1)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    ((recv k) (send k)))+  (label 16)+  (parent 13)+  (unrealized (2 0))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a) (n-b-0 n-b) (a a) (b b)+        (c c))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 n-a-1 text)+    (a b c a-0 b-0 c-0 name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (defstrand resp 2 (n-a n-a-0) (n-b n-b-0) (b b) (a a) (c c))+  (defstrand init 3 (k k) (n-a n-a-1) (n-b n-b) (a a-0) (b b-0) (c c-0))+  (precedes ((0 1) (3 1)) ((1 1) (3 1)) ((1 2) (0 2)) ((2 1) (1 0))+    ((3 2) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation encryption-test (added-strand init 3) (enc n-b k) (0 3))+  (strand-map 0 1 2)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k)))+    ((recv (cat a n-a-0)) (send (cat b c) (cat a b n-a-0 n-b-0)))+    ((send (cat a-0 n-a-1))+      (recv (cat c-0 a-0) (cat a-0 b-0 k n-a-1 n-b))+      (send (enc n-b k))))+  (label 17)+  (parent 14)+  (unrealized (3 1))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (defstrand resp 2 (n-a n-a-0) (n-b n-b-0) (b b) (a a) (c c))+  (deflistener k)+  (precedes ((1 1) (3 0)) ((1 2) (0 2)) ((2 1) (1 0)) ((3 1) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation encryption-test (added-listener k) (enc n-b k) (0 3))+  (strand-map 0 1 2)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k)))+    ((recv (cat a n-a-0)) (send (cat b c) (cat a b n-a-0 n-b-0)))+    ((recv k) (send k)))+  (label 18)+  (parent 14)+  (unrealized (3 0))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (defstrand init 3 (k k) (n-a n-a) (n-b n-b) (a a) (b b) (c c))+  (precedes ((0 1) (1 0)) ((1 1) (2 1)) ((1 2) (0 2)) ((2 2) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation nonce-test (contracted (a-0 a) (b-0 b) (c-0 c) (n-a-0 n-a))+    k (2 1) (ch-msg (cat c a) (cat a b k n-a n-b)))+  (strand-map 0 1 2)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    ((send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k))))+  (label 19)+  (parent 15)+  (realized)+  (shape)+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a) (n-b-0 n-b) (a a) (b b)+        (c c))))+  (origs (k (1 1)) (n-b (0 1))))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 text) (a b c a-0 b-0 c-0 name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (defstrand init 3 (k k) (n-a n-a-0) (n-b n-b) (a a-0) (b b-0) (c c-0))+  (precedes ((0 1) (1 0)) ((1 2) (0 2)) ((1 2) (2 1)) ((2 2) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation nonce-test (displaced 3 1 serv 3) k (2 1)+    (ch-msg (cat c a) (cat a b k n-a n-b)))+  (strand-map 0 1 2)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    ((send (cat a-0 n-a-0))+      (recv (cat c-0 a-0) (cat a-0 b-0 k n-a-0 n-b))+      (send (enc n-b k))))+  (label 20)+  (parent 15)+  (unrealized (2 1))+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a) (n-b-0 n-b) (a a) (b b)+        (c c))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (deflistener k)+  (precedes ((0 1) (1 0)) ((1 2) (0 2)) ((1 2) (2 0)) ((2 1) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation nonce-test (displaced 3 1 serv 3) k (2 0)+    (ch-msg (cat c a) (cat a b k n-a n-b)))+  (strand-map 0 1 2)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    ((recv k) (send k)))+  (label 21)+  (parent 16)+  (unrealized (2 0))+  (dead)+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a) (n-b-0 n-b) (a a) (b b)+        (c c))))+  (comment "empty cohort"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 n-a-1 text)+    (a b c a-0 b-0 c-0 name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (defstrand resp 2 (n-a n-a-0) (n-b n-b-0) (b b) (a a) (c c))+  (defstrand init 3 (k k) (n-a n-a-1) (n-b n-b) (a a-0) (b b-0) (c c-0))+  (precedes ((0 1) (3 1)) ((1 2) (0 2)) ((1 2) (3 1)) ((2 1) (1 0))+    ((3 2) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation nonce-test (displaced 4 1 serv 3) k (3 1)+    (ch-msg (cat c a) (cat a b k n-a-0 n-b-0)))+  (strand-map 0 1 2 3)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k)))+    ((recv (cat a n-a-0)) (send (cat b c) (cat a b n-a-0 n-b-0)))+    ((send (cat a-0 n-a-1))+      (recv (cat c-0 a-0) (cat a-0 b-0 k n-a-1 n-b))+      (send (enc n-b k))))+  (label 22)+  (parent 17)+  (unrealized (3 1))+  (dead)+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (comment "empty cohort"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (defstrand resp 2 (n-a n-a-0) (n-b n-b-0) (b b) (a a) (c c))+  (deflistener k)+  (precedes ((1 2) (0 2)) ((1 2) (3 0)) ((2 1) (1 0)) ((3 1) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation nonce-test (displaced 4 1 serv 3) k (3 0)+    (ch-msg (cat c a) (cat a b k n-a-0 n-b-0)))+  (strand-map 0 1 2 3)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k)))+    ((recv (cat a n-a-0)) (send (cat b c) (cat a b n-a-0 n-b-0)))+    ((recv k) (send k)))+  (label 23)+  (parent 18)+  (unrealized (3 0))+  (dead)+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (comment "empty cohort"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (defstrand init 3 (k k) (n-a n-a) (n-b n-b) (a a) (b b) (c c))+  (precedes ((0 1) (1 0)) ((1 2) (0 2)) ((1 2) (2 1)) ((2 2) (0 3)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation nonce-test (contracted (a-0 a) (b-0 b) (c-0 c) (n-a-0 n-a))+    k (2 1) (ch-msg (cat c a) (cat a b k n-a n-b))+    (ch-msg (cat c b) (cat a b k)))+  (strand-map 0 1 2)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    ((send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k))))+  (label 24)+  (parent 20)+  (seen 19)+  (seen-ops+    (19 (operation generalization weakened ((1 2) (2 1)))+      (strand-map 0 1 2)))+  (realized)+  (maps+    ((0 1)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a) (n-b-0 n-b) (a a) (b b)+        (c c))))+  (comment "1 in cohort - 0 not yet seen"))++(comment "Nothing left to do")++(defprotocol yahalom basic+  (defrole init+    (vars (a b c name) (n-a n-b text) (k skey))+    (trace (send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k))))+  (defrole resp+    (vars (b a c name) (n-a n-b text) (k skey))+    (trace (recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k))))+  (defrole serv+    (vars (c a b name) (n-a n-b text) (k skey))+    (trace (recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    (uniq-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (comment+    "Use (cat x y) as channel from x to y. Matching channel should force matching names."))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (deflistener k)+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k))) ((recv k) (send k)))+  (label 25)+  (unrealized (0 2) (0 3) (1 0) (2 0))+  (preskeleton)+  (maps+    ((0 1 2)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (origs (k (1 1)) (n-b (0 1)))+  (comment "Not a skeleton"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (deflistener k)+  (precedes ((1 1) (0 2)) ((1 1) (2 0)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k))) ((recv k) (send k)))+  (label 26)+  (parent 25)+  (unrealized (0 2) (0 3) (1 0) (2 0))+  (maps+    ((0 1 2)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (origs (k (1 1)) (n-b (0 1)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-b n-a n-a-0 n-b-0 text) (a b c name))+  (defstrand resp 4 (k k) (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (defstrand serv 3 (k k) (n-a n-a-0) (n-b n-b-0) (c c) (a a) (b b))+  (deflistener k)+  (precedes ((1 1) (0 2)) ((1 2) (2 0)))+  (uniq-orig k n-b)+  (conf (cat c a) (cat c b))+  (auth (cat b c) (cat c b))+  (operation nonce-test (displaced 3 1 serv 3) k (2 0)+    (ch-msg (cat c a) (cat a b k n-a-0 n-b-0)))+  (strand-map 0 1 2)+  (traces+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k)))+    ((recv (cat b c) (cat a b n-a-0 n-b-0))+      (send (cat c a) (cat a b k n-a-0 n-b-0))+      (send (cat c b) (cat a b k))) ((recv k) (send k)))+  (label 27)+  (parent 26)+  (unrealized (0 2) (0 3) (1 0) (2 0))+  (dead)+  (maps+    ((0 1 2)+      ((k k) (n-b n-b) (n-a n-a) (n-a-0 n-a-0) (n-b-0 n-b-0) (a a) (b b)+        (c c))))+  (origs (k (1 1)) (n-b (0 1)))+  (comment "empty cohort"))++(comment "Nothing left to do")++(defprotocol yahalom basic+  (defrole init+    (vars (a b c name) (n-a n-b text) (k skey))+    (trace (send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k))))+  (defrole resp+    (vars (b a c name) (n-a n-b text) (k skey))+    (trace (recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k))))+  (defrole serv+    (vars (c a b name) (n-a n-b text) (k skey))+    (trace (recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    (uniq-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (comment+    "Use (cat x y) as channel from x to y. Matching channel should force matching names."))++(defskeleton yahalom+  (vars (k skey) (n-a n-b text) (a c b name))+  (defstrand init 3 (k k) (n-a n-a) (n-b n-b) (a a) (b b) (c c))+  (uniq-orig n-a)+  (auth (cat c a))+  (traces+    ((send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k))))+  (label 28)+  (unrealized (0 1))+  (maps ((0) ((a a) (c c) (n-a n-a) (b b) (n-b n-b) (k k))))+  (origs (n-a (0 0)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-a n-b text) (a c b name))+  (defstrand init 3 (k k) (n-a n-a) (n-b n-b) (a a) (b b) (c c))+  (defstrand serv 2 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))+  (uniq-orig k n-a)+  (auth (cat c a))+  (operation channel-test (added-strand serv 2)+    (ch-msg (cat c a) (cat a b k n-a n-b)) (0 1))+  (strand-map 0)+  (traces+    ((send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k)))+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b))))+  (label 29)+  (parent 28)+  (realized)+  (shape)+  (maps ((0) ((a a) (c c) (n-a n-a) (b b) (n-b n-b) (k k))))+  (origs (k (1 1)) (n-a (0 0))))++(comment "Nothing left to do")++(defprotocol yahalom basic+  (defrole init+    (vars (a b c name) (n-a n-b text) (k skey))+    (trace (send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k))))+  (defrole resp+    (vars (b a c name) (n-a n-b text) (k skey))+    (trace (recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k))))+  (defrole serv+    (vars (c a b name) (n-a n-b text) (k skey))+    (trace (recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    (uniq-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (comment+    "Use (cat x y) as channel from x to y. Matching channel should force matching names."))++(defskeleton yahalom+  (vars (k skey) (n-a n-b text) (a c b c-0 name))+  (defstrand init 3 (k k) (n-a n-a) (n-b n-b) (a a) (b b) (c c))+  (defstrand serv 2 (k k) (n-a n-a) (n-b n-b) (c c-0) (a a) (b b))+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))+  (uniq-orig k n-a)+  (conf (cat c-0 a))+  (auth (cat c a) (cat b c-0))+  (traces+    ((send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k)))+    ((recv (cat b c-0) (cat a b n-a n-b))+      (send (cat c-0 a) (cat a b k n-a n-b))))+  (label 30)+  (unrealized (0 1) (1 0))+  (maps ((0 1) ((k k) (n-a n-a) (n-b n-b) (a a) (c c) (b b) (c-0 c-0))))+  (origs (k (1 1)) (n-a (0 0)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-a n-b text) (a c b c-0 name))+  (defstrand init 3 (k k) (n-a n-a) (n-b n-b) (a a) (b b) (c c))+  (defstrand serv 2 (k k) (n-a n-a) (n-b n-b) (c c-0) (a a) (b b))+  (defstrand resp 2 (n-a n-a) (n-b n-b) (b b) (a a) (c c-0))+  (precedes ((0 0) (2 0)) ((1 1) (0 1)) ((2 1) (1 0)))+  (uniq-orig k n-a)+  (conf (cat c-0 a))+  (auth (cat c a) (cat b c-0))+  (operation channel-test (added-strand resp 2)+    (ch-msg (cat b c-0) (cat a b n-a n-b)) (1 0))+  (strand-map 0 1)+  (traces+    ((send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k)))+    ((recv (cat b c-0) (cat a b n-a n-b))+      (send (cat c-0 a) (cat a b k n-a n-b)))+    ((recv (cat a n-a)) (send (cat b c-0) (cat a b n-a n-b))))+  (label 31)+  (parent 30)+  (unrealized (0 1))+  (maps ((0 1) ((k k) (n-a n-a) (n-b n-b) (a a) (c c) (b b) (c-0 c-0))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-a n-b text) (a b c name))+  (defstrand init 3 (k k) (n-a n-a) (n-b n-b) (a a) (b b) (c c))+  (defstrand serv 2 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (defstrand resp 2 (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (precedes ((0 0) (2 0)) ((1 1) (0 1)) ((2 1) (1 0)))+  (uniq-orig k n-a)+  (conf (cat c a))+  (auth (cat b c) (cat c a))+  (operation channel-test (displaced 3 1 serv 2)+    (ch-msg (cat c-0 a) (cat a b k n-a n-b)) (0 1))+  (strand-map 0 1 2)+  (traces+    ((send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k)))+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)))+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))))+  (label 32)+  (parent 31)+  (realized)+  (shape)+  (maps ((0 1) ((k k) (n-a n-a) (n-b n-b) (a a) (c c) (b b) (c-0 c))))+  (origs (k (1 1)) (n-a (0 0))))++(comment "Nothing left to do")++(defprotocol yahalom basic+  (defrole init+    (vars (a b c name) (n-a n-b text) (k skey))+    (trace (send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k))))+  (defrole resp+    (vars (b a c name) (n-a n-b text) (k skey))+    (trace (recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k))))+  (defrole serv+    (vars (c a b name) (n-a n-b text) (k skey))+    (trace (recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    (uniq-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (comment+    "Use (cat x y) as channel from x to y. Matching channel should force matching names."))++(defskeleton yahalom+  (vars (k skey) (n-a n-b text) (c a b name))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (uniq-orig k)+  (conf (cat c a) (cat c b))+  (auth (cat b c))+  (traces+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b))+      (send (cat c b) (cat a b k))))+  (label 33)+  (unrealized (0 0))+  (maps ((0) ((c c) (a a) (b b) (n-a n-a) (n-b n-b) (k k))))+  (origs (k (0 1)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-a n-b text) (c a b name))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (defstrand resp 2 (n-a n-a) (n-b n-b) (b b) (a a) (c c))+  (precedes ((1 1) (0 0)))+  (uniq-orig k)+  (conf (cat c a) (cat c b))+  (auth (cat b c))+  (operation channel-test (added-strand resp 2)+    (ch-msg (cat b c) (cat a b n-a n-b)) (0 0))+  (strand-map 0)+  (traces+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    ((recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))))+  (label 34)+  (parent 33)+  (realized)+  (shape)+  (maps ((0) ((c c) (a a) (b b) (n-a n-a) (n-b n-b) (k k))))+  (origs (k (0 1))))++(comment "Nothing left to do")++(defprotocol yahalom basic+  (defrole init+    (vars (a b c name) (n-a n-b text) (k skey))+    (trace (send (cat a n-a)) (recv (cat c a) (cat a b k n-a n-b))+      (send (enc n-b k))))+  (defrole resp+    (vars (b a c name) (n-a n-b text) (k skey))+    (trace (recv (cat a n-a)) (send (cat b c) (cat a b n-a n-b))+      (recv (cat c b) (cat a b k)) (recv (enc n-b k))))+  (defrole serv+    (vars (c a b name) (n-a n-b text) (k skey))+    (trace (recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    (uniq-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (comment+    "Use (cat x y) as channel from x to y. Matching channel should force matching names."))++(defskeleton yahalom+  (vars (k skey) (n-a n-b text) (c a b name))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (deflistener k)+  (uniq-orig k)+  (conf (cat c a) (cat c b))+  (auth (cat b c))+  (traces+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    ((recv k) (send k)))+  (label 35)+  (unrealized (0 0) (1 0))+  (preskeleton)+  (maps ((0 1) ((c c) (a a) (b b) (k k) (n-a n-a) (n-b n-b))))+  (origs (k (0 1)))+  (comment "Not a skeleton"))++(defskeleton yahalom+  (vars (k skey) (n-a n-b text) (c a b name))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (deflistener k)+  (precedes ((0 1) (1 0)))+  (uniq-orig k)+  (conf (cat c a) (cat c b))+  (auth (cat b c))+  (traces+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    ((recv k) (send k)))+  (label 36)+  (parent 35)+  (unrealized (0 0) (1 0))+  (maps ((0 1) ((c c) (a a) (b b) (k k) (n-a n-a) (n-b n-b))))+  (origs (k (0 1)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton yahalom+  (vars (k skey) (n-a n-b text) (c a b name))+  (defstrand serv 3 (k k) (n-a n-a) (n-b n-b) (c c) (a a) (b b))+  (deflistener k)+  (precedes ((0 2) (1 0)))+  (uniq-orig k)+  (conf (cat c a) (cat c b))+  (auth (cat b c))+  (operation nonce-test (displaced 2 0 serv 3) k (1 0)+    (ch-msg (cat c a) (cat a b k n-a n-b)))+  (strand-map 0 1)+  (traces+    ((recv (cat b c) (cat a b n-a n-b))+      (send (cat c a) (cat a b k n-a n-b)) (send (cat c b) (cat a b k)))+    ((recv k) (send k)))+  (label 37)+  (parent 36)+  (unrealized (0 0) (1 0))+  (dead)+  (maps ((0 1) ((c c) (a a) (b b) (k k) (n-a n-a) (n-b n-b))))+  (origs (k (0 1)))+  (comment "empty cohort"))++(comment "Nothing left to do")
tst/chan-perrig-song.tst view
@@ -1,6 +1,6 @@ (herald perrig-song) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/chan-perrig-song.scm")  (defprotocol perrig-song basic
tst/chan-unilateral.tst view
@@ -1,6 +1,6 @@ (herald chan-unilateral) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/chan-unilateral.scm")  (defprotocol unilateral basic
tst/chan-yahalom-role-decl.tst view
@@ -1,6 +1,6 @@ (herald "Yahalom Protocol Without Forwarding" (bound 15)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/chan-yahalom-role-decl.scm") (comment "Strand count bounded at 15") 
tst/chan-yahalom.tst view
@@ -1,6 +1,6 @@ (herald "Yahalom Protocol Without Forwarding" (bound 15)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/chan-yahalom.scm") (comment "Strand count bounded at 15") 
tst/commitment.tst view
@@ -1,6 +1,6 @@ (herald commitment) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/commitment.scm")  (defprotocol commit basic
tst/comp_test.tst view
@@ -1,6 +1,6 @@ (herald "Main Example") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/comp_test.scm")  (defprotocol main-ex-src basic
tst/completeness-test.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/completeness-test.scm")  (defprotocol completeness-test basic
tst/crushing.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/crushing.scm")  (defprotocol crushing basic
tst/dass_simple.tst view
@@ -1,6 +1,6 @@ (herald "Distributed Authentication Security Service Protocol Variants") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/dass_simple.scm")  (defprotocol dass-simple basic
tst/denning-sacco.tst view
@@ -1,6 +1,6 @@ (herald "Denning-Sacco Protocol") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/denning-sacco.scm")  (defprotocol denning-sacco basic
tst/deorig_contract.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/deorig_contract.scm")  (defprotocol deorig-contract basic
tst/deorig_mesg.tst view
@@ -1,6 +1,6 @@ (herald deorig-mesg) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/deorig_mesg.scm")  (defprotocol deorig-mesg basic
tst/deorig_simple.tst view
@@ -1,6 +1,6 @@ (herald deorig-simple) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/deorig_simple.scm")  (defprotocol deorig-simple basic
+ tst/dev-subatomic-open-closed.scm view
@@ -0,0 +1,158 @@+(herald+ dev-subatomic-open-closed+ (comment "Version that uses (dev const) pairs for locations"))++(defmacro (dev-key-state o k)+  (cat "st-k" o k))++(defmacro (opened o)+  (cat o o))++(defmacro (closed o) o)++(defmacro (dev-state-opened o)+  (cat "st" (opened o)))++(defmacro (dev-state-closed o)+  (cat "st" (closed o)))++(defmacro (dev-state-any o any)+  (cat "st" any))++(defprotocol subatomic-open-closed basic+  (defrole dev-up+    (vars (k skey) (d dev) (o name) (old old1 mesg) (start-ch chan))+    (trace+     (recv start-ch (cat "power-up" o k))+     (stor (cat d "lk") (dev-key-state o k))+     (stor (cat d "ls") (dev-state-closed o))+     (send (enc "up" k)))+    (auth start-ch)+    )++  (defrole owner-power-dev+    (vars (k skey) (o name) (start-ch chan))+    (trace+     (send start-ch (cat "power-up" o k))+     (recv (enc "up" k)))+    (conf start-ch))++  (defrole owner-open+    (vars (k skey) (n text) (d dev) (o name))+    (trace+     (send (enc "open" d o n k))+     (recv n)))++  (defrole owner-close+    (vars (k skey) (n text) (d dev) (o name))+    (trace+     (send (enc "close" d o n k))+     (recv n)))++  (defrole dev-open+    (vars (k skey) (n text) (any mesg) (d dev) (o name))+    (trace+     (recv (enc "open" d o n k))+     (load (cat d "lk") (dev-key-state o k))+     (stor (cat d "ls") (dev-state-opened o))+     (send n))+    (gen-st (dev-key-state o k) (dev-state-opened o))+    )++  (defrole dev-close+    (vars (k skey) (n text) (any mesg) (d dev) (o name))+    (trace+     (recv (enc "close" d o n k))+     (load (cat d "lk") (dev-key-state o k))+     (stor (cat d "ls") (dev-state-closed o))+     (send n))+    (gen-st (dev-key-state o k))+    )++  (defrole dev-pass+    (vars (k skey) (n text) (d dev) (o name))+    (trace+     (load (cat d "lk") (dev-key-state o k))+     (load (cat d "ls") (dev-state-opened o))+     (recv (enc "may I pass" k))+     (send (enc "you may pass" n k)))+    (uniq-orig n)+    (gen-st (dev-key-state o k) (dev-state-opened o))+    )++  (defrole user-pass+    (vars (k skey))+    (trace+     (send (enc "may I pass" k))+     (recv (enc "you may pass" k))))++   (defrule power-deliver-once+     (forall+      ((z1 z2 strd) (k skey))+      (implies+       (and (p "dev-up" z1 2)+ 	   (p "dev-up" z2 2)+ 	   (p "dev-up" "k" z1 k)+ 	   (p "dev-up" "k" z2 k))+       (= z1 z2))))++   ;; (defrule locName+   ;;   (forall+   ;;    ((l1 l2 locn) (m mesg))+   ;;    (implies+   ;;     (and (fact useLocName)+   ;; 	    (fact locName l1 m)+   ;; 	    (fact locName l2 m))+   ;;     (= l1 l2))))+)++(defskeleton subatomic-open-closed+  (vars (k skey) (d o name) (n text) (start-ch chan))+  (defstrand owner-power-dev 2 (k k))+  (deflistener k)+  (uniq-orig k)+  (facts (no-state-split)))++(defskeleton subatomic-open-closed+  (vars (k skey) (d o name) (n text) (start-ch chan))+  (defstrand dev-pass 4 (k k))+  (facts (no-state-split) (useLocName)))++(defskeleton subatomic-open-closed+	   (vars (k skey) (d o name) (n text) (start-ch chan))+	   (defstrand owner-power-dev 2 (k k))+	   (defstrand dev-pass 4 (k k))+	   (uniq-orig k)+	   (facts (no-state-split)))++;; When the locName rule is disabled CPSA considers it+;; possible that a given device may have several key-state+;; locations and several door-state locations. These wires+;; can get crossed. The locName fact and rule allow us to+;; treat ls and lk as fixed constant addresses on each+;; device d. +(defskeleton subatomic-open-closed+  (vars (k skey) (d o name) (n text) (start-ch chan))+  (defstrand dev-pass 4 (k k))+  (facts (no-state-split)))++(comment+ (defskeleton subatomic-open-closed+   (vars (any old old1 mesg) (k skey) (n n-0 text) (d o name)+	 (pt pt-0 pt-1 pt-2 pt-3 pt-4 pval) (start-ch chan) (lk ls locn))+   (defstrand owner-power-dev 2 (k k) (d d) (o o) (start-ch start-ch))+   (defstrand dev-pass 4 (k k) (n n) (d d) (o o) (lk lk) (ls ls))+   (defstrand dev-open 4 (any any) (k k) (n n-0) (d d) (o o) (lk lk)+     (ls ls))+   (defstrand owner-open 1 (k k) (n n-0) (d d) (o o))+   (defstrand user-pass 1 (k k))+   (defstrand dev-up 6 (old old) (old1 old1) (k k) (d d) (o o)+     (start-ch start-ch) (lk lk) (ls ls))+   (precedes ((0 0) (5 0)) ((2 3) (1 0)) ((3 0) (2 0)) ((4 0) (1 2))+	     ((5 4) (2 1)) ((5 5) (0 1)))+   (uniq-orig k n)+   (gen-st (cat "st" d o o) (cat "st-k" d o k))+   (conf start-ch)+   (auth start-ch)+   ;;  (facts (same-dev ls lk) (no-state-split))+   (leads-to ((2 3) (1 1)) ((5 3) (1 0)) ((5 3) (2 2)))))
+ tst/dev-subatomic-open-closed.tst view
@@ -0,0 +1,1443 @@+(herald dev-subatomic-open-closed+  (comment "Version that uses (dev const) pairs for locations"))++(comment "CPSA 4.4.9")+(comment "All input read from tst/dev-subatomic-open-closed.scm")++(defprotocol subatomic-open-closed basic+  (defrole dev-up+    (vars (k skey) (d dev) (o name) (start-ch chan))+    (trace (recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat "st-k" o k))+      (stor (cat d "ls") (cat "st" o)) (send (enc "up" k)))+    (auth start-ch))+  (defrole owner-power-dev+    (vars (k skey) (o name) (start-ch chan))+    (trace (send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    (conf start-ch))+  (defrole owner-open+    (vars (k skey) (n text) (d dev) (o name))+    (trace (send (enc "open" d o n k)) (recv n)))+  (defrole owner-close+    (vars (k skey) (n text) (d dev) (o name))+    (trace (send (enc "close" d o n k)) (recv n)))+  (defrole dev-open+    (vars (k skey) (n text) (d dev) (o name))+    (trace (recv (enc "open" d o n k))+      (load (cat d "lk") (cat "st-k" o k))+      (stor (cat d "ls") (cat "st" o o)) (send n))+    (gen-st (cat "st-k" o k) (cat "st" (cat o o))))+  (defrole dev-close+    (vars (k skey) (n text) (d dev) (o name))+    (trace (recv (enc "close" d o n k))+      (load (cat d "lk") (cat "st-k" o k))+      (stor (cat d "ls") (cat "st" o)) (send n))+    (gen-st (cat "st-k" o k)))+  (defrole dev-pass+    (vars (k skey) (n text) (d dev) (o name))+    (trace (load (cat d "lk") (cat "st-k" o k))+      (load (cat d "ls") (cat "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    (uniq-orig n)+    (gen-st (cat "st-k" o k) (cat "st" (cat o o))))+  (defrole user-pass+    (vars (k skey))+    (trace (send (enc "may I pass" k)) (recv (enc "you may pass" k))))+  (defrule power-deliver-once+    (forall ((z1 z2 strd) (k skey))+      (implies+        (and (p "dev-up" z2 (idx 2)) (p "dev-up" z1 (idx 2))+          (p "dev-up" "k" z2 k) (p "dev-up" "k" z1 k))+        (= z1 z2))))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (defgenrule scissorsRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (trans z2 i2)+          (leads-to z0 i0 z1 i1) (leads-to z0 i0 z2 i2))+        (and (= z1 z2) (= i1 i2)))))+  (defgenrule cakeRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (leads-to z0 i0 z1 i1)+          (leads-to z0 i0 z2 i2) (prec z1 i1 z2 i2)) (false))))+  (defgenrule no-interruption+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (leads-to z0 i0 z2 i2) (trans z1 i1)+          (same-locn z0 i0 z1 i1) (prec z0 i0 z1 i1) (prec z1 i1 z2 i2))+        (false))))+  (defgenrule discreteAfter+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z2 i2) (leads-to z0 i0 z1 i1)+          (same-locn z0 i0 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z1 z2) (= i1 i2)) (prec z1 i1 z2 i2)))))+  (defgenrule discreteBefore+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (same-locn z0 i0 z1 i1)+          (leads-to z1 i1 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z0 z1) (= i0 i1)) (prec z0 i0 z1 i1)))))+  (defgenrule trRl_dev-up-at-2+    (forall ((z strd))+      (implies (p "dev-up" z (idx 3)) (trans z (idx 2)))))+  (defgenrule trRl_dev-up-at-1+    (forall ((z strd))+      (implies (p "dev-up" z (idx 2)) (trans z (idx 1)))))+  (defgenrule trRl_dev-open-at-2+    (forall ((z strd))+      (implies (p "dev-open" z (idx 3)) (trans z (idx 2)))))+  (defgenrule trRl_dev-close-at-2+    (forall ((z strd))+      (implies (p "dev-close" z (idx 3)) (trans z (idx 2)))))+  (defgenrule eff-dev-up-1+    (forall ((i indx) (z1 z strd))+      (implies (and (p "dev-up" z (idx 2)) (prec z (idx 1) z1 i))+        (or (= z z1)+          (and (p "dev-up" z (idx 3)) (prec z (idx 2) z1 i))))))+  (defgenrule cau-dev-pass-1+    (forall ((i indx) (z1 z strd))+      (implies (and (p "dev-pass" z (idx 2)) (prec z1 i z (idx 1)))+        (or (= z z1) (prec z1 i z (idx 0))))))+  (defgenrule eff-dev-pass-2+    (forall ((i indx) (z1 z strd))+      (implies (and (p "dev-pass" z (idx 3)) (prec z (idx 2) z1 i))+        (or (= z z1)+          (and (p "dev-pass" z (idx 2)) (prec z (idx 1) z1 i))))))+  (defgenrule gen-st-dev-open-1+    (forall ((z strd) (o name) (k skey))+      (implies+        (and (p "dev-open" z (idx 1)) (p "dev-open" "k" z k)+          (p "dev-open" "o" z o)) (gen-st (cat "st-k" o k)))))+  (defgenrule gen-st-dev-open-0+    (forall ((z strd) (o name))+      (implies (and (p "dev-open" z (idx 1)) (p "dev-open" "o" z o))+        (gen-st (cat "st" o o)))))+  (defgenrule gen-st-dev-close-0+    (forall ((z strd) (o name) (k skey))+      (implies+        (and (p "dev-close" z (idx 1)) (p "dev-close" "k" z k)+          (p "dev-close" "o" z o)) (gen-st (cat "st-k" o k)))))+  (defgenrule gen-st-dev-pass-1+    (forall ((z strd) (o name) (k skey))+      (implies+        (and (p "dev-pass" z (idx 1)) (p "dev-pass" "k" z k)+          (p "dev-pass" "o" z o)) (gen-st (cat "st-k" o k)))))+  (defgenrule gen-st-dev-pass-0+    (forall ((z strd) (o name))+      (implies (and (p "dev-pass" z (idx 1)) (p "dev-pass" "o" z o))+        (gen-st (cat "st" o o))))))++(defskeleton subatomic-open-closed+  (vars (k skey) (o name) (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (deflistener k)+  (uniq-orig k)+  (conf start-ch)+  (facts (no-state-split))+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((recv k) (send k)))+  (label 0)+  (unrealized (0 1) (1 0))+  (preskeleton)+  (maps ((0 1) ((k k) (o o) (start-ch start-ch))))+  (origs (k (0 0)))+  (comment "Not a skeleton"))++(defskeleton subatomic-open-closed+  (vars (k skey) (o name) (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (deflistener k)+  (precedes ((0 0) (1 0)))+  (uniq-orig k)+  (conf start-ch)+  (facts (no-state-split))+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((recv k) (send k)))+  (label 1)+  (parent 0)+  (unrealized (0 1) (1 0))+  (maps ((0 1) ((k k) (o o) (start-ch start-ch))))+  (origs (k (0 0)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (o name) (pt pt-0 pval) (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (deflistener k)+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (precedes ((0 0) (2 0)) ((2 2) (1 0)))+  (uniq-orig k)+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (rule eff-dev-up-1 trRl_dev-up-at-1 trRl_dev-up-at-2)+  (operation nonce-test (added-strand dev-up 2) k (1 0)+    (ch-msg start-ch (cat "power-up" o k)))+  (strand-map 0 1)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((recv k) (send k))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt "st-k" o k))+      (stor (cat d "ls") (cat pt-0 "st" o))))+  (label 2)+  (parent 1)+  (unrealized (0 1) (1 0))+  (dead)+  (maps ((0 1) ((k k) (o o) (start-ch start-ch))))+  (comment "empty cohort"))++(comment "Nothing left to do")++(defprotocol subatomic-open-closed basic+  (defrole dev-up+    (vars (k skey) (d dev) (o name) (start-ch chan))+    (trace (recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat "st-k" o k))+      (stor (cat d "ls") (cat "st" o)) (send (enc "up" k)))+    (auth start-ch))+  (defrole owner-power-dev+    (vars (k skey) (o name) (start-ch chan))+    (trace (send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    (conf start-ch))+  (defrole owner-open+    (vars (k skey) (n text) (d dev) (o name))+    (trace (send (enc "open" d o n k)) (recv n)))+  (defrole owner-close+    (vars (k skey) (n text) (d dev) (o name))+    (trace (send (enc "close" d o n k)) (recv n)))+  (defrole dev-open+    (vars (k skey) (n text) (d dev) (o name))+    (trace (recv (enc "open" d o n k))+      (load (cat d "lk") (cat "st-k" o k))+      (stor (cat d "ls") (cat "st" o o)) (send n))+    (gen-st (cat "st-k" o k) (cat "st" (cat o o))))+  (defrole dev-close+    (vars (k skey) (n text) (d dev) (o name))+    (trace (recv (enc "close" d o n k))+      (load (cat d "lk") (cat "st-k" o k))+      (stor (cat d "ls") (cat "st" o)) (send n))+    (gen-st (cat "st-k" o k)))+  (defrole dev-pass+    (vars (k skey) (n text) (d dev) (o name))+    (trace (load (cat d "lk") (cat "st-k" o k))+      (load (cat d "ls") (cat "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    (uniq-orig n)+    (gen-st (cat "st-k" o k) (cat "st" (cat o o))))+  (defrole user-pass+    (vars (k skey))+    (trace (send (enc "may I pass" k)) (recv (enc "you may pass" k))))+  (defrule power-deliver-once+    (forall ((z1 z2 strd) (k skey))+      (implies+        (and (p "dev-up" z2 (idx 2)) (p "dev-up" z1 (idx 2))+          (p "dev-up" "k" z2 k) (p "dev-up" "k" z1 k))+        (= z1 z2))))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (defgenrule scissorsRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (trans z2 i2)+          (leads-to z0 i0 z1 i1) (leads-to z0 i0 z2 i2))+        (and (= z1 z2) (= i1 i2)))))+  (defgenrule cakeRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (leads-to z0 i0 z1 i1)+          (leads-to z0 i0 z2 i2) (prec z1 i1 z2 i2)) (false))))+  (defgenrule no-interruption+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (leads-to z0 i0 z2 i2) (trans z1 i1)+          (same-locn z0 i0 z1 i1) (prec z0 i0 z1 i1) (prec z1 i1 z2 i2))+        (false))))+  (defgenrule discreteAfter+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z2 i2) (leads-to z0 i0 z1 i1)+          (same-locn z0 i0 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z1 z2) (= i1 i2)) (prec z1 i1 z2 i2)))))+  (defgenrule discreteBefore+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (same-locn z0 i0 z1 i1)+          (leads-to z1 i1 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z0 z1) (= i0 i1)) (prec z0 i0 z1 i1)))))+  (defgenrule trRl_dev-up-at-2+    (forall ((z strd))+      (implies (p "dev-up" z (idx 3)) (trans z (idx 2)))))+  (defgenrule trRl_dev-up-at-1+    (forall ((z strd))+      (implies (p "dev-up" z (idx 2)) (trans z (idx 1)))))+  (defgenrule trRl_dev-open-at-2+    (forall ((z strd))+      (implies (p "dev-open" z (idx 3)) (trans z (idx 2)))))+  (defgenrule trRl_dev-close-at-2+    (forall ((z strd))+      (implies (p "dev-close" z (idx 3)) (trans z (idx 2)))))+  (defgenrule eff-dev-up-1+    (forall ((i indx) (z1 z strd))+      (implies (and (p "dev-up" z (idx 2)) (prec z (idx 1) z1 i))+        (or (= z z1)+          (and (p "dev-up" z (idx 3)) (prec z (idx 2) z1 i))))))+  (defgenrule cau-dev-pass-1+    (forall ((i indx) (z1 z strd))+      (implies (and (p "dev-pass" z (idx 2)) (prec z1 i z (idx 1)))+        (or (= z z1) (prec z1 i z (idx 0))))))+  (defgenrule eff-dev-pass-2+    (forall ((i indx) (z1 z strd))+      (implies (and (p "dev-pass" z (idx 3)) (prec z (idx 2) z1 i))+        (or (= z z1)+          (and (p "dev-pass" z (idx 2)) (prec z (idx 1) z1 i))))))+  (defgenrule gen-st-dev-open-1+    (forall ((z strd) (o name) (k skey))+      (implies+        (and (p "dev-open" z (idx 1)) (p "dev-open" "k" z k)+          (p "dev-open" "o" z o)) (gen-st (cat "st-k" o k)))))+  (defgenrule gen-st-dev-open-0+    (forall ((z strd) (o name))+      (implies (and (p "dev-open" z (idx 1)) (p "dev-open" "o" z o))+        (gen-st (cat "st" o o)))))+  (defgenrule gen-st-dev-close-0+    (forall ((z strd) (o name) (k skey))+      (implies+        (and (p "dev-close" z (idx 1)) (p "dev-close" "k" z k)+          (p "dev-close" "o" z o)) (gen-st (cat "st-k" o k)))))+  (defgenrule gen-st-dev-pass-1+    (forall ((z strd) (o name) (k skey))+      (implies+        (and (p "dev-pass" z (idx 1)) (p "dev-pass" "k" z k)+          (p "dev-pass" "o" z o)) (gen-st (cat "st-k" o k)))))+  (defgenrule gen-st-dev-pass-0+    (forall ((z strd) (o name))+      (implies (and (p "dev-pass" z (idx 1)) (p "dev-pass" "o" z o))+        (gen-st (cat "st" o o))))))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o name) (pt pt-0 pval))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (uniq-orig n)+  (facts (no-state-split) (useLocName))+  (traces+    ((load (cat d "lk") (cat pt "st-k" o k))+      (load (cat d "ls") (cat pt-0 "st" o o))+      (recv (enc "may I pass" k)) (send (enc "you may pass" n k))))+  (label 3)+  (realized)+  (maps ((0) ((k k) (n n) (d d) (o o))))+  (origs (n (0 3)))+  (comment "Not closed under rules"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o name) (pt pt-0 pval))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (uniq-orig n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (facts (no-state-split) (useLocName))+  (rule gen-st-dev-pass-0 gen-st-dev-pass-1)+  (traces+    ((load (cat d "lk") (cat pt "st-k" o k))+      (load (cat d "ls") (cat pt-0 "st" o o))+      (recv (enc "may I pass" k)) (send (enc "you may pass" n k))))+  (label 4)+  (parent 3)+  (unrealized (0 0) (0 1))+  (maps ((0) ((k k) (n n) (d d) (o o))))+  (origs (n (0 3)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (precedes ((1 2) (0 0)))+  (uniq-orig n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (auth start-ch)+  (facts (no-state-split) (useLocName))+  (leads-to ((1 1) (0 0)))+  (rule eff-dev-up-1 trRl_dev-up-at-1 trRl_dev-up-at-2)+  (operation channel-test (added-strand dev-up 2)+    (ch-msg (cat d "lk") (cat pt-0 "st-k" o k)) (0 0))+  (strand-map 0)+  (traces+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o))))+  (label 5)+  (parent 4)+  (unrealized (0 1) (1 0))+  (maps ((0) ((k k) (n n) (d d) (o o))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (defstrand owner-power-dev 1 (k k) (o o) (start-ch start-ch))+  (precedes ((1 2) (0 0)) ((2 0) (1 0)))+  (uniq-orig n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split) (useLocName))+  (leads-to ((1 1) (0 0)))+  (operation channel-test (added-strand owner-power-dev 1)+    (ch-msg start-ch (cat "power-up" o k)) (1 0))+  (strand-map 0 1)+  (traces+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o)))+    ((send start-ch (cat "power-up" o k))))+  (label 6)+  (parent 5)+  (unrealized (0 1))+  (maps ((0) ((k k) (n n) (d d) (o o))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k k-0 skey) (n n-0 text) (o name)+    (pt pt-0 pt-1 pt-2 pval) (start-ch chan))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (defstrand owner-power-dev 1 (k k) (o o) (start-ch start-ch))+  (defstrand dev-open 3 (d d) (k k-0) (n n-0) (o o))+  (precedes ((1 2) (3 1)) ((2 0) (1 0)) ((3 2) (0 0)))+  (uniq-orig n)+  (gen-st (cat "st" o o) (cat "st-k" o k) (cat "st-k" o k-0))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split) (useLocName))+  (leads-to ((1 1) (0 0)) ((3 2) (0 1)))+  (rule cau-dev-pass-1 discreteBefore gen-st-dev-open-1+    trRl_dev-open-at-2)+  (operation channel-test (added-strand dev-open 3)+    (ch-msg (cat d "ls") (cat pt "st" o o)) (0 1))+  (strand-map 0 1 2)+  (traces+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o)))+    ((send start-ch (cat "power-up" o k)))+    ((recv (enc "open" d o n-0 k-0))+      (load (cat d "lk") (cat pt-2 "st-k" o k-0))+      (stor (cat d "ls") (cat pt "st" o o))))+  (label 7)+  (parent 6)+  (unrealized (3 1))+  (maps ((0) ((k k) (n n) (d d) (o o))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n n-0 text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand owner-power-dev 1 (k k) (o o) (start-ch start-ch))+  (defstrand dev-open 3 (d d) (k k) (n n-0) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (precedes ((1 0) (3 0)) ((2 2) (0 0)) ((3 2) (2 1)))+  (uniq-orig n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split) (useLocName))+  (leads-to ((2 2) (0 1)) ((3 1) (0 0)) ((3 1) (2 1)))+  (rule discreteBefore eff-dev-up-1 trRl_dev-up-at-1 trRl_dev-up-at-2)+  (operation channel-test (added-strand dev-up 2)+    (ch-msg (cat d "lk") (cat pt-0 "st-k" o k)) (3 1))+  (strand-map 0 2 3 1)+  (traces+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((send start-ch (cat "power-up" o k)))+    ((recv (enc "open" d o n-0 k))+      (load (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt "st" o o)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o))))+  (label 8)+  (parent 7)+  (realized)+  (shape)+  (maps ((0) ((k k) (n n) (d d) (o o))))+  (origs (pt-0 (3 1)) (pt-1 (3 2)) (pt (2 2)) (n (0 3))))++(comment "Nothing left to do")++(defprotocol subatomic-open-closed basic+  (defrole dev-up+    (vars (k skey) (d dev) (o name) (start-ch chan))+    (trace (recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat "st-k" o k))+      (stor (cat d "ls") (cat "st" o)) (send (enc "up" k)))+    (auth start-ch))+  (defrole owner-power-dev+    (vars (k skey) (o name) (start-ch chan))+    (trace (send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    (conf start-ch))+  (defrole owner-open+    (vars (k skey) (n text) (d dev) (o name))+    (trace (send (enc "open" d o n k)) (recv n)))+  (defrole owner-close+    (vars (k skey) (n text) (d dev) (o name))+    (trace (send (enc "close" d o n k)) (recv n)))+  (defrole dev-open+    (vars (k skey) (n text) (d dev) (o name))+    (trace (recv (enc "open" d o n k))+      (load (cat d "lk") (cat "st-k" o k))+      (stor (cat d "ls") (cat "st" o o)) (send n))+    (gen-st (cat "st-k" o k) (cat "st" (cat o o))))+  (defrole dev-close+    (vars (k skey) (n text) (d dev) (o name))+    (trace (recv (enc "close" d o n k))+      (load (cat d "lk") (cat "st-k" o k))+      (stor (cat d "ls") (cat "st" o)) (send n))+    (gen-st (cat "st-k" o k)))+  (defrole dev-pass+    (vars (k skey) (n text) (d dev) (o name))+    (trace (load (cat d "lk") (cat "st-k" o k))+      (load (cat d "ls") (cat "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    (uniq-orig n)+    (gen-st (cat "st-k" o k) (cat "st" (cat o o))))+  (defrole user-pass+    (vars (k skey))+    (trace (send (enc "may I pass" k)) (recv (enc "you may pass" k))))+  (defrule power-deliver-once+    (forall ((z1 z2 strd) (k skey))+      (implies+        (and (p "dev-up" z2 (idx 2)) (p "dev-up" z1 (idx 2))+          (p "dev-up" "k" z2 k) (p "dev-up" "k" z1 k))+        (= z1 z2))))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (defgenrule scissorsRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (trans z2 i2)+          (leads-to z0 i0 z1 i1) (leads-to z0 i0 z2 i2))+        (and (= z1 z2) (= i1 i2)))))+  (defgenrule cakeRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (leads-to z0 i0 z1 i1)+          (leads-to z0 i0 z2 i2) (prec z1 i1 z2 i2)) (false))))+  (defgenrule no-interruption+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (leads-to z0 i0 z2 i2) (trans z1 i1)+          (same-locn z0 i0 z1 i1) (prec z0 i0 z1 i1) (prec z1 i1 z2 i2))+        (false))))+  (defgenrule discreteAfter+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z2 i2) (leads-to z0 i0 z1 i1)+          (same-locn z0 i0 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z1 z2) (= i1 i2)) (prec z1 i1 z2 i2)))))+  (defgenrule discreteBefore+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (same-locn z0 i0 z1 i1)+          (leads-to z1 i1 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z0 z1) (= i0 i1)) (prec z0 i0 z1 i1)))))+  (defgenrule trRl_dev-up-at-2+    (forall ((z strd))+      (implies (p "dev-up" z (idx 3)) (trans z (idx 2)))))+  (defgenrule trRl_dev-up-at-1+    (forall ((z strd))+      (implies (p "dev-up" z (idx 2)) (trans z (idx 1)))))+  (defgenrule trRl_dev-open-at-2+    (forall ((z strd))+      (implies (p "dev-open" z (idx 3)) (trans z (idx 2)))))+  (defgenrule trRl_dev-close-at-2+    (forall ((z strd))+      (implies (p "dev-close" z (idx 3)) (trans z (idx 2)))))+  (defgenrule eff-dev-up-1+    (forall ((i indx) (z1 z strd))+      (implies (and (p "dev-up" z (idx 2)) (prec z (idx 1) z1 i))+        (or (= z z1)+          (and (p "dev-up" z (idx 3)) (prec z (idx 2) z1 i))))))+  (defgenrule cau-dev-pass-1+    (forall ((i indx) (z1 z strd))+      (implies (and (p "dev-pass" z (idx 2)) (prec z1 i z (idx 1)))+        (or (= z z1) (prec z1 i z (idx 0))))))+  (defgenrule eff-dev-pass-2+    (forall ((i indx) (z1 z strd))+      (implies (and (p "dev-pass" z (idx 3)) (prec z (idx 2) z1 i))+        (or (= z z1)+          (and (p "dev-pass" z (idx 2)) (prec z (idx 1) z1 i))))))+  (defgenrule gen-st-dev-open-1+    (forall ((z strd) (o name) (k skey))+      (implies+        (and (p "dev-open" z (idx 1)) (p "dev-open" "k" z k)+          (p "dev-open" "o" z o)) (gen-st (cat "st-k" o k)))))+  (defgenrule gen-st-dev-open-0+    (forall ((z strd) (o name))+      (implies (and (p "dev-open" z (idx 1)) (p "dev-open" "o" z o))+        (gen-st (cat "st" o o)))))+  (defgenrule gen-st-dev-close-0+    (forall ((z strd) (o name) (k skey))+      (implies+        (and (p "dev-close" z (idx 1)) (p "dev-close" "k" z k)+          (p "dev-close" "o" z o)) (gen-st (cat "st-k" o k)))))+  (defgenrule gen-st-dev-pass-1+    (forall ((z strd) (o name) (k skey))+      (implies+        (and (p "dev-pass" z (idx 1)) (p "dev-pass" "k" z k)+          (p "dev-pass" "o" z o)) (gen-st (cat "st-k" o k)))))+  (defgenrule gen-st-dev-pass-0+    (forall ((z strd) (o name))+      (implies (and (p "dev-pass" z (idx 1)) (p "dev-pass" "o" z o))+        (gen-st (cat "st" o o))))))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o o-0 name) (pt pt-0 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o-0))+  (uniq-orig k n)+  (conf start-ch)+  (facts (no-state-split))+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt "st-k" o-0 k))+      (load (cat d "ls") (cat pt-0 "st" o-0 o-0))+      (recv (enc "may I pass" k)) (send (enc "you may pass" n k))))+  (label 9)+  (unrealized (0 1) (1 0) (1 2))+  (preskeleton)+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o-0))))+  (origs (n (1 3)) (k (0 0)))+  (comment "Not a skeleton"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o o-0 name) (pt pt-0 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o-0))+  (precedes ((0 0) (1 0)))+  (uniq-orig k n)+  (conf start-ch)+  (facts (no-state-split))+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt "st-k" o-0 k))+      (load (cat d "ls") (cat pt-0 "st" o-0 o-0))+      (recv (enc "may I pass" k)) (send (enc "you may pass" n k))))+  (label 10)+  (parent 9)+  (unrealized (0 1) (1 0) (1 2))+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o-0))))+  (origs (n (1 3)) (k (0 0)))+  (comment "Not closed under rules"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o o-0 name) (pt pt-0 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o-0))+  (precedes ((0 0) (1 0)))+  (uniq-orig k n)+  (gen-st (cat "st" o-0 o-0) (cat "st-k" o-0 k))+  (conf start-ch)+  (facts (no-state-split))+  (rule gen-st-dev-pass-0 gen-st-dev-pass-1)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt "st-k" o-0 k))+      (load (cat d "ls") (cat pt-0 "st" o-0 o-0))+      (recv (enc "may I pass" k)) (send (enc "you may pass" n k))))+  (label 11)+  (parent 10)+  (unrealized (0 1) (1 0) (1 1) (1 2))+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o-0))))+  (origs (n (1 3)) (k (0 0)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o o-0 name) (pt pt-0 pt-1 pval)+    (start-ch start-ch-0 chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o-0))+  (defstrand dev-up 3 (d d) (k k) (o o-0) (start-ch start-ch-0))+  (precedes ((0 0) (2 0)) ((2 2) (1 0)))+  (uniq-orig k n)+  (gen-st (cat "st" o-0 o-0) (cat "st-k" o-0 k))+  (conf start-ch)+  (auth start-ch-0)+  (facts (no-state-split))+  (leads-to ((2 1) (1 0)))+  (rule eff-dev-up-1 trRl_dev-up-at-1 trRl_dev-up-at-2)+  (operation channel-test (added-strand dev-up 2)+    (ch-msg (cat d "lk") (cat pt-0 "st-k" o-0 k)) (1 0))+  (strand-map 0 1)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o-0 k))+      (load (cat d "ls") (cat pt "st" o-0 o-0))+      (recv (enc "may I pass" k)) (send (enc "you may pass" n k)))+    ((recv start-ch-0 (cat "power-up" o-0 k))+      (stor (cat d "lk") (cat pt-0 "st-k" o-0 k))+      (stor (cat d "ls") (cat pt-1 "st" o-0))))+  (label 12)+  (parent 11)+  (unrealized (0 1) (1 1) (1 2) (2 0))+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o-0))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (precedes ((0 0) (2 0)) ((2 2) (1 0)))+  (uniq-orig k n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 1) (1 0)))+  (operation channel-test (displaced 3 0 owner-power-dev 1)+    (ch-msg start-ch-0 (cat "power-up" o-0 k)) (2 0))+  (strand-map 0 1 2)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o))))+  (label 13)+  (parent 12)+  (unrealized (0 1) (1 1) (1 2))+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k k-0 skey) (n n-0 text) (o name)+    (pt pt-0 pt-1 pt-2 pval) (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (defstrand dev-open 3 (d d) (k k-0) (n n-0) (o o))+  (precedes ((0 0) (2 0)) ((2 2) (3 1)) ((3 2) (1 0)))+  (uniq-orig k n)+  (gen-st (cat "st" o o) (cat "st-k" o k) (cat "st-k" o k-0))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 1) (1 0)) ((3 2) (1 1)))+  (rule cau-dev-pass-1 discreteBefore gen-st-dev-open-1+    trRl_dev-open-at-2)+  (operation channel-test (added-strand dev-open 3)+    (ch-msg (cat d "ls") (cat pt "st" o o)) (1 1))+  (strand-map 0 1 2)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o)))+    ((recv (enc "open" d o n-0 k-0))+      (load (cat d "lk") (cat pt-2 "st-k" o k-0))+      (stor (cat d "ls") (cat pt "st" o o))))+  (label 14)+  (parent 13)+  (unrealized (0 1) (1 2) (3 1))+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n n-0 text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-open 3 (d d) (k k) (n n-0) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (precedes ((0 0) (3 0)) ((2 2) (1 0)) ((3 2) (2 1)))+  (uniq-orig k n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 2) (1 1)) ((3 1) (1 0)) ((3 1) (2 1)))+  (rule discreteBefore eff-dev-up-1 trRl_dev-up-at-1 trRl_dev-up-at-2)+  (operation channel-test (added-strand dev-up 2)+    (ch-msg (cat d "lk") (cat pt-0 "st-k" o k)) (3 1))+  (strand-map 0 1 3 2)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv (enc "open" d o n-0 k))+      (load (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt "st" o o)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o))))+  (label 15)+  (parent 14)+  (unrealized (0 1) (1 2) (2 0))+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o))))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n n-0 text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-open 3 (d d) (k k) (n n-0) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (defstrand owner-open 1 (d d) (k k) (n n-0) (o o))+  (precedes ((0 0) (3 0)) ((2 2) (1 0)) ((3 2) (2 1)) ((4 0) (2 0)))+  (uniq-orig k n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 2) (1 1)) ((3 1) (1 0)) ((3 1) (2 1)))+  (operation encryption-test (added-strand owner-open 1)+    (enc "open" d o n-0 k) (2 0))+  (strand-map 0 1 2 3)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv (enc "open" d o n-0 k))+      (load (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt "st" o o)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o)))+    ((send (enc "open" d o n-0 k))))+  (label 16)+  (parent 15)+  (unrealized (0 1) (1 2))+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o))))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n n-0 text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-open 3 (d d) (k k) (n n-0) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (deflistener k)+  (precedes ((0 0) (3 0)) ((0 0) (4 0)) ((2 2) (1 0)) ((3 2) (2 1))+    ((4 1) (2 0)))+  (uniq-orig k n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 2) (1 1)) ((3 1) (1 0)) ((3 1) (2 1)))+  (operation encryption-test (added-listener k) (enc "open" d o n-0 k)+    (2 0))+  (strand-map 0 1 2 3)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv (enc "open" d o n-0 k))+      (load (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt "st" o o)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o))) ((recv k) (send k)))+  (label 17)+  (parent 15)+  (unrealized (0 1) (4 0))+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n n-0 text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-open 3 (d d) (k k) (n n-0) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (defstrand owner-open 1 (d d) (k k) (n n-0) (o o))+  (defstrand user-pass 1 (k k))+  (precedes ((0 0) (3 0)) ((2 2) (1 0)) ((3 2) (2 1)) ((4 0) (2 0))+    ((5 0) (1 2)))+  (uniq-orig k n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 2) (1 1)) ((3 1) (1 0)) ((3 1) (2 1)))+  (operation encryption-test (added-strand user-pass 1)+    (enc "may I pass" k) (1 2))+  (strand-map 0 1 2 3 4)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv (enc "open" d o n-0 k))+      (load (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt "st" o o)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o)))+    ((send (enc "open" d o n-0 k))) ((send (enc "may I pass" k))))+  (label 18)+  (parent 16)+  (unrealized (0 1))+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o))))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n n-0 text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-open 3 (d d) (k k) (n n-0) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (defstrand owner-open 1 (d d) (k k) (n n-0) (o o))+  (deflistener k)+  (precedes ((0 0) (3 0)) ((0 0) (5 0)) ((2 2) (1 0)) ((3 2) (2 1))+    ((4 0) (2 0)) ((5 1) (1 2)))+  (uniq-orig k n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 2) (1 1)) ((3 1) (1 0)) ((3 1) (2 1)))+  (operation encryption-test (added-listener k) (enc "may I pass" k)+    (1 2))+  (strand-map 0 1 2 3 4)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv (enc "open" d o n-0 k))+      (load (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt "st" o o)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o)))+    ((send (enc "open" d o n-0 k))) ((recv k) (send k)))+  (label 19)+  (parent 16)+  (unrealized (0 1) (5 0))+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n n-0 text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-open 3 (d d) (k k) (n n-0) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (deflistener k)+  (precedes ((0 0) (3 0)) ((2 2) (1 0)) ((3 2) (4 0)) ((4 1) (2 0)))+  (uniq-orig k n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 2) (1 1)) ((3 1) (1 0)) ((3 1) (2 1)))+  (rule eff-dev-up-1 power-deliver-once trRl_dev-up-at-1)+  (operation nonce-test (added-strand dev-up 2) k (4 0)+    (ch-msg start-ch (cat "power-up" o k)))+  (strand-map 0 1 2 3 4)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv (enc "open" d o n-0 k))+      (load (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt "st" o o)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o))) ((recv k) (send k)))+  (label 20)+  (parent 17)+  (unrealized (0 1) (4 0))+  (dead)+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o))))+  (comment "empty cohort"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n n-0 text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-open 3 (d d) (k k) (n n-0) (o o))+  (defstrand owner-open 1 (d d) (k k) (n n-0) (o o))+  (defstrand user-pass 1 (k k))+  (defstrand dev-up 4 (d d) (k k) (o o) (start-ch start-ch))+  (precedes ((0 0) (5 0)) ((2 2) (1 0)) ((3 0) (2 0)) ((4 0) (1 2))+    ((5 2) (2 1)) ((5 3) (0 1)))+  (uniq-orig k n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 2) (1 1)) ((5 1) (1 0)) ((5 1) (2 1)))+  (rule power-deliver-once trRl_dev-up-at-1 trRl_dev-up-at-2)+  (operation encryption-test (added-strand dev-up 4) (enc "up" k) (0 1))+  (strand-map 0 1 2 4 5 3)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv (enc "open" d o n-0 k))+      (load (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt "st" o o)))+    ((send (enc "open" d o n-0 k))) ((send (enc "may I pass" k)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o)) (send (enc "up" k))))+  (label 21)+  (parent 18)+  (realized)+  (shape)+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o))))+  (origs (pt-0 (5 1)) (pt-1 (5 2)) (pt (2 2)) (n (1 3)) (k (0 0))))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n n-0 text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-open 3 (d d) (k k) (n n-0) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (defstrand owner-open 1 (d d) (k k) (n n-0) (o o))+  (defstrand user-pass 1 (k k))+  (deflistener k)+  (precedes ((0 0) (3 0)) ((0 0) (6 0)) ((2 2) (1 0)) ((3 2) (2 1))+    ((4 0) (2 0)) ((5 0) (1 2)) ((6 1) (0 1)))+  (uniq-orig k n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 2) (1 1)) ((3 1) (1 0)) ((3 1) (2 1)))+  (operation encryption-test (added-listener k) (enc "up" k) (0 1))+  (strand-map 0 1 2 3 4 5)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv (enc "open" d o n-0 k))+      (load (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt "st" o o)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o)))+    ((send (enc "open" d o n-0 k))) ((send (enc "may I pass" k)))+    ((recv k) (send k)))+  (label 22)+  (parent 18)+  (unrealized (6 0))+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n n-0 text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-open 3 (d d) (k k) (n n-0) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (defstrand owner-open 1 (d d) (k k) (n n-0) (o o))+  (deflistener k)+  (precedes ((0 0) (3 0)) ((2 2) (1 0)) ((3 2) (2 1)) ((3 2) (5 0))+    ((4 0) (2 0)) ((5 1) (1 2)))+  (uniq-orig k n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 2) (1 1)) ((3 1) (1 0)) ((3 1) (2 1)))+  (rule eff-dev-up-1 power-deliver-once trRl_dev-up-at-1)+  (operation nonce-test (added-strand dev-up 2) k (5 0)+    (ch-msg start-ch (cat "power-up" o k)))+  (strand-map 0 1 2 3 4 5)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv (enc "open" d o n-0 k))+      (load (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt "st" o o)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o)))+    ((send (enc "open" d o n-0 k))) ((recv k) (send k)))+  (label 23)+  (parent 19)+  (unrealized (0 1) (5 0))+  (dead)+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o))))+  (comment "empty cohort"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n n-0 text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand owner-power-dev 2 (k k) (o o) (start-ch start-ch))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-open 3 (d d) (k k) (n n-0) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (defstrand owner-open 1 (d d) (k k) (n n-0) (o o))+  (defstrand user-pass 1 (k k))+  (deflistener k)+  (precedes ((0 0) (3 0)) ((2 2) (1 0)) ((3 2) (2 1)) ((3 2) (6 0))+    ((4 0) (2 0)) ((5 0) (1 2)) ((6 1) (0 1)))+  (uniq-orig k n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 2) (1 1)) ((3 1) (1 0)) ((3 1) (2 1)))+  (rule eff-dev-up-1 power-deliver-once trRl_dev-up-at-1)+  (operation nonce-test (added-strand dev-up 2) k (6 0)+    (ch-msg start-ch (cat "power-up" o k)))+  (strand-map 0 1 2 3 4 5 6)+  (traces ((send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv (enc "open" d o n-0 k))+      (load (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt "st" o o)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o)))+    ((send (enc "open" d o n-0 k))) ((send (enc "may I pass" k)))+    ((recv k) (send k)))+  (label 24)+  (parent 22)+  (unrealized (6 0))+  (dead)+  (maps ((0 1) ((k k) (o o) (start-ch start-ch) (n n) (d d) (o-0 o))))+  (comment "empty cohort"))++(comment "Nothing left to do")++(defprotocol subatomic-open-closed basic+  (defrole dev-up+    (vars (k skey) (d dev) (o name) (start-ch chan))+    (trace (recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat "st-k" o k))+      (stor (cat d "ls") (cat "st" o)) (send (enc "up" k)))+    (auth start-ch))+  (defrole owner-power-dev+    (vars (k skey) (o name) (start-ch chan))+    (trace (send start-ch (cat "power-up" o k)) (recv (enc "up" k)))+    (conf start-ch))+  (defrole owner-open+    (vars (k skey) (n text) (d dev) (o name))+    (trace (send (enc "open" d o n k)) (recv n)))+  (defrole owner-close+    (vars (k skey) (n text) (d dev) (o name))+    (trace (send (enc "close" d o n k)) (recv n)))+  (defrole dev-open+    (vars (k skey) (n text) (d dev) (o name))+    (trace (recv (enc "open" d o n k))+      (load (cat d "lk") (cat "st-k" o k))+      (stor (cat d "ls") (cat "st" o o)) (send n))+    (gen-st (cat "st-k" o k) (cat "st" (cat o o))))+  (defrole dev-close+    (vars (k skey) (n text) (d dev) (o name))+    (trace (recv (enc "close" d o n k))+      (load (cat d "lk") (cat "st-k" o k))+      (stor (cat d "ls") (cat "st" o)) (send n))+    (gen-st (cat "st-k" o k)))+  (defrole dev-pass+    (vars (k skey) (n text) (d dev) (o name))+    (trace (load (cat d "lk") (cat "st-k" o k))+      (load (cat d "ls") (cat "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    (uniq-orig n)+    (gen-st (cat "st-k" o k) (cat "st" (cat o o))))+  (defrole user-pass+    (vars (k skey))+    (trace (send (enc "may I pass" k)) (recv (enc "you may pass" k))))+  (defrule power-deliver-once+    (forall ((z1 z2 strd) (k skey))+      (implies+        (and (p "dev-up" z2 (idx 2)) (p "dev-up" z1 (idx 2))+          (p "dev-up" "k" z2 k) (p "dev-up" "k" z1 k))+        (= z1 z2))))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (defgenrule scissorsRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (trans z2 i2)+          (leads-to z0 i0 z1 i1) (leads-to z0 i0 z2 i2))+        (and (= z1 z2) (= i1 i2)))))+  (defgenrule cakeRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (leads-to z0 i0 z1 i1)+          (leads-to z0 i0 z2 i2) (prec z1 i1 z2 i2)) (false))))+  (defgenrule no-interruption+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (leads-to z0 i0 z2 i2) (trans z1 i1)+          (same-locn z0 i0 z1 i1) (prec z0 i0 z1 i1) (prec z1 i1 z2 i2))+        (false))))+  (defgenrule discreteAfter+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z2 i2) (leads-to z0 i0 z1 i1)+          (same-locn z0 i0 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z1 z2) (= i1 i2)) (prec z1 i1 z2 i2)))))+  (defgenrule discreteBefore+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (same-locn z0 i0 z1 i1)+          (leads-to z1 i1 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z0 z1) (= i0 i1)) (prec z0 i0 z1 i1)))))+  (defgenrule trRl_dev-up-at-2+    (forall ((z strd))+      (implies (p "dev-up" z (idx 3)) (trans z (idx 2)))))+  (defgenrule trRl_dev-up-at-1+    (forall ((z strd))+      (implies (p "dev-up" z (idx 2)) (trans z (idx 1)))))+  (defgenrule trRl_dev-open-at-2+    (forall ((z strd))+      (implies (p "dev-open" z (idx 3)) (trans z (idx 2)))))+  (defgenrule trRl_dev-close-at-2+    (forall ((z strd))+      (implies (p "dev-close" z (idx 3)) (trans z (idx 2)))))+  (defgenrule eff-dev-up-1+    (forall ((i indx) (z1 z strd))+      (implies (and (p "dev-up" z (idx 2)) (prec z (idx 1) z1 i))+        (or (= z z1)+          (and (p "dev-up" z (idx 3)) (prec z (idx 2) z1 i))))))+  (defgenrule cau-dev-pass-1+    (forall ((i indx) (z1 z strd))+      (implies (and (p "dev-pass" z (idx 2)) (prec z1 i z (idx 1)))+        (or (= z z1) (prec z1 i z (idx 0))))))+  (defgenrule eff-dev-pass-2+    (forall ((i indx) (z1 z strd))+      (implies (and (p "dev-pass" z (idx 3)) (prec z (idx 2) z1 i))+        (or (= z z1)+          (and (p "dev-pass" z (idx 2)) (prec z (idx 1) z1 i))))))+  (defgenrule gen-st-dev-open-1+    (forall ((z strd) (o name) (k skey))+      (implies+        (and (p "dev-open" z (idx 1)) (p "dev-open" "k" z k)+          (p "dev-open" "o" z o)) (gen-st (cat "st-k" o k)))))+  (defgenrule gen-st-dev-open-0+    (forall ((z strd) (o name))+      (implies (and (p "dev-open" z (idx 1)) (p "dev-open" "o" z o))+        (gen-st (cat "st" o o)))))+  (defgenrule gen-st-dev-close-0+    (forall ((z strd) (o name) (k skey))+      (implies+        (and (p "dev-close" z (idx 1)) (p "dev-close" "k" z k)+          (p "dev-close" "o" z o)) (gen-st (cat "st-k" o k)))))+  (defgenrule gen-st-dev-pass-1+    (forall ((z strd) (o name) (k skey))+      (implies+        (and (p "dev-pass" z (idx 1)) (p "dev-pass" "k" z k)+          (p "dev-pass" "o" z o)) (gen-st (cat "st-k" o k)))))+  (defgenrule gen-st-dev-pass-0+    (forall ((z strd) (o name))+      (implies (and (p "dev-pass" z (idx 1)) (p "dev-pass" "o" z o))+        (gen-st (cat "st" o o))))))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o name) (pt pt-0 pval))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (uniq-orig n)+  (facts (no-state-split))+  (traces+    ((load (cat d "lk") (cat pt "st-k" o k))+      (load (cat d "ls") (cat pt-0 "st" o o))+      (recv (enc "may I pass" k)) (send (enc "you may pass" n k))))+  (label 25)+  (realized)+  (maps ((0) ((k k) (n n) (d d) (o o))))+  (origs (n (0 3)))+  (comment "Not closed under rules"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o name) (pt pt-0 pval))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (uniq-orig n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (facts (no-state-split))+  (rule gen-st-dev-pass-0 gen-st-dev-pass-1)+  (traces+    ((load (cat d "lk") (cat pt "st-k" o k))+      (load (cat d "ls") (cat pt-0 "st" o o))+      (recv (enc "may I pass" k)) (send (enc "you may pass" n k))))+  (label 26)+  (parent 25)+  (unrealized (0 0) (0 1))+  (maps ((0) ((k k) (n n) (d d) (o o))))+  (origs (n (0 3)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (precedes ((1 2) (0 0)))+  (uniq-orig n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((1 1) (0 0)))+  (rule eff-dev-up-1 trRl_dev-up-at-1 trRl_dev-up-at-2)+  (operation channel-test (added-strand dev-up 2)+    (ch-msg (cat d "lk") (cat pt-0 "st-k" o k)) (0 0))+  (strand-map 0)+  (traces+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o))))+  (label 27)+  (parent 26)+  (unrealized (0 1) (1 0))+  (maps ((0) ((k k) (n n) (d d) (o o))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (defstrand owner-power-dev 1 (k k) (o o) (start-ch start-ch))+  (precedes ((1 2) (0 0)) ((2 0) (1 0)))+  (uniq-orig n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((1 1) (0 0)))+  (operation channel-test (added-strand owner-power-dev 1)+    (ch-msg start-ch (cat "power-up" o k)) (1 0))+  (strand-map 0 1)+  (traces+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o)))+    ((send start-ch (cat "power-up" o k))))+  (label 28)+  (parent 27)+  (unrealized (0 1))+  (maps ((0) ((k k) (n n) (d d) (o o))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k k-0 skey) (n n-0 text) (o name)+    (pt pt-0 pt-1 pt-2 pval) (start-ch chan))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (defstrand owner-power-dev 1 (k k) (o o) (start-ch start-ch))+  (defstrand dev-open 3 (d d) (k k-0) (n n-0) (o o))+  (precedes ((1 2) (3 1)) ((2 0) (1 0)) ((3 2) (0 0)))+  (uniq-orig n)+  (gen-st (cat "st" o o) (cat "st-k" o k) (cat "st-k" o k-0))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((1 1) (0 0)) ((3 2) (0 1)))+  (rule cau-dev-pass-1 discreteBefore gen-st-dev-open-1+    trRl_dev-open-at-2)+  (operation channel-test (added-strand dev-open 3)+    (ch-msg (cat d "ls") (cat pt "st" o o)) (0 1))+  (strand-map 0 1 2)+  (traces+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o)))+    ((send start-ch (cat "power-up" o k)))+    ((recv (enc "open" d o n-0 k-0))+      (load (cat d "lk") (cat pt-2 "st-k" o k-0))+      (stor (cat d "ls") (cat pt "st" o o))))+  (label 29)+  (parent 28)+  (unrealized (3 1))+  (maps ((0) ((k k) (n n) (d d) (o o))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton subatomic-open-closed+  (vars (d dev) (k skey) (n n-0 text) (o name) (pt pt-0 pt-1 pval)+    (start-ch chan))+  (defstrand dev-pass 4 (d d) (k k) (n n) (o o))+  (defstrand owner-power-dev 1 (k k) (o o) (start-ch start-ch))+  (defstrand dev-open 3 (d d) (k k) (n n-0) (o o))+  (defstrand dev-up 3 (d d) (k k) (o o) (start-ch start-ch))+  (precedes ((1 0) (3 0)) ((2 2) (0 0)) ((3 2) (2 1)))+  (uniq-orig n)+  (gen-st (cat "st" o o) (cat "st-k" o k))+  (conf start-ch)+  (auth start-ch)+  (facts (no-state-split))+  (leads-to ((2 2) (0 1)) ((3 1) (0 0)) ((3 1) (2 1)))+  (rule discreteBefore eff-dev-up-1 trRl_dev-up-at-1 trRl_dev-up-at-2)+  (operation channel-test (added-strand dev-up 2)+    (ch-msg (cat d "lk") (cat pt-0 "st-k" o k)) (3 1))+  (strand-map 0 2 3 1)+  (traces+    ((load (cat d "lk") (cat pt-0 "st-k" o k))+      (load (cat d "ls") (cat pt "st" o o)) (recv (enc "may I pass" k))+      (send (enc "you may pass" n k)))+    ((send start-ch (cat "power-up" o k)))+    ((recv (enc "open" d o n-0 k))+      (load (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt "st" o o)))+    ((recv start-ch (cat "power-up" o k))+      (stor (cat d "lk") (cat pt-0 "st-k" o k))+      (stor (cat d "ls") (cat pt-1 "st" o))))+  (label 30)+  (parent 29)+  (realized)+  (shape)+  (maps ((0) ((k k) (n n) (d d) (o o))))+  (origs (pt-0 (3 1)) (pt-1 (3 2)) (pt (2 2)) (n (0 3))))++(comment "Nothing left to do")
+ tst/devlocn.scm view
@@ -0,0 +1,108 @@+(herald "Dev and Locn" +  (comment "This tests the feature that allows loads and stors to have any message in their location position."))++(defprotocol devlocn basic+  (defrole init+    (vars (d dev) (l1 l2 locn) (n1 n2 data) (k skey))+    (trace+     (stor (cat d l1) n1)+     (stor (cat d l2) n2)+     (send (enc d l1 k))+     (send (enc d l2 k)))+    (uniq-orig n1 n2 d))+  (defrole resp+    (vars (d dev) (l locn) (m mesg) (k skey))+    (trace+     (recv (enc d l k))+     (load (cat d l) m)+     (send m))+    (non-orig k))) ++(defskeleton devlocn+  (vars (n1 n2 data))+  (defstrand init 2 (n1 n1) (n2 n2))+  (deflistener n1)+  (deflistener n2))++(defprotocol devlocn basic+  (defrole init+    (vars (d dev) (l1 l2 locn) (n1 n2 data) (k skey))+    (trace+     (stor (cat d l1) n1)+     (send (enc d l1 k)))+    (uniq-orig n1 l1))+  (defrole resp+    (vars (d dev) (l locn) (m mesg) (k skey))+    (trace+     (recv (enc d l k))+     (load (cat d l) m)+     (send m))+    (non-orig k))) ++(defskeleton devlocn+  (vars (n1 n2 data))+  (defstrand init 1 (n1 n1))+  (defstrand init 1 (n1 n2))+  (deflistener n1)+  (deflistener n2))++(defskeleton devlocn+  (vars (n1 n2 data) (d1 d2 dev))+  (defstrand init 1 (n1 n1) (d d1))+  (defstrand init 1 (n1 n2) (d d2))+  (deflistener n1)+  (deflistener n2)+  (facts (neq d1 d2))+  (comment "With different devices they cannot have the same source."))++(defskeleton devlocn+  (vars (n1 n2 data) (l1 l2 locn))+  (defstrand init 1 (n1 n1) (l1 l1))+  (defstrand init 1 (n1 n2) (l1 l2))+  (deflistener n1)+  (deflistener n2)+  (facts (neq l1 l2))+  (comment "With different locns they cannot have the same source."))++(defskeleton devlocn+  (vars (n1 n2 data) (l1 l2 locn) (d dev))+  (defstrand init 1 (n1 n1) (l1 l1) (d d))+  (defstrand init 1 (n1 n2) (l1 l2) (d d))+  (deflistener n1)+  (deflistener n2)+  (facts (neq l1 l2))+  (comment "With different locns they cannot have the same source even if the devs are the same."))+++(defprotocol devlocn basic+  (defrole init+    (vars (d dev) (l1 l2 locn) (n1 n2 data) (k skey))+    (trace+     (stor (cat d l1) n1)+     (send (enc d l1 k)))+    (uniq-orig n1 l1))+  (defrole resp+    (vars (d dev) (l locn) (dl m mesg) (k skey))+    (trace+     (recv (enc dl k))+     (load dl m)+     (send m)+     )+    (non-orig k))+  (comment "Notice the mesg var dl as location for load. Only allowed because it is acquired."))++(defskeleton devlocn+  (vars (m mesg))+  (defstrand resp 2 (m m))+  (gen-st m))++(defskeleton devlocn+  (vars (m mesg))+  (defstrand resp 2 (m m))+  (comment "Possibly strange interpretation. Init has uniq-orig n1 and l1. Resp doesn't necessarily retrieve n1, even though nobody but Init should know l1, so nobody else could stor into it."))++(defskeleton devlocn+  (vars (n data))+  (defstrand resp 2 (m n))+  (defstrand init 2 (n1 n))+  (comment "Even if loaded value is not gen-st, since it's uniq-orig, nonce-test still applies."))
+ tst/devlocn.tst view
@@ -0,0 +1,1861 @@+(herald "Dev and Locn"+  (comment+    "This tests the feature that allows loads and stors to have any message in their location position."))++(comment "CPSA 4.4.9")+(comment "All input read from tst/devlocn.scm")++(defprotocol devlocn basic+  (defrole init+    (vars (d dev) (l1 l2 locn) (n1 n2 data) (k skey))+    (trace (stor (cat d l1) n1) (stor (cat d l2) n2) (send (enc d l1 k))+      (send (enc d l2 k)))+    (uniq-orig n1 n2 d))+  (defrole resp+    (vars (d dev) (l locn) (m mesg) (k skey))+    (trace (recv (enc d l k)) (load (cat d l) m) (send m))+    (non-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (defgenrule scissorsRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (trans z2 i2)+          (leads-to z0 i0 z1 i1) (leads-to z0 i0 z2 i2))+        (and (= z1 z2) (= i1 i2)))))+  (defgenrule cakeRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (leads-to z0 i0 z1 i1)+          (leads-to z0 i0 z2 i2) (prec z1 i1 z2 i2)) (false))))+  (defgenrule no-interruption+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (leads-to z0 i0 z2 i2) (trans z1 i1)+          (same-locn z0 i0 z1 i1) (prec z0 i0 z1 i1) (prec z1 i1 z2 i2))+        (false))))+  (defgenrule discreteAfter+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z2 i2) (leads-to z0 i0 z1 i1)+          (same-locn z0 i0 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z1 z2) (= i1 i2)) (prec z1 i1 z2 i2)))))+  (defgenrule discreteBefore+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (same-locn z0 i0 z1 i1)+          (leads-to z1 i1 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z0 z1) (= i0 i1)) (prec z0 i0 z1 i1)))))+  (defgenrule trRl_init-at-1+    (forall ((z strd))+      (implies (p "init" z (idx 2)) (trans z (idx 1)))))+  (defgenrule trRl_init-at-0+    (forall ((z strd))+      (implies (p "init" z (idx 1)) (trans z (idx 0)))))+  (defgenrule eff-init-0+    (forall ((i indx) (z1 z strd))+      (implies (and (p "init" z (idx 1)) (prec z (idx 0) z1 i))+        (or (= z z1)+          (and (p "init" z (idx 2)) (prec z (idx 1) z1 i))))))+  (defgenrule eff-resp-2+    (forall ((i indx) (z1 z strd))+      (implies (and (p "resp" z (idx 3)) (prec z (idx 2) z1 i))+        (or (= z z1)+          (and (p "resp" z (idx 2)) (prec z (idx 1) z1 i)))))))++(defskeleton devlocn+  (vars (n1 n2 data) (d dev) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 2 (n1 n1) (n2 n2) (d d) (l1 l1) (l2 l2))+  (deflistener n1)+  (deflistener n2)+  (uniq-orig n1 n2)+  (traces+    ((stor (cat d l1) (cat pt n1)) (stor (cat d l2) (cat pt-0 n2)))+    ((recv n1) (send n1)) ((recv n2) (send n2)))+  (label 0)+  (unrealized (1 0) (2 0))+  (preskeleton)+  (maps ((0 1 2) ((n1 n1) (n2 n2) (d d) (l1 l1) (l2 l2))))+  (origs (pt-0 (0 1)) (pt (0 0)) (n2 (0 1)) (n1 (0 0)))+  (comment "Not a skeleton"))++(defskeleton devlocn+  (vars (n1 n2 data) (d dev) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 2 (n1 n1) (n2 n2) (d d) (l1 l1) (l2 l2))+  (deflistener n1)+  (deflistener n2)+  (precedes ((0 0) (1 0)) ((0 1) (2 0)))+  (uniq-orig n1 n2)+  (traces+    ((stor (cat d l1) (cat pt n1)) (stor (cat d l2) (cat pt-0 n2)))+    ((recv n1) (send n1)) ((recv n2) (send n2)))+  (label 1)+  (parent 0)+  (unrealized (1 0) (2 0))+  (maps ((0 1 2) ((n1 n1) (n2 n2) (d d) (l1 l1) (l2 l2))))+  (origs (pt-0 (0 1)) (pt (0 0)) (n2 (0 1)) (n1 (0 0)))+  (comment "Not closed under rules"))++(defskeleton devlocn+  (vars (n1 n2 data) (d dev) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 2 (n1 n1) (n2 n2) (d d) (l1 l1) (l2 l2))+  (deflistener n1)+  (deflistener n2)+  (precedes ((0 1) (1 0)) ((0 1) (2 0)))+  (uniq-orig n1 n2)+  (rule eff-init-0 trRl_init-at-0 trRl_init-at-1)+  (traces+    ((stor (cat d l1) (cat pt n1)) (stor (cat d l2) (cat pt-0 n2)))+    ((recv n1) (send n1)) ((recv n2) (send n2)))+  (label 2)+  (parent 1)+  (unrealized (1 0) (2 0))+  (maps ((0 1 2) ((n1 n1) (n2 n2) (d d) (l1 l1) (l2 l2))))+  (origs (n1 (0 0)) (n2 (0 1)) (pt (0 0)) (pt-0 (0 1)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n2 data) (d dev) (k skey) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 2 (n1 n1) (n2 n2) (d d) (l1 l1) (l2 l2))+  (deflistener n1)+  (deflistener n2)+  (defstrand resp 3 (m n2) (d d) (k k) (l l2))+  (precedes ((0 1) (1 0)) ((0 1) (3 1)) ((3 2) (2 0)))+  (non-orig k)+  (uniq-orig n1 n2)+  (leads-to ((0 1) (3 1)))+  (operation nonce-test (added-strand resp 3) n2 (2 0)+    (ch-msg (cat d l2) (cat pt-0 n2)))+  (strand-map 0 1 2)+  (traces+    ((stor (cat d l1) (cat pt n1)) (stor (cat d l2) (cat pt-0 n2)))+    ((recv n1) (send n1)) ((recv n2) (send n2))+    ((recv (enc d l2 k)) (load (cat d l2) (cat pt-0 n2)) (send n2)))+  (label 3)+  (parent 2)+  (unrealized (1 0) (3 0))+  (maps ((0 1 2) ((n1 n1) (n2 n2) (d d) (l1 l1) (l2 l2))))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton devlocn+  (vars (n1 n2 data) (d dev) (k skey) (pt pt-0 pval) (l2 l1 locn))+  (deflistener n1)+  (deflistener n2)+  (defstrand resp 3 (m n2) (d d) (k k) (l l2))+  (defstrand init 4 (n1 n1) (n2 n2) (d d) (k k) (l1 l1) (l2 l2))+  (precedes ((2 2) (1 0)) ((3 1) (0 0)) ((3 3) (2 0)))+  (non-orig k)+  (uniq-orig n1 n2 d)+  (leads-to ((3 1) (2 1)))+  (rule discreteBefore trRl_init-at-0 trRl_init-at-1)+  (operation encryption-test (added-strand init 4) (enc d l2 k) (3 0))+  (strand-map 1 2 3 0)+  (traces ((recv n1) (send n1)) ((recv n2) (send n2))+    ((recv (enc d l2 k)) (load (cat d l2) (cat pt-0 n2)) (send n2))+    ((stor (cat d l1) (cat pt n1)) (stor (cat d l2) (cat pt-0 n2))+      (send (enc d l1 k)) (send (enc d l2 k))))+  (label 4)+  (parent 3)+  (unrealized (0 0))+  (maps ((3 0 1) ((n1 n1) (n2 n2) (d d) (l1 l1) (l2 l2))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n2 data) (d dev) (k skey) (pt pt-0 pval) (l2 locn))+  (deflistener n1)+  (deflistener n2)+  (defstrand resp 3 (m n2) (d d) (k k) (l l2))+  (defstrand init 3 (n1 n1) (n2 n2) (d d) (k k) (l1 l2) (l2 l2))+  (precedes ((2 2) (1 0)) ((3 1) (0 0)) ((3 2) (2 0)))+  (non-orig k)+  (uniq-orig n1 n2 d)+  (leads-to ((3 1) (2 1)))+  (operation encryption-test (displaced 0 4 init 3) (enc d l2-0 k)+    (3 0))+  (strand-map 3 0 1 2)+  (traces ((recv n1) (send n1)) ((recv n2) (send n2))+    ((recv (enc d l2 k)) (load (cat d l2) (cat pt-0 n2)) (send n2))+    ((stor (cat d l2) (cat pt n1)) (stor (cat d l2) (cat pt-0 n2))+      (send (enc d l2 k))))+  (label 5)+  (parent 3)+  (unrealized (0 0))+  (dead)+  (maps ((3 0 1) ((n1 n1) (n2 n2) (d d) (l1 l2) (l2 l2))))+  (comment "empty cohort"))++(defskeleton devlocn+  (vars (n1 n2 data) (d dev) (k k-0 skey) (pt pt-0 pval) (l2 l1 locn))+  (deflistener n1)+  (deflistener n2)+  (defstrand resp 3 (m n2) (d d) (k k) (l l2))+  (defstrand init 4 (n1 n1) (n2 n2) (d d) (k k) (l1 l1) (l2 l2))+  (defstrand resp 3 (m n1) (d d) (k k-0) (l l1))+  (precedes ((2 2) (1 0)) ((3 2) (4 0)) ((3 3) (2 0)) ((4 2) (0 0)))+  (non-orig k k-0)+  (uniq-orig n1 n2 d)+  (leads-to ((3 0) (4 1)) ((3 1) (2 1)))+  (operation nonce-test (added-strand resp 3) n1 (0 0)+    (ch-msg (cat d l1) (cat pt n1)))+  (strand-map 0 1 2 3)+  (traces ((recv n1) (send n1)) ((recv n2) (send n2))+    ((recv (enc d l2 k)) (load (cat d l2) (cat pt-0 n2)) (send n2))+    ((stor (cat d l1) (cat pt n1)) (stor (cat d l2) (cat pt-0 n2))+      (send (enc d l1 k)) (send (enc d l2 k)))+    ((recv (enc d l1 k-0)) (load (cat d l1) (cat pt n1)) (send n1)))+  (label 6)+  (parent 4)+  (unrealized (4 0))+  (maps ((3 0 1) ((n1 n1) (n2 n2) (d d) (l1 l1) (l2 l2))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n2 data) (d dev) (k skey) (pt pt-0 pval) (l2 l1 locn))+  (deflistener n1)+  (deflistener n2)+  (defstrand resp 3 (m n2) (d d) (k k) (l l2))+  (defstrand init 4 (n1 n1) (n2 n2) (d d) (k k) (l1 l1) (l2 l2))+  (defstrand resp 3 (m n1) (d d) (k k) (l l1))+  (precedes ((2 2) (1 0)) ((3 2) (4 0)) ((3 3) (2 0)) ((4 2) (0 0)))+  (non-orig k)+  (uniq-orig n1 n2 d)+  (leads-to ((3 0) (4 1)) ((3 1) (2 1)))+  (operation encryption-test (displaced 5 3 init 3) (enc d l1 k-0)+    (4 0))+  (strand-map 0 1 2 3 4)+  (traces ((recv n1) (send n1)) ((recv n2) (send n2))+    ((recv (enc d l2 k)) (load (cat d l2) (cat pt-0 n2)) (send n2))+    ((stor (cat d l1) (cat pt n1)) (stor (cat d l2) (cat pt-0 n2))+      (send (enc d l1 k)) (send (enc d l2 k)))+    ((recv (enc d l1 k)) (load (cat d l1) (cat pt n1)) (send n1)))+  (label 7)+  (parent 6)+  (realized)+  (shape)+  (maps ((3 0 1) ((n1 n1) (n2 n2) (d d) (l1 l1) (l2 l2))))+  (origs (n1 (3 0)) (n2 (3 1)) (d (3 2)) (pt (3 0)) (pt-0 (3 1))))++(comment "Nothing left to do")++(defprotocol devlocn basic+  (defrole init+    (vars (d dev) (l1 locn) (n1 data) (k skey))+    (trace (stor (cat d l1) n1) (send (enc d l1 k)))+    (uniq-orig n1 l1))+  (defrole resp+    (vars (d dev) (l locn) (m mesg) (k skey))+    (trace (recv (enc d l k)) (load (cat d l) m) (send m))+    (non-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (defgenrule scissorsRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (trans z2 i2)+          (leads-to z0 i0 z1 i1) (leads-to z0 i0 z2 i2))+        (and (= z1 z2) (= i1 i2)))))+  (defgenrule cakeRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (leads-to z0 i0 z1 i1)+          (leads-to z0 i0 z2 i2) (prec z1 i1 z2 i2)) (false))))+  (defgenrule no-interruption+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (leads-to z0 i0 z2 i2) (trans z1 i1)+          (same-locn z0 i0 z1 i1) (prec z0 i0 z1 i1) (prec z1 i1 z2 i2))+        (false))))+  (defgenrule discreteAfter+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z2 i2) (leads-to z0 i0 z1 i1)+          (same-locn z0 i0 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z1 z2) (= i1 i2)) (prec z1 i1 z2 i2)))))+  (defgenrule discreteBefore+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (same-locn z0 i0 z1 i1)+          (leads-to z1 i1 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z0 z1) (= i0 i1)) (prec z0 i0 z1 i1)))))+  (defgenrule trRl_init-at-0+    (forall ((z strd))+      (implies (p "init" z (idx 1)) (trans z (idx 0)))))+  (defgenrule eff-resp-2+    (forall ((i indx) (z1 z strd))+      (implies (and (p "resp" z (idx 3)) (prec z (idx 2) z1 i))+        (or (= z z1)+          (and (p "resp" z (idx 2)) (prec z (idx 1) z1 i)))))))++(defskeleton devlocn+  (vars (n1 n2 data) (d d-0 dev) (pt pt-0 pval) (l1 l1-0 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (defstrand init 1 (n1 n2) (d d-0) (l1 l1-0))+  (deflistener n1)+  (deflistener n2)+  (uniq-orig n1 n2)+  (traces ((stor (cat d l1) (cat pt n1)))+    ((stor (cat d-0 l1-0) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2)))+  (label 8)+  (unrealized (2 0) (3 0))+  (preskeleton)+  (maps+    ((0 1 2 3) ((n1 n1) (n2 n2) (d d) (l1 l1) (d-0 d-0) (l1-0 l1-0))))+  (origs (pt-0 (1 0)) (n2 (1 0)) (pt (0 0)) (n1 (0 0)))+  (comment "Not a skeleton"))++(defskeleton devlocn+  (vars (n1 n2 data) (d d-0 dev) (pt pt-0 pval) (l1 l1-0 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (defstrand init 1 (n1 n2) (d d-0) (l1 l1-0))+  (deflistener n1)+  (deflistener n2)+  (precedes ((0 0) (2 0)) ((1 0) (3 0)))+  (uniq-orig n1 n2)+  (traces ((stor (cat d l1) (cat pt n1)))+    ((stor (cat d-0 l1-0) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2)))+  (label 9)+  (parent 8)+  (unrealized (2 0) (3 0))+  (maps+    ((0 1 2 3) ((n1 n1) (n2 n2) (d d) (l1 l1) (d-0 d-0) (l1-0 l1-0))))+  (origs (pt-0 (1 0)) (n2 (1 0)) (pt (0 0)) (n1 (0 0)))+  (comment "Not closed under rules"))++(defskeleton devlocn+  (vars (n1 n2 data) (d d-0 dev) (pt pt-0 pval) (l1 l1-0 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (defstrand init 1 (n1 n2) (d d-0) (l1 l1-0))+  (deflistener n1)+  (deflistener n2)+  (precedes ((0 0) (2 0)) ((1 0) (3 0)))+  (uniq-orig n1 n2)+  (rule trRl_init-at-0)+  (traces ((stor (cat d l1) (cat pt n1)))+    ((stor (cat d-0 l1-0) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2)))+  (label 10)+  (parent 9)+  (unrealized (2 0) (3 0))+  (maps+    ((0 1 2 3) ((n1 n1) (n2 n2) (d d) (l1 l1) (d-0 d-0) (l1-0 l1-0))))+  (origs (pt-0 (1 0)) (n2 (1 0)) (pt (0 0)) (n1 (0 0)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 data) (d dev) (pt pval) (l1 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (deflistener n1)+  (deflistener n1)+  (precedes ((0 0) (1 0)) ((0 0) (2 0)))+  (uniq-orig n1)+  (operation collapsed 1 0)+  (strand-map 0 0 1 2)+  (traces ((stor (cat d l1) (cat pt n1))) ((recv n1) (send n1))+    ((recv n1) (send n1)))+  (label 11)+  (parent 10)+  (unrealized (1 0) (2 0))+  (maps ((0 0 1 2) ((n1 n1) (n2 n1) (d d) (l1 l1) (d-0 d) (l1-0 l1))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 data) (d dev) (pt pval) (l1 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (deflistener n1)+  (precedes ((0 0) (1 0)))+  (uniq-orig n1)+  (operation collapsed 2 1)+  (strand-map 0 1 1)+  (traces ((stor (cat d l1) (cat pt n1))) ((recv n1) (send n1)))+  (label 12)+  (parent 11)+  (unrealized (1 0))+  (maps ((0 0 1 1) ((n1 n1) (n2 n1) (d d) (l1 l1) (d-0 d) (l1-0 l1))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n2 data) (d d-0 dev) (k skey) (pt pt-0 pval) (l1 l1-0 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (defstrand init 1 (n1 n2) (d d-0) (l1 l1-0))+  (deflistener n1)+  (deflistener n2)+  (defstrand resp 3 (m n2) (d d-0) (k k) (l l1-0))+  (precedes ((0 0) (2 0)) ((1 0) (4 1)) ((4 2) (3 0)))+  (non-orig k)+  (uniq-orig n1 n2)+  (leads-to ((1 0) (4 1)))+  (operation nonce-test (added-strand resp 3) n2 (3 0)+    (ch-msg (cat d-0 l1-0) (cat pt-0 n2)))+  (strand-map 0 1 2 3)+  (traces ((stor (cat d l1) (cat pt n1)))+    ((stor (cat d-0 l1-0) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2))+    ((recv (enc d-0 l1-0 k)) (load (cat d-0 l1-0) (cat pt-0 n2))+      (send n2)))+  (label 13)+  (parent 10)+  (unrealized (2 0) (4 0))+  (maps+    ((0 1 2 3) ((n1 n1) (n2 n2) (d d) (l1 l1) (d-0 d-0) (l1-0 l1-0))))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton devlocn+  (vars (n1 data) (d dev) (k skey) (pt pval) (l1 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (deflistener n1)+  (deflistener n1)+  (defstrand resp 3 (m n1) (d d) (k k) (l l1))+  (precedes ((0 0) (1 0)) ((0 0) (3 1)) ((3 2) (2 0)))+  (non-orig k)+  (uniq-orig n1)+  (leads-to ((0 0) (3 1)))+  (operation nonce-test (added-strand resp 3) n1 (2 0)+    (ch-msg (cat d l1) (cat pt n1)))+  (strand-map 0 1 2)+  (traces ((stor (cat d l1) (cat pt n1))) ((recv n1) (send n1))+    ((recv n1) (send n1))+    ((recv (enc d l1 k)) (load (cat d l1) (cat pt n1)) (send n1)))+  (label 14)+  (parent 11)+  (seen 16)+  (seen-ops+    (16+      (operation encryption-test (added-strand init 2) (enc d l1 k)+        (3 0)) (strand-map 1 2 3 0)))+  (unrealized (1 0) (3 0))+  (maps ((0 0 1 2) ((n1 n1) (n2 n1) (d d) (l1 l1) (d-0 d) (l1-0 l1))))+  (origs (pt (0 0)) (n1 (0 0)))+  (comment "1 in cohort - 0 not yet seen"))++(defskeleton devlocn+  (vars (n1 data) (d dev) (k skey) (pt pval) (l1 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (deflistener n1)+  (defstrand resp 3 (m n1) (d d) (k k) (l l1))+  (precedes ((0 0) (2 1)) ((2 2) (1 0)))+  (non-orig k)+  (uniq-orig n1)+  (leads-to ((0 0) (2 1)))+  (operation nonce-test (added-strand resp 3) n1 (1 0)+    (ch-msg (cat d l1) (cat pt n1)))+  (strand-map 0 1)+  (traces ((stor (cat d l1) (cat pt n1))) ((recv n1) (send n1))+    ((recv (enc d l1 k)) (load (cat d l1) (cat pt n1)) (send n1)))+  (label 15)+  (parent 12)+  (unrealized (2 0))+  (maps ((0 0 1 1) ((n1 n1) (n2 n1) (d d) (l1 l1) (d-0 d) (l1-0 l1))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 data) (d dev) (k skey) (pt pval) (l1 locn))+  (deflistener n1)+  (deflistener n1)+  (defstrand resp 3 (m n1) (d d) (k k) (l l1))+  (defstrand init 2 (n1 n1) (d d) (k k) (l1 l1))+  (precedes ((2 2) (1 0)) ((3 0) (0 0)) ((3 1) (2 0)))+  (non-orig k)+  (uniq-orig n1 l1)+  (leads-to ((3 0) (2 1)))+  (rule discreteBefore)+  (operation encryption-test (displaced 0 5 init 2) (enc d l1 k) (4 0))+  (strand-map 3 3 0 1 2)+  (traces ((recv n1) (send n1)) ((recv n1) (send n1))+    ((recv (enc d l1 k)) (load (cat d l1) (cat pt n1)) (send n1))+    ((stor (cat d l1) (cat pt n1)) (send (enc d l1 k))))+  (label 16)+  (parent 13)+  (unrealized (0 0))+  (maps ((3 3 0 1) ((n1 n1) (n2 n1) (d d) (l1 l1) (d-0 d) (l1-0 l1))))+  (origs (n1 (3 0)) (l1 (3 1)) (pt (3 0)))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton devlocn+  (vars (n1 n1-0 data) (d d-0 dev) (k skey) (pt pt-0 pval)+    (l1 l1-0 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (deflistener n1)+  (deflistener n1-0)+  (defstrand resp 3 (m n1-0) (d d-0) (k k) (l l1-0))+  (defstrand init 2 (n1 n1-0) (d d-0) (k k) (l1 l1-0))+  (precedes ((0 0) (1 0)) ((3 2) (2 0)) ((4 1) (3 0)))+  (non-orig k)+  (uniq-orig n1 n1-0 l1-0)+  (leads-to ((4 0) (3 1)))+  (rule discreteBefore trRl_init-at-0)+  (operation encryption-test (added-strand init 2) (enc d-0 l1-0 k)+    (4 0))+  (strand-map 0 2 3 4 1)+  (traces ((stor (cat d l1) (cat pt n1))) ((recv n1) (send n1))+    ((recv n1-0) (send n1-0))+    ((recv (enc d-0 l1-0 k)) (load (cat d-0 l1-0) (cat pt-0 n1-0))+      (send n1-0))+    ((stor (cat d-0 l1-0) (cat pt-0 n1-0)) (send (enc d-0 l1-0 k))))+  (label 17)+  (parent 13)+  (unrealized (1 0))+  (maps+    ((0 4 1 2) ((n1 n1) (n2 n1-0) (d d) (l1 l1) (d-0 d-0) (l1-0 l1-0))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 data) (d dev) (k skey) (pt pval) (l1 locn))+  (deflistener n1)+  (defstrand resp 3 (m n1) (d d) (k k) (l l1))+  (defstrand init 2 (n1 n1) (d d) (k k) (l1 l1))+  (precedes ((1 2) (0 0)) ((2 1) (1 0)))+  (non-orig k)+  (uniq-orig n1 l1)+  (leads-to ((2 0) (1 1)))+  (rule discreteBefore trRl_init-at-0)+  (operation encryption-test (added-strand init 2) (enc d l1 k) (2 0))+  (strand-map 1 2 0)+  (traces ((recv n1) (send n1))+    ((recv (enc d l1 k)) (load (cat d l1) (cat pt n1)) (send n1))+    ((stor (cat d l1) (cat pt n1)) (send (enc d l1 k))))+  (label 18)+  (parent 15)+  (realized)+  (shape)+  (maps ((2 2 0 0) ((n1 n1) (n2 n1) (d d) (l1 l1) (d-0 d) (l1-0 l1))))+  (origs (n1 (2 0)) (l1 (2 1)) (pt (2 0))))++(defskeleton devlocn+  (vars (n1 data) (d dev) (k skey) (pt pval) (l1 locn))+  (deflistener n1)+  (deflistener n1)+  (defstrand resp 3 (m n1) (d d) (k k) (l l1))+  (defstrand init 2 (n1 n1) (d d) (k k) (l1 l1))+  (precedes ((2 2) (0 0)) ((2 2) (1 0)) ((3 1) (2 0)))+  (non-orig k)+  (uniq-orig n1 l1)+  (leads-to ((3 0) (2 1)))+  (operation nonce-test (displaced 4 2 resp 3) n1 (0 0)+    (ch-msg (cat d l1) (cat pt n1)))+  (strand-map 0 1 2 3)+  (traces ((recv n1) (send n1)) ((recv n1) (send n1))+    ((recv (enc d l1 k)) (load (cat d l1) (cat pt n1)) (send n1))+    ((stor (cat d l1) (cat pt n1)) (send (enc d l1 k))))+  (label 19)+  (parent 16)+  (realized)+  (shape)+  (maps ((3 3 0 1) ((n1 n1) (n2 n1) (d d) (l1 l1) (d-0 d) (l1-0 l1))))+  (origs (n1 (3 0)) (l1 (3 1)) (pt (3 0))))++(defskeleton devlocn+  (vars (n1 data) (d dev) (k k-0 skey) (pt pval) (l1 locn))+  (deflistener n1)+  (deflistener n1)+  (defstrand resp 3 (m n1) (d d) (k k) (l l1))+  (defstrand init 2 (n1 n1) (d d) (k k) (l1 l1))+  (defstrand resp 3 (m n1) (d d) (k k-0) (l l1))+  (precedes ((2 2) (1 0)) ((3 1) (2 0)) ((3 1) (4 0)) ((4 2) (0 0)))+  (non-orig k k-0)+  (uniq-orig n1 l1)+  (leads-to ((3 0) (2 1)) ((3 0) (4 1)))+  (operation nonce-test (added-strand resp 3) n1 (0 0)+    (ch-msg (cat d l1) (cat pt n1)))+  (strand-map 0 1 2 3)+  (traces ((recv n1) (send n1)) ((recv n1) (send n1))+    ((recv (enc d l1 k)) (load (cat d l1) (cat pt n1)) (send n1))+    ((stor (cat d l1) (cat pt n1)) (send (enc d l1 k)))+    ((recv (enc d l1 k-0)) (load (cat d l1) (cat pt n1)) (send n1)))+  (label 20)+  (parent 16)+  (unrealized (4 0))+  (maps ((3 3 0 1) ((n1 n1) (n2 n1) (d d) (l1 l1) (d-0 d) (l1-0 l1))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n1-0 data) (d d-0 dev) (k k-0 skey) (pt pt-0 pval)+    (l1 l1-0 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (deflistener n1)+  (deflistener n1-0)+  (defstrand resp 3 (m n1-0) (d d-0) (k k) (l l1-0))+  (defstrand init 2 (n1 n1-0) (d d-0) (k k) (l1 l1-0))+  (defstrand resp 3 (m n1) (d d) (k k-0) (l l1))+  (precedes ((0 0) (5 1)) ((3 2) (2 0)) ((4 1) (3 0)) ((5 2) (1 0)))+  (non-orig k k-0)+  (uniq-orig n1 n1-0 l1-0)+  (leads-to ((0 0) (5 1)) ((4 0) (3 1)))+  (operation nonce-test (added-strand resp 3) n1 (1 0)+    (ch-msg (cat d l1) (cat pt n1)))+  (strand-map 0 1 2 3 4)+  (traces ((stor (cat d l1) (cat pt n1))) ((recv n1) (send n1))+    ((recv n1-0) (send n1-0))+    ((recv (enc d-0 l1-0 k)) (load (cat d-0 l1-0) (cat pt-0 n1-0))+      (send n1-0))+    ((stor (cat d-0 l1-0) (cat pt-0 n1-0)) (send (enc d-0 l1-0 k)))+    ((recv (enc d l1 k-0)) (load (cat d l1) (cat pt n1)) (send n1)))+  (label 21)+  (parent 17)+  (seen 22)+  (seen-ops+    (22+      (operation encryption-test (displaced 6 4 init 2)+        (enc d-0 l1-0 k-0) (5 0)) (strand-map 3 0 1 2 3 4)))+  (unrealized (5 0))+  (maps+    ((0 4 1 2) ((n1 n1) (n2 n1-0) (d d) (l1 l1) (d-0 d-0) (l1-0 l1-0))))+  (comment "2 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 data) (d dev) (k skey) (pt pval) (l1 locn))+  (deflistener n1)+  (deflistener n1)+  (defstrand resp 3 (m n1) (d d) (k k) (l l1))+  (defstrand init 2 (n1 n1) (d d) (k k) (l1 l1))+  (defstrand resp 3 (m n1) (d d) (k k) (l l1))+  (precedes ((2 2) (1 0)) ((3 1) (2 0)) ((3 1) (4 0)) ((4 2) (0 0)))+  (non-orig k)+  (uniq-orig n1 l1)+  (leads-to ((3 0) (2 1)) ((3 0) (4 1)))+  (operation encryption-test (displaced 5 3 init 2) (enc d l1 k-0)+    (4 0))+  (strand-map 0 1 2 3 4)+  (traces ((recv n1) (send n1)) ((recv n1) (send n1))+    ((recv (enc d l1 k)) (load (cat d l1) (cat pt n1)) (send n1))+    ((stor (cat d l1) (cat pt n1)) (send (enc d l1 k)))+    ((recv (enc d l1 k)) (load (cat d l1) (cat pt n1)) (send n1)))+  (label 22)+  (parent 20)+  (realized)+  (shape)+  (maps ((3 3 0 1) ((n1 n1) (n2 n1) (d d) (l1 l1) (d-0 d) (l1-0 l1))))+  (origs (n1 (3 0)) (l1 (3 1)) (pt (3 0))))++(defskeleton devlocn+  (vars (n1 n1-0 data) (d d-0 dev) (k k-0 skey) (pt pt-0 pval)+    (l1 l1-0 locn))+  (deflistener n1-0)+  (deflistener n1)+  (defstrand resp 3 (m n1) (d d-0) (k k) (l l1-0))+  (defstrand init 2 (n1 n1) (d d-0) (k k) (l1 l1-0))+  (defstrand resp 3 (m n1-0) (d d) (k k-0) (l l1))+  (defstrand init 2 (n1 n1-0) (d d) (k k-0) (l1 l1))+  (precedes ((2 2) (1 0)) ((3 1) (2 0)) ((4 2) (0 0)) ((5 1) (4 0)))+  (non-orig k k-0)+  (uniq-orig n1 n1-0 l1 l1-0)+  (leads-to ((3 0) (2 1)) ((5 0) (4 1)))+  (rule discreteBefore trRl_init-at-0)+  (operation encryption-test (added-strand init 2) (enc d l1 k-0) (5 0))+  (strand-map 1 2 3 4 5 0)+  (traces ((recv n1-0) (send n1-0)) ((recv n1) (send n1))+    ((recv (enc d-0 l1-0 k)) (load (cat d-0 l1-0) (cat pt n1))+      (send n1))+    ((stor (cat d-0 l1-0) (cat pt n1)) (send (enc d-0 l1-0 k)))+    ((recv (enc d l1 k-0)) (load (cat d l1) (cat pt-0 n1-0))+      (send n1-0))+    ((stor (cat d l1) (cat pt-0 n1-0)) (send (enc d l1 k-0))))+  (label 23)+  (parent 21)+  (realized)+  (shape)+  (maps+    ((5 3 0 1) ((n1 n1-0) (n2 n1) (d d) (l1 l1) (d-0 d-0) (l1-0 l1-0))))+  (origs (n1-0 (5 0)) (l1 (5 1)) (pt-0 (5 0)) (n1 (3 0)) (l1-0 (3 1))+    (pt (3 0))))++(comment "Nothing left to do")++(defprotocol devlocn basic+  (defrole init+    (vars (d dev) (l1 locn) (n1 data) (k skey))+    (trace (stor (cat d l1) n1) (send (enc d l1 k)))+    (uniq-orig n1 l1))+  (defrole resp+    (vars (d dev) (l locn) (m mesg) (k skey))+    (trace (recv (enc d l k)) (load (cat d l) m) (send m))+    (non-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (defgenrule scissorsRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (trans z2 i2)+          (leads-to z0 i0 z1 i1) (leads-to z0 i0 z2 i2))+        (and (= z1 z2) (= i1 i2)))))+  (defgenrule cakeRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (leads-to z0 i0 z1 i1)+          (leads-to z0 i0 z2 i2) (prec z1 i1 z2 i2)) (false))))+  (defgenrule no-interruption+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (leads-to z0 i0 z2 i2) (trans z1 i1)+          (same-locn z0 i0 z1 i1) (prec z0 i0 z1 i1) (prec z1 i1 z2 i2))+        (false))))+  (defgenrule discreteAfter+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z2 i2) (leads-to z0 i0 z1 i1)+          (same-locn z0 i0 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z1 z2) (= i1 i2)) (prec z1 i1 z2 i2)))))+  (defgenrule discreteBefore+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (same-locn z0 i0 z1 i1)+          (leads-to z1 i1 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z0 z1) (= i0 i1)) (prec z0 i0 z1 i1)))))+  (defgenrule trRl_init-at-0+    (forall ((z strd))+      (implies (p "init" z (idx 1)) (trans z (idx 0)))))+  (defgenrule eff-resp-2+    (forall ((i indx) (z1 z strd))+      (implies (and (p "resp" z (idx 3)) (prec z (idx 2) z1 i))+        (or (= z z1)+          (and (p "resp" z (idx 2)) (prec z (idx 1) z1 i)))))))++(defskeleton devlocn+  (vars (n1 n2 data) (d1 d2 dev) (pt pt-0 pval) (l1 l1-0 locn))+  (defstrand init 1 (n1 n1) (d d1) (l1 l1))+  (defstrand init 1 (n1 n2) (d d2) (l1 l1-0))+  (deflistener n1)+  (deflistener n2)+  (uniq-orig n1 n2)+  (facts (neq d1 d2))+  (comment "With different devices they cannot have the same source.")+  (traces ((stor (cat d1 l1) (cat pt n1)))+    ((stor (cat d2 l1-0) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2)))+  (label 24)+  (unrealized (2 0) (3 0))+  (preskeleton)+  (maps+    ((0 1 2 3) ((n1 n1) (n2 n2) (d1 d1) (d2 d2) (l1 l1) (l1-0 l1-0))))+  (origs (pt-0 (1 0)) (n2 (1 0)) (pt (0 0)) (n1 (0 0)))+  (comment "Not a skeleton"))++(defskeleton devlocn+  (vars (n1 n2 data) (d1 d2 dev) (pt pt-0 pval) (l1 l1-0 locn))+  (defstrand init 1 (n1 n1) (d d1) (l1 l1))+  (defstrand init 1 (n1 n2) (d d2) (l1 l1-0))+  (deflistener n1)+  (deflistener n2)+  (precedes ((0 0) (2 0)) ((1 0) (3 0)))+  (uniq-orig n1 n2)+  (facts (neq d1 d2))+  (comment "With different devices they cannot have the same source.")+  (traces ((stor (cat d1 l1) (cat pt n1)))+    ((stor (cat d2 l1-0) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2)))+  (label 25)+  (parent 24)+  (unrealized (2 0) (3 0))+  (maps+    ((0 1 2 3) ((n1 n1) (n2 n2) (d1 d1) (d2 d2) (l1 l1) (l1-0 l1-0))))+  (origs (pt-0 (1 0)) (n2 (1 0)) (pt (0 0)) (n1 (0 0)))+  (comment "Not closed under rules"))++(defskeleton devlocn+  (vars (n1 n2 data) (d1 d2 dev) (pt pt-0 pval) (l1 l1-0 locn))+  (defstrand init 1 (n1 n1) (d d1) (l1 l1))+  (defstrand init 1 (n1 n2) (d d2) (l1 l1-0))+  (deflistener n1)+  (deflistener n2)+  (precedes ((0 0) (2 0)) ((1 0) (3 0)))+  (uniq-orig n1 n2)+  (facts (neq d1 d2))+  (comment "With different devices they cannot have the same source.")+  (rule trRl_init-at-0)+  (traces ((stor (cat d1 l1) (cat pt n1)))+    ((stor (cat d2 l1-0) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2)))+  (label 26)+  (parent 25)+  (unrealized (2 0) (3 0))+  (maps+    ((0 1 2 3) ((n1 n1) (n2 n2) (d1 d1) (d2 d2) (l1 l1) (l1-0 l1-0))))+  (origs (pt-0 (1 0)) (n2 (1 0)) (pt (0 0)) (n1 (0 0)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n2 data) (d1 d2 dev) (k skey) (pt pt-0 pval) (l1 l1-0 locn))+  (defstrand init 1 (n1 n1) (d d1) (l1 l1))+  (defstrand init 1 (n1 n2) (d d2) (l1 l1-0))+  (deflistener n1)+  (deflistener n2)+  (defstrand resp 3 (m n2) (d d2) (k k) (l l1-0))+  (precedes ((0 0) (2 0)) ((1 0) (4 1)) ((4 2) (3 0)))+  (non-orig k)+  (uniq-orig n1 n2)+  (facts (neq d1 d2))+  (leads-to ((1 0) (4 1)))+  (comment "With different devices they cannot have the same source.")+  (operation nonce-test (added-strand resp 3) n2 (3 0)+    (ch-msg (cat d2 l1-0) (cat pt-0 n2)))+  (strand-map 0 1 2 3)+  (traces ((stor (cat d1 l1) (cat pt n1)))+    ((stor (cat d2 l1-0) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2))+    ((recv (enc d2 l1-0 k)) (load (cat d2 l1-0) (cat pt-0 n2))+      (send n2)))+  (label 27)+  (parent 26)+  (unrealized (2 0) (4 0))+  (maps+    ((0 1 2 3) ((n1 n1) (n2 n2) (d1 d1) (d2 d2) (l1 l1) (l1-0 l1-0))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n1-0 data) (d1 d2 dev) (k skey) (pt pt-0 pval)+    (l1 l1-0 locn))+  (defstrand init 1 (n1 n1) (d d1) (l1 l1))+  (deflistener n1)+  (deflistener n1-0)+  (defstrand resp 3 (m n1-0) (d d2) (k k) (l l1-0))+  (defstrand init 2 (n1 n1-0) (d d2) (k k) (l1 l1-0))+  (precedes ((0 0) (1 0)) ((3 2) (2 0)) ((4 1) (3 0)))+  (non-orig k)+  (uniq-orig n1 n1-0 l1-0)+  (facts (neq d1 d2))+  (leads-to ((4 0) (3 1)))+  (comment "With different devices they cannot have the same source.")+  (rule discreteBefore trRl_init-at-0)+  (operation encryption-test (added-strand init 2) (enc d2 l1-0 k)+    (4 0))+  (strand-map 0 2 3 4 1)+  (traces ((stor (cat d1 l1) (cat pt n1))) ((recv n1) (send n1))+    ((recv n1-0) (send n1-0))+    ((recv (enc d2 l1-0 k)) (load (cat d2 l1-0) (cat pt-0 n1-0))+      (send n1-0))+    ((stor (cat d2 l1-0) (cat pt-0 n1-0)) (send (enc d2 l1-0 k))))+  (label 28)+  (parent 27)+  (unrealized (1 0))+  (maps+    ((0 4 1 2) ((n1 n1) (n2 n1-0) (d1 d1) (d2 d2) (l1 l1) (l1-0 l1-0))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n1-0 data) (d1 d2 dev) (k k-0 skey) (pt pt-0 pval)+    (l1 l1-0 locn))+  (defstrand init 1 (n1 n1) (d d1) (l1 l1))+  (deflistener n1)+  (deflistener n1-0)+  (defstrand resp 3 (m n1-0) (d d2) (k k) (l l1-0))+  (defstrand init 2 (n1 n1-0) (d d2) (k k) (l1 l1-0))+  (defstrand resp 3 (m n1) (d d1) (k k-0) (l l1))+  (precedes ((0 0) (5 1)) ((3 2) (2 0)) ((4 1) (3 0)) ((5 2) (1 0)))+  (non-orig k k-0)+  (uniq-orig n1 n1-0 l1-0)+  (facts (neq d1 d2))+  (leads-to ((0 0) (5 1)) ((4 0) (3 1)))+  (comment "With different devices they cannot have the same source.")+  (operation nonce-test (added-strand resp 3) n1 (1 0)+    (ch-msg (cat d1 l1) (cat pt n1)))+  (strand-map 0 1 2 3 4)+  (traces ((stor (cat d1 l1) (cat pt n1))) ((recv n1) (send n1))+    ((recv n1-0) (send n1-0))+    ((recv (enc d2 l1-0 k)) (load (cat d2 l1-0) (cat pt-0 n1-0))+      (send n1-0))+    ((stor (cat d2 l1-0) (cat pt-0 n1-0)) (send (enc d2 l1-0 k)))+    ((recv (enc d1 l1 k-0)) (load (cat d1 l1) (cat pt n1)) (send n1)))+  (label 29)+  (parent 28)+  (unrealized (5 0))+  (maps+    ((0 4 1 2) ((n1 n1) (n2 n1-0) (d1 d1) (d2 d2) (l1 l1) (l1-0 l1-0))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n1-0 data) (d1 d2 dev) (k k-0 skey) (pt pt-0 pval)+    (l1 l1-0 locn))+  (deflistener n1-0)+  (deflistener n1)+  (defstrand resp 3 (m n1) (d d2) (k k) (l l1-0))+  (defstrand init 2 (n1 n1) (d d2) (k k) (l1 l1-0))+  (defstrand resp 3 (m n1-0) (d d1) (k k-0) (l l1))+  (defstrand init 2 (n1 n1-0) (d d1) (k k-0) (l1 l1))+  (precedes ((2 2) (1 0)) ((3 1) (2 0)) ((4 2) (0 0)) ((5 1) (4 0)))+  (non-orig k k-0)+  (uniq-orig n1 n1-0 l1 l1-0)+  (facts (neq d1 d2))+  (leads-to ((3 0) (2 1)) ((5 0) (4 1)))+  (comment "With different devices they cannot have the same source.")+  (rule discreteBefore trRl_init-at-0)+  (operation encryption-test (added-strand init 2) (enc d1 l1 k-0)+    (5 0))+  (strand-map 1 2 3 4 5 0)+  (traces ((recv n1-0) (send n1-0)) ((recv n1) (send n1))+    ((recv (enc d2 l1-0 k)) (load (cat d2 l1-0) (cat pt n1)) (send n1))+    ((stor (cat d2 l1-0) (cat pt n1)) (send (enc d2 l1-0 k)))+    ((recv (enc d1 l1 k-0)) (load (cat d1 l1) (cat pt-0 n1-0))+      (send n1-0))+    ((stor (cat d1 l1) (cat pt-0 n1-0)) (send (enc d1 l1 k-0))))+  (label 30)+  (parent 29)+  (realized)+  (shape)+  (maps+    ((5 3 0 1) ((n1 n1-0) (n2 n1) (d1 d1) (d2 d2) (l1 l1) (l1-0 l1-0))))+  (origs (n1-0 (5 0)) (l1 (5 1)) (pt-0 (5 0)) (n1 (3 0)) (l1-0 (3 1))+    (pt (3 0))))++(comment "Nothing left to do")++(defprotocol devlocn basic+  (defrole init+    (vars (d dev) (l1 locn) (n1 data) (k skey))+    (trace (stor (cat d l1) n1) (send (enc d l1 k)))+    (uniq-orig n1 l1))+  (defrole resp+    (vars (d dev) (l locn) (m mesg) (k skey))+    (trace (recv (enc d l k)) (load (cat d l) m) (send m))+    (non-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (defgenrule scissorsRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (trans z2 i2)+          (leads-to z0 i0 z1 i1) (leads-to z0 i0 z2 i2))+        (and (= z1 z2) (= i1 i2)))))+  (defgenrule cakeRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (leads-to z0 i0 z1 i1)+          (leads-to z0 i0 z2 i2) (prec z1 i1 z2 i2)) (false))))+  (defgenrule no-interruption+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (leads-to z0 i0 z2 i2) (trans z1 i1)+          (same-locn z0 i0 z1 i1) (prec z0 i0 z1 i1) (prec z1 i1 z2 i2))+        (false))))+  (defgenrule discreteAfter+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z2 i2) (leads-to z0 i0 z1 i1)+          (same-locn z0 i0 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z1 z2) (= i1 i2)) (prec z1 i1 z2 i2)))))+  (defgenrule discreteBefore+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (same-locn z0 i0 z1 i1)+          (leads-to z1 i1 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z0 z1) (= i0 i1)) (prec z0 i0 z1 i1)))))+  (defgenrule trRl_init-at-0+    (forall ((z strd))+      (implies (p "init" z (idx 1)) (trans z (idx 0)))))+  (defgenrule eff-resp-2+    (forall ((i indx) (z1 z strd))+      (implies (and (p "resp" z (idx 3)) (prec z (idx 2) z1 i))+        (or (= z z1)+          (and (p "resp" z (idx 2)) (prec z (idx 1) z1 i)))))))++(defskeleton devlocn+  (vars (n1 n2 data) (d d-0 dev) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (defstrand init 1 (n1 n2) (d d-0) (l1 l2))+  (deflistener n1)+  (deflistener n2)+  (uniq-orig n1 n2)+  (facts (neq l1 l2))+  (comment "With different locns they cannot have the same source.")+  (traces ((stor (cat d l1) (cat pt n1)))+    ((stor (cat d-0 l2) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2)))+  (label 31)+  (unrealized (2 0) (3 0))+  (preskeleton)+  (maps ((0 1 2 3) ((n1 n1) (n2 n2) (l1 l1) (l2 l2) (d d) (d-0 d-0))))+  (origs (pt-0 (1 0)) (n2 (1 0)) (pt (0 0)) (n1 (0 0)))+  (comment "Not a skeleton"))++(defskeleton devlocn+  (vars (n1 n2 data) (d d-0 dev) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (defstrand init 1 (n1 n2) (d d-0) (l1 l2))+  (deflistener n1)+  (deflistener n2)+  (precedes ((0 0) (2 0)) ((1 0) (3 0)))+  (uniq-orig n1 n2)+  (facts (neq l1 l2))+  (comment "With different locns they cannot have the same source.")+  (traces ((stor (cat d l1) (cat pt n1)))+    ((stor (cat d-0 l2) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2)))+  (label 32)+  (parent 31)+  (unrealized (2 0) (3 0))+  (maps ((0 1 2 3) ((n1 n1) (n2 n2) (l1 l1) (l2 l2) (d d) (d-0 d-0))))+  (origs (pt-0 (1 0)) (n2 (1 0)) (pt (0 0)) (n1 (0 0)))+  (comment "Not closed under rules"))++(defskeleton devlocn+  (vars (n1 n2 data) (d d-0 dev) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (defstrand init 1 (n1 n2) (d d-0) (l1 l2))+  (deflistener n1)+  (deflistener n2)+  (precedes ((0 0) (2 0)) ((1 0) (3 0)))+  (uniq-orig n1 n2)+  (facts (neq l1 l2))+  (comment "With different locns they cannot have the same source.")+  (rule trRl_init-at-0)+  (traces ((stor (cat d l1) (cat pt n1)))+    ((stor (cat d-0 l2) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2)))+  (label 33)+  (parent 32)+  (unrealized (2 0) (3 0))+  (maps ((0 1 2 3) ((n1 n1) (n2 n2) (l1 l1) (l2 l2) (d d) (d-0 d-0))))+  (origs (pt-0 (1 0)) (n2 (1 0)) (pt (0 0)) (n1 (0 0)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n2 data) (d d-0 dev) (k skey) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (defstrand init 1 (n1 n2) (d d-0) (l1 l2))+  (deflistener n1)+  (deflistener n2)+  (defstrand resp 3 (m n2) (d d-0) (k k) (l l2))+  (precedes ((0 0) (2 0)) ((1 0) (4 1)) ((4 2) (3 0)))+  (non-orig k)+  (uniq-orig n1 n2)+  (facts (neq l1 l2))+  (leads-to ((1 0) (4 1)))+  (comment "With different locns they cannot have the same source.")+  (operation nonce-test (added-strand resp 3) n2 (3 0)+    (ch-msg (cat d-0 l2) (cat pt-0 n2)))+  (strand-map 0 1 2 3)+  (traces ((stor (cat d l1) (cat pt n1)))+    ((stor (cat d-0 l2) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2))+    ((recv (enc d-0 l2 k)) (load (cat d-0 l2) (cat pt-0 n2)) (send n2)))+  (label 34)+  (parent 33)+  (unrealized (2 0) (4 0))+  (maps ((0 1 2 3) ((n1 n1) (n2 n2) (l1 l1) (l2 l2) (d d) (d-0 d-0))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n1-0 data) (d d-0 dev) (k skey) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (deflistener n1)+  (deflistener n1-0)+  (defstrand resp 3 (m n1-0) (d d-0) (k k) (l l2))+  (defstrand init 2 (n1 n1-0) (d d-0) (k k) (l1 l2))+  (precedes ((0 0) (1 0)) ((3 2) (2 0)) ((4 1) (3 0)))+  (non-orig k)+  (uniq-orig n1 n1-0 l2)+  (facts (neq l1 l2))+  (leads-to ((4 0) (3 1)))+  (comment "With different locns they cannot have the same source.")+  (rule discreteBefore trRl_init-at-0)+  (operation encryption-test (added-strand init 2) (enc d-0 l2 k) (4 0))+  (strand-map 0 2 3 4 1)+  (traces ((stor (cat d l1) (cat pt n1))) ((recv n1) (send n1))+    ((recv n1-0) (send n1-0))+    ((recv (enc d-0 l2 k)) (load (cat d-0 l2) (cat pt-0 n1-0))+      (send n1-0))+    ((stor (cat d-0 l2) (cat pt-0 n1-0)) (send (enc d-0 l2 k))))+  (label 35)+  (parent 34)+  (unrealized (1 0))+  (maps ((0 4 1 2) ((n1 n1) (n2 n1-0) (l1 l1) (l2 l2) (d d) (d-0 d-0))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n1-0 data) (d d-0 dev) (k k-0 skey) (pt pt-0 pval)+    (l1 l2 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (deflistener n1)+  (deflistener n1-0)+  (defstrand resp 3 (m n1-0) (d d-0) (k k) (l l2))+  (defstrand init 2 (n1 n1-0) (d d-0) (k k) (l1 l2))+  (defstrand resp 3 (m n1) (d d) (k k-0) (l l1))+  (precedes ((0 0) (5 1)) ((3 2) (2 0)) ((4 1) (3 0)) ((5 2) (1 0)))+  (non-orig k k-0)+  (uniq-orig n1 n1-0 l2)+  (facts (neq l1 l2))+  (leads-to ((0 0) (5 1)) ((4 0) (3 1)))+  (comment "With different locns they cannot have the same source.")+  (operation nonce-test (added-strand resp 3) n1 (1 0)+    (ch-msg (cat d l1) (cat pt n1)))+  (strand-map 0 1 2 3 4)+  (traces ((stor (cat d l1) (cat pt n1))) ((recv n1) (send n1))+    ((recv n1-0) (send n1-0))+    ((recv (enc d-0 l2 k)) (load (cat d-0 l2) (cat pt-0 n1-0))+      (send n1-0))+    ((stor (cat d-0 l2) (cat pt-0 n1-0)) (send (enc d-0 l2 k)))+    ((recv (enc d l1 k-0)) (load (cat d l1) (cat pt n1)) (send n1)))+  (label 36)+  (parent 35)+  (unrealized (5 0))+  (maps ((0 4 1 2) ((n1 n1) (n2 n1-0) (l1 l1) (l2 l2) (d d) (d-0 d-0))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n1-0 data) (d d-0 dev) (k k-0 skey) (pt pt-0 pval)+    (l1 l2 locn))+  (deflistener n1-0)+  (deflistener n1)+  (defstrand resp 3 (m n1) (d d-0) (k k) (l l2))+  (defstrand init 2 (n1 n1) (d d-0) (k k) (l1 l2))+  (defstrand resp 3 (m n1-0) (d d) (k k-0) (l l1))+  (defstrand init 2 (n1 n1-0) (d d) (k k-0) (l1 l1))+  (precedes ((2 2) (1 0)) ((3 1) (2 0)) ((4 2) (0 0)) ((5 1) (4 0)))+  (non-orig k k-0)+  (uniq-orig n1 n1-0 l1 l2)+  (facts (neq l1 l2))+  (leads-to ((3 0) (2 1)) ((5 0) (4 1)))+  (comment "With different locns they cannot have the same source.")+  (rule discreteBefore trRl_init-at-0)+  (operation encryption-test (added-strand init 2) (enc d l1 k-0) (5 0))+  (strand-map 1 2 3 4 5 0)+  (traces ((recv n1-0) (send n1-0)) ((recv n1) (send n1))+    ((recv (enc d-0 l2 k)) (load (cat d-0 l2) (cat pt n1)) (send n1))+    ((stor (cat d-0 l2) (cat pt n1)) (send (enc d-0 l2 k)))+    ((recv (enc d l1 k-0)) (load (cat d l1) (cat pt-0 n1-0))+      (send n1-0))+    ((stor (cat d l1) (cat pt-0 n1-0)) (send (enc d l1 k-0))))+  (label 37)+  (parent 36)+  (realized)+  (shape)+  (maps ((5 3 0 1) ((n1 n1-0) (n2 n1) (l1 l1) (l2 l2) (d d) (d-0 d-0))))+  (origs (n1-0 (5 0)) (l1 (5 1)) (pt-0 (5 0)) (n1 (3 0)) (l2 (3 1))+    (pt (3 0))))++(comment "Nothing left to do")++(defprotocol devlocn basic+  (defrole init+    (vars (d dev) (l1 locn) (n1 data) (k skey))+    (trace (stor (cat d l1) n1) (send (enc d l1 k)))+    (uniq-orig n1 l1))+  (defrole resp+    (vars (d dev) (l locn) (m mesg) (k skey))+    (trace (recv (enc d l k)) (load (cat d l) m) (send m))+    (non-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (defgenrule scissorsRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (trans z2 i2)+          (leads-to z0 i0 z1 i1) (leads-to z0 i0 z2 i2))+        (and (= z1 z2) (= i1 i2)))))+  (defgenrule cakeRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (leads-to z0 i0 z1 i1)+          (leads-to z0 i0 z2 i2) (prec z1 i1 z2 i2)) (false))))+  (defgenrule no-interruption+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (leads-to z0 i0 z2 i2) (trans z1 i1)+          (same-locn z0 i0 z1 i1) (prec z0 i0 z1 i1) (prec z1 i1 z2 i2))+        (false))))+  (defgenrule discreteAfter+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z2 i2) (leads-to z0 i0 z1 i1)+          (same-locn z0 i0 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z1 z2) (= i1 i2)) (prec z1 i1 z2 i2)))))+  (defgenrule discreteBefore+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (same-locn z0 i0 z1 i1)+          (leads-to z1 i1 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z0 z1) (= i0 i1)) (prec z0 i0 z1 i1)))))+  (defgenrule trRl_init-at-0+    (forall ((z strd))+      (implies (p "init" z (idx 1)) (trans z (idx 0)))))+  (defgenrule eff-resp-2+    (forall ((i indx) (z1 z strd))+      (implies (and (p "resp" z (idx 3)) (prec z (idx 2) z1 i))+        (or (= z z1)+          (and (p "resp" z (idx 2)) (prec z (idx 1) z1 i)))))))++(defskeleton devlocn+  (vars (n1 n2 data) (d dev) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (defstrand init 1 (n1 n2) (d d) (l1 l2))+  (deflistener n1)+  (deflistener n2)+  (uniq-orig n1 n2)+  (facts (neq l1 l2))+  (comment+    "With different locns they cannot have the same source even if the devs are the same.")+  (traces ((stor (cat d l1) (cat pt n1)))+    ((stor (cat d l2) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2)))+  (label 38)+  (unrealized (2 0) (3 0))+  (preskeleton)+  (maps ((0 1 2 3) ((n1 n1) (n2 n2) (l1 l1) (l2 l2) (d d))))+  (origs (pt-0 (1 0)) (n2 (1 0)) (pt (0 0)) (n1 (0 0)))+  (comment "Not a skeleton"))++(defskeleton devlocn+  (vars (n1 n2 data) (d dev) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (defstrand init 1 (n1 n2) (d d) (l1 l2))+  (deflistener n1)+  (deflistener n2)+  (precedes ((0 0) (2 0)) ((1 0) (3 0)))+  (uniq-orig n1 n2)+  (facts (neq l1 l2))+  (comment+    "With different locns they cannot have the same source even if the devs are the same.")+  (traces ((stor (cat d l1) (cat pt n1)))+    ((stor (cat d l2) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2)))+  (label 39)+  (parent 38)+  (unrealized (2 0) (3 0))+  (maps ((0 1 2 3) ((n1 n1) (n2 n2) (l1 l1) (l2 l2) (d d))))+  (origs (pt-0 (1 0)) (n2 (1 0)) (pt (0 0)) (n1 (0 0)))+  (comment "Not closed under rules"))++(defskeleton devlocn+  (vars (n1 n2 data) (d dev) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (defstrand init 1 (n1 n2) (d d) (l1 l2))+  (deflistener n1)+  (deflistener n2)+  (precedes ((0 0) (2 0)) ((1 0) (3 0)))+  (uniq-orig n1 n2)+  (facts (neq l1 l2))+  (comment+    "With different locns they cannot have the same source even if the devs are the same.")+  (rule trRl_init-at-0)+  (traces ((stor (cat d l1) (cat pt n1)))+    ((stor (cat d l2) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2)))+  (label 40)+  (parent 39)+  (unrealized (2 0) (3 0))+  (maps ((0 1 2 3) ((n1 n1) (n2 n2) (l1 l1) (l2 l2) (d d))))+  (origs (pt-0 (1 0)) (n2 (1 0)) (pt (0 0)) (n1 (0 0)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n2 data) (d dev) (k skey) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (defstrand init 1 (n1 n2) (d d) (l1 l2))+  (deflistener n1)+  (deflistener n2)+  (defstrand resp 3 (m n2) (d d) (k k) (l l2))+  (precedes ((0 0) (2 0)) ((1 0) (4 1)) ((4 2) (3 0)))+  (non-orig k)+  (uniq-orig n1 n2)+  (facts (neq l1 l2))+  (leads-to ((1 0) (4 1)))+  (comment+    "With different locns they cannot have the same source even if the devs are the same.")+  (operation nonce-test (added-strand resp 3) n2 (3 0)+    (ch-msg (cat d l2) (cat pt-0 n2)))+  (strand-map 0 1 2 3)+  (traces ((stor (cat d l1) (cat pt n1)))+    ((stor (cat d l2) (cat pt-0 n2))) ((recv n1) (send n1))+    ((recv n2) (send n2))+    ((recv (enc d l2 k)) (load (cat d l2) (cat pt-0 n2)) (send n2)))+  (label 41)+  (parent 40)+  (unrealized (2 0) (4 0))+  (maps ((0 1 2 3) ((n1 n1) (n2 n2) (l1 l1) (l2 l2) (d d))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n1-0 data) (d dev) (k skey) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (deflistener n1)+  (deflistener n1-0)+  (defstrand resp 3 (m n1-0) (d d) (k k) (l l2))+  (defstrand init 2 (n1 n1-0) (d d) (k k) (l1 l2))+  (precedes ((0 0) (1 0)) ((3 2) (2 0)) ((4 1) (3 0)))+  (non-orig k)+  (uniq-orig n1 n1-0 l2)+  (facts (neq l1 l2))+  (leads-to ((4 0) (3 1)))+  (comment+    "With different locns they cannot have the same source even if the devs are the same.")+  (rule discreteBefore trRl_init-at-0)+  (operation encryption-test (added-strand init 2) (enc d l2 k) (4 0))+  (strand-map 0 2 3 4 1)+  (traces ((stor (cat d l1) (cat pt n1))) ((recv n1) (send n1))+    ((recv n1-0) (send n1-0))+    ((recv (enc d l2 k)) (load (cat d l2) (cat pt-0 n1-0)) (send n1-0))+    ((stor (cat d l2) (cat pt-0 n1-0)) (send (enc d l2 k))))+  (label 42)+  (parent 41)+  (unrealized (1 0))+  (maps ((0 4 1 2) ((n1 n1) (n2 n1-0) (l1 l1) (l2 l2) (d d))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n1-0 data) (d dev) (k k-0 skey) (pt pt-0 pval) (l1 l2 locn))+  (defstrand init 1 (n1 n1) (d d) (l1 l1))+  (deflistener n1)+  (deflistener n1-0)+  (defstrand resp 3 (m n1-0) (d d) (k k) (l l2))+  (defstrand init 2 (n1 n1-0) (d d) (k k) (l1 l2))+  (defstrand resp 3 (m n1) (d d) (k k-0) (l l1))+  (precedes ((0 0) (5 1)) ((3 2) (2 0)) ((4 1) (3 0)) ((5 2) (1 0)))+  (non-orig k k-0)+  (uniq-orig n1 n1-0 l2)+  (facts (neq l1 l2))+  (leads-to ((0 0) (5 1)) ((4 0) (3 1)))+  (comment+    "With different locns they cannot have the same source even if the devs are the same.")+  (operation nonce-test (added-strand resp 3) n1 (1 0)+    (ch-msg (cat d l1) (cat pt n1)))+  (strand-map 0 1 2 3 4)+  (traces ((stor (cat d l1) (cat pt n1))) ((recv n1) (send n1))+    ((recv n1-0) (send n1-0))+    ((recv (enc d l2 k)) (load (cat d l2) (cat pt-0 n1-0)) (send n1-0))+    ((stor (cat d l2) (cat pt-0 n1-0)) (send (enc d l2 k)))+    ((recv (enc d l1 k-0)) (load (cat d l1) (cat pt n1)) (send n1)))+  (label 43)+  (parent 42)+  (unrealized (5 0))+  (maps ((0 4 1 2) ((n1 n1) (n2 n1-0) (l1 l1) (l2 l2) (d d))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 n1-0 data) (d dev) (k k-0 skey) (pt pt-0 pval) (l1 l2 locn))+  (deflistener n1-0)+  (deflistener n1)+  (defstrand resp 3 (m n1) (d d) (k k) (l l2))+  (defstrand init 2 (n1 n1) (d d) (k k) (l1 l2))+  (defstrand resp 3 (m n1-0) (d d) (k k-0) (l l1))+  (defstrand init 2 (n1 n1-0) (d d) (k k-0) (l1 l1))+  (precedes ((2 2) (1 0)) ((3 1) (2 0)) ((4 2) (0 0)) ((5 1) (4 0)))+  (non-orig k k-0)+  (uniq-orig n1 n1-0 l1 l2)+  (facts (neq l1 l2))+  (leads-to ((3 0) (2 1)) ((5 0) (4 1)))+  (comment+    "With different locns they cannot have the same source even if the devs are the same.")+  (rule discreteBefore trRl_init-at-0)+  (operation encryption-test (added-strand init 2) (enc d l1 k-0) (5 0))+  (strand-map 1 2 3 4 5 0)+  (traces ((recv n1-0) (send n1-0)) ((recv n1) (send n1))+    ((recv (enc d l2 k)) (load (cat d l2) (cat pt n1)) (send n1))+    ((stor (cat d l2) (cat pt n1)) (send (enc d l2 k)))+    ((recv (enc d l1 k-0)) (load (cat d l1) (cat pt-0 n1-0))+      (send n1-0))+    ((stor (cat d l1) (cat pt-0 n1-0)) (send (enc d l1 k-0))))+  (label 44)+  (parent 43)+  (realized)+  (shape)+  (maps ((5 3 0 1) ((n1 n1-0) (n2 n1) (l1 l1) (l2 l2) (d d))))+  (origs (n1-0 (5 0)) (l1 (5 1)) (pt-0 (5 0)) (n1 (3 0)) (l2 (3 1))+    (pt (3 0))))++(comment "Nothing left to do")++(defprotocol devlocn basic+  (defrole init+    (vars (d dev) (l1 locn) (n1 data) (k skey))+    (trace (stor (cat d l1) n1) (send (enc d l1 k)))+    (uniq-orig n1 l1))+  (defrole resp+    (vars (dl m mesg) (k skey))+    (trace (recv (enc dl k)) (load dl m) (send m))+    (non-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (defgenrule scissorsRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (trans z2 i2)+          (leads-to z0 i0 z1 i1) (leads-to z0 i0 z2 i2))+        (and (= z1 z2) (= i1 i2)))))+  (defgenrule cakeRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (leads-to z0 i0 z1 i1)+          (leads-to z0 i0 z2 i2) (prec z1 i1 z2 i2)) (false))))+  (defgenrule no-interruption+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (leads-to z0 i0 z2 i2) (trans z1 i1)+          (same-locn z0 i0 z1 i1) (prec z0 i0 z1 i1) (prec z1 i1 z2 i2))+        (false))))+  (defgenrule discreteAfter+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z2 i2) (leads-to z0 i0 z1 i1)+          (same-locn z0 i0 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z1 z2) (= i1 i2)) (prec z1 i1 z2 i2)))))+  (defgenrule discreteBefore+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (same-locn z0 i0 z1 i1)+          (leads-to z1 i1 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z0 z1) (= i0 i1)) (prec z0 i0 z1 i1)))))+  (defgenrule trRl_init-at-0+    (forall ((z strd))+      (implies (p "init" z (idx 1)) (trans z (idx 0)))))+  (defgenrule eff-resp-2+    (forall ((i indx) (z1 z strd))+      (implies (and (p "resp" z (idx 3)) (prec z (idx 2) z1 i))+        (or (= z z1)+          (and (p "resp" z (idx 2)) (prec z (idx 1) z1 i))))))+  (comment+    "Notice the mesg var dl as location for load. Only allowed because it is acquired."))++(defskeleton devlocn+  (vars (m dl mesg) (k skey) (pt pval))+  (defstrand resp 2 (dl dl) (m m) (k k))+  (non-orig k)+  (gen-st m)+  (traces ((recv (enc dl k)) (load dl (cat pt m))))+  (label 45)+  (unrealized (0 0) (0 1))+  (maps ((0) ((m m) (dl dl) (k k))))+  (origs)+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (m mesg) (n1 data) (d dev) (k skey) (pt pt-0 pval) (l1 locn))+  (defstrand resp 2 (dl (cat d l1)) (m m) (k k))+  (defstrand init 2 (n1 n1) (d d) (k k) (l1 l1))+  (precedes ((1 1) (0 0)))+  (non-orig k)+  (uniq-orig n1 l1)+  (gen-st m)+  (rule trRl_init-at-0)+  (operation encryption-test (added-strand init 2) (enc d l1 k) (0 0))+  (strand-map 0)+  (traces ((recv (enc d l1 k)) (load (cat d l1) (cat pt m)))+    ((stor (cat d l1) (cat pt-0 n1)) (send (enc d l1 k))))+  (label 46)+  (parent 45)+  (unrealized (0 1))+  (maps ((0) ((m m) (dl (cat d l1)) (k k))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n1 data) (d dev) (k skey) (pt pval) (l1 locn))+  (defstrand resp 2 (dl (cat d l1)) (m n1) (k k))+  (defstrand init 2 (n1 n1) (d d) (k k) (l1 l1))+  (precedes ((1 1) (0 0)))+  (non-orig k)+  (uniq-orig n1 l1)+  (gen-st n1)+  (leads-to ((1 0) (0 1)))+  (rule discreteBefore trRl_init-at-0)+  (operation channel-test (added-strand init 1)+    (ch-msg (cat d l1) (cat pt n1)) (0 1))+  (strand-map 0 1)+  (traces ((recv (enc d l1 k)) (load (cat d l1) (cat pt n1)))+    ((stor (cat d l1) (cat pt n1)) (send (enc d l1 k))))+  (label 47)+  (parent 46)+  (realized)+  (shape)+  (maps ((0) ((m n1) (dl (cat d l1)) (k k))))+  (origs (n1 (1 0)) (pt (1 0)) (l1 (1 1))))++(comment "Nothing left to do")++(defprotocol devlocn basic+  (defrole init+    (vars (d dev) (l1 locn) (n1 data) (k skey))+    (trace (stor (cat d l1) n1) (send (enc d l1 k)))+    (uniq-orig n1 l1))+  (defrole resp+    (vars (dl m mesg) (k skey))+    (trace (recv (enc dl k)) (load dl m) (send m))+    (non-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (defgenrule scissorsRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (trans z2 i2)+          (leads-to z0 i0 z1 i1) (leads-to z0 i0 z2 i2))+        (and (= z1 z2) (= i1 i2)))))+  (defgenrule cakeRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (leads-to z0 i0 z1 i1)+          (leads-to z0 i0 z2 i2) (prec z1 i1 z2 i2)) (false))))+  (defgenrule no-interruption+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (leads-to z0 i0 z2 i2) (trans z1 i1)+          (same-locn z0 i0 z1 i1) (prec z0 i0 z1 i1) (prec z1 i1 z2 i2))+        (false))))+  (defgenrule discreteAfter+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z2 i2) (leads-to z0 i0 z1 i1)+          (same-locn z0 i0 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z1 z2) (= i1 i2)) (prec z1 i1 z2 i2)))))+  (defgenrule discreteBefore+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (same-locn z0 i0 z1 i1)+          (leads-to z1 i1 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z0 z1) (= i0 i1)) (prec z0 i0 z1 i1)))))+  (defgenrule trRl_init-at-0+    (forall ((z strd))+      (implies (p "init" z (idx 1)) (trans z (idx 0)))))+  (defgenrule eff-resp-2+    (forall ((i indx) (z1 z strd))+      (implies (and (p "resp" z (idx 3)) (prec z (idx 2) z1 i))+        (or (= z z1)+          (and (p "resp" z (idx 2)) (prec z (idx 1) z1 i))))))+  (comment+    "Notice the mesg var dl as location for load. Only allowed because it is acquired."))++(defskeleton devlocn+  (vars (m dl mesg) (k skey) (pt pval))+  (defstrand resp 2 (dl dl) (m m) (k k))+  (non-orig k)+  (comment+    "Possibly strange interpretation. Init has uniq-orig n1 and l1. Resp doesn't necessarily retrieve n1, even though nobody but Init should know l1, so nobody else could stor into it.")+  (traces ((recv (enc dl k)) (load dl (cat pt m))))+  (label 48)+  (unrealized (0 0))+  (maps ((0) ((m m) (dl dl) (k k))))+  (origs)+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (m mesg) (n1 data) (d dev) (k skey) (pt pt-0 pval) (l1 locn))+  (defstrand resp 2 (dl (cat d l1)) (m m) (k k))+  (defstrand init 2 (n1 n1) (d d) (k k) (l1 l1))+  (precedes ((1 1) (0 0)))+  (non-orig k)+  (uniq-orig n1 l1)+  (comment+    "Possibly strange interpretation. Init has uniq-orig n1 and l1. Resp doesn't necessarily retrieve n1, even though nobody but Init should know l1, so nobody else could stor into it.")+  (rule trRl_init-at-0)+  (operation encryption-test (added-strand init 2) (enc d l1 k) (0 0))+  (strand-map 0)+  (traces ((recv (enc d l1 k)) (load (cat d l1) (cat pt m)))+    ((stor (cat d l1) (cat pt-0 n1)) (send (enc d l1 k))))+  (label 49)+  (parent 48)+  (realized)+  (shape)+  (maps ((0) ((m m) (dl (cat d l1)) (k k))))+  (origs (n1 (1 0)) (l1 (1 1)) (pt-0 (1 0))))++(comment "Nothing left to do")++(defprotocol devlocn basic+  (defrole init+    (vars (d dev) (l1 locn) (n1 data) (k skey))+    (trace (stor (cat d l1) n1) (send (enc d l1 k)))+    (uniq-orig n1 l1))+  (defrole resp+    (vars (dl m mesg) (k skey))+    (trace (recv (enc dl k)) (load dl m) (send m))+    (non-orig k))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (defgenrule scissorsRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (trans z2 i2)+          (leads-to z0 i0 z1 i1) (leads-to z0 i0 z2 i2))+        (and (= z1 z2) (= i1 i2)))))+  (defgenrule cakeRule+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (leads-to z0 i0 z1 i1)+          (leads-to z0 i0 z2 i2) (prec z1 i1 z2 i2)) (false))))+  (defgenrule no-interruption+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (leads-to z0 i0 z2 i2) (trans z1 i1)+          (same-locn z0 i0 z1 i1) (prec z0 i0 z1 i1) (prec z1 i1 z2 i2))+        (false))))+  (defgenrule discreteAfter+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z2 i2) (leads-to z0 i0 z1 i1)+          (same-locn z0 i0 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z1 z2) (= i1 i2)) (prec z1 i1 z2 i2)))))+  (defgenrule discreteBefore+    (forall ((z0 z1 z2 strd) (i0 i1 i2 indx))+      (implies+        (and (trans z0 i0) (trans z1 i1) (same-locn z0 i0 z1 i1)+          (leads-to z1 i1 z2 i2) (prec z0 i0 z2 i2))+        (or (and (= z0 z1) (= i0 i1)) (prec z0 i0 z1 i1)))))+  (defgenrule trRl_init-at-0+    (forall ((z strd))+      (implies (p "init" z (idx 1)) (trans z (idx 0)))))+  (defgenrule eff-resp-2+    (forall ((i indx) (z1 z strd))+      (implies (and (p "resp" z (idx 3)) (prec z (idx 2) z1 i))+        (or (= z z1)+          (and (p "resp" z (idx 2)) (prec z (idx 1) z1 i))))))+  (comment+    "Notice the mesg var dl as location for load. Only allowed because it is acquired."))++(defskeleton devlocn+  (vars (dl mesg) (n data) (d dev) (k k-0 skey) (pt pt-0 pval)+    (l1 locn))+  (defstrand resp 2 (dl dl) (m n) (k k))+  (defstrand init 2 (n1 n) (d d) (k k-0) (l1 l1))+  (non-orig k)+  (uniq-orig n l1)+  (comment+    "Even if loaded value is not gen-st, since it's uniq-orig, nonce-test still applies.")+  (traces ((recv (enc dl k)) (load dl (cat pt n)))+    ((stor (cat d l1) (cat pt-0 n)) (send (enc d l1 k-0))))+  (label 50)+  (unrealized (0 0) (0 1))+  (preskeleton)+  (maps ((0 1) ((n n) (dl dl) (k k) (d d) (l1 l1) (k-0 k-0))))+  (origs (pt-0 (1 0)) (l1 (1 1)) (n (1 0)))+  (comment "Not a skeleton"))++(defskeleton devlocn+  (vars (dl mesg) (n data) (d dev) (k k-0 skey) (pt pt-0 pval)+    (l1 locn))+  (defstrand resp 2 (dl dl) (m n) (k k))+  (defstrand init 2 (n1 n) (d d) (k k-0) (l1 l1))+  (precedes ((1 0) (0 1)))+  (non-orig k)+  (uniq-orig n l1)+  (comment+    "Even if loaded value is not gen-st, since it's uniq-orig, nonce-test still applies.")+  (traces ((recv (enc dl k)) (load dl (cat pt n)))+    ((stor (cat d l1) (cat pt-0 n)) (send (enc d l1 k-0))))+  (label 51)+  (parent 50)+  (unrealized (0 0) (0 1))+  (maps ((0 1) ((n n) (dl dl) (k k) (d d) (l1 l1) (k-0 k-0))))+  (origs (pt-0 (1 0)) (l1 (1 1)) (n (1 0)))+  (comment "Not closed under rules"))++(defskeleton devlocn+  (vars (dl mesg) (n data) (d dev) (k k-0 skey) (pt pt-0 pval)+    (l1 locn))+  (defstrand resp 2 (dl dl) (m n) (k k))+  (defstrand init 2 (n1 n) (d d) (k k-0) (l1 l1))+  (precedes ((1 0) (0 1)))+  (non-orig k)+  (uniq-orig n l1)+  (comment+    "Even if loaded value is not gen-st, since it's uniq-orig, nonce-test still applies.")+  (rule trRl_init-at-0)+  (traces ((recv (enc dl k)) (load dl (cat pt n)))+    ((stor (cat d l1) (cat pt-0 n)) (send (enc d l1 k-0))))+  (label 52)+  (parent 51)+  (unrealized (0 0) (0 1))+  (maps ((0 1) ((n n) (dl dl) (k k) (d d) (l1 l1) (k-0 k-0))))+  (origs (pt-0 (1 0)) (l1 (1 1)) (n (1 0)))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton devlocn+  (vars (n data) (d dev) (k skey) (pt pt-0 pval) (l1 locn))+  (defstrand resp 2 (dl (cat d l1)) (m n) (k k))+  (defstrand init 2 (n1 n) (d d) (k k) (l1 l1))+  (precedes ((1 1) (0 0)))+  (non-orig k)+  (uniq-orig n l1)+  (comment+    "Even if loaded value is not gen-st, since it's uniq-orig, nonce-test still applies.")+  (operation encryption-test (displaced 2 1 init 2) (enc d-0 l1-0 k-0)+    (0 0))+  (strand-map 0 1)+  (traces ((recv (enc d l1 k)) (load (cat d l1) (cat pt n)))+    ((stor (cat d l1) (cat pt-0 n)) (send (enc d l1 k))))+  (label 53)+  (parent 52)+  (unrealized (0 1))+  (maps ((0 1) ((n n) (dl (cat d l1)) (k k) (d d) (l1 l1) (k-0 k))))+  (origs (n (1 0)) (l1 (1 1)) (pt-0 (1 0)))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton devlocn+  (vars (n n1 data) (d d-0 dev) (k k-0 skey) (pt pt-0 pt-1 pval)+    (l1 l1-0 locn))+  (defstrand resp 2 (dl (cat d-0 l1-0)) (m n) (k k))+  (defstrand init 2 (n1 n) (d d) (k k-0) (l1 l1))+  (defstrand init 2 (n1 n1) (d d-0) (k k) (l1 l1-0))+  (precedes ((1 0) (0 1)) ((2 1) (0 0)))+  (non-orig k)+  (uniq-orig n n1 l1 l1-0)+  (comment+    "Even if loaded value is not gen-st, since it's uniq-orig, nonce-test still applies.")+  (rule trRl_init-at-0)+  (operation encryption-test (added-strand init 2) (enc d-0 l1-0 k)+    (0 0))+  (strand-map 0 1)+  (traces ((recv (enc d-0 l1-0 k)) (load (cat d-0 l1-0) (cat pt n)))+    ((stor (cat d l1) (cat pt-0 n)) (send (enc d l1 k-0)))+    ((stor (cat d-0 l1-0) (cat pt-1 n1)) (send (enc d-0 l1-0 k))))+  (label 54)+  (parent 52)+  (unrealized (0 1))+  (maps+    ((0 1) ((n n) (dl (cat d-0 l1-0)) (k k) (d d) (l1 l1) (k-0 k-0))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n data) (d dev) (k skey) (pt pval) (l1 locn))+  (defstrand resp 2 (dl (cat d l1)) (m n) (k k))+  (defstrand init 2 (n1 n) (d d) (k k) (l1 l1))+  (precedes ((1 1) (0 0)))+  (non-orig k)+  (uniq-orig n l1)+  (leads-to ((1 0) (0 1)))+  (comment+    "Even if loaded value is not gen-st, since it's uniq-orig, nonce-test still applies.")+  (operation nonce-test (contracted (pt-0 pt)) n (0 1)+    (ch-msg (cat d l1) (cat pt n)))+  (strand-map 0 1)+  (traces ((recv (enc d l1 k)) (load (cat d l1) (cat pt n)))+    ((stor (cat d l1) (cat pt n)) (send (enc d l1 k))))+  (label 55)+  (parent 53)+  (realized)+  (shape)+  (maps ((0 1) ((n n) (dl (cat d l1)) (k k) (d d) (l1 l1) (k-0 k))))+  (origs (n (1 0)) (l1 (1 1)) (pt (1 0))))++(defskeleton devlocn+  (vars (n data) (d dev) (k k-0 skey) (pt pt-0 pval) (l1 locn))+  (defstrand resp 2 (dl (cat d l1)) (m n) (k k))+  (defstrand init 2 (n1 n) (d d) (k k) (l1 l1))+  (defstrand resp 3 (dl (cat d l1)) (m n) (k k-0))+  (precedes ((1 1) (0 0)) ((1 1) (2 0)) ((2 2) (0 1)))+  (non-orig k k-0)+  (uniq-orig n l1)+  (leads-to ((1 0) (2 1)))+  (comment+    "Even if loaded value is not gen-st, since it's uniq-orig, nonce-test still applies.")+  (operation nonce-test (added-strand resp 3) n (0 1)+    (ch-msg (cat d l1) (cat pt-0 n)))+  (strand-map 0 1)+  (traces ((recv (enc d l1 k)) (load (cat d l1) (cat pt n)))+    ((stor (cat d l1) (cat pt-0 n)) (send (enc d l1 k)))+    ((recv (enc d l1 k-0)) (load (cat d l1) (cat pt-0 n)) (send n)))+  (label 56)+  (parent 53)+  (unrealized (2 0))+  (maps ((0 1) ((n n) (dl (cat d l1)) (k k) (d d) (l1 l1) (k-0 k))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n n1 data) (d d-0 dev) (k k-0 k-1 skey) (pt pt-0 pt-1 pval)+    (l1 l1-0 locn))+  (defstrand resp 2 (dl (cat d-0 l1-0)) (m n) (k k))+  (defstrand init 2 (n1 n) (d d) (k k-0) (l1 l1))+  (defstrand init 2 (n1 n1) (d d-0) (k k) (l1 l1-0))+  (defstrand resp 3 (dl (cat d l1)) (m n) (k k-1))+  (precedes ((1 1) (3 0)) ((2 1) (0 0)) ((3 2) (0 1)))+  (non-orig k k-1)+  (uniq-orig n n1 l1 l1-0)+  (leads-to ((1 0) (3 1)))+  (comment+    "Even if loaded value is not gen-st, since it's uniq-orig, nonce-test still applies.")+  (operation nonce-test (added-strand resp 3) n (0 1)+    (ch-msg (cat d l1) (cat pt-0 n)))+  (strand-map 0 1 2)+  (traces ((recv (enc d-0 l1-0 k)) (load (cat d-0 l1-0) (cat pt n)))+    ((stor (cat d l1) (cat pt-0 n)) (send (enc d l1 k-0)))+    ((stor (cat d-0 l1-0) (cat pt-1 n1)) (send (enc d-0 l1-0 k)))+    ((recv (enc d l1 k-1)) (load (cat d l1) (cat pt-0 n)) (send n)))+  (label 57)+  (parent 54)+  (unrealized (3 0))+  (maps+    ((0 1) ((n n) (dl (cat d-0 l1-0)) (k k) (d d) (l1 l1) (k-0 k-0))))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton devlocn+  (vars (n data) (d dev) (k skey) (pt pt-0 pval) (l1 locn))+  (defstrand resp 2 (dl (cat d l1)) (m n) (k k))+  (defstrand init 2 (n1 n) (d d) (k k) (l1 l1))+  (defstrand resp 3 (dl (cat d l1)) (m n) (k k))+  (precedes ((1 1) (0 0)) ((1 1) (2 0)) ((2 2) (0 1)))+  (non-orig k)+  (uniq-orig n l1)+  (leads-to ((1 0) (2 1)))+  (comment+    "Even if loaded value is not gen-st, since it's uniq-orig, nonce-test still applies.")+  (operation encryption-test (displaced 3 1 init 2) (enc d l1 k-0)+    (2 0))+  (strand-map 0 1 2)+  (traces ((recv (enc d l1 k)) (load (cat d l1) (cat pt n)))+    ((stor (cat d l1) (cat pt-0 n)) (send (enc d l1 k)))+    ((recv (enc d l1 k)) (load (cat d l1) (cat pt-0 n)) (send n)))+  (label 58)+  (parent 56)+  (realized)+  (shape)+  (maps ((0 1) ((n n) (dl (cat d l1)) (k k) (d d) (l1 l1) (k-0 k))))+  (origs (n (1 0)) (l1 (1 1)) (pt-0 (1 0))))++(defskeleton devlocn+  (vars (n n1 data) (d d-0 dev) (k k-0 skey) (pt pt-0 pt-1 pval)+    (l1 l1-0 locn))+  (defstrand resp 2 (dl (cat d-0 l1-0)) (m n) (k k))+  (defstrand init 2 (n1 n) (d d) (k k-0) (l1 l1))+  (defstrand init 2 (n1 n1) (d d-0) (k k) (l1 l1-0))+  (defstrand resp 3 (dl (cat d l1)) (m n) (k k-0))+  (precedes ((1 1) (3 0)) ((2 1) (0 0)) ((3 2) (0 1)))+  (non-orig k k-0)+  (uniq-orig n n1 l1 l1-0)+  (leads-to ((1 0) (3 1)))+  (comment+    "Even if loaded value is not gen-st, since it's uniq-orig, nonce-test still applies.")+  (operation encryption-test (displaced 4 1 init 2) (enc d l1 k-1)+    (3 0))+  (strand-map 0 1 2 3)+  (traces ((recv (enc d-0 l1-0 k)) (load (cat d-0 l1-0) (cat pt n)))+    ((stor (cat d l1) (cat pt-0 n)) (send (enc d l1 k-0)))+    ((stor (cat d-0 l1-0) (cat pt-1 n1)) (send (enc d-0 l1-0 k)))+    ((recv (enc d l1 k-0)) (load (cat d l1) (cat pt-0 n)) (send n)))+  (label 59)+  (parent 57)+  (realized)+  (shape)+  (maps+    ((0 1) ((n n) (dl (cat d-0 l1-0)) (k k) (d d) (l1 l1) (k-0 k-0))))+  (origs (n (1 0)) (l1 (1 1)) (pt-0 (1 0)) (n1 (2 0)) (l1-0 (2 1))+    (pt-1 (2 0))))++(comment "Nothing left to do")
tst/dh-ca_hack.tst view
@@ -1,6 +1,6 @@ (herald dhca (algebra basic) (bound 12)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/dh-ca_hack.scm")  (defprotocol dhca basic
tst/dh_encrypt_hack.tst view
@@ -1,6 +1,6 @@ (herald dhencrypt (algebra basic)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/dh_encrypt_hack.scm")  (defprotocol dhencrypt basic
tst/dh_group_sig.tst view
@@ -1,7 +1,7 @@ (herald "Signed group DH exchange (improved version)"   (algebra diffie-hellman) (limit 100)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/dh_group_sig.scm") (comment "Step count limited to 100") 
tst/dh_group_sig_auth_failure.tst view
@@ -1,7 +1,7 @@ (herald "Signed group DH exchange (version with auth failure)"   (algebra diffie-hellman) (limit 100)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/dh_group_sig_auth_failure.scm") (comment "Step count limited to 100") 
tst/dh_mim_hack.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/dh_mim_hack.scm")  (defprotocol dh_mim basic
tst/dhnsl_hack.tst view
@@ -1,7 +1,7 @@ (herald "Diffie-Hellman enhanced Needham-Schroeder-Lowe Protocol"   (algebra basic)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/dhnsl_hack.scm")  (defprotocol dhnsl basic
tst/dhstatic-state.tst view
@@ -1,6 +1,6 @@ (herald dhstatic-state (algebra diffie-hellman) (bound 16)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/dhstatic-state.scm") (comment "Strand count bounded at 16") 
tst/disclosure.tst view
@@ -1,6 +1,6 @@ (herald disclosure) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/disclosure.scm")  (defprotocol disc basic
tst/doorsep.tst view
@@ -1,6 +1,6 @@ (herald doorsep (comment "Door Simple Example Protocol")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/doorsep.scm")  (defprotocol doorsep basic
tst/doorsep2invk.tst view
@@ -1,6 +1,6 @@ (herald doorsep2invk (comment "Door Simple Example Protocol")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/doorsep2invk.scm")  (defprotocol doorsep basic
tst/dy.tst view

file too large to diff

tst/encsig.tst view
@@ -1,7 +1,7 @@ (herald "Encrypted Signed Message Example"   (comment "Shows examples of key usage of asymmetric keys")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/encsig.scm")  (defprotocol mult-keys-enc-sig basic
tst/envelope.tst view
@@ -1,6 +1,6 @@ (herald "Envelope Protocol" (bound 15)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/envelope.scm") (comment "Strand count bounded at 15") 
tst/epmo-hash.tst view
@@ -1,7 +1,7 @@ (herald "Electronic Purchase with Money Order Protocol with Key Hashing"   (comment "Annotated with trust management formulas")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/epmo-hash.scm")  (defprotocol epmo basic
tst/epmo-key-hash.tst view
@@ -1,7 +1,7 @@ (herald "Electronic Purchase with Money Order Protocol with Key Hashing"   (comment "Annotated with trust management formulas")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/epmo-key-hash.scm")  (defprotocol epmo basic
tst/epmo.tst view
@@ -1,7 +1,7 @@ (herald "Electronic Purchase with Money Order Protocol"   (comment "Annotated with trust management formulas")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/epmo.scm")  (defprotocol epmo basic
tst/epmo_acctnum-key-hash.tst view
@@ -2,7 +2,7 @@   "Electronic Purchase with Money Order Protocol Variant with Key Hashing"   (comment "This version includes account numbers in exchanges")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/epmo_acctnum-key-hash.scm")  (defprotocol epmo_acctnum basic
tst/epmo_acctnum.tst view
@@ -2,7 +2,7 @@   (bound 12) (limit 5000)   (comment "This version includes account numbers in exchanges")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/epmo_acctnum.lsp") (comment "Step count limited to 5000") 
tst/expand.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "Expanded macros")  (herald expand (expand) (comment "test macro expansion"))
tst/facts.tst view
@@ -1,6 +1,6 @@ (herald facts) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/facts.scm")  (defprotocol unilateral basic
tst/factvar.tst view
@@ -1,6 +1,6 @@ (herald factvar) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/factvar.scm")  (defprotocol free-fact-var basic
tst/ffgg.tst view
@@ -1,7 +1,7 @@ (herald "The ffgg Protocol"   (comment "From A Necessarily Parallel Attack by Jon K. Millen")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/ffgg.scm")  (defprotocol ffgg basic
tst/fluffy_draft03_gske.tst view
@@ -3,7 +3,7 @@   (comment     "Based on the Internet-Draft: https://www.ietf.org/archive/id/draft-hardjono-ace-fluffy-03.txt")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/fluffy_draft03_gske.scm")  (defprotocol fluffy basic
tst/fragile_pruning.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/fragile_pruning.scm")  (defprotocol fragile_pruning basic
tst/goals.tst view
@@ -1,6 +1,6 @@ (herald goals) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/goals.scm")  (defprotocol ns basic
tst/goalsvar.tst view
@@ -1,6 +1,6 @@ (herald goalsvar) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/goalsvar.scm")  (defprotocol ns basic
tst/hashtest-key-hash.tst view
@@ -1,6 +1,6 @@ (herald "Hashtest") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/hashtest-key-hash.scm")  (defprotocol hashtest basic
tst/hashtest.tst view
@@ -1,6 +1,6 @@ (herald "Hashtest") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/hashtest.scm")  (defprotocol hashtest basic
tst/incompleteness_example.tst view
@@ -1,7 +1,7 @@ (herald incompleteness-example   (comment "Shows a shape not found by CPSA")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/incompleteness_example.scm")  (defprotocol incompleteness-example basic
tst/isoreject-corrected.tst view
@@ -1,6 +1,6 @@ (herald isoreject-corrected) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/isoreject-corrected.scm")  (defprotocol isofix basic
tst/isoreject.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/isoreject.scm")  (defprotocol isoreject basic
tst/kelly1.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/kelly1.scm")  (defprotocol kelly1 basic
tst/kerberos.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/kerberos.scm")  (defprotocol kerberos basic
+ tst/lemmas.scm view
@@ -0,0 +1,61 @@+(herald goalsvar)++;;; Section 1 --- Examples from CPSA and Formal Security Goals++;;; Needham-Schroeder from Section 10 of the CPSA Primer++(defprotocol ns basic+  (defrole init+    (vars (a b name) (n1 n2 text))+    (trace+     (send (enc n1 a (pubk b)))+     (recv (enc n1 n2 (pubk a)))+     (send (enc n2 (pubk b)))))+  (defrole resp+    (vars (b a name) (n2 n1 text))+    (trace+     (recv (enc n1 a (pubk b)))+     (send (enc n1 n2 (pubk a)))+     (recv (enc n2 (pubk b)))))+  (comment "Needham-Schroeder with no role origination assumptions"))++(deflemma rule lemma1 ns+  (forall ((b name) (n1 text) (z0 strd))+    (implies+     (and +      (strand init z0 3 (n1 n1) (b b))+      (non (privk b)) (uniq n1))+     (exists ((z1 strd))+	     (strand resp z1 2 (b b)))))+  (comment "Skeleton 1")+  (comment "Authentication goal: agreement on name b"))++(deflemma both lemma2 ns+  (forall ((b name) (n1 text) (z0 strd))+    (implies+     (and (strand init z0 3 (n1 n1) (b b))+      (non (privk b)) (uniq n1))+     (exists ((z1 strd))+        (and +          (strand resp z1 2 (b b))+	      (prec z1 1 z0 2)))))+  (comment "Prec example. Skeleton 2"))++(deflemma goal lemma3 ns+  (forall ((a b name) (n2 text) (z0 strd))+    (implies+     (and (strand resp z0 3 (n2 n2) (a a) (b b))+      (non (privk a)) (uniq n2))+     (exists ((z1 strd))+      (strand init z1 2 (b b)))))+  (comment "Skeleton 3")+  (comment "Failed authentication goal: agreement on name b"))++(defgoal ns+  (forall ((a b name) (n2 text) (z0 strd))+    (implies+     (and (strand resp z0 3 (n2 n2) (a a) (b b))+      (non (privk a)) (uniq n2))+     (exists ((z1 strd))+      (strand init z1 2 (b b)))))+  (comment "Skeleton 4"))
+ tst/lemmas.tst view
@@ -0,0 +1,317 @@+(herald goalsvar)++(comment "CPSA 4.4.9")+(comment "All input read from lemmas.scm")++(defprotocol ns basic+  (defrole init+    (vars (a b name) (n1 n2 text))+    (trace (send (enc n1 a (pubk b))) (recv (enc n1 n2 (pubk a)))+      (send (enc n2 (pubk b)))))+  (defrole resp+    (vars (b a name) (n2 n1 text))+    (trace (recv (enc n1 a (pubk b))) (send (enc n1 n2 (pubk a)))+      (recv (enc n2 (pubk b)))))+  (defrule lemma1+    (forall ((b name) (n1 text) (z0 strd))+      (implies+        (and (p "init" z0 (idx 3)) (p "init" "n1" z0 n1)+          (p "init" "b" z0 b) (non (privk b)) (uniq n1))+        (exists ((z1 strd))+          (and (p "resp" z1 (idx 2))+            (p "resp" "b" z1 b))))) (comment Lemma not checked)+    (comment "Skeleton 1")+    (comment "Authentication goal: agreement on name b"))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (comment "Needham-Schroeder with no role origination assumptions"))++(defskeleton ns+  (vars (n1 n2 text) (b a name))+  (defstrand init 3 (n1 n1) (n2 n2) (a a) (b b))+  (non-orig (privk b))+  (uniq-orig n1)+  (goals+    (forall ((b name) (n1 text) (z0 strd))+      (implies+        (and (strand init z0 3 (n1 n1) (b b)) (non (privk b)) (uniq n1))+        (exists ((z1 strd))+          (and (strand resp z1 2 (b b)) (prec z1 1 z0 2))))))+  (comment "Prec example. Skeleton 2" Lemma: lemma2)+  (traces+    ((send (enc n1 a (pubk b))) (recv (enc n1 n2 (pubk a)))+      (send (enc n2 (pubk b)))))+  (label 0)+  (unrealized (0 1))+  (maps ((0) ((b b) (n1 n1) (a a) (n2 n2))))+  (origs (n1 (0 0)))+  (comment "Not closed under rules"))++(defskeleton ns+  (vars (n1 n2 n2-0 n1-0 text) (a b a-0 name))+  (defstrand init 3 (n1 n1) (n2 n2) (a a) (b b))+  (defstrand resp 2 (n2 n2-0) (n1 n1-0) (b b) (a a-0))+  (non-orig (privk b))+  (uniq-orig n1)+  (goals+    (forall ((b name) (n1 text) (z0 strd))+      (implies+        (and (strand init z0 3 (n1 n1) (b b)) (non (privk b)) (uniq n1))+        (exists ((z1 strd))+          (and (strand resp z1 2 (b b)) (prec z1 1 z0 2))))))+  (comment "Prec example. Skeleton 2" Lemma: lemma2)+  (rule lemma1)+  (traces+    ((send (enc n1 a (pubk b))) (recv (enc n1 n2 (pubk a)))+      (send (enc n2 (pubk b))))+    ((recv (enc n1-0 a-0 (pubk b))) (send (enc n1-0 n2-0 (pubk a-0)))))+  (label 1)+  (parent 0)+  (unrealized (0 1))+  (maps ((0) ((b b) (n1 n1) (a a) (n2 n2))))+  (comment "2 in cohort - 2 not yet seen"))++(defskeleton ns+  (vars (n2 n2-0 n1 text) (b a name))+  (defstrand init 3 (n1 n1) (n2 n2) (a a) (b b))+  (defstrand resp 2 (n2 n2-0) (n1 n1) (b b) (a a))+  (precedes ((0 0) (1 0)) ((1 1) (0 1)))+  (non-orig (privk b))+  (uniq-orig n1)+  (goals+    (forall ((b name) (n1 text) (z0 strd))+      (implies+        (and (strand init z0 3 (n1 n1) (b b)) (non (privk b)) (uniq n1))+        (exists ((z1 strd))+          (and (strand resp z1 2 (b b)) (prec z1 1 z0 2))))))+  (comment "Prec example. Skeleton 2" Lemma: lemma2)+  (operation nonce-test (displaced 2 1 resp 2) n1-0 (0 1)+    (enc n1-0 a-0 (pubk b)))+  (strand-map 0 1)+  (traces+    ((send (enc n1 a (pubk b))) (recv (enc n1 n2 (pubk a)))+      (send (enc n2 (pubk b))))+    ((recv (enc n1 a (pubk b))) (send (enc n1 n2-0 (pubk a)))))+  (label 2)+  (parent 1)+  (realized)+  (shape)+  (satisfies yes)+  (maps ((0) ((b b) (n1 n1) (a a) (n2 n2))))+  (origs (n1 (0 0))))++(defskeleton ns+  (vars (n1 n2 n2-0 n1-0 n2-1 text) (a b a-0 name))+  (defstrand init 3 (n1 n1) (n2 n2) (a a) (b b))+  (defstrand resp 2 (n2 n2-0) (n1 n1-0) (b b) (a a-0))+  (defstrand resp 2 (n2 n2-1) (n1 n1) (b b) (a a))+  (precedes ((0 0) (2 0)) ((2 1) (0 1)))+  (non-orig (privk b))+  (uniq-orig n1)+  (goals+    (forall ((b name) (n1 text) (z0 strd))+      (implies+        (and (strand init z0 3 (n1 n1) (b b)) (non (privk b)) (uniq n1))+        (exists ((z1 strd))+          (and (strand resp z1 2 (b b)) (prec z1 1 z0 2))))))+  (comment "Prec example. Skeleton 2" Lemma: lemma2)+  (operation nonce-test (added-strand resp 2) n1 (0 1)+    (enc n1 a (pubk b)))+  (strand-map 0 1)+  (traces+    ((send (enc n1 a (pubk b))) (recv (enc n1 n2 (pubk a)))+      (send (enc n2 (pubk b))))+    ((recv (enc n1-0 a-0 (pubk b))) (send (enc n1-0 n2-0 (pubk a-0))))+    ((recv (enc n1 a (pubk b))) (send (enc n1 n2-1 (pubk a)))))+  (label 3)+  (parent 1)+  (seen 2)+  (seen-ops+    (2 (operation generalization deleted (1 0)) (strand-map 0 2)))+  (realized)+  (maps ((0) ((b b) (n1 n1) (a a) (n2 n2))))+  (comment "1 in cohort - 0 not yet seen"))++(comment "Nothing left to do")++(defprotocol ns basic+  (defrole init+    (vars (a b name) (n1 n2 text))+    (trace (send (enc n1 a (pubk b))) (recv (enc n1 n2 (pubk a)))+      (send (enc n2 (pubk b)))))+  (defrole resp+    (vars (b a name) (n2 n1 text))+    (trace (recv (enc n1 a (pubk b))) (send (enc n1 n2 (pubk a)))+      (recv (enc n2 (pubk b)))))+  (defrule lemma2+    (forall ((b name) (n1 text) (z0 strd))+      (implies+        (and (p "init" z0 (idx 3)) (p "init" "n1" z0 n1)+          (p "init" "b" z0 b) (non (privk b)) (uniq n1))+        (exists ((z1 strd))+          (and (p "resp" z1 (idx 2)) (p "resp" "b" z1 b)+            (prec z1 (idx 1) z0+              (idx 2)))))) (comment Lemma has associated query)+    (comment "Prec example. Skeleton 2"))+  (defrule lemma1+    (forall ((b name) (n1 text) (z0 strd))+      (implies+        (and (p "init" z0 (idx 3)) (p "init" "n1" z0 n1)+          (p "init" "b" z0 b) (non (privk b)) (uniq n1))+        (exists ((z1 strd))+          (and (p "resp" z1 (idx 2))+            (p "resp" "b" z1 b))))) (comment Lemma not checked)+    (comment "Skeleton 1")+    (comment "Authentication goal: agreement on name b"))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (comment "Needham-Schroeder with no role origination assumptions"))++(defskeleton ns+  (vars (n2 n1 text) (a b name))+  (defstrand resp 3 (n2 n2) (n1 n1) (b b) (a a))+  (non-orig (privk a))+  (uniq-orig n2)+  (goals+    (forall ((a b name) (n2 text) (z0 strd))+      (implies+        (and (strand resp z0 3 (n2 n2) (a a) (b b)) (non (privk a))+          (uniq n2)) (exists ((z1 strd)) (strand init z1 2 (b b))))))+  (comment "Skeleton 3"+    "Failed authentication goal: agreement on name b" Lemma: lemma3)+  (traces+    ((recv (enc n1 a (pubk b))) (send (enc n1 n2 (pubk a)))+      (recv (enc n2 (pubk b)))))+  (label 4)+  (unrealized (0 2))+  (maps ((0) ((a a) (b b) (n2 n2) (n1 n1))))+  (origs (n2 (0 1)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton ns+  (vars (n2 n1 text) (a b b-0 name))+  (defstrand resp 3 (n2 n2) (n1 n1) (b b) (a a))+  (defstrand init 3 (n1 n1) (n2 n2) (a a) (b b-0))+  (precedes ((0 1) (1 1)) ((1 2) (0 2)))+  (non-orig (privk a))+  (uniq-orig n2)+  (goals+    (forall ((a b name) (n2 text) (z0 strd))+      (implies+        (and (strand resp z0 3 (n2 n2) (a a) (b b)) (non (privk a))+          (uniq n2)) (exists ((z1 strd)) (strand init z1 2 (b b))))))+  (comment "Skeleton 3"+    "Failed authentication goal: agreement on name b" Lemma: lemma3)+  (operation nonce-test (added-strand init 3) n2 (0 2)+    (enc n1 n2 (pubk a)))+  (strand-map 0)+  (traces+    ((recv (enc n1 a (pubk b))) (send (enc n1 n2 (pubk a)))+      (recv (enc n2 (pubk b))))+    ((send (enc n1 a (pubk b-0))) (recv (enc n1 n2 (pubk a)))+      (send (enc n2 (pubk b-0)))))+  (label 5)+  (parent 4)+  (realized)+  (shape)+  (satisfies (no (p "init" "b" z1 b) (a a) (b b) (n2 n2) (z0 0)))+  (maps ((0) ((a a) (b b) (n2 n2) (n1 n1))))+  (origs (n2 (0 1))))++(comment "Nothing left to do")++(defprotocol ns basic+  (defrole init+    (vars (a b name) (n1 n2 text))+    (trace (send (enc n1 a (pubk b))) (recv (enc n1 n2 (pubk a)))+      (send (enc n2 (pubk b)))))+  (defrole resp+    (vars (b a name) (n2 n1 text))+    (trace (recv (enc n1 a (pubk b))) (send (enc n1 n2 (pubk a)))+      (recv (enc n2 (pubk b)))))+  (defrule lemma2+    (forall ((b name) (n1 text) (z0 strd))+      (implies+        (and (p "init" z0 (idx 3)) (p "init" "n1" z0 n1)+          (p "init" "b" z0 b) (non (privk b)) (uniq n1))+        (exists ((z1 strd))+          (and (p "resp" z1 (idx 2)) (p "resp" "b" z1 b)+            (prec z1 (idx 1) z0+              (idx 2)))))) (comment Lemma has associated query)+    (comment "Prec example. Skeleton 2"))+  (defrule lemma1+    (forall ((b name) (n1 text) (z0 strd))+      (implies+        (and (p "init" z0 (idx 3)) (p "init" "n1" z0 n1)+          (p "init" "b" z0 b) (non (privk b)) (uniq n1))+        (exists ((z1 strd))+          (and (p "resp" z1 (idx 2))+            (p "resp" "b" z1 b))))) (comment Lemma not checked)+    (comment "Skeleton 1")+    (comment "Authentication goal: agreement on name b"))+  (defgenrule neqRl_indx+    (forall ((x indx)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_strd+    (forall ((x strd)) (implies (fact neq x x) (false))))+  (defgenrule neqRl_mesg+    (forall ((x mesg)) (implies (fact neq x x) (false))))+  (comment "Needham-Schroeder with no role origination assumptions"))++(defskeleton ns+  (vars (n2 n1 text) (a b name))+  (defstrand resp 3 (n2 n2) (n1 n1) (b b) (a a))+  (non-orig (privk a))+  (uniq-orig n2)+  (goals+    (forall ((a b name) (n2 text) (z0 strd))+      (implies+        (and (strand resp z0 3 (n2 n2) (a a) (b b)) (non (privk a))+          (uniq n2)) (exists ((z1 strd)) (strand init z1 2 (b b))))))+  (comment "Skeleton 4")+  (traces+    ((recv (enc n1 a (pubk b))) (send (enc n1 n2 (pubk a)))+      (recv (enc n2 (pubk b)))))+  (label 6)+  (unrealized (0 2))+  (maps ((0) ((a a) (b b) (n2 n2) (n1 n1))))+  (origs (n2 (0 1)))+  (comment "1 in cohort - 1 not yet seen"))++(defskeleton ns+  (vars (n2 n1 text) (a b b-0 name))+  (defstrand resp 3 (n2 n2) (n1 n1) (b b) (a a))+  (defstrand init 3 (n1 n1) (n2 n2) (a a) (b b-0))+  (precedes ((0 1) (1 1)) ((1 2) (0 2)))+  (non-orig (privk a))+  (uniq-orig n2)+  (goals+    (forall ((a b name) (n2 text) (z0 strd))+      (implies+        (and (strand resp z0 3 (n2 n2) (a a) (b b)) (non (privk a))+          (uniq n2)) (exists ((z1 strd)) (strand init z1 2 (b b))))))+  (comment "Skeleton 4")+  (operation nonce-test (added-strand init 3) n2 (0 2)+    (enc n1 n2 (pubk a)))+  (strand-map 0)+  (traces+    ((recv (enc n1 a (pubk b))) (send (enc n1 n2 (pubk a)))+      (recv (enc n2 (pubk b))))+    ((send (enc n1 a (pubk b-0))) (recv (enc n1 n2 (pubk a)))+      (send (enc n2 (pubk b-0)))))+  (label 7)+  (parent 6)+  (realized)+  (shape)+  (satisfies (no (p "init" "b" z1 b) (a a) (b b) (n2 n2) (z0 0)))+  (maps ((0) ((a a) (b b) (n2 n2) (n1 n1))))+  (origs (n2 (0 1))))++(comment "Nothing left to do")
tst/locn_envelope.tst view
@@ -1,7 +1,7 @@ (herald "Envelope Protocol, location-based version" (bound 30)   (limit 1200)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/locn_envelope.scm") (comment "Step count limited to 1200") (comment "Strand count bounded at 30")
tst/mass.tst view
@@ -1,6 +1,6 @@ (herald mass (bound 8)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/mass.lsp") (comment "Strand count bounded at 8") 
tst/mass2.tst view
@@ -1,6 +1,6 @@ (herald mass2 (bound 8)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/mass2.lsp") (comment "Strand count bounded at 8") 
tst/missing_contraction.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/missing_contraction.scm")  (defprotocol missing-contraction basic
tst/neq_test.tst view
@@ -2,7 +2,7 @@   (comment "First skeleton should have a shape,"     "second should be dead.")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/neq_test.scm")  (defprotocol neq-test basic
tst/neuman-stubblebine-reauth.tst view
@@ -1,6 +1,6 @@ (herald neuman-stubblebine-reauth (bound 8)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/neuman-stubblebine-reauth.lsp") (comment "Strand count bounded at 8") 
tst/neuman-stubblebine.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/neuman-stubblebine.scm")  (defprotocol neuman-stubblebine basic
tst/no_contraction.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/no_contraction.scm")  (defprotocol no-contraction basic
tst/non_transforming.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/non_transforming.scm")  (defprotocol non_transforming basic
tst/nonaug-prune.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/nonaug-prune.scm")  (defprotocol nonaug-prune basic
tst/ns-l.tst view
@@ -1,7 +1,7 @@ (herald "Needham-Schroeder-Low Public-Key Protocol"   (comment "With deflistener's")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/ns-l.scm")  (defprotocol ns basic
tst/ns-rebinding.tst view
@@ -1,6 +1,6 @@ (herald "ALternate Needham-Schroeder Public-Key Protocol Variants") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/ns-rebinding.scm")  (defprotocol ns basic
tst/ns.tst view
@@ -1,6 +1,6 @@ (herald "Needham-Schroeder Public-Key Protocol Variants") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/ns.scm")  (defprotocol ns basic
tst/nsl3.tst view
@@ -1,6 +1,6 @@ (herald "Three Party Needham-Schroeder-Lowe Protocol") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/nsl3.scm")  (defprotocol nsl3 basic
tst/nslsk.tst view
@@ -1,6 +1,6 @@ (herald "Needham-Schroeder-Lowe Protocol with symmetric encryption") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/nslsk.scm")  (defprotocol nslsk basic
tst/open-closed-multiloc.tst view
@@ -1,6 +1,6 @@ (herald open-closed (bound 44)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/open-closed-multiloc.scm") (comment "Strand count bounded at 44") 
tst/open-closed-tag.tst view
@@ -1,6 +1,6 @@ (herald open-closed (bound 44)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/open-closed-tag.scm") (comment "Strand count bounded at 44") 
tst/open-closed.tst view
@@ -1,6 +1,6 @@ (herald open-closed (bound 44)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/open-closed.scm") (comment "Strand count bounded at 44") 
tst/or.tst view
@@ -1,7 +1,7 @@ (herald "Otway-Rees Protocol"   (comment "Standard version using variables of sort mesg")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/or.scm")  (defprotocol or basic
tst/ordered.tst view
@@ -1,6 +1,6 @@ (herald ordered) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/ordered.scm")  (defprotocol ordered basic
tst/orderedvar.tst view
@@ -1,6 +1,6 @@ (herald ordered) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/orderedvar.scm")  (defprotocol ordered basic
tst/pca.tst view
@@ -1,7 +1,7 @@ (herald "Privacy Certificate Authority" (bound 15)   (comment "Generation of an Attestation Identity Certificate")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/pca.scm") (comment "Strand count bounded at 15") 
tst/pen-non-orig-test.tst view
@@ -1,6 +1,6 @@ (herald "pen-non-orig test") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/pen-non-orig-test.scm")  (defprotocol pennonorigtest basic
tst/pfs-via-pubkey.tst view
@@ -1,6 +1,6 @@ (herald pfs-via-pubkey) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/pfs-via-pubkey.scm")  (defprotocol pfs-easy basic
tst/pkinit.tst view
@@ -1,6 +1,6 @@ (herald "Kerberos PK init") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/pkinit.scm")  (defprotocol pkinit basic
tst/preprocess.tst view
@@ -1,6 +1,6 @@ (herald "Pre-processing test example: modified NS with two responders") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/preprocess.scm")  (defprotocol ns basic
tst/print.tst view
@@ -1,7 +1,7 @@ (herald "Print Test"   (comment "See if read forms look like printed ones")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/print.scm")  (defprotocol print-test basic
tst/prottrans.tst view
@@ -1,6 +1,6 @@ (herald "Protocol Transformations With Rules") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/prottrans.scm")  (defprotocol ns basic
tst/pruning1.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/pruning1.scm")  (defprotocol prune basic
tst/puzzle_example.tst view
@@ -1,6 +1,6 @@ (herald puzzle_example) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/puzzle_example.scm")  (defprotocol puzzle basic
tst/reflect.tst view
@@ -1,6 +1,6 @@ (herald reflect) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/reflect.scm")  (defprotocol reflect basic
tst/renamings.tst view
@@ -2,7 +2,7 @@   (comment "There is a flaw in this protocol by design")   (comment "It also shows how variable renaming works")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/renamings.scm")  (defprotocol blanchet basic
tst/role_uniq.tst view
@@ -1,6 +1,6 @@ (herald "Role Unique Origination") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/role_uniq.scm")  (defprotocol blanchet basic
tst/rule-node.tst view
@@ -1,6 +1,6 @@ (herald rule-node) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/rule-node.scm")  (defprotocol rule-order basic
tst/rule-order.tst view
@@ -1,6 +1,6 @@ (herald rule-order) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/rule-order.scm")  (defprotocol rule-order basic
tst/sigenc.tst view
@@ -1,7 +1,7 @@ (herald "Signed Encrypted Message Example"   (comment "Shows examples of key usage of asymmetric keys")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/sigenc.scm")  (defprotocol mult-keys-sig-enc basic
tst/sorted_epmo_acctnum.tst view
@@ -4,7 +4,7 @@     "This version uses sorts to avoid confusion"     "between a nonce and other data")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/sorted_epmo_acctnum.scm")  (defprotocol sorted_epmo_acctnum basic
tst/sts.tst view
@@ -1,7 +1,7 @@ (herald "Station-to-station protocol" (bound 20)   (algebra diffie-hellman)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/sts.scm") (comment "Strand count bounded at 20") 
tst/sts_non_role.tst view
@@ -1,7 +1,7 @@ (herald "Station-to-station protocol:  Weakened version" (bound 20)   (algebra diffie-hellman)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/sts_non_role.scm") (comment "Strand count bounded at 20") 
tst/sts_weakened_reflect.tst view
@@ -1,7 +1,7 @@ (herald "station-to-station-reflect protocol" (bound 20)   (algebra diffie-hellman)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/sts_weakened_reflect.scm") (comment "Strand count bounded at 20") 
tst/subatomic-open-closed-test-genrule.tst view
@@ -1,6 +1,6 @@ (herald subatomic-open-closed-test-genrule (bound 40)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment   "All input read from tst/subatomic-open-closed-test-genrule.scm") (comment "Strand count bounded at 40")
tst/subatomic-open-closed.tst view
@@ -1,6 +1,6 @@ (herald subatomic-open-closed (bound 40)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/subatomic-open-closed.scm") (comment "Strand count bounded at 40") 
tst/sync_locn_envelope.tst view
@@ -1,7 +1,7 @@ (herald "Envelope Protocol, location-based version" (check-nonces)   (bound 30) (limit 6000)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/sync_locn_envelope.scm") (comment "Step count limited to 6000") (comment "Strand count bounded at 30")
tst/targetterms1.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/targetterms1.scm")  (defprotocol targetterms basic
tst/targetterms2.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/targetterms2.scm")  (defprotocol targetterms2 basic
tst/targetterms6.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/targetterms6.scm")  (defprotocol targetterms6 basic
tst/targetterms8.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/targetterms8.scm")  (defprotocol targetterms8 basic
tst/thisthat.tst view
@@ -1,6 +1,6 @@ (herald "Needham-Schroeder Public-Key Protocol This-That Variant") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/thisthat.scm")  (defprotocol thisthat basic
tst/tickle-unique.tst view
@@ -1,6 +1,6 @@ (herald tickle-unique) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/tickle-unique.scm")  (defprotocol tickle basic
tst/timestamping.tst view
@@ -1,6 +1,6 @@ (herald timestamping-service) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/timestamping.scm")  (defprotocol timestamping-service basic
tst/trust-anchor.tst view
@@ -1,7 +1,7 @@ (herald trust-anchor   (comment "Tests rule application on initial skeleton")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/trust-anchor.scm")  (defprotocol trust-anchor basic
tst/ugen-at.tst view
@@ -1,6 +1,6 @@ (herald uniq-at) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/ugen-at.scm")  (defprotocol yahalom-plus-uniq-at basic
tst/ugo.tst view
@@ -1,7 +1,7 @@ (herald uniq-gen-and-orig-example   (comment "Non-executable role examples")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/ugo.scm")  (defprotocol uniq-gen-example basic
tst/uncarried_keys.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/uncarried_keys.scm")  (defprotocol uncarried-keys basic
tst/unilateral.tst view
@@ -1,6 +1,6 @@ (herald unilateral) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/unilateral.scm")  (defprotocol unilateral basic
tst/uniq-at.tst view
@@ -1,6 +1,6 @@ (herald uniq-at) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/uniq-at.scm")  (defprotocol yahalom-plus-uniq-at basic
tst/uniq-gen-test.tst view
@@ -1,7 +1,7 @@ (herald "Unique generation test protocols."   (comment "Skeletons 2, 4, and 7 should have no shapes.")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/uniq-gen-test.scm")  (defprotocol uniqgentest basic
tst/uo.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/uo.scm")  (defprotocol uniq-orig basic
tst/wang-hash.tst view
@@ -1,6 +1,6 @@ (herald "Wang's Fair Exchange Protocol" (bound 10)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/wang-hash.scm") (comment "Strand count bounded at 10") 
tst/wang-key-hash.tst view
@@ -1,6 +1,6 @@ (herald "Wang's Fair Exchange Protocol" (bound 10)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/wang-key-hash.scm") (comment "Strand count bounded at 10") 
tst/weird.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/weird.scm")  (defprotocol weird basic
tst/wide-mouth-frog-scyther.tst view
@@ -1,7 +1,7 @@ (herald "Wide-Mouth Frog Protocol from Scyther" (bound 8)   (comment "This protocol has an infinite number of shapes")) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/wide-mouth-frog-scyther.lsp") (comment "Strand count bounded at 8") 
tst/wide-mouth-frog.tst view
@@ -1,7 +1,7 @@ (herald "Wide-Mouth Frog Protocol"   (comment "This protocol has an infinite number of shapes") (bound 8)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/wide-mouth-frog.lsp") (comment "Strand count bounded at 8") 
tst/wonthull.tst view
@@ -1,6 +1,6 @@ (herald wonthull (bound 9)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/wonthull.scm") (comment "Strand count bounded at 9") 
tst/wonthull2.tst view
@@ -1,6 +1,6 @@ (herald wonthull2 (bound 9)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/wonthull2.scm") (comment "Strand count bounded at 9") 
tst/wonthull3.tst view
@@ -1,4 +1,4 @@-(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/wonthull3.scm")  (defprotocol wonthull3 basic
tst/woolam.tst view
@@ -1,6 +1,6 @@ (herald "Woo-Lam Protocol") -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/woolam.scm")  (defprotocol woolam basic
tst/yahalom-6.3.6.tst view
@@ -5,7 +5,7 @@   (url "http://www.eecs.umich.edu/acal/swerve/docs/49-1.pdf")   (bound 15)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/yahalom-6.3.6.scm") (comment "Strand count bounded at 15") 
tst/yahalom-forward.tst view
@@ -1,6 +1,6 @@ (herald "Yahalom Protocol With Forwarding" (bound 15)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/yahalom-forward.scm") (comment "Strand count bounded at 15") 
tst/yahalom.tst view
@@ -1,6 +1,6 @@ (herald "Yahalom Protocol Without Forwarding" (bound 15)) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/yahalom.scm") (comment "Strand count bounded at 15") 
tst/yes-or-no.tst view
@@ -1,6 +1,6 @@ (herald yes-or-no) -(comment "CPSA 4.4.8")+(comment "CPSA 4.4.9") (comment "All input read from tst/yes-or-no.scm")  (defprotocol yes-or-no basic