• Aucun résultat trouvé

Entailment is Undecidable for Symbolic Heap Separation Logic Formulae with Non-Established Inductive Rules

N/A
N/A
Protected

Academic year: 2021

Partager "Entailment is Undecidable for Symbolic Heap Separation Logic Formulae with Non-Established Inductive Rules"

Copied!
11
0
0

Texte intégral

(1)

HAL Id: hal-02951859

https://hal.archives-ouvertes.fr/hal-02951859v2

Submitted on 30 Sep 2020

HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires

Entailment is Undecidable for Symbolic Heap Separation Logic Formulae with Non-Established Inductive Rules

Mnacho Echenim, Radu Iosif, Nicolas Peltier

To cite this version:

Mnacho Echenim, Radu Iosif, Nicolas Peltier. Entailment is Undecidable for Symbolic Heap Separation Logic Formulae with Non-Established Inductive Rules. Information Processing Letters, Elsevier, 2022.

�hal-02951859v2�

(2)

Entailment is Undecidable for Symbolic Heap Separation Logic Formulæ with Non-Established

Inductive Rules

Mnacho Echenim, Radu Iosif and Nicolas Peltier September 30, 2020

Abstract

Entailment is undecidable in general for Separation (SL) Logic formulæ with inductive definitions, but it has been shown to be decidable [1] if the inductive rules satisfy three conditions, namely progress, connectivity and establishment.

We show that entailment is undecidable if the latter condition is dropped, thus drawing a much clearer frontier for (un)decidability.

1 Introduction

Separation Logic (SL) is widely used in program verification to reason about programs manipulating dynamically allocated data structures [2].It forms the basis of several industrial-scale static program analyzers [3, 4, 5]. SL formulæ describe heaps, i.e.

finite partial functions mapping locations (memory addresses) to tuples of locations (records) of a fixed size. A formula x 7→ (y

1

, . . . , y

κ

) states that the image of the loca- tion associated with x in the heap is the tuple of locations associated with (y

1

, . . . , y

κ

), whereas φ

1

∗ φ

2

states that the heap can be split into two disjoint parts satisfying φ

1

and φ

2

, respectively. Describing unbounded data structures (lists, trees, etc.) is possible by the use of predicate symbols, the interpretation of which is given by a set of user- defined inductive rules. These SL formulæ, in which boolean conjunction does not occur and negation is restricted to disequalities, are commonly called symbolic heaps.

Testing entailment between symbolic heaps is known to be decidable for a class of inductive definitions satisfying three natural conditions [1]:(1) progress, stating that every inductive rule allocates exactly one memory cell, (2) connectivity, ensuring that the locations allocated during the unfolding of a predicate form a tree-like connected structure and (3) establishment, stating that all the existentially quantified variables introduced during the unfolding of inductive predicates must be eventually allocated.

These conditions play very different rˆoles. Condition (1) is actually not restrictive

and is considered for simplicity only. In contrast, Condition (2) is crucial for decid-

ability: entailments are undecidable for inductive definitions that are not connected,

because then the inductive definitions may be used to encode context-free languages,

the inclusion of which is known to be undecidable. The remaining question is whether

(3)

condition (3) is actually required for decidability or whether it can be ignored. We show that discarding this condition leads to undecidability.

The precise rˆole of establishment for decidability of entailments between symbolic heaps has been an open problem since establishment was identified as a condition en- suring, with progress and connectivity, decidability of entailments between symbolic heaps [1]. The proof of [1] used a reduction of the entailment between symbolic heaps to the (decidable) satisfiability of monadic second order logic on graphs with bounded treewidth [6] and establishment was crucial to ensure that the considered heaps have a bounded treewidth. We recently showed that establishment can be replaced by a strictly more general condition restricting the form of the disequations in the system [7]. The undecidability proof for non-established definitions given here implies the un- decidability of entailments for definitions that cannot be transformed into the restricted disequations form [7].

2 Separation Logic

