Abstract 1 Introduction 2 Dynamic Separation Logic 3 PCE Rules 4 Some Basic Transformations on Inductive Predicates 5 Elimination of Modalities 6 Future Work References Appendix A Proof of Lemma 15 Appendix B Proof of Lemma 18 Appendix C Proof of Lemma 19 Appendix D Proof of Proposition 21 Appendix E Proof of Proposition 22 Appendix F Proof of Lemma 24 Appendix G Proof of Lemma 25 Appendix H Proof of Lemma 28

On the Entailment Problem in Dynamic Separation Logic with Inductive Definitions

Nicolas Peltier ORCID Univ. Grenoble Alpes, CNRS, LIG, F-38000 Grenoble, France
Abstract

Separation Logic (SL) is a well-established framework for reasoning about programs that manipulate dynamic memory. To express and verify properties of custom recursive data structures, SL is extended with spatial predicates defined by user-specified inductive rules. Many verification problems reduce to deciding entailments between formulas involving these predicates. While the general entailment problem is undecidable, a broad class of inductive rules – known as PCE (Progressing, Connected, and Established) – has been identified for which entailment is decidable. In this work, we extend the study of the entailment problem to Dynamic Separation Logic (DSL), an extension of SL that includes dynamic modalities for reasoning about actions on the heap and store. We show that entailment in DSL remains decidable for PCE rules by proving that dynamic modalities can be automatically eliminated.

Keywords and phrases:
Separation logic, Dynamic logic, Entailment problem
Copyright and License:
[Uncaptioned image] © Nicolas Peltier; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Logic and verification
; Theory of computation Automated reasoning
Acknowledgements:
The author wishes to thank the anonymous referees for their valuable comments.
Funding:
This work has been partially funded by the French National Research Agency under project ANR-21-CE48-0011.
Editors:
Stefano Guerrini and Barbara König

1 Introduction

Separation Logic (SL) has emerged as a central formalism for reasoning about mutable data structures in program verification [14, 17]. Its core contribution lies in enabling local reasoning: the ability to specify and verify properties of program fragments by focusing only on the memory cells they access, without requiring global knowledge of the entire heap. This locality principle has proved useful in scaling formal verification to realistic programs, particularly those involving pointer manipulation and dynamic memory allocation. At the heart of SL is the separating conjunction, a connective that expresses spatial separation between heap fragments. Combined with inductive definitions with a fixpoint semantics, this allows for elegant and concise specifications of custom linked data structures such as lists or trees. This gives rise to rich logical systems that support expressive specifications. These extensions introduce significant challenges for automation: while satisfiability is decidable [2], the entailment problem – deciding whether one SL formula is a logical consequence of another – is undecidable in general. Consequently, a substantial body of work has been devoted to identifying fragments of Separation Logic with recursive definitions for which the entailment problem is decidable (see, e.g., [1, 3, 4, 11, 10, 6, 13, 18]). Among these, a particularly expressive and well-structured class of inductive definitions, known as PCE rules (for Progressing, Connected, and Established), was introduced in [12]. For this class, entailment in SL was shown to be 2-ExpTime complete [15]. The original proof is based on a reduction to monadic second-order logic (MSO) over graphs of bounded tree width, a highly general approach that, however, does not yield efficient procedures in practice. More recently, optimal (doubly exponential) decision procedures for the PCE fragment have been proposed (e.g., [15, 9]), significantly improving the theoretical and practical feasibility of automated reasoning.

Despite these advances, traditional forms of SL remain insufficient to express and verify certain dynamic behaviors of programs, particularly those involving changes in control flow or temporal evolution of the heap. To address these limitations, Dynamic Separation Logic (DSL) has been proposed [5] as an extension of SL with dynamic modalities, inspired by dynamic logic. These modalities enable reasoning not only about static heap configurations but also about how these configurations evolve during program execution. By incorporating modalities for program actions, DSL enables to express the result of actions that operate on data structures directly within the logic’s syntax (using construction of the form [𝚊]ϕ, meaning that ϕ holds after action 𝚊 is applied). This extension increases the expressiveness of SL, making it well-suited for modeling and verifying complex program behaviors, including dynamic allocation patterns. This approach provides a compelling alternative to traditional methods based on Hoare logic and weakest precondition calculi [16] for reasoning about sequential heap manipulations. It avoids the use of the separating implication, which, although essential in the weakest precondition calculus (as it enables to express extensions of the heap), poses challenges for automated reasoning.

This paper builds on these foundational insights to explore the entailment problem in Dynamic Separation Logic (DSL), focusing on inductive definitions that satisfy the PCE conditions established in [12]. We prove that entailment is decidable for a specific fragment – namely, formulas built on the connectives ,, together with existential quantifications and dynamic modalities – by showing that the dynamic modalities introduced in DSL can be systematically and automatically eliminated (for PCE rules). Specifically, we present a transformation procedure that rewrites both the formulas and the inductive rules defining spatial predicates, while preserving equivalence. This reduction reduces the entailment problem in DSL to one in standard SL and enables the application of existing proof techniques and decision procedures. Remarkably, one of the crucial properties that enables this reduction is the same one that guarantees the decidability of the entailment problem [8]: the establishment property of [12]. Intuitively, this property ensures that the considered structures contain only a bounded number of “pending edges” (see Proposition 7).

The rest of the paper is structured as follows. Section 2 defines the syntax and semantics of the fragment of dynamic separation logic considered in this work. Section 3 recalls the definition of the properties of inductive rules that ensure the decidability of entailment. Section 4 introduces several useful transformations on formulas and rules, and shows that these transformations preserve equivalence under certain conditions. Section 5, the heart of the paper, presents a systematic and automatic procedure for eliminating dynamic modalities from formulas that meet the conditions defined in Section 3. Finally, Section 6 concludes the paper by outlining some interesting directions for future work.

2 Dynamic Separation Logic

We define the syntax and semantics of Dynamic Separation Logic as a natural extension of the definitions in [12], which address basic separation logic with recursive spatial predicates, and [5], which introduces dynamic modalities.

Basic notations

We begin by reviewing some basic notations. For any partial function f, 𝖽𝗈𝗆(f) denotes the domain of f, 𝑖𝑚𝑔(f) denotes its image (i.e., 𝑖𝑚𝑔(f)={f(x)x𝖽𝗈𝗆(f)}) and f|D denotes the restriction of f to D. Two partial functions f and g are disjoint if their domains are disjoint, in which case fg denotes the function h of domain 𝖽𝗈𝗆(f)𝖽𝗈𝗆(g) defined as follows:

h(x)={f(x)if x𝖽𝗈𝗆(f)g(x)if x𝖽𝗈𝗆(g)𝑢𝑛𝑑𝑒𝑓𝑖𝑛𝑒𝑑otherwise

For every function f and elements x, y, we denote by f[xy] the function such that 𝖽𝗈𝗆(f[xy])=𝖽𝗈𝗆(f){x}, f[xy](x)=y and f[xy](x)=f(x) if x𝖽𝗈𝗆(f){x}. For any binary relation , + (resp. ) denotes the transitive closure (resp. the reflexive and transitive closure) of .

Syntax

We now define the syntax of DSL. We begin by defining the notion of actions, which are atomic operations on structures, including assignments xy, look-ups xz.i, redirections x.iy, disallocations 𝚍𝚒𝚜𝚙𝚘𝚜𝚎(𝚡) and allocations x𝚌𝚘𝚗𝚜(z1,,zκ) (x is allocated with fields pointing to z1,,zκ). The semantics of actions is intuitive and will be formally defined in a later section.

Definition 1 (Actions).

Let 𝒱 be a countably infinite set of variables and let κ (denoting a number of record fields). The set of actions 𝒜 is the set of expressions of the following forms:

xy|xz.i|x.iy|𝚍𝚒𝚜𝚙𝚘𝚜𝚎(𝚡)|x𝚌𝚘𝚗𝚜(z1,,zκ)

with x,y,z𝒱, xz, z1,,zκ is a tuple of variables not containing x and i{1,,κ}.

The conditions xz and x{z1,,zκ} are meant to simplify forthcoming definitions (they are not restrictive; for instance, an action zz.1 could be replaced by a sequence of two actions zz.1 and zz, where z is a fresh variable).

The syntax of DSL formulas includes the standard logical connectives , and quantifier , as well as the special connective of separation logic and a modality [𝚊]ψ, which asserts that formula ψ holds after action 𝚊 is applied. Atomic formulas include points-to atoms y(x1,,xκ), stating that y is the only allocated locations and refers to the tuple (x1,,xκ), as well a spatial predicate atoms, which are intended to denote recursive data structures (e.g., lists or trees). As usual in SL, negations are not allowed.

Definition 2 (Syntax of Dynamic Separation Logic).

Let 𝒫 be a set of predicate symbols, where each symbol in p𝒫 is associated with a unique arity #(p). A DSL formula ϕ (or simply formula) is built inductively as follows:

p(x1,,xn)|y(x1,,xκ)|xy|x≄y|
(ϕ1ϕ2)|(ϕ1ϕ2)|(ϕ1ϕ2)|xψ|[𝚊]ψ

where n, p is a predicate in 𝒫 of arity n, x,xi and y are variables, 𝚊 is an action and ϕ1,ϕ2,ψ are formulas. The false formula is a shorthand for x≄x (where x is an arbitrary variable) and 𝚎𝚖𝚙 is a shorthand for xx.

We emphasize that x≄y it not exactly the negation of xy, as both atoms require the heap to be empty (see Definition 5). For simplicity, the syntax excludes constants (e.g., 𝚗𝚒𝚕). This is not a limitation, as constants can be readily represented by variables passed as parameters to every predicate symbol. Formulas of the form y(x1,,xκ) (resp. p(x1,,xn)) are called -atoms (resp. 𝒫-atoms). We denote by |ϕ| the size of the formula ϕ (i.e., the number of occurrences of symbols in it). If S={ϕ1,,ϕn} is a finite set of formulas, then S denotes the formula i=1nϕi. For every formula ϕ we denote by 𝖿𝗏(ϕ) the set of variables freely occurring in ϕ.

A formula is static if it contains no subformula of the form [𝚊]ψ. A symbolic heap is a static formula that contains no occurrence of or . If x=(x1,,xn) and y=(y1,,yn) are tuples of variables, then xy is a shorthand for i=1n(xiyi) (we use instead of to obtain a symbolic heap).

We now introduce the inductive rules that define the semantics of the predicates in 𝒫. A set of inductive rules (SID) is a set of rules p(x1,,xn)ϕ, where p is a predicate of arity n in 𝒫 and ϕ is a symbolic heap such that 𝖿𝗏(ϕ){x1,,xn}. We assume that for any given predicate p there are finitely many rules of the above form (but the sets 𝒫 and may be infinite). Examples of inductive definitions will be presented in a later section. Given two predicate symbols p,q𝒫, we write pq if contains a rule of the form p(x1,,xn)ϕ where q occurs in ϕ. Note that actions are not allowed inside inductive rules (such rules are used to denote recursive data structures of unbounded size, not sequences of operations).

A substitution is a mapping from variables to variables. If x1,,xn are pairwise distinct, then the set {xiyi1in} denotes a substitution σ such that σ(xi)=yi for all i{1,,n} and σ(z)=z if z{x1,,xn}. For any expression (formula, variable or tuples of variables) ϕ and substitution σ, ϕσ denotes the expression obtained from ϕ by replacing every free occurrence of every variable x by σ(x) (using α-renaming to avoid variable capture).

If is a SID, we write ψψ (and say that “ψ unfolds to ψ”) if contains a rule p(x1,,xn)ϕ and ψ is obtained from ψ by replacing one occurrence of a formula p(y1,,yn) by ϕ{xiyi1in} (i.e., the formal parameters xi are replaced by the actual parameters yi, the existential variables in ϕ are renamed if needed to avoid collisions with variables occurring in ψ).

Semantics

We are now in the position to define the semantics of DSL. The formulas are interpreted in structures defined as follows.

Definition 3 (Structures).

Let be a countably infinite set of locations. A store is a function mapping every variable to a location. A heap is a partial function mapping some locations to κ-tuples of locations, with a finite domain. A structure is a pair (𝔰,𝔥), where 𝔰 is a store and 𝔥 is a heap.
A location (resp. a variable x) is allocated in a heap 𝔥 (resp. in a structure (𝔰,𝔥)) if 𝖽𝗈𝗆(𝔥) (resp. if 𝔰(x)𝖽𝗈𝗆(𝔥)).

A heap 𝔥 of domain 1,,n with 𝔥(i)=ti for all i{1,,n} is denoted by {1t1,,ntn}. We denote by |𝔥| the size of 𝔥, i.e., the cardinality of 𝖽𝗈𝗆(𝔥) (which is finite by hypothesis) and by 𝑙𝑜𝑐𝑠(𝔥) the set of locations occurring in 𝔥, i.e.: 𝑙𝑜𝑐𝑠(𝔥)={i0𝖽𝗈𝗆(𝔥),𝔥(0)=(1,,κ),0iκ}.

The relation 𝚊 formalizes the effect of applying an action on a structure:

Definition 4 (Applying Actions on Structures).

Let (𝔰,𝔥) and (𝔰,𝔥) be two structures and let 𝚊𝒜. We write (𝔰,𝔥)𝚊(𝔰,𝔥) if one of the following assertions holds:

  • 𝚊=xy, 𝔥=𝔥 and 𝔰=𝔰[x𝔰(y)]

  • 𝚊=x.iy, 𝔰=𝔰, 𝔥(𝔰(x))=(1,,κ) and 𝔥 is the following heap:
    𝔥=𝔥[𝔰(x)(1,,i1,𝔰(y),i+1,,κ)].

  • 𝚊=xy.i, 𝔥=𝔥, 𝔥(𝔰(y))=(1,,κ) and 𝔰=𝔰[xi].

  • 𝚊=𝚍𝚒𝚜𝚙𝚘𝚜𝚎(𝚡), 𝔰=𝔰, 𝔰(x)𝖽𝗈𝗆(𝔥) and 𝔥 is the restriction of 𝔥 such that 𝖽𝗈𝗆(𝔥)=𝖽𝗈𝗆(𝔥){𝔰(x)}.

  • 𝚊=x𝚌𝚘𝚗𝚜(y1,,yκ), 𝖽𝗈𝗆(𝔥), 𝔰=𝔰[x], 𝔥=𝔥[(𝔰(y1),,𝔰(yκ))].

An action 𝚊 fails on (𝔰,𝔥) if there is no structure (𝔰,𝔥) such that (𝔰,𝔥)𝚊(𝔰,𝔥).

The satisfiability relations n and are defined as follows (the exponent n denotes the maximal number of nested applications of inductive rules in ).

Definition 5 (Satisfiability Relation).

We write (𝔰,𝔥)nϕ if one of the following conditions holds:

  • ϕ is of the form (xy) (resp. (x≄y)), 𝔥= and 𝔰(x)=𝔰(y) (resp. (𝔰(x)𝔰(y)).

  • ϕ is of the form x(y1,,yκ) and 𝔥={𝔰(x)(𝔰(y1),,𝔰(yκ))}.

  • ϕ is of the form ϕ1ϕ2 (resp. ϕ1ϕ2) and (𝔰,𝔥)nϕi holds for some i{1,2} (resp. for all i{1,2}).

  • ϕ is of the form ϕ1ϕ2 and there exist disjoint heaps 𝔥1,𝔥2 such that 𝔥=𝔥1𝔥2 and (𝔰,𝔥i)nϕi, for all i{1,2}.

  • ϕ is of the form xψ and there exists such that (𝔰[x],𝔥)nψ.

  • ϕ is of the form p(x1,,xn), ϕψ, n>0 and (𝔰,𝔥)n1ψ.

  • ϕ is of the form [𝚊]ψ, 𝚊 does not fail on (𝔰,𝔥) and (𝔰,𝔥)nψ for all (𝔰,𝔥) such that (𝔰,𝔥)𝚊(𝔰,𝔥).

We write (𝔰,𝔥)ϕ if (𝔰,𝔥)nϕ for some n, and in this case (𝔰,𝔥) is called an -model of ϕ. We write ϕψ if the entailment (𝔰,𝔥)ϕ(𝔰,𝔥)ψ holds for all structures (𝔰,𝔥), and ϕψ if we have both ϕψ and ψϕ.

It is straightforward to verify that nn+1 for all n. Moreover, if ϕ contains no predicate symbols, then the satisfiability relation does not depend on , and we may write (𝔰,𝔥)ϕ instead of (𝔰,𝔥)ϕ. Finally, if (𝔰,𝔥)ϕ, then there exists a formula ψ containing no symbols from 𝒫 such that ϕψ and (𝔰,𝔥)ψ.

Note that equalities and disequalities are satisfied only by structures with an empty heap. This convention simplifies the notation by allowing us to omit standard conjunctions in certain cases, and it is not restrictive in our setting. Also note that there is no formula that is satisfied by all structures – this property is essential for the decidability of entailment in standard SL, if standard conjunctions are allowed [15].

3 PCE Rules

We now recall several definitions from [12], introducing conditions on the inductive rules that, in standard Separation Logic, ensure the decidability of the entailment problem. Intuitively, these conditions ensure that each rule allocates exactly one location, that the set of allocated locations has a tree-shaped structure, and that every location is either allocated or associated with a free variable.

Definition 6 (Progress, Connectedness and Establishment (PCE)).

A rule p(x1,,xn)yϕ is:

  • progressing if ϕ is of the form x1(z1,,zκ)ϕ, where ϕ contains no -atom (i.e., the rule allocates exactly one location x1);

  • connected if, moreover, every predicate atom in ϕ is of the form q(z,v) with z{z1,,zκ} (i.e., the locations allocated by the called predicates are successors of x1).

A SID is progressing (resp. connected) if all the rules in are progressing (resp. connected). It is established if for every atom p(x1,,xn) and for every formula ϕ containing no predicate symbol, if p(x1,,xn)ϕ and x is existentially quantified in ϕ then ϕ contains atoms yiyi+1 (for i=0,,n, with n0) such that x=yn+1 and either ϕ contains a -atom of the form y0(z) or y0{x1,,xn} (i.e., every existentially quantified variable either is equal to a free variable or is eventually allocated).

The following proposition recalls a key property of PCE rules: in every model of a quantifier-free formula, all locations that do not correspond to free variables are allocated.

Proposition 7.

Let ϕ be a static formula containing no quantifier. Let (𝔰,𝔥) be an -model of ϕ. If is PCE, then 𝑙𝑜𝑐𝑠(𝔥)𝖽𝗈𝗆(𝔥){𝔰(x)x𝖿𝗏(ϕ)}.

Example 8.

The following rules, defining a non empty list segment from x to y are PCE:

𝚕𝚜𝚎𝚐(x,y)x(y)𝚕𝚜𝚎𝚐(x,y)z(x(z)𝚕𝚜𝚎𝚐(z,y))

In contrast, the following rules, defining the same structures, are not PCE, because the second rule contains no -atom (hence is not progressing):

𝚕𝚜𝚎𝚐(x,y)x(y)𝚕𝚜𝚎𝚐(x,y)z(𝚕𝚜𝚎𝚐(x,z)𝚕𝚜𝚎𝚐(z,y))

The following rules, defining a list segment with last cell z, are not connected.

𝚕𝚜𝚎𝚐′′(z,x,y)z(y)zx𝚕𝚜𝚎𝚐′′(z,x,y)u(z(y)𝚕𝚜𝚎𝚐(u,x,z))

The following PCE rules define a tree rooted at x, where all nodes have an additional pointer to their parent node y and the leaves point to z:

𝚝𝚛𝚎𝚎(x,y,z)x1,x2(x(x1,x2,y)𝚝𝚛𝚎𝚎(x1,x,z)𝚝𝚛𝚎𝚎(x2,x,z))𝚝𝚛𝚎𝚎(x,y,z)x(z,z,y)

4 Some Basic Transformations on Inductive Predicates

In this section, we introduce a set of transformations that apply to formulas and the inductive rules defining the predicates they contain. These transformations preserve equivalence (under certain conditions) and will serve as the foundation for the algorithm that eliminates modalities, presented in the next section. We begin with the notion of context predicates (borrowed and adapted from [18, 9]), which enable the extraction of some predicate calls q from the rules of a predicate symbol p, lifting them to the initial formula.

Definition 9 (Context Predicates).

For every pair of predicates p,q with #(p)=n and #(q)=m, we define a predicate (qp) of arity n+m associated with the following rules, for each rule of the form p(u1,,un)w(u1(y)p(z)ψ) in (modulo AC):

(qp)(u1,,un,v1,,vm)w(u1(y)(qp)(z,v1,,vm)ψ)
(qp)(u1,,un,v1,,vm)w(u1(y)z(v1,,vm)ψ) if q=p

The rules of (qp)(x1,,xn,y1,,ym) are obtained from those of p(x1,,xn) by removing exactly one call to the atom q(y1,,ym) (occurring at some non-root position in the derivation tree). Consequently, (qp)(x1,,xn,y1,,ym) is satisfied by all (non-empty) structures that will satisfy p(x1,,xn) after a disjoint heap satisfying q(y1,,ym) is added to the current heap. It is easy to check that the rules of (qp) fulfill the conditions of Definition 6.

Example 10.

Let p,q be predicates associated with the following rules:

p(x)y,z(x(y,z)p(y)q(z,y))q(z,y)z(z(z,z)q(z,z))q(z,y)z(y,y)

The predicate (qp) is defined as follows:

(qp)(x,u,v)y,z(x(y,z)(qp)(y,u,v)q(z,y))(qp)(x,u,v)y,z(x(y,z)p(y)(qq)(z,y,u,v))(qp)(x,u,v)y,z(x(y,z)p(y)zuyv)(qq)(z,y,u,v)z(z(z,z)(qq)(z,z,u,v))(qq)(z,y,u,v)z(z(z,z)zuzv)

The following lemma states that qp denotes the structures obtained by removing the subheap satisfying q from a structure that satisfies p.

Lemma 11.

Assume that is PCE. Let (𝔰,𝔥) be a structure, let x be a variable and let p(y1,,yn) be a formula. If 𝔰(x)dom(𝔥) and 𝔰(x)𝔰(y1) then the two following assertions are equivalent:

  • (𝔰,𝔥)p(y1,,yn).

  • There exists a predicate q of arity m, pairwise distinct variables z2,,zm, distinct from x,y1,,yn and locations 2,,n such that p+q and:

    (𝔰^,𝔥)(qp)(y1,,yn,x,z2,,zm)q(x,z2,,zm)

    with 𝔰^=𝔰[ziii{2,,m}].

The following result follows immediately from Lemma 11:

Corollary 12.

Assume that is PCE. Let (𝔰,𝔥) be a structure such that 𝔰(x)𝖽𝗈𝗆(𝔥). Let (zi)i be a sequence of pairwise distinct variables, all distinct from x,y1,,yn. Then the following equivalence holds:

(𝔰,𝔥)y1≄xp(y1,,yn)(𝔰,𝔥)y1≄x{ϕqp+q}

with ϕq=z2,,zm((qp)(y1,,yn,x,z2,,zm)q(x,z2,,zm)) and m=#(q).

The following definition associates each pair (ϕ,x), consisting of a static formula ϕ and a variable x, with a formula ϕ𝙽(x). This transformation enriches ϕ by explicitly adding assertions that ensure x is not allocated (see Lemma 15). It also implicitly extends the SID by introducing new predicate symbols and rules, which enforce that x is not allocated within the data structures described by the predicates occurring in ϕ.

Definition 13.

Let ϕ be a static formula and let x be a variable. We denote by ϕ𝙽(x) the formula inductively defined as follows.

  • If ϕ is of the form yz or y≄z then ϕ𝙽(x)=ϕ.

  • If ϕ is of the form x(y1,,yκ) then ϕ𝙽(x)=ϕ(x≄x).

  • If ϕ=ϕ1ϕ2 then ϕ𝙽(x)=ϕ1𝙽(x)ϕ2.

  • If ϕ=ϕ1ϕ2 (with {,}) then ϕ𝙽(x)=ϕ𝙽(x)ϕ2𝙽(x).

  • If ϕ=yψ then ϕ𝙽(x)=yψ𝙽(x) (we assume by α-renaming that xy).

  • If ϕ=p(x1,,xn) then ϕ𝙽(x)=p(x1,,xn,x) if p is a predicate symbol of arity n+1, associated with rules of the form p(y1,,yn,y)ϕ𝙽(y), for all rules of the form p(y1,,yn)ϕ occurring in .

Note that, alternatively, one could define ϕ1ϕ2𝙽(x) as ϕ𝙽(x)ϕ2𝙽(x); however, the chosen definition is more flexible and tends to yield simpler formulas. Due to the commutativity of , the transformation can be applied to either conjunct without loss of generality. Since the transformation can be applied recursively, it may generate predicates of the form p, p, and so on. Consequently, both the set of rules and the set of predicates 𝒫 are infinite. This is not problematic in practice, as new predicates and rules are generated on demand.

Example 14.

Let ϕ be the formula y(u,v)(p(u)p(v)) where p is defined as in Example 10. Then ϕ𝙽(x) is y(u,v)y≄x(p(u,x)p(v,x)), where p is defined as follows (x is renamed into x in the first rule to avoid conflict):

p(x,x)y,z(x(y,z)x≄xp(y,x)q(z,y,x))q(z,y,x)z(z(z,z)x≄zq(z,z,x))q(z,y,x)z(y,y)z≄x

Note that in every model of ϕ, x is not allocated, because each -atom u() is associated with a disequation x≄u.

We now establish the soundness of the transformation. Lemma 15 shows that ϕ𝙽(x) indeed captures the intended properties, i.e., that ϕ is true and x is not allocated.

Lemma 15.

For every structure (𝔰,𝔥), for every static formula and for every variable x, the following equivalence holds:

(𝔰,𝔥)ϕ𝙽(x)(𝔰,𝔥)ϕ𝔰(x)𝖽𝗈𝗆(𝔥)

We now introduce a similar but slightly more complex transformation. It associates every formula ϕ and variables x,y1,,yκ with a formula ϕ|x(y1,,yκ) which is intended to denote the structures in which ϕ holds after a mapping x(y1,,yκ) is added to the heap (see Lemma 18). In other words ϕ|x(y1,,yκ) is equivalent to the formula (x(y1,,yκ))ϕ, where is the usual separating implication (a.k.a. “magic wand”) of SL (as defined for instance in [17]).

Definition 16.

Assume that is PCE. Let ϕ be a static formula and let x,y1,,yκ be variables. We denote by ϕ|x(y1,,yκ) the formula inductively defined as follows.

  • If ϕ is of the form yz or y≄z then ϕ|x(y1,,yκ)=.

  • If ϕ is of the form x(y1,,yκ) then ϕ|x(y1,,yκ)=(xx)i=1κ(yiyi).

  • If ϕ=ϕ1ϕ2 (with {,}) then ϕ|x(y1,,yκ)=ϕ1|x(y1,,yκ)ϕ2|x(y1,,yκ).

  • If ϕ=ϕ1ϕ2 then ϕ|x(y1,,yκ) is the formula: (ϕ1|x(y1,,yκ)ϕ2)(ϕ1ϕ2|x(y1,,yκ)).

  • If ϕ=zψ then ϕ|x(y1,,yκ)=zψ|x(y1,,yκ) (we assume by α-renaming that z{x,y1,,yκ}).

  • If ϕ=p(z1,,zn) and z1=x then p(z1,,zn)|x(y1,,yκ) is:

    {u(ψj=1κ(yiyi))p(z1,,zn)u(z1(y1,,yκ)ψ)}

    Note that the above set is finite (up to a renaming of variables) as there are finitely many rules associated with any given predicate p.

  • If ϕ=p(z1,,zn) and z1x then ϕ|x(y1,,yκ) is:

    (p(x,z2,,zn)|x(y1,,yκ)(z1x))p+q,#(q)=m(u2,,umq(x,u2,,um)|x(y1,,yκ)(qp)(z1,,zn,x,u2,,um)(z1≄x))

It is straightforward to check that the computation of ϕ|x(y1,,yκ) always terminates. Indeed, in every item except the last one, the size of ϕ decreases strictly at each recursive call, whereas in the last item, all the calls are of the form r(x,z)|x(y1,,yκ) (for some r𝒫) and thus terminate immediately as there is no recursive call for the formulas of this form (see penultimate item).

Example 17.

Let ϕ be the formula x(y)𝚕𝚜𝚎𝚐(y,z), where 𝚕𝚜𝚎𝚐 is defined as in Example 8. Then ϕ|u(v) is given by the following disjunction:

xuyv𝚕𝚜𝚎𝚐(y,z)x(y)y(𝚕𝚜𝚎𝚐(y,z)yv)yux(y)z(zv(𝚕𝚜𝚎𝚐𝚕𝚜𝚎𝚐)(y,z,u,z))y≄ux(y)z,x(xv𝚕𝚜𝚎𝚐(x,z)(𝚕𝚜𝚎𝚐𝚕𝚜𝚎𝚐)(y,z,u,z))y≄u

The structures described by ϕ|u(v) are obtained by removing the mapping u(v) from the heap described by ϕ. The first disjunct corresponds to the case where the removed mapping is exactly x(y). The second disjunct handles the case where the removed mapping is the first one in the list segment 𝚕𝚜𝚎𝚐(y,z) (which entails that y=u). The third disjunct covers the case where the removed mapping is the last one in the list segment 𝚕𝚜𝚎𝚐(y,z). The fourth disjunct accounts for the case where the removed mapping is part of the structure generated by 𝚕𝚜𝚎𝚐(y,z), but is not its first or last element. The formula can be further simplified by replacing z with z (since the second argument of 𝚕𝚜𝚎𝚐 remains unchanged through recursive calls) and x,y by v (based on the equations xv and yv).

Lemma 18.

Assume that is PCE. Let (𝔰,𝔥) be a structure, let ϕ be a static formula and let x,y1,,yκ be variables. If 𝔥=𝔥{𝔰(x)(𝔰(y1),,𝔰(yκ))} (with 𝔰(x)𝖽𝗈𝗆(𝔥)), then:

(𝔰,𝔥)ϕ(𝔰,𝔥)ϕ|x(y1,,yκ)

For any static formula ϕ and variable x, we denote by ϕ𝙰(x) the formula defined as follows: z1,,zκ(x(z1,,zκ)ϕ|x(z1,,zκ)). Intuively, ϕ𝙰(x) asserts that ϕ holds and that x is allocated. The following two lemmata follow from Lemma 18.

Lemma 19.

Assume that is PCE. For every structure (𝔰,𝔥), for every static formula and variable x the following equivalence holds:

(𝔰,𝔥)ϕ𝙰(x)(𝔰,𝔥)ϕ𝔰(x)𝖽𝗈𝗆(𝔥)
Lemma 20.

For every structure (𝔰,𝔥), for every static formula and variable x the following two assertions are equivalent:

  • (𝔰,𝔥)x(y1,,yκ)ϕ|x(y1,,yκ).

  • (𝔰,𝔥)ϕ𝔰(x)=(𝔰(y1),,𝔰(yκ)).

Proof.

The proof is similar to that of Lemma 19.

5 Elimination of Modalities

Building on the results in Section 4, we now show how dynamic modalities can be eliminated (if the rules satisfy the PCE conditions), thereby proving that any formula can be transformed into an equivalent static formula. We distinguish several cases, depending on the actions considered. In essence, eliminating modalities reduces to computing the weakest precondition of the corresponding modal formulas. The case of assignments can be handled using the following standard property:

Proposition 21.

For all static formulas ϕ and all variables x,y: [xy]ϕϕ{xy}

Desallocations [𝚍𝚒𝚜𝚙𝚘𝚜𝚎(𝚡)]ϕ are also straightforward to handle: it is sufficient to assert that the desallocated variable x is initially allocated and that the remainder of the heap satisfies ϕ:

Proposition 22.

For all static formulas ϕ for all variables x, and for all pairwise distinct variables y1,,yκ not occurring in ϕ:

[𝚍𝚒𝚜𝚙𝚘𝚜𝚎(𝚡)]ϕy1,,yκ(x(y1,,yκ)ϕ)
Example 23.

Consider the formula ϕ=[yx][𝚍𝚒𝚜𝚙𝚘𝚜𝚎(𝚢)]𝚕𝚜𝚎𝚐(x,x). We get:

ϕ[yx]z(y(z)𝚕𝚜𝚎𝚐(x,x))(Proposition 22)z(x(z)𝚕𝚜𝚎𝚐(x,x))(Proposition 21)

While the previous reductions (for assignments and deallocations) apply to any formula and set of rules, the remaining actions are more challenging to address. Their handling relies on the transformations described in Section 4, which crucially depend on the rules being PCE. We begin by presenting results that aim to enforce additional properties on the formulas appearing under the considered modality, based on the semantics of actions and their post-conditions. These properties will later simplify the elimination of modalities. We first consider redirections and look-ups:

Lemma 24.

Assume that is PCE. Let ϕ be a static formula. If 𝚊 is an action of the form x.iy or yx.i, then: [𝚊]ϕ[𝚊]ϕ𝙰(x)

Allocations are addressed in a similar way, using Lemma 20:

Lemma 25.

Assume that is PCE. Let ϕ be a static formula. If 𝚊 is an action of the form x𝚌𝚘𝚗𝚜(y1,,yκ), then: [𝚊]ϕ[𝚊](x(y1,,yκ)ϕ|x(y1,,yκ)))

Next, Lemma 26 can be applied to eliminate redirection modalities, provided that the considered formula has a specific form, which will be ensured by applying Lemma 24.

Lemma 26.

For all formulas ϕ, for all variables x,y1,,yn,y, for all i{1,,κ}, for all sequences of variables z (not containing x or y) and for all variables u not occurring in x,y1,,yn,y, z or ϕ, the following equivalence holds:

[x.iy]z(x(y1,,yκ)ϕ))zu(x(y1,,yi1,u,yi+1,yκ)ϕyiy) (1)

