Feature constraints to modelise Unix filesystems Nicolas Jeannerod - - PowerPoint PPT Presentation

feature constraints to modelise unix filesystems
SMART_READER_LITE
LIVE PREVIEW

Feature constraints to modelise Unix filesystems Nicolas Jeannerod - - PowerPoint PPT Presentation

Feature constraints to modelise Unix filesystems Nicolas Jeannerod IRIF February 7, 2018 1/27 The CoLiS Project Shell 2/27 The CoLiS Project Translation Shell IL 2/27 The CoLiS Project Translation Shell IL 2/27 The CoLiS Project


slide-1
SLIDE 1

1/27

Feature constraints to modelise Unix filesystems

Nicolas Jeannerod

IRIF

February 7, 2018

slide-2
SLIDE 2

2/27

The CoLiS Project

Shell

slide-3
SLIDE 3

2/27

The CoLiS Project

Shell IL

Translation

slide-4
SLIDE 4

2/27

The CoLiS Project

Shell IL

Translation

slide-5
SLIDE 5

2/27

The CoLiS Project

Shell IL

Translation

Specification in Tree Transducers

slide-6
SLIDE 6

2/27

The CoLiS Project

Shell IL

Translation

Specification in Tree Transducers Specification in Feature Trees

slide-7
SLIDE 7

2/27

The CoLiS Project

Shell IL

Translation

Specification in Tree Transducers Specification in Feature Trees

slide-8
SLIDE 8

3/27

Specifications.. then what?

Find accessible states that lead to errors.

slide-9
SLIDE 9

3/27

Specifications.. then what?

Find accessible states that lead to errors. ◮ “Accessible”? Where the specification is satisfiable.

slide-10
SLIDE 10

3/27

Specifications.. then what?

Find accessible states that lead to errors. ◮ “Accessible”? Where the specification is satisfiable. ◮ “Lead to errors”? Where the script exists abnormally.

slide-11
SLIDE 11

3/27

Specifications.. then what?

Find accessible states that lead to errors. ◮ “Accessible”? Where the specification is satisfiable. ◮ “Lead to errors”? Where the script exists abnormally. Fill automated report to script’s maintainer.

slide-12
SLIDE 12

3/27

Specifications.. then what?

Find accessible states that lead to errors. ◮ “Accessible”? Where the specification is satisfiable. ◮ “Lead to errors”? Where the script exists abnormally. Fill automated report to script’s maintainer. Check properties

slide-13
SLIDE 13

3/27

Specifications.. then what?

Find accessible states that lead to errors. ◮ “Accessible”? Where the specification is satisfiable. ◮ “Lead to errors”? Where the script exists abnormally. Fill automated report to script’s maintainer. Check properties: ◮ ∀rin, rout ·

  • specs1(rin, rout) ↔ specs2(rout, rin)
slide-14
SLIDE 14

3/27

Specifications.. then what?

Find accessible states that lead to errors. ◮ “Accessible”? Where the specification is satisfiable. ◮ “Lead to errors”? Where the script exists abnormally. Fill automated report to script’s maintainer. Check properties: ◮ ∀rin, rout ·

  • specs1(rin, rout) ↔ specs2(rout, rin)
  • ◮ ∀rin, rout · (specs(rin, rout) → rout[home] = rin[home])
slide-15
SLIDE 15

3/27

Specifications.. then what?

Find accessible states that lead to errors. ◮ “Accessible”? Where the specification is satisfiable. ◮ “Lead to errors”? Where the script exists abnormally. Fill automated report to script’s maintainer. Check properties: ◮ ∀rin, rout ·

  • specs1(rin, rout) ↔ specs2(rout, rin)
  • ◮ ∀rin, rout · (specs(rin, rout) → rout[home] = rin[home])

◮ ∀rin, rout · (specs(rin, rout) ↔ rout . = rin)

slide-16
SLIDE 16

3/27

Specifications.. then what?

Find accessible states that lead to errors. ◮ “Accessible”? Where the specification is satisfiable. ◮ “Lead to errors”? Where the script exists abnormally. Fill automated report to script’s maintainer. Check properties: ◮ ∀rin, rout ·

  • specs1(rin, rout) ↔ specs2(rout, rin)
  • ◮ ∀rin, rout · (specs(rin, rout) → rout[home] = rin[home])

◮ ∀rin, rout · (specs(rin, rout) ↔ rout . = rin) ◮ ∀rin, rout ·

  • ∃r′ · (specs1(rin, r′) ∧ specs2(r′, rout)) ↔ rout .

= rin

slide-17
SLIDE 17

4/27

Table of Contents

  • 1. Description of filesystems

Unix filesystems Static description Directory update

  • 2. Constraints

Definitions Basic constraints Negation

  • 3. Usages

Decidability of the First-Order Theory Automated Specification for Scripts: Proof of Concept

slide-18
SLIDE 18

5/27

Unix filesystem

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

slide-19
SLIDE 19

5/27

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

5/27

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