Let κ ≥ 0 be a natural number(denoting the number of record fields), V and C be two disjoint sets of symbols (denoting respectively variables and constants

1

, and P be a set of predicate symbols. Each symbol p ∈ P is associated with a unique arity #(p) ≥ 1.

The set of separation logic symbolic heaps φ is inductively defined as follows, where x, x

0

,y

1

, . . . , y

κ

, z

1

, . . . , z

#(p)

∈ V C , u V and p P :

φ ::= x ≈ x

0

|x 6≈ x

0

| x 7→ (y

1

, . . . , y

κ

)| φ ∗ φ | p(z

1

, . . . , z

#(p)

) | ∃u . φ.

A formula is predicate-free if it contains no symbols from P . We denote by var(φ) the set of variables freely occurring in φ. A substitution is a partial mapping from V to V C . The substitution of domain {x

1

, . . . , x

n

} mapping every variable x

i

to t

i

is denoted by [x

i

← t

i

| 1 ≤ i ≤ n]. For every formula φ and substitution σ, φσ denotes the formula obtained by replacing each free occurrence of a variable x in φ by σ(x) (bound variables are renamed to avoid collisions).

Let U be a countably infinite set of locations, with C U . A structure is a pair (s, h) where s is a store, i.e., a total mapping from V C to U that is the identity on C ; and h is a heap, i.e., a partial finite mapping from U to U

κ

. Two heaps h

1

and h

2

are disjoint iff dom(h

1

) ∩ dom(h

2

) = 0, and in this case / h

1

] h

2

denotes the union of disjoint heaps.

A system of inductive definitions (SID) R is a set of rules p(x

1

, . . . , x

#(p)

) ⇐ φ, where x

1

, . . . , x

#(p)

are pairwise distinct variables and φ is a symbolic heap with var(φ) ⊆

{x

1

, . . . , x

#(p)

}. A system R is progressing and connected if every rule in R is of the

form p(x

1

, . . . , x

#(p)

) ⇐ ∃y

1

, . . . , y

m

. x

1

7→ (u

1

, . . . , u

#(p)

)∗ ∗

mi=1

p

i

(y

i1

, . . . , y

i#(p

i)

), where for all i ∈ J 1, m K , we have y

i1

∈ {u

1

, . . . , u

#(p)

}.

For any formula φ, we write φ →

R

ψ if ψ is obtained from φ by replacing an oc- currence of a predicate atom p(x

1

, . . . , x

#(p)

) by ρ[y

i

← x

i

| 1 ≤ i ≤ #(p)], where R

1Constants are introduced only to improve readability. One could replace them by variables added as parameters to every predicate symbol, and adding disequality constraintsx6≈yfor allx,y∈

C

, stating that all constants are mapped to distinct locations. Hence the undecidability result holds also for

C

=0./

(4)

contains a rule p(y

1

, . . . , y

#(p)

) ⇐ ρ and the existential variables of ρ are α-renamed to avoid collisions. As usual, →

R

denotes the reflexive and transitive closure of →

R

. A formula ψ such that φ →

R

ψ is called an R -unfolding of φ. A SID R is established if, in every predicate-free R -unfolding ψ of a predicate atom p(x

1

, . . . , x

#(p)

), each exis- tentially quantified variable in ψ is asserted equal to a variable x, where x 7→ (y

1

, . . . , y

κ

) is a an atom of ψ.

For all structures (s, h), symbolic heaps φ containing no predicate atom and SIDs R , we write (s, h) | = φ iff one of the following holds: (i) φ ≡ x ≈ x

0

(resp. φ ≡ x 6≈ x

0

), dom(h) = 0 / and s(x) = s(x

0

) (resp. s(x) 6= s(x

0

)); (ii) φ ≡ x 7→ (y

1

, . . . , y

κ

), dom(h) = {s(x)} and h(s(x)) = (s(y

1

), . . . , s(y

κ

)); (iii) φ ≡ φ

1

∗φ

2

and h = h

1

] h

2

where (s, h

i

) | = φ

i

, for all i ∈ {1, 2}; (iv) φ ≡ ∃x . φ

0

and there exists a store s

0

coinciding with s on all variables and constants distinct from x such that (s

0

,h) | = φ

0

. This definition is extended to formulæ containing predicate symbols as follows: (s, h) | =

R

φ iff (s,h) | =

R

ψ, for some predicate-free R -unfolding ψ of φ.

3 Encoding the Post Correspondence Problem

The undecidability proof uses a reduction from a variant of Post’s Correspondence Problem (PCP). We denote by w[i] the i-th character

2

of the word w, and by |w| its length, so that w = (w[1], . . . , w[|w|]). For readability, we shall use the following con- vention: when a capital letter (say, A) is used to denote a natural number, then the corresponding lower case letter a will denote a natural number ranging over the in- terval J 1, A K . Further, the variable i will range over the set {1, 2}. We recall that the PCP asks, given two sequences u

i

= (u

i1

, . . . , u

iN

) (with i = 1, 2) of words on the same alphabet V , whether there exists a nonempty sequence s = (s

1

, . . . , s

K

) of el- ements of J 1, N K (called a solution of the PCP) such that u

1s

1

. . . . .u

1s

K

= u

2s

1

. . . . .u

2s

K

. The latter word is called a witness of the PCP and its length will be denoted by L.

PCP is a well-known undecidable problem. We assume that all the words in u

