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

[a] [a] [b] [a] [c]

Knowledge Problems in Protocol Analysis:
Extending the Notion of Subterm Convergent

Carter Bunch Saraid Dwyer Satterfield Serdar Erbatur\lmcsorcid0000-0002-7574-195X Andrew M. Marshall\lmcsorcid0000-0002-0522-8384  and  Christophe Ringeissen\lmcsorcid0000-0002-5937-6059 University of Mary Washington, Fredericksburg, VA, USA University of Texas at Dallas, Richardson, TX, USA Université de Lorraine, CNRS, Inria, LORIA, F-54000 Nancy, France
Abstract.

We introduce a new form of restricted term rewrite system, the graph-embedded term rewrite system. These systems, and thus the name, are inspired by the graph minor relation and are more flexible extensions of the well-known homeomorphic-embedded property of term rewrite systems. As a motivating application area, we consider the symbolic analysis of security protocols, and more precisely the two knowledge problems defined by the deduction problem and the static equivalence problem. In this field restricted term rewrite systems, such as subterm convergent ones, have proven useful since the knowledge problems are decidable for such systems. Many of the same decision procedures still work for examples of systems which are “beyond subterm convergent”. However, the applicability of the corresponding decision procedures to these examples must often be proven on an individual basis. This is due to the problem that they don’t fit into an existing syntactic definition for which the procedures are known to work. Here we show that many of these systems belong to a particular subclass of graph-embedded convergent systems, called contracting convergent systems. On the one hand, we show that the knowledge problems are decidable for the subclass of contracting convergent systems. On the other hand, we show that the knowledge problems are undecidable for the class of graph-embedded systems. Going further, we compare and contrast these graph embedded systems with several notions and properties already known in the protocol analysis literature. Finally, we provide several combination results, both for the combination of multiple contracting convergent systems, and then for the combination of contracting convergent systems with particular permutative equational theories.

Key words and phrases:
Term Rewriting, Security Protocols, Deduction, Static Equivalence
We would like to thank the anonymous reviewers of this article for their helpful comments, feedback, and suggestions. Their input has improved the paper. We also thank Paliath Narendran for his helpful input.

1. Introduction

In this paper we introduce a new form of term rewrite system, called the graph-embedded term rewrite systems, and motivate the study and use of such rewrite systems by demonstrating their usefulness in the application of security protocols.

The research area of cryptographic protocol analysis contains a number of innovative algorithms and procedures for checking various security properties of protocols, see for example [AC06, BCD13, CCcCK16, cCDK12, DDKS17]. These procedures consider protocols modeled in a symbolic way, typically via a rewrite system or equational theory. Often the procedure is proven sound and complete for specific classes of theories. One of the most common classes are those theories that can be represented by subterm convergent term rewrite systems. That is, term rewrite systems where the right-hand side of the rules are strict subterms of the left-hand side or a constant. For example, see the procedures developed in [AC06, cCDK12]. Interestingly, many of these same procedures also work for theories that are “beyond subterm convergent”. That is, they are not strictly subterm convergent. However, since these examples don’t fit into a known class of theories for which soundness and completeness proofs already exist, they must be proven on an individual bases. For example, the procedures of [AC06, BCD13, CCcCK16, cCDK12, DDKS17] are shown to work on the theory of blind signatures, see Example 1 below. However, the theory is not subterm convergent, notice in the final rule, 𝑢𝑛𝑏𝑙𝑖𝑛𝑑(𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z),y)𝑠𝑖𝑔𝑛(x,z)\mathit{unblind}(\mathit{sign}(\mathit{blind}(x,y),z),y)\rightarrow\mathit{sign}(x,z), that 𝑠𝑖𝑔𝑛(x,z)\mathit{sign}(x,z) is not a strict subterm of 𝑢𝑛𝑏𝑙𝑖𝑛𝑑(𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z),y)\mathit{unblind}(\mathit{sign}(\mathit{blind}(x,y),z),y). Thus, in each case a unique proof is needed to show applicability of the procedure on the theory of blind signatures. Several additional examples of beyond subterm theories are given throughout this paper. This begs the question of whether there is a syntactic definition of a class of term rewrite systems such that the definition encapsulates these beyond subterm examples yet still maintains some of the useful properties needed to ensure applicability of the above procedures.

In this paper we answer the question in the positive by introducing first graph-embedded term rewrite systems and then a particular subclass called contracting rewrite systems. These systems are inspired by the notions of graph embeddings and graph minors. Here we are able to translate the notion to term rewrite systems. This translation is done in a very similar fashion to what has been done with homeomorphic embeddings. We are able to provide a rewrite schema which induces graph-embedded systems in a similar way in which homeomorphic-embedded systems are induced by a rewrite system (see [BN98] for more details). To the best of our knowledge these systems have not been explored before. We then explore some of the properties of these new systems. Interestingly, the graph-embedded systems encompass most of the beyond subterm examples from many of the protocol analysis procedure papers [AC06, BCD13, CCcCK16, cCDK12, DDKS17]. As an initial step, in this paper we concentrate on the knowledge problems considered in [AC06] using the notion of locally stable theories. Local stability is a desirable property which ensures the decidability of the critical symbolic security question of deducibility. In the class of graph-embedded convergent systems, we are now able to identify a particular subclass called the contracting convergent systems, which are beyond subterm convergent, encompass most of the beyond subterm examples of [AC06, BCD13, CCcCK16, cCDK12, DDKS17], and are locally stable. As a consequence, the knowledge problems of deduction and static equivalence are decidable for the subclass of contracting convergent systems. We show that the knowledge problems are undecidable for the class of graph-embedded convergent systems in general. Going further, we also compare the graph-embedded systems to the Finite Variant Property (FVP), another useful property in protocol analysis, and show that the two do not define the same set of term rewrite systems but that a sub-class of graph embedding system, a restricted form of the contracting systems, can be defined which always guarantees the FVP. We consider the cap problem [ANR07a], a related knowledge problem, showing it is also decidable for contracting systems, when certain signature requirements are met. In addition to the procedure in [AC06] we also investigate graph-embedded term rewrite systems with the YAPA procedure [BCD13], showing that contracting graph-embedded term rewrite systems have the layered property, an important property for guaranteeing success of the YAPA procedure. Lastly we present several combination results for contracting convergent term rewrite systems.

This paper represents an exploration of graph-embedded term rewrite systems and their application to protocol analysis. We hope that the formulation proves useful in areas beyond security protocols as homeomorphic embeddings have proven useful in many areas. We conclude the paper with a discussion of several open questions related to graph-embedded systems.

An initial version of these results was presented in [SEMR23]. The current paper expands on [SEMR23] by including a number of new results and answering several questions left open in [SEMR23], specifically:

  • We consider the cap problem, left open in [SEMR23], showing new decidability results (see Section 6.1).

  • We expand on the FVP results of [SEMR23] by including new positive results (see Section 6.2).

  • We answer a question on graph-embedded systems and the YAPA procedure left open in [SEMR23], showing that a restricted form of graph embedded systems are layered (see Section 6.3).

  • We have included new combination results between contracting convergent systems, which were not considered in [SEMR23] (see Section 7).

  • Finally, we have made several improvements on the material of [SEMR23]. We have simplified the definition of contracting convergent TRS, making the definition easier to understand. We have also fixed an issue with the proof of the undecidability of the knowledge problems in graph-embedded systems presented in [SEMR23], correcting a problem that allowed trivial solutions.

Paper Outline.

The remainder of the paper is organized as follows. Section 2 contains the preliminaries, introducing the necessary background material on term-rewrite systems, graph theory and security protocol analysis. Section 3 introduces the graph-embedded term rewrite systems and explores some of their basic properties. Then, the next sections are related to the motivating application area of this paper for graph-embedded systems, security protocol analysis. The knowledge problems are shown to be undecidable for the class of graph-embedded convergent systems (Section 4) and decidable for the subclass of contracting convergent systems (Section 5). Section 6 considers the relation to the cap problem, to the FVP, and to the YAPA procedure. Section 7 considers the combination question in contracting convergent systems. Finally, Section 8 contains the concluding remarks, future work, and open problems.

2. Preliminaries

We use the standard notation of equational unification [BS01] and term rewriting systems [BN98]. Given a first-order signature Σ\Sigma and a (countable) set of variables VV, the Σ\Sigma-terms over variables VV are built in the usual way by taking into account the arity of each function symbol in Σ\Sigma. Arity 0 function symbols are called constants. Each Σ\Sigma-term is well-formed: if it is rooted by a nn-ary function symbol in Σ\Sigma, then it has necessarily nn direct subterms. The set of Σ\Sigma-terms over variables VV is denoted by T(Σ,V)T(\Sigma,V). The set of variables (resp., constants) from VV (resp., Σ\Sigma) occurring in a term tT(Σ,V)t\in T(\Sigma,V) is denoted by 𝑉𝑎𝑟(t)\mathit{Var}(t) (resp., 𝐶𝑠𝑡(t)\mathit{Cst}(t)). A term tt is ground if 𝑉𝑎𝑟(t)=\mathit{Var}(t)=\emptyset. A Σ\Sigma-rooted term is a term whose root symbol is in Σ\Sigma. For any position pp in a term tt (including the root position ϵ\epsilon), t(p)t(p) is the symbol at position pp, t|pt|_{p} is the subterm of tt at position pp, and t[u]pt[u]_{p} is the term tt in which t|pt|_{p} is replaced by uu. A substitution is an endomorphism of T(Σ,V)T(\Sigma,V) with only finitely many variables not mapped to themselves. A substitution is denoted by σ={x1t1,,xmtm}\sigma=\{x_{1}\mapsto t_{1},\dots,x_{m}\mapsto t_{m}\}, where the domain of σ\sigma is Dom(σ)={x1,,xm}Dom(\sigma)=\{x_{1},\dots,x_{m}\} and the range of σ\sigma is Ran(σ)={t1,,tm}Ran(\sigma)=\{t_{1},\dots,t_{m}\}. Application of a substitution σ\sigma to tt is written tσt\sigma.

The size of a term tt, denoted by |t||t|, is defined inductively as follows: |f(t1,,tn)|=1+Σi=1n|ti||f(t_{1},\dots,t_{n})|=1+\Sigma_{i=1}^{n}|t_{i}| if ff is a nn-ary function symbol with n1n\geq 1, |c|=1|c|=1 if cc is a constant, and |x|=1|x|=1 if xx is a variable. The depth of a term tt, denoted by depth(t)depth(t), is defined inductively as follows: depth(f(t1,,tn))=1+maxi=1,,ndepth(ti)depth(f(t_{1},\dots,t_{n}))=1+\max_{i=1,\dots,n}depth(t_{i}) if ff a nn-ary function symbol with n1n\geq 1, depth(c)=0depth(c)=0 if cc is a constant, and depth(x)=0depth(x)=0 if xx is a variable.

Let VCV_{C} denote a finite set of context variables (sometimes called holes) such that VCV=V_{C}\cap V=\emptyset. We use the notation i\diamond_{i} to represent the context variable iVC\diamond_{i}\in V_{C}. A context is a linear term containing only context variables. More formally, a context is a term, CT(Σ,VC)C\in T(\Sigma,V_{C}), where each variable (context hole) occurs at most once. Thus, the size of a context follows from the size of a term, where any hole occurrence counts for 11. Given a context CC with mm variables and mm terms S1,,SmT(Σ,V)S_{1},\dots,S_{m}\in T(\Sigma,V), C[S1,,Sm]C[S_{1},\dots,S_{m}] denotes the term C{1S1,,mSm}C\{\diamond_{1}\mapsto S_{1},\dots,\diamond_{m}\mapsto S_{m}\} where for i=1,,mi=1,\dots,m, i\diamond_{i} denotes the ii-th context variable occurring in the term CC, and CC is called the context part of C[S1,,Sm]C[S_{1},\dots,S_{m}]. When S1,,Sm𝒮S_{1},\dots,S_{m}\in\mathcal{S}, C[S1,,Sm]C[S_{1},\dots,S_{m}] is said to be a context instantiated with terms in 𝒮\mathcal{S}. Given a positive integer nn, C[S1,,Sm]C[S_{1},\dots,S_{m}] is said to be small (with respect to nn) if its context part CC satisfies |C|n|C|\leq n.

Equational Theories

Given a set EE of Σ\Sigma-axioms (i.e., pairs of terms in T(Σ,V)T(\Sigma,V), denoted by l=rl=r), the equational theory =E=_{E} is the congruence closure of EE under the law of substitutivity (by a slight abuse of terminology, EE is often called an equational theory). Equivalently, =E=_{E} can be defined as the reflexive transitive closure E\leftrightarrow_{E}^{*} of an equational step E\leftrightarrow_{E} defined as follows: sEts\leftrightarrow_{E}t if there exist a position pp of ss, l=rl=r (or r=lr=l) in EE, and substitution σ\sigma such that s|p=lσs|_{p}=l\sigma and t=s[rσ]pt=s[r\sigma]_{p}. An equational theory EE is said to be permutative if for any l=rl=r in EE, the number of occurrences of any (function or variable) symbol in ll is equal to the number of occurrences of that symbol in rr. Well-known theories such as Associativity (A={(x+y)+z=x+(y+z)}A=\{(x+y)+z=x+(y+z)\}), Commutativity (C={x+y=y+x}C=\{x+y=y+x\}), and Associativity-Commutativity (AC=ACAC=A\cup C) are permutative theories. A theory EE is said to be shallow if variables can only occur at a depth at most 11 in axioms of EE. For example, CC is shallow but AA and ACAC are not.

Rewrite Relations

