Undecidability of propositional separation logic and its neighbours - - PowerPoint PPT Presentation

undecidability of propositional separation logic and its
SMART_READER_LITE
LIVE PREVIEW

Undecidability of propositional separation logic and its neighbours - - PowerPoint PPT Presentation

Undecidability of propositional separation logic and its neighbours James Brotherston Computer Science Seminar Institute of Cybernetics, Tallinn University of Technology 17 Nov 2011 1/ 27 Outline 1. An overview of propositional separation


slide-1
SLIDE 1

Undecidability of propositional separation logic and its neighbours

James Brotherston Computer Science Seminar Institute of Cybernetics, Tallinn University of Technology 17 Nov 2011

1/ 27

slide-2
SLIDE 2

Outline

  • 1. An overview of propositional separation logic

2/ 27

slide-3
SLIDE 3

Outline

  • 1. An overview of propositional separation logic
  • 2. Undecidability of separation logic

2/ 27

slide-4
SLIDE 4

Outline

  • 1. An overview of propositional separation logic
  • 2. Undecidability of separation logic
  • 3. Decidable fragments: finite vs. infinite valuations

2/ 27

slide-5
SLIDE 5

Outline

  • 1. An overview of propositional separation logic
  • 2. Undecidability of separation logic
  • 3. Decidable fragments: finite vs. infinite valuations
  • 4. Additional results

2/ 27

slide-6
SLIDE 6

Outline

  • 1. An overview of propositional separation logic
  • 2. Undecidability of separation logic
  • 3. Decidable fragments: finite vs. infinite valuations
  • 4. Additional results

This is joint work with Prof. Max Kanovich, Queen Mary University of London. This talk is based on the paper of the same name (in Proc. LICS’10).

2/ 27

slide-7
SLIDE 7

Part I Propositional separation logic

3/ 27

slide-8
SLIDE 8

Separation models

Separation logic is well established as a formalism for expressing and reasoning about properties of memory.

4/ 27

slide-9
SLIDE 9

Separation models

Separation logic is well established as a formalism for expressing and reasoning about properties of memory. Definition A separation model is a cancellative partial commutative monoid H, ◦, E.

4/ 27

slide-10
SLIDE 10

Separation models

Separation logic is well established as a formalism for expressing and reasoning about properties of memory. Definition A separation model is a cancellative partial commutative monoid H, ◦, E. We define: X · Y =def {x ◦ y | x ∈ X, y ∈ Y } whence E ⊆ H is a set of units such that X · E = X.

4/ 27

slide-11
SLIDE 11

Separation models

Separation logic is well established as a formalism for expressing and reasoning about properties of memory. Definition A separation model is a cancellative partial commutative monoid H, ◦, E. We define: X · Y =def {x ◦ y | x ∈ X, y ∈ Y } whence E ⊆ H is a set of units such that X · E = X. Definition H, ◦, E has indivisible units if h1 ◦ h2 ∈ E implies h1, h2 ∈ E. (NB. All models of practical interest have indivisible units!)

4/ 27

slide-12
SLIDE 12

Practical examples of separation models (I)

  • Heap models H, ◦, {e}, where H = L ⇀fin RV is the set
  • f heaps (L is infinite). e is the function with empty

domain, and: h1 ◦ h2 = h1 ∪ h2 if dom(h1), dom(h2) disjoint undefined

  • therwise

5/ 27

slide-13
SLIDE 13

Practical examples of separation models (I)

  • Heap models H, ◦, {e}, where H = L ⇀fin RV is the set
  • f heaps (L is infinite). e is the function with empty

domain, and: h1 ◦ h2 = h1 ∪ h2 if dom(h1), dom(h2) disjoint undefined

  • therwise
  • A basic example of the above: the RAM-domain model

D, ◦, {e0} where D is the class of finite subsets of N, the

  • peration ◦ is the union of disjoint sets, and the unit e0 is ∅.

5/ 27

slide-14
SLIDE 14

