Disproving Inductive Entailments in Separation Logic via Base Pair Approximation
James Brotherston1 Nikos Gorogiannis2
1UCL 2Middlesex University
TABLEAUX’15, Wroclaw, 23 Sept 2015
1/ 16
Disproving Inductive Entailments in Separation Logic via Base Pair - - PowerPoint PPT Presentation
Disproving Inductive Entailments in Separation Logic via Base Pair Approximation James Brotherston 1 Nikos Gorogiannis 2 1 UCL 2 Middlesex University TABLEAUX15, Wroclaw, 23 Sept 2015 1/ 16 Disproof, in general Disproof is the problem of
James Brotherston1 Nikos Gorogiannis2
1UCL 2Middlesex University
TABLEAUX’15, Wroclaw, 23 Sept 2015
1/ 16
A ⊢ B (in some undecidable logic) is not valid.
2/ 16
A ⊢ B (in some undecidable logic) is not valid.
subgoals.
2/ 16
A ⊢ B (in some undecidable logic) is not valid.
subgoals.
exploration: filter out invalid “lemmas”.
2/ 16
A ⊢ B (in some undecidable logic) is not valid.
subgoals.
exploration: filter out invalid “lemmas”.
2/ 16
A ⊢ B (in some undecidable logic) is not valid.
subgoals.
exploration: filter out invalid “lemmas”.
definitions, widely used in program verification.
2/ 16
3/ 16
F ::= emp | x → t | Pt | F ∗ F π ::= t = t | t = t (where P a predicate symbol, t a tuple of terms).
in the heap.
heaps.
3/ 16
F ::= emp | x → t | Pt | F ∗ F π ::= t = t | t = t (where P a predicate symbol, t a tuple of terms).
in the heap.
heaps.
formulas.
3/ 16
A ⇒ Pt (We typically suppress the existential quantifiers in A.)
4/ 16
A ⇒ Pt (We typically suppress the existential quantifiers in A.)
given by: emp ⇒ ls x x x = nil : x → z ∗ ls z y ⇒ ls x y
4/ 16
A ⇒ Pt (We typically suppress the existential quantifiers in A.)
given by: emp ⇒ ls x x x = nil : x → z ∗ ls z y ⇒ ls x y
x = nil : emp ⇒ bt x x = nil : x → (y, z) ∗ bt y ∗ bt z ⇒ bt x
4/ 16
h : Loc ⇀fin Val. ◦ is union of domain-disjoint heaps; e is the empty heap; nil is a non-allocable value.
5/ 16
h : Loc ⇀fin Val. ◦ is union of domain-disjoint heaps; e is the empty heap; nil is a non-allocable value.
= A given by
s, h | =Φ t1 = (=)t2 ⇔ s(t1) = (=)s(t2) s, h | =Φ emp ⇔ h = e s, h | =Φ x → t ⇔ dom(h) = {s(x)} and h(s(x)) = s(t) s, h | =Φ Pit ⇔ (s(t), h) ∈ PiΦ s, h | =Φ F1 ∗ F2 ⇔ ∃h1, h2. h = h1 ◦ h2 and s, h1 | =Φ F1 and s, h2 | =Φ F2 s, h | =Φ ∃z. Π : F ⇔ ∃v ∈ Val|z|. s[z → v], h | =Φ π for all π ∈ Π and s[z → v], h | =Φ F
5/ 16
FOSSACS’14], although satisfiability is decidable [Brotherston et al., CSL-LICS’14].
6/ 16
FOSSACS’14], although satisfiability is decidable [Brotherston et al., CSL-LICS’14].
s, h | =Φ A but s, h | =Φ B.
6/ 16
FOSSACS’14], although satisfiability is decidable [Brotherston et al., CSL-LICS’14].
s, h | =Φ A but s, h | =Φ B.
decidable, in fact EXPTIME-complete [Brotherston et al., submitted, 2015].
6/ 16
FOSSACS’14], although satisfiability is decidable [Brotherston et al., CSL-LICS’14].
s, h | =Φ A but s, h | =Φ B.
decidable, in fact EXPTIME-complete [Brotherston et al., submitted, 2015].
complete, but complicated and, I suspect, ridiculously expensive.
6/ 16
7/ 16
for each possible way of constructing a model of A,
7/ 16
for each possible way of constructing a model of A,
emp ⇒ ls x x x = nil : x → z ∗ ls z y ⇒ ls x y
7/ 16
for each possible way of constructing a model of A,
emp ⇒ ls x x x = nil : x → z ∗ ls z y ⇒ ls x y We obtain two base pairs: baseΦ(ls x y) = {(∅, {x = y}), ({x}, {x = nil})}
7/ 16
8/ 16
Lemma (1) Given (V, Π) ∈ baseΦ(A), a stack s s.t. s | = Π, and finite set W ⊂ Loc \ s(V ), then ∃h. s, h | =Φ A and W ∩ dom(h) = ∅.
8/ 16
Lemma (1) Given (V, Π) ∈ baseΦ(A), a stack s s.t. s | = Π, and finite set W ⊂ Loc \ s(V ), then ∃h. s, h | =Φ A and W ∩ dom(h) = ∅. Lemma (2) If s, h | =Φ B, there is a base pair (V, Π) ∈ baseΦ(B) such that s(V ) ⊆ dom(h) and s | = Π.
8/ 16
Lemma (1) Given (V, Π) ∈ baseΦ(A), a stack s s.t. s | = Π, and finite set W ⊂ Loc \ s(V ), then ∃h. s, h | =Φ A and W ∩ dom(h) = ∅. Lemma (2) If s, h | =Φ B, there is a base pair (V, Π) ∈ baseΦ(B) such that s(V ) ⊆ dom(h) and s | = Π.
A and then Lemma 2 to show it cannot be a model of B.
8/ 16
Game (1)
= Π; and
9/ 16
Game (1)
= Π; and
such that s | = Θ and W ∩ s(Y ) = ∅.
9/ 16
Game (1)
= Π; and
such that s | = Θ and W ∩ s(Y ) = ∅.
9/ 16
Game (1)
= Π; and
such that s | = Θ and W ∩ s(Y ) = ∅.
Proposition If Player 1 has a winning move for A ⊢ B then it is invalid.
9/ 16
Game (2)
= Π.
10/ 16
Game (2)
= Π.
such that σ | = Θ and ∀y ∈ Y \ X. ∃x ∈ X. y ≡σ x.
10/ 16
Game (2)
= Π.
such that σ | = Θ and ∀y ∈ Y \ X. ∃x ∈ X. y ≡σ x.
10/ 16
Game (2)
= Π.
such that σ | = Θ and ∀y ∈ Y \ X. ∃x ∈ X. y ≡σ x.
Theorem Games 1 and 2 are equivalent, and decidable.
10/ 16
11/ 16
baseΦ(bt x) = {(∅, {x = nil}), ({x}, {x = nil})} baseΦ(ls x y) = {(∅, {x = y}), ({x}, {x = nil})}
11/ 16
baseΦ(bt x) = {(∅, {x = nil}), ({x}, {x = nil})} baseΦ(ls x y) = {(∅, {x = y}), ({x}, {x = nil})}
partition σ s.t. x ≡σ nil and x ≡σ y.
11/ 16
baseΦ(bt x) = {(∅, {x = nil}), ({x}, {x = nil})} baseΦ(ls x y) = {(∅, {x = y}), ({x}, {x = nil})}
partition σ s.t. x ≡σ nil and x ≡σ y.
11/ 16
baseΦ(bt x) = {(∅, {x = nil}), ({x}, {x = nil})} baseΦ(ls x y) = {(∅, {x = y}), ({x}, {x = nil})}
partition σ s.t. x ≡σ nil and x ≡σ y.
partition σ s.t. x ≡σ y and x ≡σ nil.
11/ 16
12/ 16
essentially projections onto the free variables of entailments.
12/ 16
essentially projections onto the free variables of entailments.
x → nil ⊢ ∃y. y → nil is valid but, since neither RHS has any free variables, baseΦ(emp) = baseΦ(∃y. y → nil) = {(∅, ∅)} so we can’t distinguish the two entailments.
12/ 16
benchmarks in SL-COMP competition (63 predicates total);
13/ 16
benchmarks in SL-COMP competition (63 predicates total);
818988 entailments; most will be invalid.
13/ 16
benchmarks in SL-COMP competition (63 predicates total);
818988 entailments; most will be invalid.
test set, taking at most 30ms for each.
13/ 16
benchmarks in SL-COMP competition (63 predicates total);
818988 entailments; most will be invalid.
test set, taking at most 30ms for each.
13/ 16
entailments over acyclic list segments only: emp ⇒ als x x x = nil, x = y : x → z ∗ als z y ⇒ als x y
14/ 16
entailments over acyclic list segments only: emp ⇒ als x x x = nil, x = y : x → z ∗ als z y ⇒ als x y
14/ 16
entailments over acyclic list segments only: emp ⇒ als x x x = nil, x = y : x → z ∗ als z y ⇒ als x y
14/ 16
logic with user-defined inductive predicates.
cheeeap.
automated theory exploration.
(e.g., by direct countermodel generation).
15/ 16
Try our techniques within the Cyclist distribution: github.com/ngorogiannis/cyclist
16/ 16