A term rewrite system (TRS) is a pair (Σ,R)(\Sigma,R), where Σ\Sigma is a signature and RR is a finite set of rewrite rules of the form lrl\rightarrow r such that l,rl,r are Σ\Sigma-terms, ll is not a variable and 𝑉𝑎𝑟(r)𝑉𝑎𝑟(l)\mathit{Var}(r)\subseteq\mathit{Var}(l). A function symbol ff is a constructor for RR if {f}{l(ϵ)|lrR}=\{f\}\cap\{l(\epsilon)~|~l\rightarrow r\in R\}=\emptyset. A term ss rewrites to a term tt w.r.t RR, denoted by sRts\rightarrow_{R}t (or simply sts\rightarrow t), if there exist a position pp of ss, lrRl\rightarrow r\in R, and substitution σ\sigma such that s|p=lσs|_{p}=l\sigma and t=s[rσ]pt=s[r\sigma]_{p}. If the rewrite step occurs at the root position (resp., at some non-rooted position) of the term ss we denote this as sRϵts\rightarrow_{R}^{\epsilon}t (resp., sRϵRts\stackrel{{\scriptstyle\neq\epsilon}}{{\rightarrow_{R}}}t). When σ\sigma is a variable renaming, we say that ss rewrites to tt applying a variable instance of lrl\rightarrow r. The reflexive transitive closure of R\rightarrow_{R} is denoted by R\rightarrow_{R}^{*}. We write R0,1\rightarrow_{R}^{0,1} to denote 0 or 11 rewrite step w.r.t RR. The composition of relations is denoted by the (.)(.) operator; for instance, R.R\rightarrow_{R}.\rightarrow_{R} is defined as follows: for any s,us,u, sR.Rus\rightarrow_{R}.\rightarrow_{R}u if there exists some tt such that sRtRus\rightarrow_{R}t\rightarrow_{R}u. A TRS RR is terminating if there are no infinite rewriting sequences with respect to R\rightarrow_{R}. A TRS RR is confluent if, whenever tRs1t\rightarrow_{R}^{*}s_{1} and tRs2t\rightarrow_{R}^{*}s_{2}, there exists a term ww such that s1Rws_{1}\rightarrow_{R}^{*}w and s2Rws_{2}\rightarrow_{R}^{*}w. A confluent and terminating TRS is called convergent. In a convergent TRS RR, we have the existence and the uniqueness of RR-normal forms, denoted by tRt{\downarrow}_{R} for any term tt. When RR is clear from the context, the normal form of tt may be written tt{\downarrow}. Given a substitution σ\sigma, σ={x(xσ)}xDom(σ)\sigma{\downarrow}=\{x\mapsto(x\sigma){\downarrow}\}_{x\in Dom(\sigma)} is the substitution corresponding to the normal form of σ\sigma. A substitution σ\sigma is in RR-normal form (or RR-normalized) if σ=σ\sigma=\sigma{\downarrow}.

A convergent term rewrite system (TRS) RR is said to be subterm convergent if for any lrRl\rightarrow r\in R, rr is either a strict subterm of ll or a constant. An equational theory, EE, is subterm convergent if it is presented by a subterm convergent TRS. That is, there exists a subterm convergent TRS, RR, such that =E=_{E} and =R=_{R} coincide. By a slight abuse of notation, the equational theory of RR, given by {l=r|lrR}\{l=r~|~l\rightarrow r\in R\}, may also be denoted by RR. The size of a TRS RR is defined as

cR=max{l|lrR}(|l|,ar(R)+1)c_{R}=max_{\{l~|~l\rightarrow r\in R\}}(|l|,ar(R)+1)

where ar(R)ar(R) is the maximal arity of any function symbol occurring in RR.

Remark 1.

We should note that in some papers the definition of subterm convergent is expanded to also include ground terms on the right-hand side. We will use the more classical definition here, allowing only strict subterms and constants on the right-hand side.

{defi}

[Homeomorphic Embedding] The homeomorphic embedding, emb\trianglerighteq_{emb} is a binary relation on terms such that: sembts\trianglerighteq_{emb}t if one of the following conditions hold:

  1. (1)

    s=x=ts=x=t for some variable xx,

  2. (2)

    s=f(s1,,sn)s=f(s_{1},\ldots,s_{n}) and t=f(t1,,tn)t=f(t_{1},\ldots,t_{n}) and s1embt1,,snembtns_{1}\trianglerighteq_{emb}t_{1},\ldots,s_{n}\trianglerighteq_{emb}t_{n},

  3. (3)

    s=f(s1,,sn)s=f(s_{1},\ldots,s_{n}) and siembts_{i}\trianglerighteq_{emb}t for some ii, 1in1\leq i\leq n.

A TRS RR is said to be a homeomorphic-embedded TRS if for any lrRl\rightarrow r\in R, lembrl\trianglerighteq_{emb}r.

More interestingly we can also define emb\trianglerighteq_{emb} as the reduction relation Remb\rightarrow^{*}_{R_{emb}} induced by the rewrite system Remb={f(x1,,xn)xi|f is n-ary,n1,1in}R_{emb}=\{f(x_{1},\ldots,x_{n})\rightarrow x_{i}~|~f\mbox{ is $n$-ary},n\geq 1,~1\leq i\leq n\}.

{exa}

[Blind Signatures] The theory of blind signatures [cCDK12] is a
homeomorphic-embedded convergent TRS:

𝑐ℎ𝑒𝑐𝑘𝑠𝑖𝑔𝑛(𝑠𝑖𝑔𝑛(x,y),𝑝𝑘(y))\displaystyle\mathit{checksign}(\mathit{sign}(x,y),\mathit{pk}(y)) x\displaystyle\rightarrow x
𝑢𝑛𝑏𝑙𝑖𝑛𝑑(𝑏𝑙𝑖𝑛𝑑(x,y),y)\displaystyle\mathit{unblind}(\mathit{blind}(x,y),y) x\displaystyle\rightarrow x
𝑢𝑛𝑏𝑙𝑖𝑛𝑑(𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z),y)\displaystyle\mathit{unblind}(\mathit{sign}(\mathit{blind}(x,y),z),y) 𝑠𝑖𝑔𝑛(x,z)\displaystyle\rightarrow\mathit{sign}(x,z)

Notions of Knowledge

The applied pi calculus and frames are used to model attacker knowledge [AF01]. In this model, the set of messages or terms which the attacker knows, and which could have been obtained from observing a protocol session, are the set of terms in Ran(σ)Ran(\sigma) of the frame ϕ=νn~.σ\phi=\nu\tilde{n}.\sigma, where σ\sigma is a substitution ranging over ground terms. We also need to model cryptographic concepts such as nonces, keys, and publicly known values. We do this by using names, which are constants.

Here also, we need to track the names which the attacker knows, such as public values, and the names which the attacker does not know a priori, such as freshly generated nonces. In a frame νn~.σ\nu\tilde{n}.\sigma, n~\tilde{n} is a finite set of restricted names, these names represent freshly generated names which the attacker doesn’t initially know. The set of names occurring in a term tt is denoted by 𝑓𝑛(t)\mathit{fn}(t). For any frame ϕ=νn~.σ\phi=\nu\tilde{n}.\sigma, let 𝑓𝑛(ϕ)\mathit{fn}(\phi) be the set of names 𝑓𝑛(σ)\n~\mathit{fn}(\sigma)\backslash\tilde{n} where 𝑓𝑛(σ)=tRan(σ)𝑓𝑛(t)\mathit{fn}(\sigma)=\bigcup_{t\in Ran(\sigma)}\mathit{fn}(t); and for any term tt, let tϕt\phi denote by a slight abuse of notation the term tσt\sigma. We say that a term tt satisfies the name restriction (of ϕ\phi) if 𝑓𝑛(t)n~=\mathit{fn}(t)\cap\tilde{n}=\emptyset. Given any convergent TRS RR, the frame ϕ\phi is RR-normalized if σ\sigma is RR-normalized.

{defi}

[Deduction] Let ϕ=νn~.σ\phi=\nu\tilde{n}.\sigma be a frame, and tt a ground term. We say that tt is deduced from ϕ\phi modulo EE, denoted by ϕEt\phi\vdash_{E}t, if there exists a term ζ\zeta such that ζσ=Et\zeta\sigma=_{E}t and 𝑓𝑛(ζ)n~=\mathit{fn}(\zeta)\cap\tilde{n}=\emptyset. The term ζ\zeta is called a recipe of tt in ϕ\phi modulo EE.

Another form of knowledge is the ability to tell if two frames are statically equivalent modulo EE, sometimes also called indistinguishability.

{defi}

[Static Equivalence] Two terms ss and tt are equal in a frame ϕ=νn~.σ\phi=\nu\tilde{n}.\sigma modulo an equational theory EE, denoted (s=Et)ϕ(s=_{E}t)\phi, if sσ=Etσs\sigma=_{E}t\sigma, and n~(𝑓𝑛(s)𝑓𝑛(t))={\tilde{n}}\cap(\mathit{fn}(s)\cup\mathit{fn}(t))=\emptyset. The set of all equalities s=ts=t such that (s=Et)ϕ(s=_{E}t)\phi is denoted by Eq(ϕ)Eq(\phi). Given a set of equalities EqEq, the fact that (s=Et)ϕ(s=_{E}t)\phi for any s=tEqs=t\in Eq is denoted by ϕEq\phi\models Eq. Two frames ϕ=νn~.σ\phi=\nu\tilde{n}.\sigma and ψ=νn~.τ\psi=\nu\tilde{n}.\tau are statically equivalent modulo EE, denoted as ϕEψ\phi\approx_{E}\psi, if Dom(σ)=Dom(τ)Dom(\sigma)=Dom(\tau), ϕEq(ψ)\phi\models Eq(\psi) and ψEq(ϕ)\psi\models Eq(\phi).

Remark 2.

Again the above definition relies on the use of the frame definition from the pi calculus. One can view the set n~\tilde{n} of bound names as those secrets the attack doesn’t have initial knowledge of for any run of the protocol. Each of the frames thus represent runs of the protocols when the attacker can then compare.

The local stability property was introduced in [AC06] and improved in [AFN17] as a collection of conditions which is sufficient to get decidability of deduction thanks to a reduction to deduction modulo the empty theory. A simplified definition of this property is introduced below. It is simplified because we do not consider ACAC-symbols as in [AC06, AFN17]. For the following definition let st(t)st(t) be the set of subterms of a term tt.

{defi}

[Local Stability [AC06]] A convergent TRS, RR, is locally stable if, for every RR-normalized frame ϕ=νn~.σ\phi=\nu\tilde{n}.\sigma, there exists a finite set sat(ϕ)sat(\phi) of ground terms such that:

  • Ran(σ)sat(ϕ)Ran(\sigma)\subseteq sat(\phi) and 𝑓𝑛(ϕ)sat(ϕ)\mathit{fn}(\phi)\subseteq sat(\phi);

  • if M1,,Mksat(ϕ)M_{1},\ldots,M_{k}\in sat(\phi) and f(M1,,Mk)st(sat(ϕ))f(M_{1},\ldots,M_{k})\in st(sat(\phi)), then f(M1,,Mk)sat(ϕ)f(M_{1},\ldots,M_{k})\in sat(\phi);

  • if C[S1,,Sl]RϵMC[S_{1},\ldots,S_{l}]\rightarrow_{R}^{\epsilon}M, where CC is a context with |C|cR|C|\leq c_{R} and 𝑓𝑛(C)n~=\mathit{fn}(C)\cap\tilde{n}=\emptyset, and S1,,Slsat(ϕ)S_{1},\ldots,S_{l}\in sat(\phi), then there exist a context CC^{\prime} and S1,,Sksat(ϕ)S_{1}^{\prime},\ldots,S_{k}^{\prime}\in sat(\phi) such that |C|cR2|C^{\prime}|\leq c_{R}^{2}, 𝑓𝑛(C)n~=\mathit{fn}(C^{\prime})\cap\tilde{n}=\emptyset, and MRC[S1,,Sk]M\rightarrow_{R}^{*}C^{\prime}[S_{1}^{\prime},\ldots,S_{k}^{\prime}];

  • if Msat(ϕ)M\in sat(\phi) then ϕRM\phi\vdash_{R}M.

Beside local stability, the additional property of local finiteness is useful for the decidability of static equivalence. In a locally finite theory, only finitely many equalities have to be checked for static equivalence. Helpfully, in a convergent TRS with no ACAC-symbols, local stability implies local finiteness [AC06]. Since we do not consider ACAC-symbols in this paper, the approach presented in [AC06] leads to the following result:

{thmC}

[[AC06]] The deduction and static equivalence problems are both decidable in any locally stable TRS.

Since any subterm convergent TRS is locally stable, the decidability of both deduction and static equivalence in the class of subterm convergent TRSs follows from Theorem 2. {exa} Let EE be the equational theory presented by the subterm convergent TRS {𝑑𝑒𝑐(𝑒𝑛𝑐(x,y),y)x}\{\mathit{dec}(\mathit{enc}(x,y),y)\rightarrow x\}. Notice that this theory is subterm convergent and contains no AC symbols. Thus, from Theorem 2 static equivalence is decidable. If we are given two frames, ϕ=ν{n}.{v𝑒𝑛𝑐(a,n)}\phi=\nu\{n\}.\{v\mapsto\mathit{enc}(a,n)\} and ψ=ν{n}.{v𝑒𝑛𝑐(b,n)}\psi=\nu\{n\}.\{v\mapsto\mathit{enc}(b,n)\}, then we can apply the saturation based procedure defined in [AC06] to find that these two frames are statically equivalent modulo EE. However, consider now ϕ=ν{n}.{v𝑒𝑛𝑐(a,n),wn}\phi^{\prime}=\nu\{n\}.\{v\mapsto\mathit{enc}(a,n),w\mapsto n\} and ψ=ν{n}.{v𝑒𝑛𝑐(b,n),wn}\psi^{\prime}=\nu\{n\}.\{v\mapsto\mathit{enc}(b,n),w\mapsto n\}. Since 𝑑𝑒𝑐(v,w)=EaEq(ϕ)\mathit{dec}(v,w)=_{E}a\in Eq(\phi^{\prime}) but 𝑑𝑒𝑐(v,w)=EaEq(ψ)\mathit{dec}(v,w)=_{E}a\notin Eq(\psi^{\prime}), ϕ\phi^{\prime} and ψ\psi^{\prime} are not statically equivalent modulo EE.

In this paper, we lift this result to rewrite systems that are beyond the class of subterm convergent rewrite systems.

Term Graphs

Each term tt can be viewed in a graphical representation, called a term graph. Each node in the graph is labeled either by a function symbol or a variable. Each function symbol node also has an associated successor number, corresponding to the arity of the function. Edges connect the nodes of the term graph based on the subterm relation. The notion of term graph is illustrated in Examples 3 and 7.

{defi}

[Term Graph Measures] We introduce some convenient notation:

  • Let 𝑉𝑃(t)\mathit{VP}(t) denote the list of leaf nodes in the term graph of a term tt labeled by a variable. Notice that two distinct nodes could be labeled by the same variable.

  • Let 𝐹𝑃(t)\mathit{FP}(t) denote the list of nodes in the term graph of tt labeled by a function symbol. Notice that two distinct nodes could be labeled by the same function symbol.

  • Let 𝐹𝑆(t)\mathit{FS}(t) denote the set of function symbols in the term tt.

Some Graph Theory

We will also need a few notions from graph theory, we introduce those in this section. We will typically use GG to denote a graph, VV the set of vertices and EV×VE\subseteq V\times V the set of edges of the graph.

{defi}

[Graph Isomorphism] Let G=(V,E)G=(V,E) and G=(V,E)G^{\prime}=(V^{\prime},E^{\prime}) be two graphs. We say that GG and GG^{\prime} are isomorphic, denoted GGG\simeq G^{\prime}, if there exists a bijection ϕ:VV\phi:V\rightarrow V^{\prime} with xyExy\in E iff ϕ(x)ϕ(y)E\phi(x)\phi(y)\in E^{\prime}, x,yV\forall x,y\in V.

{defi}