Practical examples of separation models (II)

  • Heap-with-permissions models H, ◦, E, where

H = L ⇀fin (RV × P) is a set of heaps with permissions. h1 ◦ h2 is defined as before, except that for heaps with the same value at overlapping locations, we add the permissions.

6/ 27

slide-15
SLIDE 15

Practical examples of separation models (II)

  • Heap-with-permissions models H, ◦, E, where

H = L ⇀fin (RV × P) is a set of heaps with permissions. h1 ◦ h2 is defined as before, except that for heaps with the same value at overlapping locations, we add the permissions.

  • Stack-and-heap models S × H, ◦, E, where H is a set of

heaps or heaps-with-permissions, S = Var ⇀fin Val is a set

  • f stacks, and s1, h1 ◦ s2, h2 is defined when s1 = s2 and

h1 ◦ h2 is defined (as above).

6/ 27

slide-16
SLIDE 16

Semantics (I)

Formulas extend standard propositional connectives with the “multiplicatives” I, ∗ and — ∗.

7/ 27

slide-17
SLIDE 17

Semantics (I)

Formulas extend standard propositional connectives with the “multiplicatives” I, ∗ and — ∗. A valuation for a separation model H, ◦, E is a function ρ from propositional variables to P(H).

7/ 27

slide-18
SLIDE 18

Semantics (I)

Formulas extend standard propositional connectives with the “multiplicatives” I, ∗ and — ∗. A valuation for a separation model H, ◦, E is a function ρ from propositional variables to P(H). Given h ∈ H and formula A we define the relation h | =ρ A by induction on A:

7/ 27

slide-19
SLIDE 19

Semantics (I)

Formulas extend standard propositional connectives with the “multiplicatives” I, ∗ and — ∗. A valuation for a separation model H, ◦, E is a function ρ from propositional variables to P(H). Given h ∈ H and formula A we define the relation h | =ρ A by induction on A:

h | =ρ P ⇔ h ∈ ρ(P) h | =ρ F1 ∧ F2 ⇔ h | =ρ F1 and r | =ρ F2 . . . h | =ρ I ⇔ h = e h | =ρ F1 ∗ F2 ⇔ h = h1 ◦ h2 and h1 | =ρ F1 and h2 | =ρ F2 h | =ρ F1 — ∗ F2 ⇔ ∀h′. h ◦ h′ defined and h′ | =ρ F1 implies h ◦ h′ | =ρ F2

7/ 27

slide-20
SLIDE 20

Semantics (I)

Formulas extend standard propositional connectives with the “multiplicatives” I, ∗ and — ∗. A valuation for a separation model H, ◦, E is a function ρ from propositional variables to P(H). Given h ∈ H and formula A we define the relation h | =ρ A by induction on A:

h | =ρ P ⇔ h ∈ ρ(P) h | =ρ F1 ∧ F2 ⇔ h | =ρ F1 and r | =ρ F2 . . . h | =ρ I ⇔ h = e h | =ρ F1 ∗ F2 ⇔ h = h1 ◦ h2 and h1 | =ρ F1 and h2 | =ρ F2 h | =ρ F1 — ∗ F2 ⇔ ∀h′. h ◦ h′ defined and h′ | =ρ F1 implies h ◦ h′ | =ρ F2

We define Aρ =def {h | h | =ρ A}.

7/ 27

slide-21
SLIDE 21

Semantics (I)

Formulas extend standard propositional connectives with the “multiplicatives” I, ∗ and — ∗. A valuation for a separation model H, ◦, E is a function ρ from propositional variables to P(H). Given h ∈ H and formula A we define the relation h | =ρ A by induction on A:

h | =ρ P ⇔ h ∈ ρ(P) h | =ρ F1 ∧ F2 ⇔ h | =ρ F1 and r | =ρ F2 . . . h | =ρ I ⇔ h = e h | =ρ F1 ∗ F2 ⇔ h = h1 ◦ h2 and h1 | =ρ F1 and h2 | =ρ F2 h | =ρ F1 — ∗ F2 ⇔ ∀h′. h ◦ h′ defined and h′ | =ρ F1 implies h ◦ h′ | =ρ F2