Proof.

Let (𝔰,𝔥) be a structure. By Definition 4, x.iy fails on (𝔰,𝔥) if 𝔰(x)𝖽𝗈𝗆(𝔥). Moreover, (𝔰,𝔥)x.iy(𝔰,𝔥) exactly when 𝔰(x)𝖽𝗈𝗆(𝔥), 𝔰=𝔰 and 𝔥=𝔥[𝔰(x)(1,,i1,𝔰(y),i+1,,κ)] with 𝔥(𝔰(x))=(1,,κ).

  • Assume that (𝔰,𝔥)[x.iy]z(x(y1,,yκ)ϕ)). By Definition 5, we deduce that x.iy does not fail on (𝔰,𝔥) (i.e., 𝔰(x)𝖽𝗈𝗆(𝔥)), and that (𝔰,𝔥)(z(x(y1,,yκ)ϕ), with 𝔥=𝔥[𝔰(x)(1,,i1,𝔰(y),i+1,,κ)] and 𝔥(𝔰(x))=(1,,κ). Consequently, there exist a vector of locations m and disjoint heaps 𝔥1,𝔥2 such that 𝔥1𝔥2=𝔥, (𝔰[zm],𝔥1)x(y1,,yκ) and (𝔰[zm],𝔥2)ϕ. This entails that 𝖽𝗈𝗆(𝔥1)={𝔰(x)} (as x does not occur in z), 𝖽𝗈𝗆(𝔥2)=𝖽𝗈𝗆(𝔥){𝔰(x)}, 𝔰[zm](yj)=j, for all j{1,,i1,i+1,,κ} and 𝔰[zm](yi)=𝔰(y)=𝔰[zm](y) (as y does not occur in z). This implies that 𝔥={𝔰(x)(1,,κ)}𝔥2, and that (𝔰[zm],{𝔰(x)(1,,κ)})ux(y1,,yi1,u,yi+1,,yκ). Consequently, (𝔰[zm],𝔥)u(x(y1,,yi1,u,yi+1,,yκ)ϕ). Since 𝔰[zm](yi)=𝔰[zm](y), we also have (𝔰[zm],𝔥)u(x(y1,,yκ)ϕyyi), so that (𝔰,𝔥) is an -model of zu(x(y1,,yi1,u,yi+1,yκ)ϕyiy).

  • Assume that (𝔰,𝔥)zu(x(y1,,yi1,u,yi+1,yκ)ϕyiy). This means that there exist a sequence of locations m, and disjoint heaps 𝔥1,𝔥2 such that 𝔥=𝔥1𝔥2, (𝔰[zm,u],𝔥1)x(y1,,yi1,u,yi+1,yκ), (𝔰[zm,𝔥2)ϕ and 𝔰[zm](yi)=𝔰[zm](y)=𝔰(y) (as uyi and y does not occur in z). Therefore 𝖽𝗈𝗆(𝔥1)={𝔰[zm,u](x)}={𝔰(x)} (as x does not occur in z,u), 𝖽𝗈𝗆(𝔥2)=𝖽𝗈𝗆(𝔥){𝔰(x)}, and 𝔥(𝔰(x))=𝔥1(𝔰(x))=(1,,κ), with i=𝔰[zm,u](u)= and j=𝔰[zm,u](yi)=𝔰[zm](yi) for all j{1,,i1,i+1,,κ}. Let 𝔥1 be the heap {𝔰(x)(1,,i1,𝔰(y),i+1,,κ)}. From the previous assertions we derive that (𝔰[zm],𝔥1)x(y1,,yκ). As 𝔰(x)𝖽𝗈𝗆(𝔥), x.iy does not fail on (𝔰,𝔥). Let 𝔥=𝔥[𝔰(x)(1,,i1,𝔰(y),i+1,,κ)]. It is clear that 𝔥=𝔥1𝔥2, so that (𝔰[zm],𝔥)x(y1,,yκ)ϕ, and thus (𝔰,𝔥)z(x(y1,,yκ)ϕ). It follows that (𝔰,𝔥)[x.iy]z(x(y1,,yκ)ϕ)).

Example 27.

Let ϕ=[x.1y]𝚕𝚜𝚎𝚐(x,x). We get:

ϕ[x.1y]𝚕𝚜𝚎𝚐(x,x)𝙰(x)(Lemma 24)[x.1y]z(x(z)𝚕𝚜𝚎𝚐(x,x)|x(z))[x.1y]z,z(x(z)zz𝚕𝚜𝚎𝚐(z,x))(Definition 16)z,z,u(x(u)zz𝚕𝚜𝚎𝚐(z,x)zy)(Lemma 26)u(x(u)𝚕𝚜𝚎𝚐(y,x))

A similar result holds for look-ups (we recall that actions yx.i with y=x are not allowed in the syntax):

Lemma 28.

For all formulas ϕ, for all variables x,y1,,yn,y (with xy), for all i{1,,κ}, and for all sequences of variables z (not containing x or y), the following equivalence holds: [yx.i]z(x(y1,,yκ)ϕ))z(x(y1,,yκ))ϕ){yyi})