[Edge Contraction] Let G=(V,E)G=(V,E) and e=xye=xy. G/eG/e is the graph G=(V,E)G^{\prime}=(V^{\prime},E^{\prime}) such that V=(V{x,y}){ve}V^{\prime}=(V\setminus\{x,y\})\cup\{v_{e}\}, where vev_{e} is a new vertex, and E={vwE|{v,w}{x,y}=}{vew|xwE{e} or ywE{e}}E^{\prime}=\{vw\in E~|~\{v,w\}\cap\{x,y\}=\emptyset\}\cup\{v_{e}w~|~xw\in E\setminus\{e\}\text{ or }yw\in E\setminus\{e\}\}.

We say that GG^{\prime} is obtained from GG by contracting the edge ee.

We use the following definition of graph minor which essentially says that a graph minor of a graph GG can be obtained by a series of graph contractions (see [Die06] for more details).

{defi}

[Graph Minor] The graph GG^{\prime} is a graph minor of the graph GG, if there exist graphs G0,G1,,GnG_{0},~G_{1},~\ldots,~G_{n} and edges eiGie_{i}\in G_{i} such that G=G0G=G_{0}, GnGG_{n}\simeq G^{\prime}, and Gi+1=Gi/eiG_{i+1}=G_{i}/e_{i} for i=0,,n1i=0,\ldots,n-1. We use the notation GGG\succcurlyeq G^{\prime} if GG^{\prime} is a graph minor of GG.

Next, we extend the graph minor definition above to terms using term graphs. For terms tt and tt^{\prime}, ttt\succcurlyeq t^{\prime} if for the corresponding term graphs of tt and tt^{\prime}, denoted as GG and GG^{\prime} respectively, we have GGG\succcurlyeq G^{\prime}.

Remark 3.

Note, in the classical definition of graph minor (see [Die06]), if GG is a subgraph of a larger graph GlargeG_{large} and GGG\succcurlyeq G^{\prime}, then also GlargeGG_{large}\succcurlyeq G^{\prime}. However, this component of the definition is not necessary for the results of this paper and by leaving it out we are able to simplify the later definitions and presentation.

The above type of embedding, denoted by \succcurlyeq, provides more flexibility than the traditional subterm relation while still preserving some features we need.

{exa}

Notice that GG^{\prime} is obtained from GG by first applying a sequence of edge contractions, contracting the edge depicted by |||| at each step, resulting in G2G_{2}, and finally G2GG_{2}\simeq G^{\prime}. Therefore, GGG\succcurlyeq G^{\prime}.

G\textstyle{G} G1\textstyle{G_{1}} G2\textstyle{G_{2}} G\textstyle{G^{\prime}}

We can now extend the above graph-theoretic notions to the term rewrite setting.

3. Graph-Embedded Systems

The key to translating from the graph theory setting to the term setting is to use the same method, edge contractions, but then only consider the term graphs representing well-formed terms. That is, we need to enforce the notion of a well formed term.

To begin we need to model the graph isomorphism. A restricted form of isomorphism can be translated into the term rewriting setting by considering permutations.

{defi}

[Leaf and Subterm Permutations] We define two types of permutations, s\approx_{s} and l\approx_{l}:

  1. (1)

    For terms tt and tt^{\prime}, we say tt is subterm permutatively equal to tt^{\prime}, denoted tstt\approx_{s}t^{\prime}, if one of the following is true:

    1. (a)

      t=tt=t^{\prime}, where tt and tt^{\prime} are constants or variables, or

    2. (b)

      t=f(u1,,un)t=f(u_{1},\ldots,u_{n}) and t=f(uσ(1),,uσ(n))t^{\prime}=f(u_{\sigma(1)},\ldots,u_{\sigma(n)}) where ff is a nn-ary function symbol, n1n\geq 1, and σ\sigma is a permutation of the indexes (1,,n)(1,\ldots,n).

  2. (2)

    For terms tt and tt^{\prime}, we say tt is leaf permutatively equal to tt^{\prime}, denoted tltt\approx_{l}t^{\prime}, if t=tσt^{\prime}=t\sigma and σ\sigma is the unique endomorphism of T(ΣV)T(\Sigma\cup V) such that its restriction to 𝑉𝑎𝑟(t)Cst(t)\mathit{Var}(t)\cup Cst(t) is a permutation on 𝑉𝑎𝑟(t)𝐶𝑠𝑡(t)\mathit{Var}(t)\cup\mathit{Cst}(t), and uσ=uu\sigma=u for any constant/variable uu not in 𝑉𝑎𝑟(t)𝐶𝑠𝑡(t)\mathit{Var}(t)\cup\mathit{Cst}(t).

The first type of permutation, s\approx_{s}, allows for permutation inside the term but preserves the layer like structure of the function symbols in the term graph. The second type of permutation in the classical leaf permutability and is restricted to the leaf nodes, i.e., just the variables and constants of the term graph. We will use a combination of the above two permutations in the definition employed for graph-embedded TRS. {defi}[Permutatively Equal] For terms tt and tt^{\prime}, we say tt is permutatively equal to tt^{\prime}, denoted ttt\approx t^{\prime}, if tst′′ltt\approx_{s}t^{\prime\prime}\approx_{l}t^{\prime}, for some term t′′t^{\prime\prime}.

Remark 4.

It is useful here to remark on the motivation of the above definition, \approx. The goal is to model the graph isomorphism property. At the same time one needs to be careful not to be too broad and remove layer preserving properties of Definition 4 and thus later protocol properties such as local stability (see Definition 2). In addition, one cannot be too restricted and disallow working protocol representations such as Example 7 which requires more than just leaf permutability. However, it may be possible to improve upon the above definition and allow for additional systems while still maintaining the decidability of the knowledge problems shown here, see the discussion in Section 8.

The next step is to develop a set of rewrite schemas which preserve a type of graph minor relation on the term graphs. This set of rewrite schemata then induces a graph-embedded term rewrite system. Notice that this is very similar to what is often done when considering the homeomorphic embeddings, see Definition 1.

{defi}

[Graph Embedding] Consider the following reduction relation, Rgemb\rightarrow^{*}_{R_{gemb}}, where RgembR_{gemb} is the set of rules given by the instantiation of the following rule schema:

{for any fΣ(1)f(x1,,xn)xi(2)f(x1,,xi1,xi,xi+1,xn)f(x1,,xi1,xi+1,,xn)and for any f,gΣ(3)f(x1,,xi1,g(z¯),xi+1,,xm)g(x1,,xi1,z¯,xi+1,,xm)(4)f(x1,,xi1,g(z¯),xi+1,,xm)f(x1,,xi1,z¯,xi+1,,xm)}\left\{\begin{array}[]{ll}&\text{for any }f\in\Sigma\\ (1)&f(x_{1},\ldots,x_{n})\rightarrow x_{i}\\ (2)&f(x_{1},\ldots,~x_{i-1},~x_{i},~x_{i+1}~\ldots,~x_{n})\rightarrow f(x_{1},\ldots,~x_{i-1},~x_{i+1},~\ldots,~x_{n})\\ &\text{and for any }f,g\in\Sigma\\ (3)&f(x_{1},\ldots,x_{i-1},g(\bar{z}),x_{i+1},~\ldots,x_{m})\rightarrow g(x_{1},\ldots,~x_{i-1},\bar{z},x_{i+1},~\ldots,x_{m})\\ (4)&f(x_{1},\ldots,x_{i-1},g(\bar{z}),x_{i+1},~\ldots,x_{m})\rightarrow f(x_{1},\ldots,~x_{i-1},\bar{z},x_{i+1},~\ldots,x_{m})\end{array}\right\}

We say a term tt^{\prime} is graph-embedded in a term tt, denoted tgembtt\succcurlyeq_{gemb}t^{\prime}, if tt^{\prime} is a well formed term and there exists a term ss such that tRgembstt\rightarrow_{R_{gemb}}^{*}s\approx t^{\prime}.

A TRS RR is graph-embedded if for any lrRl\rightarrow r\in R, lgembrl\succcurlyeq_{gemb}r or rr is a constant.

Remark 5.

Notice that the rules in RgembR_{gemb} ignore function arity, thus intermediate terms between tt and tt^{\prime} may not be well formed. It is only the final term for which function arity and the relation between variables and functions must obey the standard term definition requirements. The schemata are being used to establish the graph-embedded property of a TRS.

Remark 6.

The rules of Definition 4 provide a convenient schemata for defining graph-embedded systems. However, they are also very useful in proving properties about graph-embedded systems. Notice that any rewrite step in a graph-embedded system corresponds to one or more steps of the above rules, thus proofs about graph-embedded TRSs can often be reduced to arguments on the properties of the rules of Definition 4.

Definition 4 provides a rewrite relation interpretation of graph-embedded systems which is contained in the \succcurlyeq relation given in Definition 2. This is due to the fact that if one applies one of the rule schema from Definition 2 to a term, tt, this correspond to one or more edge contractions applied to the term graph of tt, therefore we obtain the following:

Lemma 7.

For any terms tt and tt^{\prime}, tgembtt\succcurlyeq_{gemb}t^{\prime} implies ttt\succcurlyeq t^{\prime}, i.e., gemb\succcurlyeq_{gemb}~\subseteq~\succcurlyeq.

{exa}

Consider the two terms t=f(h(a,b),h(c,d))t=f(h(a,b),h(c,d)) and t=f(d,a)t^{\prime}=f(d,a). Then, tgembtt\succcurlyeq_{gemb}t^{\prime}, since tRgembstt\rightarrow_{R_{gemb}}^{*}s\approx t^{\prime} where the derivation tRgembst\rightarrow_{R_{gemb}}^{*}s is as follows:

f\textstyle{f}h\textstyle{h}h\textstyle{h}a\textstyle{a}b\textstyle{b}c\textstyle{c}d\textstyle{d}t\textstyle{t} Rgemb\rightarrow_{R_{gemb}}^{*} f\textstyle{f}h\textstyle{h}h\textstyle{h}a\textstyle{a}d\textstyle{d}u\textstyle{u} Rgemb\rightarrow_{R_{gemb}}^{*} f\textstyle{f}a\textstyle{a}d\textstyle{d}s\textstyle{s}
{exa}

[Malleable Encryption] Consider the theory of Malleable Encryption, RmalR_{mal}:

𝑑𝑒𝑐(𝑒𝑛𝑐(x,y),y)\displaystyle\mathit{dec}(\mathit{enc}(x,y),y) x\displaystyle\rightarrow x
𝑚𝑎𝑙(𝑒𝑛𝑐(x,y),z)\displaystyle\mathit{mal}(\mathit{enc}(x,y),z) 𝑒𝑛𝑐(z,y)\displaystyle\rightarrow\mathit{enc}(z,y)

For the second rule, let t1=𝑚𝑎𝑙(𝑒𝑛𝑐(x,y),z)t_{1}=\mathit{mal}(\mathit{enc}(x,y),z), and consider the following derivation t1Rgembt3t_{1}\rightarrow_{R_{gemb}}^{*}t_{3}:

mal\textstyle{mal}enc\textstyle{enc}z\textstyle{z}x\textstyle{x}y\textstyle{y}t1\textstyle{t_{1}} Rgemb(rule3)\rightarrow_{R_{gemb}}^{(rule~3)} enc\textstyle{enc}x\textstyle{x}y\textstyle{y}z\textstyle{z}t2\textstyle{t_{2}} Rgemb(rule2)\rightarrow_{R_{gemb}}^{(rule~2)} enc\textstyle{enc}y\textstyle{y}z\textstyle{z}t3\textstyle{t_{3}}

Since t3𝑒𝑛𝑐(z,y)t_{3}\approx\mathit{enc}(z,y), we have 𝑚𝑎𝑙(𝑒𝑛𝑐(x,y),z)gemb𝑒𝑛𝑐(z,y)\mathit{mal}(\mathit{enc}(x,y),z)\succcurlyeq_{gemb}\mathit{enc}(z,y). The first rule of RmalR_{mal} being subterm, 𝑑𝑒𝑐(𝑒𝑛𝑐(x,y),y)gembx\mathit{dec}(\mathit{enc}(x,y),y)\succcurlyeq_{gemb}x. Thus, RmalR_{mal} is a graph-embedded TRS.

{exa}

The theory of blind signatures from Example 1 is also a graph-embedded TRS. All but the final rule are subterm. For the final rule,

𝑢𝑛𝑏𝑙𝑖𝑛𝑑(𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z),y)Rgemb𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z)\mathit{unblind}(\mathit{sign}(\mathit{blind}(x,y),z),y)\rightarrow_{R_{gemb}}\mathit{sign}(\mathit{blind}(x,y),z)

via the RgembR_{gemb} rule (1). Then,

𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z)Rgemb𝑠𝑖𝑔𝑛(x,y,z)\mathit{sign}(\mathit{blind}(x,y),z)\rightarrow_{R_{gemb}}\mathit{sign}(x,y,z)

via the RgembR_{gemb} rule (4). Notice again that this intermediate term is not well formed. Finally

𝑠𝑖𝑔𝑛(x,y,z)Rgemb𝑠𝑖𝑔𝑛(x,z)𝑠𝑖𝑔𝑛(x,z)\mathit{sign}(x,y,z)\rightarrow_{R_{gemb}}\mathit{sign}(x,z)\approx\mathit{sign}(x,z)

via RgembR_{gemb} rule (2).

{exa}

[Addition] Consider the theory of Addition, RaddR_{add}, from [AC06]:

𝑝𝑙𝑢𝑠(x,s(y))\displaystyle\mathit{plus}(x,s(y)) 𝑝𝑙𝑢𝑠(s(x),y)\displaystyle\rightarrow\mathit{plus}(s(x),y)
𝑝𝑙𝑢𝑠(x,0)\displaystyle\mathit{plus}(x,0) x\displaystyle\rightarrow x
𝑝𝑟𝑒𝑑(s(x))\displaystyle\mathit{pred}(s(x)) x\displaystyle\rightarrow x

RaddR_{add} is a graph-embedded TRS. Notice that 𝑝𝑙𝑢𝑠(x,s(y))𝑝𝑙𝑢𝑠(s(x),y)\mathit{plus}(x,s(y))\approx\mathit{plus}(s(x),y).

{exa}

[Prefix with Pairing] The theory of prefix with pairing [CDL06, DDKS17] is a graph-embedded TRS:

𝑑𝑒𝑐(𝑒𝑛𝑐(x,y),y)\displaystyle\mathit{dec}(\mathit{enc}(x,y),y) x\displaystyle\rightarrow x
(𝑒𝑛𝑐(<x,y>,z))\displaystyle(\mathit{enc}(<x,y>,z)) 𝑒𝑛𝑐(x,z)\displaystyle\rightarrow\mathit{enc}(x,z)
𝑓𝑠𝑡(<x,y>)\displaystyle\mathit{fst}(<x,y>) x\displaystyle\rightarrow x
𝑠𝑛𝑑(<x,y>)\displaystyle\mathit{snd}(<x,y>) y\displaystyle\rightarrow y
{exa}