5/27

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

6/27

Table of Contents

  • 1. Description of filesystems

Unix filesystems Static description Directory update

  • 2. Constraints

Definitions Basic constraints Negation

  • 3. Usages

Decidability of the First-Order Theory Automated Specification for Scripts: Proof of Concept

slide-23
SLIDE 23

7/27

Static description

r v w x u∅ usr etc lib skel

  • caml
slide-24
SLIDE 24

7/27

Static description

r v w x u∅ usr etc lib skel

  • caml
slide-25
SLIDE 25

7/27

Static description

r v w x u∅ usr etc lib skel

  • caml

c =

slide-26
SLIDE 26

7/27

Static description

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

  • caml

c = ∃u, v, x, w ·

slide-27
SLIDE 27

7/27

Static description

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

  • caml

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

slide-28
SLIDE 28

7/27

Static description

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

  • caml

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

slide-29
SLIDE 29

7/27

Static description

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

  • caml

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

slide-30
SLIDE 30

8/27

Table of Contents

  • 1. Description of filesystems

Unix filesystems Static description Directory update

  • 2. Constraints

Definitions Basic constraints Negation

  • 3. Usages

Decidability of the First-Order Theory Automated Specification for Scripts: Proof of Concept

slide-31
SLIDE 31

9/27

Directory update

r v w x usr etc lib

  • caml
slide-32
SLIDE 32

9/27

Directory update

r v w x usr etc lib

  • caml

mkdir /usr/lib/ocaml

slide-33
SLIDE 33

9/27

Directory update

r v w x usr etc lib

  • caml

mkdir /usr/lib/ocaml

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

  • caml
slide-34
SLIDE 34

9/27

Directory update

r v w x usr etc lib

  • caml

mkdir /usr/lib/ocaml

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

  • caml

c′ =

slide-35
SLIDE 35

9/27

Directory update

r v w x usr etc lib

  • caml

mkdir /usr/lib/ocaml

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

  • caml

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

slide-36
SLIDE 36

9/27

Directory update

r v w x usr etc lib

  • caml

mkdir /usr/lib/ocaml

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

  • caml

c′ = ∃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-37
SLIDE 37

10/27

Er.. is that really what we want?

◮ Asymmetric: y is x with f → v

slide-38
SLIDE 38

10/27

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

10/27

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

10/27

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

10/27

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

10/27

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

10/27

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

11/27

∼: Much better

◮ Allows to express the update: “y is x with f → v” := y

.

∼f x ∧ y[f]v

slide-45
SLIDE 45

11/27

∼: Much better

◮ Allows to express the update: “y is x with f → v” := y

.

∼f x ∧ y[f]v ◮ Symmetric and transitive: y

.

∼f x ⇐ ⇒ x . ∼f y y

.

∼f x ∧ z

.

∼f x = ⇒ y

.

∼f z

slide-46
SLIDE 46

11/27

∼: Much better

◮ Allows to express the update: “y is x with f → v” := y

.

∼f x ∧ y[f]v ◮ Symmetric and transitive: y

.

∼f x ⇐ ⇒ x . ∼f y y

.

∼f x ∧ z

.

∼f x = ⇒ y

.

∼f z ◮ Other properties: y

.

∼f x ∧ z

.

∼g x = ⇒ y

.

∼{f,g} z y

.

∼f x ∧ y

.

∼g x ⇐ ⇒ y

.

∼∅ x

slide-47
SLIDE 47

11/27

∼: Much better

◮ Allows to express the update: “y is x with f → v” := y

.

∼f x ∧ y[f]v ◮ Symmetric and transitive: y

.

∼f x ⇐ ⇒ x . ∼f y y

.

∼f x ∧ z

.

∼f x = ⇒ y

.

∼f z ◮ Other properties: y

.

∼f x ∧ z

.

∼g x = ⇒ 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-48
SLIDE 48

11/27

∼: Much better

◮ Allows to express the update: “y is x with f → v” := y

.

∼f x ∧ y[f]v ◮ Symmetric and transitive: y

.

∼f x ⇐ ⇒ x . ∼f y y

.

∼f x ∧ z

.

∼f x = ⇒ y

.

∼f z ◮ Other properties: y

.

∼f x ∧ z

.

∼g x = ⇒ 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-49
SLIDE 49

11/27

∼: Much better

◮ Allows to express the update: “y is x with f → v” := y

.

∼f x ∧ y[f]v ◮ Symmetric and transitive: y

.

∼f x ⇐ ⇒ x . ∼f y y

.

∼f x ∧ z

.

∼f x = ⇒ y

.

∼f z ◮ Other properties: y

.

∼f x ∧ z

.

∼g x = ⇒ 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-50
SLIDE 50

11/27

∼: Much better

◮ Allows to express the update: “y is x with f → v” := y

.

∼f x ∧ y[f]v ◮ Symmetric and transitive: y

.

∼f x ⇐ ⇒ x . ∼f y y

.

∼f x ∧ z