We define Aρ =def {h | h | =ρ A}. A “sequent” A ⊢ B is valid in H, ◦, E if Aρ ⊆ Bρ for all ρ.

7/ 27

slide-22
SLIDE 22

Semantics (II)

In any separation model H, ◦, E we have: Iρ = E A ∗ Bρ = Aρ · Bρ A — ∗ Bρ = largest Z ⊆ H. Z · Aρ ⊆ Bρ

8/ 27

slide-23
SLIDE 23

Semantics (II)

In any separation model H, ◦, E we have: Iρ = E A ∗ Bρ = Aρ · Bρ A — ∗ Bρ = largest Z ⊆ H. Z · Aρ ⊆ Bρ In particular this implies restricted ∗-contraction: I ∧ Aρ = I ∧ Aρ · I ∧ Aρ = (I ∧ A) ∗ (I ∧ A)ρ

8/ 27

slide-24
SLIDE 24

Semantics (II)

In any separation model H, ◦, E we have: Iρ = E A ∗ Bρ = Aρ · Bρ A — ∗ Bρ = largest Z ⊆ H. Z · Aρ ⊆ Bρ In particular this implies restricted ∗-contraction: I ∧ Aρ = I ∧ Aρ · I ∧ Aρ = (I ∧ A) ∗ (I ∧ A)ρ which doesn’t hold in linear logic because, e.g.: A ∗ Bρ = Cl(Aρ · Bρ) where Cl is a closure operator. This is less precise, and rules

  • ut finite valuations since, e.g., Cl(∅) is infinite.

8/ 27

slide-25
SLIDE 25

Possible axiomatisations of separation logic

  • BI, obtained by extending intuitionistic logic with the

standard MILL axioms and rules for I, ∗ and — ∗;

9/ 27

slide-26
SLIDE 26

Possible axiomatisations of separation logic

  • BI, obtained by extending intuitionistic logic with the

standard MILL axioms and rules for I, ∗ and — ∗;

  • BBI, obtained by extending classical logic with the

standard MILL axioms and rules for I, ∗ and — ∗;

9/ 27

slide-27
SLIDE 27

Possible axiomatisations of separation logic

  • BI, obtained by extending intuitionistic logic with the

standard MILL axioms and rules for I, ∗ and — ∗;

  • BBI, obtained by extending classical logic with the

standard MILL axioms and rules for I, ∗ and — ∗;

  • a minimal BBI with additives restricted to ∧ and →, i.e. no

negation and no falsum (see next slide);

9/ 27

slide-28
SLIDE 28

Possible axiomatisations of separation logic

  • BI, obtained by extending intuitionistic logic with the

standard MILL axioms and rules for I, ∗ and — ∗;

  • BBI, obtained by extending classical logic with the

standard MILL axioms and rules for I, ∗ and — ∗;

  • a minimal BBI with additives restricted to ∧ and →, i.e. no

negation and no falsum (see next slide);

  • BBI+eW where eW is the restricted ∗-weakening:

I ∧ (A ∗ B) ⊢ I ∧ A, which holds in all models with indivisible units. Because of restricted ∗-contraction we have I ∧ (A ∗ B) ≡ I ∧ A ∧ B;

9/ 27

slide-29
SLIDE 29

Possible axiomatisations of separation logic

  • BI, obtained by extending intuitionistic logic with the

standard MILL axioms and rules for I, ∗ and — ∗;

  • BBI, obtained by extending classical logic with the

standard MILL axioms and rules for I, ∗ and — ∗;

  • a minimal BBI with additives restricted to ∧ and →, i.e. no

negation and no falsum (see next slide);

  • BBI+eW where eW is the restricted ∗-weakening:

I ∧ (A ∗ B) ⊢ I ∧ A, which holds in all models with indivisible units. Because of restricted ∗-contraction we have I ∧ (A ∗ B) ≡ I ∧ A ∧ B;

  • BBI+W where W is the full ∗-weakening: A ∗ B ⊢ A. This

