This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Solving the insecurity problem for assertions

R Ramanujam
The Institute of Mathematical Sciences, Chennai (Retd.)
Homi Bhabha National Institute, Mumbai (Retd.)
Azim Premji University, Bengaluru (Visiting)
Bengaluru, India
Email: jam@imsc.res.in
   Vaishnavi Sundararajan
Dept of Computer Science & Engineering
Indian Institute of Technology Delhi
New Delhi, India
Email: vaishnavi@cse.iitd.ac.in
   S P Suresh
Chennai Mathematical Institute
CNRS UMI 2000 ReLaX
Chennai, India
Email: spsuresh@cmi.ac.in
Partially supported by a grant from the Infosys Foundation.
Abstract

In the symbolic verification of cryptographic protocols, a central problem is deciding whether a protocol admits an execution which leaks a designated secret to the malicious intruder. In [38], it is shown that, when considering finitely many sessions, this “insecurity problem” is NP-complete. Central to their proof strategy is the observation that any execution of a protocol can be simulated by one where the intruder only communicates terms of bounded size. However, when we consider models where, in addition to terms, one can also communicate logical statements about terms, the analysis of the insecurity problem becomes tricky when both these inference systems are considered together. In this paper we consider the insecurity problem for protocols with logical statements that include equality on terms and existential quantification. Witnesses for existential quantifiers may be unbounded, and obtaining small witness terms while maintaining equality proofs complicates the analysis considerably. We extend techniques from [38] to show that this problem is also in NP.

1 Introduction

1.1 Symbolic analysis of cryptographic protocols

Symbolic analysis of security protocols is a long-standing field of study, with the Dolev-Yao model [22] being the standard. In this model, cryptographic operations are abstracted as operators in a term algebra, and the ability to build new messages from old ones is specified by rewrite rules or a proof system. The model includes an intruder who controls the network, and can see, block, inject, redirect, as well as derive terms, but cannot break cryptography. Informally, protocols are specified as a finite sequence of communications between principals/agents. We now illustrate this model using an example.

Example 1.

Alice sends to Bob her public key as well as a randomly-chosen value encrypted in Bob’s public key. Bob receives it, decrypts it using his private key, encrypts it in Alice’s public key, and sends it back to her. We split each communication into a send and a receive. We formalize the protocol as two roles: an initiator role 𝗂𝗇𝗂𝗍(A,B){{\sf init}}(A,B) (left column) and a responder role 𝗋𝖾𝗌𝗉(B){{\sf resp}}(B) (right column). We use !C!C and ?C?C to denote a send and a receive respectively by an agent C{A,B}C\in\{A,B\}. kAk_{A} and kBk_{B} stand for the private keys of AA and BB respectively, 𝑝𝑘(k)\mathit{pk}(k) stands for the public key corresponding to a key kk, and {t}k\{t\}_{k} stands for the encryption of a message tt using a key kk.

A\displaystyle A :Generate freshm\displaystyle:\text{Generate fresh}\ m
!A\displaystyle!A :(𝑝𝑘(kA),{m}𝑝𝑘(kB))\displaystyle:(\mathit{pk}(k_{A}),\{m\}_{\mathit{pk}(k_{B})})
?A\displaystyle?A :{m}𝑝𝑘(kA)\displaystyle:\{m\}_{\mathit{pk}(k_{A})}

width 2pt ?B\displaystyle?B :(x,{y}𝑝𝑘(kB))\displaystyle:(x,\{y\}_{\mathit{pk}(k_{B})}) !B\displaystyle!B :{y}x\displaystyle:\{y\}_{x}

The protocol itself can be thought of as a program running potentially unboundedly-many copies (sessions) of 𝗂𝗇𝗂𝗍{{\sf init}} and 𝗋𝖾𝗌𝗉{{\sf resp}} in parallel. Each copy instantiates parameters AA and BB with agent names, while xx and yy denote parts of messages received while participating in a session, and will be instantiated accordingly. An execution (run) of a protocol is an interleaving of a finite set of sessions, such that every sent message can be generated by the sender (based on their current knowledge), and received messages by the intruder II (since every received message comes from the channel, and could have been potentially tampered with by the intruder).

Is there any execution of this protocol at the end of which the intruder can derive mm? This property is called confidentiality. In fact, the intruder can effect the following man-in-the-middle attack, at the end of which AA thinks mm is secret between her and BB, while BB thinks mm is secret between him and II. BB receives a message where xx can be matched with 𝑝𝑘(kI)\mathit{pk}(k_{I}) and yy with mm, and thus sends out {m}𝑝𝑘(kI)\{m\}_{\mathit{pk}(k_{I})}.

!A\displaystyle!A :(𝑝𝑘(kA),{m}𝑝𝑘(kB))\displaystyle:(\mathit{pk}(k_{A}),\{m\}_{\mathit{pk}(k_{B})})
?B\displaystyle?B :(𝑝𝑘(kI),{m}𝑝𝑘(kB))\displaystyle:(\mathit{pk}(k_{I}),\{m\}_{\mathit{pk}(k_{B})})
!B\displaystyle!B :{m}𝑝𝑘(kI)\displaystyle:\{m\}_{\mathit{pk}(k_{I})}
?A\displaystyle?A :{m}𝑝𝑘(kA)\displaystyle:\{m\}_{\mathit{pk}(k_{A})}

1.2 Communicating “assertions”

The Dolev-Yao model and its extensions have been studied extensively over the last forty years. People have studied extensions that express richer classes of protocols and security properties [1, 10, 7, 17], and associated decidability and complexity results [12, 8, 16, 15, 30, 18, 36, 37, 23, 9, 14, 2, 20]. Various verification tools have also been built based on these formal models [21, 10, 11, 33, 13].

In this paper, we consider an extension introduced in [35], which gives agents the power to communicate terms as well as logical formulas about them. These formulas, called assertions, involve equality of terms, existential quantification, conjunction, and disjunction. For instance, we can reveal partial information about some encrypted term {m}k\{m\}_{k} to a recipient who does not know the key kk (for instance, that the value of mm is either 0 or 11, without revealing which) by sending the assertion xy[{x}y={m}kx{0,1}]\exists{x}{y}\bigl{[}\{x\}_{y}=\{m\}_{k}\ \wedge\ x\in\{0,1\}\bigr{]}. So we see that assertions allow us to model protocols that involve some kinds of certification. Traditionally, such certification is often modelled using zero-knowledge proofs.

The Dolev-Yao model can also be extended with a special class of zero-knowledge terms [7, 6]. But in these extensions, one important component is missing: logical reasoning over certificates. This is especially important in situations where certificates communicate partial information. For example, two partial-information certificates of the form x{0,1}x\in\{0,1\} and x{0,2}x\in\{0,2\} can lead to the inference of strictly greater information, namely x=0x=0, potentially violating some security guarantees. This is one of the main features of the model in [35]. Making “assertions”, as that paper refers to such logical statements, first-class citizens provides a threefold advantage: a more transparent specification of protocols which captures design intent better, the ability to explicitly reason about certificates and thus analyze protocols more precisely, and the ability to state some security properties more easily. In [35], the authors express examples (the FOO [24] and Helios [3] e-voting protocols) and specify security properties using assertions. We describe the modelling of the FOO protocol in detail in Section 2.3.

In [35], any communicated assertion is “believed” by the recipients. One way to implement this feature is to communicate a zero knowledge proof of the assertion. But formally, we send the assertion itself rather than a term standing for a zero-knowledge proof, which also allows us the possibility of choosing other implementations for the assertion. Another way in which [35] differs from other modelling using ZKP terms is that these proofs need not be built ab initio every time. One can compose a new proof by combining existing proofs. These can be implemented using composable ZKPs [26]. These issues have been discussed in [31], which considers a logical language with conjunction and existential quantification and modular construction of ZKPs for these formulas. However, unlike [31], assertions also allow “destructive reasoning” from existing knowledge via elimination rules.

The main focus in this paper is to solve an interesting technical problem in our model with assertions – the insecurity problem for finitely many sessions.

1.3 The insecurity problem for finitely many sessions

The attack on Example 1 indicates that even for simple protocols, one needs to consider non-trivial scenarios to detect security violations. A canonical problem of interest is the insecurity problem, which asks if a given protocol admits a run that leaks a secret to the intruder. A run is characterized by an interleaving of protocol roles (AA and BB in Example 1), with a substitution for the variables in messages received by agents during these roles. There can be infinitely many such substitutions, i.e. a potentially infinite number of executions, and thus, the insecurity problem is undecidable in general [4, 23, 27]. In [38], the authors consider a restricted set of runs, and show that the insecurity problem is in NP when one considers at most KK sessions, for some fixed KK.

Even with only a finite number of sessions, the intruder can inject arbitrarily large terms in place of variables. Thus, there is no bound on the size of terms encountered in a run. The work in [38] gets around this complication by showing that if there is any attack at all given by an interleaving of roles and a substitution, there is an attack given by the same interleaving and a ‘small’ substitution. This “new” attack is such that the intruder can derive the same terms at the end, and the size of all messages transmitted is bounded by a polynomial in the size of the protocol specification. Hence the insecurity problem with boundedly many sessions can be solved in NP.

As with terms, one can formulate the insecurity problem for assertions as well. The general problem continues to be undecidable, so we consider the case of finitely many sessions. With existential quantification, we now have two types of variables – those used to identify parts of received messages (instantiated at runtime by the actual message sent by the intruder), and quantified variables that occur in assertions. As earlier, there is no a priori bound on the size of terms assigned to the first kind of variables. But there is another source of unboundedness: to derive a quantified assertion x.α\exists{x}.~{}\alpha, one must derive α(t)\alpha(t) for some “witness” tt. There is no a priori bound on the size of tt either, and proof search is further complicated by any potential interaction between these two sources of unboundedness. When we simulate a substitution for the “intruder” variables with a small one, the witnesses for quantifiers might change too, but we still need to preserve some derivations under these new witnesses.

We extend the techniques of [38], while considering interactions between multiple substitutions and having to preserve more complex derivations, to obtain a somewhat surprising result. In this paper, we show that the insecurity problem for assertions for finitely many sessions remains in NP.

1.4 Related work

There are many extensions of the basic Dolev-Yao model that aim to capture various cryptographic operators and their properties [2, 8, 15, 16, 17, 20, 30]. Algebraic properties of operators like xor, blinding, distributive encryption etc. are studied by means of equation theories, which are also referred to as intruder theories in the security literature. Equations in these theories are implicitly universally quantified, and the intention is that any term matching one side of the equation may be replaced by the other side. For example, if the theory contains a rule of the form unblind(sign(blind(x,y),k),y)=sign(x,k)\textit{unblind}(\textit{sign}(\textit{blind}(x,y),k),y)=\textit{sign}(x,k), it means that any instance of the LHS can be replaced by the corresponding instance of the RHS. Such equations correspond to proof rules in the system for deriving terms in this paper (examples of such systems are given in Section 2.1).

Equality assertions, on the other hand, are to be treated literally, and not as rewrite rules. For instance, given an assertion of the form {x}k={t}k\{x\}_{k}=\{t\}_{k}, we cannot replace all terms of the form {u}k\{u\}_{k} by {t}k\{t\}_{k}. In fact, these equality assertions are objects that are manipulated by proof rules, rather than being another style of expressing derivations between terms.

Along with studying the derivability problem for such extensions, several of these papers also extend the results of [38] by addressing the active intruder problem for finitely many sessions. For instance, [15, 16] obtain NP decision procedures in the case of extending Dolev-Yao with rules for xor. The current paper, however, extends [38] along a different dimension, to solve both the passive and active intruder problems for assertions, and is thus not subsumed by any of these works on equation theories.

1.5 Organization of the paper

In Section 2, we first introduce the syntax for terms and assertions. We present an example of modelling with assertions via the FOO e-voting protocol, and then present the proof system for assertions. Then we define protocols and runs for this new system. In Section 3, we first present a high-level overview of the various steps involved in solving the insecurity problem, and then we move on to Section 4, where we present the technical results in detail and prove that insecurity for the assertion system is in NP. We present some ideas for future research in Section 5.

2 Modeling security protocols

2.1 Terms: Syntax and Derivation System

In this model, each communicated message is modelled as a term in an algebra, which has operators for pairing, encryption, hashing etc. New terms can be derived from old ones using proof rules, which specify the behaviour of these operators. We begin with a set 𝒩\mathscr{N} of names (atomic terms, with no further structure), and a set of variables 𝒱\mathscr{V}. We denote by 𝒜𝒩\mathscr{A}\subseteq\mathscr{N} the set of agents, with I𝒜I\in\mathscr{A} being the malicious intruder. We denote by 𝒱q𝒱\mathscr{V}_{q}\subset\mathscr{V} the variables used for quantification, and by 𝒱i\mathscr{V}_{i} the set 𝒱𝒱q\mathscr{V}\setminus\mathscr{V}_{q}. The set of terms, denoted by 𝒯\mathscr{T}, is given by

t𝒯::=xm𝖿(t1,,tn)t\in\mathscr{T}::=x\mid m\mid{\sf f}(t_{1},\ldots,t_{n})

where x𝒱x\in\mathscr{V}, m𝒩m\in\mathscr{N}, t1,tn𝒯t_{1},\ldots t_{n}\in\mathscr{T}, and 𝖿{\sf f} is an nn-ary operator. The set of ground terms are those without variables. A substitution σ\sigma is a partial function with finite support from 𝒱i\mathscr{V}_{i} to 𝒯\mathscr{T}. Its domain is denoted by 𝖽𝗈𝗆(σ){\sf dom}(\sigma). We assume that σ(x)=x\sigma(x)=x for x𝖽𝗈𝗆(σ)x\not\in{\sf dom}(\sigma). The set of subterms of tt is denoted by 𝗌𝗍(t){\sf st}(t), and defined as usual. The set of variables appearing in tt is denoted by 𝗏𝖺𝗋𝗌(t){\sf vars}(t).

Each 𝖿{\sf f} has constructor rules and destructor rules, expressed in terms of sequents of the form XtX\vdash t (to be read as “tt is derived from XX”), where X{t}X\cup\{t\} is a finite set of terms. Figure 1 gives the general form of a constructor rule (on the left) and a destructor rule (on the right). In a destructor rule, the conclusion tit_{i} is an immediate subterm of the leftmost premise, which is designated as the major premise of the rule. The 𝖺𝗑{\sf ax} rule (which derives XtX\vdash t when tXt\in X) is also considered a destructor rule for technical purposes. We say X𝑑𝑦tX\vdash_{\mathit{dy}}t if there is a proof of XtX\vdash t using these constructor and destructor rules, and X𝑑𝑦SX\vdash_{\mathit{dy}}S to mean that X𝑑𝑦tX\vdash_{\mathit{dy}}t for every tSt\in S.

tensy Xt1Xtn\displaystyle\penalty 1X\vdash t_{1}\cdots X\vdash t_{n}   X𝖿(t1,,tn)\displaystyle X\vdash{\sf f}(t_{1},\ldots,t_{n}) tensy X𝖿(t1,,tn)Xu1Xum\displaystyle\penalty 1X\vdash{\sf f}(t_{1},\ldots,t_{n})\quad X\vdash u_{1}\cdots X\vdash u_{m}   Xti\displaystyle X\vdash t_{i}
Figure 1: General form of constructor and destructor rules

For any proof π\pi of XtX\vdash t, we denote by 𝖺𝗑𝗂𝗈𝗆𝗌(π){\sf axioms}(\pi) the set XX, by 𝖼𝗈𝗇𝖼(π){\sf conc}(\pi) the term tt, and by 𝗍𝖾𝗋𝗆𝗌(π){\sf terms}(\pi) all terms occurring in π\pi. π\pi is said to be normal if a constructor rule does not yield the major premise of a destructor rule. We only consider proof systems which enjoy the following three properties:

  • Normalization: Every proof π\pi of XtX\vdash t can be converted into a normal proof ϖ\varpi of the same.

  • Subterm property: For any normal proof ϖ\varpi of XtX\vdash t, 𝗍𝖾𝗋𝗆𝗌(ϖ)𝗌𝗍(X{t}){\sf terms}(\varpi)\subseteq{\sf st}(X\cup\{t\}), and if ϖ\varpi ends in a destructor rule, 𝗍𝖾𝗋𝗆𝗌(ϖ)𝗌𝗍(X){\sf terms}(\varpi)\subseteq{\sf st}(X).

  • Efficient derivability checks: There is a PTIME algorithm for checking derivability.

The normalization and subterm properties combined are referred to as locality in the security literature. This is a notion identified in [32], and is crucially used in solving the derivability problem for many classes of inference systems, including many intruder theories.

Example 2.

A term algebra with pairing, symmetric and asymmetric encryption operations, where m,k𝒩m,k\in\mathscr{N} and t,u𝒯t,u\in\mathscr{T} is given by t:=m𝑝𝑘(k)(t,u){t}k{|t|}𝑝𝑘(k)t:=m\mid\mathit{pk}(k)\mid(t,u)\mid\{t\}_{k}\mid\{\!|t|\!\}_{\mathit{pk}(k)}. The proof system for this algebra is shown in Table 1. This system enjoys normalization and the subterm property [38].

tensy  𝖺𝗑(mX){\sf ax}(m\in X) Xm\displaystyle X\vdash m tensy X(t1,t2)\displaystyle\penalty 1X\vdash(t_{1},t_{2})  𝗌𝗉𝗅𝗂𝗍{\sf split} Xti\displaystyle X\vdash t_{i} tensy Xk\displaystyle\penalty 1X\vdash k  𝗉𝗄{\sf pk} X𝑝𝑘(k)\displaystyle X\vdash\mathit{pk}(k)
tensy XtXu\displaystyle\penalty 1X\vdash t\quad X\vdash u  𝗉𝖺𝗂𝗋{\sf pair} X(t,u)\displaystyle X\vdash(t,u) tensy X{t}kXk\displaystyle\penalty 1X\vdash\{t\}_{k}\quad X\vdash k  𝗌𝖽𝖾𝖼{\sf sdec} Xt\displaystyle X\vdash t tensy XtXk\displaystyle\penalty 1X\vdash t\quad X\vdash k  𝗌𝖾𝗇𝖼{\sf senc} X{t}k\displaystyle X\vdash\{t\}_{k}
tensy X{|t|}𝑝𝑘(k)Xk\displaystyle\penalty 1X\vdash\{\!|t|\!\}_{\mathit{pk}(k)}\quad X\vdash k  𝖺𝖽𝖾𝖼{\sf adec} Xt\displaystyle X\vdash t tensy XtX𝑝𝑘(k)\displaystyle\penalty 1X\vdash t\quad X\vdash\mathit{pk}(k)  𝖺𝖾𝗇𝖼{\sf aenc} X{|t|}𝑝𝑘(k)\displaystyle X\vdash\{\!|t|\!\}_{\mathit{pk}(k)}
Table 1: Proof system for the term algebra in Example 2

2.2 Assertions

We consider an assertion syntax which includes equality over terms (to avoid overloading the == operator, we denote equality between tt and uu by tu{{t}\bowtie{u}}), predicates, conjunction, existentially quantified assertions, list membership, and a𝑠𝑎𝑦𝑠\ \mathit{says}\ connective. Existential quantification allows us to make statements that convey partial information about terms, in particular, allowing us to hide terms or parts thereof. The𝑠𝑎𝑦𝑠\ \mathit{says}\ connective works like a signature over assertions, indicating who endorses the fact conveyed by the assertion. List membership, which we denote by \twoheadleftarrow, acts as a restricted form of disjunction. Predicates allow us to express some protocol-specific facts. As we will see over the later sections, this fragment allows us to express example protocols of interest, as well as yields a decidable active intruder problem for boundedly many sessions.

In the following, t,u𝒯t,u\in\mathscr{T}, PP is an mm-ary predicate, u1,,um,t0𝒩𝒱u_{1},\ldots,u_{m},t_{0}\in\mathscr{N}\cup\mathscr{V}, and t1,,tn𝒩t_{1},\ldots,t_{n}\in\mathscr{N},111We could consider arbitrary terms in list membership, but this simple syntax suffices for most examples. Similarly for P(u1,.um)P(u_{1},\ldots.u_{m}). x𝒱qx\in\mathscr{V}_{q}, and 𝑝𝑘(k)\mathit{pk}(k) is the public key corresponding to a secret key kk.

α\displaystyle\alpha :=tuP(u1,,um)t0[t1,,tn]\displaystyle:={{t}\bowtie{u}}\mid P(u_{1},\ldots,u_{m})\mid t_{0}\twoheadleftarrow[t_{1},\ldots,t_{n}]
α0α1x.α(x)𝑝𝑘(k)𝑠𝑎𝑦𝑠α\displaystyle\hskip 14.22636pt\mid\alpha_{0}\wedge\alpha_{1}\mid\exists x.~{}\alpha(x)\mid\mathit{pk}(k)\ \mathit{says}\ \alpha

By atomic assertions, we mean assertions that are not of the form αβ\alpha\wedge\beta or xα\exists{x}\alpha.

We denote the free (resp. bound) variables occurring in an assertion α\alpha by 𝖿𝗏(α){\sf fv}(\alpha) and 𝖻𝗏(α){\sf bv}(\alpha). 𝗏𝖺𝗋𝗌(α)=𝖿𝗏(α)𝖻𝗏(α){\sf vars}(\alpha)={\sf fv}(\alpha)\cup{\sf bv}(\alpha). The set of subterms (resp. subformulas) of α\alpha is given by 𝗌𝗍(α){\sf st}(\alpha) (resp. 𝗌𝖿(α){\sf sf}(\alpha)). We can lift these notions to sets of assertions as usual. For a substitution λ\lambda, we obtain λ(α)\lambda(\alpha) by replacing xx in α\alpha by λ(x)\lambda(x) for all x𝖿𝗏(α)x\in{\sf fv}(\alpha).

We now define the public terms of an assertion α\alpha. These are essentially the terms that α\alpha is “about”, which are always communicated along with α\alpha. Quantified variables in an assertion stand for “private” terms, so if a term tt occurring in α\alpha has quantified variables, it cannot itself be public. But it is not reasonable to declare all other subterms to be public terms either. For instance, if an assertion talks about 𝗌𝖾𝗇𝖼(v,k){\sf senc}(v,k), the term 𝗌𝖾𝗇𝖼(v,k){\sf senc}(v,k) should be public, but probably not vv or kk itself. Hence we define the public terms of α\alpha, denoted 𝗉𝗎𝖻𝗌(α){\sf pubs}(\alpha), as the set of all maximal subterms of α\alpha which contain no quantified variables. In other words, t𝗉𝗎𝖻𝗌(α)t\in{\sf pubs}(\alpha) iff t𝗌𝗍(α)t\in{\sf st}(\alpha), 𝗏𝖺𝗋𝗌(t)𝒱q={\sf vars}(t)\cap\mathscr{V}_{q}=\emptyset, and u𝗌𝗍(α):t𝗌𝗍(u)𝗏𝖺𝗋𝗌(u)𝒱q\forall u\in{\sf st}(\alpha):\ t\in{\sf st}(u)\implies{\sf vars}(u)\cap\mathscr{V}_{q}\neq\emptyset.

Example 3.

AA (with secret key kk) encrypts a vote vv in a key rr unknown to BB and states that it is one of two allowed values.

AB:{v}r,𝑝𝑘(k)𝑠𝑎𝑦𝑠{xy.{x}y{v}rx[0,1]}A\rightarrow B:\{v\}_{r},\ \mathit{pk}(k)\ \mathit{says}\ \bigl{\{}\exists xy.{{\{x\}_{y}}\bowtie{\{v\}_{r}}}\wedge x\twoheadleftarrow[0,1]\bigr{\}}

The set of public terms of this assertion is {{v}r,0,1}\bigl{\{}\{v\}_{r},0,1\bigr{\}}.

Assertions, like terms, can be involved in sends and receives. However, since assertions are logical formulas, we can also have agents check them for derivability and take some action based on the result of this check, without any send/receive. We call such an action an 𝖺𝗌𝗌𝖾𝗋𝗍{\sf assert}. As part of an 𝖺𝗌𝗌𝖾𝗋𝗍α{\sf assert}~{}{\alpha} action, an agent AA checks to see if α\alpha is derivable from their current knowledge. If it is, AA continues with their role, otherwise AA aborts. An 𝖺𝗌𝗌𝖾𝗋𝗍{\sf assert} action allows us to model some minimal branching based on the derivability of assertions from agents’ local states.

Note that this does not involve any absolute notion of the “truth” (or lack thereof) of an assertion. An agent can only locally check if an assertion can be “verified”, i.e. obtained from what they know about the system at that point in the execution. It might well be the case that while an 𝖺𝗌𝗌𝖾𝗋𝗍α{\sf assert}~{}\alpha check passes for an agent AA, a different agent BB might not have enough information to be able to derive α\alpha, and abort. Conversely, if some agent’s internal state has been compromised somehow and made inconsistent, they might even be able to 𝖺𝗌𝗌𝖾𝗋𝗍{\sf assert} something like 0=10=1, which is patently false. We are only concerned with the verifiability of assertions, and not their absolute truth values.

Having introduced this system, we now present the modelling of the well-known FOO e-voting protocol [24]. This is a minor modification of the presentation in [35].

2.3 Example: FOO e-voting Protocol

The FOO e-voting protocol was proposed in 1992 and closely mirrors the way one votes offline. There is a voter VV, an authority AA who verifies voter identities, and a collector CC who computes the final tally.

To model this using only terms [24, 29], blinding is used. One can use tt and bb to make a blind pair 𝖻𝗅𝗂𝗇𝖽(t,b){\sf blind}(t,b), and get 𝗌𝗂𝗀𝗇(t,k){\sf sign}(t,k) from 𝗌𝗂𝗀𝗇(𝖻𝗅𝗂𝗇𝖽(t,b),k){\sf sign}({\sf blind}(t,b),k) and bb. The voter authenticates themselves to the authority using their signing key 𝑠𝑘V\mathit{sk}_{V}, and uses the blinding operation to have the authority certify it without knowing the actual vote. The authority’s signature 𝗌𝗂𝗀𝗇(,𝑠𝑘A){\sf sign}(\cdot,\mathit{sk}_{A}) percolates through to the vote when the voter removes the blind, and the voter can then anonymously send (denoted by \looparrowright) this signed vote to the collector for inclusion into the final tally. This specification is shown below.

VA\displaystyle V\rightarrow A :𝗌𝗂𝗀𝗇(𝖻𝗅𝗂𝗇𝖽({v}r,b),𝑠𝑘V)\displaystyle:{\sf sign}({\sf blind}(\{v\}_{r},b),\mathit{sk}_{V})
AV\displaystyle A\rightarrow V :𝗌𝗂𝗀𝗇(𝖻𝗅𝗂𝗇𝖽({v}r,b),𝑠𝑘A)\displaystyle:{\sf sign}({\sf blind}(\{v\}_{r},b),\mathit{sk}_{A})
VC\displaystyle V\looparrowright C :𝗌𝗂𝗀𝗇({v}r,𝑠𝑘A)\displaystyle:{\sf sign}(\{v\}_{r},\mathit{sk}_{A})

We model the voting phase of FOO as below, following [35]. We use {α}A\{\alpha\}^{A} as shorthand for A𝑠𝑎𝑦𝑠αA\ \mathit{says}\ \alpha. In fact, the use of assertions allows one to also specify an eligibility check for voters via an 𝖺𝗌𝗌𝖾𝗋𝗍{\sf assert}. If the user is not eligible, the protocol aborts. Further, voters can also state that their vote is for an allowable candidate from the list \ell. These are left implicit in the terms-only modelling.

VA\displaystyle V\rightarrow A :{v}p,{xr.{x}r{v}px}V\displaystyle:\{v\}_{p},\bigl{\{}\exists xr.{{\{x\}_{r}}\bowtie{\{v\}_{p}}}\wedge x\twoheadleftarrow\ell\bigr{\}}^{V}
A\displaystyle A :𝖺𝗌𝗌𝖾𝗋𝗍𝖾𝗅(V)\displaystyle:{\sf assert}~{}{\sf el}(V)
AV\displaystyle A\rightarrow V :{𝖾𝗅(V){xr.{x}r{v}px}V}A\displaystyle:\bigl{\{}{\sf el}(V)\wedge\bigl{\{}\exists xr.{{\{x\}_{r}}\bowtie{\{v\}_{p}}}\wedge x\twoheadleftarrow\ell\bigr{\}}^{V}\bigr{\}}^{A}
VC\displaystyle V\looparrowright C :{v}q,Uys.{𝖾𝗅(U){xr.{x}r{y}sx}U}A\displaystyle:\{v\}_{q},\exists Uys.\bigl{\{}{\sf el}(U)\wedge\bigl{\{}\exists xr.{{\{x\}_{r}}\bowtie{\{y\}_{s}}}\wedge x\twoheadleftarrow\ell\bigr{\}}^{U}\bigr{\}}^{A}
{w.{y}w{v}q}\displaystyle\hskip 14.22636pt\wedge\bigl{\{}\exists w.{{\{y\}_{w}}\bowtie{\{v\}_{q}}}\bigr{\}}

VV first sends to AA their encrypted vote along with an assertion claiming that it is for a candidate from the list \ell. The authority checks the voter’s eligibility via the 𝖺𝗌𝗌𝖾𝗋𝗍{\sf assert} action on the 𝖾𝗅{\sf el} predicate. If the check passes, the authority issues a certificate stating that the voter is allowed to vote, crucially, without modifying the term containing the vote. VV then existentially quantifies out their name from this certificate, and anonymously sends to CC a re-encryption of the vote authorized by AA along with a certificate to that effect. Here, pp and qq are freshly-generated ephemeral keys. Thus, the intent behind the various communications is made more transparent than in the model with blind signatures. One can show that this satisfies anonymity [35].

One can also specify security properties in a more natural manner (as compared to the terms-only model). For instance, one can say that vote secrecy is ensured in the above protocol if there is no run where the intruder can derive the assertion xy:[{v}p={x}yx=v]\exists{xy}:[\{v\}_{p}=\{x\}_{y}\wedge x=v]. Note that this means that while anyone can derive the value of vv, which is public, they should not be able to identify the value inside the encrypted vote {v}p\{v\}_{p} as being a particular public name. To express this in the terms-only formulation, one has to check whether two runs that only differ in the vote vv can be distinguished by the intruder [19]. It can be seen from [35] that proving such properties might involve considering multiple runs simultaneously, but their specification itself does not refer to a notion of equivalence.

