Deciding the First-Order Theory of an Algebra of Feature Trees with - - PowerPoint PPT Presentation

deciding the first order theory of an algebra of feature
SMART_READER_LITE
LIVE PREVIEW

Deciding the First-Order Theory of an Algebra of Feature Trees with - - PowerPoint PPT Presentation

Deciding the First-Order Theory of an Algebra of Feature Trees with Updates Nicolas Jeannerod, Ralf Treinen IRIF , Universit e Paris-Diderot June 25, 2018 1/24 The CoLiS Project ANR project with IRIF, Inria Saclay, Inria Lille. 2/24


slide-1
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
SLIDE 2

2/24

The CoLiS Project

⊲ ANR project with IRIF, Inria Saclay, Inria Lille.

slide-3
SLIDE 3

2/24

The CoLiS Project

⊲ ANR project with IRIF, Inria Saclay, Inria Lille. ⊲ Verifying Debian packages

slide-4
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
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
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
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
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
SLIDE 9

3/24

Big Picture

Shell

slide-10
SLIDE 10

3/24

Big Picture

Shell IL

Translation

slide-11
SLIDE 11

3/24

Big Picture

Shell IL

Translation

slide-12
SLIDE 12

3/24

Big Picture

Shell IL

Translation

Specifications in Tree Transducers

slide-13
SLIDE 13

3/24

Big Picture

Shell IL

Translation

Specifications in Tree Transducers Specifications in Feature Trees

Symbolic Execution

slide-14
SLIDE 14

3/24

Big Picture

Shell IL

Translation

Specifications in Tree Transducers Specifications in Feature Trees

Symbolic Execution

slide-15
SLIDE 15

4/24

What For?

⊲ Find executions that lead to errors.

⊲ Provide an understandable explanation of why.

slide-16
SLIDE 16

4/24

What For?

⊲ Find executions that lead to errors.

⊲ Provide an understandable explanation of why.

⊲ Check properties

slide-17
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
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
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
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
SLIDE 21

5/24

Feature Trees and Update

slide-22
SLIDE 22

6/24

Unix Filesystem

/ usr etc lib ⊲ Basically a tree with labelled nodes and edges;

slide-23
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
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
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
SLIDE 26

7/24

Here Come the Feature Trees

r v w x u∅ usr etc lib skel

  • caml
slide-27
SLIDE 27

7/24

Here Come the Feature Trees

r v w x u∅ usr etc lib skel

  • caml

c(r) =

slide-28
SLIDE 28

7/24

Here Come the Feature Trees

r v w x u[∅] usr etc lib skel

  • caml

c(r) = ∃u, v, x, w ·

slide-29
SLIDE 29

7/24

Here Come the Feature Trees

r v w x u[∅] usr etc lib skel

  • caml

c(r) = ∃u, v, x, w · r[usr]v ∧ v[lib]x ∧ r[etc]w ∧ w[skel]u

slide-30
SLIDE 30

7/24

Here Come the Feature Trees

r v w x u[∅] usr etc lib skel

  • caml

c(r) = ∃u, v, x, w · r[usr]v ∧ v[lib]x ∧ x[ocaml] ↑ ∧ r[etc]w ∧ w[skel]u

slide-31
SLIDE 31

7/24

Here Come the Feature Trees

r v w x u[∅] usr etc lib skel

  • caml

c(r) = ∃u, v, x, w · r[usr]v ∧ v[lib]x ∧ x[ocaml] ↑ ∧ r[etc]w ∧ w[skel]u ∧ u[∅]

slide-32
SLIDE 32

8/24

...and Here Come the Update

r v w x usr etc lib

  • caml
slide-33
SLIDE 33

8/24

...and Here Come the Update

r v w x usr etc lib

  • caml

mkdir /usr/lib/ocaml

slide-34
SLIDE 34

8/24

...and Here Come the Update

r v w x usr etc lib

  • caml

mkdir /usr/lib/ocaml

r′ v′ w′ x′ y′∅ usr etc lib

  • caml
slide-35
SLIDE 35

8/24

...and Here Come the Update

r v w x usr etc lib

  • caml

mkdir /usr/lib/ocaml

r′ v′ w′ x′ y′∅ usr etc lib

  • caml

c′(r, r′) =

slide-36
SLIDE 36

8/24

...and Here Come the Update

r v w x usr etc lib

  • caml

mkdir /usr/lib/ocaml

r′ v′ w′ x′ y′[∅] usr etc lib

  • caml

c′(r, r′) = ∃v, v′, x, x′, y′ ·       

slide-37
SLIDE 37

8/24

...and Here Come the Update

r v w x usr etc lib

  • caml

mkdir /usr/lib/ocaml

r′ v′ w′ x′ y′[∅] usr etc lib

  • caml

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
SLIDE 38

9/24

Er.. Is That Really What We Want?

⊲ Asymmetric: y is x with f → v

slide-39
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 ·

  • y is x with f → v

∧ z is x with g → w

slide-40
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 ·

  • y is x with f → v

∧ z is x with g → w

  • ⊲ Contains in fact two pieces of information:
slide-41
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 ·

  • y is x with f → v

∧ 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
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 ·

  • y is x with f → v

∧ 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
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 ·

  • y is x with f → v

∧ 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
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 ·

  • y is x with f → v

∧ 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
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
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
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
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 ·

  • y is x with f → v