system collapses into classical logic!

9/ 27

slide-30
SLIDE 30

Minimal BBI

(A ∗ B) ⊢ (B ∗ A) (A ∗ I) ⊢ A (A∗(B ∗ C)) ⊢ ((A ∗ B) ∗ C) A ⊢ (A ∗ I) (A ∗ (A — ∗ B)) ⊢ B A ⊢ B (A ∗ C) ⊢ (B ∗ C) (A ∗ B) ⊢ C A ⊢ (B — ∗ C) (a) Axioms and rules for ∗, — ∗ and I.

10/ 27

slide-31
SLIDE 31

Minimal BBI

(A ∗ B) ⊢ (B ∗ A) (A ∗ I) ⊢ A (A∗(B ∗ C)) ⊢ ((A ∗ B) ∗ C) A ⊢ (A ∗ I) (A ∗ (A — ∗ B)) ⊢ B A ⊢ B (A ∗ C) ⊢ (B ∗ C) (A ∗ B) ⊢ C A ⊢ (B — ∗ C) (a) Axioms and rules for ∗, — ∗ and I. A ⊢ (B → A) A ⊢ (B → (A ∧ B)) (A → (B → C)) ⊢ ((A → B) → (A → C)) (A ∧ B) ⊢ A ((A → B) → A) ⊢ A (Peirce’s law) (A ∧ B) ⊢ B A A ⊢ B B (A ∧ B) ⊢ C A ⊢ (B → C) (b) Axioms and rules for → and ∧.

10/ 27

slide-32
SLIDE 32

Part II Undecidability

11/ 27

slide-33
SLIDE 33

Outline proof of undecidability

M terminates from C

12/ 27

slide-34
SLIDE 34

Outline proof of undecidability

M terminates from C FM,C provable in minimal BBI (Thm 1)

12/ 27

slide-35
SLIDE 35

Outline proof of undecidability

M terminates from C FM,C provable in minimal BBI (Thm 1) FM,C provable in BBI FM,C provable in BBI+eW

12/ 27

slide-36
SLIDE 36

Outline proof of undecidability

M terminates from C FM,C provable in minimal BBI (Thm 1) FM,C provable in BBI FM,C provable in BBI+eW FM,C valid in any separation model FM,C valid in any separation model with indivisible units

12/ 27

slide-37
SLIDE 37

Outline proof of undecidability

M terminates from C FM,C provable in minimal BBI (Thm 1) FM,C provable in BBI FM,C provable in BBI+eW FM,C valid in any separation model FM,C valid in any separation model with indivisible units FM,C valid in some concrete heap model

12/ 27

slide-38
SLIDE 38

Outline proof of undecidability

M terminates from C FM,C provable in minimal BBI (Thm 1) FM,C provable in BBI FM,C provable in BBI+eW FM,C valid in any separation model FM,C valid in any separation model with indivisible units FM,C valid in some concrete heap model (Thm 2)

12/ 27

slide-39
SLIDE 39

Outline proof of undecidability

M terminates from C FM,C provable in minimal BBI (Thm 1) FM,C provable in BBI FM,C provable in BBI+eW FM,C valid in any separation model FM,C valid in any separation model with indivisible units FM,C valid in some concrete heap model (Thm 2) All problems above are undecidable. Undecidability of BBI also established by Larchey-Wendling and Galmiche 2010.

12/ 27

slide-40
SLIDE 40

Minsky machines

A Minsky machine M with counters c1, c2 is given by a finite set

  • f labelled instructions of the following types, where k ∈ {1, 2}:

Li: ck++; goto Lj; “increment ck (and jump)” Li: ck−−; goto Lj; “decrement ck (and jump)” Li: if ck =0 goto Lj; “zero-test ck (and jump)” Li: goto Lj; “jump”

13/ 27

slide-41
SLIDE 41

Minsky machines