It remains to consider the case of allocation actions [x𝚌𝚘𝚗𝚜(y1,,yκ)]ϕ. This introduces new challenges, because the action associates the variable x with a fresh, unallocated location . We need to ensure that the formula ϕ holds for all possible choices of (provided is unallocated). The most natural way to express this would be through universal quantification or separating implication. However, this is not feasible within our fragment – these constructs are not supported by existing entailment procedures for separation logic with inductive definitions. To address this, we establish Lemma 30 below. Intuitively, it states that the truth value of a static formula within a structure remains unchanged when some locations are replaced, as long as the replacement preserves variable aliasing and does not affect the heap. This will allow us to consider only a finite number of possible choices for the location as all locations outside the image of the store behave identically. More formally, we introduce the following equivalence relation on structures:

Definition 29.

Let (𝔰i,𝔥i) (for i{1,2}) be two structures and let V be a finite set of variables. We write (𝔰1,𝔥1)V(𝔰2,𝔥2) if the three following conditions are fulfilled:

  1. 1.

    𝔥1=𝔥2.

  2. 2.

    The equivalence 𝔰1(x)=𝔰1(y)𝔰2(x)=𝔰2(y) holds for all variables x,yV.

  3. 3.

    For all variables xV, if 𝔰1(x)𝑙𝑜𝑐𝑠(𝔥1) or 𝔰2(x)𝑙𝑜𝑐𝑠(𝔥1) then 𝔰1(x)=𝔰2(x).

Lemma 30.

Let (𝔰i,𝔥i) (for i{1,2}) be two structures with (𝔰1,𝔥1)𝖿𝗏(ϕ)(𝔰2,𝔥2). Let ϕ be a static formula. If (𝔰1,𝔥1)nϕ then (𝔰2,𝔥2)nϕ.

Proof.