Example 4.

Consider a protocol where VV sends to AA the vote encrypted in a fresh key kk, and an assertion that the vote belongs to an allowable list \ell of candidates. This looks as follows. VA:{v}k,xr.{{x}r{v}kx}V\rightarrow A:\{v\}_{k},\exists xr.\bigl{\{}{{\{x\}_{r}}\bowtie{\{v\}_{k}}}\wedge x\twoheadleftarrow\ell\bigr{\}}.

Suppose this same protocol is used for two elections that VV participates in simultaneously, where the first election has candidates 0 and 11 (so 1=[0,1]\ell_{1}=[0,1]) and the second has candidates 0 and 22 (so 2=[0,2]\ell_{2}=[0,2]).

VV wants to vote for 0 in both elections. Since the vote is for the same candidate, VV (unwisely) decides to reuse the same term, instead of re-encrypting in a fresh key. So we have a run where VV sends both xr.{{x}r{v}kx[0,1]}\exists xr.\bigl{\{}{{\{x\}_{r}}\bowtie{\{v\}_{k}}}\wedge x\twoheadleftarrow[0,1]\bigr{\}} and ys.{{y}s{v}ky[0,2]}\exists ys.\bigl{\{}{{\{y\}_{s}}\bowtie{\{v\}_{k}}}\wedge y\twoheadleftarrow[0,2]\bigr{\}}. Now, since the same term {v}k\{v\}_{k} is involved in both assertions, an observer ought to be able to deduce that the vote is actually for 0. This would allow them access to both the identity of a voter as well as their vote, falsifying anonymity. The assertion system formally captures such inference via a proof system.

2.4 Abstractability and Proof System

Before we present the proof system, we need to fix under what conditions one can derive a new assertion from existing ones. In a security context, it becomes important to distinguish when a term is accessible inside an assertion versus when it is not. To substitute a term uu (with, say, vv) inside a term tt, an agent AA essentially needs to break the term down to that position, replace uu with vv, and construct the whole term back. This depends on other terms AA has access to. We formalize this notion as “abstractability”, which requires us to first define the set of term positions of an assertion.

We will view terms as trees, with (t)\mathbb{P}(t)\subseteq\mathbb{N}^{*} denoting the set of positions of the term tt, and ε\varepsilon the empty word in \mathbb{N}^{*}. We will also view assertions as trees, with any operator forming the root of its subtree, and its operands standing for its children. We will only be interested in the position where terms occur in assertions, not those of the various operators. We define these as follows.

Definition 5 (Term positions of an assertion).

We define the term positions of an assertion α\alpha, denoted (α)\mathbb{P}(\alpha), as follows:

  • (tt)={0pp(t)}{1pp(t)}\mathbb{P}({{t}\bowtie{t^{\prime}}})=\{0\cdot p\mid p\in\mathbb{P}(t)\}\cup\{1\cdot p\mid p\in\mathbb{P}(t^{\prime})\}

  • (P(u0,,um))={0,,m}\mathbb{P}(P(u_{0},\ldots,u_{m}))=\{0,\ldots,m\}

  • (t[t1,,tn])={0,1,,n}\mathbb{P}(t\twoheadleftarrow[t_{1},\ldots,t_{n}])=\{0,1,\ldots,n\}

  • (αβ)={0pp(α)}{1pp(β)}\mathbb{P}(\alpha\wedge\beta)=\{0\cdot p\mid p\in\mathbb{P}(\alpha)\}\cup\{1\cdot p\mid p\in\mathbb{P}(\beta)\}

  • (x.α)={0pp(α)}\mathbb{P}(\exists{x}.\alpha)=\{0\cdot p\mid p\in\mathbb{P}(\alpha)\}

  • (𝑝𝑘(k)𝑠𝑎𝑦𝑠α)={0,00}{1pp(α)}\mathbb{P}(\mathit{pk}(k)\ \mathit{says}\ \alpha)=\{0,00\}\cup\{1\cdot p\mid p\in\mathbb{P}(\alpha)\}

For t,r𝒯t,r\in\mathscr{T}, and p(t)p\in\mathbb{P}(t), t|p{t}|_{p} is the subterm of tt rooted at pp. The set of positions of rr in tt is r(t){p(t)t|p=r}\mathbb{P}_{r}({t})\coloneqq\{p\in\mathbb{P}(t)\mid{t}|_{p}=r\}. For P(t)P\subseteq\mathbb{P}(t), t[r]P{t}[{r}]_{P} is obtained by replacing the subterm of tt occurring at each pPp\in P with rr. We will use analogous notation for assertions.

Definition 6 (Abstractable positions of a term).

Let S{t}𝒯S\cup\{t\}\subseteq\mathscr{T}. The set of abstractable positions of tt w.r.t. SS, denoted 𝔸(S,t)\mathbb{A}(S,t), is defined as follows. For p(t)p\in\mathbb{P}(t), let p={ε}{qi(t)q\mathbb{Q}_{p}=\{\varepsilon\}\cup\{qi\in\mathbb{P}(t)\mid q is a proper prefix of p}p\}. Then 𝔸(S,t){p(t)S𝑑𝑦t|q\mathbb{A}(S,t)\coloneqq\{p\in\mathbb{P}(t)\mid S\vdash_{\mathit{dy}}{t}|_{q} for all qp}q\in\mathbb{Q}_{p}\}.

For example, let t=({{m}k}k,(n1,n2))t=(\{\{m\}_{k}\}_{k^{\prime}},(n_{1},n_{2})). Then, (t)={ε,0,1,00,01,10,11,000,001}\mathbb{P}(t)=\{\varepsilon,0,1,00,01,10,11,000,001\}. Consider the set S={{m}k}k,(n1,n2)S=\{\{m\}_{k}\}_{k^{\prime}},(n_{1},n_{2}). Then, 𝔸(S,t)={ε,0,1,10,11}\mathbb{A}(S,t)=\{\varepsilon,0,1,10,11\}. The abstractable positions are shown in bold in Figure 2.

pairsenc𝗌𝖾𝗇𝖼{\sf senc}mm000kk00100kk^{\prime}010𝗉𝖺𝗂𝗋{\sf pair}n1n_{1}10n2n_{2}111ε\varepsilon
Figure 2: Abstractable positions w.r.t. S={{m}k}k,(n1,n2)}S=\{\{m\}_{k}\}_{k^{\prime}},(n_{1},n_{2})\}

Now, an inductive definition seems like it might suffice to lift the notion of abstractable positions for assertions. However, a problem arises when we consider an assertion of the form x.α\exists x.\alpha. Let α=b.{{m}b{m}k}\alpha=\exists b.\{{{\{m\}_{b}}\bowtie{\{m\}_{k}}}\}. Suppose we want to get ab.{{a}b{m}k}\exists ab.\{{{\{a\}_{b}}\bowtie{\{m\}_{k}}}\} from α\alpha in the presence of the set S={m,k}S=\{m,k\}. That position of mm in α\alpha must be abstractable w.r.t SS, i.e. we require that S𝑑𝑦{m}bS\vdash_{\mathit{dy}}\{m\}_{b}, but SS does not even contain the quantified variable bb. We must therefore consider derivability from S{b}S\cup\{b\} in this case, not SS.

Definition 7 (Abstractable positions of an assertion).

The set of abstractable positions of α\alpha w.r.t. SS, denoted by 𝔸(S,α)\mathbb{A}(S,\alpha), is:

  • 𝔸(S,t0t1)={ipi{0,1},p𝔸(S,ti)}\mathbb{A}(S,{{t_{0}}\bowtie{t_{1}}})=\{i\cdot p\mid i\in\{0,1\},\ p\in\mathbb{A}(S,t_{i})\}

  • 𝔸(S,P(u1,,um))={i1im,S𝑑𝑦ui}\mathbb{A}(S,P(u_{1},\ldots,u_{m}))=\{i\mid 1\leq i\leq m,S\vdash_{\mathit{dy}}u_{i}\}

  • 𝔸(S,t[t1,,tn])={0}\mathbb{A}(S,t\twoheadleftarrow[t_{1},\ldots,t_{n}])=\{0\}

  • 𝔸(S,α0α1)={ipi{0,1},p𝔸(S,αi)}\mathbb{A}(S,\alpha_{0}\wedge\alpha_{1})=\{i\cdot p\mid i\in\{0,1\},\ p\in\mathbb{A}(S,\alpha_{i})\}

  • 𝔸(S,x.α)={0pp𝔸(S{x},α)}\mathbb{A}(S,\exists{x}.\alpha)=\{0\cdot p\mid p\in\mathbb{A}(S\cup\{x\},\alpha)\}

  • 𝔸(S,𝑝𝑘(k)𝑠𝑎𝑦𝑠α)={0}{1pp𝔸(S,α)}\mathbb{A}(S,\mathit{pk}(k)\ \mathit{says}\ \alpha)=\{0\}\cup\{1\cdot p\mid p\in\mathbb{A}(S,\alpha)\}

We now state a fundamental property of abstractability, which will be used in some of the more technical proofs later.

Lemma 8.

Let S{t,r}𝒯S\cup\{t,r\}\subseteq\mathscr{T} s.t. S𝑑𝑦rS\vdash_{\mathit{dy}}r. If x𝗏𝖺𝗋𝗌(S)x\notin{\sf vars}(S) and P=x(t)𝔸(S{x},t)P=\mathbb{P}_{x}({t})\subseteq\mathbb{A}(S\cup\{x\},t), then 𝔸(S,t[r]P)(t)=𝔸(S{x},t)\mathbb{A}(S,{t}[{r}]_{P})\cap\mathbb{P}(t)=\mathbb{A}(S\cup\{x\},t).

Proof.

For any term aa and any set Q(a)Q\subseteq\mathbb{P}(a), we let a|Q{a}|_{Q} denote {a|qqQ}\{{a}|_{q}\mid q\in Q\}. We now observe some general properties of abstractability.

For any T,aT,a and q𝔸(T,a)q\in\mathbb{A}(T,a) s.t. a|q{a}|_{q} is non-atomic, either {q0,q1}𝔸(T,a)\{q0,q1\}\subseteq\mathbb{A}(T,a) and a|{q0,q1}𝑑𝑦a|q{a}|_{\{q0,q1\}}\vdash_{\mathit{dy}}{a}|_{q} via a constructor rule, or qq is a maximal position in 𝔸(T,a)\mathbb{A}(T,a) (it is not the prefix of any other position in the set). We have the following two properties.

  1. 1.

    Let M={q(a)qM=\{q\in\mathbb{P}(a)\mid q is a maximal position in 𝔸(T,a)}\mathbb{A}(T,a)\}. Then for every p𝔸(T,a)p\in\mathbb{A}(T,a), a|M𝑑𝑦a|p{a}|_{M}\vdash_{\mathit{dy}}{a}|_{p} via a proof consisting only of constructor rules.

  2. 2.

    Suppose Q(a)Q\subseteq\mathbb{P}(a) is prefix-closed (if qQq\in Q and pp is a prefix of qq, then pQp\in Q) and sibling-closed (if qiQqi\in Q and qj(a)qj\in\mathbb{P}(a), then qjQqj\in Q). If T𝑑𝑦a|qT\vdash_{\mathit{dy}}{a}|_{q} for every maximal qQq\in Q, then Q𝔸(T,a)Q\subseteq\mathbb{A}(T,a).

We now prove the statement of the lemma. Let u=t[r]Pu={t}[{r}]_{P}, and let AA and BB denote 𝔸(S{x},t)\mathbb{A}(S\cup\{x\},t) and 𝔸(S,u)(t)\mathbb{A}(S,u)\cap\mathbb{P}(t) respectively. Note that AA and BB are both prefix-closed and sibling-closed. Let MM (resp. NN) be the set of maximal positions in AA (resp. BB).

Since PAP\subseteq A is the set of xx-positions in tt, PMP\subseteq M and no qMq\in M is a prefix of a position in PP. Thus, for every qMq\in M, either t|q=x{t}|_{q}=x, or x𝗏𝖺𝗋𝗌(t|q)x\notin{\sf vars}({t}|_{q}). If t|q=x{t}|_{q}=x, u|q=r{u}|_{q}=r, and S𝑑𝑦u|qS\vdash_{\mathit{dy}}{u}|_{q} (since S𝑑𝑦rS\vdash_{\mathit{dy}}r). If x𝗏𝖺𝗋𝗌(t|q)x\notin{\sf vars}({t}|_{q}), then u|q=t|q{u}|_{q}={t}|_{q} and S𝑑𝑦u|qS\vdash_{\mathit{dy}}{u}|_{q}. This is because q𝔸(S{x},t)q\in\mathbb{A}(S\cup\{x\},t), so S{x}𝑑𝑦t|qS\cup\{x\}\vdash_{\mathit{dy}}{t}|_{q}, but xx does not occur in the conclusion. Thus we have S𝑑𝑦u|qS\vdash_{\mathit{dy}}{u}|_{q} for every qMq\in M. Since AA is prefix-closed and sibling-closed, by 2, we get A𝔸(S,u)A\subseteq\mathbb{A}(S,u). Since A(t)A\subseteq\mathbb{P}(t) as well, we get ABA\subseteq B.

By similar reasoning as above, we can see that S{x}𝑑𝑦t|qS\cup\{x\}\vdash_{\mathit{dy}}{t}|_{q} for each qNq\in N. (For some of these positions qq, xx does not occur at all in the subterm at that position, and t|q=u|q{t}|_{q}={u}|_{q} is derivable from SS. For other positions qq, t|q=x{t}|_{q}=x and is derivable from S{x}S\cup\{x\}.) Therefore BAB\subseteq A. ∎

The assertion proof system is shown in Table 2. We say S;AaαS;A\vdash_{\mathit{a}}\alpha if α\alpha can be derived from S;AS;A using these rules. We say S;AaΓS;A\vdash_{\mathit{a}}\Gamma if S;AaγS;A\vdash_{\mathit{a}}\gamma for every γΓ\gamma\in\Gamma.

tensy  ax S;A{α}α {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 22.22859pt\hbox{$\displaystyle\penalty 1$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=44.45718pt\hbox{\kern 2.10002pt${\sf ax}$}}}\hbox{\kern 0.0pt\hbox{$\displaystyle S;A\cup\{\alpha\}\vdash\alpha$}}}}} tensy Sdyt  eq S;Att {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 7.89053pt\hbox{$\displaystyle\penalty 1S\vdash_{\mathit{dy}}t$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=33.47356pt\hbox{\kern 2.10002pt${\sf eq}$}}}\hbox{\kern 0.0pt\hbox{$\displaystyle S;A\vdash{{t}\bowtie{t}}$}}}}} tensy S;At0u0S;At1u1  cons S;Af(t0,t1)f(u0,u1) {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash{{t_{0}}\bowtie{u_{0}}}\quad S;A\vdash{{t_{1}}\bowtie{u_{1}}}$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=80.85707pt\hbox{\kern 2.10002pt${\sf cons}$}}}\hbox{\kern 6.04233pt\hbox{$\displaystyle S;A\vdash{{{\sf f}(t_{0},t_{1})}\bowtie{{\sf f}(u_{0},u_{1})}}$}}}}}
tensy S;Atu  sym S;Aut {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash{{t}\bowtie{u}}$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=34.95297pt\hbox{\kern 2.10002pt${\sf sym}$}}}\hbox{\kern 0.0pt\hbox{$\displaystyle S;A\vdash{{u}\bowtie{t}}$}}}}} tensy S;At1t2S;Atkt+k1  trans S;At1t+k1 {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash{{t_{1}}\bowtie{t_{2}}}\cdots S;A\vdash{{t_{k}}\bowtie{t_{k+1}}}$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=81.56544pt\hbox{\kern 2.10002pt${\sf trans}$}}}\hbox{\kern 20.45163pt\hbox{$\displaystyle S;A\vdash{{t_{1}}\bowtie{t_{k+1}}}$}}}}} tensy S;Af(t1,..,tr)f(u1,..,ur)  proji S;Atiui {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash{{{\sf f}(t_{1},\ldotp\ldotp,t_{r})}\bowtie{{\sf f}(u_{1},\ldotp\ldotp,u_{r})}}$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=80.27394pt\hbox{\kern 2.10002pt${\sf proj}_{i}^{\P}$}}}\hbox{\kern 22.2822pt\hbox{$\displaystyle S;A\vdash{{t_{i}}\bowtie{u_{i}}}$}}}}}
tensy S;Aα0S;Aα1  i S;Aα0α1 {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash\alpha_{0}\quad S;A\vdash\alpha_{1}$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=62.32292pt\hbox{\kern 2.10002pt$\wedge\sf i$}}}\hbox{\kern 11.00067pt\hbox{$\displaystyle S;A\vdash\alpha_{0}\wedge\alpha_{1}$}}}}} tensy S;Aα0α1  ei S;Aαi {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash\alpha_{0}\wedge\alpha_{1}$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=40.32156pt\hbox{\kern 2.10002pt$\wedge\sf e_{i}$}}}\hbox{\kern 6.63481pt\hbox{$\displaystyle S;A\vdash\alpha_{i}$}}}}} tensy S;AtlS;Atu  subst S;Aul {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash t\twoheadleftarrow l\quad S;A\vdash{{t}\bowtie{u}}$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=78.8196pt\hbox{\kern 2.10002pt${\sf subst}$}}}\hbox{\kern 20.23679pt\hbox{$\displaystyle S;A\vdash u\twoheadleftarrow l$}}}}}
tensy S;Aα[t]PSdyt  i S;Ax.α {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash{\alpha}[{t}]_{P}\quad S\vdash_{\mathit{dy}}t$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=57.92734pt\hbox{\kern 2.10002pt$\exists\sf i^{{\ddagger}}$}}}\hbox{\kern 10.6126pt\hbox{$\displaystyle S;A\vdash\exists{x}.\alpha$}}}}} tensy S;Ax.αS{y};A{α[y]P}γ  e§ S;Aγ {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash\exists{}{x}.\alpha\quad S\cup\{y\};A\cup\{{\alpha}[{y}]_{P}\}\vdash\gamma$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=117.84402pt\hbox{\kern 2.10002pt$\exists\sf e^{\S}$}}}\hbox{\kern 46.49818pt\hbox{$\displaystyle S;A\vdash\gamma$}}}}} tensy S;AαSdyk  say S;Apk(k)saysα {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 4.22046pt\hbox{$\displaystyle\penalty 1S;A\vdash\alpha\quad S\vdash_{\mathit{dy}}k$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=60.17168pt\hbox{\kern 2.10002pt${\sf say}$}}}\hbox{\kern 0.0pt\hbox{$\displaystyle S;A\vdash\mathit{pk}(k)\ \mathit{says}\ \alpha$}}}}}
tensy S;At[n]  prom S;Atn {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash t\twoheadleftarrow[n]$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=42.73074pt\hbox{\kern 2.10002pt${\sf prom}$}}}\hbox{\kern 3.79167pt\hbox{$\displaystyle S;A\vdash{{t}\bowtie{n}}$}}}}} tensy S;Atl1S;Atlm  int S;At(l1lm) {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash t\twoheadleftarrow l_{1}\ldots S;A\vdash t\twoheadleftarrow l_{m}$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=84.38501pt\hbox{\kern 2.10002pt${\sf int}$}}}\hbox{\kern 9.15344pt\hbox{$\displaystyle S;A\vdash t\twoheadleftarrow(l_{1}\cap\ldots\cap l_{m})$}}}}} tensy S;AtniSdyni(in)  wk S;At[n1,,nk] {{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash{{t}\bowtie{n_{i}}}\quad S\vdash_{\mathit{dy}}n_{i}(\forall i\leq n)$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=90.66133pt\hbox{\kern 2.10002pt${\sf wk}$}}}\hbox{\kern 14.64963pt\hbox{$\displaystyle S;A\vdash t\twoheadleftarrow[n_{1},\ldots,n_{k}]$}}}}}
Table 2: Derivation system a\vdash_{\mathit{a}} for assertions. \P states that {0i,1iir}𝔸(S,𝖿(t1,,tr)𝖿(u1,,ur))\{0i,1i\mid i\leq r\}\subseteq\mathbb{A}(S,{{{\sf f}(t_{1},\ldots,t_{r})}\bowtie{{\sf f}(u_{1},\ldots,u_{r}))}}. {\dagger} demands that Px(α)𝔸(S{x},α)P\subseteq\mathbb{P}_{x}({\alpha})\cap\mathbb{A}(S\cup\{x\},\alpha), and no position in PP occurs in the scope of a𝑠𝑎𝑦𝑠\ \mathit{says}\ ​​. {\ddagger} stands for P=x(α)𝔸(S{x},α)P=\mathbb{P}_{x}({\alpha})\subseteq\mathbb{A}(S\cup\{x\},\alpha). §\S states that y𝖿𝗏(S)𝖿𝗏(A)𝖿𝗏(γ)y\notin{\sf fv}(S)\cup{\sf fv}(A)\cup{\sf fv}(\gamma) and P=x(α)P=\mathbb{P}_{x}({\alpha}).

We say that S;A𝑒𝑞αS;A\vdash_{\mathit{eq}}\alpha if α\alpha can be derived from S;AS;A by a proof which does not use any of the rules from {𝗂,𝖾,𝗂,𝖾,𝗌𝖺𝗒}\{\wedge\sf i,\wedge\sf e,\exists\sf i,\exists\sf e,{\sf say}\}. Recall that an atomic assertion is one that is not of the form αβ\alpha\wedge\beta or x.α\exists{x}.\alpha. The 𝑒𝑞\vdash_{\mathit{eq}} system is used typically when A{α}A\cup\{\alpha\} consists only of atomic assertions, and we want to ensure that there is no use of the rules for \wedge and \exists in these proofs. To ensure this, we also need to avoid the 𝗌𝖺𝗒{\sf say} rule. Otherwise, we might allow a derivation of 𝑝𝑘(k)𝑠𝑎𝑦𝑠(αβ)\mathit{pk}(k)\ \mathit{says}\ (\alpha\wedge\beta) using αβ\alpha\wedge\beta, which itself can be derived only using 𝗂\wedge\sf i (since the LHS contains only atomic assertions).

The proofs in Section 4 crucially appeal to some properties of 𝑒𝑞\vdash_{\mathit{eq}} proofs, which we detail below.

Definition 9.

Suppose E{α}E\cup\{\alpha\} consists only of atomic formulas and π\pi is a proof of T;E𝑒𝑞αT;E\vdash_{\mathit{eq}}\alpha. We use “𝗋1{\sf r}_{1} precedes 𝗋2{\sf r}_{2} in π\pi” to mean that the conclusion of some application of 𝗋1{\sf r}_{1} is a premise of an application of 𝗋2{\sf r}_{2} in π\pi.

We say that π\pi is normal if the following hold.

  1. 1.

    All 𝑑𝑦\vdash_{\mathit{dy}} subproofs are normal.

  2. 2.

    𝗌𝗒𝗆{\sf sym} can only be preceded by 𝖺𝗑{\sf ax} or 𝗉𝗋𝗈𝗆{\sf prom}.

  3. 3.

    𝖾𝗊{\sf eq} can only be preceded by a destructor rule.

  4. 4.

    No premise of a 𝗍𝗋𝖺𝗇𝗌{\sf trans} is of the form aa{{a}\bowtie{a}}, or the conclusion of a 𝗍𝗋𝖺𝗇𝗌{\sf trans}.

  5. 5.

    Adjacent premises of a 𝗍𝗋𝖺𝗇𝗌{\sf trans} are not conclusions of 𝖼𝗈𝗇𝗌{\sf cons}.

  6. 6.

    𝗂𝗇𝗍{\sf int} cannot be preceded by 𝗂𝗇𝗍{\sf int} or 𝗐𝗄{\sf wk}.

  7. 7.

    No subproof ending in 𝗉𝗋𝗈𝗃{\sf proj} contains 𝖼𝗈𝗇𝗌{\sf cons}.

We now state the normalization theorem and subterm property for 𝑒𝑞\vdash_{\mathit{eq}} proofs. First, we define the following notions.

  • 𝗍𝖾𝗋𝗆𝗌(π){t{\sf terms}(\pi)\coloneqq\{t\mid a subproof of π\pi derives α\alpha and tt is a maximal subterm of α}\alpha\}.

  • 𝗅𝗂𝗌𝗍𝗌(E){t:t{\sf lists}(E)\coloneqq\{\ell\mid\exists{t}:t\twoheadleftarrow{\ell} is in E}E\}.

  • 𝗅𝗂𝗌𝗍𝗌(π){{\sf lists}(\pi)\coloneqq\{\ell\mid a subproof of π\pi derives t}t\twoheadleftarrow{\ell}\}.

Theorem 10 (Normalization & Subterm Property for 𝑒𝑞\vdash_{\mathit{eq}}).

a

  1. 1.

    If (T;E)𝑒𝑞α(T;E)\vdash_{\mathit{eq}}\alpha then there is a normal proof of (T;E)α(T;E)\vdash\alpha in the 𝑒𝑞\vdash_{\mathit{eq}} system.

  2. 2.

    For any normal proof π\pi of T;E𝑒𝑞αT;E\vdash_{\mathit{eq}}\alpha, letting Y=𝗌𝗍(T)𝗌𝗍(E{α})Y={\sf st}(T)\cup{\sf st}(E\cup\{\alpha\}), we have:

    • 𝗍𝖾𝗋𝗆𝗌(π)Y{\sf terms}(\pi)\subseteq Y.

    • 𝗅𝗂𝗌𝗍𝗌(π)𝗅𝗂𝗌𝗍𝗌(E{α}){[n]nY}{\sf lists}(\pi)\subseteq{\sf lists}(E\cup\{\alpha\})\cup\{[n]\mid n\in Y\}.

Armed with these notions, we present a saturation-based procedure in Algorithm 1 for deciding whether T;E𝑒𝑞αT;E\vdash_{\mathit{eq}}\alpha, where E{α}E\cup\{\alpha\} consists only of atomic assertions. The procedure computes the set

T,Eα{ββ is atomic,βZ,(T;E)𝑒𝑞β}\mathscr{E}^{{\alpha}}_{{T},{E}}\coloneqq\bigl{\{}\beta\mid\beta\text{ is atomic},\beta\in Z,(T;E)\vdash_{\mathit{eq}}\beta\bigr{\}}

where ZZ is as defined in Algorithm 1, and checks if αT,Eα\alpha\in\mathscr{E}^{{\alpha}}_{{T},{E}}.

Letting M=|𝗌𝗍(T)𝗌𝗍(E{α})|M=|{\sf st}(T)\cup{\sf st}(E\cup\{\alpha\})| and N=|𝗅𝗂𝗌𝗍𝗌(E)|N=|{\sf lists}(E)|, it can be seen that the algorithm runs in time polynomial in M+NM+N. There are at most (M+N)2(M+N)^{2} atomic formulas that can be added in CC, and hence the while loop runs for at most (M+N)2(M+N)^{2} iterations. In each iteration, the amount of work to be done is polynomial in M+NM+N. (Recall that 𝑑𝑦\vdash_{\mathit{dy}} can be decided in PTIME.) Thus the algorithm works in time polynomial in M+NM+N, and hence polynomial in the size of (T;E{α})(T;E\cup\{\alpha\}).

Algorithm 1 Algorithm to compute T,Eα\mathscr{E}^{{\alpha}}_{{T},{E}}, given (T;E),α(T;E),\alpha
1:Y𝗌𝗍(S)𝗌𝗍(E{α})Y\leftarrow{\sf st}(S)\cup{\sf st}(E\cup\{\alpha\});
2:Z{ββ is atomic,𝗌𝗍(β)Y,Z\leftarrow\big{\{}\beta\mid\beta\text{ is atomic},{\sf st}(\beta)\in Y,
3:   𝗅𝗂𝗌𝗍𝗌(β)𝗅𝗂𝗌𝗍𝗌(E){[n]nY}};{\sf lists}(\beta)\subseteq{\sf lists}(E)\cup\{[n]\mid n\in Y\}\big{\}};
4:BB\leftarrow\emptyset;
5:CEC\leftarrow E;
6:while (BC)(B\neq C) do
7:     BCB\leftarrow C;
8:     CB{βZβ can be obtained from B usingC\leftarrow B\cup\big{\{}\beta\in Z\mid\beta\text{ can be obtained from $B$ using}
9:           one application of any rule in a}\text{one application of any rule in $\vdash_{\mathit{a}}$}\big{\}};
10:end while
11:return BB.

2.5 Protocols and runs

Following [10, 38], a protocol is given by a finite set of roles, each role consisting of a finite sequence of alternating receives and sends (each send triggered by a receive).​222This model considers actions of the form 𝖺𝗌𝗌𝖾𝗋𝗍α{\sf assert}~{}\alpha to model rudimentary branching in protocols, which we used for specifying the FOO protocol. But we omit these in the formal model, for ease of presentation. We discuss handling such branching in Section 5.4. These are the actions of honest agents. Every sent message is added to the Dolev-Yao intruder’s knowledge base. Each received message is assumed to have come from the intruder, so it must be derivable by the intruder. We assume that only assertions are communicated – a term tt can be modelled via the assertion tt{{t}\bowtie{t}}, whose only public term is tt.

A protocol 𝑃𝑟\mathit{Pr} is a finite set of roles, each of the form (β1,α1)(βm,αm)({\beta_{1}},{\alpha_{1}})\ldots({\beta_{m}},{\alpha_{m}}), where the αi\alpha_{i}s and βi\beta_{i}s are assertions. An x𝖿𝗏(𝑃𝑟)x\in{\sf fv}(\mathit{Pr}) is said to be an agent variable if it occurs first in an αi\alpha_{i}; otherwise it is an intruder variable. Each role is a sequence of actions by an agent, receiving the βi\beta_{i}s and sending the αi\alpha_{i}s in response. The αi\alpha_{i}s and βi\beta_{i}s can have bound variables from 𝒱q\mathscr{V}_{q} as well as free variables from 𝒱i\mathscr{V}_{i}. Instantiating the free variables with appropriately-typed ground terms yields a session. A run is obtained by interleaving a finite number of sessions that satisfy the required derivability conditions. It is convenient to instantiate the free variables of a role in two stages. Agent variables are instantiated with names before starting a session, but intruder variables can be mapped to terms only at runtime.