[Trap-door Commitment] The theory of trap-door commitment [cCDK12] is a graph-embedded TRS:

𝑜𝑝𝑒𝑛(𝑡𝑑(x,y,z),y)\displaystyle\mathit{open}(\mathit{td}(x,y,z),y) x\displaystyle\rightarrow x
𝑜𝑝𝑒𝑛(𝑡𝑑(x1,y,z),f(x1,y,z,x2))\displaystyle\mathit{open}(\mathit{td}(x_{1},y,z),f(x_{1},y,z,x_{2})) x2\displaystyle\rightarrow x_{2}
𝑡𝑑(x2,f(x1,y,z,x2),z)\displaystyle\mathit{td}(x_{2},f(x_{1},y,z,x_{2}),z) 𝑡𝑑(x1,y,z)\displaystyle\rightarrow\mathit{td}(x_{1},y,z)
f(x2,f(x1,y,z,x2),z,x3)\displaystyle f(x_{2},f(x_{1},y,z,x_{2}),z,x_{3}) f(x1,y,z,x3)\displaystyle\rightarrow f(x_{1},y,z,x_{3})
{exa}

[Strong Secrecy] Subterm convergent theories where the right hand sides are strict subterms or constants are graph-embedded. For example, the following system for considering a form of strong secrecy [Bla04, CCcCK16]:

𝑓𝑠𝑡(<x,y>)\displaystyle\mathit{fst}(<x,y>) x\displaystyle\rightarrow x
𝑠𝑛𝑑(<x,y>)\displaystyle\mathit{snd}(<x,y>) y\displaystyle\rightarrow y
𝑎𝑑𝑒𝑐(𝑎𝑒𝑛𝑐(x,𝑝𝑘(y)),y)\displaystyle\mathit{adec}(\mathit{aenc}(x,\mathit{pk}(y)),y) x\displaystyle\rightarrow x
𝑑𝑒𝑐(𝑒𝑛𝑐(x,y),y)\displaystyle\mathit{dec}(\mathit{enc}(x,y),y) x\displaystyle\rightarrow x
𝑐ℎ𝑒𝑐𝑘(𝑠𝑖𝑔𝑛(x,y),𝑝𝑘(y))\displaystyle\mathit{check}(\mathit{sign}(x,y),\mathit{pk}(y)) 𝑜𝑘\displaystyle\rightarrow\mathit{ok}
𝑚𝑠𝑔(𝑠𝑖𝑔𝑛(x,y))\displaystyle\mathit{msg}(\mathit{sign}(x,y)) x\displaystyle\rightarrow x

3.1. Some Properties of Graph-Embedded Systems

As an initial step we explore some of the basic properties of the graph-embedded TRSs. Similar to the class of subterm TRSs, the graph-embedded TRSs have several nice properties such as termination.

We can first note that the gemb\succcurlyeq_{gemb} relation is a partial order on the class of terms. This follows from Lemma 7 and the fact that the graph-embedded relation is a partial ordering on the class of finite graphs (See Proposition 1.7.3 from [Die06]).

In addition, rewriting at the root position preserves the graph-embedded property. This is due to the fact that for any graph-embedded TRS RR and for any lrRl\rightarrow r\in R, lgembrl\succcurlyeq_{gemb}r. Thus, lσ=t1gembt2=rσl\sigma=t_{1}\succcurlyeq_{gemb}t_{2}=r\sigma. More formally, if t1t_{1} and t2t_{2} are terms, RR a graph-embedded TRS, and t1Rϵt2t_{1}\rightarrow_{R}^{\epsilon}t_{2}, then, t1gembt2t_{1}\succcurlyeq_{gemb}t_{2}.

Graph-embedded systems also have the nice property of being size reducing when rewrite steps are applied and thus terminating.

Lemma 8.

Let RR be a graph-embedded TRS such that for all lrRl\rightarrow r\in R, lRgemb+rl\rightarrow_{R_{gemb}}^{+}\cdot\approx r. Assume tRtt\rightarrow_{R}t^{\prime}. Then,

  • |𝑉𝑎𝑟(t)||𝑉𝑎𝑟(t)||\mathit{Var}(t^{\prime})|\leq|\mathit{Var}(t)|,

  • |𝑉𝑃(t)||𝑉𝑃(t)||\mathit{VP}(t^{\prime})|\leq|\mathit{VP}(t)|,

  • 𝐹𝑆(t)𝐹𝑆(t)\mathit{FS}(t^{\prime})\subseteq\mathit{FS}(t),

  • |𝐹𝑃(t)|<|𝐹𝑃(t)||\mathit{FP}(t^{\prime})|<|\mathit{FP}(t)|.

Proof 3.1.

No rule from Definition 4 introduces additional function symbols or variables, satisfying the first and third condition. All rules from Definition 4 remove function symbols except the second rule and \approx. Notice that if rule 2 is applied then one of the other rules must also be applied to ensure the final term is well formed. Finally, since we require that at least one rewrite step is applied, the size of the term will be reduced even if \approx doesn’t reduce the size of the term. Thus the remaining conditions are satisfied.

Remark 9.

Notice that if only \approx steps are applied in a graph-embedded system then termination is not guaranteed. However, if at least one rewrite rule from RgembR_{gemb} is applied then by Lemma 8, the system will be terminating.

Comparing Definitions

We compare the definitions of graph embedded and homeomorphic embedding. Consider Malleable Encryption, RmalR_{mal}, from Example 7. RmalR_{mal} is a graph-embedded TRS, as is shown in Example 7. However, RmalR_{mal} is not a homeomorphic-embedded TRS. This can be seen in the rule 𝑚𝑎𝑙(𝑒𝑛𝑐(x,y),z)𝑒𝑛𝑐(z,y)\mathit{mal}(\mathit{enc}(x,y),z)\rightarrow\mathit{enc}(z,y). There is no way to obtain the term 𝑒𝑛𝑐(z,y)\mathit{enc}(z,y) from the term 𝑚𝑎𝑙(𝑒𝑛𝑐(x,y),z)\mathit{mal}(\mathit{enc}(x,y),z) by application of only the projection rule, f(x1,,xn)xif(x_{1},\ldots,x_{n})\rightarrow x_{i}. Thus, it’s easy to see that there exist graph-embedded TRSs which are not homeomorphic-embedded TRSs. Furthermore, we see that homeomorphic-embedded TRSs are a subset of graph-embedded TRSs.

{exa}

Consider the theory of trap-door commitment from Example 7. Notice that this theory is not a homeomorphic-embedded TRS. For the final rule,

f(x2,f(x1,y,z,x2),z,x3)f(x1,y,z,x3),f(x_{2},f(x_{1},y,z,x_{2}),z,x_{3})\rightarrow f(x_{1},y,z,x_{3}),

we cannot obtain the right-hand side from the left by the simple projection type relation of Definition 1.

In the rest of the paper we look at how graph-embedded TRSs can be used to both extend results in security protocols and also give a formal syntactic definition to classes of protocol presentations for which the decidability of the two knowledge problems are already known but are not contained in the class of strictly subterm convergent theories. We focus on theories with the local stability property as introduced in [AC06] (and extended in [AFN17]). For this purpose, we need to consider a restricted form of graph-embedded system called contracting system introduced in Definition 13. One can show that without such a restriction, the knowledge problems for graph-embedded TRSs are undecidable in general.

4. Undecidable Knowledge Problems

It is shown in [AC06] that the knowledge problems are undecidable in general. For graph-embedded systems we construct a proof that uses a reduction from the Modified Post Correspondence Problem (MPCP), a well known undecidable problem. This proof is similar to two other undecidability proofs developed in [ALL+12], and in the research report [ANR07b] of the paper [ANR07a].

Let Γ={a,b}\Gamma=\{a,b\} be the alphabet of the MPCPMPCP problem. Then, an instance of the problem is a finite set of string pairs, S={(αi,βi)|i[1,n]}Γ+×Γ+S=\{(\alpha_{i},\beta_{i})|~i\in[1,n]\}\subseteq\Gamma^{+}\times\Gamma^{+}, and two input strings α0Γ\alpha_{0}\in\Gamma^{*} , and β0Γ\beta_{0}\in\Gamma^{*}. A solution is a sequence of indexes i1,ik[1,n]i_{1},\ldots i_{k}\in[1,n] such that αi1αi2αik=βi1βi2βik\alpha_{i_{1}}\alpha_{i_{2}}\ldots\alpha_{i_{k}}=\beta_{i_{1}}\beta_{i_{2}}\ldots\beta_{i_{k}}, α0\alpha_{0} is a suffix of αi1αi2αik\alpha_{i_{1}}\alpha_{i_{2}}\ldots\alpha_{i_{k}}, and β0\beta_{0} is a suffix of βi1βi2βik\beta_{i_{1}}\beta_{i_{2}}\ldots\beta_{i_{k}}. That is, there are string α,βΓ\alpha^{\prime},\beta^{\prime}\in\Gamma^{*} s.t. αi1αi2αik=αα0=ββ0=βi1βi2βik\alpha_{i_{1}}\alpha_{i_{2}}\ldots\alpha_{i_{k}}=\alpha^{\prime}\cdot\alpha_{0}=\beta^{\prime}\cdot\beta_{0}=\beta_{i_{1}}\beta_{i_{2}}\ldots\beta_{i_{k}}. Notice that the standard PCPPCP is easily reducible to this MPCPMPCP by setting α0\alpha_{0} and β0\beta_{0} to the empty string.

Lemma 10.

The deduction problem is undecidable for the class of homeomorphic-embedded convergent TRSs.

Proof 4.1.

Let MPCP=α0,β0, and {(αi,βi)|i[1,n]}MPCP=\alpha_{0},~\beta_{0},\textit{ and }\{(\alpha_{i},\beta_{i})|~i\in[1,n]\} over the alphabet Γ={a,b}\Gamma=\{a,b\}. Consider unary function symbols lockedlocked, unlockedunlocked, aa, bb, g1,,gng_{1},\dots,g_{n}, a quaternary function ff, and constants cc, dd, ee.

Each string from the MPCPMPCP can be viewed as a sequence of applications of the unary function symbols. We can convert a string over Γ\Gamma into a term using function symbols aa and bb as follows. For an alphabet symbol γ~Γ\widetilde{\gamma}\in\Gamma, represent by γ\gamma the corresponding function symbol. That is, if γ~=a\widetilde{\gamma}=a, then γ=a()\gamma=a(). Likewise, if γ~=b\widetilde{\gamma}=b, then γ=b()\gamma=b(). Now for each pair of strings, (αi,βi)(\alpha_{i},\beta_{i}), we can recursively construct the function interpretation of each string, α~\widetilde{\alpha}, as follows: αi~(x)=γαi~(x)=γ(αi~(x))\widetilde{\alpha_{i}}(x)=\widetilde{\gamma\alpha_{i}^{\prime}}(x)=\gamma(\widetilde{\alpha_{i}^{\prime}}(x)), and βi~(x)=γβi~(x)=γ(βi~(x))\widetilde{\beta_{i}}(x)=\widetilde{\gamma\beta_{i}^{\prime}}(x)=\gamma(\widetilde{\beta_{i}^{\prime}}(x)).

Let R=BUR=B\cup U where

B\displaystyle B =i=1n{f(αi~(x),gi(y),βi~(z),unlocked(z))f(x,y,z,unlocked(z))},\displaystyle=\bigcup_{i=1}^{n}\{f(\widetilde{\alpha_{i}}(x),g_{i}(y),\widetilde{\beta_{i}}(z),unlocked(z))\rightarrow f(x,y,z,unlocked(z))\},
U\displaystyle U ={f(x,y,x,locked(unlocked(z)))f(x,y,x,unlocked(z))}.\displaystyle=\{f(x,y,x,locked(unlocked(z)))\rightarrow f(x,y,x,unlocked(z))\}.

The rules in BB are called the block rules, while the rule in UU is called the unlock one. The function symbols g1,,gng_{1},\dots,g_{n} (and the lockedlocked in the final rule) ensure there are no critical pairs between rules and thus we have a convergent TRS.

Now construct the frame ϕ=νn~.σ\phi=\nu\tilde{n}.\sigma where n~={c,e}\tilde{n}=\{c,e\} and σ={xα0~(c),yβ0~(c),zlocked(unlocked(e))}\sigma=\{x\mapsto\widetilde{\alpha_{0}}(c),y\mapsto\widetilde{\beta_{0}}(c),z\mapsto locked(unlocked(e))\}, and let the target ground term to be deduced be f(c,d,c,unlocked(e))f(c,d,c,unlocked(e)).

Let us show that there exists a recipe ζ\zeta such that ζσR!f(c,d,c,unlocked(e))\zeta\sigma\rightarrow_{R}^{!}f(c,d,c,unlocked(e)) iff there is a solution to the MPCPMPCP.

  • Let αi1αi2αik=βi1βi2βik\alpha_{i_{1}}\alpha_{i_{2}}\ldots\alpha_{i_{k}}=\beta_{i_{1}}\beta_{i_{2}}\ldots\beta_{i_{k}}, be a solution to the MPCPMPCP problem. Let αα0=αi1αi2αik\alpha^{\prime}\cdot\alpha_{0}=\alpha_{i_{1}}\alpha_{i_{2}}\ldots\alpha_{i_{k}} and ββ0=βi1βi2βik\beta^{\prime}\cdot\beta_{0}=\beta_{i_{1}}\beta_{i_{2}}\ldots\beta_{i_{k}}. Then, α~(x)σ=β~(y)σ\widetilde{\alpha^{\prime}}(x)\sigma=\widetilde{\beta^{\prime}}(y)\sigma. Now, for each block, ii in the MPCPMPCP, there exists a single block rule, containing gig_{i}, that removes the αi\alpha_{i} and βi\beta_{i}. Therefore, the recipe ζ=f(α~(x),gi1((gik(d))),β~(y),z)\zeta=f(\widetilde{\alpha^{\prime}}(x),g_{i_{1}}(\ldots(g_{i_{k}}(d))),\widetilde{\beta^{\prime}}(y),z) is a solution recipe since:

    ζσ\displaystyle\zeta\sigma =f(α(α0(c))~,gi1((gik(d))),β(β0(c))~,locked(unlocked(e)))Runlock\displaystyle=f(\widetilde{\alpha^{\prime}(\alpha_{0}(c))},g_{i_{1}}(\ldots(g_{i_{k}}(d))),\widetilde{\beta^{\prime}(\beta_{0}(c))},locked(unlocked(e)))\rightarrow_{R}^{unlock}
    f(α(α0(c))~,gi1((gik(d))),β(β0(c))~,unlocked(e))R!f(c,d,c,unlocked(e))\displaystyle f(\widetilde{\alpha^{\prime}(\alpha_{0}(c))},g_{i_{1}}(\ldots(g_{i_{k}}(d))),\widetilde{\beta^{\prime}(\beta_{0}(c))},unlocked(e))\rightarrow^{!}_{R}f(c,d,c,unlocked(e))
  • Let ζ\zeta be a recipe term such that ζσR!f(c,d,c,unlocked(e))\zeta\sigma\rightarrow^{!}_{R}f(c,d,c,unlocked(e)) then there is a solution to the MPCPMPCP and it can be extracted from the indexes of the gig_{i} function symbol in the term ζσ\zeta\sigma. This is due to the fact that the two strings must be the same, otherwise the unlock rule in UU cannot be applied. Notice also that this rule must be applied before any of the remaining rules since it “unlocks” the function unlockedunlocked which is required for the other block rules. Next since each of the rules represents a string pair in the MPCPMPCP problem, if ζσ\zeta\sigma reduces to the target f(c,d,c,unlocked(e))f(c,d,c,unlocked(e)), then the strings in ζσ\zeta\sigma are composed exactly of MPCPMPCP string pairs. Finally, the recipe cannot just be f(c,d,c,unlocked(e))f(c,d,c,unlocked(e)) since c,en~c,e\in\tilde{n}. In addition, the recipe cannot contain unlocked(e)unlocked(e) before applying the substitution σ\sigma, since en~e\in\tilde{n}.