i

are nonempty (which does not impact the undecidability proof of the PCP). We consider a slightly adapted version of the PCP, in which: (i) The last element of both sequences of words is a special character $ = u

1N

= u

2N

, not occurring in the words u

in

, for i ∈ {1, 2}, n ∈ J 1, N − 1 K ; and (ii) any solution must be such that K > 1, s

K

= N and s

k

6= N if k < K. In other words, in this adapted version, the witness must end with the special element $. It is clear that the standard PCP can be reduced to the adapted version, which is thus also undecidable. We denote by M

i

the maximal length of the words in u

i

, i.e. M

idef

= max{|u

in

| | n ∈ J 1, N K }, for i ∈ {1, 2} and let M

def

= max({M

1

, M

2

}).

We consider two special constants nil and ⊥, and we associate all natural num- bers m ∈ J 1, M K and all elements a ∈ V with pairwise distinct constants also distinct from nil and ⊥. These constants will be, for the sake of readability, also denoted by m or a (assuming, w.l.o.g., that V ∪ N ∪ {⊥, nil} ⊆ C and V ∩ N = 0). We assume / next that κ = 6, i.e. we fix the number of record fields. The encoding could easily be adapted for any κ ≥ 2, using binary trees to represent tuples of elements, but this would greatly hinder readability, because of the progress condition which requires that

2Since words will often be indexed, using the notationwiwould be confusing.

(5)

every rule allocates exactly one location. For readability, we shall actually consider elements referring to tuples of any length n ≤ 6, where missing elements are implicitly replaced by the constant ⊥. Hence the notation x 7→ (y

1

, . . . , y

n

) for n ≤ 6 stands for x 7→

(y

1

, . . . , y

n

, ⊥

6−n

). Similarly, h(`) = (`

1

, . . . , `

n

) stands for h(`) = (`

1

, . . . , `

n

, ⊥

6−n

).

For the sake of conciseness, we allow disjunctions in the right-hand side of the induc- tive rules: a rule p( ~ x) ⇐ φ ∗ (ψ

1

∨ ψ

2

) stands for { p( ~ x) ⇐ φ ∗ ψ

1

, p( ~ x) ⇐ φ ∗ ψ

2

}.

We begin by showing that the solutions of the PCP can be encoded by structures of a specific form.

Definition 1. A heap h is a PCP-encoding if there exists a word w with L

def

= |w| > 1, a natural number K > 1 and pairwise distinct locations `

1

, . . . , `

L+1

and `

01

, . . . , `

0K+1

with `

L+1

= `

0K+1

= nil, such that:

1. dom(h) = {`

1

, . . . , `

L

, `

01

, . . . , `

0K

}.

2. For every l ∈ J 1,L K , h(`

l

) is of the form (`

l+1

, w[l], `

1l

, p

1l

, `

2l

, p

2l

), for locations

`

1l

, `

2l

and integers p

1l

, p

2l

∈ J 1, M K , with `

11

= `

21

= `

01

, `

1L

= `

2L

= `

0K

and p

11

= p

21

= p

1L

= p

2L

= 1.

3. For every k ∈ J 1, K K , h(`

0k

) is of the form (`

0k+1

,s

k

) for some s

k

∈ J 1,N K , with s

K

= N and s

k

6= N if k < K.

The location `

1

is called the root of h. We denote w(h)

def

= w and s(h)

def

= (s

1

, . . . , s

K

);

clearly h uniquely defines w(h) and s(h).

nil

s1 s2 N

w[1] w[2] w[L]

1

`l

`1l `2l p1l p2l

· · ·

· · · · · ·

· · ·

· · ·

`1

`01

`L

`0K

Figure 1: Encoding of a PCP Solution by a Heap

The sequence `

1

, . . . , `

L

encodes the linked sequence of characters w[1],. . . , w[L]

in a witness w. Each location `

l

refers to a tuple containing the next element of the sequence `

l+1

as well as the character w[l], and locations `

1l

, p

1l

, `

2l

, p

2l

, which will be used to denote the position of the character within the words u

1s

1

. . . . .u

1s

K

and u

2s

1

. . . . .u

2s

K

(see Definition 2). The sequence `

01

, . . . , `

0K

represents the solution s. Each location

`

0k

points to a tuple containing the next element of the sequence `

0k+1

and the k-th component of s (see Fig. 1). The next definition states conditions ensuring that a PCP-encoding indeed encodes a solution of the PCP.

Definition 2. A PCP-encoding h is i-consistent for i = 1,2 if, for all l ∈ J 1,L K , there exists k ∈ J 1, K K such that, with the notations of Definition 1, `

il

= `

0k

and:

1. w[l] is the p