A session of a protocol 𝑃𝑟\mathit{Pr} is a sequence of the form u:β1α1u:βαu:{\beta_{1}}\!\Rightarrow\!{\alpha_{1}}\ \cdots\ u:{\beta_{\ell}}\!\Rightarrow\!{\alpha_{\ell}} where u𝒜u\in\mathscr{A} and (β1,α1)(β,α)(\beta_{1},\alpha_{1})\cdots(\beta_{\ell},\alpha_{\ell}) is a prefix of a role of 𝑃𝑟\mathit{Pr} with all the agent variables instantiated by values from 𝒩\mathscr{N}. A set of sessions SS of 𝑃𝑟\mathit{Pr} is coherent if 𝖿𝗏(ξ)𝖿𝗏(ξ)={\sf fv}(\xi)\cap{\sf fv}(\xi^{\prime})=\emptyset for distinct ξ,ξS\xi,\xi^{\prime}\in S. One can always achieve coherence by renaming intruder variables as necessary.

A run is an interleaving of sessions where each message sent by an agent should be constructible from their knowledge. A knowledge state is a pair (X;Φ)(X;\Phi) where XX is a finite set of terms and Φ\Phi is a finite set of assertions. A knowledge function 𝗄{\sf k} is such that 𝖽𝗈𝗆(𝗄)=𝒜{\sf dom}({\sf k})=\mathscr{A} and for each a𝒜a\in\mathscr{A}, 𝗄(a){\sf k}(a) is a knowledge state.

Given a knowledge state (X;Φ)(X;\Phi) and an assertion α\alpha, we define 𝑢𝑝𝑑𝑎𝑡𝑒((X;Φ),α)(X𝗉𝗎𝖻𝗌(α),Φ{α}){\it update}((X;\Phi),\alpha)\coloneqq(X\cup{\sf pubs}(\alpha),\Phi\cup\{\alpha\}).

Definition 11.

A run of a protocol 𝑃𝑟\mathit{Pr} is a pair (ξ,σ)(\xi,\sigma) where:

  • ξu1:β1α1,,un:βnαn\xi\coloneqq u_{1}:{\beta_{1}}\!\Rightarrow\!{\alpha_{1}},\ldots,u_{n}:{\beta_{n}}\!\Rightarrow\!{\alpha_{n}} is an interleaving of a finite, coherent set of sessions of 𝑃𝑟\mathit{Pr}.

  • σ\sigma is a ground substitution with 𝖽𝗈𝗆(σ)=𝖿𝗏(ξ){\sf dom}(\sigma)={\sf fv}(\xi).

  • There is a sequence 𝗄0𝗄n{\sf k}_{0}\ldots{\sf k}_{n} of knowledge functions s.t.:

    • 𝗄0(a)=(Xa;){\sf k}_{0}(a)=(X_{a};\emptyset), where XaX_{a} is a finite set of initial terms known to aa (aa’s secret key, public keys, public names etc).

    • For all i<ni<n,

      𝗄i+1(a)={𝗄i(a)if aui,aI𝑢𝑝𝑑𝑎𝑡𝑒(𝗄i(a),βi)if a=ui𝑢𝑝𝑑𝑎𝑡𝑒(𝗄i(a),αi)if a=I{\sf k}_{i+1}(a)=\begin{cases}{\sf k}_{i}(a)&\mbox{if $a\neq u_{i},a\neq I$}\\ {\it update}({\sf k}_{i}(a),\beta_{i})&\mbox{if $a=u_{i}$}\\ {\it update}({\sf k}_{i}(a),\alpha_{i})&\mbox{if $a=I$}\end{cases}
    • For ini\leq n, 𝗄i(ui)aαi{\sf k}_{i}(u_{i})\vdash_{\mathit{a}}\alpha_{i} and σ(𝗄i1(I))aσ(βi)\sigma({\sf k}_{i-1}(I))\vdash_{\mathit{a}}\sigma(\beta_{i}).

Note that honest agent derivations of the form 𝗄i(ui)aαi{\sf k}_{i}(u_{i})\vdash_{\mathit{a}}\alpha_{i} do not depend on accidental unification with intruder variables under σ\sigma; rather, they hold even in the “abstract”.

We can write an AA-session and a BB-session for the Example 1 protocol as A:β1α1,A:β3α3A:\beta_{1}\Rightarrow\alpha_{1},A:\beta_{3}\Rightarrow\alpha_{3} and B:β2α2B:\beta_{2}\Rightarrow\alpha_{2}. (To save space, we denote by pAp_{A} and pBp_{B} the keys 𝑝𝑘(kA)\mathit{pk}(k_{A}) and 𝑝𝑘(kB)\mathit{pk}(k_{B}).) We assume that AA starts a session by receiving a dummy name ss, and ends the session by sending ss out, and code up each communicated term tt from Example 1 as the assertion tt{{t}\bowtie{t}}. Note that A,B,pA,mA,B,p_{A},m, and pBp_{B} are names used to instantiate agent variables in these sessions. The set of these two sessions is coherent.

β1=ssα1={(pA,{m}pB)(pA,{m}pB)}β2={(x,{y}pB)(x,{y}pB)}α2={{y}x{y}x}β3={{m}pA{m}pA}α3=ss\beta_{1}={{s}\bowtie{s}}\qquad\qquad\hskip 8.53581pt\alpha_{1}=\{{{(p_{A},\{m\}_{p_{B}})}\bowtie{(p_{A},\{m\}_{p_{B}})}}\}\\ \beta_{2}=\{{{(x,\{y\}_{p_{B}})}\bowtie{(x,\{y\}_{p_{B}})}}\}\qquad\hskip 5.69054pt\alpha_{2}=\{{{\{y\}_{x}}\bowtie{\{y\}_{x}}}\}\\ \beta_{3}=\{{{\{m\}_{p_{A}}}\bowtie{\{m\}_{p_{A}}}}\}\qquad\qquad\hskip 14.22636pt\alpha_{3}={{s}\bowtie{s}}

Consider the substitution σ=[xpA,ym]\sigma=[x\mapsto p_{A},y\mapsto m] applied to ξ=A:β1α1,B:β2α2,A:β3α3\xi=A:\beta_{1}\Rightarrow\alpha_{1},B:\beta_{2}\Rightarrow\alpha_{2},A:\beta_{3}\Rightarrow\alpha_{3}. This would be a run (ξ,σ)(\xi,\sigma) where the intruder just observes traffic on the network, but does not interfere otherwise.

Let XB={A,B,pA,pB,kB}X_{B}=\{A,B,p_{A},p_{B},k_{B}\}. 𝗄0(B)=(XB;){\sf k}_{0}(B)=(X_{B};\emptyset). Note that 𝗄1(B)=𝗄0(B){\sf k}_{1}(B)={\sf k}_{0}(B). There is an update to BB’s knowledge state only upon receipt of β2\beta_{2}. So, 𝗄2(B)=𝑢𝑝𝑑𝑎𝑡𝑒(𝗄1(B),β2){\sf k}_{2}(B)={\it update}({\sf k}_{1}(B),\beta_{2}) is given by (X;Φ)(X^{\prime};\Phi) where X=X{(pA,{m}pB)}X^{\prime}=X\cup\{(p_{A},\{m\}_{p_{B}})\} and Φ={{(pA,{m}pB)(pA,{m}pB)}\Phi=\{\{{{(p_{A},\{m\}_{p_{B}})}\bowtie{(p_{A},\{m\}_{p_{B}})}}\}.

We can also consider a run with the same ξ\xi under a substitution σ=[x𝑝𝑘(kI),ym]\sigma=[x\mapsto\mathit{pk}(k_{I}),y\mapsto m], which represents the man-in-the-middle attack shown earlier.

A secrecy property is given by an assertion γ\gamma that the intruder should not know. A KK-bounded attack which violates the secrecy of γ\gamma is a run of the protocol with at most KK sessions where σ(𝗄n(I))aσ(γ)\sigma({\sf k}_{n}(I))\vdash_{\mathit{a}}\sigma(\gamma).

Definition 12 (KK-bounded insecurity problem).

Given a protocol 𝑃𝑟\mathit{Pr} and a designated assertion γ\gamma, check whether there exists a KK-bounded attack on 𝑃𝑟\mathit{Pr} violating the secrecy of γ\gamma.

Henceforth, we will use “insecurity problem” to mean the KK-bounded insecurity problem for some KK.

3 Proof strategy for the insecurity problem

In the subsequent sections, we will show that the KK-bounded insecurity problem for assertions is in NP. But first, we provide an overview of the proof strategy we will employ.

Given a protocol 𝑃𝑟\mathit{Pr}, a secrecy property specified by an assertion γ\gamma and a bound KK (in unary), one way to check if there is a KK-bounded attack works as follows: Guess a coherent set of sessions of size KK, an interleaving ξ=u1:β1α1,,un:βnαn\xi=u_{1}:{\beta_{1}}\!\Rightarrow\!{\alpha_{1}},\ldots,u_{n}:{\beta_{n}}\!\Rightarrow\!{\alpha_{n}}, and a substitution σ\sigma with 𝖽𝗈𝗆(σ)=𝖿𝗏(ξ){\sf dom}(\sigma)={\sf fv}(\xi), and check that (ξ,σ)(\xi,\sigma) satisfies the conditions in Definition 11. For this, we need an effective check for derivabilities of the form σ(𝗄i1(I))aσ(βi)\sigma({\sf k}_{i-1}(I))\vdash_{\mathit{a}}\sigma(\beta_{i}).

As with terms, this needs us to bound the size of terms assigned to variables by σ\sigma. However, we also have quantified variables in our proofs, for which witnesses need to be assigned. To check whether a formula of the form x.α\exists{x}.~{}\alpha is derivable, one would in general have to check if α(t)\alpha(t) is derivable for some tt, which might be unboundedly large. To get an effective algorithm, we have to show that if there is a witness at all, there is a witness of small size.

One way to represent these witnesses is via a substitution μ\mu which maps each quantified variable xx to the appropriate witness. To obtain small witnesses, we adapt the techniques of [38]. For this, it is helpful to first simplify the LHS to contain only atomic formulas. Any normal proof of α\alpha from such an LHS will not involve 𝖾\wedge\sf e or 𝖾\exists\sf e. We further show, via Theorem 16, that these proofs can be decomposed into multiple proofs, one for each atomic subformula of α\alpha (with witnesses instantiated by μ\mu), and then applying 𝗂\wedge\sf i and 𝗂\exists\sf i.

Applying Theorem 16 to each derivability check σ(𝗄i1(I))aσ(βi)\sigma({\sf k}_{i-1}(I))\vdash_{\mathit{a}}\sigma(\beta_{i}) for 1in1\leq i\leq n, we get a set of witness substitutions {μ1,,μn}\{\mu_{1},\dots,\mu_{n}\}. We would like to ensure that all of these, along with σ\sigma, can be chosen to be “small”.

In order to obtain these small substitutions, we follow the techniques of [38]. This involves identifying and mapping to atomic terms variables that do not map to any term that “corresponds” to one in the protocol specification. However, unlike [38], we need to do this simultaneously for multiple substitutions – σ\sigma (which instantiates intruder variables) and μi\mu_{i} (which instantiates quantified variables). The various μi\mu_{i}s might be influenced by σ\sigma, so preserving derivabilities when moving to small substitutions becomes a challenge. In order to do this, we employ a notion of “typed proofs”, both for the 𝑑𝑦\vdash_{\mathit{dy}} and 𝑒𝑞\vdash_{\mathit{eq}} systems. We show that any proof can be converted to a typed equivalent, and typed proofs make it easier for us to replace the substitutions therein with small ones while preserving derivations.

We will now present the solution in detail.

4 Solving the insecurity problem for a\vdash_{\mathit{a}}

We fix a protocol 𝑃𝑟\mathit{Pr} and a run (ξ,σ)(\xi,\sigma) of 𝑃𝑟\mathit{Pr}. By renaming variables if necessary, we can ensure that 𝖿𝗏(ξ)𝒱q={\sf fv}(\xi)\cap\mathscr{V}_{q}=\emptyset. Thus, in all proof sequents that we consider, no variable has both free and bound occurrences, and no variable is quantified by distinct quantifiers. Furthermore, whenever we use (S;A)(S;A), we mean that SS is a set of terms, AA is a set of assertions, and SS derives the public terms of all assertions in AA.

We also use 𝗏𝖺𝗋𝗌(S;A){\sf vars}(S;A) to mean 𝗏𝖺𝗋𝗌(S)𝗏𝖺𝗋𝗌(A){\sf vars}(S)\cup{\sf vars}(A) and 𝖿𝗏(S;A){\sf fv}(S;A) to mean 𝗏𝖺𝗋𝗌(S)𝖿𝗏(A){\sf vars}(S)\cup{\sf fv}(A).

As a first step, we move to an LHS consisting solely of atomic formulas. For this, we will employ the following two “left” properties enjoyed by the a\vdash_{\mathit{a}} system.

Lemma 13.

a

  1. 1.

    (S;A{αβ})aγ(S;A\cup\{\alpha\wedge\beta\})\vdash_{\mathit{a}}\gamma iff (S;A{α,β})aγ(S;A\cup\{\alpha,\beta\})\vdash_{\mathit{a}}\gamma.

  2. 2.

    Let S,A,x.αS,A,\exists x.\alpha and γ\gamma be such that x𝗏𝖺𝗋𝗌(S)𝗏𝖺𝗋𝗌(A{γ})x\notin{\sf vars}(S)\cup{\sf vars}(A\cup\{\gamma\}) and x(α)𝔸(S{x},α)\mathbb{P}_{x}({\alpha})\subseteq\mathbb{A}(S\cup\{x\},\alpha). Then (S;A{x.α})aγ(S;A\cup\{\exists x.\alpha\})\vdash_{\mathit{a}}\gamma iff (S{x};A{α})aγ(S\cup\{x\};A\cup\{\alpha\})\vdash_{\mathit{a}}\gamma.

Proof.
  1. 1.

    To save space, we use A,φA,\varphi to mean A{φ}A\cup\{\varphi\} in the proof to follow.

    For the left to right direction, let π\pi be a proof of S;A,αβγS;A,\alpha\wedge\beta\vdash\gamma. The following is a proof of S;A,α,βγS;A,\alpha,\beta\vdash\gamma.

    tensy tensy tensy  ax S;A,α,βα     tensy  ax S;A,α,ββ  i S;A,α,βαβ      π S;A,αβγ   S;A,α,βγ {tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1\hskip 5.0pt plus 1.0fil{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1\hskip 5.0pt plus 1.0fil{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 28.8292pt\hbox{$\displaystyle\penalty 1$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=57.65839pt\hbox{\kern 3.00003pt${\sf ax}$}}}\hbox{\kern 0.0pt\hbox{$\displaystyle S;A,\alpha,\beta\vdash\alpha$}}}}\hskip 5.0pt plus 1.0fil\penalty 2\hskip 5.0pt plus 1.0fil{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 28.4588pt\hbox{$\displaystyle\penalty 1$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=56.9176pt\hbox{\kern 3.00003pt${\sf ax}$}}}\hbox{\kern 0.0pt\hbox{$\displaystyle S;A,\alpha,\beta\vdash\beta$}}}}\hskip 5.0pt plus 1.0fil\penalty 2$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=203.56927pt\hbox{\kern 3.00003pt$\wedge\sf i$}}}\hbox{\kern 64.57181pt\hbox{$\displaystyle S;A,\alpha,\beta\vdash\alpha\wedge\beta$}}}}\hskip 5.0pt plus 1.0fil\penalty 2\hskip 5.0pt plus 1.0fil{\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 28.70251pt\hbox{$\displaystyle\penalty 1\pi$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 30.16376pt$\vbox to16.14578pt{\leaders\vbox to5.38193pt{\vss\hbox{$\cdot$}\vss}\vfill}$\hbox{}}}\hbox{\kern 0.0pt\hbox{$\displaystyle S;A,\alpha\wedge\beta\vdash\gamma$}}}}\hskip 5.0pt plus 1.0fil\penalty 2$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=322.56003pt\hbox{}}}\hbox{\kern 133.06068pt\hbox{$\displaystyle S;A,\alpha,\beta\vdash\gamma$}}}}

    For the other direction, let π\pi be a proof of S;A,α,βγS;A,\alpha,\beta\vdash\gamma. We obtain a proof of S;A,αβγS;A,\alpha\wedge\beta\vdash\gamma below. We omit the S;AS;A part of the LHS to conserve space.

    tensy tensy tensy  ax αβαβ  e αββ     tensy tensy tensy  ax αβαβ  e αβα      π α,βγ   αβ,βγ   αβγ {tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1\hskip 5.0pt plus 1.0fil{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1\hskip 5.0pt plus 1.0fil{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 28.99756pt\hbox{$\displaystyle\penalty 1$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=57.99512pt\hbox{\kern 3.00003pt${\sf ax}$}}}\hbox{\kern 0.0pt\hbox{$\displaystyle\alpha\wedge\beta\vdash\alpha\wedge\beta$}}}}\hskip 5.0pt plus 1.0fil\penalty 2$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=102.49176pt\hbox{\kern 3.00003pt$\wedge\sf e{}$}}}\hbox{\kern 31.00235pt\hbox{$\displaystyle\alpha\wedge\beta\vdash\beta$}}}}\hskip 5.0pt plus 1.0fil\penalty 2\hskip 5.0pt plus 1.0fil{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1\hskip 5.0pt plus 1.0fil{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1\hskip 5.0pt plus 1.0fil{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 28.99756pt\hbox{$\displaystyle\penalty 1$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=57.99512pt\hbox{\kern 3.00003pt${\sf ax}$}}}\hbox{\kern 0.0pt\hbox{$\displaystyle\alpha\wedge\beta\vdash\alpha\wedge\beta$}}}}\hskip 5.0pt plus 1.0fil\penalty 2$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=102.49176pt\hbox{\kern 3.00003pt$\wedge\sf e{}$}}}\hbox{\kern 30.63196pt\hbox{$\displaystyle\alpha\wedge\beta\vdash\alpha$}}}}\hskip 5.0pt plus 1.0fil\penalty 2\hskip 5.0pt plus 1.0fil{\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 13.82063pt\hbox{$\displaystyle\penalty 1\pi$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 15.28188pt$\vbox to16.14578pt{\leaders\vbox to5.38193pt{\vss\hbox{$\cdot$}\vss}\vfill}$\hbox{}}}\hbox{\kern 0.0pt\hbox{$\displaystyle\alpha,\beta\vdash\gamma$}}}}\hskip 5.0pt plus 1.0fil\penalty 2$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=193.3854pt\hbox{\kern 3.00003pt$$}}}\hbox{\kern 71.6383pt\hbox{$\displaystyle\alpha\wedge\beta,\beta\vdash\gamma$}}}}\hskip 5.0pt plus 1.0fil\penalty 2$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=377.64812pt\hbox{}}}\hbox{\kern 168.81999pt\hbox{$\displaystyle\alpha\wedge\beta\vdash\gamma$}}}}

    We have freely used the cut rule, which is admissible in our system.

    tensy S;AφS;B,φψ   S;ABψ {tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1S;A\vdash\varphi\qquad S;B,\varphi\vdash\psi$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=105.26704pt\hbox{}}}\hbox{\kern 24.61801pt\hbox{$\displaystyle S;A\cup B\vdash\psi$}}}}

    If π0\pi_{0} and π1\pi_{1} are derivations of the left and right premises as above, then we can replace each axiom rule occurring in π1\pi_{1} and deriving φ\varphi, with the proof π0\pi_{0}, thus yielding a proof of S;ABψS;A\cup B\vdash\psi.

  2. 2.

    For the left to right direction, let π\pi be a proof of S;A,x.αγS;A,\exists{x}.\alpha\vdash\gamma. Note that we have a proof π1\pi_{1} of x.α\exists{x}.\alpha from (S,x;A,α)(S,x;A,\alpha), where the 𝗂\exists\sf i rule is justified because the abstractability side condition x(α)𝔸(S{x},α)\mathbb{P}_{x}({\alpha})\subseteq\mathbb{A}(S\cup\{x\},\alpha) is assumed. We can then use the 𝖼𝗎𝗍{\sf cut} rule (which is admissible in a\vdash_{\mathit{a}}) on this proof along with the proof π\pi to get (S,x;A,α)aγ(S,x;A,\alpha)\vdash_{\mathit{a}}\gamma.

    tensy tensy tensy  ax S,x;A,αα  i S,x;A,αx.α      π S;A,x.αγ  cut S,x;A,αγ {tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1\hskip 5.0pt plus 1.0fil{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1\hskip 5.0pt plus 1.0fil{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 28.58092pt\hbox{$\displaystyle\penalty 1$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=57.16183pt\hbox{\kern 3.00003pt${\sf ax}$}}}\hbox{\kern 0.0pt\hbox{$\displaystyle S,x;A,\alpha\vdash\alpha$}}}}\hskip 5.0pt plus 1.0fil\penalty 2$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=101.65848pt\hbox{\kern 3.00003pt$\exists\sf i$}}}\hbox{\kern 14.39069pt\hbox{$\displaystyle S,x;A,\alpha\vdash\exists{x}.\alpha$}}}}\hskip 5.0pt plus 1.0fil\penalty 2\hskip 5.0pt plus 1.0fil{\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 28.1765pt\hbox{$\displaystyle\penalty 1\pi$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 29.63774pt$\vbox to16.14578pt{\leaders\vbox to5.38193pt{\vss\hbox{$\cdot$}\vss}\vfill}$\hbox{}}}\hbox{\kern 0.0pt\hbox{$\displaystyle S;A,\exists{x}.\alpha\vdash\gamma$}}}}\hskip 5.0pt plus 1.0fil\penalty 2$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=217.93056pt\hbox{\kern 3.00003pt${\sf cut}$}}}\hbox{\kern 80.9942pt\hbox{$\displaystyle S,x;A,\alpha\vdash\gamma$}}}}

    For the other direction, let π\pi be a proof of S,x;A,αγS,x;A,\alpha\vdash\gamma. We obtain a proof of S;A,x.αγS;A,\exists{x}.\alpha\vdash\gamma as follows.

    tensy tensy  ax S;A,x.αx.α      π S,x;A,αγ  e S;A,x.αγ {tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1\hskip 5.0pt plus 1.0fil{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 39.49411pt\hbox{$\displaystyle\penalty 1$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=78.98822pt\hbox{\kern 3.00003pt${\sf ax}$}}}\hbox{\kern 0.0pt\hbox{$\displaystyle S;A,\exists{x}.\alpha\vdash\exists{x}.\alpha$}}}}\hskip 5.0pt plus 1.0fil\penalty 2\hskip 5.0pt plus 1.0fil{\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{\kern 25.12094pt\hbox{$\displaystyle\penalty 1\pi$}}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 26.58218pt$\vbox to16.14578pt{\leaders\vbox to5.38193pt{\vss\hbox{$\cdot$}\vss}\vfill}$\hbox{}}}\hbox{\kern 0.0pt\hbox{$\displaystyle S,x;A,\alpha\vdash\gamma$}}}}\hskip 5.0pt plus 1.0fil\penalty 2$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=189.427pt\hbox{\kern 3.00003pt$\exists\sf e$}}}\hbox{\kern 63.68687pt\hbox{$\displaystyle S;A,\exists{x}.\alpha\vdash\gamma$}}}}

This leads us to a notion of kernel.

Definition 14.

The atoms of an assertion α\alpha, denoted 𝖺𝗍(α){\sf at}(\alpha), is the set of all maximal subformulas of α\alpha that are atomic. The kernel of (S;A)(S;A), denoted 𝑘𝑒𝑟(S;A)\mathit{ker}(S;A), is given by (T;E)(T;E) where T=S𝖻𝗏(A)T=S\cup{\sf bv}(A) and E={β𝖺𝗍(α)αA}E=\{\beta\in{\sf at}(\alpha)\mid\alpha\in A\}.

Any x𝖻𝗏(A)x\in{\sf bv}(A) which is added to TT can be thought of as an “eigenvariable” which witnesses an existential assertion in AA. If we derive some γ\gamma from (T{x};β)(T\cup\{x\};\beta), since we only consider γ\gamma such that 𝗏𝖺𝗋𝗌(γ)𝖻𝗏(A)={\sf vars}(\gamma)\cap{\sf bv}(A)=\emptyset, we can also derive it from (T;x.β)(T;\exists{x}.\beta). Lemma 13 can thus always be applied, and it can be shown that kernels preserve derivability, i.e. (S;A)aγ(S;A)\vdash_{\mathit{a}}\gamma iff 𝑘𝑒𝑟(S;A)aγ\mathit{ker}(S;A)\vdash_{\mathit{a}}\gamma for any γ\gamma.

Here is another basic property of kernels, which is crucially used in many proofs later.

Lemma 15.

Suppose (T;E)=𝑘𝑒𝑟(S;A)(T;E)=\mathit{ker}(S;A) for some (S;A)(S;A). If (T;E)aα(T;E)\vdash_{\mathit{a}}\alpha and a𝗉𝗎𝖻𝗌(α)a\in{\sf pubs}(\alpha), then T𝑑𝑦aT\vdash_{\mathit{dy}}a. If (T;E)𝑒𝑞tu(T;E)\vdash_{\mathit{eq}}{{t}\bowtie{u}} then T𝑑𝑦tT\vdash_{\mathit{dy}}t and T𝑑𝑦uT\vdash_{\mathit{dy}}u.

Proof.

Recall that we only consider (S;A)(S;A) such that 𝖿𝗏(S;A)𝒱q={\sf fv}(S;A)\cap\mathscr{V}_{q}=\emptyset, and S𝑑𝑦𝗉𝗎𝖻𝗌(β)SS\nvdash_{\mathit{dy}}{\sf pubs}(\beta)\in S for all βA\beta\in A. Since (T;E)=𝑘𝑒𝑟(S;A)(T;E)=\mathit{ker}(S;A), we have T=S𝖻𝗏(A)T=S\cup{\sf bv}(A) and E={γ𝖺𝗍(β)βA}E=\{\gamma\in{\sf at}(\beta)\mid\beta\in A\}. Thus T𝑑𝑦𝗉𝗎𝖻𝗌(γ)TT\vdash_{\mathit{dy}}{\sf pubs}(\gamma)\in T for every γE\gamma\in E, and 𝗏𝖺𝗋𝗌(E)𝒱qT{\sf vars}(E)\cap\mathscr{V}_{q}\subseteq T.

Let π\pi be a proof of (T;E)aα(T;E)\vdash_{\mathit{a}}\alpha. Note that π\pi has no occurrence of 𝖾\exists\sf e or 𝖾\wedge\sf e. We assume that all premises of 𝖾𝗊{\sf eq} are normal 𝑑𝑦\vdash_{\mathit{dy}} proofs ending in a destructor (by repeatedly turning all constructor+𝖾𝗊\text{constructor}+{\sf eq} patterns into 𝖾𝗊+𝖼𝗈𝗇𝗌{\sf eq}+{\sf cons}). We show by induction that T𝑑𝑦𝗉𝗎𝖻𝗌(α)T\vdash_{\mathit{dy}}{\sf pubs}(\alpha). Let 𝗋{\sf r} denote the last rule of π\pi.

  • 𝗋=𝖺𝗑{\sf r}={\sf ax}: αE\alpha\in E. So T𝑑𝑦𝗉𝗎𝖻𝗌(α)T\vdash_{\mathit{dy}}{\sf pubs}(\alpha).

  • 𝗋=𝖾𝗊{\sf r}={\sf eq}: α\alpha is tt{{t}\bowtie{t}} with T𝑑𝑦tT\vdash_{\mathit{dy}}t via a proof ending in destructor. Since any term in TT is either in 𝒱q\mathscr{V}_{q} or contains no variables from 𝒱q\mathscr{V}_{q}, and since t𝗌𝗍(T)t\in{\sf st}(T), we see that 𝗉𝗎𝖻𝗌(α){\sf pubs}(\alpha) is {t}\{t\} or \emptyset, and T𝑑𝑦𝗉𝗎𝖻𝗌(α)T\vdash_{\mathit{dy}}{\sf pubs}(\alpha) in both cases.

  • 𝗋{𝗌𝗒𝗆,𝗍𝗋𝖺𝗇𝗌,𝗉𝗋𝗈𝗆,𝗂𝗇𝗍,𝗌𝗎𝖻𝗌𝗍,𝗂}{\sf r}\in\{{\sf sym},{\sf trans},{\sf prom},{\sf int},{\sf subst},\wedge\sf i\}: Any t𝗉𝗎𝖻𝗌(α)t\in{\sf pubs}(\alpha) is in 𝗉𝗎𝖻𝗌(β){\sf pubs}(\beta) for one of the premises β\beta, and the result follows.

  • 𝗋=𝖼𝗈𝗇𝗌{\sf r}={\sf cons}: α\alpha is of the form tu{{t}\bowtie{u}}, where t=𝖿(t0,t1)t={\sf f}(t_{0},t_{1}) and u=𝖿(u0,u1)u={\sf f}(u_{0},u_{1}), and the immediate subproofs of π\pi derive t0u0{{t_{0}}\bowtie{u_{0}}} and t1u1{{t_{1}}\bowtie{u_{1}}}. Now, any term in 𝗉𝗎𝖻𝗌(α){\sf pubs}(\alpha) is a public term of one of the premises (and we can apply IH), unless it is tt or uu. Say it is tt. Then, tt is a maximal subterm of α\alpha which avoid 𝒱q\mathscr{V}_{q}, and thus it must be that t0t_{0} and t1t_{1} are also public terms of the premises. Thus T𝑑𝑦{t0,t1}T\vdash_{\mathit{dy}}\{t_{0},t_{1}\} by IH, and hence T𝑑𝑦tT\vdash_{\mathit{dy}}t. Similarly for uu.

  • 𝗋=𝗉𝗋𝗈𝗃{\sf r}={\sf proj}: α\alpha is tu{{t}\bowtie{u}}, and any public term of α\alpha is a public term of the premise (and we can apply IH), unless it is tt or uu. But by abstractability, T𝑑𝑦{t,u}T\vdash_{\mathit{dy}}\{t,u\}, and we are done.

  • 𝗋=𝗐𝗄{\sf r}={\sf wk}: α\alpha is t[n0,,nk]t\twoheadleftarrow[n_{0},\ldots,n_{k}], where tt and all the nin_{i}’s are variables or names. The premise is tni{{t}\bowtie{n_{i}}} for some ii, and we also require that S𝑑𝑦niS\vdash_{\mathit{dy}}n_{i} for all ii. Combining this with the IH, we see that S𝑑𝑦𝗉𝗎𝖻𝗌(α)S\vdash_{\mathit{dy}}{\sf pubs}(\alpha).

  • 𝗋=𝗌𝖺𝗒{\sf r}={\sf say}: α\alpha is of the form 𝑝𝑘(k)𝑠𝑎𝑦𝑠β\mathit{pk}(k)\ \mathit{says}\ \beta, and β\beta is proved by the immediate subproof. We also have that SkS\vdash k and hence S𝑝𝑘(k)S\vdash\mathit{pk}(k). Any other public term occurring in α\alpha occurs in β\beta, so by IH we have that S𝑑𝑦𝗉𝗎𝖻𝗌(α)S\vdash_{\mathit{dy}}{\sf pubs}(\alpha).

  • 𝗋=𝗂{\sf r}=\exists\sf i: α\alpha is of the form x.β\exists{x}.\beta, with premise γ=β[r]P\gamma={\beta}[{r}]_{P}, where P=x(β)P=\mathbb{P}_{x}({\beta}). We also have, by the other requirements for the rule, T𝑑𝑦rT\vdash_{\mathit{dy}}r and P𝔸(T{x},β)P\subseteq\mathbb{A}(T\cup\{x\},\beta). By Lemma 8, P𝔸(T,γ)P\subseteq\mathbb{A}(T,\gamma). Consider any a=α|q𝗉𝗎𝖻𝗌(α)a={\alpha}|_{q}\in{\sf pubs}(\alpha). If a𝗉𝗎𝖻𝗌(γ)a\in{\sf pubs}(\gamma), then we can apply IH. Otherwise, qq has to be a sibling of some position in pPp\in P. In other words, aa is public in α\alpha because its sibling is xx, but in γ\gamma, the xx is replaced by rr (and 𝗏𝖺𝗋𝗌(r)𝒱q={\sf vars}(r)\cap\mathscr{V}_{q}=\emptyset), so aa is no longer a maximal subterm avoiding 𝒱q\mathscr{V}_{q}. Since the set of abstractable positions is sibling-closed, q𝔸(T,α)q\in\mathbb{A}(T,\alpha), and since subterms at abstractable positions are derivable, T𝑑𝑦aT\vdash_{\mathit{dy}}a.