{exa}

Consider the following MPCPMPCP:

(babaa)pair 1,(abba)pair 2,(aaaaa)pair 3\overbrace{\left(\frac{ba}{baa}\right)}^{\text{\text{pair 1}}},~\overbrace{\left(\frac{ab}{ba}\right)}^{\text{\text{pair 2}}},~\overbrace{\left(\frac{\vphantom{b}aaa}{aa}\right)}^{\text{\text{pair 3}}}

Assume the two starting string are: α0=aa\alpha_{0}=aa and β0=a\beta_{0}=a.

Following the construction of Lemma 10:

R={f(b(a(x)),g1(y),b(a(a(z))),unlocked(z))f(x,y,z,unlocked(z))f(a(b(x)),g2(y),b(a(z)),unlocked(z))f(x,y,z,unlcoked(z))f(a(a(a(x))),g3(y),a(a(z)),unlocked(z))f(x,y,z,unlocked(z))f(x,y,x,locked(unlocked(z)))f(x,y,x,unlocked(z))}R=\left\{\begin{array}[]{ll}f(b(a(x)),g_{1}(y),b(a(a(z))),unlocked(z))&\rightarrow f(x,y,z,unlocked(z))\\ f(a(b(x)),g_{2}(y),b(a(z)),unlocked(z))&\rightarrow f(x,y,z,unlcoked(z))\\ f(a(a(a(x))),g_{3}(y),a(a(z)),unlocked(z))&\rightarrow f(x,y,z,unlocked(z))\\ f(x,y,x,locked(unlocked(z)))&\rightarrow f(x,y,x,unlocked(z))\end{array}\right\}

In addition, α0~(c)=a(a(c))\widetilde{\alpha_{0}}(c)=a(a(c)) and β0~(c)=a(c)\widetilde{\beta_{0}}(c)=a(c). Notice there is a solution with indexes 1 and 3. That is, baaα0=α1α3=baaaβ0=β1β3baa\cdot\alpha_{0}=\alpha_{1}\cdot\alpha_{3}=baaa\cdot\beta_{0}=\beta_{1}\cdot\beta_{3}.

The starting frame is: ϕ=ν{c,e}.{xa(a(c)),ya(c),zlocked(unlocked(e))}\phi=\nu\{c,e\}.\{x\mapsto a(a(c)),~y\mapsto a(c),z\mapsto locked(unlocked(e))\}. Then, there is a solution recipe: ζ=f(b(a(a(x))),g1(g3(d)),b(a(a(a(y)))),z)\zeta=f(b(a(a(x))),g_{1}(g_{3}(d)),b(a(a(a(y)))),z), since ζσR!f(c,d,c,unlocked(e))\zeta\sigma\rightarrow^{!}_{R}f(c,d,c,unlocked(e)).

As a corollary of Lemma 10 we obtain the following.

Corollary 11.

The deduction problem is undecidable for the class of graph-embedded convergent TRSs.

Remark 12.

Note that the knowledge problems of deduction and static-equivalence were already proven undecidable in general in [AC06], where a reduction from PCP is also used. However, the system used in the proof from [AC06] is not graph-embedded and it’s not clear how to directly adapt that proof to the graph-embedded case of Lemma 10.

Finally, let us note that the above proof fixes an error with the proof of the same result presented in [SEMR23]. There, the system would erroneously allow trivial solutions since it did not include an unlock type rule that forces the two string to be equal.

5. Decidable Knowledge Problems

We consider below a restricted form of the graph-embedded TRS for which we can show decidability of the knowledge problems. The key to the definition is to start with a graph-embedded system but then to require a set of “projection rules”. These rules, in a way, provide access to subterms which may be modified during some rewrite derivation. Access to these subterms is important for the success of the saturation based decision procedure ([AC06]) for showing decidability of the knowledge problems (see Definition 16 below). Having access to subterms is a critical property in a number of definitions for which the knowledge problems are considered. It is a key feature in subterm convergent TRSs. It is also a feature in Δ\Delta-strong theories, defined in [ANR07a], where the cap problem, a form of the deduction problem, is studied for such theories (see Section 6.1). We can now introduce the type of projection rules we will require.

{defi}

[Projecting Rule] Let RR be a TRS, xx a variable and tt a term with a single occurrence of xx. A projecting rule in RR over tt leading to xx is a rule in RR which is a variant of txt^{\prime}\rightarrow x where tt^{\prime} is a superterm of tt with no additional occurrences of xx.

Remark 13.

The requirement that xx only occurs once in the left-hand side allows us to rule out projecting rules which don’t help in producing new knowledge during the saturation procedure (Definition 16). For example, a rule of the form f(x,g(x))xf(x,g(x))\rightarrow x requires that you already have knowledge of the subterm of g()g() in order to derive the subterm. However, this restriction doesn’t require that the entire term be linear. For example, 𝑑𝑒𝑐(𝑒𝑛𝑐(x,y),y)x\mathit{dec}(\mathit{enc}(x,y),y)\rightarrow x is a valid projecting rule since you only need to know yy to unlock the enc()enc() term and obtain the subterm instantiating xx.

How these projecting rules relate to the entire term-rewrite system can now be defined. We consider the relation to a rewrite derivation, using the graph-embedded rules, and then the permutation relation.

{defi}

[Projection-Closed Derivation] Let RR be a TRS. A non-empty RgembR_{gemb}-derivation is said to be projection-closed with respect to RR if it has the form

sRgemblr,γsRgembts\rightarrow_{R_{gemb}}^{l\rightarrow r,\gamma}s^{\prime}\rightarrow_{R_{gemb}}^{*}t

where

  • ss is a linear term and tt is a well formed term,

  • lrl\rightarrow r is a RgembR_{gemb} rule among (1), (2) and (4),

  • γ\gamma is a substitution ranging over variables,

  • if lrl\rightarrow r is rule (1), f(x1,,xn)xif(x_{1},\ldots,x_{n})\rightarrow x_{i}, then for any xiγx_{i}\gamma occurring in tt there exists a projecting rule in RR over f(x1,,xn)γf(x_{1},\ldots,x_{n})\gamma leading to xiγx_{i}\gamma,

  • if lrl\rightarrow r is rule (4), f(x1,,xi1,g(z¯),xi+1,,xm)f(x1,,xi1,z¯,xi+1,,xm)f(x_{1},\ldots,x_{i-1},g(\bar{z}),x_{i+1},~\ldots,x_{m})\rightarrow f(x_{1},\ldots,~x_{i-1},\bar{z},x_{i+1},~\ldots,x_{m}), then for any ziγz_{i}\gamma occurring in tt there exists a projecting rule in RR over g(z¯)γg(\bar{z})\gamma leading to ziγz_{i}\gamma,

  • sRgembts^{\prime}\rightarrow_{R_{gemb}}^{*}t is either projection-closed with respect to RR or empty.

{defi}

[Projection-Closed Permutative Equality] Let RR be a TRS and l=rl=r a permutative equality obtained by one or zero applications of s\approx_{s} followed by one or zero applications of l\approx_{l}. The equality l=rl=r is said to be projection-closed with respect to RR if the following holds: for any variable xx occurring in a strict subterm lxl^{\prime}\neq x of ll and in a strict subterm rr^{\prime} of rr such that lrl^{\prime}\neq r^{\prime}, then there exists a projecting rule in RR over ll^{\prime} leading to xx.

Based on Definitions 13 and 13, we can now introduce the subset of graph-embedded rules for which we can obtain decidability of the knowledge problems.

{defi}

[Contracting TRS]

A TRS RR is said to be contracting if for any non-subterm rule lrl\rightarrow r in RR one of the following holds:

  • there exist a position pp of ll, a substitution σ\sigma ranging over variables, a projection-closed derivation gRgemb+dg\rightarrow_{R_{gemb}}^{+}d with respect to RR such that l|p=gσl{|_{p}}=g\sigma and r=dσr=d\sigma is of depth 11,

  • l=rl=r is a permutative equality of depth 22 which is projection-closed with respect to RR.

A contracting TRS, RR, is strictly contracting if for any lrRl\rightarrow r\in R, depth(l)>depth(r)depth(l)>depth(r).

Remark 14.

Note that the projection-closed derivation in Definition 13 starts at some subterm of ll, say l|pl|_{p}. To get this subterm l|pl|_{p} from ll thanks a rewriting derivation with respect to RgembR_{gemb}, it suffices to apply repeatedly rule (1)(1) in RgembR_{gemb} at the root until it reaches l|pl|_{p}. These root applications of rule (1)(1) don’t necessarily require projecting rules, as the non-root applications of rule (1)(1) will in the projection-closed derivation. See Example 5 below an illustration of this fact.

It is also worth pointing out that the requirement on gg being a linear term (in Definition 13) is a way to identify individual instances of variables, which is needed to identifying the variable for which a projection rule is required (in Definition 13). However, the requirement that gg be linear is not a restriction requiring that ll (in Definition 13) be a linear term. Notice that σ\sigma is a substitution ranging over variables and used to match l|pl|_{p} with gg. Thus, even if gg is linear, it doesn’t require that ll is linear.

Although the definition restricts the set of graph-embedded systems it is still sufficient to model many security protocols of interest. We include several such examples below.

{exa}

Consider the theory of blind signatures from Example 1. This theory is contracting. Let’s look at the rule: 𝑢𝑛𝑏𝑙𝑖𝑛𝑑(𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z),y)𝑠𝑖𝑔𝑛(x,z)\mathit{unblind}(\mathit{sign}(\mathit{blind}(x,y),z),y)\rightarrow\mathit{sign}(x,z) and see how it satisfies the above definitions for contracting convergent systems by identifying the subterm l|pl|_{p}, and the projection-closed derivation. Let’s construct this derivation step by step.

  • Let l=𝑢𝑛𝑏𝑙𝑖𝑛𝑑(𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z),y)l=\mathit{unblind}(\mathit{sign}(\mathit{blind}(x,y),z),y). We can start the projection-closed derivation at the subterm 𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z)\mathit{sign}(\mathit{blind}(x,y),z), that is l|1=𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z)l|_{1}=\mathit{sign}(\mathit{blind}(x,y),z). We can obtain this subterm by first applying an instance of rule 1 at the root of ll. Then, l=𝑢𝑛𝑏𝑙𝑖𝑛𝑑(𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z),y)Rgembϵ,rule 1𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z)l=\mathit{unblind}(\mathit{sign}(\mathit{blind}(x,y),z),y)\rightarrow_{R_{gemb}}^{\epsilon,\textit{rule 1}}\mathit{sign}(\mathit{blind}(x,y),z).

  • Now we can apply a projection-closed derivation on l|1l|_{1}:

    1. (1)

      Let l|1=𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x,y),z)l|_{1}=\mathit{sign}(\mathit{blind}(x,y),z), g=𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x1,x2),x3)g=\mathit{sign}(\mathit{blind}(x_{1},x_{2}),x_{3}), and σ={x1x,x2y,x3z,}\sigma=\{x_{1}\mapsto x,~x_{2}\mapsto y,~x_{3}\mapsto z,\}. Then, l|1=gσl|_{1}=g\sigma.

    2. (2)

      There is a projection-closed derivation:

      g=𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x1,x2),x3)\displaystyle g=\mathit{sign}(\mathit{blind}(x_{1},x_{2}),x_{3}) Rgembrule 4𝑠𝑖𝑔𝑛(x1,x2,x3)\displaystyle\rightarrow_{R_{gemb}}^{\textit{rule 4}}\mathit{sign}(x_{1},x_{2},x_{3})
      𝑠𝑖𝑔𝑛(x1,x2,x3)\displaystyle\mathit{sign}(x_{1},x_{2},x_{3}) Rgembrule 2𝑠𝑖𝑔𝑛(x1,x3)\displaystyle\rightarrow_{R_{gemb}}^{\textit{rule 2}}\mathit{sign}(x_{1},x_{3})
    3. (3)

      r=𝑠𝑖𝑔𝑛(x,z)=𝑠𝑖𝑔𝑛(x1,x3)σr=\mathit{sign}(x,z)=\mathit{sign}(x_{1},x_{3})\sigma, and rr is depth 11.

We also need the required projecting rule, given the above projection-closed derivation:

  • The step, 𝑠𝑖𝑔𝑛(𝑏𝑙𝑖𝑛𝑑(x1,x2),x3)Rgembrule 4𝑠𝑖𝑔𝑛(x1,x2,x3)\mathit{sign}(\mathit{blind}(x_{1},x_{2}),x_{3})\rightarrow_{R_{gemb}}^{\textit{rule 4}}\mathit{sign}(x_{1},x_{2},x_{3}), applied rule 4 below the rule, to remove the blind()blind() function symbol, there must be a projecting rule. There are two variable, x1x_{1} and x2x_{2}, under the blind()blind() symbol. However, notice that x2x_{2} is removed in the next step. Therefore, we need only one projecting rule, tx1t^{\prime}\rightarrow x_{1}, which is the rule 𝑢𝑛𝑏𝑙𝑖𝑛𝑑(𝑏𝑙𝑖𝑛𝑑(x,y),y)x\mathit{unblind}(\mathit{blind}(x,y),y)\rightarrow x. Following Definition 5, t=𝑢𝑛𝑏𝑙𝑖𝑛𝑑(𝑏𝑙𝑖𝑛𝑑(x,y),y)t^{\prime}=\mathit{unblind}(\mathit{blind}(x,y),y), t=𝑏𝑙𝑖𝑛𝑑(x,y)t=\mathit{blind}(x,y), and xx only occurs once in tt^{\prime}.