il

-th character of the word u

is

k

(i.e., w[l] = u

is

k

[p

il

]).

2. If l 6= L and p

il

< |u

is

k

| then `

il+1

= `

0k

and p

il+1

= p

il

+1.

3. If l 6= L and p

il

= |u

is

k

| then k < K, `

il+1

= `

0k+1

and p

il+1

= 1.

(6)

Example 3. We consider the following instance of the PCP: N = 3, u

11

= ab, u

22

= c, u

21

= a, u

22

= bc and u

13

= u

23

= $. The following heap, of domain {`

1

, `

2

, `

3

, `

4

, `

01

, `

02

, `

03

} is a PCP-encoding that is i-consistent for i = 1, 2. It encodes the solution (1,2, 3) of the above PCP, with witness abc$. Locations `

1

, `

2

, `

3

, `

4

encode the witness whereas locations `

01

, `

02

, `

03

encode the solution.

`

1

7→ (`

2

, a, `

01

, 1, `

01

, 1) `

01

7→ (`

02

, 1)

`

2

7→ (`

3

, b, `

01

, 2, `

02

, 1) `

02

7→ (`

03

, 2)

`

3

7→ (`

4

, c, `

02

, 1, `

02

, 2) `

03

7→ (nil,3)

`

4

7→ (nil, $, `

03

, 1, `

03

, 1)

Lemma 4. A PCP admits a solution iff there exists a PCP-encoding that is both 1- consistent and 2-consistent.

Proof. Assume that the PCP admits a solution s of length K, with witness w and let L = |w|. We construct a PCP-encoding as follows. Let `

1

, . . . , `

L

, `

01

, . . . , `

0K

be pair- wise distinct locations distinct from all constants. Let `

L+1def

= `

0K0+1

def

= nil, and let h be a heap of domain {`

1

, . . . , `

L

, `

01

, . . . , `

0K

}, such that: (i) For every l ∈ J 1, L K , h(`

l

)

def

= (`

l+1

, w[l], `

0

k1l

, p

1l

, `

0

k2l

, p

2l

), where k

il

is the greatest element in J 1, K K with |u

is

1

. . . . .u

is

kil−1

| <

l, and p

il def

= l − |u

is

1

. . . . .u

is

kil−1

|. (ii) For every k ∈ J 1, K K , h(`

0k

)

def

= (`

0k+1

, s

k

). It is straightforward to check that h is a PCP-encoding. Conversely, let h be a PCP- encoding that is i-consistent for all i = 1, 2, and let w

def

= w(h) and s

def

= s(h). By induction on l, we can show, by a case analysis on whether p

il

< |u

is

kil

| or not, and using Conditions 2 and 3 of Def. 2 that for every i ∈ {1, 2} and l ∈ J 1, L K , the following equality holds: w[1]. . . . .w[l] = u

is

1

. . . . .u

is

kil−1

.u

is

kil

[1]. . . . .u

is

kil

[p

il

] (1). Note that, in par- ticular, for l = L, Equation 1 entails that w = u

is

1

. . . . .u

is

K

(i.e. s is indeed a solution of the PCP). Indeed, we have p

iL

= 1 and `

iL

= `

0K

, so that k

iL

= K; moreover s

K

= N and u

iN

= $ is of length 1. The proof goes by induction on l.

• If l = 1 then we have k

1i

= 1 and p

i1

= 1, by Definition 1 (2). Further, w[1] = u

is

1

[1], by Condition 1 in Definition 2.

• Assume that Equation 1 holds for some l < K. We distinguish two cases.

– If p

il

< |u

i

kil

|, then by Definition 2 (2), applied on l with k = k

li

, this entails that `

il+1

= `

il

(hence k

il+1

= k

il

), and p

il+1

= p

il

+1. Moreover:

w[1]. . . . .w[l + 1] = u

is

1

. . . . .u

is

kil−1

.u

is

kil

[1]. . . . .u

is

kil

[ p

il

].w[l + 1].

By Definition 2 (1), applied on l + 1 with k = k

il+1

, we have w[l + 1] = u

i

kil+1

[p

il+1

] = u

i

kil

[ p

il

+ 1], hence w[1]. . . . .w[l +1] = u

is

1

. . . . .u

is

kil−1

.u

is

kil

[1]. . . . .u

is

kil

[p

il

+ 1],

and the proof is completed.

(7)

– Otherwise, by Definition 2 (3) applied on l with k = k

il

, we have that k

il+1

= k

il

+ 1 and p

il+1

= 1. By Equation (1), since p

il

= |u

i

kil

|, we get:

w[1]. . . . .w[l] = u

is

1

. . . . .u

is

kil