Now consider an 𝑒𝑞\vdash_{\mathit{eq}} proof of (T;E)tu(T;E)\vdash{{t}\bowtie{u}}. It has been shown above that T𝑑𝑦𝗉𝗎𝖻𝗌(tu)T\vdash_{\mathit{dy}}{\sf pubs}({{t}\bowtie{u}}). Consider tt. Either t𝗉𝗎𝖻𝗌(tu)t\in{\sf pubs}({{t}\bowtie{u}}), in which case we are done. Otherwise, every maximal subterm of tt which avoids 𝒱q\mathscr{V}_{q} is derivable from TT, and every x𝗏𝖺𝗋𝗌(t)𝒱qx\in{\sf vars}(t)\cap\mathscr{V}_{q} is in TT. From these, we can “build up” tt using constructor rules only, thereby proving that T𝑑𝑦tT\vdash_{\mathit{dy}}t. Similarly we can show that T𝑑𝑦uT\vdash_{\mathit{dy}}u. ∎

As mentioned earlier, by proof normalization, we decompose a proof π\pi of (S;A)α(S;A)\vdash\alpha into several proofs of atomic subformulas of α\alpha (equalities, predicates, list membership, and says assertions), and a proof π0\pi_{0} which uses these atoms as axioms, and applies 𝗂\wedge\sf i and 𝗂\exists\sf i, all with the kernel as LHS.

For each of these atomic subformulas, we would like to operate in a proof system which does not involve conjunction or existential quantification. This is easy to do for equalities, predicates, and lists, because the only way to derive such assertions is by deriving other equalities, predicates, and lists.

However, consider subformulas of the form 𝑝𝑘(k)𝑠𝑎𝑦𝑠β\mathit{pk}(k)\ \mathit{says}\ \beta. We can derive those in two ways – either by using 𝖺𝗑{\sf ax} (if the formula is already in the LHS) or by using the 𝗌𝖺𝗒{\sf say} rule on β\beta and kk. In the latter case, β\beta might contain logical operators! Thus, we need to break down β\beta as well.

We thus formalize the hereditary atoms of a formula as:

𝗁𝖺𝗍(γ)={𝗁𝖺𝗍(α)𝗁𝖺𝗍(β)if γ=αβ𝗁𝖺𝗍(α)if γ=x.α{𝑝𝑘(k)𝑠𝑎𝑦𝑠α}𝗁𝖺𝗍(α)if γ=𝑝𝑘(k)𝑠𝑎𝑦𝑠α{γ}otherwise{\sf hat}(\gamma)=\begin{cases}{\sf hat}(\alpha)\cup{\sf hat}(\beta)&\text{if $\gamma=\alpha\wedge\beta$}\\ {\sf hat}(\alpha)&\text{if $\gamma=\exists{x}.\alpha$}\\ \left\{\mathit{pk}(k)\ \mathit{says}\ \alpha\right\}\cup{\sf hat}(\alpha)&\text{if $\gamma=\mathit{pk}(k)\ \mathit{says}\ \alpha$}\\ \{\gamma\}&\text{otherwise}\end{cases}

We now reduce any proof of S;AaαS;A\vdash_{\mathit{a}}\alpha to one with a very particular structure, as depicted in Figure 3. This new proof has as its LHS the kernel (T;E)(T;E) of (S;A)(S;A), and derives α\alpha. This proof first involves multiple proofs, each of which is an 𝑒𝑞\vdash_{\mathit{eq}} proof 333Recall that 𝑒𝑞\vdash_{\mathit{eq}} is the subsystem that does not use any rules from {𝗂,𝖾,𝗂,𝖾,𝗌𝖺𝗒}\{\wedge\sf i,\wedge\sf e,\exists\sf i,\exists\sf e,{\sf say}\}. of some hereditary atom of α\alpha, with witnesses appropriately assigned to bound variables by a substitution μ\mu. These proofs are then followed by applications of the 𝖺𝗑{\sf ax}, 𝗂\wedge\sf i, 𝗂\exists\sf i and 𝗌𝖺𝗒{\sf say} rules (represented by i\vdash_{i} in the Figure 3) to get α\alpha.

Refer to caption𝑒𝑞\vdash_{\mathit{eq}}i\vdash_{i}Each a sequent of the formT;Eμ(β)T;E\vdash\mu(\beta) for β𝗁𝖺𝗍(α)\beta\in{\sf hat}(\alpha)T;EαT;E\vdash\alpha
Figure 3: Structure of the new proof guaranteed by Theorem 16

Consider the set XX of all hereditary atoms of α\alpha which feature in the above reduction. Suppose βX\beta\in X is of the form 𝑝𝑘(k)𝑠𝑎𝑦𝑠(x.δ)\mathit{pk}(k)\ \mathit{says}\ (\exists{x}.\delta), but x.δX\exists{x}.\delta\notin X. Then β\beta can only be derived from the LHS by the 𝖺𝗑{\sf ax} rule, since there is no other rule in the 𝑒𝑞\vdash_{\mathit{eq}} system that derives a𝑠𝑎𝑦𝑠\ \mathit{says}\ assertion. Thus we do not obtain x.δ\exists{x}.\delta using the 𝗂\exists\sf i rule, and so we do not need to provide a witness for such an xx. This is precisely formulated in the next theorem.

In the statement of the theorem, [a] ensures that all witnesses are derivable, [b] ensures that all the atoms in XX have a proof (with witnesses instantiated appropriately), and [c] ensures that the final intros-only proof exists. Finally, [d] ensures that the proper abstractability conditions for applications of 𝗂\exists\sf i are satisfied. For any set of assertions, we denote the set {x𝖻𝗏(β)βX}\{x\in{\sf bv}(\beta)\mid\beta\in X\} by 𝖻𝗏(X){\sf bv}(X).

Theorem 16.

For a formula α\alpha s.t. 𝖻𝗏(α)𝗏𝖺𝗋𝗌(S;A)={\sf bv}(\alpha)\cap{\sf vars}(S;A)=\emptyset, and (T;E)=𝑘𝑒𝑟(S;A)(T;E)=\mathit{ker}(S;A), (S;A)aα(S;A)\vdash_{\mathit{a}}\alpha iff there is X𝗁𝖺𝗍(α)X\subseteq{\sf hat}(\alpha) and μ\mu with 𝖽𝗈𝗆(μ)=𝖻𝗏(α)𝖻𝗏(X){\sf dom}(\mu)={\sf bv}(\alpha)\setminus{\sf bv}(X) s.t.:

  1. [a]

    x𝖽𝗈𝗆(μ):T𝑑𝑦μ(x)\forall{}x\in{\sf dom}(\mu):T\vdash_{\mathit{dy}}\mu(x).

  2. [b]

    For all βX\beta\in X, (T;E)𝑒𝑞μ(β)(T;E)\vdash_{\mathit{eq}}\mu(\beta).

  3. [c]

    (T;μ(X))aα(T;\mu(X))\vdash_{\mathit{a}}\alpha via a proof using rules from {𝖺𝗑,𝗂,𝗂,𝗌𝖺𝗒}\{{\sf ax},\wedge\sf i,\exists\sf i,{\sf say}\}.

  4. [d]

    x𝖽𝗈𝗆(μ),t𝗌𝗍(α)\forall{}x\in{\sf dom}(\mu),t\in{\sf st}(\alpha): x(t)𝔸(T𝖽𝗈𝗆(μ),t)\mathbb{P}_{x}({t})\subseteq\mathbb{A}(T\cup{\sf dom}(\mu),t).

Proof.

a

()(\Rightarrow)

Suppose (S;A)aα(S;A)\vdash_{\mathit{a}}\alpha. Then, since kernels preserve derivability, (T;E)aα(T;E)\vdash_{\mathit{a}}\alpha. Let π\pi be a normal proof of (T;E)α(T;E)\vdash\alpha. Since EE only has atomic assertions, it is easy to see that there is no occurrence of the 𝖾\wedge\sf e and 𝖾\exists\sf e rules. Recall that we only consider α\alpha such that no xx is quantified by quantifiers occurring in two distinct positions in α\alpha, and that no variable occurs both free and bound in α\alpha. For each x𝖻𝗏(α)x\in{\sf bv}(\alpha) introduced in π\pi via an 𝗂\exists\sf i application, let txt_{x} be the witness used by the 𝗂\exists\sf i rule introducing the quantifier x\exists{x} in α\alpha. Define μ(x)tx\mu(x)\coloneqq t_{x} for each such xx. The side conditions for the 𝗂\exists\sf i occurrences guarantee that T𝑑𝑦μ(x)T\vdash_{\mathit{dy}}\mu(x) for each x𝖽𝗈𝗆(μ)x\in{\sf dom}(\mu), thus satisfying [a].

Let X𝗁𝖺𝗍(α)X\subseteq{\sf hat}(\alpha) be all the hereditary atoms of α\alpha appearing on the RHS in various subproofs of π\pi. By normalization, one can always place the logical rules after deriving atomic formulas. Hence, we can decompose π\pi into proofs πβ\pi_{\beta} of (T;E)μ(β)(T;E)\vdash\mu(\beta) for each βX\beta\in X, and a proof π^\widehat{\pi} deriving (T;μ(X))α(T;\mu(X))\vdash\alpha using only the 𝖺𝗑,𝗂,𝗂{\sf ax},\wedge\sf i,\exists\sf i and 𝗌𝖺𝗒{\sf say} rules. This proves [b] and [c].

We now prove [d]. It is evident that each subproof of π^\widehat{\pi} has conclusion μ(β)\mu(\beta) for some β𝗌𝖿(α)\beta\in{\sf sf}(\alpha), with π^\widehat{\pi} itself deriving μ(α)=α\mu(\alpha)=\alpha. We will now show that for every subproof π0\pi_{0} of π^\widehat{\pi} with conclusion μ(β)\mu(\beta) and last rule 𝗋{\sf r}, we have (letting Zβ=𝖻𝗏(β)𝖻𝗏(X)Z_{\beta}={\sf bv}(\beta)\setminus{\sf bv}(X)):

xZβ,t𝗌𝗍(μ(β)):x(t)𝔸(TZβ,t).\forall{}x\in Z_{\beta},\forall{}t\in{\sf st}(\mu(\beta)):\mathbb{P}_{x}({t})\subseteq\mathbb{A}(T\cup Z_{\beta},t). (1)
𝗋=𝖺𝗑{\sf r}={\sf ax}:

μ(β)μ(X)\mu(\beta)\in\mu(X), so Zβ=Z_{\beta}=\emptyset, and so (1) holds vacuously.

𝗋=𝗂{\sf r}=\wedge\sf i:

β\beta of the form β0β1\beta_{0}\wedge\beta_{1}, and 𝖻𝗏(β0){\sf bv}(\beta_{0}) and 𝖻𝗏(β1){\sf bv}(\beta_{1}) are disjoint, and no variable has both free and bound occurrences. So no variable in 𝖻𝗏(βi){\sf bv}(\beta_{i}) occurs in β1i\beta_{1-i}. So if x𝖻𝗏(βi)x\in{\sf bv}(\beta_{i}), and any t𝗌𝗍(μ(β1i))t\in{\sf st}(\mu(\beta_{1-i})), then x(t)=\mathbb{P}_{x}({t})=\emptyset. So (1) for π0\pi_{0} follows by IH (applied on the immediate subproofs).

𝗋=𝗌𝖺𝗒{\sf r}={\sf say}:

β\beta is of the form 𝑝𝑘(k)𝑠𝑎𝑦𝑠β\mathit{pk}(k)\ \mathit{says}\ \beta^{\prime} and every bound variable of β\beta is also bound in β\beta^{\prime}, so we get (1) from IH.

𝗋=𝗂{\sf r}=\exists\sf i:

β=z.γ\beta=\exists{z}.\gamma, and μ(β)=z.μ(γ)\mu(\beta)=\exists{z}.\mu^{\prime}(\gamma), where μ=μ(Zγ)\mu^{\prime}=\mu\upharpoonright(Z_{\gamma}). The immediate subproof of π0\pi_{0} has conclusion μ(γ)\mu(\gamma).

Now for any r𝗌𝗍(μ(β))r\in{\sf st}(\mu(\beta)), letting P=z(r)P=\mathbb{P}_{z}({r}), t=r[μ(z)]P𝗌𝗍(μ(γ))t={r}[{\mu(z)}]_{P}\in{\sf st}(\mu(\gamma)). For any x𝒱x\in\mathscr{V}, we have x(r)=x(t)(r)\mathbb{P}_{x}({r})=\mathbb{P}_{x}({t})\cap\mathbb{P}(r) and 𝔸(TZβ,r)=𝔸(TZγ,t)(r)\mathbb{A}(T\cup Z_{\beta},r)=\mathbb{A}(T\cup Z_{\gamma},t)\cap\mathbb{P}(r) (by Lemma 8).

By IH, for all xZγx\in Z_{\gamma} and t𝗌𝗍(μ(γ))t\in{\sf st}(\mu(\gamma)), x(t)𝔸(TZγ,t)𝔸(TZβ,t)\mathbb{P}_{x}({t})\subseteq\mathbb{A}(T\cup Z_{\gamma},t)\subseteq\mathbb{A}(T\cup Z_{\beta},t). So for all xZβ{z}x\in Z_{\beta}\setminus\{z\} and r𝗌𝗍(μ(β))r\in{\sf st}(\mu(\beta)), x(r)𝔸(TZβ,r)\mathbb{P}_{x}({r})\subseteq\mathbb{A}(T\cup Z_{\beta},r).

For zz, the abstractability side condition for 𝗂\exists\sf i implies that for all r𝗌𝗍(μ(β))r\in{\sf st}(\mu(\beta)), z(r)𝔸(TZβ,r)\mathbb{P}_{z}({r})\subseteq\mathbb{A}(T\cup Z_{\beta},r). Thus, equation (1) follows for π0\pi_{0}.

Applying (1) to π^\widehat{\pi}, we get [d].

()(\Leftarrow)

This is the easier direction. We just compose all the 𝑒𝑞\vdash_{\mathit{eq}} proofs and the intros-only proof to obtain an a\vdash_{\mathit{a}} proof π\pi of (T;E)α(T;E)\vdash\alpha. The abstractability condition [d] ensures that the 𝗂\exists\sf i is always enabled in π\pi.

Thus, (T;E)aα(T;E)\vdash_{\mathit{a}}\alpha iff (S;A)aα(S;A)\vdash_{\mathit{a}}\alpha, and so we are done. ∎

For the rest of the paper, we use the following notation. (Ti;Ei)𝑘𝑒𝑟(𝗄i(I))(T_{i};E_{i})\coloneqq\mathit{ker}({\sf k}_{i}(I)) and (Ui;Fi)𝑘𝑒𝑟(𝗄i(ui))(U_{i};F_{i})\coloneqq\mathit{ker}({\sf k}_{i}(u_{i})) for 1in1\leq i\leq n. Note that TiTi+1T_{i}\subseteq T_{i+1} and EiEi+1E_{i}\subseteq E_{i+1} for every ii.

Since 𝖽𝗈𝗆(σ)=𝖿𝗏(ξ){\sf dom}(\sigma)={\sf fv}(\xi), we have σ(x)=x\sigma(x)=x for all x𝒱qx\in\mathscr{V}_{q}. It follows that σ(𝑘𝑒𝑟(S;A))=𝑘𝑒𝑟(σ(S;A))\sigma(\mathit{ker}(S;A))=\mathit{ker}(\sigma(S;A)), for any (S;A)(S;A).

Applying Theorem 16 to the σ(𝗄i1(I))aσ(βi)\sigma({\sf k}_{i-1}(I))\vdash_{\mathit{a}}\sigma(\beta_{i}) derivations in Definition 11, for every ini\leq n we get Xi𝗁𝖺𝗍(βi)X_{i}\subseteq{\sf hat}(\beta_{i}) and a substitution μi\mu_{i} with domain 𝖻𝗏(βi)𝖻𝗏(Xi){\sf bv}(\beta_{i})\setminus{\sf bv}(X_{i}) s.t.:

  • for every x𝖽𝗈𝗆(μi)x\in{\sf dom}(\mu_{i}), σ(Ti1)𝑑𝑦μi(x)\sigma(T_{i-1})\vdash_{\mathit{dy}}\mu_{i}(x), and

  • σ(Ti1;Ei1)𝑒𝑞σμi(γ)\sigma(T_{i-1};E_{i-1})\vdash_{\mathit{eq}}\sigma\mu_{i}(\gamma) for γXi\gamma\in X_{i}.

For every ini\leq n, Definition 11 also states 𝗄i(ui)aαi{\sf k}_{i}(u_{i})\vdash_{\mathit{a}}\alpha_{i}, and thus, σ(𝗄i(ui))aσ(αi)\sigma({\sf k}_{i}(u_{i}))\vdash_{\mathit{a}}\sigma(\alpha_{i}). So Theorem 16 guarantees Yi𝗁𝖺𝗍(αi)Y_{i}\subseteq{\sf hat}(\alpha_{i}) and a substitution θi\theta_{i} with domain 𝖻𝗏(αi)𝖻𝗏(Yi){\sf bv}(\alpha_{i})\setminus{\sf bv}(Y_{i}) s.t.:

  • for every x𝖽𝗈𝗆(θi)x\in{\sf dom}(\theta_{i}), σ(Ui)𝑑𝑦θi(x)\sigma(U_{i})\vdash_{\mathit{dy}}\theta_{i}(x), and

  • σ(Ui;Fi)𝑒𝑞σθi(γ)\sigma(U_{i};F_{i})\vdash_{\mathit{eq}}\sigma\theta_{i}(\gamma), where γYi\gamma\in Y_{i}.

For any γXiYi\gamma\in X_{i}\cup Y_{i}, three possibilities arise.

  • γ\gamma is of the form tu{{t}\bowtie{u}}.

  • γ\gamma is of the form 𝑝𝑘(k)𝑠𝑎𝑦𝑠δ\mathit{pk}(k)\ \mathit{says}\ \delta. Such a formula can only be derived using 𝖺𝗑{\sf ax}, as no other rule in the 𝑒𝑞\vdash_{\mathit{eq}} system generates it. Hence such assertions can be ignored for the rest of this section, which is about preserving non-trivial 𝑒𝑞\vdash_{\mathit{eq}} proofs even after changing some substitutions.

  • γ\gamma is of the form P(u0,,um)P(u_{0},\ldots,u_{m}) or tt\twoheadleftarrow\ell. Such formulas only mention variables or names, so λ(x)\lambda(x) is already small for any λ{σ,θi,μiin}\lambda\in\{\sigma,\theta_{i},\mu_{i}\mid i\leq n\} and any variable xx occurring in γ\gamma. Hence we can ignore such formulas too for the rest of the section, since these formulas do not undergo any change.

Hence we simplify the presentation for the rest of this section by only considering equality assertions γ\gamma.

We now have, for every ini\leq n, substitutions μi\mu_{i} and θj\theta_{j}, each with domain 𝖻𝗏(βi){\sf bv}(\beta_{i}) and 𝖻𝗏(αj){\sf bv}(\alpha_{j}). However, these substitutions do not necessarily map variables to ground terms. It is possible that θj(αj)\theta_{j}(\alpha_{j}) has as a subterm a variable from the domain of some “earlier” μi\mu_{i}, i.e. one where i<ji<j.

If (T;E)xy(T;E)\vdash{{x}\bowtie{y}}, then xx and yy ought to actually stand for the same ground term. To capture this, we need a “compound” substitution that maps each variable in the domain of each μ\mu and each θ\theta to a ground term. We now present a motivating example which is followed by the formal definition of this ground substitution.

Example 17.

Suppose y𝖻𝗏(β1)y\in{\sf bv}(\beta_{1}), and x𝖻𝗏(α2)x\in{\sf bv}(\alpha_{2}). Consider a situation where θ2(x)={y}k\theta_{2}(x)=\{y\}_{k} and μ1(y)=(m0,m1)\mu_{1}(y)=(m_{0},m_{1}), where m0,m1𝒩m_{0},m_{1}\in\mathscr{N}. Also suppose (T2;E2)xz(T_{2};E_{2})\vdash{{x}\bowtie{z}} for some z𝖽𝗈𝗆(σ)z\in{\sf dom}(\sigma). We need a λ\lambda which maps xx and zz to the same ground term, i.e. λ\lambda needs to be s.t. λ(x)=λ(z)\lambda(x)=\lambda(z). We can take λ\lambda to be σμ1θ2\sigma\mu_{1}\theta_{2}. We see that λ(x)=σ(μ1(θ2(x)))=σ(μ1({y}k))=σ({(m0,m1)}k)={(m0,m1)}k\lambda(x)=\sigma(\mu_{1}(\theta_{2}(x)))=\sigma(\mu_{1}(\{y\}_{k}))=\sigma(\{(m_{0},m_{1})\}_{k})=\{(m_{0},m_{1})\}_{k}. Observe that 𝖽𝗈𝗆(λ)=𝖽𝗈𝗆(σ)𝖽𝗈𝗆(μ1)𝖽𝗈𝗆(θ2){\sf dom}(\lambda)={\sf dom}(\sigma)\cup{\sf dom}(\mu_{1})\cup{\sf dom}(\theta_{2}), and since z𝖽𝗈𝗆(μ1)𝖽𝗈𝗆(θ2)z\notin{\sf dom}(\mu_{1})\cup{\sf dom}(\theta_{2}), λ(z)=σ(z)\lambda(z)=\sigma(z).

Definition 18.

The compound substitution which maps any variable in 𝖽𝗈𝗆(σ){𝖽𝗈𝗆(μi)𝖽𝗈𝗆(θi)1in}{\sf dom}(\sigma)\cup\{{\sf dom}(\mu_{i})\cup{\sf dom}(\theta_{i})\mid 1\leq i\leq n\} to a ground term is given by ωσμ1θ1μnθn\omega\coloneqq\sigma\mu_{1}\theta_{1}\ldots\mu_{n}\theta_{n}.

Note that for λ{σ,θi,μiin},ω(λ(x))=ω(x)\lambda\in\{\sigma,\theta_{i},\mu_{i}\mid i\leq n\},\omega(\lambda(x))=\omega(x).

Lemma 19.

Suppose λ\lambda is such that λ(r)=λ(s)\lambda(r)=\lambda(s) for each rsE{{r}\bowtie{s}}\in E, and T;E𝑒𝑞tuT;E\vdash_{\mathit{eq}}{{t}\bowtie{u}}. Then λ(t)=λ(u)\lambda(t)=\lambda(u).

Proof.

Suppose T;EtuT;E\vdash{{t}\bowtie{u}} via a proof π\pi with last rule 𝗋{\sf r}. The proof is by induction on the structure of π\pi. The following cases arise.

  • 𝗋=𝖺𝗑{\sf r}={\sf ax}: In this case, tuE{{t}\bowtie{u}}\in E, so by assumption, λ(t)=λ(u)\lambda(t)=\lambda(u).

  • 𝗋=𝖾𝗊{\sf r}={\sf eq}: In this case t=ut=u, so λ(t)=λ(u)\lambda(t)=\lambda(u) as well.

  • 𝗋=𝗍𝗋𝖺𝗇𝗌{\sf r}={\sf trans}: Suppose t0t1,,tn1tn{{t_{0}}\bowtie{t_{1}}},\ldots,{{t_{n-1}}\bowtie{t_{n}}} are the premises of 𝗋{\sf r}, with t=t0t=t_{0} and u=tnu=t_{n}. By IH, λ(ti1)=λ(ti)\lambda(t_{i-1})=\lambda(t_{i}) for all ini\leq n. It follows that λ(t)=λ(u)\lambda(t)=\lambda(u).

  • 𝗋=𝖼𝗈𝗇𝗌{\sf r}={\sf cons}: Let t=𝖿(t1,,tn)t={\sf f}(t_{1},\ldots,t_{n}) and u=𝖿(u1,,un)u={\sf f}(u_{1},\ldots,u_{n}) and let t1u1,,tnun{{t_{1}}\bowtie{u_{1}}},\ldots,{{t_{n}}\bowtie{u_{n}}} be the premises of 𝗋{\sf r}. By IH, λ(ti)=λ(ui)\lambda(t_{i})=\lambda(u_{i}) for all ini\leq n. Thus we have the following:

    λ(t)\lambda(t) =λ(𝖿(t1,,tn))=𝖿(λ(t1),,λ(tn))=\lambda({\sf f}(t_{1},\ldots,t_{n}))={\sf f}(\lambda(t_{1}),\ldots,\lambda(t_{n}))
    =𝖿(λ(u1),,λ(un))=λ(𝖿(t1,,tn))=λ(u)={\sf f}(\lambda(u_{1}),\ldots,\lambda(u_{n}))=\lambda({\sf f}(t_{1},\ldots,t_{n}))=\lambda(u).
  • 𝗋=𝗉𝗋𝗈𝗃{\sf r}={\sf proj}: Let 𝖿(t1,,tn)𝖿(u1,,un){{{\sf f}(t_{1},\ldots,t_{n})}\bowtie{{\sf f}(u_{1},\ldots,u_{n})}} be the premise of the last rule with t=tit=t_{i} and u=uiu=u_{i} respectively. By IH, λ(𝖿(t1,,tn))=λ(𝖿(u1,un))\lambda({\sf f}(t_{1},\ldots,t_{n}))=\lambda({\sf f}(u_{1},u_{n})). So, λ(t)=λ(u)\lambda(t)=\lambda(u).

Lemma 20.

For any i{1,,n}i\in\{1,\ldots,n\},

  1. 1.

    if tuEiFi{{t}\bowtie{u}}\in E_{i}\cup F_{i}, then ω(t)=ω(u)\omega(t)=\omega(u).

  2. 2.

    if σ(Ti1;Ei1)𝑒𝑞σμi(tu)\sigma(T_{i-1};E_{i-1})\vdash_{\mathit{eq}}\sigma\mu_{i}({{t}\bowtie{u}}), then ω(t)=ω(u)\omega(t)=\omega(u).

  3. 3.

    if σ(Ui;Fi)𝑒𝑞σθi(tu)\sigma(U_{i};F_{i})\vdash_{\mathit{eq}}\sigma\theta_{i}({{t}\bowtie{u}}), then ω(t)=ω(u)\omega(t)=\omega(u).

Proof.

In addition to Ei,FiE_{i},F_{i} for 0<in0<i\leq n, we also use E0=E_{0}=\emptyset, for which claim 1 is vacuously true. We prove the claims simultaneously by induction on i>0i>0. Assume that they hold for all j<ij<i via IH1, IH2, and IH3.

  1. 1.

    Suppose tuEi{{t}\bowtie{u}}\in E_{i}. Then, j<i:tu𝗌𝖿(αj)\exists{}j<i:{{t}\bowtie{u}}\in{\sf sf}(\alpha_{j}), and σ(Uj;Fj)𝑒𝑞σθj(tu)\sigma(U_{j};F_{j})\vdash_{\mathit{eq}}\sigma\theta_{j}({{t}\bowtie{u}}). By IH3, ω(t)=ω(u)\omega(t)=\omega(u). If tuFi{{t}\bowtie{u}}\in F_{i}, then ji:tu𝐼𝐸j\exists{}j\leq i:{{t}\bowtie{u}}\in\mathit{IE}_{j}, and σ(Tj1;Ej1)𝑒𝑞σμj(tu)\sigma(T_{j-1};E_{j-1})\vdash_{\mathit{eq}}\sigma\mu_{j}({{t}\bowtie{u}}). If j<ij<i, by IH2, ω(t)=ω(u)\omega(t)=\omega(u). If j=ij=i, by IH1, ω(r)=ω(s)\omega({r})=\omega({s}) for every rsEi1{{{r}}\bowtie{{s}}}\in E_{i-1}. Any abσ(Ei1){{a}\bowtie{b}}\in\sigma(E_{i-1}) is of the form σ(rs)\sigma({{r}\bowtie{s}}) for some rsEi1{{r}\bowtie{s}}\in E_{i-1}. Thus, ω(a)=ω(σ(r))=ω(r)=ω(s)=ω(σ(s))=ω(b)\omega(a)=\omega(\sigma(r))=\omega(r)=\omega(s)=\omega(\sigma(s))=\omega(b). By Lemma 19, ω(σμj(t))=ω(σμj(u))\omega(\sigma\mu_{j}(t))=\omega(\sigma\mu_{j}(u)), i.e. ω(t)=ω(u)\omega(t)=\omega(u).

  2. 2.

    Suppose σ(Ti1);σ(Ei1)𝑒𝑞σμi(tu\sigma(T_{i-1});\sigma(E_{i-1})\vdash_{\mathit{eq}}\sigma\mu_{i}({{t}\bowtie{u}}. As above, for each abσ(Ei1){{a}\bowtie{b}}\in\sigma(E_{i-1}), ω(a)=ω(s^)\omega(a)=\omega(\widehat{s}). By appealing to Lemma 19, we get ω(σμi(t))=ω(σμi(u))\omega(\sigma\mu_{i}(t))=\omega(\sigma\mu_{i}(u)), i.e. ω(t)=ω(u)\omega(t)=\omega(u).

  3. 3.

    The proof is similar to the above. ∎

We developed this preliminary setup for both honest agent derivations as well as intruder derivations in order to demonstrate the interplay between θ\theta and μ\mu, as evidenced in the definition of ω\omega. However, the insecurity problem itself is concerned only with intruder derivability, and therefore, in the next few sections we will focus only on βi,(Ti;Ei)\beta_{i},(T_{i};E_{i}), and μi\mu_{i}. We will discuss honest agent derivations later.

4.1 Typed proofs for 𝑑𝑦\vdash_{\mathit{dy}} and 𝑒𝑞\vdash_{\mathit{eq}}

In order to obtain “small” versions of the various substitutions σ,θi,\sigma,\theta_{i}, and μi\mu_{i} while preserving their interaction, we consider a universe of “anchor terms”. These are abstract terms that appear in the protocol specification, and for which we have a bound on size. We call these anchors “types”. We would eventually like to be able to convert any proof into one that only involves typed terms, i.e. terms that correspond to one of these types under ω\omega.

Definition 21 (Types and typed terms).

We use the sets 𝒞\mathscr{C} (consisting of the terms occurring in ξ\xi before applying any substitution) and 𝒟\mathscr{D} (the same set, but without variables) to type the terms appearing in any proof.

𝒞in{(𝗌𝗍(TiUi)𝗌𝗍(EiFi))}𝒟𝒞𝒱\mathscr{C}\coloneqq\bigcup_{i\leq n}\bigl{\{}\bigl{(}{\sf st}(T_{i}\cup U_{i})\cup{\sf st}(E_{i}\cup F_{i})\bigr{)}\bigr{\}}\quad\quad\mathscr{D}\coloneqq\mathscr{C}\setminus\mathscr{V}

A term tt is typed if tσ(𝒟)ω(𝒞)𝒱qt\in\sigma(\mathscr{D})\cup\omega(\mathscr{C})\cup\mathscr{V}_{q}.

Note that we must consider σ(𝒟)\sigma(\mathscr{D}) separately from ω(𝒞)\omega(\mathscr{C}). Consider a term of the form (m,x)𝒟(m,x)\in\mathscr{D}, where x𝖽𝗈𝗆(σ)x\notin{\sf dom}(\sigma). σ((m,x))=(m,x)\sigma((m,x))=(m,x), but this cannot be in ω(𝒞)\omega(\mathscr{C}), since ω(𝒞)\omega(\mathscr{C}) only contains ground terms. Thus, σ(𝒟)ω(𝒞)\sigma(\mathscr{D})\not\subseteq\omega(\mathscr{C}).

We now define a notion of “zappable terms”, which are terms that do not correspond to any type in 𝒞\mathscr{C}. The idea is these terms can be freely “zapped”.444In order to motivate the key ideas behind typing, we will often use the word “zap” to mean replacing terms by an atomic name. However, we will formally define this zapping operation in the next subsection.

Definition 22 (Zappable terms).

A term tt is zappable if there is an x𝖽𝗈𝗆(ω)x\in{\sf dom}(\omega) such that ω(t)=ω(x)\omega(t)=\omega(x), but there is no u𝒟u\in\mathscr{D} such that ω(x)=ω(u)\omega(x)=\omega(u). We refer to such an xx as a minimal variable.

Here are a couple of easy observations that relate to zappable terms.

Observation 23.

a

  • If a term tt is zappable, then t𝒟t\notin\mathscr{D}.

  • If a term tω(𝒞)t\in\omega(\mathscr{C}) is not zappable, then tω(𝒟)t\in\omega(\mathscr{D}).

  • For t,ut,u s.t. ω(t)=ω(u)\omega(t)=\omega(u), tt is zappable iff uu is zappable.

Lemma 24.

Suppose t=𝖿(t0,t1)t={\sf f}(t_{0},t_{1}) and u=𝖿(u0,u1)u={\sf f}(u_{0},u_{1}) are typed, and ω(t)=ω(u)\omega(t)=\omega(u). One of the following is true:

  • tt and uu are not zappable, and t0,t1,u0,u1t_{0},t_{1},u_{0},u_{1} are typed, or

  • tt and uu are zappable, and t=ut=u.

Proof.

Observe that for any aσ(𝒞)a\in\sigma(\mathscr{C}), aσ(𝒟)a\in\sigma(\mathscr{D}), or a=σ(x)=xa=\sigma(x)=x for some x𝖽𝗈𝗆(σ)x\notin{\sf dom}(\sigma) (in which case a𝒱qa\in\mathscr{V}_{q}), or a=σ(x)a=\sigma(x) for x𝖽𝗈𝗆(σ)x\in{\sf dom}(\sigma) (in which case a=ω(x)a=\omega(x) also, so aω(𝒞)a\in\omega(\mathscr{C})). Thus σ(𝒞)σ(𝒟)ω(𝒞)𝒱q\sigma(\mathscr{C})\subseteq\sigma(\mathscr{D})\cup\omega(\mathscr{C})\cup\mathscr{V}_{q}.

Now tt and uu are typed, and are non-atomic. So t,u𝒱qt,u\notin\mathscr{V}_{q}, and so t,uσ(𝒟)ω(𝒞)t,u\in\sigma(\mathscr{D})\cup\omega(\mathscr{C}). We consider two cases:

  • Neither tt nor uu is zappable: Consider tt. If tσ(𝒟)t\in\sigma(\mathscr{D}), each tiσ(𝒞)σ(𝒟)ω(𝒞)𝒱qt_{i}\in\sigma(\mathscr{C})\subseteq\sigma(\mathscr{D})\cup\omega(\mathscr{C})\cup\mathscr{V}_{q}. If tω(𝒞)t\in\omega(\mathscr{C}), then since tt is not zappable, t=ω(a)t=\omega(a) for some a𝒟a\in\mathscr{D}. Then aa has to be of the form 𝖿(a1,,ak){\sf f}(a_{1},\dots,a_{k}), with each ai𝒞a_{i}\in\mathscr{C} and ti=ω(ai)t_{i}=\omega(a_{i}). Thus each tiω(𝒞)σ(𝒟)ω(𝒞)𝒱qt_{i}\in\omega(\mathscr{C})\subseteq\sigma(\mathscr{D})\cup\omega(\mathscr{C})\cup\mathscr{V}_{q}. Reasoning about uu in a similar manner, we see that each uiσ(𝒟)ω(𝒞)𝒱qu_{i}\in\sigma(\mathscr{D})\cup\omega(\mathscr{C})\cup\mathscr{V}_{q}. So each tit_{i} and uiu_{i} is typed.

  • One of tt and uu is zappable: Say tt is zappable. Then, since ω(t)=ω(u)\omega(t)=\omega(u), uu is zappable as well. Therefore t,uσ(𝒟)t,u\notin\sigma(\mathscr{D}), which implies that t,uω(𝒞)t,u\in\omega(\mathscr{C}). Therefore both tt and uu are ground terms, so t=ω(t)=ω(u)=ut=\omega(t)=\omega(u)=u. ∎

We now devise notions of “typed proofs” for the 𝑑𝑦\vdash_{\mathit{dy}} as well as the 𝑒𝑞\vdash_{\mathit{eq}} system, which will help us obtain bounds on the sizes of terms appearing in the ranges of various substitutions. Then, we show that every proof in these systems can be converted into a typed proof.

Consider a proof π\pi witnessing σ(Ti)𝑑𝑦t\sigma(T_{i})\vdash_{\mathit{dy}}t for some tt. Any term in TiT_{i}, since TiT_{i} is part of a kernel, is either a bound variable outside the domain of σ\sigma (i.e. in 𝒱q\mathscr{V}_{q}) or a public term of some assertion. Note that any variables in public terms of assertions must not be quantified, hence they fall into the domain of σ\sigma. Thus, any such tt derived from σ(Ti)\sigma(T_{i}) is either in 𝒱q\mathscr{V}_{q}, or a ground term of the form σ(v)\sigma(v) for some vv.

Now, it is possible that π\pi mentions some term uω(𝒞)u\not\in\omega(\mathscr{C}), even if tω(𝒞)t\in\omega(\mathscr{C}). If a destructor rule is applied to uu in order to obtain a proof of tt, we cannot “zap” uu into an atomic name while still preserving derivability. This leads us to the following definition of a typed proof in the 𝑑𝑦\vdash_{\mathit{dy}} system, which preserves derivability even after zapping variables as necessary.

Definition 25.

[Typed 𝑑𝑦\vdash_{\mathit{dy}} proof] A 𝑑𝑦\vdash_{\mathit{dy}} proof π\pi is typed if for each subproof π\pi^{\prime}, either π\pi^{\prime} ends in a constructor rule, or 𝖼𝗈𝗇𝖼(π)σ(𝒟)𝒱q{\sf conc}(\pi^{\prime})\in\sigma(\mathscr{D})\cup\mathscr{V}_{q}, where 𝖼𝗈𝗇𝖼(π){\sf conc}(\pi^{\prime}) denotes the conclusion derived using π\pi.

Armed with this definition of a typed 𝑑𝑦\vdash_{\mathit{dy}} proof, we can show that any proof σ(Ti)𝑑𝑦t\sigma(T_{i})\vdash_{\mathit{dy}}t can be transformed into a typed normal equivalent witnessing the same. This transformation crucially uses the following fact about how non-typed terms are generated: any non-typed term uu occurring in a 𝑑𝑦\vdash_{\mathit{dy}} proof from σ(Ti)\sigma(T_{i}) obeys the following:

  • appears first as part of a received assertion σ(β)\sigma(\beta), and

  • is generated by the intruder by putting information together, i.e. via a normal proof ending in a constructor.

The intuition behind this is easy to see – honest agents follow the protocol, and will only communicate terms that follow the protocol specification, modulo any insertions by the intruder. Terms that correspond to ones in the protocol specification are always typed, so any non-typed term must have been initially sent out by the intruder, i.e. in a β\beta received by an honest agent. In particular, such a term must have been constructed by the intruder by putting information together, since up till that point, the intruder’s knowledge state would have only consisted of typed terms, and destructor rules would preserve “typability”. Thus, for any non-typed term tt such that t𝗌𝗍(σ(Ti))t\in{\sf st}(\sigma(T_{i})), we can always “chase back” to an index j<ij<i at which it was not in the subterms of σ(Tj)\sigma(T_{j}), but still derivable, i.e. σ(Tj)𝑑𝑦t\sigma(T_{j})\vdash_{\mathit{dy}}t via a normal proof ending in a constructor rule. This reasoning closely follows the ideas in [38], and is formalized below.

Observation 26.

Since agent variables are mapped to names, the only free variables in sessions are intruder variables. Thus, for any ii\leq\ell and any x𝖿𝗏(αi)x\in{\sf fv}(\alpha_{i}), there is j<ij<i s.t. x𝖿𝗏(βj)x\in{\sf fv}(\beta_{j}).

We define 𝐼𝑇i𝗉𝗎𝖻𝗌(βi)\mathit{IT}_{i}\coloneqq{\sf pubs}(\beta_{i}) and 𝐻𝑇i𝗉𝗎𝖻𝗌(αi)\mathit{HT}_{i}\coloneqq{\sf pubs}(\alpha_{i})555These stand for intruder terms and honest agent terms respectively.

Lemma 27.

Suppose tσ(𝒟)𝒱qt\notin\sigma(\mathscr{D})\cup\mathscr{V}_{q}. For any ini\leq n, if t𝗌𝗍(σ(Ti))t\in{\sf st}(\sigma(T_{i})), then there is a k<ik<i such that t𝗌𝗍(σ(𝐼𝑇k))t\in{\sf st}(\sigma(\mathit{IT}_{k})).

Proof.

Consider t𝗌𝗍(σ(u))(σ(𝒟)𝒱q)t\in{\sf st}(\sigma(u))\setminus(\sigma(\mathscr{D})\cup\mathscr{V}_{q}) for some uTiu\in T_{i}. Then, t𝗌𝗍(σ(y))t\in{\sf st}(\sigma(y)) for some y𝗏𝖺𝗋𝗌(u)y\in{\sf vars}(u). Since uTiu\in T_{i}, there is a j<ij<i such that u𝐻𝑇j𝒱qu\in\mathit{HT}_{j}\cup\mathscr{V}_{q}. If u𝒱qu\in\mathscr{V}_{q}, then u=y=σ(y)u=y=\sigma(y) and t=yt=y, but we know that t𝒱qt\not\in\mathscr{V}_{q}. Thus u𝒱qu\not\in\mathscr{V}_{q} and u𝐻𝑇ju\in\mathit{HT}_{j}, i.e. y𝗏𝖺𝗋𝗌(𝐻𝑇j)y\in{\sf vars}(\mathit{HT}_{j}). Now ξ\xi is an interleaving of sessions of 𝑃𝑟\mathit{Pr}, and y𝗏𝖺𝗋𝗌(u)y\in{\sf vars}(u) where uu occurs in an honest agent send in a session. Thus by Observation 26, there is an earlier intruder send in the same session in which yy occurs. This send occurs before αj\alpha_{j} in ξ\xi. Thus there is a kjk\leq j such that y𝗏𝖺𝗋𝗌(𝗉𝗎𝖻𝗌(βk))=𝗏𝖺𝗋𝗌(𝐼𝑇k)y\in{\sf vars}({\sf pubs}(\beta_{k}))={\sf vars}(\mathit{IT}_{k}). Thus, t𝗌𝗍(σ(𝐼𝑇k))t\in{\sf st}(\sigma(\mathit{IT}_{k})). ∎

Lemma 28.

Suppose ini\leq n, tσ(𝒟)𝒱qt\notin\sigma(\mathscr{D})\cup\mathscr{V}_{q} and σ(Ti)𝑑𝑦t\sigma(T_{i})\vdash_{\mathit{dy}}t via a normal proof π\pi ending in a destructor rule. Then there is an <i\ell<i such that σ(T)𝑑𝑦t\sigma(T_{\ell})\vdash_{\mathit{dy}}t.

Proof.

Since π\pi ends in a destructor rule, t𝗌𝗍(σ(Ti))t\in{\sf st}(\sigma(T_{i})). By Lemma 27, there is an i<ii^{\prime}<i such that t𝗌𝗍(σ(𝐼𝑇i))t\in{\sf st}(\sigma(\mathit{IT}_{i^{\prime}})). Let jj be the earliest such index, and let a𝐼𝑇ja\in\mathit{IT}_{j} such that t𝗌𝗍(σ(a))t\in{\sf st}(\sigma(a)). Since σ(Tj1;Ej1)aσμj(βj)\sigma(T_{j-1};E_{j-1})\vdash_{\mathit{a}}\sigma\mu_{j}(\beta_{j}), and a𝐼𝑇j=𝗉𝗎𝖻𝗌(βj)a\in\mathit{IT}_{j}={\sf pubs}(\beta_{j}), it follows by Lemma 15 that σ(Tj1)𝑑𝑦σμj(a)\sigma(T_{j-1})\vdash_{\mathit{dy}}\sigma\mu_{j}(a). But 𝗏𝖺𝗋𝗌(a)𝖽𝗈𝗆(μj)={\sf vars}(a)\cap{\sf dom}(\mu_{j})=\emptyset, so σ(Tj1)𝑑𝑦σ(a)\sigma(T_{j-1})\vdash_{\mathit{dy}}\sigma(a), via a normal proof ρ\rho. Consider a minimal subproof χ\chi of ρ\rho such that t𝗌𝗍(𝖼𝗈𝗇𝖼(χ))t\in{\sf st}({\sf conc}(\chi)). (There is at least one such subproof, namely ρ\rho.) If χ\chi ends in a destructor, then 𝖼𝗈𝗇𝖼(χ)𝗌𝗍(σ(Tj1)){\sf conc}(\chi)\in{\sf st}(\sigma(T_{j-1})), and hence t𝗌𝗍(σ(Tj1))t\in{\sf st}(\sigma(T_{j-1})). But by Lemma 27, there must be a k<j1k<j-1 such that t𝗌𝗍(σ(𝐼𝑇k))t\in{\sf st}(\sigma(\mathit{IT}_{k})), contradicting the fact that jj is the earliest such index. So χ\chi ends in a constructor rule. If t𝖼𝗈𝗇𝖼(χ)t\neq{\sf conc}(\chi), then t𝗌𝗍(𝖼𝗈𝗇𝖼(χ))t\in{\sf st}({\sf conc}(\chi^{\prime})), for some proper subproof of χ\chi. But this cannot be, since χ\chi is a minimal proof with this property. Thus, t=𝖼𝗈𝗇𝖼(χ)t={\sf conc}(\chi) and χ\chi is a proof of σ(Tj1)t\sigma(T_{j-1})\vdash t (and we choose our \ell to be j1j-1). ∎

Theorem 29.

For all tt and all i{0,,n}i\in\{0,\ldots,n\}, if σ(Ti)𝑑𝑦t\sigma(T_{i})\vdash_{\mathit{dy}}t, then there is a typed normal proof π\pi^{*} of the same.

Proof.

Assume the theorem holds for all j<ij<i. We show how to transform any proof π\pi of σ(Ti)t\sigma(T_{i})\vdash t ending in rule 𝗋{\sf r} into a typed normal proof π\pi^{*} of the same by induction on the structure of π\pi.

  • rr is ax: tσ(Ti)σ(𝒞)t\in\sigma(T_{i})\subseteq\sigma(\mathscr{C}). If tσ(𝒟)𝒱qt\in\sigma(\mathscr{D})\cup\mathscr{V}_{q}, we take π\pi^{*} to be π\pi itself. Otherwise, there is a j<ij<i such that σ(Tj)𝑑𝑦t\sigma(T_{j})\vdash_{\mathit{dy}}t. We can get a typed normal proof π\pi^{*} of σ(Tj)t\sigma(T_{j})\vdash t and obtain the required result by weakening the LHS.

  • rr is a constructor: We can find typed normal equivalents for all immediate subproofs, and apply the same constructor rule to get the desired π\pi^{*}.

  • rr is a destructor: Let π1\pi_{1} and π2\pi_{2} be immediate subproofs of π\pi, with 𝖼𝗈𝗇𝖼(π1)=s{\sf conc}(\pi_{1})=s, and tt an immediate subterm of ss. We can find typed normal equivalents π1\pi^{*}_{1} and π2\pi^{*}_{2}. If π1\pi^{*}_{1} ends in a constructor, then we choose π\pi^{*} to be the immediate subproof of π1\pi^{*}_{1} s.t. 𝖼𝗈𝗇𝖼(π)=t{\sf conc}(\pi^{*})=t.

    If π1\pi^{*}_{1} does not end in a constructor, sσ(𝒟)𝒱qs\in\sigma(\mathscr{D})\cup\mathscr{V}_{q}. Since a destructor rule 𝗋{\sf r} was applied on ss, s𝒱qs\notin\mathscr{V}_{q}. So sσ(𝒟)s\in\sigma(\mathscr{D}), and hence tσ(𝒞)t\in\sigma(\mathscr{C}). If tσ(𝒟)𝒱qt\in\sigma(\mathscr{D})\cup\mathscr{V}_{q}, we obtain a typed normal π\pi^{*} by applying 𝗋{\sf r} on π1\pi^{*}_{1}. Otherwise, as with 𝖺𝗑{\sf ax}, we get a typed and normal proof π\pi^{*} of σ(Tj)t\sigma(T_{j})\vdash t for some j<ij<i and apply weakening. ∎

Having shown that we can always obtain a typed 𝑑𝑦\vdash_{\mathit{dy}} proof, we now consider 𝑒𝑞\vdash_{\mathit{eq}}. We present below an example which will motivate our choices for the definition of a typed 𝑒𝑞\vdash_{\mathit{eq}} proof.

Suppose σ(x)=(t1,t2)\sigma(x)=(t_{1},t_{2}) for some minimal xx, and σ(u)=(u1,u2)\sigma(u)=(u_{1},u_{2}) for some term uu. Suppose we also have a proof of t1u1{{t_{1}}\bowtie{u_{1}}} obtained by applying 𝗉𝗋𝗈𝗃1{\sf proj}_{1} to a proof of σ(x)σ(u){{\sigma(x)}\bowtie{\sigma(u)}}, and we want a “corresponding” proof, even after zapping. However, xx would be zapped to a name, and we cannot apply 𝗉𝗋𝗈𝗃{\sf proj} to an atomic value. We would prefer a proof which allows us to preserve its structure even after zapping. To this end, we define a typed 𝑒𝑞\vdash_{\mathit{eq}} proof as follows.

Definition 30.

[Typed 𝑒𝑞\vdash_{\mathit{eq}} proof] A proof π\pi of X;ArsX;A\vdash{{r}\bowtie{s}} is typed if for every subproof π\pi^{\prime} with conclusion X;AtuX;A\vdash{{t}\bowtie{u}},

  • π\pi^{\prime} contains an occurrence of the 𝖼𝗈𝗇𝗌{\sf cons} rule, or

  • t=ut=u, or

  • tt and uu are typed terms.

Intuitively, this definition disallows “asymmetric” zapping of the above kind, and allows us to prove the equivalent of Theorem 29 for 𝑒𝑞\vdash_{\mathit{eq}} proofs.

Theorem 31.

For ini\leq n and a,b𝒯a,b\in\mathscr{T}, if σ(Ti;Ei)𝑒𝑞ab\sigma(T_{i};E_{i})\vdash_{\mathit{eq}}{{a}\bowtie{b}}, then there is a typed normal proof of σ(Ti;Ei)ab\sigma(T_{i};E_{i})\vdash{{a}\bowtie{b}}.

Proof of Theorem 31.

By Theorem 10, we know that every 𝑒𝑞\vdash_{\mathit{eq}} proof can be converted to an equivalent normal proof. We can show that every normal 𝑒𝑞\vdash_{\mathit{eq}} proof is typed. The only non-trivial case is when the last rule is 𝗉𝗋𝗈𝗃{\sf proj}. Consider a normal proof π\pi of σ(Ti;Ei)ab\sigma(T_{i};E_{i})\vdash{{a}\bowtie{b}}, whose last rule is 𝗉𝗋𝗈𝗃{\sf proj}, and whose immediate (typed normal, by IH) subproof is π\pi^{\prime} deriving 𝖿(a,c)𝖿(b,d){{{\sf f}(a,c)}\bowtie{{\sf f}(b,d)}}. Since π\pi is a normal proof ending in 𝗉𝗋𝗈𝗃{\sf proj}, the 𝖼𝗈𝗇𝗌{\sf cons} rule does not occur in π\pi or π\pi^{\prime}. Two cases arise:

  • 𝖿(a,c)=𝖿(b,d){\sf f}(a,c)={\sf f}(b,d), in which case a=ba=b and π\pi is typed.

  • 𝖿(a,c){\sf f}(a,c) and 𝖿(b,d){\sf f}(b,d) are both typed terms. By Lemma 24, either 𝖿(a,c)=𝖿(b,d){\sf f}(a,c)={\sf f}(b,d) (whence a=ba=b), or a,b,c,da,b,c,d are all typed, and thus π\pi is typed. ∎

4.2 Small substitutions σ,ω\sigma^{\!*},\omega^{\!*}, and μi\mu^{\!*}_{i}

Assume that there is an 𝗆T0𝒩{\sf m}\in T_{0}\cap\mathscr{N} s.t. 𝗆𝗌𝗍({αi,βi})𝗌𝗍(𝗋𝗇𝗀(θi)𝗋𝗇𝗀(μi)){\sf m}\notin{\sf st}(\{\alpha_{i},\beta_{i}\})\cup{\sf st}({\sf rng}(\theta_{i})\cup{\sf rng}(\mu_{i})) for all ii. This can be thought of as a fixed “spare name” that does not appear in the run. We will use this name to formally define a zap operation, as below.

Definition 32.

For any term tt, we inductively define the zap of tt, denoted t¯\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}, as follows:

x¯\displaystyle\overline{\mspace{1.0mu}{x}\mspace{1.0mu}} x\displaystyle\coloneqq x
n¯\displaystyle\overline{\mspace{1.0mu}{n}\mspace{1.0mu}} {𝗆if n is zappablenotherwise\displaystyle\coloneqq\begin{cases}{\sf m}&\qquad\hskip 5.69054pt\mbox{if $n$ is zappable}\\ n&\qquad\hskip 5.69054pt\mbox{otherwise}\end{cases}
𝖿(t1,t2)¯\displaystyle\overline{\mspace{1.0mu}{{\sf f}(t_{1},t_{2})}\mspace{1.0mu}} {𝗆if 𝖿(t1,t2) is zappable𝖿(t1¯,t2¯)otherwise\displaystyle\coloneqq\begin{cases}{\sf m}&\mbox{if ${\sf f}(t_{1},t_{2})$ is zappable}\\ {\sf f}(\overline{\mspace{1.0mu}{t_{1}}\mspace{1.0mu}},\overline{\mspace{1.0mu}{t_{2}}\mspace{1.0mu}})&\mbox{otherwise}\end{cases}

For a set of terms XX, X¯{t¯tX}\overline{\mspace{1.0mu}{X}\mspace{1.0mu}}\coloneqq\{\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}\mid t\in X\}. For a set of equalities EE, E¯{t¯u¯tuE}\overline{\mspace{1.0mu}{E}\mspace{1.0mu}}\coloneqq\{{{\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}}\bowtie{\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}}}\mid{{t}\bowtie{u}}\in E\}.

Definition 33.

For λ{σ,ω,μiin}\lambda\in\{\sigma,\omega,\mu_{i}\mid i\leq n\}, the small substitution λ\lambda^{\!*} corresponding to λ\lambda is defined as λ(x)λ(x)¯\lambda^{\!*}(x)\coloneqq\overline{\mspace{1.0mu}{\lambda(x)}\mspace{1.0mu}} for all x𝒱x\in\mathscr{V}.

Here are a few examples that illustrate the above definition, for different choices of λ\lambda and 𝒞\mathscr{C}.

Example 34.

a

  1. 1.

    Suppose 𝒞=𝗌𝗍({𝗆,y,(y1,{y2}k)})\mathscr{C}={\sf st}(\{{\sf m},y,(y_{1},\{y_{2}\}_{k})\}), where y1,y2y_{1},y_{2} are minimal, and μ2(y)=(y1,{y2}k)\mu_{2}(y)=(y_{1},\{y_{2}\}_{k}). Then μ2(y)=(y1,{y2}k)\mu^{\!*}_{2}(y)=(y_{1},\{y_{2}\}_{k}) and ω(y)=(𝗆,{𝗆}k)\omega^{\!*}(y)=({\sf m},\{{\sf m}\}_{k}).

  2. 2.

    Suppose 𝒞=𝗌𝗍({𝗆,y,y2,(y1,x)})\mathscr{C}={\sf st}(\{{\sf m},y,y_{2},(y_{1},x)\}) and μ2\mu_{2} is the same as above, with xx minimal and σ(x)=μ2({y2}k)\sigma(x)=\mu_{2}(\{y_{2}\}_{k}). Then μ2(y)=(y1,𝗆)\mu^{\!*}_{2}(y)=(y_{1},{\sf m}) and ω(y)=(𝗆,𝗆)\omega^{\!*}(y)=({\sf m},{\sf m}).

Following Definition 33, we can see that σμi(x)=σμi(x)¯\sigma^{\!*}\mu^{\!*}_{i}(x)=\overline{\mspace{1.0mu}{\sigma\mu_{i}(x)}\mspace{1.0mu}} for any ini\leq n and x𝒱x\in\mathscr{V}, but this equality need not lift to bigger terms in general. Consider a minimal x𝖽𝗈𝗆(σ)x\in{\sf dom}(\sigma) with σ(x)=t\sigma(x)=t. So tt is ground, and hence 𝗏𝖺𝗋𝗌(t)={\sf vars}(t)=\emptyset. So σμi(t)=t\sigma^{\!*}\mu^{\!*}_{i}(t)=t. However, σμi(t)¯=t¯=𝗆\overline{\mspace{1.0mu}{\sigma\mu_{i}(t)}\mspace{1.0mu}}=\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}={\sf m}, since tt is zappable. Thus, it is not true that σμi(t)=σμi(t)¯\sigma^{\!*}\mu^{\!*}_{i}(t)=\overline{\mspace{1.0mu}{\sigma\mu_{i}(t)}\mspace{1.0mu}} for all possible terms tt. However, we can show that this holds for all t𝒞t\in\mathscr{C}.

Lemma 35.

For ini\leq n and t𝒞t\in\mathscr{C}, σμi(t)=σμi(t)¯\sigma^{\!*}\mu^{\!*}_{i}(t)=\overline{\mspace{1.0mu}{\sigma\mu_{i}(t)}\mspace{1.0mu}}.