Notice that the remaining rules of the blind signatures theory are subterm. Therefore, blind signatures is a contracting convergent TRS.

{exa}

Consider several additional convergent TRSs given in previous examples:

  • The theory of addition, introduced in Example 7, is a contracting TRS and provides a good example of the use of permutative equality in Definition 13. Consider the rule 𝑝𝑙𝑢𝑠(x,s(y))𝑝𝑙𝑢𝑠(s(x),y)Radd\mathit{plus}(x,s(y))\rightarrow\mathit{plus}(s(x),y)\in R_{add}. Notice that 𝑝𝑙𝑢𝑠(x,s(y))𝑝𝑙𝑢𝑠(s(x),y)\mathit{plus}(x,s(y))\approx\mathit{plus}(s(x),y) and that on the left-hand side yy appears in the subterm s(y)s(y) but does not appear in the same subterm on the right-hand side. Thus, there needs to be the rule 𝑝𝑟𝑒𝑑(s(x))x\mathit{pred}(s(x))\rightarrow x.

  • The theory of prefix with pairing from Example 7 is a contracting TRS.

  • Any subterm convergent TRS such that the right-hand side is either a strict subterm or a constant is contracting. For example, the theory of pairing with encryption, R={𝑓𝑠𝑡(x,y)x,𝑠𝑛𝑑(x,y)y,𝑑𝑒𝑐(𝑒𝑛𝑐(x,y),y)x}R=\{\mathit{fst}(\left\langle x,y\right\rangle)\rightarrow x,\mathit{snd}(\left\langle x,y\right\rangle)\rightarrow y,\mathit{dec}(\mathit{enc}(x,y),y)\rightarrow x\}, and the theory of Example 7.

{exa}

Consider several of the previous example TRSs:

  • The theory of trap-door commitment of Definition 7 is not a contracting TRS. Notice that it is missing the required projecting rules. For example, for the rule
    td(x2,f(x1,y,z,x2),z)td(x1,y,z)td(x_{2},f(x_{1},y,z,x_{2}),z)\rightarrow td(x_{1},y,z), there would need to be projecting rules for x1x_{1}, yy, and zz. Interestingly, this theory is also not locally stable [cCDK12]. However, if we add the rules,

    𝑓𝑠𝑡(f(x1,x2,x3,x4))x1,𝑠𝑛𝑑(f(x1,x2,x3,x4))x2,𝑡ℎ𝑑(f(x1,x2,x3,x4))x3,\mathit{fst}(f(x_{1},x_{2},x_{3},x_{4}))\rightarrow x_{1},\mathit{snd}(f(x_{1},x_{2},x_{3},x_{4}))\rightarrow x_{2},\mathit{thd}(f(x_{1},x_{2},x_{3},x_{4}))\rightarrow x_{3},

    then the theory is contracting and locally stable.

  • The theory of Example 7 is not contracting. Notice that for the rule 𝑚𝑎𝑙(𝑒𝑛𝑐(x,y),z)𝑒𝑛𝑐(z,y)\mathit{mal}(\mathit{enc}(x,y),z)\rightarrow\mathit{enc}(z,y), the node labeled with zz is moved under the 𝑒𝑛𝑐\mathit{enc} node on the right-hand side. This violates the requirements of Definition 13, which does not allow the RgembR_{gemb} rule (3), which would be required in this case. Thus, even with additional projecting rules, it cannot be made to be contracting. This theory is also not locally stable, as shown in [cCDK12].

Remark 15.

If we consider now the TRS from the undecidability proof of Lemma 10 we can see that while the system is graph-embedded it is not contracting. The required projecting rules do not exist.

We now develop a few results and definitions we need to show the decidability of the knowledge problems for contracting, graph-embedded convergent systems.

{defi}

[Graph-Embedded Subterms] Let RR be a contracting TRS and ϕ=νn~.σ\phi=\nu\tilde{n}.\sigma be a frame. For a term tRan(σ)t\in Ran(\sigma), let st(t)st(t) be the set of subterms of a term tt. Then, the set of graph-embedded subterms of a term tt, denoted as gst(t)gst(t), is defined as: gst(c)={c}gst(c)=\{c\}, where cc is a name or a constant, gst(t)={t|tRgembt′′t, and t is a well formed term }t′′st(t)gst(t′′)gst(t)=\{t^{\prime}|t\rightarrow_{R_{gemb}}^{*}t^{\prime\prime}\approx t^{\prime},\text{ and }t^{\prime}\text{ is a well formed term }\}\cup\bigcup_{t^{\prime\prime}\in st(t)}gst(t^{\prime\prime}). In addition, gst(ϕ)=tRan(σ)gst(t)gst(\phi)=\cup_{t\in Ran(\sigma)}gst(t).

Notice that for any term tt, gst(t)gst(t) is a finite set. This is due to the fact that when recursively constructing gst(t)gst(t) in Definition 15, tt^{\prime} is equal or smaller in size to tt, and any term t′′st(t)t^{\prime\prime}\in st(t) must be strictly smaller than tt. Thus, we have the following result.

Lemma 16.

For any term tt and any frame ϕ\phi, gst(t)gst(t) and gst(ϕ)gst(\phi) are finite sets.

Based on the extended definition of subterms, gstgst, we can now construct a saturation set for frames. Computing such a saturation set is the goal of many procedures that consider security notions such as deducibility. The saturation set represents the knowledge of the attacker and their ability to deduce a term from that knowledge, see [AC06] for more background. When considering this saturation procedure, recall that for any frame, ϕ=νn~.σ\phi=\nu\tilde{n}.\sigma, σ\sigma is a ground substitution. For the following it is also useful to recall the definition of cRc_{R} from Section 2.

{defi}

[Frame Saturation for Contracting Convergent TRSs] Let RR be any contracting convergent TRS and ϕ=νn~.σ\phi=\nu\tilde{n}.\sigma any RR-normalized frame. Define the set sat(ϕ)sat(\phi) to be the smallest set such that Ran(σ)sat(ϕ)Ran(\sigma)\subseteq sat(\phi), and csat(ϕ)c\in sat(\phi) for every c𝑓𝑛(ϕ)c\in\mathit{fn}(\phi), and closed under the following two rules:

  1. (1)

    if M1,,Mlsat(ϕ)M_{1},\ldots,M_{l}\in sat(\phi) and f(M1,,Ml)gst(ϕ)f(M_{1},\ldots,M_{l})\in gst(\phi), then f(M1,,Ml)sat(ϕ)f(M_{1},\ldots,M_{l})\in sat(\phi),

  2. (2)

    if M1,,Mlsat(ϕ)M_{1},\ldots,M_{l}\in sat(\phi), C[M1,,Ml]RϵMC[M_{1},\ldots,M_{l}]\rightarrow_{R}^{\epsilon}M, where CC is a context, |C|cR|C|\leq c_{R}, 𝑓𝑛(C)n~=\mathit{fn}(C)\cap\tilde{n}=\emptyset, and Mgst(ϕ)M\in gst(\phi), then Msat(ϕ)M\in sat(\phi).

Remark 17.

It is important to note that sat(ϕ)sat(\phi) should contain the set of deducible terms from the frame. For example, it would be tempting to just place all of gst(ϕ)gst(\phi) into sat(ϕ)sat(\phi) immediately, but this would add non-deducible terms to the set and invalidate the results.

Also notice for Definition 16, by applying an empty context, the second rule ensures that for any Ssat(ϕ)S\in sat(\phi), if SRϵSS\rightarrow_{R}^{\epsilon}S^{\prime} and Sgst(ϕ)S^{\prime}\in gst(\phi), then Ssat(ϕ)S^{\prime}\in sat(\phi).

This set is also finite which is critical to computing the possible attackers knowledge thus having a finite set is useful for any practical procedure for deciding deducibility.

Lemma 18.

Let RR be any contracting convergent TRS. For any RR-normalized frame ϕ\phi, sat(ϕ)sat(\phi) is finite.

Proof 5.1.

New terms not originally contained in ϕ\phi are only added to sat(ϕ)sat(\phi) if they are first contained in gst(ϕ)gst(\phi). Since gst(ϕ)gst(\phi) is finite by Lemma 16, sat(ϕ)sat(\phi) is finite.

5.1. Closure Under Small Context

The following definition and lemmas will be useful in proving the main motivating result as they show key components of the local stability property given in Definition 2.

{defi}

[Closure Under Small Context] Let RR be any contracting convergent TRS and ϕ=νn~.σ\phi=\nu\tilde{n}.\sigma any RR-normalized frame. A finite set of ground terms, 𝒮\mathcal{S}, is closed under small ϕ\phi-restricted context by RR if the following property holds: for any context CC with |C|cR|C|\leq c_{R} and 𝑓𝑛(C)n~=\mathit{fn}(C)\cap\tilde{n}=\emptyset, and any S1,,Sl𝒮S_{1},\ldots,S_{l}\in\mathcal{S}, if C[S1,,Sl]RϵMC[S_{1},\ldots,S_{l}]\rightarrow_{R}^{\epsilon}M then there exist a context CC^{\prime} and S1,,Sk𝒮S_{1}^{\prime},\ldots,S_{k}^{\prime}\in\mathcal{S} such that |C|cR2|C^{\prime}|\leq c_{R}^{2}, 𝑓𝑛(C)n~=\mathit{fn}(C^{\prime})\cap\tilde{n}=\emptyset, and MRC[S1,,Sk]M\rightarrow_{R}^{*}C^{\prime}[S_{1}^{\prime},\ldots,S_{k}^{\prime}]. When ϕ\phi is clear from the context, 𝒮\mathcal{S} is said to be closed under small context by RR.

Using cR2c_{R}^{2} as an upper bound is somewhat arbitrary since we need just some fixed bound. We use cR2c_{R}^{2} since it is sufficient for the results in this paper and it is the bound used in [AC06].

In the following, we show that the frame saturation for a contracting convergent TRS RR (cf. Definition 16) is closed under small context by RR.

Lemma 19.

For any contracting convergent TRS RR and any RR-normalized frame ϕ\phi, let sat(ϕ)sat(\phi) be the set given in Definition 16. Then, sat(ϕ)sat(\phi) is closed under small context by RR.

Proof 5.2.

Assume tϵRlr,γtt\stackrel{{\scriptstyle\epsilon}}{{\rightarrow}}_{R}^{l\rightarrow r,\gamma}t^{\prime} where t=lγt=l\gamma is a small context instantiated by terms in sat(ϕ)sat(\phi). By analyzing the different forms of rule lrl\rightarrow r that occurs in a contracting TRS RR, we show that for any variable x𝑉𝑎𝑟(l)x\in\mathit{Var}(l), if xγx\gamma is a strict subterm of some term in sat(ϕ)sat(\phi), then xγx\gamma is also in sat(ϕ)sat(\phi). Thus, xγx\gamma is a small context instantiated by terms in sat(ϕ)sat(\phi), as well as t=rγt^{\prime}=r\gamma since 𝑉𝑎𝑟(r)𝑉𝑎𝑟(l)\mathit{Var}(r)\subseteq\mathit{Var}(l).

First, if lrl\rightarrow r is a rule such that rr is either a constant or a strict subterm of ll, then the property holds according to [AC06].

Second, consider lrl\rightarrow r is a rule such that depth(l)>depth(r)=1depth(l)>depth(r)=1. Assume r=h(x1,,xn)r=h(x_{1},\dots,x_{n}) and let ii be any integer in {1,,n}\{1,\dots,n\}. Any xix_{i} occurs in ll either at depth at most 11 or at some depth strictly greater than 11.

  • If xix_{i} occurs in ll at depth at most 11, then xiγx_{i}\gamma is a small context instantiated by terms in sat(ϕ)sat(\phi).

  • if xix_{i} occurs in ll at some depth strictly greater than 11, then xiγx_{i}\gamma is a small context instantiated by terms in sat(ϕ)sat(\phi) thanks to Definition 13.

Then, rγ=h(x1γ,,xnγ)r\gamma=h(x_{1}\gamma,\dots,x_{n}\gamma) is a small context instantiated by terms in sat(ϕ)sat(\phi). Indeed, by construction, the context part of rγr\gamma cannot be greater than the context part of lγl\gamma.

Third, consider the case lrl\rightarrow r such that depth(l)=depth(r)=2depth(l)=depth(r)=2. Assume r=h(r1,,rn)r=h(r_{1},\dots,r_{n}), and let ii be any integer in {1,,n}\{1,\dots,n\}.

  • If rir_{i} is a variable occurring at depth at most 11 in ll, then riγr_{i}\gamma is a small context instantiated by terms in sat(ϕ)sat(\phi).

  • If rir_{i} is a variable occurring at depth 22 in ll, then riγr_{i}\gamma is a small context instantiated by terms in sat(ϕ)sat(\phi) thanks to Definition 13.

  • If rir_{i} is a non-variable term occurring as a direct subterm ljl_{j} of ll for some j[1,n]j\in[1,n], then riγ=ljγr_{i}\gamma=l_{j}\gamma is a small context instantiated by terms in sat(ϕ)sat(\phi).

  • If rir_{i} is a non-variable term f(x¯)f(\bar{x}) not occurring as a direct subterm of ll, then there are two cases for any variable xx¯x\in\bar{x}: if xx occurs at depth at most 11 in ll, then xγx\gamma is a small context instantiated by terms in sat(ϕ)sat(\phi); otherwise xx also occurs at depth 22 in ll and xγx\gamma is a small context instantiated by terms in sat(ϕ)sat(\phi) thanks to Definition 13.

Then, rγ=h(r1γ,,rnγ)r\gamma=h(r_{1}\gamma,\dots,r_{n}\gamma) is a small context instantiated by terms in sat(ϕ)sat(\phi). Indeed, by definition of lrl\rightarrow r where rr is obtained from ll via root and leaf permutations, the context part of rγr\gamma cannot be greater than the context part of lγl\gamma.

5.2. Local Stability

We can now show that any contracting convergent TRS has the local stability property introduced in Definition 2. For the frame saturation given in Definition 16, it suffices to check that all the items defining local stability (cf Definition 2) are satisfied. For any contracting convergent TRS, Lemma 19 establishes all but the last item of Definition 2, and this item has already been shown in [AC06]. {lemC}[[AC06]] For any locally stable TRS RR, any RR-normalized frame ϕ\phi and any ground term MM, if Msat(ϕ)M\in sat(\phi) then ϕM\phi\vdash M. This result is proven in [AC06] where the authors also consider the more complicated case of systems with ACAC-symbols.

Theorem 20.

Any contracting convergent TRS is locally stable.

Proof 5.3.

The first two conditions follow from Definition 16 where sat(ϕ)sat(\phi) is given in the particular case of a contracting convergent TRS. Then, the third condition follows from Lemma 19. The final condition follows from Lemma 5.2.