∧ z is x with g → w

slide-49
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 ·

  • y ∼f x ∧ y[f]v

∧ z ∼g x ∧ z[g]w

slide-50
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 ·

  • y ∼f x ∧ y[f]v

∧ z ∼g x ∧ z[g]w

  • ↔ y[f]v ∧ z[g]w
slide-51
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 ·

  • y ∼f x ∧ y[f]v

∧ z ∼g x ∧ z[g]w

  • ↔ y[f]v ∧ z[g]w ∧ y ∼{f,g} z
slide-52
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
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
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
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
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
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
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
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
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
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
SLIDE 62

14/24

Existential Fragment

slide-63
SLIDE 63

15/24

Existential Fragment

⊲ Constraint system for symbolic execution.

slide-64
SLIDE 64

15/24

Existential Fragment

⊲ Constraint system for symbolic execution. ⊲ Existential quantification on the outside.

slide-65
SLIDE 65

15/24

Existential Fragment

⊲ Constraint system for symbolic execution. ⊲ Existential quantification on the outside. ⊲ “Saturation” system:

slide-66
SLIDE 66

15/24

Existential Fragment

⊲ Constraint system for symbolic execution. ⊲ Existential quantification on the outside. ⊲ “Saturation” system:

⊲ that terminates,

slide-67
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
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
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
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
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
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
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
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
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
SLIDE 76

18/24

Properties of the Normal Forms

Lemma

Take a clause c (= ⊥) [...]

c = g ∧ ∃X · l ⊲ in normal form;

slide-77
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
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
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
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
SLIDE 81

19/24

Garbage Collection

r0 x0 y0 usr lib

slide-82
SLIDE 82

19/24

Garbage Collection

r0 x0 y0 usr lib ⊲ mkdir /usr/lib/ocaml;

slide-83
SLIDE 83

19/24

Garbage Collection

r0 x0 y0 usr lib

  • caml

r1 x1 y1 usr lib z1[∅]

  • caml

∼{usr} ∼{lib} ∼{ocaml} ⊲ mkdir /usr/lib/ocaml; ⊲ Normal form: satisfiable

slide-84
SLIDE 84

19/24

Garbage Collection

r0 x0 y0 usr lib

  • caml

r1 x1 y1 usr lib z1[∅]

  • caml

∼{usr} ∼{lib} ∼{ocaml} ⊲ mkdir /usr/lib/ocaml; ⊲ mkdir /usr/lib/haskell; ⊲ Normal form: satisfiable

slide-85
SLIDE 85

19/24

Garbage Collection

r0 x0 y0 usr lib

  • caml

r1 x1 y1 usr lib z1[∅]

  • caml

∼{usr} ∼{lib} ∼{ocaml} r2 x2 y2 usr lib w2[∅] haskell haskell ∼{usr} ∼{lib} ∼{haskell} ⊲ mkdir /usr/lib/ocaml; ⊲ mkdir /usr/lib/haskell;

slide-86
SLIDE 86

19/24

Garbage Collection

r0 x0 y0 usr lib

  • caml

r1 x1 y1 usr lib z1[∅]

  • caml

∼{usr} ∼{lib} ∼{ocaml} r2 x2 y2 usr lib w2[∅] haskell haskell ∼{usr} ∼{lib} ∼{haskell} z1

  • caml

haskell ⊲ mkdir /usr/lib/ocaml; ⊲ mkdir /usr/lib/haskell;

slide-87
SLIDE 87

19/24

Garbage Collection

r0 x0 y0 usr lib

  • caml

r1 x1 y1 usr lib z1[∅]

  • caml

∼{usr} ∼{lib} ∼{ocaml} r2 x2 y2 usr lib w2[∅] haskell haskell ∼{usr} ∼{lib} ∼{haskell} z1

  • caml

haskell ⊲ mkdir /usr/lib/ocaml; ⊲ mkdir /usr/lib/haskell; ⊲ Normal form: satisfiable

slide-88
SLIDE 88

19/24

Garbage Collection

r0 x0 y0 usr lib

  • caml

r1 x1 y1 usr lib z1[∅]

  • caml

∼{usr} ∼{lib} ∼{ocaml} r2 x2 y2 usr lib w2[∅] haskell haskell ∼{usr} ∼{lib} ∼{haskell} z1

  • caml

haskell ⊲ mkdir /usr/lib/ocaml; ⊲ mkdir /usr/lib/haskell; ⊲ Normal form: satisfiable

slide-89
SLIDE 89

19/24

Garbage Collection

r0 x0 y0 usr lib

  • caml

r2 x2 y2 usr lib w2[∅] haskell z1[∅]

  • caml

haskell ∼{usr} ∼{lib} ∼{ocaml,haskell} ⊲ mkdir /usr/lib/ocaml; ⊲ mkdir /usr/lib/haskell; ⊲ Normal form: satisfiable

slide-90
SLIDE 90

20/24

First Order

slide-91
SLIDE 91

21/24

Quantifier Switching

⊲ What can we express with local variables? ∃x · (y[f]x ∧ x[g] ↑)

slide-92
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
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
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
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
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
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
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
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
SLIDE 100

23/24

Weak Quantifier Elimination

⊲ If we have a procedure: ∃X · c ⇒ ∀Y · c′

slide-101
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
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
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
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
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
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
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?