.

∼f x = ⇒ y

.

∼f z ◮ Other properties: y

.

∼f x ∧ z

.

∼g x = ⇒ 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-51
SLIDE 51

12/27

Table of Contents

  • 1. Description of filesystems

Unix filesystems Static description Directory update

  • 2. Constraints

Definitions Basic constraints Negation

  • 3. Usages

Decidability of the First-Order Theory Automated Specification for Scripts: Proof of Concept

slide-52
SLIDE 52

13/27

Model and Constraints

ftree ::= F ftree

slide-53
SLIDE 53

13/27

Model and Constraints

ftree ::= F ftree ◮ F infinite set of features (names for the edges); ◮ F ftree: partial function with finite domain;

slide-54
SLIDE 54

13/27

Model and Constraints

ftree ::= F ftree ◮ F infinite set of features (names for the edges); ◮ F ftree: partial function with finite domain; ◮ Infinite set of variables x, y, etc.; ◮ f ∈ F, F ⊂ F finite. Equality x . = y Feature x[f]y x[f] ↑ Absence Fence x[F] x . ∼F y Similarity

slide-55
SLIDE 55

13/27

Model and Constraints

ftree ::= F ftree ◮ F infinite set of features (names for the edges); ◮ F ftree: partial function with finite domain; ◮ Infinite set of variables x, y, etc.; ◮ f ∈ F, F ⊂ F finite. Equality x . = y Feature x[f]y x[f] ↑ Absence Fence x[F] x . ∼F y Similarity ◮ Composed with ¬, ∧, ∨, ∃x, ∀x (no quantification on features);

slide-56
SLIDE 56

13/27

Model and Constraints

ftree ::= F ftree ◮ F infinite set of features (names for the edges); ◮ F ftree: partial function with finite domain; ◮ Infinite set of variables x, y, etc.; ◮ f ∈ F, F ⊂ F finite. Equality x . = y Feature x[f]y x[f] ↑ Absence Fence x[F] x . ∼F y Similarity ◮ Composed with ¬, ∧, ∨, ∃x, ∀x (no quantification on features); ◮ Wanted: (un)satisfiability of these constraints; ◮ Bonus point for incremental procedures.

slide-57
SLIDE 57

14/27

Semantics

T , ρ | = c ◮ T the model of all feature trees; ◮ ρ : V(c) → T ;

slide-58
SLIDE 58

14/27

Semantics

T , ρ | = c ◮ T the model of all feature trees; ◮ ρ : V(c) → T ; Equality: T , ρ | = x . = y if ρ(x) = ρ(y)

slide-59
SLIDE 59

14/27

Semantics

T , ρ | = c ◮ T the model of all feature trees; ◮ ρ : V(c) → T ; Equality: T , ρ | = x . = y if ρ(x) = ρ(y) Feature: T , ρ | = x[f]y if ρ(x)(f) = ρ(y) Absence: T , ρ | = x[f] ↑ if f / ∈ dom(ρ(x))

slide-60
SLIDE 60

14/27

Semantics

T , ρ | = c ◮ T the model of all feature trees; ◮ ρ : V(c) → T ; Equality: T , ρ | = x . = y if ρ(x) = ρ(y) Feature: T , ρ | = x[f]y if ρ(x)(f) = ρ(y) Absence: T , ρ | = x[f] ↑ if f / ∈ dom(ρ(x)) Fence: T , ρ | = x[F] if dom(ρ(x)) ⊆ F

slide-61
SLIDE 61

14/27

Semantics

T , ρ | = c ◮ T the model of all feature trees; ◮ ρ : V(c) → T ; Equality: T , ρ | = x . = y if ρ(x) = ρ(y) Feature: T , ρ | = x[f]y if ρ(x)(f) = ρ(y) Absence: T , ρ | = x[f] ↑ if f / ∈ dom(ρ(x)) Fence: T , ρ | = x[F] if dom(ρ(x)) ⊆ F Similarity: T , ρ | = x . ∼F y if ρ(x) ↾ F = ρ(y) ↾ F

slide-62
SLIDE 62

15/27

Table of Contents

  • 1. Description of filesystems

Unix filesystems Static description Directory update

  • 2. Constraints

Definitions Basic constraints Negation

  • 3. Usages

Decidability of the First-Order Theory Automated Specification for Scripts: Proof of Concept

slide-63
SLIDE 63

16/27

Game plan

◮ Rewriting system;

slide-64
SLIDE 64

16/27

Game plan

◮ Rewriting system; ◮ Puts constraints in normal form (not necessarily unique);

slide-65
SLIDE 65

16/27

Game plan

◮ Rewriting system; ◮ Puts constraints in normal form (not necessarily unique); ◮ Respects equivalences;

slide-66
SLIDE 66

16/27

Game plan

◮ Rewriting system; ◮ Puts constraints in normal form (not necessarily unique); ◮ Respects equivalences; ◮ Normal forms: either ⊥ or with nice properties.