Directly from Theorem 20 and Theorem 2, we obtain the following corollary.

Corollary 21.

The deduction and static equivalence problems are both decidable for the class of contracting convergent TRSs.

The deduction and static equivalence problems are thus decidable for any TRS from Example 5.

6. Relation to Existing Notions and Properties

In this section we consider an additional knowledge problem, the cap problem [ANR07a], the relation of contracting TRS to the finite variant property [CD05], and the relation to the layered convergent property [BCD13].

6.1. The Cap Problem

The cap problem [ANR07a, ANR07b] is another knowledge problem introduced to model an intruder’s ability to obtain access to something that was intended to be secret. We show that the cap problem can be considered as a particular deduction problem.

{defi}

[Cap Problem] Let Σ\Sigma be a signature containing a constant, mm, called the secret. A subset ΣirΣ{m}\Sigma_{ir}\subseteq\Sigma\setminus\{m\} of publicly known symbols from the signature Σ\Sigma is called the intruder repertoire. Symbols not in the intruder repertoire are called private. The intruder repertoire is said to be complete if Σir=Σ{m}\Sigma_{ir}=\Sigma\setminus\{m\}. A cap term is a linear term built over Σir\Sigma_{ir}. Given a set SS of ground terms built over Σ\Sigma such that at least one of the terms contains mm, and a convergent TRS, RR, over Σ{m}\Sigma\setminus\{m\}, the cap problem asks if there exist a cap term tt with 𝑉𝑎𝑟(t)={x1,,xn}\mathit{Var}(t)=\{x_{1},\dots,x_{n}\} and ground terms s1,,snSs_{1},\dots,s_{n}\in S such that t{x1s1,,xnsn}R=mt\{x_{1}\mapsto s_{1},\dots,x_{n}\mapsto s_{n}\}\downarrow_{R}=m.

As shown below, the cap problem can be easily related to the deduction problem, provided that the intruder repertoire is complete.

Lemma 22.

If the intruder deduction problem is decidable for a convergent TRS RR, then the cap problem with a complete intruder repertoire is also decidable for RR.

Proof 6.1.

Consider the frame ϕ=ν{m}.σ\phi=\nu\{m\}.\sigma where mm is the constant denoting the secret and σ={x1s1,,xnsn}\sigma=\{x_{1}\mapsto s_{1},~\ldots,~x_{n}\mapsto s_{n}\} where S={s1,,sn}S=\{s_{1},\dots,s_{n}\} is the set of ground terms given by the cap problem. Then, following the respective definitions, there exists a recipe ζ\zeta such that ζσR=m\zeta\sigma\downarrow_{R}=m iff there exists a cap term for the cap problem.

Applying Theorem 20 together with the above lemma, we obtain the following.

Corollary 23.

The cap problem with a complete intruder repertoire is decidable for any contracting convergent TRS.

Remark 24.

As illustrated above one of the differences between the cap problem and deduction is that the cap problem allows for a restricted signature over which the intruder must work. The deduction problem assumes that essentially the entire signature, minus some restricted names, is public. However, it should be possible to extend the definition of deduction to allow for a restricted intruder repertoire. This new definition would then encapsulate the current deduction definition and the cap problem. Indeed, although this would need to be shown, it seems like the current deduction procedures could work for this new definition by restricting their saturation procedures to building terms only over the intruder repertoire.

6.2. Relation to the Finite Variant Property

The Finite Variant Property (FVP) is a useful property which is utilized in a number of applications, including protocol analysis. The FVP was introduced in [CD05] (see also [BGLN13, ESM12] for additional examples in using the FVP). It has been shown [CD05] that a TRS has the FVP iff it has the following boundedness property.

{defi}

[Boundedness Property] A convergent TRS, RR, has the boundedness property if tnσ:t(σ)Rn(tσ)\forall t\exists n\forall\sigma~:~t(\sigma{\downarrow})\rightarrow_{R}^{\leq n}(t\sigma){\downarrow}. That is, for any term tt there exists a bound, nn, on the number of step required to reach the normal form, and this bound is independent of the substitution.

One could naturally ask if the graph-embedded or contracting definitions just lead to systems with the FVP. This is not the case but some of the contracting systems listed in Example 5, such as blind signatures, do have the FVP as shown below. This is not surprising, given that the FVP can be useful for proving properties like termination. Another interesting question could be: are there meaningful examples from the protocol analysis literature for which deduction and static equivalence are decidable, do not have the FVP, but are representable by contracting convergent TRSs? Here we answer this question positively.

{exa}

Consider again the theory of Addition, RaddR_{add}, from Example 7. RaddR_{add} is a contracting convergent TRS, is locally stable, and contains no ACAC-symbols, thus deduction and static equivalence are decidable. However, RaddR_{add} does not have the FVP, we can see this by considering the rule 𝑝𝑙𝑢𝑠(x,s(y))𝑝𝑙𝑢𝑠(s(x),y)\mathit{plus}(x,s(y))\rightarrow\mathit{plus}(s(x),y) and the boundedness property. Notice that for any finite bound nn one can select a normal form substitution, σ\sigma, such that 𝑝𝑙𝑢𝑠(x,s(y))σRadd>n(𝑝𝑙𝑢𝑠(x,s(y))σ)\mathit{plus}(x,s(y))\sigma\overset{>n}{\rightarrow_{R_{add}}}(\mathit{plus}(x,s(y))\sigma){\downarrow}. Namely, σ={ysn+1(z)}\sigma=\{y\mapsto s^{n+1}(z)\}. Since RaddR_{add} does not have the boundedness property it can’t have the FVP [CD05]. Yet, RaddR_{add} is a contracting convergent TRS. Notice that the second and third rules are already subterm. The first rule is obtained by applying Definition 3. Therefore, RaddR_{add} satisfies Corollary 21.

As a positive result, there is an easy way to get a strictly contracting TRS with the FVP:

Lemma 25.

Assume RR is any strictly contracting convergent TRS such that for any rule lrl\rightarrow r in RR, rr is either a variable or a non-variable term rooted by a constructor symbol. Then, RR has the FVP.

Proof 6.2.

Consider any rule lrl\rightarrow r in RR. By assumption, RR is strictly contracting, and so rr is of depth at most 11. If rr is variable, there is no way to overlap at a non-variable position in rr with the left-hand side of any rule in RR. Assume now rr is of depth 11. If there is a non-variable overlap in rr with the left-hand side of any rule in RR, this overlap can only occur at the root position of rr. Since the function symbol at the root position of rr is necessarily a constructor symbol, it cannot occur at the root-position of any left-hand side of RR. Since there is no non-variable overlap in rr with the left-hand side of any rule in RR, this is simple way for RR to satisfy the property of being forward-closed as defined in [BGLN13]. Then, relying on the fact that a TRS has the FVP iff it has a finite forward closure [BGLN13], we can conclude that RR has the FVP.

{exa}

For the theory of blind signatures and the theory of prefix with pairing (Example 5), the corresponding TRSs satisfy the assumption of Lemma 25. Consequently, these two strictly contracting convergent TRSs have the FVP.

For the theory of trap-door commitment, the strictly contracting convergent TRS obtained by considering additional rules (see Example 5) does not satisfy the assumption of Lemma 25.

6.3. Relation to the Layered Convergent Property

The layered convergent property is yet another useful property for TRS modeling security protocols because it can be used to ensure that the YAPA [BCD13] tool for protocol analysis doesn’t fail. YAPA is a tool for computing intruder knowledge in the formal analysis of security protocols and it is able to work with a large number of protocol specifications. While YAPA allows us to consider private symbols in addition to public ones, we assume here that all the function symbols are publicly known. In this classical setting, the tool is not guaranteed to terminate or return successfully, it could return a “don’t know” answer. However, it is shown in [BCD13] that the “layered convergent” property for a given TRS, with some additional conditions, can be used to show termination. This property is defined using a particular term decomposition to express any left-hand side of the TRS.

{defi}

[Term Decomposition] Let n,pn,~p, and qq be non-negative integers. A (n,p,q)(n,p,q)-decomposition of a term ll is a context CC with n+p+qn+p+q context holes and l=C[l1,,ln,y1,,yp,z1,,zq]l=C[l_{1},\ldots,l_{n},~y_{1},\ldots,y_{p},~z_{1},\ldots,z_{q}] where:

  • l1,,lnl_{1},\ldots,l_{n} are mutually distinct non-variable terms,

  • y1,,ypy_{1},\ldots,y_{p} and z1,,znz_{1},\ldots,z_{n} are mutually distinct variables, and

  • y1,,ypVar(l1,,ln)y_{1},\ldots,y_{p}\in Var(l_{1},\ldots,l_{n}) but z1,,znVar(l1,,ln)z_{1},\ldots,z_{n}\not\in Var(l_{1},\ldots,l_{n}).

{defi}

[Layered TRS] A TRS, RR, is layered if there exists an ascending chain of sub sets =R0R1Rn+1=R(n0)\emptyset=R_{0}\subseteq R_{1}\subseteq\dots R_{n+1}=R\>(n\geq 0) s.t. for every rule lrRi+1\Ril\rightarrow r\in R_{i+1}\backslash R_{i} and every (n,p,q)(n,p,q)-decomposition l=D[l1,,lm,y1,,yp,z1,,zq]l=D[l_{1},\ldots,l_{m},~y_{1},\ldots,y_{p},~z_{1},\ldots,z_{q}] one of the following holds:

  1. (1)

    𝑉𝑎𝑟(r)𝑉𝑎𝑟(l1,,lm)\mathit{Var}(r)\subseteq\mathit{Var}(l_{1},\ldots,l_{m}).

  2. (2)

    There exist C0,C1,CkC_{0},C_{1},\ldots C_{k} and s1,sks_{1},\ldots s_{k} such that r=C0[s1,,sk]r=C_{0}[s_{1},\ldots,s_{k}] and for any j=1,,kj=1,\dots,k, we have Cj[l1,,lm,y1,,yp,z1,,zq]ϵRi0,1sjC_{j}[l_{1},\ldots,l_{m},~y_{1},\ldots,y_{p},~z_{1},\ldots,z_{q}]\stackrel{{\scriptstyle\epsilon}}{{\rightarrow}}_{R_{i}}^{0,1}s_{j}.

Remark 26.

What is interesting here is that both the contracting definition (Definition 13) and the layered definition (Definition 6.3) point to the ability of accessing subterms as a key component to ensuring that the knowledge problems are decidable. Indeed, there is a relation between the two definitions, as shown in the next result.

Theorem 27.

Any contracting TRS is layered.

Proof 6.3.

Let RR be a contracting TRS and R1={lrR|r is a subterm of l or a constant}R_{1}=\{l\rightarrow r\in R~|~r\text{ is a subterm of }l\text{ or a constant}\}. It has already been shown in [BCD13] that any subterm convergent TRS is layered. Thus, if R1=RR_{1}=R we are done. Otherwise, let R2=RR_{2}=R and any rule lrR2\R1l\rightarrow r\in R_{2}\backslash R_{1} must be contracting but not subterm. Let lrR2\R1l\rightarrow r\in R_{2}\backslash R_{1} and consider any arbitrary (n,p,q)(n,p,q)-decomposition
l=D[l1,,lm,y1,,yp,z1,,zq]l=D[l_{1},\ldots,l_{m},~y_{1},\ldots,y_{p},~z_{1},\ldots,z_{q}]. If r{l1,,lm}{y1,,yp}{z1,,zq}r\in\{l_{1},\ldots,l_{m}\}\cup\{y_{1},\ldots,y_{p}\}\cup\{z_{1},\ldots,z_{q}\}, then we are done. Thus, assume that rlir\neq l_{i}, for any 1im1\leq i\leq m and also r{y1,,yp}{z1,,zq}r\not\in\{y_{1},\ldots,y_{p}\}\cup\{z_{1},\ldots,z_{q}\}. Let r=C0[s1,,sk]r=C_{0}[s_{1},\ldots,s_{k}], we show how to construct C0C_{0} and how to obtain each sis_{i}, 1ik1\leq i\leq k, from the decomposition. There are two cases based on depth(r)depth(r):

  • Assume depth(r)=1depth(r)=1. Then, each sis_{i} is a variable. If si{y1,,yp}{z1,,zq}s_{i}\in\{y_{1},\ldots,y_{p}\}\cup\{z_{1},\ldots,z_{q}\} for all 1ik1\leq i\leq k, then by definition we are done. Thus, assume there exists at least one si{y1,,yp}{z1,,zq}s_{i}\not\in\{y_{1},\ldots,y_{p}\}\cup\{z_{1},\ldots,z_{q}\}, which implies that siVar(lj)s_{i}\in Var(l_{j}) for some ljl_{j}, 1jm1\leq j\leq m, in ll, but sis_{i} is not a subterm of lil_{i} in rr. thus, by Definition 13 there is a rule tsiR1t^{\prime}\rightarrow s_{i}\in R_{1} such that t=Ci[lj]t^{\prime}=C_{i}[l_{j}].

  • Assume depth(r)=2depth(r)=2. Here again we can assume that each sis_{i} are variables. This is due to the fact that non-variable portions of the term can be placed in the context C0C_{0}. If sis_{i} is contained in {y1,,yp}{z1,,zq}\{y_{1},\ldots,y_{p}\}\cup\{z_{1},\ldots,z_{q}\}, then by definition we are done. Otherwise, siVar(li)s_{i}\in Var(l_{i}), for some 1im1\leq i\leq m, in ll, but sis_{i} is no longer a subterm of lil_{i} in rr. Thus, by Definition 13 there is a rule in R1R_{1} of the form Ci[li]siC_{i}[l_{i}]\rightarrow s_{i}.

Remark 28.

Notice that the above proof outlines a natural and simple layered system for any contracting TRS RR. Let R0=R_{0}=\emptyset, R1={lrR|r is a subterm of l}R_{1}=\{l\rightarrow r\in R~|~r\text{ is a subterm of }l\}, and R2=RR1R_{2}=R\setminus R_{1}. Then R0R1R2=RR_{0}\cup R_{1}\cup R_{2}=R and any rule needed to deduce variables for decompositions of R2R_{2} rules will be subterm and thus contained in R1R_{1}. Note that there are TRSs which are layered for n=1n=1 but not contracting.

Theorem 27 implies that for contracting convergent TRS, the YAPA procedure won’t fail, i.e., return a “don’t know” answer. However, this result doesn’t prove termination. However, we conjecture that the YAPA procedure does terminate for contracting convergent TRS.

7. Contracting Convergent Systems in Unions of Theories

In this section, we investigate the knowledge problems in unions of theories including at least a contracting convergent TRS. We mainly focus on constructor-sharing unions of theories, where it is possible to reuse existing modularity results and combination methods [EMR17]. Let us first consider the class of strictly contracting convergent TRSs. As shown below, this class is closed by constructor-sharing union:

Theorem 29.