The result is established by induction on (n,|ϕ|). By Definition 29 (1) 𝔥1=𝔥2.

  • If ϕ=(xy) then, as (𝔰1,𝔥1)ϕ, we must have 𝔥1= and 𝔰1(x)=𝔰1(y), thus 𝔰2(x)=𝔰2(y) by Definition 29 (2), and (𝔰2,𝔥1)ϕ. The proof is similar if ϕ=(x≄y).

  • If ϕ=y0(y1,,yκ) then 𝔥1={𝔰1(y0)(𝔰1(y1),,𝔰1(yκ))} thus 𝔰1(yi)𝑙𝑜𝑐𝑠(𝔥1) for all i{0,,κ}. Consequently 𝔰1(yi)=𝔰2(yi) by Definition 29 (3) and 𝔥1={𝔰2(y0)(𝔰2(y1),,𝔰2(yκ))}. Hence (𝔰2,𝔥1)nϕ.

  • If ϕ=ϕ1ϕ2 then (𝔰1,𝔥1)nϕi for some i{1,2}. By the induction hypothesis we get (𝔰2,𝔥2)nϕi and (𝔰2,𝔥1)nϕ.

  • The proof is similar if ϕ=ϕ1ϕ2.

  • If ϕ=ϕ1ϕ2 then there exist heaps 𝔥11,𝔥12 such that 𝔥1=𝔥11𝔥12 and (𝔰1,𝔥1i)nϕi for all i{1,2}. It is straightforward to verify that (𝔰1,𝔥1i)𝖿𝗏(ϕ)(𝔰2,𝔥1i), as 𝑙𝑜𝑐𝑠(𝔥1i)𝑙𝑜𝑐𝑠(𝔥1). By the induction hypothesis, we get (𝔰2,𝔥1i)nϕi (for all i{1,2}) thus (𝔰2,𝔥1)nϕ.

  • If ϕ=xψ then there exists 1 such that (𝔰1[x],𝔥1)ψ. We distinguish several cases. In every case we show that there exists a location 2 such that (𝔰1[x1],𝔥1)𝖿𝗏(ψ)(𝔰2[x2],𝔥1), i.e., such that Conditions 2 and 3 in Definition 29 both hold.

    • If 1𝑙𝑜𝑐𝑠(𝔥1) then we take 2=1. It is easy to check that Condition 3 holds, as it trivially holds for x and it also holds for all y𝖿𝗏(ψ){x} since 𝔰1𝖿𝗏(ϕ)𝔰2 by hypothesis and 𝔰i[xi] coincides with 𝔰i on all yx. Now consider two variables u,v𝖿𝗏(ψ). We show that 𝔰1[x1](u)=𝔰1[x1](v)𝔰2[x2](u)=𝔰2[x2](v). The proof is trivial if u=v, thus we assume that uv.

      • *

        If u,v are both distinct from x then 𝔰1[x1](u)=𝔰1[x1](v)𝔰1(u)=𝔰1(v)𝔰2(u)=𝔰2(v) (as 𝔰1𝖿𝗏(ϕ)𝔰2 and u,v𝖿𝗏(ϕ)). Thus the above equivalence holds.

      • *

        If one of the variables, say u is x, and if, for some i{1,2}, 𝔰i[xi](u)=𝔰i[xi](v), then, as 1𝑙𝑜𝑐𝑠(𝔥1) and 2=1, we get 1=𝔰i[xi](v)=𝔰i(v)𝑙𝑜𝑐𝑠(𝔥1) and by Condition 3, 𝔰i(v)=𝔰3i(v), thus 𝔰3i[x3i](u)=𝔰3i[x3i](v).

    • If 1𝑙𝑜𝑐𝑠(𝔥1) and 1=𝔰1(y) for some variable y𝖿𝗏(ϕ) then we take 2=𝔰2(y). We show that Condition 3 holds. Assume that 𝔰i[xi](y)𝑙𝑜𝑐𝑠(𝔥1) for some i{1,2}. Since y𝖿𝗏(ϕ), yx, which entails that 𝔰i(y)𝑙𝑜𝑐𝑠(𝔥1), and thus 𝔰i(y)=𝔰3i(y) by Condition 3. Then we show that Condition 2 holds. Consider two variables u,v𝖿𝗏(ψ) and assume that 𝔰i[xi](u)=𝔰i[xi](v) for some i{1,2}. We show that 𝔰3i[x3i](u)=𝔰3i[x3i](v). We may assume, w.l.o.g., that uv. If one of the variables, say u, is x, then we get 𝔰i(y)=i=𝔰i[xi](v)=𝔰i(v), hence 3i=𝔰3i(y)=𝔰3i(v) by Condition 2, as (𝔰1,𝔥1)𝖿𝗏(ϕ)(𝔰2,𝔥1). Thus 𝔰3i[x3i](u)=𝔰3i[x3i](v). If x{u,v} then {u,v}𝖿𝗏(ϕ) and the proof follows from the fact that (𝔰1,𝔥1)𝖿𝗏(ϕ)(𝔰2,𝔥1).

    • Otherwise (i.e., if 1𝔰1(𝖿𝗏(ϕ))𝑙𝑜𝑐𝑠(𝔥1)), 2 is any location not occurring in 𝔰2(𝖿𝗏(ϕ))𝑙𝑜𝑐𝑠(𝔥2) (such a location exists as is infinite). Condition 3 trivially holds for x as {1,2}𝑙𝑜𝑐𝑠(𝔥1)=, and also holds for all variables y distinct from x since 𝔰i[xi] coincides with 𝔰i on all yx. Now consider two variables u,v𝖿𝗏(ψ) and assume that 𝔰i[xi](u)=𝔰i[xi](v) for some i{1,2}. We show that 𝔰3i[x3i](u)=𝔰3i[x3i](v). The proof is immediate if u=v, thus we assume that uv. This implies that x{u,v}, as i𝔰i(𝖿𝗏(ϕ)) (due to the conditions above on 1 and to the choice of 2), so that {u,v}𝖿𝗏(ϕ). Then the proof follows from the fact that (𝔰1,𝔥1)𝖿𝗏(ϕ)(𝔰2,𝔥1), as 𝔰i[xi](y)=𝔰i(y) for all yx.

    Consequently, we get in all cases (𝔰2[x2],𝔥1)nψ by the induction hypothesis, which implies that (𝔰2,𝔥1)nϕ.

  • Assume that ϕ is of the form p(x1,,xn). By Definition 5, there exists a formula ψ such that ϕψ and (𝔰1,𝔥1)n1ψ. By the induction hypothesis, we get (𝔰2,𝔥2)n1ψ, thus (𝔰2,𝔥2)n1ϕ.

Based on the previous result and on the key proposition 7, we now establish the equivalence that permits the elimination of allocations.

Lemma 31.

Assume that is PCE. Let ϕ=v1,,vmχ be a static formula in prenex form (where χ is quantifier-free) and let x,x,y1,,yκ be variables, where x𝖿𝗏(χ). Let {z1,,zn}=(𝖿𝗏(χ){x}){x}. The following equivalence holds:

[x𝚌𝚘𝚗𝚜(y1,,yκ)](x(y1,,yκ)ϕ)v1,,vm,x(ψ1ψ2ψ3)

where:

  • ψ1=χ{xx}𝙽(x);

  • ψ2=x(ϕ𝙽(x)i=1nx≄zi);

  • ψ3=i=1n(ψ1𝙰(zi)ϕ{xzi})

Intuitively, the formula ψ1 (which states that χ{xx} holds and that x is not allocated) is obtained by applying the allocation x𝚌𝚘𝚗𝚜(y1,,yκ) using any (arbitrary chosen) unallocated location x. As the resulting structure satisfies x(y1,,yκ)ϕ, there must exist v1,,vm such that χ{xx} holds, and since x is not allocated, this implies that χ{xx}𝙽(x) also holds. Afterwards, the action is applied again, this time mapping x to another unallocated location distinct from the values of all (free or existential) variables occurring in the previous formula ψ1, yielding the formula ψ2. Finally, the formula ψ3 is obtained by mapping x to each (unallocated) location zi. The disjunct ψ1𝙰(zi) is added to exclude allocated locations. To establish the converse, we observe that the locations that are unallocated and distinct from the free variables in ψ1 cannot occur in the heap (by Proposition 7), and are therefore indiscernible (by Lemma 30). Consequently, the variable x in ψ2 serves as a single representative for all such locations. More formally:

Proof.

Let (𝔰,𝔥) be a structure. By Definition 4, x𝚌𝚘𝚗𝚜(y1,,yκ) never fails on (𝔰,𝔥) (as 𝔥 is finite and is infinite) and (𝔰,𝔥)x𝚌𝚘𝚗𝚜(y1,,yκ)(𝔰,𝔥) iff 𝔰=𝔰[x] and 𝔥=𝔥{(𝔰(y1),,𝔰(yκ))}, for some 𝖽𝗈𝗆(𝔥).

  • Assume that (𝔰,𝔥)[x𝚌𝚘𝚗𝚜(y1,,yκ)](x(y1,,yκ)ϕ). Let be any location not occurring in 𝖽𝗈𝗆(𝔥). By definition of the semantics, there exist disjoint heaps 𝔥1,𝔥2 such that 𝔥{(𝔰(y1),,𝔰(yκ))}=𝔥1𝔥2, (𝔰[x],𝔥1)x(y1,,yκ) and (𝔰[x],𝔥2)ϕ. This implies that 𝔥1={(𝔰(y1),,𝔰(yκ))} and 𝔥2=𝔥 thus (𝔰[x],𝔥)ϕ, and (as ϕ=v1,,vmχ), there exist locations 1,,m such that (𝔰[x,vii1in],𝔥)χ, thus (𝔰[x,vii1in],𝔥)χ{xx}. By Lemma 15, since 𝖽𝗈𝗆(𝔥), we get (𝔰[x,vii1in],𝔥)χ{xx}𝙽(x). Hence (𝔰,𝔥)ψ1, with 𝔰=𝔰[x,vii1in]. We now prove that (𝔰,𝔥)ψ2. Let be any location not occurring in {𝔰(zi)1in}𝖽𝗈𝗆(𝔥). Using the same reasoning as before, we show (by definition of the semantics of allocations), that (𝔰[x],𝔥)ϕ𝙽(x) and therefore (𝔰[x],𝔥)ϕ𝙽(x) (since the variables v1,,vm are not free in ϕ, thus in ϕ𝙽(x)). As i=𝔰(zi) we get (𝔰[x],𝔥)ϕ𝙽(x)i=1nx≄zi which implies that (𝔰,𝔥)x(ϕ𝙽(x)i=1nx≄zi)=ψ2. Finally, we prove that (𝔰,𝔥)ψ3. Consider any i{1,,n}. If 𝔰(zi)𝖽𝗈𝗆(𝔥) then by Lemma 19, (𝔰,𝔥)ψ1𝙰(zi) (since (𝔰,𝔥)ψ1). Otherwise, by definition of the semantics, (𝔰[x𝔰(zi)],𝔥)ϕ, and therefore (𝔰,𝔥)ϕ{xzi}. Therefore, we have (𝔰,𝔥)ψ1ψ2ψ3 which implies that (𝔰,𝔥)v1,,vm(ψ1ψ2ψ3).

  • Assume that (𝔰,𝔥)v1,,vm(ψ1ψ2ψ3). Let be any location not occurring in 𝖽𝗈𝗆(𝔥), we need to show that (𝔰[x],𝔥{(𝔰(y1),,𝔰(yκ))})x(y1,,yκ)ϕ. Since (𝔰[x],{(𝔰(y1),,𝔰(yκ))})x(y1,,yκ) (as x does not occur in y1,,yκ, by Definition 1), we only have to prove that (𝔰[x],𝔥)ϕ. By definition, there exists a store 𝔰, coinciding with 𝔰 on all variables distinct from v1,,vm,x, such that (𝔰,𝔥)ψ1ψ2ψ3. We distinguish two cases.

    • Assume that =𝔰(zi), for some i{1,,n}. Then, by Lemma 19, we cannot have (𝔰,𝔥)ψ1𝙰(x) (otherwise would occur in 𝖽𝗈𝗆(𝔥)), thus we must have (𝔰,𝔥)ϕ{xzi}, hence (𝔰[x],𝔥)ϕ. Since v1,,vm,x do not freely occur in ϕ, this implies that (𝔰[x],𝔥)ϕ.

    • Assume that 𝔰(zi), for all i{1,,n}. In this case, as (𝔰,𝔥)ψ2, there exists such that (𝔰[x],𝔥)ϕ𝙽(x) and 𝔰(zi), for all i{1,,m}. By Proposition 7, since ψ1 is quantifier-free, 𝑙𝑜𝑐𝑠(𝔥)𝖽𝗈𝗆(𝔥){𝔰(u)u𝖿𝗏(ψ1)}𝖽𝗈𝗆(𝔥){𝔰(zi)1in}. Since ,𝖽𝗈𝗆(𝔥){𝔰(zi)1in}, we deduce that ,𝑙𝑜𝑐𝑠(𝔥), which implies that (𝔰[x],𝔥){z1,,zn,x}(𝔰[x],𝔥). By Lemma 30, this entails that (𝔰[x],𝔥)ϕ𝙽(x), thus (by Lemma 18) (𝔰[x],𝔥)ϕ (since v1,,vm,x are not free in ϕ).