We now show, via Lemmas 36 and 37, that small substitutions preserve derivabilities of both terms and equalities.

Lemma 36.

For ini\leq n and any term tt, if σ(Ti)𝑑𝑦t\sigma(T_{i})\vdash_{\mathit{dy}}t then σ(Ti)𝑑𝑦t¯\sigma^{\!*}(T_{i})\vdash_{\mathit{dy}}\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}.

Proof.

Let XX and YY stand for σ(Ti)\sigma(T_{i}) and σ(Ti)\sigma^{\!*}(T_{i}). Since X𝒞X\subseteq\mathscr{C}, by Lemma 35, X¯=Y\overline{\mspace{1.0mu}{X}\mspace{1.0mu}}=Y. Let π\pi be a typed normal 𝑑𝑦\vdash_{\mathit{dy}} proof of XtX\vdash t (ensured by Theorem 29). We prove that Y𝑑𝑦t¯Y\vdash_{\mathit{dy}}\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}. Consider the last rule 𝗋{\sf r} of π\pi. The following cases arise.

  • 𝗋=ax{\sf r}=\textsf{ax}: tXt\in X, and therefore t¯Y\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}\in Y. Thus Y𝑑𝑦t¯Y\vdash_{\mathit{dy}}\overline{\mspace{1.0mu}{t}\mspace{1.0mu}} by ax.

  • 𝗋{\sf r} is a constructor: Let t=𝖿(t1,t2)t={\sf f}(t_{1},t_{2}) and let the immediate subproofs of π\pi be π1,π2\pi_{1},\pi_{2}, with 𝖼𝗈𝗇𝖼(πi)=ti{\sf conc}(\pi_{i})=t_{i} for i2i\leq 2. By IH, there is a proof ϖi\varpi_{i} of Yti¯Y\vdash\overline{\mspace{1.0mu}{t_{i}}\mspace{1.0mu}} for each i2i\leq 2. If tt is zappable, then t¯=𝗆Y\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}={\sf m}\in Y (𝗆Ti{\sf m}\in T_{i} for all ii, so 𝗆X{\sf m}\in X and 𝗆Y{\sf m}\in Y), and we have Y𝑑𝑦t¯Y\vdash_{\mathit{dy}}\overline{\mspace{1.0mu}{t}\mspace{1.0mu}} using ax. If tt is not zappable, then t¯=𝖿(t1,t2)¯=𝖿(t1¯,t2¯)\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}=\overline{\mspace{1.0mu}{{\sf f}(t_{1},t_{2})}\mspace{1.0mu}}={\sf f}(\overline{\mspace{1.0mu}{t_{1}}\mspace{1.0mu}},\overline{\mspace{1.0mu}{t_{2}}\mspace{1.0mu}}), and we can apply 𝗋{\sf r} on the ϖi\varpi_{i}s to get Y𝑑𝑦t¯Y\vdash_{\mathit{dy}}\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}.

  • 𝗋{\sf r} is a destructor: Let the immediate subproofs of π\pi be π1,π2\pi_{1},\pi_{2}, deriving t1,t2t_{1},t_{2} respectively, with t1t_{1} being the major premise, and tt an immediate subterm of t1t_{1}. Since π\pi is typed normal, π1\pi_{1} is also typed and ends in a destructor, so by Definition 25, t1σ(𝒟)𝒱qt_{1}\in\sigma(\mathscr{D})\cup\mathscr{V}_{q}. Since we applied a destructor on t1t_{1}, it is not in 𝒱q\mathscr{V}_{q}. Thus, there is some u1𝒟u_{1}\in\mathscr{D}, with the same outermost operator as t1t_{1}, such that t1=σ(u1)t_{1}=\sigma(u_{1}). Hence, ω(t1)=ω(u1)\omega(t_{1})=\omega(u_{1}).

    If t1t_{1} were zappable, there would be a minimal xx such that ω(x)=ω(t1)=ω(u1)ω(𝒟)\omega(x)=\omega(t_{1})=\omega(u_{1})\in\omega(\mathscr{D}), which contradicts the minimality of xx. Thus, t1t_{1} is not zappable, and t1¯\overline{\mspace{1.0mu}{t_{1}}\mspace{1.0mu}} has the same outermost structure as t1t_{1}. By IH, there is a proof ϖi\varpi_{i} of Yti¯Y\vdash\overline{\mspace{1.0mu}{t_{i}}\mspace{1.0mu}} for each i2i\leq 2. Since t1¯\overline{\mspace{1.0mu}{t_{1}}\mspace{1.0mu}} is not atomic, we can apply the destructor 𝗋{\sf r} on the ϖi\varpi_{i}s to get Y𝑑𝑦t¯Y\vdash_{\mathit{dy}}\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}. ∎

Lemma 37.

For ini\leq n and terms t,ut,u, if σ(Ti;Ei)𝑒𝑞tu\sigma(T_{i};E_{i})\vdash_{\mathit{eq}}{{t}\bowtie{u}} then σ(Ti;Ei)𝑒𝑞t¯u¯\sigma^{\!*}(T_{i};E_{i})\vdash_{\mathit{eq}}{{\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}}\bowtie{\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}}}.

Proof.

Let (X;A)(X;A) and (Y;B)(Y;B) denote σ(Ti;Ei)\sigma(T_{i};E_{i}) and σ(Ti;Ei)\sigma^{\!*}(T_{i};E_{i}) respectively. As earlier, using Lemma 35, X¯=Y\overline{\mspace{1.0mu}{X}\mspace{1.0mu}}=Y and A¯=B\overline{\mspace{1.0mu}{A}\mspace{1.0mu}}=B. Let π\pi be a typed normal 𝑒𝑞\vdash_{\mathit{eq}} proof of X;AtuX;A\vdash{{t}\bowtie{u}} (guaranteed by Theorem 31). We prove that Y;B𝑒𝑞t¯u¯Y;B\vdash_{\mathit{eq}}{{\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}}\bowtie{\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}}}. Most of the cases are straightforward, so here we only consider the cases when π\pi ends in 𝗉𝗋𝗈𝗃{\sf proj} or 𝖼𝗈𝗇𝗌{\sf cons}.

  • π\pi ends in 𝗉𝗋𝗈𝗃{\sf proj}: Let the immediate subproof of π\pi be π\pi^{\prime} deriving X;AabX;A\vdash{{a}\bowtie{b}} where a=𝖿(a0,a1)a={\sf f}(a_{0},a_{1}), b=𝖿(b0,b1)b={\sf f}(b_{0},b_{1}), and t=a0t=a_{0} and u=b0u=b_{0}. By IH, there is a proof ϖ\varpi^{\prime} of Y;Ba¯b¯Y;B\vdash{{\overline{\mspace{1.0mu}{a}\mspace{1.0mu}}}\bowtie{\overline{\mspace{1.0mu}{b}\mspace{1.0mu}}}}. For 𝗉𝗋𝗈𝗃{\sf proj}, we need X𝑑𝑦{a0,a1,b0,b1}X\vdash_{\mathit{dy}}\{a_{0},a_{1},b_{0},b_{1}\}. By Lemma 36, Y𝑑𝑦{a0¯,a1¯,b0¯,b1¯}Y\vdash_{\mathit{dy}}\{\overline{\mspace{1.0mu}{a_{0}}\mspace{1.0mu}},\overline{\mspace{1.0mu}{a_{1}}\mspace{1.0mu}},\overline{\mspace{1.0mu}{b_{0}}\mspace{1.0mu}},\overline{\mspace{1.0mu}{b_{1}}\mspace{1.0mu}}\}. By Lemma 20, ω(a)=ω(b)\omega(a)=\omega(b). By normality, 𝖼𝗈𝗇𝗌{\sf cons} cannot occur in π\pi. π\pi is also typed, so either a=ba=b or aa and bb are typed. If a=ba=b, then t=ut=u, and we have a proof of Y;Bt¯u¯Y;B\vdash{{\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}}\bowtie{\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}}} ending in 𝖾𝗊{\sf eq}. If aa and bb are typed, we apply Lemma 24 and the following two cases arise.

    • aa and bb not zappable: Then a¯\overline{\mspace{1.0mu}{a}\mspace{1.0mu}} and b¯\overline{\mspace{1.0mu}{b}\mspace{1.0mu}} have the same outermost structure as aa and bb, and t¯=a0¯\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}=\overline{\mspace{1.0mu}{a_{0}}\mspace{1.0mu}} and u¯=b0¯\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}=\overline{\mspace{1.0mu}{b_{0}}\mspace{1.0mu}}. So we can apply 𝗉𝗋𝗈𝗃{\sf proj} on ϖ\varpi^{\prime} to get Y;B𝑒𝑞t¯u¯Y;B\vdash_{\mathit{eq}}{{\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}}\bowtie{\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}}}.

    • a=ba=b: Then t=ut=u as well, and hence t¯=u¯\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}=\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}. Since Y𝑑𝑦{t¯,u¯}Y\vdash_{\mathit{dy}}\{\overline{\mspace{1.0mu}{t}\mspace{1.0mu}},\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}\}, Y;B𝑒𝑞t¯u¯Y;B\vdash_{\mathit{eq}}{{\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}}\bowtie{\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}}} with last rule 𝖾𝗊{\sf eq}.

  • π\pi ends in 𝖼𝗈𝗇𝗌{\sf cons}: Let t=𝖿(t0,t1)t={\sf f}(t_{0},t_{1}) and u=𝖿(u0,u1)u={\sf f}(u_{0},u_{1}). Let π\pi have immediate subproofs π0\pi_{0} and π1\pi_{1}, each πi\pi_{i} proving X;AtiuiX;A\vdash{{t_{i}}\bowtie{u_{i}}}. By IH, there are proofs ϖ1,ϖ2\varpi_{1},\varpi_{2}, each ϖi\varpi_{i} proving Y;Bti¯ui¯Y;B\vdash{{\overline{\mspace{1.0mu}{t_{i}}\mspace{1.0mu}}}\bowtie{\overline{\mspace{1.0mu}{u_{i}}\mspace{1.0mu}}}}. By Lemma 24, two cases arise.

    • tt and uu not zappable: Then t¯=𝖿(t1¯,t2¯)\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}={\sf f}(\overline{\mspace{1.0mu}{t_{1}}\mspace{1.0mu}},\overline{\mspace{1.0mu}{t_{2}}\mspace{1.0mu}}) and u¯=𝖿(u1¯,u2¯)\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}={\sf f}(\overline{\mspace{1.0mu}{u_{1}}\mspace{1.0mu}},\overline{\mspace{1.0mu}{u_{2}}\mspace{1.0mu}}). So Y;B𝑒𝑞t¯u¯Y;B\vdash_{\mathit{eq}}{{\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}}\bowtie{\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}}} using 𝖼𝗈𝗇𝗌{\sf cons} on the ϖi\varpi_{i}s.

    • tt and uu zappable: Then, t¯=u¯=𝗆Y\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}=\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}={\sf m}\in Y, so we have a proof of Y;Bt¯u¯Y;B\vdash{{\overline{\mspace{1.0mu}{t}\mspace{1.0mu}}}\bowtie{\overline{\mspace{1.0mu}{u}\mspace{1.0mu}}}} ending in 𝖾𝗊{\sf eq}. ∎

Putting Lemmas 3536 and 37 together, we get:

Theorem 38.

Let t,u𝒞t,u\in\mathscr{C} and ini\leq n.

  • If σ(Ti1)𝑑𝑦σμi(t)\sigma(T_{i-1})\vdash_{\mathit{dy}}\sigma\mu_{i}(t) then σ(Ti1)𝑑𝑦σμi(t)\sigma^{\!*}(T_{i-1})\vdash_{\mathit{dy}}\sigma^{\!*}\mu^{\!*}_{i}(t).

  • If σ(Ti1;Ei1)𝑒𝑞σμi(tu)\sigma(T_{i-1};E_{i-1})\vdash_{\mathit{eq}}\sigma\mu_{i}({{t}\bowtie{u}}) then σ(Ti1;Ei1)𝑒𝑞σμi(tu)\sigma^{\!*}(T_{i-1};E_{i-1})\vdash_{\mathit{eq}}\sigma^{\!*}\mu^{\!*}_{i}({{t}\bowtie{u}}).

Having shown that the λ\lambda^{\!*}s simulate the λ\lambdas, we next show that they allow us a bound on the size of terms therein.

Theorem 39.

For λ{σ,ω,μiin}\lambda\in\{\sigma,\omega,\mu_{i}\mid i\leq n\}, λ\lambda^{\!*} is such that |𝗌𝗍(λ(x))||𝒟||{\sf st}({\lambda^{\!*}(x)})|\leq|\mathscr{D}| for all x𝖽𝗈𝗆(λ)x\in{\sf dom}(\lambda^{\!*}).

Proof.

For each λ\lambda and any xx, ω(λ(x))=ω(x)=ω(x)¯\omega^{\!*}(\lambda^{\!*}(x))=\omega^{\!*}(x)=\overline{\mspace{1.0mu}{\omega(x)}\mspace{1.0mu}} (by Definition 33) and thus, |𝗌𝗍(λ(x))||𝗌𝗍(ω(x))||{\sf st}({\lambda^{\!*}(x)})|\leq|{\sf st}({\omega^{\!*}(x)})|. So it suffices to prove a bound on |𝗌𝗍(ω(x))||{\sf st}({\omega^{\!*}(x)})|. We show that for t𝒞t\in\mathscr{C}, 𝗌𝗍(ω(t))ω(𝒟){\sf st}(\omega^{\!*}(t))\subseteq\omega^{\!*}(\mathscr{D}). Note that if t=xt=x is non-minimal, there is an r𝒟r\in\mathscr{D} s.t. ω(t)=ω(r)\omega^{\!*}(t)=\omega^{\!*}(r). Thus it suffices to prove the statement for tt which is either a minimal variable or in 𝒟\mathscr{D}.

The proof is by induction on |ω(t)||\omega^{\!*}(t)|.

  • |ω(t)|=1:|\omega^{\!*}(t)|=1: ω(t)𝒩\omega^{\!*}(t)\in\mathscr{N}. So t𝒩t\in\mathscr{N} or tt is a minimal variable. If t𝒩t\in\mathscr{N}, ω(t)=t𝒩\omega^{\!*}(t)=t\in\mathscr{N}. Otherwise, ω(t)=𝗆\omega^{\!*}(t)={\sf m}. In both these cases, 𝗌𝗍(ω(t))ω(𝒟){\sf st}(\omega^{\!*}(t))\subseteq\omega^{\!*}(\mathscr{D}).

  • |ω(t)|>1:|\omega^{\!*}(t)|>1: Let a𝗌𝗍(ω(t))a\in{\sf st}(\omega^{\!*}(t)). If a=ω(u)a=\omega^{\!*}(u) for some u𝗌𝗍(t)𝗏𝖺𝗋𝗌(t)u\in{\sf st}(t)\setminus{\sf vars}(t), then aω(𝒟)a\in\omega^{\!*}(\mathscr{D}). If a=ω(x)a=\omega^{\!*}(x) for some minimal x𝗏𝖺𝗋𝗌(t)x\in{\sf vars}(t), then a=𝗆=ω(𝗆)ω(𝒟)a={\sf m}=\omega^{\!*}({\sf m})\in\omega^{\!*}(\mathscr{D}). If a𝗌𝗍(ω(x))a\in{\sf st}(\omega^{\!*}(x)) for non-minimal x𝗏𝖺𝗋𝗌(t)x\in{\sf vars}(t), then xtx\neq t, and there is an r𝒟r\in\mathscr{D} s.t. ω(x)=ω(r)\omega^{\!*}(x)=\omega^{\!*}(r), and a𝗌𝗍(ω(r))a\in{\sf st}(\omega^{\!*}(r)). Since |ω(r)|<|ω(t)||\omega^{\!*}(r)|<|\omega^{\!*}(t)|, by IH, 𝗌𝗍(ω(r))ω(𝒟){\sf st}(\omega^{\!*}(r))\subseteq\omega^{\!*}(\mathscr{D}). Thus aω(𝒟)a\in\omega^{\!*}(\mathscr{D}).

Hence, |𝗌𝗍(ω(t))||ω(𝒟)||𝒟||{\sf st}({\omega^{\!*}(t)})|\leq|\omega^{\!*}(\mathscr{D})|\leq|\mathscr{D}|, for t𝒞t\in\mathscr{C}. ∎

4.3 NP algorithm for Insecurity: Sketch

After guessing a coherent set of sessions and an interleaving of these sessions of length nn, we guess a small substitution σ\sigma^{\!*}, for each intruder send βi\beta_{i} a set Xi𝗁𝖺𝗍(βi)X_{i}\subseteq{\sf hat}(\beta_{i}) and a small substitution μi\mu^{\!*}_{i} whose domain is 𝖻𝗏(βi)𝖻𝗏(Xi){\sf bv}(\beta_{i})\setminus{\sf bv}(X_{i}). We also guess a sequence of knowledge functions such that the relevant atomic assertions and terms (communicated in the σ(βi)\sigma^{\!*}(\beta_{i})s) are derivable from σ(𝑘𝑒𝑟(𝗄i1(I)))\sigma^{\!*}(\mathit{ker}({\sf k}_{i-1}(I))). These derivability checks in the 𝑒𝑞\vdash_{\mathit{eq}} system can be carried out in time polynomial in the size of the protocol description (using the procedure described in Algorithm 1).

For honest agent derivations, we only deal with derivations of the form 𝗄i(ui)aαi{\sf k}_{i}(u_{i})\vdash_{\mathit{a}}\alpha_{i} (without the σ\sigma). This is, in fact, a version of the passive intruder problem for assertions. Applying Theorem 16, we reduce this to checks of the form (Ui;Fi)𝑒𝑞θi(rs)(U_{i};F_{i})\vdash_{\mathit{eq}}\theta_{i}({{r}\bowtie{s}}). It is much simpler to ensure that we can obtain θi\theta_{i}s of bounded size, because of the absence of σ\sigma. We can think of this as a version of the passive intruder problem for the system with assertions. The following theorem, the proof of which can be found in the Appendix, will help us obtain small θi\theta_{i}s.

Theorem 40.

If there is a μ\mu satisfying Theorem 16, there is a “small” ν\nu satisfying the same conditions, such that |𝗌𝗍(ν(x))||𝗌𝗍(S)𝗌𝗍(A{α})||{\sf st}({\nu(x)})|\leq|{\sf st}(S)\cup{\sf st}(A\cup\{\alpha\})| for all x𝖽𝗈𝗆(ν)x\in{\sf dom}(\nu).

In order to check whether 𝗄i(ui)aαi{\sf k}_{i}(u_{i})\vdash_{\mathit{a}}\alpha_{i}, we need to guess X𝗁𝖺𝗍(αi)X\subseteq{\sf hat}(\alpha_{i}) and a small substitution θi\theta_{i} such that the conditions of Theorem 16 are satisfied. (The smallness of θi\theta_{i} is guaranteed by Theorem 40.) Each of those conditions can be checked in polynomial time because they only involve 𝑑𝑦\vdash_{\mathit{dy}} proofs (checkable in PTIME), 𝑒𝑞\vdash_{\mathit{eq}} proofs (also checkable in PTIME), and proofs involving only {𝖺𝗑,𝗂,𝗂,𝗌𝖺𝗒}\{{\sf ax},\wedge\sf i,\exists\sf i,{\sf say}\} (also checkable in PTIME). Thus, honest agent derivability checks are in NP.

5 Discussion and Future Work

5.1 Intruder theories for terms

For terms, we assumed that every operator had constructor and destructor rules, as specified in Figure 1. Such systems are called constructor-destructor theories. While the initial results for the active intruder problem were proved for simple theories by [38], that work has been extended to much richer theories [15, 2, 20, 16, 9, 13, 14]. As mentioned in Section 1.4, the extension with assertions that we consider is not subsumed by any known intruder theories.

Can one generalize the results of this paper to richer intruder theories? We believe that one can, but one needs to modify a few fundamental notions used so far. We list these considerations below.

  • In the main text, we used 𝗌𝗍(t){\sf st}(t) to mean the syntactic subterms of tt. For a general intruder theory, we will need to assume a function 𝒮{\cal S} which maps finite sets of terms to finite sets, and satisfies 𝗌𝗍(X)𝒮(X){\sf st}(X)\subseteq{\cal S}(X) for any set XX.

  • To handle the general case, we modify the form of constructors and destructors as follows. In a constructor rule, each immediate subterm of the conclusion is a subterm of one of the premises. In a destructor rule, the conclusion is a subterm of one of the premises.

  • We can assume that the intruder theory we consider is local w.r.t. 𝒮{\cal S}. That is, whenever XX derives tt, we have a proof π\pi of XtX\vdash t such that 𝗍𝖾𝗋𝗆𝗌(π)𝒮(X{t}){\sf terms}(\pi)\subseteq{\cal S}(X\cup\{t\}), and further, if π\pi ends in a destructor rule, 𝗍𝖾𝗋𝗆𝗌(π)𝒮(X){\sf terms}(\pi)\subseteq{\cal S}(X).

  • We modify Definition 21 to use 𝒮{\cal S} instead of 𝗌𝗍{\sf st}. Definitions 22, 25, 30, 32, and 33, on which the proofs in Section 4 hinge, will stay unchanged, since they only refer to 𝒞\mathscr{C} and 𝒟\mathscr{D}.

  • We need to prove Theorem 29 for the extended theory before moving onto the 𝑒𝑞\vdash_{\mathit{eq}} system. Determining the conditions on the intruder theory which would guarantee this theorem is left for future work.

  • Now, for proofs in the 𝑒𝑞\vdash_{\mathit{eq}} system, there is the following subtlety, which we illustrate by considering the 𝑒𝑞\vdash_{\mathit{eq}} theory built on top of the theory for xor as presented in [15]. In this intruder theory, there are implicit rewrites in the rules for xor. For instance, from aba\oplus b and bcb\oplus c, we can obtain aca\oplus c. We would need to carry over these rewrites into the equality rules as well, and in the presence of such rewrites, show that normalization and subterm property hold for the new 𝑒𝑞\vdash_{\mathit{eq}} system.

    In particular, for normalization, we need to eliminate subproofs where an instance of 𝖼𝗈𝗇𝗌{\sf cons} appears as the premise for 𝗉𝗋𝗈𝗃{\sf proj}. For the basic 𝑒𝑞\vdash_{\mathit{eq}} system, one can do this by picking the appropriate subproof of 𝖼𝗈𝗇𝗌{\sf cons}. However, in this new system with xor, consider a proof of the following form.

    tensy tensy T;ExabT;Eybc  cons T;Exyac  proj1 T;Exa {tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1\hskip 5.0pt plus 1.0fil{tensy\vbox{\hbox spread0.0pt{\hskip 0.0pt plus 0.0001fil\hbox{$\displaystyle\penalty 1T;E\vdash{{x}\bowtie{a\oplus b}}\quad T;E\vdash{{y}\bowtie{b\oplus c}}$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=146.77716pt\hbox{\kern 3.00003pt${\sf cons}$}}}\hbox{\kern 30.08148pt\hbox{$\displaystyle T;E\vdash{{x\oplus y}\bowtie{a\oplus c}}$}}}}\hskip 5.0pt plus 1.0fil\penalty 2$}\hskip 0.0pt plus 0.0001fil}\hbox{\hbox{\kern 0.0pt\vrule height=0.25002pt,depth=0.25002pt,width=199.94046pt\hbox{\kern 3.00003pt${\sf proj}_{1}$}}}\hbox{\kern 73.67984pt\hbox{$\displaystyle T;E\vdash{{x}\bowtie{a}}$}}}}

    Such a proof cannot easily be normalized, since none of these subproofs has the same conclusion. But such a 𝗉𝗋𝗈𝗃{\sf proj} rule should not be allowed to begin with, since implicit rewrites are not injective.666In the constructor-destructor theories as in Figure 1, we can see that such implicit rewrites do not occur, and all 𝖿{\sf f}s considered are injective. Thus, proving normalization and the subterm property for any modified 𝑒𝑞\vdash_{\mathit{eq}} system built on top of a general intruder theory seems feasible, provided one appropriately tailors the rules – especially 𝗉𝗋𝗈𝗃{\sf proj} – to avoid any unsound behaviour. This is left for future work.

Thus, we can see that the main change in lifting this result to richer intruder theories lies in showing that Theorem 29 holds. One might also need to restrict the new rules one might introduce to the 𝑒𝑞\vdash_{\mathit{eq}} system, and hence mildly modify the proofs of the normalization theorem and Theorem 31.

5.2 Constraint solving approach

An algorithmic approach to the active intruder problem is constraint solving [34, 16]. Rather than merely proving a bound on the substitution size, these papers present the problem as a series of deducibility constraints (involving variables), the solution to which is a substitution under which all the deducibilities actually hold. They also provide rules for constructing such a substitution.

In Section 4, for a run, we defined the sequence of sets (Ti;Ei)(T_{i};E_{i}), and sets of atomic formulas XiX_{i}, for ini\leq n. This can be viewed as a generalized constraint system, where we want to find substitutions under which (Ti;Ei)(T_{i};E_{i}) can derive the equality assertions in XiX_{i}, and TiT_{i} can derive the public terms of XiX_{i}. It is a worthwhile exercise to adapt the existing constraint solving approaches to solve such generalized constraint systems. We leave this for future work.

5.3 Full disjunction

An interesting feature of the language in [35] is the use of disjunction. While our syntax here uses list membership to express a limited form of disjunction that seems to suffice for many protocols, it would be worthwhile to explore the utility of full disjunction and its effect on the active intruder problem.

In fact, with disjunction, we know that even the derivability problem becomes more involved. To check if (S;A)aγ(S;A)\vdash_{\mathit{a}}\gamma, one can no longer work with a single kernel of (S;A)(S;A). One can define a notion of “down-closure”. For each disjunctive formula αβ\alpha\vee\beta, one obtains two down-closures – one containing α\alpha, and the other β\beta. In general, many disjunctions could occur in AA, and there are exponentially many down-closures for any (S;A)(S;A). Using a left disjunction property similar to those in Lemma 13 (αβ\alpha\vee\beta derives γ\gamma iff γ\gamma is derivable from α\alpha and from β\beta), we check if the kernels of all down-closures of (S;A)(S;A) derive γ\gamma. Thus, the derivability problem is in Π2\Pi_{2}. Some of these down-closures might even contain contradictory assertions, and hence our techniques for the insecurity problem do not seem to directly apply. Exploring these issues is an interesting direction of research and is left for future work.

5.4 Adding if-then-else branching to protocols

As mentioned earlier, we can add an A:𝖺𝗌𝗌𝖾𝗋𝗍αA:{\sf assert}~{}\alpha action that allows the role to proceed only if α\alpha can be derived using the information that AA has at the time. Similarly, we can add an action of the form A:𝖽𝖾𝗇𝗒αA:{\sf deny}~{}\alpha, which lets the role proceed only if α\alpha cannot be derived using AA’s current knowledge. To simulate an if-then-else branch (by specifying a condition α\alpha to be checked and an agent AA who will check it), we create two roles, one containing A:𝖺𝗌𝗌𝖾𝗋𝗍αA:{\sf assert}~{}\alpha followed by the actions in the then branch, and the other containing A:𝖽𝖾𝗇𝗒αA:{\sf deny}~{}\alpha followed by the actions in the else branch. We can easily extend our results to protocols involving such assert and deny actions where the condition being checked is whether or not a predicate holds about some atomic terms (for example, 𝖾𝗅(V){\sf el}(V) in Section 2.3).

The fact that a predicate PP holds about some terms t\vec{t} can be modelled as the presence of t\vec{t} in a global list. We can also extend the model to allow agents (with appropriate access privileges) to add and delete entries from global lists, as considered in tools like Proverif [11] and in some versions of applied-pi [5, 28]. The technical proofs in our work continue to hold for these extensions.

5.5 Adding assertions to other models and tools

It is also useful to add communicable assertions to the widely-used applied pi calculus [1]. It would be especially interesting to see how this impacts the notion of static equivalence, and then study expressibility and decidability. As mentioned earlier, one can express certain “equivalence” properties in a more natural manner with assertions as compared to the terms-only model. Another promising extension is to study which equivalence properties can be expressed as reachability properties in this manner, like in [25]. These would also help us to extend existing tools [21, 33, 11, 13] with assertions.