If R1R_{1} and R2R_{2} are two strictly contracting convergent TRSs such that the function symbols shared by R1R_{1} and R2R_{2} are constructors for both R1R_{1} and R2R_{2}, then R1R2R_{1}\cup R_{2} is strictly contracting convergent.

Proof 7.1.

First, note that a strictly contracting TRS is terminating. By definition, if R1R_{1} and R2R_{2} are strictly contracting, then so is R1R2R_{1}\cup R_{2}. Thus, R1R2R_{1}\cup R_{2} is terminating. By assumption R1R_{1} and R2R_{2} are confluent, and so also locally confluent. The local confluence is a modular property for constructing-sharing TRSs [Mid90]. Thus, R1R2R_{1}\cup R_{2} is locally confluent. Then, R1R2R_{1}\cup R_{2} is confluent since R1R2R_{1}\cup R_{2} is terminating. Consequently, R1R2R_{1}\cup R_{2} is both confluent and terminating, equivalently, it is convergent.

The combination framework developed in [EMR17] for the knowledge problems in unions of constructor-sharing theories can be applied to contracting convergent TRSs that are not necessarily strictly contracting:

Theorem 30.

If R1R_{1} and R2R_{2} are two contracting convergent TRSs such that the function symbols shared by R1R_{1} and R2R_{2} are constructors for both R1R_{1} and R2R_{2}, then both deduction and static equivalence are decidable in R1R2R_{1}\cup R_{2}.

Proof 7.2.

Directly from [EMR17] where it is shown that, for constructor sharing theories, the knowledge problems are decidable for R1R2R_{1}\cup R_{2} if they are decidable for R1R_{1} and R2R_{2}. Section 5.2 establishes the decidability of the knowledge problems for contracting convergent TRSs.

We now study the case of unions of theories defined as a contracting convergent TRS RR plus an equational theory EE that cannot be oriented as a convergent TRS. Typical examples for EE are provided by permutative theories. Fortunately, deduction is decidable in the class of permutative theories.

Theorem 31.

Deduction is decidable in any permutative theory.

Proof 7.3.

Consider the problem of checking whether a term tt is deduced from ϕ=νn~.σ\phi=\nu\tilde{n}.\sigma modulo any permutative theory EE. For any term ss such that |s|>|t||s|>|t|, we have sσEts\sigma\neq_{E}t: otherwise, we would have |sσ||s|>|t||s\sigma|\geq|s|>|t| and sσ=Ets\sigma=_{E}t implies |sσ|=|t||s\sigma|=|t|. Thus, only finitely many terms ss (up to a renaming) have to be considered in order to check whether tt is deduced from ϕ\phi modulo EE.

When an equational theory EE is defined by a finite set of permutative axioms built using function symbols that do not occur as the root positions, these symbols can be viewed as constructors for EE. It has been shown in [EMR17] that a permutative theory can be successfully combined with a theory given by a convergent TRS, provided that the shared symbols are constructors for both theories. Thus, directly from [EMR17] we obtain:

Theorem 32.

Let RR be any contracting convergent TRS and EE any permutative presentation such that any function symbol ff shared by RR and EE is a constructor for RR and, for any axiom l=rl=r in EE, ff does not occur neither as a root symbol of ll nor as a root symbol of rr. Then, deduction is decidable in RER\cup E.

{exa}

[Intruder Theory with a Permutative Axiom] Let us consider a theory used in practice to model a group messaging protocol [CCG+18]. For this protocol, the theory modeling the intruder can be defined [Ngu19] as a combination RKR\cup K where

K={𝑘𝑒𝑦𝑒𝑥𝑐ℎ(x,𝑝𝑘(x),y,𝑝𝑘(y))=𝑘𝑒𝑦𝑒𝑥𝑐ℎ(x,𝑝𝑘(x),y,𝑝𝑘(y))}K=\{\mathit{keyexch}(x,\mathit{pk}(x^{\prime}),y,\mathit{pk}(y^{\prime}))=\mathit{keyexch}(x^{\prime},\mathit{pk}(x),y^{\prime},\mathit{pk}(y))\}

and

R={𝑎𝑑𝑒𝑐(𝑎𝑒𝑛𝑐(m,𝑝𝑘(sk)),sk)m𝑐ℎ𝑒𝑐𝑘𝑠𝑖𝑔𝑛(𝑠𝑖𝑔𝑛(m,sk),m,𝑝𝑘(sk))ok𝑔𝑒𝑡𝑚𝑠𝑔(𝑠𝑖𝑔𝑛(m,sk))m𝑠𝑑𝑒𝑐(𝑠𝑒𝑛𝑐(m,k),k)m}.R=\left\{\begin{array}[]{ll}\begin{array}[]{lcl}\mathit{adec}(\mathit{aenc}(m,\mathit{pk}(sk)),sk)&\rightarrow&m\\ \mathit{checksign}(\mathit{sign}(m,sk),m,\mathit{pk}(sk))&\rightarrow&ok\end{array}&\begin{array}[]{lcl}\mathit{getmsg}(\mathit{sign}(m,sk))&\rightarrow&m\\ \mathit{sdec}(\mathit{senc}(m,k),k)&\rightarrow&m\end{array}\end{array}\right\}.

RR is a subterm convergent TRS and KK is a variable-permuting theory sharing with RR the constructor symbol 𝑝𝑘\mathit{pk}. Theorem 32 applies to RKR\cup K, leading to a combined decision procedure for deduction in RKR\cup K.

Deduction is decidable in permutative theories, as stated in Theorem 31. However, the static equivalence problem is undecidable in general for permutative theories or even leaf permutative theories, as show recently in [EMNR24]. However, we conjecture there are useful subclasses of permutative theories, including the theory KK introduced in Example 32, for which static equivalence is decidable and thus for which a static equivalence form of Theorem 32 could be developed. We plan to investigate this in a future work.

8. Conclusions and Future Work

In this paper, we have explored the idea of graph-embedded term rewrite systems and shown their applicability in protocol analysis for identifying protocols with the local stability property. This in turn allows for the identification of protocols with decidable deduction and static-equivalence problems. We have also compared and contrasted this new definition to several other concept, including the FVP, the cap problem, and Layered TRS. Finally, we have developed several combination results for these TRS. In the first version of this paper [SEMR23] we had identified several problems and areas for further research. Some of those problems have now been answered in this paper, in particular:

  • We had conjectured in [SEMR23] that the cap problem should be decidable for contracting systems and have show this to be the case, see Section 6.1. However, one has to be careful how the signature is defined, and we currently require it to be completely public (except for some constants).

  • We asked in [SEMR23] about the relation between the graph-embedded systems and the layered systems. This has now been developed in Section 6.3.

We have also made a number of improvements over the presentation in [SEMR23]:

  • We have improved and simplified the definition of contracting convergent TRS.

  • We have improved the proof of the undecidability of the knowledge problems for graph-embedded TRS.

While we have answer some problems from [SEMR23], additional problems still remain to be investigated. For example, While the knowledge problems are undecidable for graph-embedded convergent systems in general and they are decidable for contracting, there is a gap between the two classes of systems. That is, how much can the contracting subclass be extended before the undecidable barrier is encountered? With respect to graph theory ideas, we are also interested in knowing if additional graph theory ideas could be useful in symbolic security protocol analysis. For example, not absolutely all theories considered in [AC06, CCcCK16, cCDK12, DDKS17] are graph-embedded. It would be interesting to know if such systems could be considered via graph minor concepts. Just as in [SEMR23], we remain interested in seeing how ideas from graph theory, translated into the TRS setting, are useful for question not only in protocol analysis but also in other rewriting domains. We had also asked about termination and if the new definition could be useful in developing termination results for procedures such as [AC06, CCcCK16, cCDK12, DDKS17]. It remains to investigate termination in these procedures.

Finally, in addition to answering some of the open problems of  [SEMR23], we have developed a number of new results not asked about in [SEMR23]. This includes identifying a subclass of graph-embedded systems that guarantee the FVP, see Section 6, and developing new combination results, see Section 7. In particular, we have investigated the union of contracting convergent systems with some permutative theories. As a future work, we plan to study how undecidability proofs known for unification in permutative theories could be adapted to static equivalence.

References

  • [AC06] Martín Abadi and Véronique Cortier. Deciding knowledge in security protocols under equational theories. Theor. Comput. Sci., 367(1-2):2–32, 2006.
  • [AF01] Martín Abadi and Cédric Fournet. Mobile values, new names, and secure communication. In Chris Hankin and Dave Schmidt, editors, Conference Record of POPL 2001: The 28th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, London, UK, January 17-19, 2001, pages 104–115. ACM, 2001.
  • [AFN17] Mauricio Ayala-Rincón, Maribel Fernández, and Daniele Nantes-Sobrinho. Intruder deduction problem for locally stable theories with normal forms and inverses. Theor. Comput. Sci., 672:64–100, 2017.
  • [ALL+12] Siva Anantharaman, Hai Lin, Christopher Lynch, Paliath Narendran, and Michaël Rusinowitch. Unification modulo homomorphic encryption. J. Autom. Reason., 48(2):135–158, 2012.
  • [ANR07a] Siva Anantharaman, Paliath Narendran, and Michaël Rusinowitch. Intruders with caps. In Franz Baader, editor, Term Rewriting and Applications, 18th International Conference, RTA 2007, Paris, France, June 26-28, 2007, Proceedings, volume 4533 of Lecture Notes in Computer Science, pages 20–35. Springer, 2007.
  • [ANR07b] Siva Anantharaman, Paliath Narendran, and Michael Rusinowitch. Intruders with caps. Research report, Laboratoire d’Informatique Fondamentale d’Orléans, 2007. URL: https://hal.science/hal-00144178.
  • [BCD13] Mathieu Baudet, Véronique Cortier, and Stéphanie Delaune. YAPA: A generic tool for computing intruder knowledge. ACM Trans. Comput. Log., 14(1):4, 2013.
  • [BGLN13] Christopher Bouchard, Kimberly A. Gero, Christopher Lynch, and Paliath Narendran. On forward closure and the finite variant property. In Pascal Fontaine, Christophe Ringeissen, and Renate A. Schmidt, editors, Frontiers of Combining Systems - 9th International Symposium, FroCoS 2013, Nancy, France, September 18-20, 2013. Proceedings, volume 8152 of Lecture Notes in Computer Science, pages 327–342. Springer, 2013.
  • [Bla04] Bruno Blanchet. Automatic proof of strong secrecy for security protocols. In 2004 IEEE Symposium on Security and Privacy (S&P 2004), 9-12 May 2004, Berkeley, CA, USA, pages 86–100. IEEE Computer Society, 2004.
  • [BN98] Franz Baader and Tobias Nipkow. Term rewriting and all that. Cambridge University Press, 1998.
  • [BS01] Franz Baader and Wayne Snyder. Unification theory. In John Alan Robinson and Andrei Voronkov, editors, Handbook of Automated Reasoning, pages 445–532. Elsevier and MIT Press, 2001.
  • [CCcCK16] Rohit Chadha, Vincent Cheval, Ştefan Ciobâcă, and Steve Kremer. Automated verification of equivalence properties of cryptographic protocols. ACM Trans. Comput. Log., 17(4):23:1–23:32, 2016.
  • [cCDK12] Ştefan Ciobâcă, Stéphanie Delaune, and Steve Kremer. Computing knowledge in security protocols under convergent equational theories. J. Autom. Reasoning, 48(2):219–262, 2012.
  • [CCG+18] Katriel Cohn-Gordon, Cas Cremers, Luke Garratt, Jon Millican, and Kevin Milner. On ends-to-ends encryption: Asynchronous group messaging with strong security guarantees. In David Lie, Mohammad Mannan, Michael Backes, and XiaoFeng Wang, editors, Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, CCS 2018, Toronto, ON, Canada, October 15-19, 2018, pages 1802–1819. ACM, 2018.
  • [CD05] Hubert Comon-Lundh and Stéphanie Delaune. The finite variant property: How to get rid of some algebraic properties. In Jürgen Giesl, editor, Term Rewriting and Applications, 16th International Conference, RTA 2005, Nara, Japan, April 19-21, 2005, Proceedings, volume 3467 of Lecture Notes in Computer Science, pages 294–307. Springer, 2005.
  • [CDL06] Véronique Cortier, Stéphanie Delaune, and Pascal Lafourcade. A survey of algebraic properties used in cryptographic protocols. J. Comput. Secur., 14(1):1–43, 2006.
  • [DDKS17] Jannik Dreier, Charles Duménil, Steve Kremer, and Ralf Sasse. Beyond subterm-convergent equational theories in automated verification of stateful protocols. In Matteo Maffei and Mark Ryan, editors, Principles of Security and Trust - 6th International Conference, POST 2017, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2017, Uppsala, Sweden, April 22-29, 2017, Proceedings, volume 10204 of Lecture Notes in Computer Science, pages 117–140. Springer, 2017.
  • [Die06] Reinhard Diestel. Graph Theory, volume 173 of Graduate Texts in Mathematics. Springer, third edition, 2006.
  • [EMNR24] Serdar Erbatur, Andrew M. Marshall, Paliath Narendran, and Christophe Ringeissen. Deciding knowledge problems modulo classes of permutative theories. In Juliana Bowles and Harald Søndergaard, editors, Logic-Based Program Synthesis and Transformation, pages 47–63, Cham, 2024. Springer Nature Switzerland.
  • [EMR17] Serdar Erbatur, Andrew M. Marshall, and Christophe Ringeissen. Notions of knowledge in combinations of theories sharing constructors. In Leonardo de Moura, editor, Automated Deduction - CADE 26 - 26th International Conference on Automated Deduction, Gothenburg, Sweden, Proceedings, volume 10395 of LNCS, pages 60–76. Springer, 2017.
  • [ESM12] Santiago Escobar, Ralf Sasse, and José Meseguer. Folding variant narrowing and optimal variant termination. J. Log. Algebr. Program., 81(7-8):898–928, 2012.
  • [Mid90] Aart Middeldorp. Modular Properties of Term Rewriting Systems. PhD thesis, Vrije Universiteit, Amsterdam, 1990.
  • [Ngu19] Ky Nguyen. Formal verification of a messaging protocol. Internship report, 2019. Work done under the supervision of Vincent Cheval and Véronique Cortier.
  • [SEMR23] Saraid Dwyer Satterfield, Serdar Erbatur, Andrew M. Marshall, and Christophe Ringeissen. Knowledge problems in security protocols: Going beyond subterm convergent theories. In Marco Gaboardi and Femke van Raamsdonk, editors, 8th International Conference on Formal Structures for Computation and Deduction, FSCD 2023, July 3-6, 2023, Rome, Italy, volume 260 of LIPIcs, pages 30:1–30:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2023. URL: https://doi.org/10.4230/LIPIcs.FSCD.2023.30, doi:10.4230/LIPICS.FSCD.2023.30.