A Minsky machine M with counters c1, c2 is given by a finite set

  • f labelled instructions of the following types, where k ∈ {1, 2}:

Li: ck++; goto Lj; “increment ck (and jump)” Li: ck−−; goto Lj; “decrement ck (and jump)” Li: if ck =0 goto Lj; “zero-test ck (and jump)” Li: goto Lj; “jump” Configurations of M have the form Li, n1, n2. We write Li, n1, n2⇓M if Li, n1, n2 ∗

M L0, 0, 0.

13/ 27

slide-42
SLIDE 42

Minsky machines

A Minsky machine M with counters c1, c2 is given by a finite set

  • f labelled instructions of the following types, where k ∈ {1, 2}:

Li: ck++; goto Lj; “increment ck (and jump)” Li: ck−−; goto Lj; “decrement ck (and jump)” Li: if ck =0 goto Lj; “zero-test ck (and jump)” Li: goto Lj; “jump” Configurations of M have the form Li, n1, n2. We write Li, n1, n2⇓M if Li, n1, n2 ∗

M L0, 0, 0.

We introduce special labels L−1, L−2 with instructions: L−1: c2−−; goto L−1; L−1: goto L0; L−2: c1−−; goto L−2; L−2: goto L0; whence L−k, n1, n2⇓M iff nk = 0.

13/ 27

slide-43
SLIDE 43

Encoding configurations in minimal BBI

For each label Li we have a propositional variable li. We also pick two propositional variables p1, p2 to represent counters c1, c2.

14/ 27

slide-44
SLIDE 44

Encoding configurations in minimal BBI

For each label Li we have a propositional variable li. We also pick two propositional variables p1, p2 to represent counters c1,

  • c2. A configuration Li, n1, n2 will be represented as:

li ∗ pn1

1 ∗ pn2 2

where pn

k denotes the formula

n times

pk ∗ pk ∗ · · · ∗ pk

  • , with p0

k = I.

14/ 27

slide-45
SLIDE 45

Encoding configurations in minimal BBI

For each label Li we have a propositional variable li. We also pick two propositional variables p1, p2 to represent counters c1,

  • c2. A configuration Li, n1, n2 will be represented as:

li ∗ pn1

1 ∗ pn2 2

where pn

k denotes the formula

n times

pk ∗ pk ∗ · · · ∗ pk

  • , with p0

k = I.

Also pick propositional variable b and write A =def A — ∗ b b will be interpreted as “all terminating configurations”. — ∗ corresponds to replacement of parts of configurations.

14/ 27

slide-46
SLIDE 46

Encoding machines in minimal BBI

We code each instruction γ of a machine M as a formula κ(γ)

  • f minimal BBI:

Li: ck++; goto Lj; ⇒ ( (lj ∗ pk) — ∗ li) Li: ck−−; goto Lj; ⇒ ( lj — ∗ (li ∗ pk)) Li: if ck =0 goto Lj; ⇒ ( (lj ∨ l−k) — ∗ li) Li: goto Lj; ⇒ ( lj — ∗ li)

15/ 27

slide-47
SLIDE 47

Encoding machines in minimal BBI

We code each instruction γ of a machine M as a formula κ(γ)

  • f minimal BBI:

Li: ck++; goto Lj; ⇒ ( (lj ∗ pk) — ∗ li) Li: ck−−; goto Lj; ⇒ ( lj — ∗ (li ∗ pk)) Li: if ck =0 goto Lj; ⇒ ( (lj ∨ l−k) — ∗ li) Li: goto Lj; ⇒ ( lj — ∗ li) We code a whole machine M = {γ1, . . . , γt} as: κ(M) = I ∧

t

  • i=1

κ(γi) We’ll use restricted ∗-contraction to duplicate instructions as needed!

15/ 27

slide-48
SLIDE 48

First main theorem

Theorem Suppose Li, n1, n2⇓M. Then the following sequent is derivable in minimal BBI: κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0) ⊢ b

16/ 27