References

  • [1] Martín Abadi, Bruno Blanchet, and Cédric Fournet. The applied pi calculus: mobile values, new names, and secure communication. Journal of the ACM, 65(1):1:1–1:41, 2017.
  • [2] Martín Abadi and Véronique Cortier. Deciding knowledge in security protocols under equational theories. Theoretical Computer Science, 367(1–2):2–32, 2006.
  • [3] Ben Adida. Helios: web-based open-audit voting. In 17th Conference on Security Symposium, pages 335–348, 2008.
  • [4] Roberto M. Amadio, Denis Lugiez, and Vincent Vanackére. On the symbolic reduction of processes with cryptographic functions. Theoretical Computer Science, 290(1):695–740, 2003.
  • [5] Myrto Arapinis, Jia Liu, Eike Ritter, and Mark Ryan. Stateful applied pi calculus: observational equivalence and labelled bisimilarity. Journal of Logical and Algebraic Methods in Programming, 89:95–149, 2017.
  • [6] Michael Backes, Cătălin Hritçu, and Matteo Maffei. Automated verification of remote electronic voting protocols in the applied pi-calculus. In 21st IEEE Computer Security Foundations Symposium, pages 195–209, 2008.
  • [7] Michael Backes, Matteo Maffei, and Dominique Unruh. Zero-knowledge in the applied pi-calculus and automated verification of the Direct Anonymous Attestation protocol. In 29th IEEE Symposium on Security and Privacy, pages 202–215, 2008.
  • [8] A. Baskar, R. Ramanujam, and S. P. Suresh. A dexptime-complete Dolev-Yao theory with distributive encryption. In 35th International Symposium on Mathematical Foundations of Computer Science, volume 6281 of Lecture Notes in Computer Science, pages 102–113, 2010.
  • [9] Mathieu Baudet. Deciding security of protocols against off-line guessing attacks. In 12th ACM Conference on Computer and Communications Security, pages 16–25, 2005.
  • [10] Bruno Blanchet. An efficient cryptographic protocol verifier based on Prolog rules. In 14th IEEE Computer Security Foundations Workshop, pages 82–96, 2001.
  • [11] Bruno Blanchet. Modeling and verifying security protocols with the applied pi calculus and ProVerif. Foundations and Trends in Privacy and Security, 1(1):1–135, 2016.
  • [12] Bruno Blanchet and Andreas Podelski. Verification of cryptographic protocols: tagging enforces termination. Theoretical Computer Science, 333(1–2):67–90, 2005.
  • [13] Vincent Cheval, Steve Kremer, and Itsaka Rakotonirina. The DEEPSEC prover. In Computer Aided Verification, volume 10982 of Lecture Notes in Computer Science, pages 28–36, 2018.
  • [14] Vincent Cheval, Steve Kremer, and Itsaka Rakotonirina. The hitchhiker’s guide to decidability and complexity of equivalence properties in security protocols. In Logic, Language, and Security: Essays Dedicated to Andre Scedrov on the Occasion of his 65th Birthday, volume 12300 of Lecture Notes in Computer Science, pages 127–145, 2020.
  • [15] Yannick Chevalier, Ralf Küsters, Michaël Rusinowitch, and Mathieu Turuani. An NP decision procedure for protocol insecurity with XOR. Theoretical Computer Science, 338(1–3):247–274, 2005.
  • [16] Hubert Comon-Lundh and Vitaly Shmatikov. Intruder deductions, constraint solving and insecurity decisions in presence of exclusive or. In 18th IEEE Symposium on Logic in Computer Science, pages 271–280, 2003.
  • [17] Véronique Cortier, Stéphanie Delaune, and Pascal Lafourcade. A survey of algebraic properties used in cryptographic protocols. Journal of Computer Security, 14(1):1–43, 2006.
  • [18] Véronique Cortier, Stéphanie Delaune, and Vaishnavi Sundararajan. A decidable class of security protocols for both reachability and equivalence properties. Journal of Automated Reasoning, 65(4):479–520, 2021.
  • [19] Véronique Cortier and Steve Kremer. Formal models and techniques for analyzing security protocols: a tutorial. Foundations and Trends in Programming Languages, 1(3):151–267, 2014.
  • [20] Véronique Cortier, Michaël Rusinowitch, and Eugen Zălinescu. A resolution strategy for verifying cryptographic protocols with CBC encryption and blind signatures. In 7th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, pages 12–22, 2005.
  • [21] Cas J. F. Cremers. The Scyther tool: verification, falsification, and analysis of security protocols. In 20th International Conference on Computer Aided Verification, volume 5123 of Lecture Notes in Computer Science, pages 414–418, 2008.
  • [22] Danny Dolev and Andrew Yao. On the security of public-key protocols. IEEE Transactions on Information Theory, 29(2):198–208, 1983.
  • [23] Nancy Durgin, Patrick Lincoln, John Mitchell, and Andre Scedrov. Multiset rewriting and the complexity of bounded security protocols. Journal of Computer Security, 12(2):247–311, 2004.
  • [24] Atsushi Fujioka, Tatsuaki Okamoto, and Kazuo Ohta. A practical secret voting scheme for large scale elections. In Advances in Cryptology – AUSCRYPT, volume 718 of Lecture Notes in Computer Science, pages 244–251, 1992.
  • [25] Sébastien Gondron, Sebastian Mödersheim, and Luca Viganò. Privacy as reachability. In 35th IEEE Computer Security Foundations Symposium, pages 130–146, 2022.
  • [26] Jens Groth and Amit Sahai. Efficient non-interactive proof systems for bilinear groups. In Advances in Cryptology – EUROCRYPT, volume 4965 of Lecture Notes in Computer Science, pages 415–432, 2008.
  • [27] Nevin Heintze and Doug Tygar. A model for secure protocols and their compositions. IEEE Transactions on Software Engineering, 22(1):16–30, 1996.
  • [28] Steve Kremer and Robert Künnemann. Automated analysis of security protocols with global state. Journal of Computer Security, 24(5):583–616, 2016.
  • [29] Steve Kremer and Mark Ryan. Analysis of an electronic voting protocol in the applied pi calculus. In Programming Languages and Systems – ESOP 2005, volume 3444 of Lecture Notes in Computer Science, pages 186–200, 2005.
  • [30] Pascal Lafourcade, Denis Lugiez, and Ralf Treinen. Intruder deduction for the equational theory of abelian groups with distributive encryption. Information and Computation, 205(4):581–623, 2007.
  • [31] Matteo Maffei, Kim Pecina, and Mathieu Reinert. Security and privacy by declarative design. In 26th IEEE Computer Security Foundations Symposium, pages 81–96, 2003.
  • [32] David A. McAllester. Automatic recognition of tractability in inference relations. Journal of the ACM, 40(2):284–303, 1993.
  • [33] Simon Meier, Benedikt Schmidt, Cas Cremers, and David Basin. The TAMARIN prover for the symbolic analysis of security protocols. In 25th International Conference on Computer Aided Verification, volume 8044 of Lecture Notes in Computer Science, pages 696–701, 2013.
  • [34] Jonathan K. Millen and Vitaly Shmatikov. Constraint solving for bounded-process cryptographic protocol analysis. In 8th ACM Conference on Computer and Communications Security, pages 166–175, 2001.
  • [35] R. Ramanujam, Vaishnavi Sundararajan, and S. P. Suresh. Existential assertions for voting protocols. In Financial Cryptography and Data Security, volume 10323 of Lecture Notes in Computer Science, pages 337–352, 2017.
  • [36] R. Ramanujam and S. P. Suresh. Decidability of context-explicit security protocols. Journal of Computer Security, 13(1):135–165, 2005.
  • [37] R. Ramanujam and S. P. Suresh. A (restricted) quantifier elimination for security protocols. Theoretical Computer Science, 367(1–2):228–256, 2006.
  • [38] Michaël Rusinowitch and Mathieu Turuani. Protocol insecurity with finite number of sessions and composed keys is NP-complete. Theoretical Computer Science, 299(1–3):451–475, 2003.

Appendix A Proof of Theorem 40

We want to check if (S;A)aα(S;A)\vdash_{\mathit{a}}\alpha, where 𝖻𝗏(α)𝗏𝖺𝗋𝗌(S;A)={\sf bv}(\alpha)\cap{\sf vars}(S;A)=\emptyset. Let (T;E)=𝑘𝑒𝑟(S;A)(T;E)=\mathit{ker}(S;A). By Theorem 16, this reduces to checking if there is a substitution μ\mu with 𝖽𝗈𝗆(μ)=𝖻𝗏(α){\sf dom}(\mu)={\sf bv}(\alpha) s.t. and X𝗁𝖺𝗍(α)X\subseteq{\sf hat}(\alpha) s.t. x𝖻𝗏(α):T𝑑𝑦μ(x)\forall{}x\in{\sf bv}(\alpha):T\vdash_{\mathit{dy}}\mu(x) and for all βX\beta\in X, (T;E)aμ(β)(T;E)\vdash_{\mathit{a}}\mu(\beta). For formulas in XX that are not of the form tu{{t}\bowtie{u}}, all terms occurring in them are variables or names, so μ\mu is atomic on variables occurring in them. It therefore suffices to only consider assertions of the form tu{{t}\bowtie{u}}.

So the problem is as follows. There is a set of terms 𝒞\mathscr{C} and (T;E)(T;E) with 𝗌𝗍(T)𝗌𝗍(E)𝒞{\sf st}(T)\cup{\sf st}(E)\subseteq\mathscr{C}, and a substitution μ\mu with 𝖽𝗈𝗆(μ)𝗏𝖺𝗋𝗌(T;E)={\sf dom}(\mu)\cap{\sf vars}(T;E)=\emptyset, which satisfies some derivabilities of the form T𝑑𝑦tT\vdash_{\mathit{dy}}t and T;E𝑒𝑞tuT;E\vdash_{\mathit{eq}}{{t}\bowtie{u}}, where t,u𝒞t,u\in\mathscr{C}. We seek a small ν\nu that preserves the above derivabilities. To reduce clutter, we use ZZ to refer to 𝖽𝗈𝗆(μ){\sf dom}(\mu). Let 𝒟=𝒞Z\mathscr{D}=\mathscr{C}\setminus Z. Since T𝑑𝑦μ(x)T\vdash_{\mathit{dy}}\mu(x), all variables occurring in μ(x)\mu(x) must also be in 𝗏𝖺𝗋𝗌(T){\sf vars}(T). But 𝗏𝖺𝗋𝗌(T;E)Z={\sf vars}(T;E)\cap Z=\emptyset, so 𝗏𝖺𝗋𝗌(μ(x))Z={\sf vars}(\mu(x))\cap Z=\emptyset.

Define tut\approx u iff T;E𝑒𝑞μ(tu)T;E\vdash_{\mathit{eq}}\mu({{t}\bowtie{u}}). It is easy to see that \approx is a partial equivalence relation (on the subset of terms tt such that T𝑑𝑦μ(t)T\vdash_{\mathit{dy}}\mu(t)).

We say that xZx\in Z is minimal if there is no t𝒟t\in\mathscr{D} with xtx\approx t. Let 𝒱m\mathscr{V}_{m} denote the set of all minimal variables. Our strategy for finding a small ν\nu is to “zap” minimal variables, and propagate the change to (interpretations of) non-minimal variables. To this end, it is convenient to translate every term to an “equivalent” one with only minimal variables. The notion of equivalence is based on unifiability under μ\mu. The set of all such terms that are equivalent to terms in 𝒞\mathscr{C} is defined as follows.

Definition 41.

𝒞^{t𝗏𝖺𝗋𝗌(t)Z𝒱m, either t𝒱m or u𝒟:tu}\widehat{\mathscr{C}}\coloneqq\{t\mid{\sf vars}(t)\cap Z\subseteq\mathscr{V}_{m},\text{ either }t\in\mathscr{V}_{m}\text{ or }\exists{u}\in\mathscr{D}:t\approx u\}.

Lemma 42.

For every t𝒞t\in\mathscr{C} with T𝑑𝑦μ(t)T\vdash_{\mathit{dy}}\mu(t), there is t𝒞^{t}^{*}\in\widehat{\mathscr{C}} such that: T𝑑𝑦μ(t)T\vdash_{\mathit{dy}}\mu({t}^{*}); ttt\approx{t}^{*}; and for all x𝒱mx\in\mathscr{V}_{m}, x(t)𝔸(TZ,t)\mathbb{P}_{x}({{t}^{*}})\subseteq\mathbb{A}(T\cup Z,{t}^{*}).

Proof.

For x,yZx,y\in Z, xyx\prec y iff r𝒟[x𝗌𝗍(r) and ry]\exists{r}\in\mathscr{D}[x\in{\sf st}(r)\text{ and }r\approx y].

We now show that \prec is acyclic. Towards this, we claim that if xyx\prec y and yzy\prec z, then there is some term aa (not necessarily in 𝒞\mathscr{C}) s.t. μ(x)\mu(x) is a proper subterm of μ(a)\mu(a) and aza\approx z. Extending this reasoning, we see that if x+xx\prec^{+}x, we have some term aa such that μ(x)\mu(x) is a proper subterm of μ(a)\mu(a) and (T;E)𝑒𝑞μ(a)μ(x)(T;E)\vdash_{\mathit{eq}}{{\mu(a)}\bowtie{\mu(x)}}. But EE is consistent, which means that there is some λ\lambda s.t. λ(μ(a))=λ(μ(x))\lambda(\mu(a))=\lambda(\mu(x)). But this is incompatible with μ(x)\mu(x) being a proper subterm of μ(a)\mu(a). Thus \prec is acyclic.

We now prove the claim. Suppose xyx\prec y and yzy\prec z. Then there exists r,s𝒟r,s\in\mathscr{D} such that x𝗌𝗍(r)x\in{\sf st}(r), (T;E)𝑒𝑞μ(r)μ(y)(T;E)\vdash_{\mathit{eq}}{{\mu(r)}\bowtie{\mu(y)}}, y𝗌𝗍(s)y\in{\sf st}(s), and (T;E)𝑒𝑞μ(s)μ(z)(T;E)\vdash_{\mathit{eq}}{{\mu(s)}\bowtie{\mu(z)}}. Let a=s[r]y(s)a={s}[{r}]_{\mathbb{P}_{y}({s})}. We see that μ(x)\mu(x) is a proper subterm of μ(a)\mu(a). From the abstractability conditions satisfied by μ\mu and the derivability of μ(x)\mu(x) for all xZx\in Z, we can justify the applications of 𝗌𝗎𝖻𝗌𝗍{\sf subst} necessary to obtain (T;E)𝑒𝑞μ(a)μ(z)(T;E)\vdash_{\mathit{eq}}{{\mu(a)}\bowtie{\mu(z)}} and thus aza\approx z.

Since \prec is acyclic, we can define a notion of rank of variables: 𝑟𝑎𝑛𝑘(x)=max{𝑟𝑎𝑛𝑘(y)y+x}+1\mathit{rank}(x)=\max\{\mathit{rank}(y)\mid y\prec^{+}x\}+1. For a term u𝒟u\in\mathscr{D}, we define 𝑟𝑎𝑛𝑘(u)=max{𝑟𝑎𝑛𝑘(x)x𝗏𝖺𝗋𝗌(u)Z}\mathit{rank}(u)=\max\{\mathit{rank}(x)\mid x\in{\sf vars}(u)\cap Z\}. It is easy to verify that if u𝒟u\in\mathscr{D} and xux\approx u, then 𝑟𝑎𝑛𝑘(x)>𝑟𝑎𝑛𝑘(u)\mathit{rank}(x)>\mathit{rank}(u). It is also easy to see that if x𝒱mx\in\mathscr{V}_{m}, then xZx\in Z has rank 0.

Having set up this machinery, we prove the lemma by induction on δ(t)=(𝑟𝑎𝑛𝑘(t),|t|)\delta(t)=(\mathit{rank}(t),|t|). First fix an ordering on 𝒞^\widehat{\mathscr{C}}. For δ(t)=(0,0)\delta(t)=(0,0), we have that tt is a variable xx and 𝑟𝑎𝑛𝑘(x)=0\mathit{rank}(x)=0. We have two cases to consider.

  • x𝒱mx\in\mathscr{V}_{m}: Choose x=x{x}^{*}=x.

  • x𝒱mx\notin\mathscr{V}_{m}: This means that there is some u𝒟u\in\mathscr{D} s.t. xux\approx u. But since 𝑟𝑎𝑛𝑘(x)=0\mathit{rank}(x)=0, 𝗏𝖺𝗋𝗌(u)Z={\sf vars}(u)\cap Z=\emptyset for each such uu. Choose x{x}^{*} to be the earliest such uu (according to the ordering on 𝒞^\widehat{\mathscr{C}}). Clearly (T;E)μ(x)μ(x)(T;E)\vdash{{\mu(x)}\bowtie{\mu({x}^{*})}}, and by Lemma 15, T𝑑𝑦μ(x)T\vdash_{\mathit{dy}}\mu({x}^{*}). Finally 𝗏𝖺𝗋𝗌(x)Z={\sf vars}({x}^{*})\cap Z=\emptyset, so it is vacuously true that y(x)𝔸(TZ,x)\mathbb{P}_{y}({{x}^{*}})\subseteq\mathbb{A}(T\cup Z,{x}^{*}) for all y𝒱my\in\mathscr{V}_{m}.

So suppose δ(t)>(0,0)\delta(t)>(0,0) and that the theorem is true for all uu such that δ(u)<δ(t)\delta(u)<\delta(t). There are two cases to consider:

  • tt is a variable, say xx: Then 𝑟𝑎𝑛𝑘(x)>0\mathit{rank}(x)>0, and there is u𝒟u\in\mathscr{D} s.t. xux\approx u, whence 𝑟𝑎𝑛𝑘(u)<𝑟𝑎𝑛𝑘(x)\mathit{rank}(u)<\mathit{rank}(x). Pick the earliest such u𝒞^u\in\widehat{\mathscr{C}}. By IH there is u{u}^{*}, and we define x=u{x}^{*}={u}^{*}. Since xux\approx u and uuu\approx{u}^{*}, we have xxx\approx{x}^{*}, by transitivity.

  • tt is not a variable: For each y𝗏𝖺𝗋𝗌(t)Zy\in{\sf vars}(t)\cap Z, there is y{y}^{*}. We obtain t{t}^{*} by replacing each yy by y{y}^{*}. Clearly 𝗏𝖺𝗋𝗌(t)Z𝒱m{\sf vars}({t}^{*})\cap Z\subseteq\mathscr{V}_{m}. Also since all variables appear in abstractable positions of tt, we can justify the relevant applications of 𝗌𝗎𝖻𝗌𝗍{\sf subst} to justify ttt\approx{t}^{*}. Finally, if zz appears in an abstractable position in rr and yy appears in an abstractable position in ss, then zz appears in an abstractable position in s[r]y(s){s}[{r}]_{\mathbb{P}_{y}({s})}. Thus the abstractability part of the statement is also fulfilled. ∎

We now define the substitution ν\nu as follows. Assume that there is some 𝗆T𝒩{\sf m}\in T\cap\mathscr{N} such that 𝗆𝗌𝗍(E{α})𝗌𝗍(𝗋𝗇𝗀(μ)){\sf m}\notin{\sf st}(E\cup\{\alpha\})\cup{\sf st}({\sf rng}(\mu)).777Thus 𝗆{\sf m} is a “spare name” that does not occur in any of the derivations under consideration. Let νm\nu_{m} be the substitution that maps each x𝒱mx\in\mathscr{V}_{m} to 𝗆{\sf m}. For all xZ:ν(x)=νm(x)x\in Z:\nu(x)=\nu_{m}({x}^{*}). Notice that for all x𝖽𝗈𝗆(ν)x\in{\sf dom}(\nu), either ν(x)=𝗆\nu(x)={\sf m} or there is u𝒟u\in\mathscr{D} s.t. ν(x)=ν(u)\nu(x)=\nu(u). Thus we can show that ν\nu is |𝒞||\mathscr{C}|-bounded following the proof of Theorem 39. To complete the proof of Theorem 40, we just need to show that ν\nu preserves derivability. This is proved in Theorem 44, the main result of this section. But first we state a useful observation.

Observation 43.

a

  1. 1.

    For xZx\in Z, if μ(x)𝒞\mu(x)\in\mathscr{C} then x𝒱mx\notin\mathscr{V}_{m}.

  2. 2.

    If t𝒞^t\in\widehat{\mathscr{C}} and μ(t)𝒞\mu(t)\in\mathscr{C}, then 𝗏𝖺𝗋𝗌(t)Z={\sf vars}(t)\cap Z=\emptyset and μ(t)=t\mu(t)=t.

Proof.

a

  1. 1.

    Let μ(x)=t𝒞\mu(x)=t\in\mathscr{C}. Since 𝗏𝖺𝗋𝗌(t)Z={\sf vars}(t)\cap Z=\emptyset, we have that tZt\notin Z and μ(t)=t\mu(t)=t. Thus t𝒟t\in\mathscr{D}, and μ(x)μ(t){{\mu(x)}\bowtie{\mu(t)}} is derivable using the 𝖾𝗊{\sf eq} rule, i.e., xtx\approx t. Therefore x𝒱mx\notin\mathscr{V}_{m}.

  2. 2.

    For every x𝗏𝖺𝗋𝗌(t)Zx\in{\sf vars}(t)\cap Z, μ(x)𝒞\mu(x)\in\mathscr{C}. Thus we have x𝒱mx\notin\mathscr{V}_{m}, by the previous part. But since t𝒞^t\in\widehat{\mathscr{C}}, we have that 𝗏𝖺𝗋𝗌(t)Z𝒱m{\sf vars}(t)\cap Z\subseteq\mathscr{V}_{m}. The only conclusion is that 𝗏𝖺𝗋𝗌(t)Z={\sf vars}(t)\cap Z=\emptyset, and thus μ(t)=t\mu(t)=t. ∎

Theorem 44.

a

  1. 1.

    For any t𝒞t\in\mathscr{C}, if T𝑑𝑦μ(t)T\vdash_{\mathit{dy}}\mu(t) then T𝑑𝑦ν(t)T\vdash_{\mathit{dy}}\nu(t).

  2. 2.

    For any t,u𝒞t,u\in\mathscr{C}, if T;E𝑒𝑞μ(t)μ(u)T;E\vdash_{\mathit{eq}}{{\mu(t)}\bowtie{\mu(u)}} then T;E𝑒𝑞ν(t)ν(u)T;E\vdash_{\mathit{eq}}{{\nu(t)}\bowtie{\nu(u)}}.

Proof.

By Lemma 42, it suffices to prove the following. Let r,s𝒞^r,s\in\widehat{\mathscr{C}} such that x𝒱m\forall{x}\in\mathscr{V}_{m}, x((r,s))𝔸(TZ,(r,s))\mathbb{P}_{x}({(r,s)})\subseteq\mathbb{A}(T\cup Z,(r,s)). If T𝑑𝑦μ(r)T\vdash_{\mathit{dy}}\mu(r) then T𝑑𝑦νm(r)T\vdash_{\mathit{dy}}\nu_{m}(r); and if T;E𝑒𝑞μ(r)μ(s)T;E\vdash_{\mathit{eq}}{{\mu(r)}\bowtie{\mu(s)}} then T;Eνm(r)νm(s)T;E\vdash{{\nu_{m}(r)}\bowtie{\nu_{m}(s)}}.

  1. 1.

    Suppose T𝑑𝑦rT\vdash_{\mathit{dy}}r for rr as above. Since all positions of variables from ZZ occurring in rr are abstractable w.r.t. TZT\cup Z, and since T{𝗆}𝑑𝑦𝗆T\cup\{{\sf m}\}\vdash_{\mathit{dy}}{\sf m}, we can easily prove by induction on the size of terms that T𝗆𝑑𝑦νm(r)T\cup{\sf m}\vdash_{\mathit{dy}}\nu_{m}(r).

  2. 2.

    Suppose T;E𝑒𝑞μ(r)μ(s)T;E\vdash_{\mathit{eq}}{{\mu(r)}\bowtie{\mu(s)}} for r,sr,s as above. Let π\pi be a normal proof of T;Eμ(r)μ(s)T;E\vdash{{\mu(r)}\bowtie{\mu(s)}} with last rule 𝗋{\sf r}. We prove the desired statement by induction on the structure of π\pi. There are the following cases to consider.

    • 𝗋{𝖺𝗑,𝖾𝗊,𝗉𝗋𝗈𝗃}{\sf r}\in\{{\sf ax},{\sf eq},{\sf proj}\}: Three cases arise: μ(r)μ(s)E{{\mu(r)}\bowtie{\mu(s)}}\in E, and thus μ(r),μ(s)𝒞\mu(r),\mu(s)\in\mathscr{C}. Or μ(r)=μ(s)\mu(r)=\mu(s) and T𝑑𝑦μ(r)T\vdash_{\mathit{dy}}\mu(r) via a proof ending in 𝖺𝗑{\sf ax} or a destructor rule, and thus μ(r),μ(s)𝗌𝗍(T)𝒞\mu(r),\mu(s)\in{\sf st}(T)\subseteq\mathscr{C}. Or by subterm property for normal 𝑒𝑞\vdash_{\mathit{eq}}-proofs μ(r),μ(s)𝗌𝗍(T;E)𝒞\mu(r),\mu(s)\in{\sf st}(T;E)\subseteq\mathscr{C}. Thus μ(r),μ(s)𝒞\mu(r),\mu(s)\in\mathscr{C} in all three cases. By Observation 43, 𝗏𝖺𝗋𝗌(r,s)Z={\sf vars}(r,s)\cap Z=\emptyset. Thus νm(r)=r=μ(r)\nu_{m}(r)=r=\mu(r) and νm(s)=s=μ(s)\nu_{m}(s)=s=\mu(s). Therefore π\pi itself is a proof of νm(r)νm(s){{\nu_{m}(r)}\bowtie{\nu_{m}(s)}}.

    • 𝗋=𝗍𝗋𝖺𝗇𝗌{\sf r}={\sf trans}: Suppose the immediate subproofs are π1,,πn\pi_{1},\ldots,\pi_{n}, with each πi\pi_{i} deriving vi1vi{{v_{i-1}}\bowtie{v_{i}}}. Let μ(r)=v0\mu(r)=v_{0} and μ(s)=vn\mu(s)=v_{n}. Since no πi\pi_{i} ends in 𝗍𝗋𝖺𝗇𝗌{\sf trans} and no two adjacent πi\pi_{i}’s end in 𝖼𝗈𝗇𝗌{\sf cons}, each viv_{i} (for 0<i<n0<i<n) appears in at least one proof ending in 𝖺𝗑{\sf ax}, 𝖾𝗊{\sf eq} or 𝗉𝗋𝗈𝗃{\sf proj}. Thus, by the subterm property, vi𝗌𝗍(T;E)𝒞v_{i}\in{\sf st}(T;E)\subseteq\mathscr{C} for 0<i<n0<i<n. Since 𝗏𝖺𝗋𝗌(T;E)Z={\sf vars}(T;E)\cap Z=\emptyset, it follows that vi𝒞^v_{i}\in\widehat{\mathscr{C}} and μ(vi)=vi\mu(v_{i})=v_{i}. Thus we can view each πi\pi_{i} as deriving μ(ri1)μ(ri){{\mu(r_{i-1})}\bowtie{\mu(r_{i})}}, where ri1,ri𝒞^r_{i-1},r_{i}\in\widehat{\mathscr{C}} (taking r0r_{0} and rnr_{n} to be rr and ss). By IH, there are proofs ϖ1,,ϖn\varpi_{1},\ldots,\varpi_{n}, with each ϖi\varpi_{i} deriving νm(ri1)νm(ri){{\nu_{m}(r_{i-1})}\bowtie{\nu_{m}(r_{i})}}. By composing them using 𝗍𝗋𝖺𝗇𝗌{\sf trans}, we get a proof of T;Eνm(r)νm(s)T;E\vdash{{\nu_{m}(r)}\bowtie{\nu_{m}(s)}}, as desired.

    • 𝗋=𝖼𝗈𝗇𝗌{\sf r}={\sf cons}: Suppose r=𝖿(r1,,rn)r={\sf f}(r_{1},\ldots,r_{n}) and s=𝖿(s1,,sn)s={\sf f}(s_{1},\ldots,s_{n}). Each ri,si𝒞^r_{i},s_{i}\in\widehat{\mathscr{C}}, and the immediate subproofs are π1,,πn\pi_{1},\ldots,\pi_{n}, with each πi\pi_{i} deriving μ(ri)μ(si){{\mu(r_{i})}\bowtie{\mu(s_{i})}}. By IH we have proofs ϖ1,,ϖn\varpi_{1},\ldots,\varpi_{n}, with each ϖi\varpi_{i} proving νm(r1)νm(s1){{\nu_{m}(r_{1})}\bowtie{\nu_{m}(s_{1})}}. We can compose them with the 𝖼𝗈𝗇𝗌{\sf cons} rule to get the desired proof of νm(r)νm(s){{\nu_{m}(r)}\bowtie{\nu_{m}(s)}}.

      Suppose, on the other hand, that rr is a variable. Since r𝒞^r\in\widehat{\mathscr{C}}, r𝒱mr\in\mathscr{V}_{m}. Now s𝒞^s\in\widehat{\mathscr{C}}, so either s𝒱ms\in\mathscr{V}_{m} or there is a𝒟a\in\mathscr{D} with sas\approx a. But in the second case, rar\approx a (by symmetry and transitivity), which cannot happen for a minimal variable rr. Therefore s𝒱ms\in\mathscr{V}_{m}. And we have νm(r)=νm(s)=𝗆T\nu_{m}(r)=\nu_{m}(s)={\sf m}\in T, so there is a proof of T,E𝑒𝑞νm(r)νm(s)T,E\vdash_{\mathit{eq}}{{\nu_{m}(r)}\bowtie{\nu_{m}(s)}} ending in 𝖾𝗊{\sf eq}.

      We have a similar argument in case ss is a variable, thereby proving the theorem. ∎

Appendix B Normalization and subterm property for 𝑒𝑞\vdash_{\mathit{eq}}

Suppose E{α}E\cup\{\alpha\} consist only of atomic formulas and π\pi is a proof of T;E𝑒𝑞αT;E\vdash_{\mathit{eq}}\alpha. We say that π\pi is normal if the following hold.

  1. 1.

    All 𝑑𝑦\vdash_{\mathit{dy}} subproofs are normal.

  2. 2.

    The premise of 𝗌𝗒𝗆{\sf sym} can only be the conclusion of 𝖺𝗑{\sf ax} or 𝗉𝗋𝗈𝗆{\sf prom}.

  3. 3.

    The premise of 𝖾𝗊{\sf eq} can only be the conclusion of a destructor rule.

  4. 4.

    No premise of a 𝗍𝗋𝖺𝗇𝗌{\sf trans} is of the form aa{{a}\bowtie{a}}, or the conclusion of a 𝗍𝗋𝖺𝗇𝗌{\sf trans}.

  5. 5.

    Adjacent premises of a 𝗍𝗋𝖺𝗇𝗌{\sf trans} are not conclusions of 𝖼𝗈𝗇𝗌{\sf cons}.

  6. 6.

    No premise of 𝗂𝗇𝗍{\sf int} is the conclusion of 𝗂𝗇𝗍{\sf int} or 𝗐𝗄{\sf wk}.

  7. 7.

    No subproof ending in 𝗉𝗋𝗈𝗃{\sf proj} contains 𝖼𝗈𝗇𝗌{\sf cons}.

A set EE of atomic formulas is said to be consistent if there is a λ\lambda s.t. λ(t)=λ(u)\lambda(t)=\lambda(u) for each tuE{{t}\bowtie{u}}\in E, and λ(t){t1,,tn}\lambda(t)\in\{t_{1},\ldots,t_{n}\} for each t[t1,,tn]Et\twoheadleftarrow{[t_{1},\ldots,t_{n}]}\in E.

