SLIDE 1 1/24
Deciding the First-Order Theory
- f an Algebra of Feature Trees with Updates
Nicolas Jeannerod, Ralf Treinen
IRIF , Universit´ e Paris-Diderot
June 25, 2018
SLIDE 2
2/24
The CoLiS Project
⊲ ANR project with IRIF, Inria Saclay, Inria Lille.
SLIDE 3
2/24
The CoLiS Project
⊲ ANR project with IRIF, Inria Saclay, Inria Lille. ⊲ Verifying Debian packages
SLIDE 4
2/24
The CoLiS Project
⊲ ANR project with IRIF, Inria Saclay, Inria Lille. ⊲ Verifying Debian packages:
⊲ A tar archive containing files; ⊲ A few shell scripts.
SLIDE 5
2/24
The CoLiS Project
⊲ ANR project with IRIF, Inria Saclay, Inria Lille. ⊲ Verifying Debian packages:
⊲ A tar archive containing files; ⊲ A few shell scripts.
⊲ Giving them specifications
SLIDE 6
2/24
The CoLiS Project
⊲ ANR project with IRIF, Inria Saclay, Inria Lille. ⊲ Verifying Debian packages:
⊲ A tar archive containing files; ⊲ A few shell scripts.
⊲ Giving them specifications:
⊲ Input:
⊲ Environment, ⊲ Execution mode (install, update, removal, purge, ..), ⊲ Input filesystem;
SLIDE 7
2/24
The CoLiS Project
⊲ ANR project with IRIF, Inria Saclay, Inria Lille. ⊲ Verifying Debian packages:
⊲ A tar archive containing files; ⊲ A few shell scripts.
⊲ Giving them specifications:
⊲ Input:
⊲ Environment, ⊲ Execution mode (install, update, removal, purge, ..), ⊲ Input filesystem;
⊲ Output:
⊲ Success / Error, ⊲ Output filesystem.
SLIDE 8
2/24
The CoLiS Project
⊲ ANR project with IRIF, Inria Saclay, Inria Lille. ⊲ Verifying Debian packages:
⊲ A tar archive containing files; ⊲ A few shell scripts.
⊲ Giving them specifications:
⊲ Input:
⊲ Environment, ⊲ Execution mode (install, update, removal, purge, ..), ⊲ Input filesystem;
⊲ Output:
⊲ Success / Error, ⊲ Output filesystem.
SLIDE 9
3/24
Big Picture
Shell
SLIDE 10 3/24
Big Picture
Shell IL
Translation
SLIDE 11 3/24
Big Picture
Shell IL
Translation
SLIDE 12 3/24
Big Picture
Shell IL
Translation
Specifications in Tree Transducers
SLIDE 13 3/24
Big Picture
Shell IL
Translation
Specifications in Tree Transducers Specifications in Feature Trees
Symbolic Execution
SLIDE 14 3/24
Big Picture
Shell IL
Translation
Specifications in Tree Transducers Specifications in Feature Trees
Symbolic Execution
SLIDE 15
4/24
What For?
⊲ Find executions that lead to errors.
⊲ Provide an understandable explanation of why.
SLIDE 16
4/24
What For?
⊲ Find executions that lead to errors.
⊲ Provide an understandable explanation of why.
⊲ Check properties
SLIDE 17
4/24
What For?
⊲ Find executions that lead to errors.
⊲ Provide an understandable explanation of why.
⊲ Check properties:
⊲ Script doing nothing: ∀in, out · (specs(in, out) ↔ out . = in)
SLIDE 18
4/24
What For?
⊲ Find executions that lead to errors.
⊲ Provide an understandable explanation of why.
⊲ Check properties:
⊲ Script doing nothing: ∀in, out · (specs(in, out) ↔ out . = in) ⊲ Equivalence of two scripts: ∀in, out · (specs(in, out) ↔ spect(in, out))
SLIDE 19
4/24
What For?
⊲ Find executions that lead to errors.
⊲ Provide an understandable explanation of why.
⊲ Check properties:
⊲ Script doing nothing: ∀in, out · (specs(in, out) ↔ out . = in) ⊲ Equivalence of two scripts: ∀in, out · (specs(in, out) ↔ spect(in, out)) ⊲ Script that don’t modify /home: ∀in, out · (specs(in, out) → out[home] = in[home])
SLIDE 20
4/24
What For?
⊲ Find executions that lead to errors.
⊲ Provide an understandable explanation of why.
⊲ Check properties:
⊲ Script doing nothing: ∀in, out · (specs(in, out) ↔ out . = in) ⊲ Equivalence of two scripts: ∀in, out · (specs(in, out) ↔ spect(in, out)) ⊲ Script that don’t modify /home: ∀in, out · (specs(in, out) → out[home] = in[home]) ⊲ Sequence of scripts that do nothing: ∀in, out · (∃r · (specs(in, r) ∧ spect(r, out)) ↔ out . = in)
SLIDE 21
5/24
Feature Trees and Update
SLIDE 22
6/24
Unix Filesystem
/ usr etc lib ⊲ Basically a tree with labelled nodes and edges;
SLIDE 23
6/24
Unix Filesystem
/ usr etc lib libc.so libc.so.6 ⊲ Basically a tree with labelled nodes and edges; ⊲ There can be sharing at the leafs (hard link between files);
SLIDE 24
6/24
Unix Filesystem
/ usr etc lib libc.so libc.so.6 lib ⊲ Basically a tree with labelled nodes and edges; ⊲ There can be sharing at the leafs (hard link between files); ⊲ There can be pointers to other parts of the tree (symbolic links)
SLIDE 25
6/24
Unix Filesystem
/ usr etc lib libc.so libc.so.6 lib root ⊲ Basically a tree with labelled nodes and edges; ⊲ There can be sharing at the leafs (hard link between files); ⊲ There can be pointers to other parts of the tree (symbolic links)
which may form cycles.
SLIDE 26 7/24
Here Come the Feature Trees
r v w x u∅ usr etc lib skel
SLIDE 27 7/24
Here Come the Feature Trees
r v w x u∅ usr etc lib skel
c(r) =
SLIDE 28 7/24
Here Come the Feature Trees
r v w x u[∅] usr etc lib skel
c(r) = ∃u, v, x, w ·
SLIDE 29 7/24
Here Come the Feature Trees
r v w x u[∅] usr etc lib skel
c(r) = ∃u, v, x, w · r[usr]v ∧ v[lib]x ∧ r[etc]w ∧ w[skel]u
SLIDE 30 7/24
Here Come the Feature Trees
r v w x u[∅] usr etc lib skel
c(r) = ∃u, v, x, w · r[usr]v ∧ v[lib]x ∧ x[ocaml] ↑ ∧ r[etc]w ∧ w[skel]u
SLIDE 31 7/24
Here Come the Feature Trees
r v w x u[∅] usr etc lib skel
c(r) = ∃u, v, x, w · r[usr]v ∧ v[lib]x ∧ x[ocaml] ↑ ∧ r[etc]w ∧ w[skel]u ∧ u[∅]
SLIDE 32 8/24
...and Here Come the Update
r v w x usr etc lib
SLIDE 33 8/24
...and Here Come the Update
r v w x usr etc lib
mkdir /usr/lib/ocaml
SLIDE 34 8/24
...and Here Come the Update
r v w x usr etc lib
mkdir /usr/lib/ocaml
r′ v′ w′ x′ y′∅ usr etc lib
SLIDE 35 8/24
...and Here Come the Update
r v w x usr etc lib
mkdir /usr/lib/ocaml
r′ v′ w′ x′ y′∅ usr etc lib
c′(r, r′) =
SLIDE 36 8/24
...and Here Come the Update
r v w x usr etc lib
mkdir /usr/lib/ocaml
r′ v′ w′ x′ y′[∅] usr etc lib
c′(r, r′) = ∃v, v′, x, x′, y′ ·
SLIDE 37 8/24
...and Here Come the Update
r v w x usr etc lib
mkdir /usr/lib/ocaml
r′ v′ w′ x′ y′[∅] usr etc lib
c′(r, r′) = ∃v, v′, x, x′, y′ · r′ is r with usr → v′ ∧ v′ is v with lib → x′ ∧ x′ is x with ocaml → y′ ∧ y′[∅]
SLIDE 38
9/24
Er.. Is That Really What We Want?
⊲ Asymmetric: y is x with f → v
SLIDE 39 9/24
Er.. Is That Really What We Want?
⊲ Asymmetric: y is x with f → v ⊲ Makes it hard to eliminate variables: ∃x ·
∧ z is x with g → w
SLIDE 40 9/24
Er.. Is That Really What We Want?
⊲ Asymmetric: y is x with f → v ⊲ Makes it hard to eliminate variables: ∃x ·
∧ z is x with g → w
- ⊲ Contains in fact two pieces of information:
SLIDE 41 9/24
Er.. Is That Really What We Want?
⊲ Asymmetric: y is x with f → v ⊲ Makes it hard to eliminate variables: ∃x ·
∧ z is x with g → w
- ⊲ Contains in fact two pieces of information:
⊲ “y and x may be different in f but are identical everywhere else”
SLIDE 42 9/24
Er.. Is That Really What We Want?
⊲ Asymmetric: y is x with f → v ⊲ Makes it hard to eliminate variables: ∃x ·
∧ z is x with g → w
- ⊲ Contains in fact two pieces of information:
⊲ “y and x may be different in f but are identical everywhere else” ⊲ “y points to v through f”
SLIDE 43 9/24
Er.. Is That Really What We Want?
⊲ Asymmetric: y is x with f → v ⊲ Makes it hard to eliminate variables: ∃x ·
∧ z is x with g → w
- ⊲ Contains in fact two pieces of information:
⊲ “y and x may be different in f but are identical everywhere else” ⊲ “y points to v through f”: y[f]v
SLIDE 44 9/24
Er.. Is That Really What We Want?
⊲ Asymmetric: y is x with f → v ⊲ Makes it hard to eliminate variables: ∃x ·
∧ z is x with g → w
- ⊲ Contains in fact two pieces of information:
⊲ “y and x may be different in f but are identical everywhere else”: y ∼f x ⊲ “y points to v through f”: y[f]v
SLIDE 45 10/24
- Nah. This Tildy-Thingy Looks Much Better
⊲ Allows to express the update: “y is x with f → v” := y ∼f x ∧ y[f]v
SLIDE 46 10/24
- Nah. This Tildy-Thingy Looks Much Better
⊲ Allows to express the update: “y is x with f → v” := y ∼f x ∧ y[f]v ⊲ Equivalence relation: y ∼f x ⇐ ⇒ x ∼f y y ∼f x ∧ x ∼f z = ⇒ y ∼f z
SLIDE 47 10/24
- Nah. This Tildy-Thingy Looks Much Better
⊲ Allows to express the update: “y is x with f → v” := y ∼f x ∧ y[f]v ⊲ Equivalence relation: y ∼f x ⇐ ⇒ x ∼f y y ∼f x ∧ x ∼f z = ⇒ y ∼f z ⊲ Other properties: y ∼f x ∧ x ∼g z = ⇒ y ∼{f,g} z y ∼f x ∧ y ∼g x ⇐ ⇒ y ∼∅ x
SLIDE 48 10/24
- Nah. This Tildy-Thingy Looks Much Better
⊲ Allows to express the update: “y is x with f → v” := y ∼f x ∧ y[f]v ⊲ Equivalence relation: y ∼f x ⇐ ⇒ x ∼f y y ∼f x ∧ x ∼f z = ⇒ y ∼f z ⊲ Other properties: y ∼f x ∧ x ∼g z = ⇒ y ∼{f,g} z y ∼f x ∧ y ∼g x ⇐ ⇒ y ∼∅ x ⊲ Allows to remove variables: ∃x ·
∧ z is x with g → w
SLIDE 49 10/24
- Nah. This Tildy-Thingy Looks Much Better
⊲ Allows to express the update: “y is x with f → v” := y ∼f x ∧ y[f]v ⊲ Equivalence relation: y ∼f x ⇐ ⇒ x ∼f y y ∼f x ∧ x ∼f z = ⇒ y ∼f z ⊲ Other properties: y ∼f x ∧ x ∼g z = ⇒ y ∼{f,g} z y ∼f x ∧ y ∼g x ⇐ ⇒ y ∼∅ x ⊲ Allows to remove variables: ∃x ·
∧ z ∼g x ∧ z[g]w
SLIDE 50 10/24
- Nah. This Tildy-Thingy Looks Much Better
⊲ Allows to express the update: “y is x with f → v” := y ∼f x ∧ y[f]v ⊲ Equivalence relation: y ∼f x ⇐ ⇒ x ∼f y y ∼f x ∧ x ∼f z = ⇒ y ∼f z ⊲ Other properties: y ∼f x ∧ x ∼g z = ⇒ y ∼{f,g} z y ∼f x ∧ y ∼g x ⇐ ⇒ y ∼∅ x ⊲ Allows to remove variables: ∃x ·
∧ z ∼g x ∧ z[g]w
SLIDE 51 10/24
- Nah. This Tildy-Thingy Looks Much Better
⊲ Allows to express the update: “y is x with f → v” := y ∼f x ∧ y[f]v ⊲ Equivalence relation: y ∼f x ⇐ ⇒ x ∼f y y ∼f x ∧ x ∼f z = ⇒ y ∼f z ⊲ Other properties: y ∼f x ∧ x ∼g z = ⇒ y ∼{f,g} z y ∼f x ∧ y ∼g x ⇐ ⇒ y ∼∅ x ⊲ Allows to remove variables: ∃x ·
∧ z ∼g x ∧ z[g]w
- ↔ y[f]v ∧ z[g]w ∧ y ∼{f,g} z
SLIDE 52
11/24
Model and Examples
FT = F FT ⊲ F infinite set of features (names for the edges); ⊲ F FT : partial function with finite domain;
SLIDE 53
11/24
Model and Examples
FT = F FT ⊲ F infinite set of features (names for the edges); ⊲ F FT : partial function with finite domain; t1 f g h t2 i h g f t3 f g h f g h
SLIDE 54
12/24
Constraints and their Interpretation
Equality
x . = y
Feature
x[f]y
Absence
x[f] ↑
Fence
x[F]
Similarity
x ∼F y ⊲ x, y variables. ⊲ f ∈ F, F ⊂ F finite.
SLIDE 55
12/24
Constraints and their Interpretation
Equality
FT , ρ | = x . = y
iff Feature
FT , ρ | = x[f]y
iff Absence
FT , ρ | = x[f] ↑
iff Fence
FT , ρ | = x[F]
iff Similarity
FT , ρ | = x ∼F y
iff
⊲ x, y variables. ⊲ f ∈ F, F ⊂ F finite. ⊲ ρ a valuation from variables to FT .
SLIDE 56
12/24
Constraints and their Interpretation
Equality
FT , ρ | = x . = y
iff
ρ(x) = ρ(y)
Feature
FT , ρ | = x[f]y
iff Absence
FT , ρ | = x[f] ↑
iff Fence
FT , ρ | = x[F]
iff Similarity
FT , ρ | = x ∼F y
iff
⊲ x, y variables. ⊲ f ∈ F, F ⊂ F finite. ⊲ ρ a valuation from variables to FT .
SLIDE 57
12/24
Constraints and their Interpretation
Equality
FT , ρ | = x . = y
iff
ρ(x) = ρ(y)
Feature
FT , ρ | = x[f]y
iff
ρ(x)(f) = ρ(y)
Absence
FT , ρ | = x[f] ↑
iff Fence
FT , ρ | = x[F]
iff Similarity
FT , ρ | = x ∼F y
iff
⊲ x, y variables. ⊲ f ∈ F, F ⊂ F finite. ⊲ ρ a valuation from variables to FT .
SLIDE 58
12/24
Constraints and their Interpretation
Equality
FT , ρ | = x . = y
iff
ρ(x) = ρ(y)
Feature
FT , ρ | = x[f]y
iff
ρ(x)(f) = ρ(y)
Absence
FT , ρ | = x[f] ↑
iff
f / ∈ dom(ρ(x))
Fence
FT , ρ | = x[F]
iff Similarity
FT , ρ | = x ∼F y
iff
⊲ x, y variables. ⊲ f ∈ F, F ⊂ F finite. ⊲ ρ a valuation from variables to FT .
SLIDE 59
12/24
Constraints and their Interpretation
Equality
FT , ρ | = x . = y
iff
ρ(x) = ρ(y)
Feature
FT , ρ | = x[f]y
iff
ρ(x)(f) = ρ(y)
Absence
FT , ρ | = x[f] ↑
iff
f / ∈ dom(ρ(x))
Fence
FT , ρ | = x[F]
iff
dom(ρ(x)) ⊆ F
Similarity
FT , ρ | = x ∼F y
iff
⊲ x, y variables. ⊲ f ∈ F, F ⊂ F finite. ⊲ ρ a valuation from variables to FT .
SLIDE 60
12/24
Constraints and their Interpretation
Equality
FT , ρ | = x . = y
iff
ρ(x) = ρ(y)
Feature
FT , ρ | = x[f]y
iff
ρ(x)(f) = ρ(y)
Absence
FT , ρ | = x[f] ↑
iff
f / ∈ dom(ρ(x))
Fence
FT , ρ | = x[F]
iff
dom(ρ(x)) ⊆ F
Similarity
FT , ρ | = x ∼F y
iff
ρ(x) ↾ F = ρ(y) ↾ F ⊲ x, y variables. ⊲ f ∈ F, F ⊂ F finite. ⊲ ρ a valuation from variables to FT .
SLIDE 61
13/24
Examples (Again)
t1 f g h t2 i h g f t3 f g h f g h
The following constraints are satisfied in FT , [x → t1, y → t2, z → t3]:
z[f]x, x[i] ↑, x[{f, g, h, i}], x ∼{i} y, x ∼{h,i} y
SLIDE 62
14/24
Existential Fragment
SLIDE 63
15/24
Existential Fragment
⊲ Constraint system for symbolic execution.
SLIDE 64
15/24
Existential Fragment
⊲ Constraint system for symbolic execution. ⊲ Existential quantification on the outside.
SLIDE 65
15/24
Existential Fragment
⊲ Constraint system for symbolic execution. ⊲ Existential quantification on the outside. ⊲ “Saturation” system:
SLIDE 66
15/24
Existential Fragment
⊲ Constraint system for symbolic execution. ⊲ Existential quantification on the outside. ⊲ “Saturation” system:
⊲ that terminates,
SLIDE 67
15/24
Existential Fragment
⊲ Constraint system for symbolic execution. ⊲ Existential quantification on the outside. ⊲ “Saturation” system:
⊲ that terminates, ⊲ that keeps equivalences,
SLIDE 68
15/24
Existential Fragment
⊲ Constraint system for symbolic execution. ⊲ Existential quantification on the outside. ⊲ “Saturation” system:
⊲ that terminates, ⊲ that keeps equivalences, ⊲ with nice properties on the normal form.
SLIDE 69
15/24
Existential Fragment
⊲ Constraint system for symbolic execution. ⊲ Existential quantification on the outside. ⊲ “Saturation” system:
⊲ that terminates, ⊲ that keeps equivalences, ⊲ with nice properties on the normal form.
⊲ Normal form: incremental.
SLIDE 70
15/24
Existential Fragment
⊲ Constraint system for symbolic execution. ⊲ Existential quantification on the outside. ⊲ “Saturation” system:
⊲ that terminates, ⊲ that keeps equivalences, ⊲ with nice properties on the normal form.
⊲ Normal form: incremental. ⊲ The rules come from properties of the constructions.
SLIDE 71 16/24
Rules with the Feature Constraint
Clash Rules
C-FEAT-ABS
x[f]y ∧ x[f] ↑
C-FEAT-FEN
x[f]y ∧ x[F] (f / ∈ F)
SLIDE 72 16/24
Rules with the Feature Constraint
Clash Rules
C-FEAT-ABS
x[f]y ∧ x[f] ↑
C-FEAT-FEN
x[f]y ∧ x[F] (f / ∈ F)
Simplification Rules
S-FEATS
∃X, z · (x[f]y ∧ x[f]z ∧ c) ⇒ ∃X · (x[f]y ∧ c{z → y})
SLIDE 73 17/24
Rules with the Similarity Constraint
Propagation Rules
P-FEAT
x ∼F y ∧ x[f]z ∧ c ⇒ x ∼F y ∧ x[f]z ∧ y[f]z ∧ c (f / ∈ F)
SLIDE 74 17/24
Rules with the Similarity Constraint
Propagation Rules
P-FEAT
x ∼F y ∧ x[f]z ∧ c ⇒ x ∼F y ∧ x[f]z ∧ y[f]z ∧ c (f / ∈ F)
P-FEN
x ∼F y ∧ x[G] ∧ c ⇒ x ∼F y ∧ x[G] ∧ y[F ∪ G] ∧ c
SLIDE 75 17/24
Rules with the Similarity Constraint
Propagation Rules
P-FEAT
x ∼F y ∧ x[f]z ∧ c ⇒ x ∼F y ∧ x[f]z ∧ y[f]z ∧ c (f / ∈ F)
P-FEN
x ∼F y ∧ x[G] ∧ c ⇒ x ∼F y ∧ x[G] ∧ y[F ∪ G] ∧ c
P-SIM
x ∼F y ∧ x ∼G z ∧ c ⇒ x ∼F y ∧ x ∼G z ∧ y ∼F∪G z ∧ c
SLIDE 76
18/24
Properties of the Normal Forms
Lemma
Take a clause c (= ⊥) [...]
c = g ∧ ∃X · l ⊲ in normal form;
SLIDE 77
18/24
Properties of the Normal Forms
Lemma
Take a clause c (= ⊥) [...]
c = g ∧ ∃X · l ⊲ in normal form; ⊲ such that there is no y[f]x with x ∈ X and y / ∈ X.
SLIDE 78
18/24
Properties of the Normal Forms
Lemma
Take a clause c (= ⊥) [...]
c = g ∧ ∃X · l ⊲ in normal form; ⊲ such that there is no y[f]x with x ∈ X and y / ∈ X.
Then
FT | = ˜ ∀ · c ↔ g
SLIDE 79
18/24
Properties of the Normal Forms
Lemma
Take a clause c (= ⊥) [...]
c = g ∧ ∃X · l ⊲ in normal form; ⊲ such that there is no y[f]x with x ∈ X and y / ∈ X.
Then
FT | = ˜ ∀ · c ↔ g ⊲ Corollary: all normal forms (= ⊥) are satisfiable:
⊲ If c is a clause in normal form: FT | = ˜ ∃ · c
SLIDE 80
18/24
Properties of the Normal Forms
Lemma
Take a clause c (= ⊥) [...]
c = g ∧ ∃X · l ⊲ in normal form; ⊲ such that there is no y[f]x with x ∈ X and y / ∈ X.
Then
FT | = ˜ ∀ · c ↔ g ⊲ Corollary: all normal forms (= ⊥) are satisfiable:
⊲ If c is a clause in normal form: FT | = ˜ ∃ · c
⊲ We can “garbage collect” the normal forms to make them smaller.
SLIDE 81
19/24
Garbage Collection
r0 x0 y0 usr lib
SLIDE 82
19/24
Garbage Collection
r0 x0 y0 usr lib ⊲ mkdir /usr/lib/ocaml;
SLIDE 83 19/24
Garbage Collection
r0 x0 y0 usr lib
r1 x1 y1 usr lib z1[∅]
∼{usr} ∼{lib} ∼{ocaml} ⊲ mkdir /usr/lib/ocaml; ⊲ Normal form: satisfiable
SLIDE 84 19/24
Garbage Collection
r0 x0 y0 usr lib
r1 x1 y1 usr lib z1[∅]
∼{usr} ∼{lib} ∼{ocaml} ⊲ mkdir /usr/lib/ocaml; ⊲ mkdir /usr/lib/haskell; ⊲ Normal form: satisfiable
SLIDE 85 19/24
Garbage Collection
r0 x0 y0 usr lib
r1 x1 y1 usr lib z1[∅]
∼{usr} ∼{lib} ∼{ocaml} r2 x2 y2 usr lib w2[∅] haskell haskell ∼{usr} ∼{lib} ∼{haskell} ⊲ mkdir /usr/lib/ocaml; ⊲ mkdir /usr/lib/haskell;
SLIDE 86 19/24
Garbage Collection
r0 x0 y0 usr lib
r1 x1 y1 usr lib z1[∅]
∼{usr} ∼{lib} ∼{ocaml} r2 x2 y2 usr lib w2[∅] haskell haskell ∼{usr} ∼{lib} ∼{haskell} z1
haskell ⊲ mkdir /usr/lib/ocaml; ⊲ mkdir /usr/lib/haskell;
SLIDE 87 19/24
Garbage Collection
r0 x0 y0 usr lib
r1 x1 y1 usr lib z1[∅]
∼{usr} ∼{lib} ∼{ocaml} r2 x2 y2 usr lib w2[∅] haskell haskell ∼{usr} ∼{lib} ∼{haskell} z1
haskell ⊲ mkdir /usr/lib/ocaml; ⊲ mkdir /usr/lib/haskell; ⊲ Normal form: satisfiable
SLIDE 88 19/24
Garbage Collection
r0 x0 y0 usr lib
r1 x1 y1 usr lib z1[∅]
∼{usr} ∼{lib} ∼{ocaml} r2 x2 y2 usr lib w2[∅] haskell haskell ∼{usr} ∼{lib} ∼{haskell} z1
haskell ⊲ mkdir /usr/lib/ocaml; ⊲ mkdir /usr/lib/haskell; ⊲ Normal form: satisfiable
SLIDE 89 19/24
Garbage Collection
r0 x0 y0 usr lib
r2 x2 y2 usr lib w2[∅] haskell z1[∅]
haskell ∼{usr} ∼{lib} ∼{ocaml,haskell} ⊲ mkdir /usr/lib/ocaml; ⊲ mkdir /usr/lib/haskell; ⊲ Normal form: satisfiable
SLIDE 90
20/24
First Order
SLIDE 91
21/24
Quantifier Switching
⊲ What can we express with local variables? ∃x · (y[f]x ∧ x[g] ↑)
SLIDE 92
21/24
Quantifier Switching
⊲ What can we express with local variables? ∃x · (y[f]x ∧ x[g] ↑) ⊲ Usually: add predicates to the language that cover these cases
⊲ Here: predicates about paths (hard to work with).
SLIDE 93 21/24
Quantifier Switching
⊲ What can we express with local variables? ∃x · (y[f]x ∧ x[g] ↑) ⊲ Usually: add predicates to the language that cover these cases
⊲ Here: predicates about paths (hard to work with).
⊲ The feature constraint is a function:
FEAT-FUN
∃X, x · (y[f]x ∧ c) ⇒ ¬y[f] ↑ ∧∀x · (y[f]x → ∃X · (y[f]x ∧ c)) y / ∈ X y = x
SLIDE 94 21/24
Quantifier Switching
⊲ What can we express with local variables? ∃x · (y[f]x ∧ x[g] ↑) ⊲ Usually: add predicates to the language that cover these cases
⊲ Here: predicates about paths (hard to work with).
⊲ The feature constraint is a function:
FEAT-FUN
∃X, x · (y[f]x ∧ c) ⇒ ¬y[f] ↑ ∧∀x · (y[f]x → ∃X · (y[f]x ∧ c)) y / ∈ X y = x ⊲ In the example: ¬y[f] ↑ ∧∀x · (y[f]x → x[g] ↑)
SLIDE 95 22/24
How Does That Help?
FEAT-FUN
∃X, x · (y[f]x ∧ c) ⇒ ¬y[f] ↑ ∧∀x · (y[f]x → ∃X · (y[f]x ∧ c)) y / ∈ X y = x
SLIDE 96 22/24
How Does That Help?
FEAT-FUN
∃X, x · (y[f]x ∧ c) ⇒ ¬y[f] ↑ ∧∀x · (y[f]x → ∃X · (y[f]x ∧ c)) y / ∈ X y = x Lemma (reminder)
Take a clause c (= ⊥) [...]
c = g ∧ ∃X · l ⊲ in normal form; ⊲ such that there is no y[f]x with x ∈ X and y / ∈ X.
Then
FT | = ˜ ∀ · c ↔ g
SLIDE 97 22/24
How Does That Help?
FEAT-FUN
∃X, x · (y[f]x ∧ c) ⇒ ¬y[f] ↑ ∧∀x · (y[f]x → ∃X · (y[f]x ∧ c)) y / ∈ X y = x Lemma (reminder)
Take a clause c (= ⊥) [...]
c = g ∧ ∃X · l ⊲ in normal form; ⊲ such that there is no y[f]x with x ∈ X and y / ∈ X.
Then
FT | = ˜ ∀ · c ↔ g ⊲ FEAT-FUN puts us in the hypothesis of the lemma.
SLIDE 98 22/24
How Does That Help?
FEAT-FUN
∃X, x · (y[f]x ∧ c) ⇒ ¬y[f] ↑ ∧∀x · (y[f]x → ∃X · (y[f]x ∧ c)) y / ∈ X y = x Lemma (reminder)
Take a clause c (= ⊥) [...]
c = g ∧ ∃X · l ⊲ in normal form; ⊲ such that there is no y[f]x with x ∈ X and y / ∈ X.
Then
FT | = ˜ ∀ · c ↔ g ⊲ FEAT-FUN puts us in the hypothesis of the lemma. ⊲ Switch an existential quantification into an universal one.
SLIDE 99 22/24
How Does That Help?
FEAT-FUN
∃X, x · (y[f]x ∧ c) ⇒ ¬y[f] ↑ ∧∀x · (y[f]x → ∃X · (y[f]x ∧ c)) y / ∈ X y = x Lemma (reminder)
Take a clause c (= ⊥) [...]
c = g ∧ ∃X · l ⊲ in normal form; ⊲ such that there is no y[f]x with x ∈ X and y / ∈ X.
Then
FT | = ˜ ∀ · c ↔ g ⊲ FEAT-FUN puts us in the hypothesis of the lemma. ⊲ Switch an existential quantification into an universal one. ⊲ We can go for a weak quantifier elimination.
SLIDE 100
23/24
Weak Quantifier Elimination
⊲ If we have a procedure: ∃X · c ⇒ ∀Y · c′
SLIDE 101
23/24
Weak Quantifier Elimination
⊲ If we have a procedure: ∃X · c ⇒ ∀Y · c′ ⊲ Then: ∀X1 · ∃X2 · · · ∀Xn−1 · ∃Xn · c
SLIDE 102
23/24
Weak Quantifier Elimination
⊲ If we have a procedure: ∃X · c ⇒ ∀Y · c′ ⊲ Then: ∀X1 · ∃X2 · · · ∀Xn−1 · ∃Xn · c ⇒ ∀X1 · ∃X2 · · · ∀Xn−1 · ∀Yn · c′
SLIDE 103
23/24
Weak Quantifier Elimination
⊲ If we have a procedure: ∃X · c ⇒ ∀Y · c′ ⊲ Then: ∀X1 · ∃X2 · · · ∀Xn−1 · ∃Xn · c ⇒ ∀X1 · ∃X2 · · · ∀Xn−1 · ∀Yn · c′ = ∀X1 · ∃X2 · · · ∀Xn−1Yn · c′
SLIDE 104
23/24
Weak Quantifier Elimination
⊲ If we have a procedure: ∃X · c ⇒ ∀Y · c′ ⊲ Then: ∀X1 · ∃X2 · · · ∀Xn−1 · ∃Xn · c ⇒ ∀X1 · ∃X2 · · · ∀Xn−1 · ∀Yn · c′ = ∀X1 · ∃X2 · · · ∀Xn−1Yn · c′ ⇒ ¬ ∃X1 · ∀X2 · · · ∃Xn−1Yn · ¬c′
SLIDE 105
23/24
Weak Quantifier Elimination
⊲ If we have a procedure: ∃X · c ⇒ ∀Y · c′ ⊲ Then: ∀X1 · ∃X2 · · · ∀Xn−1 · ∃Xn · c ⇒ ∀X1 · ∃X2 · · · ∀Xn−1 · ∀Yn · c′ = ∀X1 · ∃X2 · · · ∀Xn−1Yn · c′ ⇒ ¬ ∃X1 · ∀X2 · · · ∃Xn−1Yn · ¬c′
. . .
⇒ ? ∃Y1 · c′′
SLIDE 106
23/24
Weak Quantifier Elimination
⊲ If we have a procedure: ∃X · c ⇒ ∀Y · c′ ⊲ Then: ∀X1 · ∃X2 · · · ∀Xn−1 · ∃Xn · c ⇒ ∀X1 · ∃X2 · · · ∀Xn−1 · ∀Yn · c′ = ∀X1 · ∃X2 · · · ∀Xn−1Yn · c′ ⇒ ¬ ∃X1 · ∀X2 · · · ∃Xn−1Yn · ¬c′
. . .
⇒ ? ∃Y1 · c′′ ⊲ We can remove all quantifier blocks but one. ⊲ If we know how to handle the last block, it’s won.
⊲ in our case, we do for closed formula.
SLIDE 107
24/24
Conclusion
⊲ CoLiS project: verifying Debian packages and their shell scripts. ⊲ Feature trees with update to model modifications of filesystems. ⊲ Incremental procedure to decide satisfiability of an existential fragment. ⊲ Extends to first order via weak quantifier elimination. ⊲ Article:
Nicolas Jeannerod, Ralf Treinen. Deciding the First-Order Theory of an Algebra of Feature Trees with Updates. IJCAR 2018
⊲ Thank you for your attention! Any questions?