slide-49
SLIDE 49

First main theorem

Theorem Suppose Li, n1, n2⇓M. Then the following sequent is derivable in minimal BBI: κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0) ⊢ b Proof relies heavily on “quasi-negation” properties of (e.g. A ≡ A) and the restricted ∗-contraction: I ∧ A ⊢ (I ∧ A) ∗ (I ∧ A) which is derivable in minimal BBI.

16/ 27

slide-50
SLIDE 50

Second main theorem

Theorem Li, n1, n2⇓M whenever the following sequent is valid in some concrete heap-like model used in practice (recall examples): κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0) ⊢ b

17/ 27

slide-51
SLIDE 51

Second main theorem

Theorem Li, n1, n2⇓M whenever the following sequent is valid in some concrete heap-like model used in practice (recall examples): κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0) ⊢ b Proof outline. Consider for simplicity the RAM-domain model D, ◦, {e0} based on subsets of N. We have for any ρ: κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0)ρ ⊆ bρ

17/ 27

slide-52
SLIDE 52

Second main theorem

Theorem Li, n1, n2⇓M whenever the following sequent is valid in some concrete heap-like model used in practice (recall examples): κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0) ⊢ b Proof outline. Consider for simplicity the RAM-domain model D, ◦, {e0} based on subsets of N. We have for any ρ: κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0)ρ ⊆ bρ We want to pick ρ with e0 ∈ κ(M)ρ and e0 ∈ I ∧ l0ρ to get: li ∗ pn1

1 ∗ pn2 2 ρ ⊆ bρ

and infer Li, n1, n2⇓M.

17/ 27

slide-53
SLIDE 53

e0 ∈ κ(M)ρ: The edge of disaster

To check e0 ∈ κ(M)ρ we check e0 ∈ κ(γ)ρ for each instruction γ.

18/ 27

slide-54
SLIDE 54

e0 ∈ κ(M)ρ: The edge of disaster

To check e0 ∈ κ(M)ρ we check e0 ∈ κ(γ)ρ for each instruction γ. Why do we encode, e.g., Li: ck++; goto Lj; as ( (lj ∗ pk) — ∗ li) and not li — ∗ (lj ∗ pk) ?

18/ 27

slide-55
SLIDE 55

e0 ∈ κ(M)ρ: The edge of disaster

To check e0 ∈ κ(M)ρ we check e0 ∈ κ(γ)ρ for each instruction γ. Why do we encode, e.g., Li: ck++; goto Lj; as ( (lj ∗ pk) — ∗ li) and not li — ∗ (lj ∗ pk) ? Let’s try to check: e0 ∈ li — ∗ (lj ∗ pk)ρ, i.e. liρ ⊆ lj ∗ pkρ.

18/ 27

slide-56
SLIDE 56

e0 ∈ κ(M)ρ: The edge of disaster

To check e0 ∈ κ(M)ρ we check e0 ∈ κ(γ)ρ for each instruction γ. Why do we encode, e.g., Li: ck++; goto Lj; as ( (lj ∗ pk) — ∗ li) and not li — ∗ (lj ∗ pk) ? Let’s try to check: e0 ∈ li — ∗ (lj ∗ pk)ρ, i.e. liρ ⊆ lj ∗ pkρ. But suppose Li = Lj. In separation models this means: liρ ⊆ liρ · pkρ ⊆ liρ · pkρ · pkρ ⊆ . . . i.e., any heap can be split into arbitrarily many pieces! (Not a problem in linear logic.)

18/ 27

slide-57
SLIDE 57

pn

kρ: The (second) edge of disaster

We intend that li ∗ pn1

1 ∗ pn2 2 ρ should encode configuration

Li, n1, n2. Thus pnk

k ρ should determine the number nk.

19/ 27

slide-58
SLIDE 58

pn

kρ: The (second) edge of disaster

We intend that li ∗ pn1

1 ∗ pn2 2 ρ should encode configuration

Li, n1, n2. Thus pnk

k ρ should determine the number nk.