R1 𝖾𝗊(𝖿(π1,π2)){\sf eq}({\sf f}(\pi_{1},\pi_{2}))
𝖼𝗈𝗇𝗌𝖿(𝖾𝗊(π1),𝖾𝗊(π2)){\sf cons}_{{\sf f}}({\sf eq}(\pi_{1}),{\sf eq}(\pi_{2}))
R2 𝗌𝗒𝗆(𝖾𝗊(π)){\sf sym}({\sf eq}(\pi))
𝖾𝗊(π){\sf eq}(\pi)
R3 𝗌𝗒𝗆(𝗌𝗒𝗆(π)){\sf sym}({\sf sym}(\pi))
π\pi
R4 𝗌𝗒𝗆(𝗋(π1,,πk)){\sf sym}({\sf r}(\pi_{1},\ldots,\pi_{k}))
𝗋(𝗌𝗒𝗆(π1),,𝗌𝗒𝗆(πk)){\sf r}({\sf sym}(\pi_{1}),\ldots,{\sf sym}(\pi_{k}))
R5 𝗍𝗋𝖺𝗇𝗌(π1,,πi1,ϖ,πi,,πr1){\sf trans}(\pi_{1},\ldots,\pi_{i-1},\varpi,\pi_{i},\ldots,\pi_{r-1})
𝗍𝗋𝖺𝗇𝗌(π1,,πi1,πi,,πr1){\sf trans}(\pi_{1},\ldots,\pi_{i-1},\pi_{i},\ldots,\pi_{r-1})
R6 𝗍𝗋𝖺𝗇𝗌(π1,,𝗍𝗋𝖺𝗇𝗌(πi1,,πik),,πr1){\sf trans}(\pi_{1},\ldots,{\sf trans}(\pi^{1}_{i},\ldots,\pi^{k}_{i}),\ldots,\pi_{r-1})
𝗍𝗋𝖺𝗇𝗌(π1,,πi1,,πik,,πr1){\sf trans}(\pi_{1},\ldots,\pi^{1}_{i},\ldots,\pi^{k}_{i},\ldots,\pi_{r-1})
R7 𝗍𝗋𝖺𝗇𝗌(π1,,𝖼𝗈𝗇𝗌(πi11,πi12),𝖼𝗈𝗇𝗌(πi1,πi2),,πr1){\sf trans}(\pi_{1},\ldots,{\sf cons}(\pi^{1}_{i-1},\pi^{2}_{i-1}),{\sf cons}(\pi^{1}_{i},\pi^{2}_{i}),\ldots,\pi_{r-1})
𝗍𝗋𝖺𝗇𝗌(π1,,𝖼𝗈𝗇𝗌(𝗍𝗋𝖺𝗇𝗌(πi11,πi1),𝗍𝗋𝖺𝗇𝗌(πi12,πi2)),,πr1){\sf trans}(\pi_{1},\ldots,{\sf cons}({\sf trans}(\pi^{1}_{i-1},\pi^{1}_{i}),{\sf trans}(\pi^{2}_{i-1},\pi^{2}_{i})),\ldots,\pi_{r-1})
R8 𝗉𝗋𝗈𝗃j(𝖼𝗈𝗇𝗌(π1,π2)){\sf proj}_{j}({\sf cons}(\pi_{1},\pi_{2}))
πj\pi_{j}
R9 𝗉𝗋𝗈𝗃j(𝗍𝗋𝖺𝗇𝗌(π1,,πi1,𝖼𝗈𝗇𝗌𝖿(πi1,πi2),πi+1,,πr1)){\sf proj}_{j}({\sf trans}(\pi_{1},\ldots,\pi_{i-1},{\sf cons}_{{\sf f}}(\pi^{1}_{i},\pi^{2}_{i}),\pi_{i+1},\ldots,\pi_{r-1}))
𝗍𝗋𝖺𝗇𝗌(𝗉𝗋𝗈𝗃j(𝗍𝗋𝖺𝗇𝗌(π1,,πi1)),πij,𝗉𝗋𝗈𝗃j(𝗍𝗋𝖺𝗇𝗌(πi+1,,πr1))){\sf trans}({\sf proj}_{j}({\sf trans}(\pi_{1},\ldots,\pi_{i-1})),\pi^{j}_{i},{\sf proj}_{j}({\sf trans}(\pi_{i+1},\ldots,\pi_{r-1})))
R10 𝗂𝗇𝗍(π1,,πk1,𝗂𝗇𝗍(πk,,πm),πm+1,,πn){\sf int}(\pi_{1},\ldots,\pi_{k-1},{\sf int}(\pi_{k},\ldots,\pi_{m}),\pi_{m+1},\ldots,\pi_{n})
𝗂𝗇𝗍(π1,,πk1,πk,,πm,πm+1,,πn){\sf int}(\pi_{1},\ldots,\pi_{k-1},\pi_{k},\ldots,\pi_{m},\pi_{m+1},\ldots,\pi_{n})
R11 𝗂𝗇𝗍(π1,,𝗐𝗄(πi),,πn){\sf int}(\pi_{1},\ldots,{\sf wk}(\pi_{i}),\ldots,\pi_{n})
𝗐𝗄(πi){\sf wk}(\pi_{i})
Table 3: Proof transformation rules. The proof represented by the first line in each row is transformed to the proof represented by the second line. In R4, 𝗋{𝗍𝗋𝖺𝗇𝗌,𝗉𝗋𝗈𝗃,𝖼𝗈𝗇𝗌}{\sf r}\in\{{\sf trans},{\sf proj},{\sf cons}\}. In R5, 𝖼𝗈𝗇𝖼(ϖ){\sf conc}(\varpi) is assumed to be of the form aa{{a}\bowtie{a}}.

We next prove normalization for 𝑒𝑞\vdash_{\mathit{eq}} proofs (with a consistent LHS). We present proof transformation rules in Table 3. To save space, we use proof terms𝗋(π1,,πn){\sf r}(\pi_{1},\ldots,\pi_{n}) denotes a proof π\pi with last rule 𝗋{\sf r} and immediate subproofs π1,,πn\pi_{1},\ldots,\pi_{n}. It is assumed that the derivations are from a consistent (T;E)(T;E). R1 is applicable when 𝖿{\sf f} is a constructor rule, and ensures that 𝑑𝑦\vdash_{\mathit{dy}} subproofs do not end in a constructor rule. R2 and R3 eliminate some occurrences of 𝗌𝗒𝗆{\sf sym}, while R4 pushes 𝗌𝗒𝗆{\sf sym} up towards the axioms. R5 and R6 ensure that no premise of 𝗍𝗋𝖺𝗇𝗌{\sf trans} is the conclusion of 𝖾𝗊{\sf eq} or 𝗍𝗋𝖺𝗇𝗌{\sf trans}. R7 ensures that adjacent premises of 𝗍𝗋𝖺𝗇𝗌{\sf trans} are not the result of 𝖼𝗈𝗇𝗌{\sf cons}. R8 simplifies proofs where 𝗉𝗋𝗈𝗃{\sf proj} follows 𝖼𝗈𝗇𝗌{\sf cons}. We will discuss R9 later. R10 ensures that the conclusion of 𝗂𝗇𝗍{\sf int} is not a premise of 𝗂𝗇𝗍{\sf int}. In R11, πi\pi_{i} proves an equality vn{{v}\bowtie{n}}, and it is weakened to a list membership of the form vv\twoheadleftarrow\ell^{\prime}, but by consistency, even after intersection, the conclusion must be of the form vv\twoheadleftarrow{\ell} where λ(v)\lambda(v) is an element of \ell for some λ\lambda. Thus we can directly apply weakening to πi\pi_{i} to get the same conclusion.

R9 requires some explanation. Let πi\pi_{i} be the proof 𝖼𝗈𝗇𝗌𝖿(πi1,πi2){\sf cons}_{{\sf f}}(\pi^{1}_{i},\pi^{2}_{i}), and let 𝖼𝗈𝗇𝖼(πj){\sf conc}(\pi_{j}) be tjtj+1{{t_{j}}\bowtie{t_{j+1}}}, for 1j<r1\leq j<r. We see that 𝖼𝗈𝗇𝖼(𝗍𝗋𝖺𝗇𝗌(π1,,πr1)){\sf conc}({\sf trans}(\pi_{1},\ldots,\pi_{r-1})) is t1tr{{t_{1}}\bowtie{t_{r}}}. Since 𝗉𝗋𝗈𝗃{\sf proj} is applied on this, there is some constructor 𝗀{\sf g} such that te=𝗀(te1,te2)t_{e}={\sf g}(t^{1}_{e},t^{2}_{e}) for e{1,r}e\in\{1,r\}. Since πi\pi_{i} ends in 𝖼𝗈𝗇𝗌𝖿{\sf cons}_{{\sf f}}, we see that te=𝖿(te1,te2)t_{e}={\sf f}(t^{1}_{e},t^{2}_{e}) for e{i,i+1}e\in\{i,i+1\}. But t1ti{{t_{1}}\bowtie{t_{i}}} is provable from (T;E)(T;E), which is consistent. Therefore it has to be the case that 𝖿=𝗀{\sf f}={\sf g}. Thus we see that for all e{1,i,i+1,r}e\in\{1,i,i+1,r\}, te=𝖿(te1,te2)t_{e}={\sf f}(t^{1}_{e},t^{2}_{e}). So we can rewrite the LHS of R9 to the RHS to get a valid proof. Note that we can apply 𝗉𝗋𝗈𝗃{\sf proj} on t1ti{{t_{1}}\bowtie{t_{i}}} in the transformed proof since all components of t1t_{1} and tit_{i} are abstractable – for t1t_{1} this is true because the 𝗉𝗋𝗈𝗃{\sf proj} rule was applied to t1tr{{t_{1}}\bowtie{t_{r}}} in the proof on the LHS; and for tit_{i} this follows from the fact that πi1\pi^{1}_{i} (resp. πi2\pi^{2}_{i}) derives ti1ti+11{{t^{1}_{i}}\bowtie{t^{1}_{i+1}}} (resp. ti2ti+12{{t^{2}_{i}}\bowtie{t^{2}_{i+1}}}), and so by Lemma 15, T𝑑𝑦{ti1,ti2}T\vdash_{\mathit{dy}}\{t^{1}_{i},t^{2}_{i}\}. For a similar reason, we can apply 𝗉𝗋𝗈𝗃{\sf proj} on ti+1tr{{t_{i+1}}\bowtie{t_{r}}}.

Theorem 45.

If (T;E)𝑒𝑞α(T;E)\vdash_{\mathit{eq}}\alpha then there is a normal proof of (T;E)α(T;E)\vdash\alpha in the 𝑒𝑞\vdash_{\mathit{eq}} system.

Proof.

Let π\pi be any proof of (T;E)α(T;E)\vdash\alpha such that all DY subproofs of π\pi are normal. Suppose we repeatedly apply the transformations of Table 3 starting with π\pi and reach a proof ϖ\varpi on which we can no longer apply any of the rules. Then ϖ\varpi satisfies clauses 1 to 6 in the definition of normal proofs (since none of the rewrite rules, in particular R1–R7 and R10–R11, apply to ϖ\varpi).

Clause 7 is also satisfied by ϖ\varpi, for the following reason. Suppose a subproof ϖ1\varpi_{1} ends in 𝗉𝗋𝗈𝗃{\sf proj} and ϖ2\varpi_{2} is a maximal subproof of ϖ1\varpi_{1} ending in 𝖼𝗈𝗇𝗌{\sf cons}. ϖ2\varpi_{2} is a proper subproof of ϖ1\varpi_{1}, so there has to be a subproof of ϖ1\varpi_{1} of the form ρ=𝗋(ϖ2)\rho={\sf r}(\cdots\varpi_{2}\cdots). Since 𝖼𝗈𝗇𝗌{\sf cons} appears as the rule above 𝗋{\sf r}, a priori, 𝗋{\sf r} can only be one of {𝗌𝗒𝗆,𝗍𝗋𝖺𝗇𝗌,𝗉𝗋𝗈𝗃,𝖼𝗈𝗇𝗌}\{{\sf sym},{\sf trans},{\sf proj},{\sf cons}\}. But since ϖ2\varpi_{2} is a maximal subproof of ϖ1\varpi_{1} ending in 𝖼𝗈𝗇𝗌{\sf cons}, 𝗋𝖼𝗈𝗇𝗌{\sf r}\neq{\sf cons}. Since R4 and R8 cannot be applied on ϖ\varpi, 𝗋{𝗌𝗒𝗆,𝗉𝗋𝗈𝗃}{\sf r}\notin\{{\sf sym},{\sf proj}\}. But if 𝗋=𝗍𝗋𝖺𝗇𝗌{\sf r}={\sf trans}, then ρ\rho is a proper subproof of ϖ1\varpi_{1}. In particular, it is the immediate subproof of some ρ=𝗋(ρ)\rho^{\prime}={\sf r}^{\prime}(\cdots\rho\cdots). Now 𝗋{\sf r}^{\prime} cannot be 𝗌𝗎𝖻𝗌𝗍{\sf subst}, since then 𝖼𝗈𝗇𝖼(ρ){\sf conc}(\rho^{\prime}) is a list membership assertion, which cannot occur in a proof ending in 𝗉𝗋𝗈𝗃{\sf proj}. 𝗋𝖼𝗈𝗇𝗌{\sf r}^{\prime}\neq{\sf cons}, as that would violate the maximality of ϖ2\varpi_{2}. 𝗋{𝗌𝗒𝗆,𝗍𝗋𝖺𝗇𝗌,𝗉𝗋𝗈𝗃}{\sf r}^{\prime}\notin\{{\sf sym},{\sf trans},{\sf proj}\}, since then one of the rewrite rules R4, R6, R8 would apply to ϖ\varpi. We have ruled out all possible cases for 𝗋{\sf r}^{\prime}, and thus we are forced to conclude that ϖ2\varpi_{2} cannot be a subproof of ϖ1\varpi_{1}. Thus, 𝖼𝗈𝗇𝗌{\sf cons} does not occur in any subproof of ϖ\varpi ending in 𝗉𝗋𝗈𝗃{\sf proj}, and ϖ\varpi satisfies all the clauses in the definition of normal proofs.

We next show that we can always reach a stage where no transformation is enabled. To begin with, apply the rules R2–R4 until the premise of each occurrence of 𝗌𝗒𝗆{\sf sym} is the conclusion of an 𝖺𝗑{\sf ax} or a 𝗉𝗋𝗈𝗆{\sf prom}. None of the other rules converts a proof ending in 𝖺𝗑{\sf ax} or 𝗉𝗋𝗈𝗆{\sf prom} to one which does not, so the above property is preserved even if we apply the other rules in any order.

Associate three sizes to an 𝑒𝑞\vdash_{\mathit{eq}}-proof π\pi:

  • δ1(π)\delta_{1}(\pi) is the sum of the sizes of the 𝑑𝑦\vdash_{\mathit{dy}} subproofs of π\pi,

  • δ2(π)\delta_{2}(\pi) is the number of 𝖼𝗈𝗇𝗌{\sf cons} rules that occur in π\pi, and

  • δ3(π)\delta_{3}(\pi) is the size of the proof π\pi (number of nodes in the proof tree).

We also define δ(π)(δ1(π),δ2(π),δ3(π))\delta(\pi)\coloneqq(\delta_{1}(\pi),\delta_{2}(\pi),\delta_{3}(\pi)).

We now show that if π\pi^{\prime} is obtained from π\pi by one application of any of the transformation rules other than R2–R4, δ(π)<δ(π)\delta(\pi^{\prime})<\delta(\pi).

  • If R1 is applied, δ1(π)<δ1(π)\delta_{1}(\pi^{\prime})<\delta_{1}(\pi) and so δ(π)<δ(π)\delta(\pi^{\prime})<\delta(\pi).

  • If R7 or R9 is applied, we have δ1(π)δ1(π)\delta_{1}(\pi^{\prime})\leq\delta_{1}(\pi) and δ2(π)<δ2(π)\delta_{2}(\pi^{\prime})<\delta_{2}(\pi). Therefore, δ(π)<δ(π)\delta(\pi^{\prime})<\delta(\pi).

  • If R5, R6, R8, R10 or R11 is applied, we have that δi(π)δi(π)\delta_{i}(\pi^{\prime})\leq\delta_{i}(\pi) for i{1,2}i\in\{1,2\} and δ3(π)<δ3(π)\delta_{3}(\pi^{\prime})<\delta_{3}(\pi). So δ(π)<δ(π)\delta(\pi^{\prime})<\delta(\pi).

Thus, once we apply R2–R4 till they can no longer be applied, we cannot have an infinite sequence of transformations starting from any π\pi. Hence, every proof π\pi can be transformed into a normal proof ϖ\varpi with the same conclusion. ∎

We state and prove the subterm property next.

Theorem 46.

For any normal proof π\pi of T;E𝑒𝑞αT;E\vdash_{\mathit{eq}}\alpha,
𝗍𝖾𝗋𝗆𝗌(π)𝗌𝗍(T)𝗌𝗍(E{α}){\sf terms}(\pi)\subseteq{\sf st}(T)\cup{\sf st}(E\cup\{\alpha\}), and
𝗅𝗂𝗌𝗍𝗌(π)𝗅𝗂𝗌𝗍𝗌(E{α}){[n]n𝗌𝗍(T)𝗌𝗍(E{α})}{\sf lists}(\pi)\subseteq{\sf lists}(E\cup\{\alpha\})\cup\{[n]\mid n\in{\sf st}(T)\cup{\sf st}(E\cup\{\alpha\})\}. If π\pi does not contain 𝖼𝗈𝗇𝗌{\sf cons}, then 𝗍𝖾𝗋𝗆𝗌(π)𝗌𝗍(T)𝗌𝗍(E){\sf terms}(\pi)\subseteq{\sf st}(T)\cup{\sf st}(E) . Also, if π\pi does not end in 𝗐𝗄{\sf wk} and does not end in 𝗂𝗇𝗍{\sf int}, then 𝗅𝗂𝗌𝗍𝗌(π)𝗅𝗂𝗌𝗍𝗌(E){[n]n𝗌𝗍(T)𝗌𝗍(E)}{\sf lists}(\pi)\subseteq{\sf lists}(E)\cup\{[n]\mid n\in{\sf st}(T)\cup{\sf st}(E)\}.

We implicitly use the following easily provable facts.

  1. (F1)

    If a normal proof π\pi ends in 𝗍𝗋𝖺𝗇𝗌{\sf trans} and an immediate subproof ϖ\varpi does not end in 𝖼𝗈𝗇𝗌{\sf cons}, then 𝖼𝗈𝗇𝗌{\sf cons} does not occur in ϖ\varpi.

  2. (F2)

    If a normal proof π\pi derives a list membership assertion, 𝖼𝗈𝗇𝗌{\sf cons} does not occur in π\pi.

Proof.

Let 𝗋{\sf r} be the last rule of π\pi. We have the following cases. We mention 𝗅𝗂𝗌𝗍𝗌(π){\sf lists}(\pi) only in cases where the rules involve lists.

  • 𝗋=𝖺𝗑{\sf r}={\sf ax}: αE\alpha\in E, so 𝗍𝖾𝗋𝗆𝗌(π)𝗌𝗍(E){\sf terms}(\pi)\subseteq{\sf st}(E) and 𝗅𝗂𝗌𝗍𝗌(π)𝗅𝗂𝗌𝗍𝗌(E){\sf lists}(\pi)\subseteq{\sf lists}(E).

  • 𝗋=𝖾𝗊{\sf r}={\sf eq}: α\alpha is tt{{t}\bowtie{t}} and T𝑑𝑦tT\vdash_{\mathit{dy}}t. Since π\pi is a normal proof whose 𝑑𝑦\vdash_{\mathit{dy}} subproofs are also normal, T𝑑𝑦tT\vdash_{\mathit{dy}}t via a proof ending in a destructor rule, and by subterm property for 𝑑𝑦\vdash_{\mathit{dy}}, it follows that t𝗌𝗍(T)t\in{\sf st}(T). Thus 𝗍𝖾𝗋𝗆𝗌(π)={t}𝗌𝗍(T){\sf terms}(\pi)=\{t\}\subseteq{\sf st}(T).

  • 𝗋=𝗌𝗒𝗆{\sf r}={\sf sym}: 𝗍𝖾𝗋𝗆𝗌(π)=𝗍𝖾𝗋𝗆𝗌(π){\sf terms}(\pi)={\sf terms}(\pi^{\prime}), where π\pi^{\prime} is the immediate subproof, and the statement follows by IH.

  • 𝗋=𝖼𝗈𝗇𝗌{\sf r}={\sf cons}: α\alpha is 𝖿(t1,t2)𝖿(u1,u2){{{\sf f}(t_{1},t_{2})}\bowtie{{\sf f}(u_{1},u_{2})}}, and for i{1,2}i\in\{1,2\}, there is a subproof πi\pi_{i} with conclusion tiui{{t_{i}}\bowtie{u_{i}}}. By IH, 𝗍𝖾𝗋𝗆𝗌(πi)𝗌𝗍(T{ti,ui})𝗌𝗍(E)𝗌𝗍(T)𝗌𝗍(E{α}){\sf terms}(\pi_{i})\subseteq{\sf st}(T\cup\{t_{i},u_{i}\})\cup{\sf st}(E)\subseteq{\sf st}(T)\cup{\sf st}(E\cup\{\alpha\}) for i{1,2}i\in\{1,2\}. Thus 𝗍𝖾𝗋𝗆𝗌(π)𝗌𝗍(T)𝗌𝗍(E{α}){\sf terms}(\pi)\subseteq{\sf st}(T)\cup{\sf st}(E\cup\{\alpha\}).

  • 𝗋=𝗍𝗋𝖺𝗇𝗌{\sf r}={\sf trans}: Suppose the subproofs of π\pi are π1\pi_{1} through πk1\pi_{k-1} with conclusions t1t2{{t_{1}}\bowtie{t_{2}}} through tk1tk{{t_{k-1}}\bowtie{t_{k}}} respectively, and α=t1tk\alpha={{t_{1}}\bowtie{t_{k}}}. Since π\pi is a normal proof, no two adjacent premises of 𝗋{\sf r} are obtained by 𝖼𝗈𝗇𝗌{\sf cons}, and no premise of 𝗋{\sf r} is obtained by 𝗍𝗋𝖺𝗇𝗌{\sf trans}. The following cases arise.

    • r{t1,tk}r\in\{t_{1},t_{k}\}. In this case, r𝗌𝗍(α)r\in{\sf st}(\alpha).

    • r𝗍𝖾𝗋𝗆𝗌(πi)r\in{\sf terms}(\pi_{i}), where πi\pi_{i} does not end in 𝖼𝗈𝗇𝗌{\sf cons}. By (F1), 𝖼𝗈𝗇𝗌{\sf cons} does not occur in πi\pi_{i}. By IH, r𝗌𝗍(T)𝗌𝗍(E)r\in{\sf st}(T)\cup{\sf st}(E).

    • r𝗍𝖾𝗋𝗆𝗌(πi)r\in{\sf terms}(\pi_{i}), where πi\pi_{i} ends in 𝖼𝗈𝗇𝗌{\sf cons}, and 1<i<k11<i<k-1. Both πi1\pi_{i-1} and πi+1\pi_{i+1} end in a rule other than 𝖼𝗈𝗇𝗌{\sf cons}, by normality of π\pi. So, by (F1), 𝖼𝗈𝗇𝗌{\sf cons} does not occur in πi1\pi_{i-1} and πi+1\pi_{i+1}, and ti,ti+1𝗍𝖾𝗋𝗆𝗌(πi1)𝗍𝖾𝗋𝗆𝗌(πi+1)𝗌𝗍(T)𝗌𝗍(E)t_{i},t_{i+1}\in{\sf terms}(\pi_{i-1})\cup{\sf terms}(\pi_{i+1})\subseteq{\sf st}(T)\cup{\sf st}(E) (by IH on πi1\pi_{i-1} and πi+1\pi_{i+1}). So, by applying IH on πi\pi_{i}, we get r𝗌𝗍(T)𝗌𝗍(E{titi+1})𝗌𝗍(T)𝗌𝗍(E)r\in{\sf st}(T)\cup{\sf st}(E\cup\{{{t_{i}}\bowtie{t_{i+1}}}\})\subseteq{\sf st}(T)\cup{\sf st}(E).

    • r𝗍𝖾𝗋𝗆𝗌(π1)r\in{\sf terms}(\pi_{1}), where π1\pi_{1} ends in 𝖼𝗈𝗇𝗌{\sf cons}. By normality of π\pi, we see that π2\pi_{2} ends in a rule other than 𝖼𝗈𝗇𝗌{\sf cons}. So 𝖼𝗈𝗇𝗌{\sf cons} does not occur in π2\pi_{2}. By IH on π2\pi_{2}, t2𝗍𝖾𝗋𝗆𝗌(π2)𝗌𝗍(T)𝗌𝗍(E)t_{2}\in{\sf terms}(\pi_{2})\subseteq{\sf st}(T)\cup{\sf st}(E). By IH on π1\pi_{1}, r𝗌𝗍(T{t1,t2})𝗌𝗍(E)𝗌𝗍(T)𝗌𝗍(E{α})r\in{\sf st}(T\cup\{t_{1},t_{2}\})\cup{\sf st}(E)\subseteq{\sf st}(T)\cup{\sf st}(E\cup\{\alpha\}).

    • r𝗍𝖾𝗋𝗆𝗌(πk1)r\in{\sf terms}(\pi_{k-1}), where πk1\pi_{k-1} ends in 𝖼𝗈𝗇𝗌{\sf cons}. The proof is similar to the above.

  • 𝗋=𝗉𝗋𝗈𝗃{\sf r}={\sf proj}: Let α=tu\alpha={{t}\bowtie{u}}, got from a proof π\pi^{\prime} with conclusion ab{{a}\bowtie{b}}. Since π\pi is normal, 𝖼𝗈𝗇𝗌{\sf cons} does not occur in π\pi (or in π\pi^{\prime}). By IH, a,b𝗍𝖾𝗋𝗆𝗌(π)𝗌𝗍(T)𝗌𝗍(E)a,b\in{\sf terms}(\pi^{\prime})\subseteq{\sf st}(T)\cup{\sf st}(E). Since t,u𝗌𝗍({a,b})t,u\in{\sf st}(\{a,b\}), we have 𝗍𝖾𝗋𝗆𝗌(π)𝗌𝗍(T)𝗌𝗍(E){\sf terms}(\pi)\subseteq{\sf st}(T)\cup{\sf st}(E).

  • 𝗋=𝗉𝗋𝗈𝗆{\sf r}={\sf prom}: α\alpha is tu{{t}\bowtie{u}}, and the immediate subproof π\pi^{\prime} proves t[u]t\twoheadleftarrow{[u]}. π\pi^{\prime} does not contain 𝖼𝗈𝗇𝗌{\sf cons}, and so by IH, 𝗍𝖾𝗋𝗆𝗌(π)=𝗍𝖾𝗋𝗆𝗌(π)𝗌𝗍(T)𝗌𝗍(E){\sf terms}(\pi)={\sf terms}(\pi^{\prime})\subseteq{\sf st}(T)\cup{\sf st}(E). Note that 𝗅𝗂𝗌𝗍𝗌(π)𝗅𝗂𝗌𝗍𝗌(π){[u]}{\sf lists}(\pi)\subseteq{\sf lists}(\pi^{\prime})\cup\{[u]\}, so the statement about lists is also true.

  • 𝗋=𝗐𝗄{\sf r}={\sf wk}: Let π\pi^{\prime} be the immediate subproof. The result follows from IH and the fact that 𝗅𝗂𝗌𝗍𝗌(π)=𝗅𝗂𝗌𝗍𝗌(π)𝗅𝗂𝗌𝗍𝗌(α){\sf lists}(\pi)={\sf lists}(\pi^{\prime})\cup{\sf lists}(\alpha).

  • 𝗋=𝗂𝗇𝗍{\sf r}={\sf int}: All terms in the conclusion appear in some proper subproof, so the statement on terms follows by IH. None of the subproofs ends in 𝗂𝗇𝗍{\sf int} or 𝗐𝗄{\sf wk} (and does not contain 𝖼𝗈𝗇𝗌{\sf cons}). Thus 𝗅𝗂𝗌𝗍𝗌(π)𝗅𝗂𝗌𝗍𝗌(E){[n]n𝗌𝗍(T)𝗌𝗍(E)]{\sf lists}(\pi^{\prime})\subseteq{\sf lists}(E)\cup\{[n]\mid n\in{\sf st}(T)\cup{\sf st}(E)], for every subproof π\pi^{\prime}. It follows that 𝗅𝗂𝗌𝗍𝗌(π)𝗅𝗂𝗌𝗍𝗌(E{α}){[n]n𝗌𝗍(T)𝗌𝗍(E{α})}{\sf lists}(\pi)\subseteq{\sf lists}(E\cup\{\alpha\})\cup\{[n]\mid n\in{\sf st}(T)\cup{\sf st}(E\cup\{\alpha\})\}.

  • 𝗋=𝗌𝗎𝖻𝗌𝗍{\sf r}={\sf subst}: Let the major premise be tt\twoheadleftarrow{\ell} and the minor premise be tu{{t}\bowtie{u}}. Both t,ut,u are from 𝒱𝒩\mathscr{V}\cup\mathscr{N}, and thus are in 𝗌𝗍(T)𝗌𝗍(E){\sf st}(T)\cup{\sf st}(E). The result follows from IH.

  • 𝗋=𝗌𝖺𝗒{\sf r}={\sf say}: Let the major premise be β\beta and the minor premise be 𝑠𝑘a\mathit{sk}_{a}. Since T𝑑𝑦𝑠𝑘aT\vdash_{\mathit{dy}}\mathit{sk}_{a}, 𝑠𝑘a𝗌𝗍(T)\mathit{sk}_{a}\in{\sf st}(T). And 𝗍𝖾𝗋𝗆𝗌(π)𝗌𝗍(T)𝗌𝗍(E)𝗌𝗍(β){𝑝𝑘a}𝗌𝗍(T)𝗌𝗍(E{α}){\sf terms}(\pi)\subseteq{\sf st}(T)\cup{\sf st}(E)\cup{\sf st}(\beta)\cup\{\mathit{pk}_{a}\}\subseteq{\sf st}(T)\cup{\sf st}(E\cup\{\alpha\}). ∎