slide-67
SLIDE 67

17/27

Basic rewriting system

x1[f1]x2 ∧ . . . ∧ xn[fn]x1 (n ≥ 1) x[f]y ∧ x[f] ↑ x[f]y ∧ x[F] (f / ∈ F) Clash Patterns

slide-68
SLIDE 68

17/27

Basic rewriting system

x1[f1]x2 ∧ . . . ∧ xn[fn]x1 (n ≥ 1) x[f]y ∧ x[f] ↑ x[f]y ∧ x[F] (f / ∈ F) Clash Patterns ∃X, x · (x . = y ∧ c) ⇒ ∃X · c{x → y} (x = y) ∃X, z · (x[f]y ∧ x[f]z ∧ c) ⇒ ∃X · (x[f]y ∧ c{z → y}) (y = z) x . ∼F y ∧ x . ∼G y ∧ c ⇒ x . ∼F∩G y ∧ c Simplification Rules

slide-69
SLIDE 69

17/27

Basic rewriting system

x1[f1]x2 ∧ . . . ∧ xn[fn]x1 (n ≥ 1) x[f]y ∧ x[f] ↑ x[f]y ∧ x[F] (f / ∈ F) Clash Patterns ∃X, x · (x . = y ∧ c) ⇒ ∃X · c{x → y} (x = y) ∃X, z · (x[f]y ∧ x[f]z ∧ c) ⇒ ∃X · (x[f]y ∧ c{z → y}) (y = z) x . ∼F y ∧ x . ∼G y ∧ c ⇒ x . ∼F∩G y ∧ c Simplification Rules x . ∼F y ∧ x[f]z ∧ c ⇒ x . ∼F y ∧ x[f]z ∧ y[f]z ∧ c (f / ∈ F) x . ∼F y ∧ x[f] ↑ ∧c ⇒ x . ∼F y ∧ x[f] ↑ ∧y[f] ↑ ∧c (f / ∈ F) x . ∼F y ∧ x[G] ∧ c ⇒ x . ∼F y ∧ x[G] ∧ y[F ∪ G] ∧ c x . ∼F y ∧ x . ∼G z ∧ c ⇒ x . ∼F y ∧ x . ∼G z ∧ y

.

∼F∪G z ∧ c (if

y . ∼Hz H ⊆ F ∪ G)

Propagation Rules

slide-70
SLIDE 70

18/27

Properties

Lemma

The basic constraint system terminates and yields a clause that is equivalent to the first one.

slide-71
SLIDE 71

18/27

Properties

Lemma

The basic constraint system terminates and yields a clause that is equivalent to the first one.

Lemma

Let c be a clause c = gc ∧ ∃X · lc such that

slide-72
SLIDE 72

18/27

Properties

Lemma

The basic constraint system terminates and yields a clause that is equivalent to the first one.

Lemma

Let c be a clause c = gc ∧ ∃X · lc such that: ◮ c is in normal form;

slide-73
SLIDE 73

18/27

Properties

Lemma

The basic constraint system terminates and yields a clause that is equivalent to the first one.

Lemma

Let c be a clause c = gc ∧ ∃X · lc such that: ◮ c is in normal form; ◮ V(gc) ∩ X = ∅; ◮ every literal in lc is about X;

slide-74
SLIDE 74

18/27

Properties

Lemma

The basic constraint system terminates and yields a clause that is equivalent to the first one.

Lemma

Let c be a clause c = gc ∧ ∃X · lc such that: ◮ c is in normal form; ◮ V(gc) ∩ X = ∅; ◮ every literal in lc is about X; ◮ there is no y[f]x with x ∈ X and y / ∈ X.

slide-75
SLIDE 75

18/27

Properties

Lemma

The basic constraint system terminates and yields a clause that is equivalent to the first one.

Lemma

Let c be a clause c = gc ∧ ∃X · lc such that: ◮ c is in normal form; ◮ V(gc) ∩ X = ∅; ◮ every literal in lc is about X; ◮ there is no y[f]x with x ∈ X and y / ∈ X. Then c is equivalent to gc.

slide-76
SLIDE 76

19/27

Table of Contents

  • 1. Description of filesystems

Unix filesystems Static description Directory update

  • 2. Constraints

Definitions Basic constraints Negation

  • 3. Usages

Decidability of the First-Order Theory Automated Specification for Scripts: Proof of Concept

slide-77
SLIDE 77

20/27

Negation: new players, new rules

aka La Slide de la Mort

slide-78
SLIDE 78

20/27

Negation: new players, new rules

¬x[f]y ∧ c ⇒ (x[f] ↑ ∨∃z · (x[f]z ∧ y ∼∅ z)) ∧ c ¬x[f] ↑ ∧c ⇒ ∃z · x[f]z ∧ c Simple Replacement Rules

slide-79
SLIDE 79

20/27

Negation: new players, new rules