But composition of heaps is disjoint so that, e.g., if we take ρ(pk) = {h} for a nonempty heap h, then ρ(p2

k) = ρ(pk ∗ pk) is

empty!

19/ 27

slide-59
SLIDE 59

pn

kρ: The (second) edge of disaster

We intend that li ∗ pn1

1 ∗ pn2 2 ρ should encode configuration

Li, n1, n2. Thus pnk

k ρ should determine the number nk.

But composition of heaps is disjoint so that, e.g., if we take ρ(pk) = {h} for a nonempty heap h, then ρ(p2

k) = ρ(pk ∗ pk) is

empty! In general, whenever ρ(pk) is finite we must have: pn

kρ = pm k ρ

for sufficiently large n and m, which obstructs us in uniquely representing the number nk by the formula pn

k.

(We discuss decidability consequences shortly.)

19/ 27

slide-60
SLIDE 60

Choosing a valuation

We choose a valuation ρ for D, ◦, {e0} as follows: ρ(p1) = {{2m} | m ∈ N} ρ(p2) = {{3m} | m ∈ N} ρ(li) = {{δm

i } | m ∈ N}

where δi is a fresh prime number for each propositional variable l−2, l−1, l0, l1, . . .

20/ 27

slide-61
SLIDE 61

Choosing a valuation

We choose a valuation ρ for D, ◦, {e0} as follows: ρ(p1) = {{2m} | m ∈ N} ρ(p2) = {{3m} | m ∈ N} ρ(li) = {{δm

i } | m ∈ N}

where δi is a fresh prime number for each propositional variable l−2, l−1, l0, l1, . . . Finally, we define: ρ(b) = Li, n1, n2⇓Mli ∗ pn1

1 ∗ pn2 2 ρ

so ρ(b) is the set of interpretations of all terminating configurations.

20/ 27

slide-62
SLIDE 62

Proof of Theorem 2

If κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0) ⊢ b is valid in D, ◦, {e0} then: κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0)ρ ⊆ bρ

21/ 27

slide-63
SLIDE 63

Proof of Theorem 2

If κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0) ⊢ b is valid in D, ◦, {e0} then: κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0)ρ ⊆ bρ Since e0 ∈ κ(M)ρ we get: li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0)ρ ⊆ l0ρ

21/ 27

slide-64
SLIDE 64

Proof of Theorem 2

If κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0) ⊢ b is valid in D, ◦, {e0} then: κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0)ρ ⊆ bρ Since e0 ∈ κ(M)ρ we get: li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0)ρ ⊆ l0ρ Since e0 ∈ I ∧ l0ρ (because L0, 0, 0⇓M), we get: li ∗ pn1

1 ∗ pn2 2 ρ ⊆ bρ

21/ 27

slide-65
SLIDE 65

Proof of Theorem 2

If κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0) ⊢ b is valid in D, ◦, {e0} then: κ(M) ∗ li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0)ρ ⊆ bρ Since e0 ∈ κ(M)ρ we get: li ∗ pn1

1 ∗ pn2 2 ∗ (I ∧

l0)ρ ⊆ l0ρ Since e0 ∈ I ∧ l0ρ (because L0, 0, 0⇓M), we get: li ∗ pn1

1 ∗ pn2 2 ρ ⊆ bρ

Since li ∗ pn1

1 ∗ pn2 2 ρ uniquely determines n1 and n2 we

conclude Li, n1, n2⇓M from definition of ρ(b).

21/ 27

slide-66
SLIDE 66

Part III Decidability: finite vs. infinite valuations

22/ 27

slide-67
SLIDE 67

Finite valuations

The quantifier-free fragment of a certain separation theory over an infinite heap model is decidable (Calcagno et al., 2001). WTF?

23/ 27

slide-68
SLIDE 68

Finite valuations

The quantifier-free fragment of a certain separation theory over an infinite heap model is decidable (Calcagno et al., 2001). WTF? There, valuations are constrained to be finite, whereas our valuation ρ is necessarily infinite.