Lemma 32.

There exists an algorithm transforming every formula (with a PCE set of rules) of the form [𝚊]γ, where γ is static, into an equivalent static formula δ.

Proof.

If 𝚊 is of the form xy, then by Proposition 21 it suffices to take δ=ϕ{xy}. If γ is of the form z(x(y1,,yκ)ϕ) and 𝚊 is of the form x.iy or yi.x then by Lemmata 26 or 28 it suffices to take δ=z(u(x(y1,,yi1,u,yi+1,yκ))ϕyiy) or δ=z((x(y1,,yκ))ϕ){yyi}) respectively. If 𝚊 is of the form x.iy or yi.x but γ is not of the form z(x(y1,,yκ)ϕ), then it suffices to apply Lemma 24, to transform γ into a formula of the latter form and get back to the previous case. If γ is of the form z(x(y1,,yκ)ϕ) and 𝚊 is of the form x𝚌𝚘𝚗𝚜(y1,,κ) then we take the formula δ=v1,,vm,x(ψ1ψ2ψ3), as defined in Lemma 31. If 𝚊 is of the form x𝚌𝚘𝚗𝚜(y1,,yκ) but γ is not of the form z(x(y1,,yκ)ϕ), then it suffices to apply Lemma 25 to get an equivalent formula of the previous form and to get back to the previous case. We derive the following theorem, which constitutes the main result of the paper:

Theorem 33.

There exists an algorithm transforming every formula (with a PCE set of rules) into an equivalent static formula.

Proof.

It suffices to apply Lemma 32 recursively, on every subformula of the form [𝚊]ϕ occurring innermost in the fomula (so that ϕ is static), until no such subformula exists (exactly one dynamic modality is eliminated at each application of the lemma). In particular, the entailment problem for DSL formulas (with PCE rules) can thus be reduced to an entailment problem in SL, which is decidable [12].

6 Future Work

We devised an algorithm for eliminating dynamic modalities from Dynamic Separation Logic formulas satisfying the PCE conditions in [12], while preserving semantic equivalence. The reduction exploits key properties of the structures generated by PCE rules. In particular, when addressing allocation actions, the fact that the structures contain a bounded number of unallocated referenced locations is essential. The result implies that entailment remains decidable for DSL PCE formulas, thereby extending the applicability of SL-based reasoning to dynamic program behaviors while retaining automation benefits.

Future work includes implementing the proposed transformation and integrating it into existing verification frameworks. Since entailment testing is doubly exponential in the worst case [7], an important research direction is to reduce the computational overhead introduced by the transformation. To this end, one could refine the transformation process to minimize the size of the resulting formulas and the number of additional inductive rules. It could also be interesting to identify subclasses of formulas and inductive definitions for which the transformation is tractable, thereby enhancing the practical usability of the presented reduction.

Another possibility would be to enrich the base SL fragment to make the transformation more efficient, by introducing new constructs that express the necessary constraints more concisely and efficiently. For example, atomic constraints stating that a variable is unallocated (or does not occur in the heap) could be added to the logic, using formulas with negations, such as: y1,,yκ¬(x(y1,,yκ)) or y0y1,,yκ(y0(y1,,yκ)i=0κ(x≄yi)). This would eliminate the need to introduce additional inductive rules to enforce these properties. Naturally, such negations must be carefully restricted to preserve the decidability of entailment, and the entailment procedure must be extended to deal with such constructs.

Extending the proposed transformation to handle rules that do not satisfy the PCE conditions could also be explored. It should be noted that inductive rules do not involve dynamic modalities. Allowing recursion in the actions would be interesting, as it would enable the expression of unbounded sequences of transformations.

References

  • [1] J. Berdine, C. Calcagno, and P. W. O’Hearn. A decidable fragment of separation logic. In Proc. of FSTTCS’04, volume 3328 of LNCS. Springer, 2004. doi:10.1007/978-3-540-30538-5_9.
  • [2] James Brotherston, Carsten Fuhs, Juan Antonio Navarro Pérez, and Nikos Gorogiannis. A decision procedure for satisfiability in separation logic with inductive predicates. In Thomas A. Henzinger and Dale Miller, editors, Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), CSL-LICS ’14, Vienna, Austria, July 14 - 18, 2014, pages 25:1–25:10. ACM, 2014. doi:10.1145/2603088.2603091.
  • [3] Cristiano Calcagno, Hongseok Yang, and Peter W O’hearn. Computability and complexity results for a spatial assertion language for data structures. In FST TCS 2001, Proceedings, pages 108–119. Springer, 2001. doi:10.1007/3-540-45294-X_10.
  • [4] B. Cook, C. Haase, J. Ouaknine, M. J. Parkinson, and J. Worrell. Tractable reasoning in a fragment of separation logic. In Proc. of CONCUR’11, volume 6901 of LNCS. Springer, 2011. doi:10.1007/978-3-642-23217-6_16.
  • [5] Frank S. de Boer, Hans-Dieter A. Hiep, and Stijn de Gouw. Dynamic separation logic. In Marie Kerjean and Paul Blain Levy, editors, Proceedings of the 39th Conference on the Mathematical Foundations of Programming Semantics, MFPS XXXIX, Indiana University, Bloomington, IN, USA, June 21-23, 2023, volume 3 of EPTICS. EpiSciences, 2023. doi:10.46298/ENTICS.12297.
  • [6] Stéphane Demri, Didier Galmiche, Dominique Larchey-Wendling, and Daniel Méry. Separation logic with one quantified variable. In CSR’14, volume 8476 of LNCS, pages 125–138. Springer, 2014. doi:10.1007/978-3-319-06686-8_10.
  • [7] Mnacho Echenim, Radu Iosif, and Nicolas Peltier. Entailment checking in separation logic with inductive definitions is 2-exptime hard. In Elvira Albert and Laura Kovács, editors, LPAR 2020: 23rd International Conference on Logic for Programming, Artificial Intelligence and Reasoning, Alicante, Spain, May 22-27, 2020, volume 73 of EPiC Series in Computing, pages 191–211. EasyChair, 2020. doi:10.29007/F5WH.
  • [8] Mnacho Echenim, Radu Iosif, and Nicolas Peltier. Entailment is undecidable for symbolic heap separation logic formulæ with non-established inductive rules. Inf. Process. Lett., 173:106169, 2022. doi:10.1016/j.ipl.2021.106169.
  • [9] Mnacho Echenim and Nicolas Peltier. A proof procedure for separation logic with inductive definitions and data. J. Autom. Reason., 67(3):30, 2023. doi:10.1007/S10817-023-09680-4.
  • [10] Constantin Enea, Ondrej Lengál, Mihaela Sighireanu, and Tomás Vojnar. Compositional entailment checking for a fragment of separation logic. Formal Methods Syst. Des., 51(3):575–607, 2017. doi:10.1007/S10703-017-0289-4.
  • [11] Constantin Enea, Mihaela Sighireanu, and Zhilin Wu. On automated lemma generation for separation logic with inductive definitions. In ATVA 2015, Proceedings, pages 80–96, 2015. doi:10.1007/978-3-319-24953-7_7.
  • [12] Radu Iosif, Adam Rogalewicz, and Jiri Simacek. The tree width of separation logic with recursive definitions. In Proc. of CADE-24, volume 7898 of LNCS, 2013.
  • [13] Radu Iosif, Adam Rogalewicz, and Tomás Vojnar. Deciding entailments in inductive separation logic with tree automata. In Franck Cassez and Jean-François Raskin, editors, ATVA 2014, Proceedings, volume 8837 of LNCS, pages 201–218. Springer, 2014. doi:10.1007/978-3-319-11936-6_15.
  • [14] Samin S Ishtiaq and Peter W O’Hearn. Bi as an assertion language for mutable data structures. In ACM SIGPLAN Notices, volume 36, pages 14–26, 2001. doi:10.1145/360204.375719.
  • [15] Christoph Matheja, Jens Pagel, and Florian Zuleger. A decision procedure for guarded separation logic complete entailment checking for separation logic with inductive definitions. ACM Trans. Comput. Log., 24(1):1:1–1:76, 2023. doi:10.1145/3534927.
  • [16] Peter W. O’Hearn, John C. Reynolds, and Hongseok Yang. Local reasoning about programs that alter data structures. In Laurent Fribourg, editor, Computer Science Logic, 15th International Workshop, CSL 2001. 10th Annual Conference of the EACSL, Paris, France, September 10-13, 2001, Proceedings, volume 2142 of LNCS, pages 1–19. Springer, 2001. doi:10.1007/3-540-44802-0_1.
  • [17] John C. Reynolds. Separation logic: A logic for shared mutable data structures. In 17th IEEE Symposium on Logic in Computer Science (LICS 2002), 22-25 July 2002, Copenhagen, Denmark, Proceedings, pages 55–74. IEEE Computer Society, 2002. doi:10.1109/LICS.2002.1029817.
  • [18] Makoto Tatsuta, Koji Nakazawa, and Daisuke Kimura. Completeness of cyclic proofs for symbolic heaps with inductive definitions. In Anthony Widjaja Lin, editor, Programming Languages and Systems - 17th Asian Symposium, APLAS 2019, Nusa Dua, Bali, Indonesia, December 1-4, 2019, Proceedings, volume 11893 of LNCS, pages 367–387. Springer, 2019. doi:10.1007/978-3-030-34175-6_19.

Appendix A Proof of Lemma 15

