On the Entailment Problem in Dynamic Separation Logic with Inductive Definitions
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 problem2012 ACM Subject Classification:
Theory of computation Logic and verification ; Theory of computation Automated reasoningAcknowledgements:
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önigSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
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 -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 , denotes the domain of , denotes its image (i.e., ) and denotes the restriction of to . Two partial functions and are disjoint if their domains are disjoint, in which case denotes the function of domain defined as follows:
For every function and elements , , we denote by the function such that , and if . 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 , look-ups , redirections , disallocations and allocations ( is allocated with fields pointing to ). 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:
with , , is a tuple of variables not containing and .
The conditions and are meant to simplify forthcoming definitions (they are not restrictive; for instance, an action could be replaced by a sequence of two actions and , where 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 , stating that is the only allocated locations and refers to the tuple , 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 is associated with a unique arity . A DSL formula (or simply formula) is built inductively as follows:
where , is a predicate in of arity , and are variables, is an action and are formulas. The false formula is a shorthand for (where is an arbitrary variable) and is a shorthand for .
We emphasize that it not exactly the negation of , 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 (resp. ) are called -atoms (resp. -atoms). We denote by the size of the formula (i.e., the number of occurrences of symbols in it). If is a finite set of formulas, then denotes the formula . 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 and are tuples of variables, then is a shorthand for (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 , where is a predicate of arity in and is a symbolic heap such that . We assume that for any given predicate 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 , we write if contains a rule of the form where 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 are pairwise distinct, then the set denotes a substitution such that for all and if . For any expression (formula, variable or tuples of variables) and substitution , denotes the expression obtained from by replacing every free occurrence of every variable by (using -renaming to avoid variable capture).
If is a SID, we write (and say that “ unfolds to ”) if contains a rule and is obtained from by replacing one occurrence of a formula by (i.e., the formal parameters are replaced by the actual parameters , 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 ) is allocated in a heap (resp. in a structure ) if (resp. if ).
A heap of domain with for all is denoted by . 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.: .
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:
-
, and
-
, , and is the following heap:
. -
, , and .
-
, , and is the restriction of such that .
-
, , , .
An action fails on if there is no structure such that .
The satisfiability relations and are defined as follows (the exponent denotes the maximal number of nested applications of inductive rules in ).
Definition 5 (Satisfiability Relation).
We write if one of the following conditions holds:
-
is of the form (resp. ), and (resp. ).
-
is of the form and .
-
is of the form (resp. ) and holds for some (resp. for all ).
-
is of the form and there exist disjoint heaps such that and , for all .
-
is of the form and there exists such that .
-
is of the form , , and .
-
is of the form , does not fail on and for all such that .
We write if for some , 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 for all . 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 is:
-
progressing if is of the form , where contains no -atom (i.e., the rule allocates exactly one location );
-
connected if, moreover, every predicate atom in is of the form with (i.e., the locations allocated by the called predicates are successors of ).
A SID is progressing (resp. connected) if all the rules in are progressing (resp. connected). It is established if for every atom and for every formula containing no predicate symbol, if and is existentially quantified in then contains atoms (for , with ) such that and either contains a -atom of the form or (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 .
Example 8.
The following rules, defining a non empty list segment from to are PCE:
In contrast, the following rules, defining the same structures, are not PCE, because the second rule contains no -atom (hence is not progressing):
The following rules, defining a list segment with last cell , are not connected.
The following PCE rules define a tree rooted at , where all nodes have an additional pointer to their parent node and the leaves point to :
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 from the rules of a predicate symbol , lifting them to the initial formula.
Definition 9 (Context Predicates).
For every pair of predicates with and , we define a predicate of arity associated with the following rules, for each rule of the form in (modulo AC):
The rules of are obtained from those of by removing exactly one call to the atom (occurring at some non-root position in the derivation tree). Consequently, is satisfied by all (non-empty) structures that will satisfy after a disjoint heap satisfying is added to the current heap. It is easy to check that the rules of fulfill the conditions of Definition 6.
Example 10.
Let be predicates associated with the following rules:
The predicate is defined as follows:
The following lemma states that denotes the structures obtained by removing the subheap satisfying from a structure that satisfies .
Lemma 11.
Assume that is PCE. Let be a structure, let be a variable and let be a formula. If and then the two following assertions are equivalent:
-
.
-
There exists a predicate of arity , pairwise distinct variables , distinct from and locations such that and:
with .
The following result follows immediately from Lemma 11:
Corollary 12.
Assume that is PCE. Let be a structure such that . Let be a sequence of pairwise distinct variables, all distinct from . Then the following equivalence holds:
with and .
The following definition associates each pair , consisting of a static formula and a variable , with a formula . This transformation enriches by explicitly adding assertions that ensure is not allocated (see Lemma 15). It also implicitly extends the SID by introducing new predicate symbols and rules, which enforce that is not allocated within the data structures described by the predicates occurring in .
Definition 13.
Let be a static formula and let be a variable. We denote by the formula inductively defined as follows.
-
If is of the form or then .
-
If is of the form then .
-
If then .
-
If (with ) then .
-
If then (we assume by -renaming that ).
-
If then if is a predicate symbol of arity , associated with rules of the form , for all rules of the form occurring in .
Note that, alternatively, one could define as ; 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 , , 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 where is defined as in Example 10. Then is , where is defined as follows ( is renamed into in the first rule to avoid conflict):
Note that in every model of , is not allocated, because each -atom is associated with a disequation .
We now establish the soundness of the transformation. Lemma 15 shows that indeed captures the intended properties, i.e., that is true and is not allocated.
Lemma 15.
For every structure , for every static formula and for every variable , the following equivalence holds:
We now introduce a similar but slightly more complex transformation. It associates every formula and variables with a formula which is intended to denote the structures in which holds after a mapping is added to the heap (see Lemma 18). In other words is equivalent to the formula , 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 be variables. We denote by the formula inductively defined as follows.
-
If is of the form or then .
-
If is of the form then .
-
If (with ) then .
-
If then is the formula: .
-
If then (we assume by -renaming that ).
-
If and then is:
Note that the above set is finite (up to a renaming of variables) as there are finitely many rules associated with any given predicate .
-
If and then is:
It is straightforward to check that the computation of 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 (for some ) 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 , where is defined as in Example 8. Then is given by the following disjunction:
The structures described by are obtained by removing the mapping from the heap described by . The first disjunct corresponds to the case where the removed mapping is exactly . The second disjunct handles the case where the removed mapping is the first one in the list segment (which entails that ). The third disjunct covers the case where the removed mapping is the last one in the list segment . The fourth disjunct accounts for the case where the removed mapping is part of the structure generated by , but is not its first or last element. The formula can be further simplified by replacing with (since the second argument of remains unchanged through recursive calls) and by (based on the equations and ).
Lemma 18.
Assume that is PCE. Let be a structure, let be a static formula and let be variables. If (with ), then:
For any static formula and variable , we denote by the formula defined as follows: . Intuively, asserts that holds and that 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 the following equivalence holds:
Lemma 20.
For every structure , for every static formula and variable the following two assertions are equivalent:
-
.
-
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 :
Desallocations are also straightforward to handle: it is sufficient to assert that the desallocated variable is initially allocated and that the remainder of the heap satisfies :
Proposition 22.
For all static formulas for all variables , and for all pairwise distinct variables not occurring in :
Example 23.
Consider the formula . We get:
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 or , then:
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 , then:
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 , for all , for all sequences of variables (not containing or ) and for all variables not occurring in , or , the following equivalence holds:
| (1) |
Proof.
Let be a structure. By Definition 4, fails on if . Moreover, exactly when , and with .
-
Assume that . By Definition 5, we deduce that does not fail on (i.e., ), and that , with and . Consequently, there exist a vector of locations and disjoint heaps such that , and . This entails that (as does not occur in ), , , for all and (as does not occur in ). This implies that , and that . Consequently, . Since , we also have , so that is an -model of .
-
Assume that . This means that there exist a sequence of locations and disjoint heaps such that , , and (as and does not occur in ). Therefore (as does not occur in ), , and , with and for all . Let be the heap . From the previous assertions we derive that . As , does not fail on . Let . It is clear that , so that , and thus . It follows that .
Example 27.
Let . We get:
A similar result holds for look-ups (we recall that actions with are not allowed in the syntax):
Lemma 28.
For all formulas , for all variables (with ), for all , and for all sequences of variables (not containing or ), the following equivalence holds:
It remains to consider the case of allocation actions . This introduces new challenges, because the action associates the variable 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 (for ) be two structures and let be a finite set of variables. We write if the three following conditions are fulfilled:
-
1.
.
-
2.
The equivalence holds for all variables .
-
3.
For all variables , if or then .
Lemma 30.
Let (for ) be two structures with . Let be a static formula. If then .
Proof.
The result is established by induction on . By Definition 29 (1) .
-
If then for some . By the induction hypothesis we get and .
-
The proof is similar if .
-
If then there exist heaps such that and for all . It is straightforward to verify that , as . By the induction hypothesis, we get (for all ) thus .
-
If then there exists such that . We distinguish several cases. In every case we show that there exists a location such that , i.e., such that Conditions 2 and 3 in Definition 29 both hold.
-
–
If then we take . It is easy to check that Condition 3 holds, as it trivially holds for and it also holds for all since by hypothesis and coincides with on all . Now consider two variables . We show that . The proof is trivial if , thus we assume that .
-
*
If are both distinct from then (as and ). Thus the above equivalence holds.
-
*
If one of the variables, say is , and if, for some , , then, as and , we get and by Condition 3, , thus .
-
*
-
–
If and for some variable then we take . We show that Condition 3 holds. Assume that for some . Since , , which entails that , and thus by Condition 3. Then we show that Condition 2 holds. Consider two variables and assume that for some . We show that . We may assume, w.l.o.g., that . If one of the variables, say , is , then we get , hence by Condition 2, as . Thus . If then and the proof follows from the fact that .
-
–
Otherwise (i.e., if ), is any location not occurring in (such a location exists as is infinite). Condition 3 trivially holds for as , and also holds for all variables distinct from since coincides with on all . Now consider two variables and assume that for some . We show that . The proof is immediate if , thus we assume that . This implies that , as (due to the conditions above on and to the choice of ), so that . Then the proof follows from the fact that , as for all .
Consequently, we get in all cases by the induction hypothesis, which implies that .
-
–
-
Assume that is of the form . By Definition 5, there exists a formula such that and . By the induction hypothesis, we get , thus .
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 be a static formula in prenex form (where is quantifier-free) and let be variables, where . Let . The following equivalence holds:
where:
-
;
-
;
-
Intuitively, the formula (which states that holds and that is not allocated) is obtained by applying the allocation using any (arbitrary chosen) unallocated location . As the resulting structure satisfies , there must exist such that holds, and since is not allocated, this implies that also holds. Afterwards, the action is applied again, this time mapping to another unallocated location distinct from the values of all (free or existential) variables occurring in the previous formula , yielding the formula . Finally, the formula is obtained by mapping to each (unallocated) location . The disjunct 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 cannot occur in the heap (by Proposition 7), and are therefore indiscernible (by Lemma 30). Consequently, the variable in serves as a single representative for all such locations. More formally:
Proof.
Let be a structure. By Definition 4, never fails on (as is finite and is infinite) and iff and , for some .
-
Assume that . Let be any location not occurring in . By definition of the semantics, there exist disjoint heaps such that , and . This implies that and thus , and (as ), there exist locations such that , thus . By Lemma 15, since , we get . Hence , with . We now prove that . Let be any location not occurring in . Using the same reasoning as before, we show (by definition of the semantics of allocations), that and therefore (since the variables are not free in , thus in ). As we get which implies that . Finally, we prove that . Consider any . If then by Lemma 19, (since ). Otherwise, by definition of the semantics, , and therefore . Therefore, we have which implies that .
-
Assume that . Let be any location not occurring in , we need to show that . Since (as does not occur in , by Definition 1), we only have to prove that . By definition, there exists a store , coinciding with on all variables distinct from , such that . We distinguish two cases.
-
–
Assume that , for some . Then, by Lemma 19, we cannot have (otherwise would occur in ), thus we must have , hence . Since do not freely occur in , this implies that .
- –
-
–
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 , then by Proposition 21 it suffices to take . If is of the form and is of the form or then by Lemmata 26 or 28 it suffices to take or respectively. If is of the form or but is not of the form , 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 and is of the form then we take the formula , as defined in Lemma 31. If is of the form but is not of the form , 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: or . 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 , and substitution : , where , for all variables .
We show that by induction on the pair , ordered by lexicographic extension of the usual order on natural numbers (the result follows immediately).
-
If is of the form (with ) then and only if , thus the proof is immediate.
-
If is of the form then . Moreover, only if , hence the equivalence holds for all -models of . Consequently, .
-
If is of the form then . By Definition 5, iff and . By the induction hypothesis, , hence is equivalent to: (for all ) and . Thus .
-
If is of the form then . By definition, iff (for some ). By the induction hypothesis, . Therefore the assertion holds iff and . Thus iff .
-
If is of the form then . By Definition 5, iff there exist disjoint heaps such that and (for all ). By the induction hypothesis, , so that (for all ) iff (for all ) and . Thus iff there exist disjoint heaps such that and (for all ) and , i.e., .
-
If (with ), then . By Definition 5, iff there exists such that . By the induction hypothesis holds iff . Thus .
-
Now assume that . Then . By definition of the rules of , iff there exists a rule such that , with . By Proposition 34, this is equivalent to , with and for all . By the induction hypothesis, iff and , i.e., iff and . Thus we obtain the equivalence .
Appendix B Proof of Lemma 18
Let . We establish the equivalence by induction on .
-
If is of the form (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 then . By Definition 5, iff , i.e., if , and (for all ), since by the hypothesis of the lemma. Thus .
-
If is of the form then with (for all ). By Definition 5, iff for all . By the induction hypothesis, , so that iff .
-
The proof is similar if .
-
If is of the form then with (for all ). By Definition 5, iff there exist disjoint heaps such that , and for all . By definition, as for all such , there is such that and . By the induction hypothesis, , so that iff there exist and such that , and (with and ). By Definition 5, this is equivalent to .
-
if then , with . By Definition 5, iff there exists such that . By the induction hypothesis, this is equivalent to: s.t. , i.e., to .
-
Assume that with . Let be the set of formulas such that (this set is finite, up to -renaming, as there are finitely many rules associated with ). As is progressing, each formula (for ) contains exactly one -atom and the left-hand side of this atom must be (i.e. ). Thus is of the form . By Definition 5, iff for some , i.e., iff there exist a natural number , locations , and heaps such that , and . The conditions above hold only if , thus only if we have , for all ) and . Thus iff there exist and , such that and . By Definition 5, this is equivalent to .
-
Finally, assume that and . We have . It is clear that is equivalent to and by Corollary 12, has the same truth value in as . We obtain:
Consider the formula with , and is the formula . In a similar way as for the previous formula, we can show that is equivalent to the formula: , with and . Furthermore, as , it is clear that , since (as is PCE) unfolds to a formula containing a -atom of the form . Consequently, iff . Using the equivalences established in the previous items, we obtain that iff is an -model of , which completes the proof.
Appendix C Proof of Lemma 19
By definition, iff there exist locations such that and . Let be fresh variables and let . By definition, . By Lemma 18, we have , if . Consequently, .
Appendix D Proof of Proposition 21
Appendix E Proof of Proposition 22
Let be a structure. By Definition 4, fails on if and iff , and is the restriction of of domain .
-
Assume that . By Definition 5 we deduce that does not fail on (that i.e., ) and that . As , there exist such that . Since are pairwise distinct, is well-defined and by definition the structure is an -model of . Thus . As , we get .
-
Assume that . By definition, (since does not occur in ) there exist disjoint heaps such that , and . This entails that , hence , so that does not fail on . Moreover, , so that 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 or , fails iff . If fails, then and are both false in . Otherwise, . Moreover, if then , as the actions or cannot affect the domain of the heap. Moreover, , since does not affect the store and does not affect the image of (as , by the condition in Definition 1). Thus . By Lemma 19 we deduce that is equivalent to . Consequently, .
Appendix G Proof of Lemma 25
Appendix H Proof of Lemma 28
Let be a structure. By Definition 4, fails on if and otherwise iff and with .
-
Assume that . Then does not fail on (thus ), and , with . Thus there exists a sequence of locations such that . In particular, (as or does not occur in and , by Definition 1) we must have , hence . Consequently, . This implies that and .
-
Assume that . This entails that there exist a sequence of locations such that , i.e., , with and (as does not occur in ). In particular, this entails that , thus does not fail on , and . Thus .