By Definition 2 (1), applied on l + 1 with k = k

il+1

, we have w[l + 1] = u

i

kil+1

[p

il+1

] = u

i

kil+1

[1]. Thus:

w[1]. . . . .w[l + 1] = u

is

1

. . . . .u

is

kil

.u

is

kil

[1],

and the proof is completed.

Let π = (u

1

, u

2

) be an instance of PCP, where u

i

= (u

i1

, . . . , u

iN

), i = 1, 2. We show how to transform i-consistent PCP-encodings into SL formulæ. Let R

π

be the set of rules in Fig. 2, we show that I defines the PCP-encodings of π (Def. 1):

Lemma 5. (s, h) | =

Rπ

I(x

1

) iff h is a PCP-encoding of root s(x

1

).

Proof. (s,h) | =

Rπ

I(x

1

) iff (s, h) | = φ for some predicate-free formula φ with I(x

1

) →

Rπ

φ. By Rule (2), I(x

1

) →

Rπ

φ iff there exist a

1

∈ V such that ∃x

2

, y

1

, z. x

1

7→ (x

2

, a

1

, y

1

, 1, y

1

, 1)∗

W (x

2

, z) ∗ S(y

1

,z) →

Rπ

φ. Any →

Rπ

-derivation from W (x

2

,z) starts by a sequence of application of Rule (3) followed by one application of (4). Thus I(x

1

) →

Rπ

φ iff there exists L ∈ N , a

1

, . . . , a

L−1

∈ V , p

12

, p

22

, . . . , p

1L−1

, p

2L−1

∈ J 1, M K s.t. ∃x

2

, . . . , x

L

, y

1

, z. x

1

7→

(x

2

, a

1

, y

1

,1, y

1

,1) ∗ ψ ∗ S(y

1

, z) →

Rπ

φ, where ψ

def

= ∗

L−1l=2

x

l

7→ (x

l+1

, a

l

, y

1l

, p

1l

,y

2l

, p

2l

) ∗ x

L

7→ (nil, $, z, 1, z, 1). Applying Rule (5) K − 1 times and then Rule (6), we deduce that I(x

1

) →

Rπ

φ iff there exists L ∈ N , K ∈ N , a

1

, . . . , a

L−1

∈ V , p

12

, p

22

, . . . , p

1L−1

, p

2L−1

∈ J 1, M K , n

1

, . . . , n

K−1

∈ J 1, N −1 K s.t. ∃x

2

, . . . , x

L

, y

1

, . . . , y

K

. x

1

7→ (y, a

1

, y

1

, 1, y

1

, 1) ∗ ψ ∗ ψ

0

R

φ where ψ

0def

= ∗

K−1k=1

y

k

7→ (y

k+1

, n

k

)∗ y

K

7→ (nil,N)∗ y

K

≈ z. Using the previous equivalence, it is straightforward to check that (s,h) | = I(x

1

) iff h is a PCP-encoding with root s(x

1

), where, using the notations of Definition 1, `

l

and `

0k

are the locations associated to x

l

and y

k

, respectively.

Predicate B defines the PCP-encodings that are not i-consistent, for some i = 1, 2 (Def. 2). Such structures necessarily contain locations `

l

and `

0k

contradicting one of Condition 1, 2 or 3 from Definition 2. Rule (11) is applied when `

0k

is such that k > 1. It allocates the first element `

1

of the witness, then invokes A(y) to allocate all elements

`

01

, . . . , `

0k−1

, and the predicate B(x

0

) to allocate the remaining elements. Note that A

allocates arbitrary linked structures, with the link on the first record field (the resulting

list does not necessarily end with nil). Predicate C is similar to A, but has 6 additional

parameters denoting the heap image of the first allocated location. Rule (12) is applied

l − 2 times to allocate locations `

2

, . . . , `

l−1

and also to allocate `

1

in the case where

k = 1 (this case must be considered apart since the sequence `

01

, . . . , `

0k−1

is empty, thus

there is no element to allocate). The remaining rules allocate the faulty location `

l

.

Rules (13-15) handle the case where the heap is not 1-consistent. Rule (13) allocates

(8)

a location contradicting Condition 1 in Definition 2. Afterwards, the predicates A(y) and C(z

1

, y

0

, n, ⊥, ⊥, ⊥,⊥) are used to allocate locations `

l+1

, . . . , `

L

, and `

0k

, . . . , `

0K

, re- spectively. Similarly, Rules (14) and (15) allocate a location contradicting Condition 2 or 3 in Definition 2, respectively. The rules corresponding to the case where the heap is 2-consistent are defined in a similar way (they are omitted for conciseness).