23/ 27

slide-69
SLIDE 69

Finite valuations

The quantifier-free fragment of a certain separation theory over an infinite heap model is decidable (Calcagno et al., 2001). WTF? There, valuations are constrained to be finite, whereas our valuation ρ is necessarily infinite. Theorem There is a sequent of the form κ(M) ∗ li ∗ pn1

1 ∗ (I ∧

l0) ⊢ b such that, for any choice of heap-like model H, ◦, E, the sequent is invalid in the model, but valid under all finite valuations ρ.

23/ 27

slide-70
SLIDE 70

Finite valuations

The quantifier-free fragment of a certain separation theory over an infinite heap model is decidable (Calcagno et al., 2001). WTF? There, valuations are constrained to be finite, whereas our valuation ρ is necessarily infinite. Theorem There is a sequent of the form κ(M) ∗ li ∗ pn1

1 ∗ (I ∧

l0) ⊢ b such that, for any choice of heap-like model H, ◦, E, the sequent is invalid in the model, but valid under all finite valuations ρ. So to obtain decidable fragments of separation logic, one should either give up infinite valuations (Calcagno et al., 2001), or restrict the formula language (Berdine et al., 2004).

23/ 27

slide-71
SLIDE 71

Part IV Additional results

24/ 27

slide-72
SLIDE 72

Classical BI (Brotherston and Calcagno, 2009)

A CBI-model is a separation model H, ◦, E enriched with a total involution ·−1 such that for all h ∈ H. h ◦ h−1 = e−1. (Cf. effect algebras in quantum mechanics.)

25/ 27

slide-73
SLIDE 73

Classical BI (Brotherston and Calcagno, 2009)

A CBI-model is a separation model H, ◦, E enriched with a total involution ·−1 such that for all h ∈ H. h ◦ h−1 = e−1. (Cf. effect algebras in quantum mechanics.) E.g., can take D, ◦, {e0}, ·−1 where D is now the class of finite and cofinite subsets of N, ◦ is union of disjoint sets, e0 = ∅ and ·−1 is set complement.

25/ 27

slide-74
SLIDE 74

Classical BI (Brotherston and Calcagno, 2009)

A CBI-model is a separation model H, ◦, E enriched with a total involution ·−1 such that for all h ∈ H. h ◦ h−1 = e−1. (Cf. effect algebras in quantum mechanics.) E.g., can take D, ◦, {e0}, ·−1 where D is now the class of finite and cofinite subsets of N, ◦ is union of disjoint sets, e0 = ∅ and ·−1 is set complement. CBI extends BBI with a multiplicative negation ∼ defined by: h | =ρ ∼A ⇔ h−1 | =ρ A

25/ 27

slide-75
SLIDE 75

Undecidability of CBI and related problems

M terminates from C FM,C provable in minimal BBI FM,C provable in CBI FM,C provable in CBI+eW FM,C valid in any CBI-model FM,C valid in any CBI-model with indivisible units FM,C valid in the concrete model D, ◦, {e0}, ·−1 (Thm 1) (Thm 2) Proof of Thm 2 now uses a slightly modified valuation ρ. All problems above are again undecidable.

26/ 27

slide-76
SLIDE 76

Some references

  • J. Berdine, C. Calcagno and P. O’Hearn.

A decidable fragment of separation logic. In Proceedings of FSTTCS, 2004.

  • J. Brotherston and C. Calcagno.

Classical BI (a logic for reasoning about dualising resources). In Proceedings of POPL, 2009.

  • C. Calcagno, P. O’Hearn and H. Yang.

Computability and complexity results for a spatial assertion language for data structures. In Proceedings of FSTTCS, 2001.

  • D. Larchey-Wendling and D. Galmiche.

Undecidability of Boolean BI through phase semantics. In Proceedings of LICS, 2010. J.C. Reynolds. Separation logic: a logic for shared mutable data structures. In Proceedings of LICS, 2002.

27/ 27