We use the following proposition, which is immediate to prove:

Proposition 34.

For every structure (𝔰,𝔥), static formula ϕ, natural number n, and substitution σ: (𝔰,𝔥)nϕσ(𝔰,𝔥)nϕ, where 𝔰(x)=𝔰(σ(x)), for all variables x.

We show that (𝔰,𝔥)nϕ𝙽(x)(𝔰,𝔥)nϕ𝔰(x)𝖽𝗈𝗆(𝔥) by induction on the pair (n,|ϕ|), ordered by lexicographic extension of the usual order on natural numbers (the result follows immediately).

  • If ϕ is of the form yz (with {,≄}) then ϕ𝙽(x)=ϕ and (𝔰,𝔥)nϕ only if 𝔥=, thus the proof is immediate.

  • If ϕ is of the form x(y1,,yκ) then ϕ𝙽(x)=ϕ(x≄x). Moreover, (𝔰,𝔥)nϕ only if 𝖽𝗈𝗆(𝔥)={𝔰(x)}, hence the equivalence 𝔰(x)𝖽𝗈𝗆(𝔥)𝔰(x)=𝔰(x) holds for all -models (𝔰,𝔥) of ϕ. Consequently, (𝔰,𝔥)nϕ(x≄x)(𝔰,𝔥)ϕ𝔰(x)𝖽𝗈𝗆(𝔥).

  • If ϕ is of the form ϕ1ϕ2 then ϕ𝙽(x)=ϕ1𝙽(x)ϕ2. By Definition 5, (𝔰,𝔥)nϕ𝙽(x) iff (𝔰,𝔥)nϕ1𝙽(x) and (𝔰,𝔥)nϕ2. By the induction hypothesis, (𝔰,𝔥)nϕ1𝙽(x)(𝔰,𝔥)nϕ1𝔰(x)𝖽𝗈𝗆(𝔥), hence (𝔰,𝔥)nϕ𝙽(x) is equivalent to: (𝔰,𝔥)nϕi (for all i{1,2}) and 𝔰(x)𝖽𝗈𝗆(𝔥). Thus (𝔰,𝔥)nϕ𝙽(x)(𝔰,𝔥)nϕ𝔰(x)𝖽𝗈𝗆(𝔥).

  • If ϕ is of the form ϕ1ϕ2 then ϕ𝙽(x)=ϕ1𝙽(x)ϕ2𝙽(x). By definition, (𝔰,𝔥)nϕ𝙽(x) iff (𝔰,𝔥)nϕi𝙽(x) (for some i{1,2}). By the induction hypothesis, (𝔰,𝔥)nϕi𝙽(x)(𝔰,𝔥)nϕi𝔰(x)𝖽𝗈𝗆(𝔥). Therefore the assertion i{1,2}s.t. (𝔰,𝔥)nϕi𝙽(x) holds iff i{1,2}s.t. (𝔰,𝔥)nϕi and 𝔰(x)𝖽𝗈𝗆(𝔥). Thus (𝔰,𝔥)nϕ𝙽(x) iff (𝔰,𝔥)nϕ𝔰(x)𝖽𝗈𝗆(𝔥).

  • If ϕ is of the form ϕ1ϕ2 then ϕ𝙽(x)=ϕ1𝙽(x)ϕ2𝙽(x). By Definition 5, (𝔰,𝔥)nϕ𝙽(x) iff there exist disjoint heaps 𝔥1,𝔥2 such that 𝔥=𝔥1𝔥2 and (𝔰,𝔥i)nϕi𝙽(x) (for all i{1,2}). By the induction hypothesis, (𝔰,𝔥i)nϕi𝙽(x)(𝔰,𝔥i)nϕi𝔰(x)𝖽𝗈𝗆(𝔥i), so that (𝔰,𝔥i)nϕi𝙽(x) (for all i{1,2}) iff (𝔰,𝔥i)nϕi (for all i{1,2}) and 𝔰(x)𝖽𝗈𝗆(𝔥1)𝖽𝗈𝗆(𝔥2). Thus (𝔰,𝔥)nϕ𝙽(x) iff there exist disjoint heaps 𝔥1,𝔥2 such that 𝔥=𝔥1𝔥2 and (𝔰,𝔥i)nϕi (for all i{1,2}) and x𝖽𝗈𝗆(𝔥), i.e., (𝔰,𝔥)nϕ𝙽(x)(𝔰,𝔥)nϕ𝔰(x)𝖽𝗈𝗆(𝔥).

  • If ϕ=yψ (with xy), then ϕ𝙽(x)=yϕ𝙽(x). By Definition 5, (𝔰,𝔥)nϕ𝙽(x) iff there exists such that (𝔰[y],𝔥)nψ𝙽(x). By the induction hypothesis (𝔰[y],𝔥)nψ𝙽(x) holds iff (𝔰[y],𝔥)nψ𝔰(x)𝖽𝗈𝗆(𝔥). Thus (𝔰,𝔥)nϕ𝙽(x)(𝔰,𝔥)nϕ𝔰(x)𝖽𝗈𝗆(𝔥).

  • Now assume that ϕ=p(x1,,xn). Then ϕ𝙽(x)=p(x1,,xn,x). By definition of the rules of ϕ𝙽(x), (𝔰,𝔥)nϕ𝙽(x) iff there exists a rule p(y1,,yn)ψ such that (𝔰,𝔥)n1ψ𝙽(y)σ, with σ={yx,yixii{1,,n}}. By Proposition 34, this is equivalent to (𝔰,𝔥)n1ψ𝙽(y), with 𝔰(y)=𝔰(x) and 𝔰(yi)=𝔰(xi) for all i{1,,n}. By the induction hypothesis, (𝔰,𝔥)n1ψ𝙽(y) iff (𝔰,𝔥)n1ψ and 𝔰(y)𝖽𝗈𝗆(𝔥), i.e., iff (𝔰,𝔥)n1ψσ and 𝔰(x)𝖽𝗈𝗆(𝔥). Thus we obtain the equivalence (𝔰,𝔥)nϕ𝙽(x)(𝔰,𝔥)nϕ𝔰(x)𝖽𝗈𝗆(𝔥).

Appendix B Proof of Lemma 18

Let ϕ=ϕ|x(y1,,yκ). We establish the equivalence (𝔰,𝔥)ϕ(𝔰,𝔥)ϕ by induction on |ϕ|.

  • If ϕ is of the form yz (with {,≄}) then ϕ= and (𝔰,𝔥)⊧̸ϕ (as 𝔥 is not empty while ϕ is satisfied only by structures with an empty heap by Definition 5). Thus (𝔰,𝔥)ϕ(𝔰,𝔥)ϕ.

  • If ϕ is of the form x(y1,,yκ) then ϕ=xxi=1κ(yiyi). By Definition 5, (𝔰,𝔥)ϕ iff 𝔥={𝔰(x)(𝔰(y1),,𝔰(yκ))}, i.e., if 𝔥=, 𝔰(x)=𝔰(x) and 𝔰(yi)=𝔰(yi) (for all i{1,,κ}), since 𝔥=𝔥{𝔰(x)(𝔰(y1),,𝔰(yκ))} by the hypothesis of the lemma. Thus (𝔰,𝔥)ϕ(𝔰,𝔥)ϕ.

  • If ϕ is of the form ϕ1ϕ2 then ϕ=ϕ1ϕ2 with ϕi=ϕi|x(y1,,yκ) (for all i{1,2}). By Definition 5, (𝔰,𝔥)ϕ iff (𝔰,𝔥)ϕi for all i{1,2}. By the induction hypothesis, (𝔰,𝔥)ϕi(𝔰,𝔥)ϕi, so that (𝔰,𝔥)ϕ iff (𝔰,𝔥)ϕ1ϕ2=ϕ.

  • The proof is similar if ϕ=ϕ1ϕ2.

  • If ϕ is of the form ϕ1ϕ2 then ϕ=(ϕ1ϕ2)(ϕ1ϕ2) with ϕi=ϕi|x(y1,,yκ) (for all i{1,2}). By Definition 5, (𝔰,𝔥)ϕ iff there exist disjoint heaps 𝔥1,𝔥2 such that 𝔥=𝔥1𝔥2, and (𝔰,𝔥i)ϕi for all i{1,2}. By definition, as 𝔥=𝔥{𝔰(x)(𝔰(y1),,𝔰(yκ))} for all such 𝔥1,𝔥2, there is i{1,2} such that 𝔥i=𝔥i{𝔰(x)(𝔰(y1),,𝔰(yκ))} and 𝔥=𝔥i𝔥3i. By the induction hypothesis, (𝔰,𝔥i)ϕi(𝔰,𝔥i)ϕi, so that (𝔰,𝔥)ϕ iff there exist 𝔥1,𝔥2 and i{1,2} such that 𝔥=𝔥1𝔥2, (𝔰,𝔥3i)ϕ3i and (𝔰,𝔥i)ϕi (with 𝔥i=𝔥i{𝔰(x)(𝔰(y1),,𝔰(yκ))} and 𝔥=𝔥i𝔥3i). By Definition 5, this is equivalent to (𝔰,𝔥)(ϕ1ϕ2)(ϕ1ϕ2).

  • if ϕ=zψ then ϕ=zψ, with ψ=ψ|x(y1,,yκ). By Definition 5, (𝔰,𝔥)ϕ iff there exists such that (𝔰[z],𝔥)ψ. By the induction hypothesis, this is equivalent to: s.t. (𝔰[z],𝔥)ψ, i.e., to (𝔰,𝔥)ϕ.

  • Assume that ϕ=p(z1,,zn) with z1=x. Let {ρ1,,ρm} be the set of formulas ρ such that ϕρ (this set is finite, up to α-renaming, as there are finitely many rules associated with p). As is progressing, each formula ρi (for i{1,,m}) contains exactly one -atom and the left-hand side of this atom must be z1 (i.e. x). Thus ρi is of the form ui(z1(y1i,,yκi)ψi). By Definition 5, (𝔰,𝔥)ϕ iff (𝔰,𝔥)ρi for some i{1,,m}, i.e., iff there exist a natural number i{1,,m}, locations , and heaps 𝔥i1,𝔥i2 such that 𝔥=𝔥i1𝔥i2, (𝔰[z],𝔥i1)z1(y1i,,yκi) and (𝔰[z],𝔥i2)ψi. The conditions above hold only if 𝖽𝗈𝗆(𝔥i1)={𝔰(z1)}={𝔰(x)}, thus only if we have 𝔥i1={𝔰(x)(𝔰(y1),,𝔰(yκ))}, 𝔰(yji)=𝔰(yj) for all j{1,,κ}) and 𝔥i2=𝔥. Thus (𝔰,𝔥)ϕ iff there exist i{1,,m} and , such that (𝔰[z],)j=1κ(yjyji) and (𝔰[z],𝔥)ψi. By Definition 5, this is equivalent to (𝔰,𝔥)i=1mui(ψij=1κ(yjyji))=ϕ.

  • Finally, assume that ϕ=p(z1,,zn) and z1x. We have ϕ(z1xϕ)(z1≄xϕ). It is clear that z1xϕ is equivalent to z1xp(x,z2,,zn) and by Corollary 12, z1≄xϕ has the same truth value in (𝔰,𝔥) as z1≄xp+q,#(q)=mu2,,um,(q(x,u2,,um)(qp)(z1,,zn,x,u2,,um)). We obtain:

    z1xϕ|x(y1,,yκ)=z1x|x(y1,,yκ)ϕz1xϕ|x(y1,,yκ)=(ϕ)(z1xϕ|x(y1,,yκ))z1xϕ|x(y1,,yκ)

    Consider the formula γ=z1≄xp+q,#(q)=mum(γq,mλq,m) with um=(u2,,um), γq,m=q(x,u2,,um) and λq,m is the formula (qp)(z1,,zn,x,u2,,um). In a similar way as for the previous formula, we can show that γ|x(y1,,yκ) is equivalent to the formula: z1≄xp+q,#(q)=mum((γq,mλq,m)(γq,mλq,m)), with γq,m=γq,m|x(y1,,yκ) and λq,m=λq,m|x(y1,,yκ). Furthermore, as 𝔰(x)𝖽𝗈𝗆(𝔥), it is clear that (𝔰,𝔥)⊧̸(γq,mλq,m), since (as is PCE) γq,m unfolds to a formula containing a -atom of the form x(). Consequently, (𝔰,𝔥)γ|x(y1,,yκ) iff (𝔰,𝔥)z1≄xp+q,#(q)=mum(γq,mλq,m). Using the equivalences established in the previous items, we obtain that (𝔰,𝔥)ϕ iff (𝔰,𝔥) is an -model of (z1xϕ|x(y1,,yκ))(z1≄xp+q,#(q)=mum(γq,mλq,m)), which completes the proof.