Lemma 6. Let h be a PCP-encoding and let s be a store such that s(x) is the root of h. The following equivalence statement holds: (s,h) | =

R

B(x) iff h is not i-consistent, for some i = 1, 2.

Proof. We use the same notations as in Definition 1. ⇒: ⇒: ⇒: Assume that (s,h) | =

Rπ

B(x). Then there exists a predicate-free unfolding φ of B(x) such that (s,h) | =

Rπ

φ.

By definition of the rules defining B, this entails that one of rules (13), (14) or (15) (or the corresponding rules for i = 2) must have been applied at some point in the derivation, since these are the only rules that can eliminate the predicate. By symmetry we assume that one of the rules corresponding to i = 1 is applied. If Rule (13) is applied, then there exist locations l, l

0

, l

00

, l

1

and l

2

such that h(l) = (l

0

, a,l

1

, p

1

, l

2

, p

2

) and h(l

1

) = (l

00

, n), where a ∈ V , n ∈ J 1, N K , a 6= u

1n

[p

1

]. Since h is a PCP-encoding, this is possible only if l = `

l

, for some l ∈ J 1,L K and l

01

= `

0k

, for some k ∈ J 1, K K . Then h falsifies Condition 1 of Definition 2, hence h is not 1-consistent. If Rule (14) is applied then there exist locations l, l

0

, l

00

, l

1

, l

2

, l

01

,l

02

and l

001

such that h(l) = (l

0

,a, l

1

, p

1

, l

2

, p

2

), h(l

0

) = (l

00

, a

0

, l

01

, p

01

, l

02

, p

02

) and h(l

1

) = (l

001

, n), where 1 ≤ p

1

< |u

1n

|, and either l

1

6≈ l

01

or p

01

6= p

1

+1. Since h is a PCP-encoding, we must have l = `

l

and l

0

= `

l+1

for some l ∈ J 1, L K , and l

1