¬x[f]y ∧ c ⇒ (x[f] ↑ ∨∃z · (x[f]z ∧ y ∼∅ z)) ∧ c ¬x[f] ↑ ∧c ⇒ ∃z · x[f]z ∧ c Simple Replacement Rules x[F] ∧ ¬x[G] ∧ c ⇒ x[F] ∧ xF \ G ∧ c x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c

x . ∼F y ∧ x ∼G y ∧ c ⇒ x . ∼F y ∧ x . =F\G y ∧ c More Replacement Rules

slide-80
SLIDE 80

20/27

Negation: new players, new rules

x[F] ∧ ¬x[G] ∧ c ⇒ x[F] ∧ xF \ G ∧ c x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c

x . ∼F y ∧ x ∼G y ∧ c ⇒ x . ∼F y ∧ x . =F\G y ∧ c More Replacement Rules

slide-81
SLIDE 81

20/27

Negation: new players, new rules

x[F] ∧ ¬x[G] ∧ c ⇒ x[F] ∧ xF \ G ∧ c x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c

x . ∼F y ∧ x ∼G y ∧ c ⇒ x . ∼F y ∧ x . =F\G y ∧ c More Replacement Rules

slide-82
SLIDE 82

20/27

Negation: new players, new rules

xF :=

  • f∈F

∃z · x[f]z x[F] ∧ ¬x[G] ∧ c ⇒ x[F] ∧ xF \ G ∧ c x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c

x . ∼F y ∧ x ∼G y ∧ c ⇒ x . ∼F y ∧ x . =F\G y ∧ c More Replacement Rules

slide-83
SLIDE 83

20/27

Negation: new players, new rules

x . =F y :=

  • f∈F

∃z′ · (x[f] ↑ ∧y[f]z′) ∨ ∃z · (x[f]z ∧ y[f] ↑) ∨∃z, z′ · (x[f]z ∧ y[f]z′ ∧ z ∼∅ z′)

  • x[F] ∧ ¬x[G] ∧ c

⇒ x[F] ∧ xF \ G ∧ c x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c

x . ∼F y ∧ x ∼G y ∧ c ⇒ x . ∼F y ∧ x . =F\G y ∧ c More Replacement Rules

slide-84
SLIDE 84

20/27

Negation: new players, new rules

x . =F y :=

  • f∈F

∃z′ · (x[f] ↑ ∧y[f]z′) ∨ ∃z · (x[f]z ∧ y[f] ↑) ∨∃z, z′ · (x[f]z ∧ y[f]z′ ∧ z ∼∅ z′)

  • x[F] ∧ ¬x[G] ∧ c

⇒ x[F] ∧ xF \ G ∧ c x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c