Appendix C Proof of Lemma 19

By definition, (𝔰,𝔥)ϕ𝔰(x)𝖽𝗈𝗆(𝔥) iff there exist locations 1,,κ such that 𝔥=𝔥{𝔰(x)(1,,k)} and (𝔰,𝔥)ϕ. Let z1,,zκ be fresh variables and let 𝔰^=𝔰[zii1iκ]. By definition, (𝔰^,{𝔰(x)(1,,k)})x(z1,,zκ). By Lemma 18, we have (𝔰,𝔥)ϕ(𝔰^,𝔥)ϕ|x(z1,,zκ), if 𝔥=𝔥{𝔰(x)(1,,k)}. Consequently, (𝔰,𝔥)ϕ(𝔰^,𝔥)z1,,zκ(x(z1,,zκ)ϕ|x(z1,,zκ))(𝔰,𝔥)ϕ𝙰(x).

Appendix D Proof of Proposition 21

Let (𝔰,𝔥) be a structure. By Definition 4, (𝔰,𝔥)xy(𝔰,𝔥)𝔰=𝔰[xy]𝔥=𝔥, thus, by Definition 5, (𝔰,𝔥)[xy]ϕ(𝔰[xy],𝔥)ϕ. Consequently (𝔰,𝔥)[xy]ϕ(𝔰[xy],𝔥)ϕ{xy} (as 𝔰[xy](x)=𝔰[xy](y)), and (𝔰,𝔥)[xy]ϕ(𝔰,𝔥)ϕ{xy} (since x does not occur in ϕ{xy} while 𝔰[xy] and 𝔰 coincide on all variables other than x).

Appendix E Proof of Proposition 22

Let (𝔰,𝔥) be a structure. By Definition 4, 𝚍𝚒𝚜𝚙𝚘𝚜𝚎(𝚡) fails on (𝔰,𝔥) if 𝔰(x)𝖽𝗈𝗆(𝔥) and (𝔰,𝔥)𝚍𝚒𝚜𝚙𝚘𝚜𝚎(𝚡)(𝔰,𝔥) iff 𝔰(x)𝖽𝗈𝗆(𝔥), 𝔰=𝔰 and 𝔥 is the restriction of 𝔥 of domain 𝖽𝗈𝗆(𝔥){𝔰(x)}.

  • Assume that (𝔰,𝔥)[𝚍𝚒𝚜𝚙𝚘𝚜𝚎(𝚡)]ϕ. By Definition 5 we deduce that 𝚍𝚒𝚜𝚙𝚘𝚜𝚎(𝚡) does not fail on (𝔰,𝔥) (that i.e., 𝔰(x)𝖽𝗈𝗆(𝔥)) and that (𝔰,𝔥|𝖽𝗈𝗆(𝔥){𝔰(x)})ϕ. As 𝔰(x)𝖽𝗈𝗆(𝔥), there exist 1,,κ such that 𝔥(𝔰(x))=(1,,κ). Since y1,,yκ are pairwise distinct, 𝔰[yii1iκ] is well-defined and by definition the structure (𝔰[yii1iκ],{𝔰(x)(1,,κ)}) is an -model of x(y1,,yκ). Thus (𝔰,{𝔰(x)(1,,κ)})y1,,yκx(y1,,yκ). As 𝔥=𝔥|𝖽𝗈𝗆(𝔥){𝔰(x)}{𝔰(x)(1,,κ)}, we get (𝔰,𝔥)y1,,yκ(x(y1,,yκ)ϕ).

  • Assume that (𝔰,𝔥)y1,,yκx(y1,,yκ)ϕ. By definition, (since y1,,yκ does not occur in ϕ) there exist disjoint heaps 𝔥1,𝔥2 such that 𝔥=𝔥1𝔥2, (𝔰,𝔥1)y1,,yκx(y1,,yκ) and (𝔰,𝔥2)ϕ. This entails that 𝖽𝗈𝗆(𝔥1)={𝔰(x)}, hence 𝔰(x)𝖽𝗈𝗆(𝔥), so that 𝚍𝚒𝚜𝚙𝚘𝚜𝚎(𝚡) does not fail on (𝔰,𝔥). Moreover, 𝖽𝗈𝗆(𝔥2)=𝖽𝗈𝗆(𝔥){𝔰(x)}, so that (𝔰,𝔥|𝖽𝗈𝗆(𝔥){𝔰(x)})ϕ and consequently (𝔰,𝔥)[𝚍𝚒𝚜𝚙𝚘𝚜𝚎(𝚡)]ϕ.

Appendix F Proof of Lemma 24

Let (𝔰,𝔥) be a structure. By definition, (𝔰,𝔥)[𝚊]ϕ iff 𝚊 does not fail on (𝔰,𝔥) and (𝔰,𝔥)ϕ, for all (𝔰,𝔥) such that (𝔰,𝔥)𝚊(𝔰,𝔥). As 𝚊 is of the form x.iy or yx.i, 𝚊 fails iff 𝔰(x)𝖽𝗈𝗆(𝔥). If 𝚊 fails, then [𝚊]ϕ and [𝚊]ϕ𝙰(x) are both false in (𝔰,𝔥). Otherwise, 𝔰(x)𝖽𝗈𝗆(𝔥). Moreover, if (𝔰,𝔥)𝚊(𝔰,𝔥) then 𝖽𝗈𝗆(𝔥)=𝖽𝗈𝗆(𝔥), as the actions x.iy or yx.i cannot affect the domain of the heap. Moreover, 𝔰(x)=𝔰(x), since x.iy does not affect the store and yx.i does not affect the image of x (as xy, by the condition in Definition 1). Thus 𝔰(x)𝖽𝗈𝗆(𝔥). By Lemma 19 we deduce that (𝔰,𝔥)ϕ is equivalent to (𝔰,𝔥)ϕ𝙰(x). Consequently, (𝔰,𝔥)[𝚊]ϕ(𝔰,𝔥)[𝚊]ϕ𝙰(x).

Appendix G Proof of Lemma 25

The proof is similar to that of Lemma 24. Let (𝔰,𝔥) be a structure. If 𝚊 fails, then [𝚊]ϕ and [𝚊](x(y1,,yκ)ϕ|x(y1,,yκ))) are both false in (𝔰,𝔥). Otherwise, by definition of 𝚊, if (𝔰,𝔥)𝚊(𝔰,𝔥) then 𝔥(𝔰(x))=(𝔰(y1),,𝔰(yκ)). The proof follows by Lemma 20.

Appendix H Proof of Lemma 28

Let (𝔰,𝔥) be a structure. By Definition 4, yx.i fails on (𝔰,𝔥) if 𝔰(x)𝖽𝗈𝗆(𝔥) and otherwise (𝔰,𝔥)yx.i(𝔰,𝔥) iff 𝔰=𝔰{yi} and 𝔥=𝔥 with 𝔥(𝔰(x))=(1,,κ).

  • Assume that (𝔰,𝔥)[yx.i]z(x(y1,,yκ)ϕ)). Then yx.i does not fail on (𝔰,𝔥) (thus 𝔰(x)𝖽𝗈𝗆(𝔥)), and (𝔰[yi],𝔥)z(x(y1,,yκ)ϕ)), with 𝔰(x)=(1,,κ). Thus there exists a sequence of locations m such that (𝔰[yi,zm],𝔥)x(y1,,yκ)ϕ. In particular, (as x or y does not occur in z and xy, by Definition 1) we must have i=𝔰[yi,zm](yi), hence 𝔰[yi,zm](y)=𝔰[yi,zm](yi). Consequently, (𝔰[yi,zm],𝔥)(x(y1,,yκ)ϕ){yyi}. This implies that (𝔰[zm],𝔥)(x(y1,,yκ)ϕ){yyi} and (𝔰,𝔥)z(x(y1,,yκ))ϕ){yyi}.

  • Assume that (𝔰,𝔥)z(x(y1,,yκ))ϕ){yyi}. This entails that there exist a sequence of locations m such that (𝔰[zm],𝔥)(x(y1,,yκ))ϕ){yyi}, i.e., (𝔰[yi,zm],𝔥)x(y1,,yκ)ϕ, with i=𝔰[zm](yi) and 𝔥(𝔰(x))=(1,,κ) (as x does not occur in z). In particular, this entails that 𝔰(x)𝖽𝗈𝗆(𝔥), thus yx.i does not fail on (𝔰,𝔥), and (𝔰[yi],𝔥)z(x(y1,,yκ))ϕ). Thus (𝔰,𝔥)[yx.i](z(x(y1,,yκ))ϕ)).