= `

0k

, for some k ∈ J 1, K K . Therefore, Condition 2 of Definition 2 is falsified. The proof is similar if Rule (15) is applied: we have p

1

= |u

1n

|, and either l

01

6≈ l

001

or p

01

6= 1, which entails that Condition 3 of Definition 2 is falsified.

⇐ ⇐ ⇐: Assume that h is not i-consistent, for some i = 1, 2. We assume that i = 1, the proof for i = 2 is symmetric. By definition of a PCP-encoding, there exists a store s

0

such that s(x) = s

0

(x) and:

(s

0

, h) | =

Rπ

Ll=1

x

l

7→ (x

l+1

, a

l

, y

1l

, p

1l

, y

2l

, p

2l

) ∗ ∗

Kk=1

y

k

7→ (y

k+1

, n

k

),

where x

l

,y

il

, y

k

∈ V , a

l

∈ V , p

il

∈ J 1, M K and n

k

∈ J 1, N K , for all l ∈ J 1, L K , k ∈ J 1,K K and i ∈ {1, 2}. The location s(x

1

) is the root of the heap, thus we have s(x) = s(x

1

), and we may assume, w.l.o.g., that x = x

1

. Since by hypothesis h is not 1-consistent, there exist l ∈ J 1, L K and k ∈ J 1, K K such that one of the conditions in Definition 2 is falsified. Observe that, according to Definition 2, this entails that s(y

1l

) = s(y

k

). We also have l < L; indeed, it is easy to check that the faulty location cannot be the last one, since, by definition of a PCP-encoding, this location is associated with the special character $ and index n

K

= N, with u

iN

= $ and p

iL

= 1. We therefore have:

(s

0

, h) | =

Rπ

φ

1

∗ x

l

7→ (x

l+1

, a

l

, y

1l

, p

1l

, y

2l

, p

2l

) ∗ φ

2

∗ ψ

1

∗ y

k

7→ (y

k+1

, n

k

)∗ ψ

2

, where:

φ

1

def

= ∗

l−1l0=1

x

l0

7→ (x

l0+1

,a

l0

,y

1l0

, p

1l0

,y

2l0

, p

2l0

) ψ

1

def

= ∗

k−1k0=1

y

k0

7→ (y

k0+1

,n

k0

) φ

2

def

= ∗

Ll0=l+1

x

l0

7→ (x

l0+1

,a

l0

,y

1l0

, p

1l0

,y

2l0

, p

2l0

) ψ

2

def

= ∗

Kk0=k+1

y

k0

7→ (y

k0+1

,n

k0

)

(9)

It is clear that φ

2

| =

Rπ

A(x

l+1

) (?) using Rule (7) L −l times and Rule (8) once. Further, if l < L − 1 then φ

2

| =

Rπ

x

l+1

7→ (x

l+2

, a

l+1

, y

l+11

, p

l+11

, y

l+12

, p

l+12

) ∗ A(x

l+2

). We also have φ

2

| =

Rπ

C(x

l+1

, x

l+2

,a

l

+ 1,y

l+11

, p

l+11

, y

l+12

, p

l+12

) (†), using Rule (9) if l < L − 1 and Rule (10) otherwise. Similarly, ψ

2

| =

Rπ

A(y

k+1

) and y

k

7→ (y

k+1

, n

k

) ∗ ψ

2

| =

Rπ

C(y

k

, y

k+1

,n

k

, ⊥, ⊥,⊥, ⊥) (‡). Furthermore, if k > 1, then ψ

1

| =

Rπ

A(y

k

).

Assume first that Condition 1 is falsified. Then a

l

6= u

1k

[p

1l

], hence, by Rule (13), using the relations (?) and (‡), we deduce that x

l

7→ (x

l+1

, a

l

,y

l1

, p

l1

, y

l2

, p

l2

) ∗ φ

2

∗ y

k

7→

(y

k+1

, n

k

) ∗ ψ

2

| =

Rπ

B(x

l

). If Condition 2 or 3 are falsified, then we get the same result, using the rules (14) and (15), instead of (13), and Relation (†) instead of (?). If k = 1, then, by applying Rule (12) k −1 times, we deduce that (s, h) | =

Rπ

B(x

1

). If k > 1, then we get the same result by applying Rule (11) once and Rule (12) k −1 times, using the fact that ψ

1

| =

Rπ

A(y

k

).

Putting everything together, we get the stated result:

Theorem 7. The entailment problem is undecidable for systems of inductive definitions satisfying the progress and connectivity condition, but not the establishment condition.

Proof. Consider an instance π of the (adapted) PCP. By Lemma 4, the PCP has a solution iff there exists a PCP-encoding that is i-consistent, for i = 1, 2. By Lemmas 5 and 6, we can compute a system of inductive rules R

π

such that h is a PCP-encoding iff (s, h) | =

Rπ

I(x

1

), and h is i-consistent for all i = 1, 2 iff (s, h) 6| =

Rπ

B(x

1

); i.e., such that the PCP has a solution iff I(x

1

) 6| =

Rπ

B(x

1

). It is easy to check that R

π

is progressing and connected but not established, see for instance Rules (7), (8) and (12) in Fig. 2.

Since the PCP is undecidable, the proof is completed.

References

[1] R. Iosif, A. Rogalewicz, J. Simacek, The tree width of separation logic with recursive defi- nitions, in: Proc. of CADE-24, Vol. 7898 of LNCS, 2013.

[2] J. Reynolds, Separation Logic: A Logic for Shared Mutable Data Structures, in: Proc. of LICS’02, 2002.

[3] C. Calcagno, D. Distefano, J. Dubreil, D. Gabi, P. Hooimeijer, M. Luca, P. W. O’Hearn, I. Papakonstantinou, J. Purbrick, D. Rodriguez, Moving fast with software verification, in:

K. Havelund, G. J. Holzmann, R. Joshi (Eds.), NASA Formal Methods - 7th International Symposium, NFM 2015, Pasadena, CA, USA, April 27-29, 2015, Proceedings, Vol. 9058 of LNCS, Springer, 2015, pp. 3–11.

[4] J. Berdine, B. Cook, S. Ishtiaq, Slayer: Memory safety for systems-level code, in: G. G.

andShaz Qadeer (Ed.), Computer Aided Verification - 23rd International Conference, CAV 2011, Snowbird, UT, USA, July 14-20, 2011. Proceedings, Vol. 6806 of LNCS, Springer, 2011, pp. 178–183.

[5] K. Dudka, P. Peringer, T. Vojnar, Predator: A practical tool for checking manipulation of dynamic data structures using separation logic, in: G. Gopalakrishnan, S. Qadeer (Eds.), Computer Aided Verification - 23rd International Conference, CAV 2011, Snowbird, UT, USA, July 14-20, 2011. Proceedings, Vol. 6806 of LNCS, Springer, 2011, pp. 372–378.

[6] B. Courcelle, The monadic second-order logic of graphs. I. Recognizable sets of finite

graphs, Information and Computation 85 (1) (1990) 12 – 75.

(10)

[7] M. Echenim, R. Iosif, N. Peltier, Decidable entailments in separation logic with inductive definitions: Beyond established systems, CoRR abs/2007.00502.

URL https://arxiv.org/abs/2007.00502

(11)

I(x)⇐ ∃x0,y,z.x7→(x0,a,y,1,y,1)∗W(x0,z)∗S(y,z) (2)

W(x,z)⇐ ∃x0,y1,y2.x7→(x0,a,y1,p1,y2,p2)∗W(x0,z) (3)

W(x,z)⇐x7→(nil,$,z,1,z,1) (4)

S(y,z)⇐ ∃y0.y7→(y0,n)∗S(y,z) ifn<N (5)

S(y,z)⇐y7→(nil,N)∗y≈z (6)

A(x)⇐ ∃x0,a,z1,p1,z2,p2.x7→(x0,a,z1,p1,z2,p2)∗A(x0) (7) A(x)⇐ ∃x0,a,z1,p1,z2,p2.x7→(x0,a,z1,p1,z2,p2) (8)

C(x,x0,a,z1,p1,z2,p2)⇐x7→(x0,a,z1,p1,z2,p2)∗A(x0) (9) C(x,x0,a,z1,p1,z2,p2)⇐x7→(x0,a,z1,p1,z2,p2) (10)

B(x) ⇐ ∃x0,a,y.x7→(x0,a,y,1,y,1)∗B(x0)∗A(y) (11) B(x) ⇐ ∃x0,a,z1,p1,z2,p2.x7→(x0,a,z1,p1,z2,p2)∗B(x0) (12) B(x) ⇐ ∃x0,a,z1,z2,p2,z01.x7→(x0,a,z1,p1,z2,p2)∗A(x0)

∗C(z1,z01,n,⊥,⊥,⊥,⊥)∗a6≈u1n[p1]ifp1≤ |u1n| (13)

B(x) ⇐ ∃x0,a,z1,z2,p2,a0,z01,p01,z02,p02,z001.x7→(x0,a,z1,p1,z2,p2)

∗C(x0,a0,z01,p01,z02,p02)∗C(z1,z001,n,⊥,⊥,⊥,⊥)

∗(z016≈z1∨p016≈p1+1)ifp1<|u1n| (14) B(x) ⇐ ∃x0,a,z1,z2,p01,p2,a0,z01,z02,p02,z001.x7→(x0,a,z1,p1,z2,p2)

∗C(x0,a0,z01,p01,z02,p02)∗C(z1,z001,n,⊥,⊥,⊥,⊥)

∗(p016≈1∨z016≈z001)ifp1=|u1n| (15) B(x) ⇐ ∃x0,a,z1,p1,z2,z02.x7→(x0,a,z1,p1,z2,p2)∗A(x0)

∗C(z2,z02,n,⊥,⊥,⊥,⊥)∗a6≈u2n[p2]ifp2≤ |u2n| (16)

B(x) ⇐ ∃x0,a,z1,z2,p02,p2,a0,z01,p01,z02,p02,z002.x7→(x0,a,z1,p1,z2,p2)

∗C(x0,a0,z01,p01,z02,p02)∗C(z2,z002,n,⊥,⊥,⊥,⊥)

∗(z026≈z2∨p026≈p2+1)ifp2<|u2n| (17) B(x) ⇐ ∃x0,a,z1,z2,a0,z01,z02,p02,z002.x7→(x0,a,z1,p1,z2,p2)

∗C(x0,a0,z01,p01,z02,p02)∗C(z2,z002,n,⊥,⊥,⊥,⊥)

∗(p026≈1∨z026≈z002)ifp2=|u2n| (18)

Figure 2: The SID R

π

for the PCP Instance π = (u

1

, u

2

) (for all a ∈ V , p

1

, p

2

∈ J 1,M K ,

n ∈ J 1,N K )

Références

Documents relatifs

• Quelle relation entre i et u peut-on écrire au niveau d’une bobine idéale selon la convention d‘orientation retenue?. • Quel est l’ordre de grandeur de

• Circuit étudié : représenter le circuit permettant d’étudier l’établissement du courant dans un circuit RL série, suite au branchement d’un générateur de tension

respectively represent the working range of case n (highly conducting medium and high frequency operation) and case n 2 (test material with high magnetic properties and low

We first give a very brief introduc- tion to Inductive Logic Programming and how it can con- tribute to learning visual classes for symbol recognition in section 2.. We then show

form of entailment that satisfies Strict Entailment (PT-entailment), and one that satisfies the Single Model postulate and Conditional Rationality, i.e., is based on a

Theorem 7.1 (Independence) Ines constraints have the independence property in case of an infinite signa- ture. 2) Satisfiability of Ines constraints with negation. 3) Satisfiability

Since the membership problem is existential (asking for the existence of a derivation) and the entailment problem is universal (every model of the left-hand side is a model of

Take the classic penguin example, and consider a knowledge base containing the statements: “penguins are birds”, “robins are birds”, “penguins do not fly”, “birds fly”