x . ∼F y ∧ x ∼G y ∧ c ⇒ x . ∼F y ∧ x . =F\G y ∧ c More Replacement Rules x . ∼F y ∧ ¬x[G] ∧ c ⇒ x . ∼F y ∧ (¬x[F ∪ G] ∨ xF \ G) ∧ c (F ⊆ G x . ∼F y ∧ ¬x[G] ∧ c ⇒ x . ∼F y ∧ ¬x[G] ∧ ¬y[G] ∧ c (F ⊆ G x . ∼F y ∧ x ∼G z ∧ c ⇒ x . ∼F y ∧

  • x ∼F∪G z ∨ x .

=F\G z

  • ∧ c

(F ⊆ G x . ∼F y ∧ x ∼G z ∧ c ⇒ x . ∼F y ∧ x ∼G z ∧ y ∼G z ∧ c (F ⊆ G Enlargement and Propagation Rules

slide-85
SLIDE 85

20/27

Negation: new players, new rules

x . =F y :=

  • f∈F

∃z′ · (x[f] ↑ ∧y[f]z′) ∨ ∃z · (x[f]z ∧ y[f] ↑) ∨∃z, z′ · (x[f]z ∧ y[f]z′ ∧ z ∼∅ z′)

  • x[F] ∧ ¬x[G] ∧ c

⇒ x[F] ∧ xF \ G ∧ c x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c

x . ∼F y ∧ x ∼G y ∧ c ⇒ x . ∼F y ∧ x . =F\G y ∧ c More Replacement Rules

slide-86
SLIDE 86

20/27

Negation: new players, new rules

x . =F y :=

  • f∈F

∃z′ · (x[f] ↑ ∧y[f]z′) ∨ ∃z · (x[f]z ∧ y[f] ↑) ∨∃z, z′ · (x[f]z ∧ y[f]z′ ∧ z ∼∅ z′)

  • x[F] ∧ ¬x[G] ∧ c

⇒ x[F] ∧ xF \ G ∧ c x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c

x . ∼F y ∧ x ∼G y ∧ c ⇒ x . ∼F y ∧ x . =F\G y ∧ c More Replacement Rules

slide-87
SLIDE 87

20/27

Negation: new players, new rules

x . =F y :=

  • f∈F

∃z′ · (x[f] ↑ ∧y[f]z′) ∨ ∃z · (x[f]z ∧ y[f] ↑) ∨∃z, z′ · (x[f]z ∧ y[f]z′ ∧ z ∼∅ z′)

  • x[F] ∧ ¬x[G] ∧ c

⇒ x[F] ∧ xF \ G ∧ c x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c

x . ∼F y ∧ x ∼G y ∧ c ⇒ x . ∼F y ∧ x . =F\G y ∧ c More Replacement Rules x[F] = “x has no feature outside F” x ∼G y = “there is a feature outside G that differentiates x and y”

slide-88
SLIDE 88

20/27

Negation: new players, new rules

x . =F y :=

  • f∈F

∃z′ · (x[f] ↑ ∧y[f]z′) ∨ ∃z · (x[f]z ∧ y[f] ↑) ∨∃z, z′ · (x[f]z ∧ y[f]z′ ∧ z ∼∅ z′)

  • x[F] ∧ ¬x[G] ∧ c

⇒ x[F] ∧ xF \ G ∧ c x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c

x . ∼F y ∧ x ∼G y ∧ c ⇒ x . ∼F y ∧ x . =F\G y ∧ c More Replacement Rules x[F] = “x has no feature outside F” x ∼G y = “there is a feature outside G that differentiates x and y” ◮ either it is in F, ◮ or it is not,

slide-89
SLIDE 89

20/27

Negation: new players, new rules

x . =F y :=

  • f∈F

∃z′ · (x[f] ↑ ∧y[f]z′) ∨ ∃z · (x[f]z ∧ y[f] ↑) ∨∃z, z′ · (x[f]z ∧ y[f]z′ ∧ z ∼∅ z′)

  • x[F] ∧ ¬x[G] ∧ c

⇒ x[F] ∧ xF \ G ∧ c x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c

x . ∼F y ∧ x ∼G y ∧ c ⇒ x . ∼F y ∧ x . =F\G y ∧ c More Replacement Rules x[F] = “x has no feature outside F” x ∼G y = “there is a feature outside G that differentiates x and y” ◮ either it is in F, and we can list all the cases; ◮ or it is not,

slide-90
SLIDE 90

20/27

Negation: new players, new rules

x . =F y :=

  • f∈F

∃z′ · (x[f] ↑ ∧y[f]z′) ∨ ∃z · (x[f]z ∧ y[f] ↑) ∨∃z, z′ · (x[f]z ∧ y[f]z′ ∧ z ∼∅ z′)

  • x[F] ∧ ¬x[G] ∧ c

⇒ x[F] ∧ xF \ G ∧ c x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c

x . ∼F y ∧ x ∼G y ∧ c ⇒ x . ∼F y ∧ x . =F\G y ∧ c More Replacement Rules x[F] = “x has no feature outside F” x ∼G y = “there is a feature outside G that differentiates x and y” ◮ either it is in F, and we can list all the cases; ◮ or it is not, and since x[F] then ¬y[F ∪ G].

slide-91
SLIDE 91

21/27

Properties

Lemma

The constraint system terminates and yields a clause that is equivalent to the first one.

slide-92
SLIDE 92

21/27

Properties

Lemma

The constraint system terminates and yields a clause that is equivalent to the first one.

Lemma

Let c be a clause c = gc ∧ ∃X · lc such that: ◮ c is in normal form; ◮ V(gc) ∩ X = ∅; ◮ every literal in lc is about X; ◮ there is no y[f]x with x ∈ X and y / ∈ X. Then c is equivalent to gc.

slide-93
SLIDE 93

22/27

Does that even terminate?

R-NSim-Fence:

x[F] ∧ x ∼G y ∧ c ⇒ x[F] ∧

  • ¬y[F ∪ G] ∨ x .

=F\G y

  • ∧ c
slide-94
SLIDE 94

22/27

Does that even terminate?

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ x[{f}] ∧ (¬y[{f}] ∨ x . =f y) ∧ c

slide-95
SLIDE 95

22/27

Does that even terminate?

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ ∃z, z′ · x[f]z ∧ y[f]z′ ∧ z ∼∅ z′ ∧ x[{f}

slide-96
SLIDE 96

22/27

Does that even terminate?

x0[{f}] x1[{f}] x2[{f}] . . . xn[{f}] . . . f f f f f . . . y0 f ∼∅

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ ∃z, z′ · x[f]z ∧ y[f]z′ ∧ z ∼∅ z′ ∧ x[{f}

slide-97
SLIDE 97

22/27

Does that even terminate?

x0[{f}] x1[{f}] x2[{f}] . . . xn[{f}] . . . f f f f f . . . y0 f ∼∅

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ ∃z, z′ · x[f]z ∧ y[f]z′ ∧ z ∼∅ z′ ∧ x[{f} ◮ R-NSim-Fence with x0 and y0;

slide-98
SLIDE 98

22/27

Does that even terminate?

∃y1, z1· x0[{f}] x1[{f}] x2[{f}] . . . xn[{f}] . . . f f f f f . . . y0 y1 f f z1 f ∼∅

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ ∃z, z′ · x[f]z ∧ y[f]z′ ∧ z ∼∅ z′ ∧ x[{f} ◮ R-NSim-Fence with x0 and y0;

slide-99
SLIDE 99

22/27

Does that even terminate?

∃y1, z1· x0[{f}] x1[{f}] x2[{f}] . . . xn[{f}] . . . f f f f f . . . y0 y1 f f z1 f ∼∅

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ ∃z, z′ · x[f]z ∧ y[f]z′ ∧ z ∼∅ z′ ∧ x[{f} ◮ R-NSim-Fence with x0 and y0; ◮ S-Feats with x1 and z1

slide-100
SLIDE 100

22/27

Does that even terminate?

∃y1· x0[{f}] x1[{f}] x2[{f}] . . . xn[{f}] . . . f f f f f . . . y0 y1 f f ∼∅

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ ∃z, z′ · x[f]z ∧ y[f]z′ ∧ z ∼∅ z′ ∧ x[{f} ◮ R-NSim-Fence with x0 and y0; ◮ S-Feats with x1 and z1

slide-101
SLIDE 101

22/27

Does that even terminate?

∃y1· x0[{f}] x1[{f}] x2[{f}] . . . xn[{f}] . . . f f f f f . . . y0 y1 f f ∼∅

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ ∃z, z′ · x[f]z ∧ y[f]z′ ∧ z ∼∅ z′ ∧ x[{f} ◮ R-NSim-Fence with x0 and y0; ◮ S-Feats with x1 and z1 ◮ R-NSim-Fence with x1 and y1;

slide-102
SLIDE 102

22/27

Does that even terminate?

∃y1, y2, z2· x0[{f}] x1[{f}] x2[{f}] . . . xn[{f}] . . . f f f f f . . . y0 y1 y2 f f f z2 f ∼∅

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ ∃z, z′ · x[f]z ∧ y[f]z′ ∧ z ∼∅ z′ ∧ x[{f} ◮ R-NSim-Fence with x0 and y0; ◮ S-Feats with x1 and z1 ◮ R-NSim-Fence with x1 and y1;

slide-103
SLIDE 103

22/27

Does that even terminate?

∃y1, y2, z2· x0[{f}] x1[{f}] x2[{f}] . . . xn[{f}] . . . f f f f f . . . y0 y1 y2 f f f z2 f ∼∅

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ ∃z, z′ · x[f]z ∧ y[f]z′ ∧ z ∼∅ z′ ∧ x[{f} ◮ R-NSim-Fence with x0 and y0; ◮ S-Feats with x1 and z1 ◮ R-NSim-Fence with x1 and y1; ◮ S-Feats with x2 and z2

slide-104
SLIDE 104

22/27

Does that even terminate?

∃y1, y2· x0[{f}] x1[{f}] x2[{f}] . . . xn[{f}] . . . f f f f f . . . y0 y1 y2 f f f ∼∅

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ ∃z, z′ · x[f]z ∧ y[f]z′ ∧ z ∼∅ z′ ∧ x[{f} ◮ R-NSim-Fence with x0 and y0; ◮ S-Feats with x1 and z1 ◮ R-NSim-Fence with x1 and y1; ◮ S-Feats with x2 and z2

slide-105
SLIDE 105

22/27

Does that even terminate?

∃y1, y2· x0[{f}] x1[{f}] x2[{f}] . . . xn[{f}] . . . f f f f f . . . y0 y1 y2 f f f ∼∅

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ ∃z, z′ · x[f]z ∧ y[f]z′ ∧ z ∼∅ z′ ∧ x[{f} ◮ R-NSim-Fence with x0 and y0; ◮ S-Feats with x1 and z1 ◮ R-NSim-Fence with x1 and y1; ◮ S-Feats with x2 and z2 ◮ . . .

slide-106
SLIDE 106

22/27

Does that even terminate?

∃y1, y2, . . . , yn· x0[{f}] x1[{f}] x2[{f}] . . . xn[{f}] . . . f f f f f . . . y0 y1 y2 . . . yn f f f f f ∼∅

R-NSim-Fence (for F = {f} and G = ∅):

x[{f}] ∧ x ∼∅ y ∧ c ⇒ ∃z, z′ · x[f]z ∧ y[f]z′ ∧ z ∼∅ z′ ∧ x[{f} ◮ R-NSim-Fence with x0 and y0; ◮ S-Feats with x1 and z1 ◮ R-NSim-Fence with x1 and y1; ◮ S-Feats with x2 and z2 ◮ . . .

slide-107
SLIDE 107

23/27

Table of Contents

  • 1. Description of filesystems

Unix filesystems Static description Directory update

  • 2. Constraints

Definitions Basic constraints Negation

  • 3. Usages

Decidability of the First-Order Theory Automated Specification for Scripts: Proof of Concept

slide-108
SLIDE 108

24/27

Weak Quantifier Elimination

Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′.

slide-109
SLIDE 109

24/27

Weak Quantifier Elimination

Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′. Take any closed formula

slide-110
SLIDE 110

24/27

Weak Quantifier Elimination

Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′. Take any closed formula, look at the last quantifier bloc

slide-111
SLIDE 111

24/27

Weak Quantifier Elimination

Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′. Take any closed formula, look at the last quantifier bloc: ◮ Universal ∀ ∃ · · · ∀X · c

slide-112
SLIDE 112

24/27

Weak Quantifier Elimination

Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′. Take any closed formula, look at the last quantifier bloc: ◮ Universal, switch it to existential: ∀ ∃ · · · ∀X · c = ⇒ ¬ ∃ ∀ · · · ∃X · ¬c

slide-113
SLIDE 113

24/27

Weak Quantifier Elimination

Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′. Take any closed formula, look at the last quantifier bloc: ◮ Universal, switch it to existential: ∀ ∃ · · · ∀X · c = ⇒ ¬ ∃ ∀ · · · ∃X · ¬c ◮ Existential:

slide-114
SLIDE 114

24/27

Weak Quantifier Elimination

Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′. Take any closed formula, look at the last quantifier bloc: ◮ Universal, switch it to existential: ∀ ∃ · · · ∀X · c = ⇒ ¬ ∃ ∀ · · · ∃X · ¬c ◮ Existential:

◮ If there is an other bloc before ∀ ∃ · · · ∀Y · ∃X · c

slide-115
SLIDE 115

24/27

Weak Quantifier Elimination

Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′. Take any closed formula, look at the last quantifier bloc: ◮ Universal, switch it to existential: ∀ ∃ · · · ∀X · c = ⇒ ¬ ∃ ∀ · · · ∃X · ¬c ◮ Existential:

◮ If there is an other bloc before, use the given technique: ∀ ∃ · · · ∀Y · ∃X · c = ⇒ ∀ ∃ · · · ∀Y, X′ · c′

slide-116
SLIDE 116

24/27

Weak Quantifier Elimination

Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′. Take any closed formula, look at the last quantifier bloc: ◮ Universal, switch it to existential: ∀ ∃ · · · ∀X · c = ⇒ ¬ ∃ ∀ · · · ∃X · ¬c ◮ Existential:

◮ If there is an other bloc before, use the given technique: ∀ ∃ · · · ∀Y · ∃X · c = ⇒ ∀ ∃ · · · ∀Y, X′ · c′ ◮ If not

slide-117
SLIDE 117

24/27

Weak Quantifier Elimination

Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′. Take any closed formula, look at the last quantifier bloc: ◮ Universal, switch it to existential: ∀ ∃ · · · ∀X · c = ⇒ ¬ ∃ ∀ · · · ∃X · ¬c ◮ Existential:

◮ If there is an other bloc before, use the given technique: ∀ ∃ · · · ∀Y · ∃X · c = ⇒ ∀ ∃ · · · ∀Y, X′ · c′ ◮ If not, then it is only a satisfiability question.

slide-118
SLIDE 118

25/27

Weak Quantifier Elimination

Previous slide said: “Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′.”

slide-119
SLIDE 119

25/27

Weak Quantifier Elimination

Previous slide said: “Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′.” Here is what we have:

Lemma

Let c be a clause c = gc ∧ ∃X · lc such that: ◮ . . . ◮ there is no y[f]x with x ∈ X and y / ∈ X. Then c is equivalent to gc.

slide-120
SLIDE 120

25/27

Weak Quantifier Elimination

Previous slide said: “Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′.” Here is what we have:

Lemma

Let c be a clause c = gc ∧ ∃X · lc such that: ◮ . . . ◮ there is no y[f]x with x ∈ X and y / ∈ X. Then c is equivalent to gc.

slide-121
SLIDE 121

25/27

Weak Quantifier Elimination

Previous slide said: “Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′.” Here is what we have:

Lemma

Let c be a clause c = gc ∧ ∃X · lc such that: ◮ . . . ◮ there is no y[f]x with x ∈ X and y / ∈ X. Then c is equivalent to gc. Lukily: ∃X, x · (y[f]x ∧ c)

slide-122
SLIDE 122

25/27

Weak Quantifier Elimination

Previous slide said: “Assume given a technique to transform ∃X · c into an equivalent ∀X′ · c′.” Here is what we have:

Lemma

Let c be a clause c = gc ∧ ∃X · lc such that: ◮ . . . ◮ there is no y[f]x with x ∈ X and y / ∈ X. Then c is equivalent to gc. Lukily: ∃X, x · (y[f]x ∧ c) ⇒ ¬y[f] ↑ ∧∀x · (y[f]x → ∃X · c)

slide-123
SLIDE 123

26/27

Table of Contents

  • 1. Description of filesystems

Unix filesystems Static description Directory update

  • 2. Constraints

Definitions Basic constraints Negation

  • 3. Usages

Decidability of the First-Order Theory Automated Specification for Scripts: Proof of Concept

slide-124
SLIDE 124

27/27

Demo!