• Aucun résultat trouvé

Leveraging the structure of uncertain data

N/A
N/A
Protected

Academic year: 2022

Partager "Leveraging the structure of uncertain data"

Copied!
200
0
0

Texte intégral

(1)

Antoine Amarilli May 16, 2018

1/33

(2)

Example application: Subway routing

2/33

(3)

2/33

(4)

Example application: Subway routing

2/33

(5)

2/33

(6)

Example application: Subway routing

(Metro|RER)*|(Bus|Tram)*

2/33

(7)

13 6

23 14

Database

• (Hyper)graph

• Collection of ground facts

G(aa1, ab2), G(ab2, ac3), S(aa1, m4), S(ab2, rB), ...

3/33

(8)

Database theory and query evaluation

13 6

23 14

Query

?

+

Database

• (Hyper)graph

• Collection of ground facts

G(aa1, ab2), G(ab2, ac3), S(aa1, m4), S(ab2, rB), ...

• Regular path

∀X(rm ∈ X ∧ ∀xy (Metro|RER)*

• Logic formula

(x ∈ X ∧ G(x, y) → y ∈ X)) → gn ∈ X

|(Bus|Tram)*

3/33

(9)

13 6

23 14

Query

?

+

Database

• (Hyper)graph

• Collection of ground facts

G(aa1, ab2), G(ab2, ac3), S(aa1, m4), S(ab2, rB), ...

• Regular path

∀X(rm ∈ X ∧ ∀xy

i Result

• TRUE/FALSE

↔ Model checking (Metro|RER)*

• Logic formula

(x ∈ X ∧ G(x, y) → y ∈ X)) → gn ∈ X

|(Bus|Tram)*

3/33

(10)

Probabilistic query evaluation

13 6

23 14

4/33

(11)

4/33

(12)

Probabilistic query evaluation

4/33

(13)

4/33

(14)

Probabilistic query evaluation

4/33

(15)

4/33

(16)

Probabilistic query evaluation

4/33

(17)

13 6

23 14

4/33

(18)

Probabilistic query evaluation

13 6

23 95% 14

5% 60

98%

2% 60

4/33

(19)

• (Hyper)graph

• Collection of ground facts

Probabilistic database

+ independent probabilities

13 6

23 95%14

5% 60

98%

2% 60

4/33

(20)

Probabilistic query evaluation

Query

?

+

• (Hyper)graph

• Collection of ground facts

• Regular path

∀X(rm ∈ X ∧ ∀xy (Metro|RER)*

• Logic formula

(x ∈ X ∧ G(x, y) → y ∈ X)) → gn ∈ X

|(Bus|Tram)*

Probabilistic database

+ independent probabilities

13 6

23 95%14

5% 60

98%

2% 60

4/33

(21)

Query

?

+

• (Hyper)graph

• Collection of ground facts

• Regular path

∀X(rm ∈ X ∧ ∀xy (Metro|RER)*

• Logic formula

(x ∈ X ∧ G(x, y) → y ∈ X)) → gn ∈ X

|(Bus|Tram)*

Probabilistic database

+ independent probabilities

Probabilistic i

Result

• Probability according to the input distribution

13 6

23 95%14

5% 60

98%

2% 60

proba to be on time: 98%

4/33

(22)

Computational complexity

Computing paths on a large graph:

Well-studied problem, efficient algorithms

#P-hardcomputational complexity in thedatabase

5/33

(23)

Computational complexity

50%

90%

42%

37%

90%

83%

78%

72%

Computing paths on a largeprobabilisticgraph:

???

5/33

(24)

Computational complexity

50%

90%

42%

37%

90%

83%

78%

72%

Computing paths on a largeprobabilisticgraph:

Exponentialnumber of possibilities

#P-hardcomputational complexity in thedatabase

5/33

(25)

50%

90%

42%

37%

90%

83%

78%

72%

Computing paths on a largeprobabilisticgraph:

Exponentialnumber of possibilities

#P-hardcomputational complexity in thedatabase 5/33

(26)

Idea: use the structure of data

→ Shortest path:very easyon alarge tree

6/33

(27)

Idea: use the structure of data

6/33

(28)

Idea: use the structure of data

→ Shortest path:very easyon alarge tree

6/33

(29)

Idea: use the structure of data

6/33

(30)

Idea: use the structure of data

→ Shortest path:very easyon alarge tree

6/33

(31)

Idea: use the structure of data

6/33

(32)

Idea: use the structure of data

→ Shortest path:very easyon alarge tree

6/33

(33)

Leveraging the structure of uncertain data

Does query evaluation on probabilistic data havelower complexity when thestructureof the data isclose to a tree?

Existing results onnon-probabilistic data:

Tree automata, to evaluate queries on trees

Treewidth, formalizes the notion of being “close to a tree”

Courcelle’s theorem

Introducenew toolsandresults:

Provenance circuitsof tree automata on uncertain trees

• Applications toprobabilistic query evaluation

Other applications:Counting, enumeration, provenance...

7/33

(34)

Leveraging the structure of uncertain data

Does query evaluation on probabilistic data havelower complexity when thestructureof the data isclose to a tree?

In this talk:

Existing results onnon-probabilistic data:

Tree automata, to evaluate queries on trees

Treewidth, formalizes the notion of being “close to a tree”

Courcelle’s theorem

Introducenew toolsandresults:

Provenance circuitsof tree automata on uncertain trees

• Applications toprobabilistic query evaluation

Other applications:Counting, enumeration, provenance...

7/33

(35)

Leveraging the structure of uncertain data

Does query evaluation on probabilistic data havelower complexity when thestructureof the data isclose to a tree?

In this talk:

Existing results onnon-probabilistic data:

Tree automata, to evaluate queries on trees

Courcelle’s theorem

Introducenew toolsandresults:

Provenance circuitsof tree automata on uncertain trees

• Applications toprobabilistic query evaluation

Other applications:Counting, enumeration, provenance...

7/33

(36)

Leveraging the structure of uncertain data

Does query evaluation on probabilistic data havelower complexity when thestructureof the data isclose to a tree?

In this talk:

Existing results onnon-probabilistic data:

Tree automata, to evaluate queries on trees

Treewidth, formalizes the notion of being “close to a tree”

Courcelle’s theorem

Introducenew toolsandresults:

Provenance circuitsof tree automata on uncertain trees

• Applications toprobabilistic query evaluation

Other applications:Counting, enumeration, provenance...

7/33

(37)

Leveraging the structure of uncertain data

Does query evaluation on probabilistic data havelower complexity when thestructureof the data isclose to a tree?

In this talk:

Existing results onnon-probabilistic data:

Tree automata, to evaluate queries on trees

Treewidth, formalizes the notion of being “close to a tree”

Courcelle’s theorem

Introducenew toolsandresults:

Provenance circuitsof tree automata on uncertain trees

• Applications toprobabilistic query evaluation

Other applications:Counting, enumeration, provenance...

7/33

(38)

Leveraging the structure of uncertain data

Does query evaluation on probabilistic data havelower complexity when thestructureof the data isclose to a tree?

In this talk:

Existing results onnon-probabilistic data:

Tree automata, to evaluate queries on trees

Treewidth, formalizes the notion of being “close to a tree”

Courcelle’s theorem

Introducenew toolsandresults:

Provenance circuitsof tree automata on uncertain trees

• Applications toprobabilistic query evaluation

Other applications:Counting, enumeration, provenance...

7/33

(39)

Leveraging the structure of uncertain data

Does query evaluation on probabilistic data havelower complexity when thestructureof the data isclose to a tree?

In this talk:

Existing results onnon-probabilistic data:

Tree automata, to evaluate queries on trees

Treewidth, formalizes the notion of being “close to a tree”

Courcelle’s theorem

Introducenew toolsandresults:

Provenance circuitsof tree automata on uncertain trees

Other applications:Counting, enumeration, provenance...

7/33

(40)

Leveraging the structure of uncertain data

Does query evaluation on probabilistic data havelower complexity when thestructureof the data isclose to a tree?

In this talk:

Existing results onnon-probabilistic data:

Tree automata, to evaluate queries on trees

Treewidth, formalizes the notion of being “close to a tree”

Courcelle’s theorem

Introducenew toolsandresults:

Provenance circuitsof tree automata on uncertain trees

• Applications toprobabilistic query evaluation

Other applications:Counting, enumeration, provenance...

7/33

(41)

Does query evaluation on probabilistic data havelower complexity when thestructureof the data isclose to a tree?

In this talk:

Existing results onnon-probabilistic data:

Tree automata, to evaluate queries on trees

Treewidth, formalizes the notion of being “close to a tree”

Courcelle’s theorem

Introducenew toolsandresults:

Provenance circuitsof tree automata on uncertain trees

• Applications toprobabilistic query evaluation

Other applications:Counting, enumeration, provenance...

7/33

(42)

Table of contents

Introduction Existing tools

Provenance circuits and probabilistic query evaluation Other applications

8/33

(43)

Query evaluation on words

Database: awordwwhere nodes have a color from an alphabet

?

inmonadic second-order logic(MSO) and a blue node?”

i

Result: TRUE/FALSE indicating if the wordwsatisfies the queryQ

Computational complexityas a function ofw (the queryQisfixed)

9/33

(44)

Query evaluation on words

Database: awordwwhere nodes have a color from an alphabet

?

QueryQ: asentence(yes/no question) inmonadic second-order logic(MSO)

“Is there both a pink and a blue node?”

i

Result: TRUE/FALSE indicating if the wordwsatisfies the queryQ

Computational complexityas a function ofw (the queryQisfixed)

9/33

(45)

Query evaluation on words

Database: awordwwhere nodes have a color from an alphabet

?

QueryQ: asentence(yes/no question) inmonadic second-order logic(MSO)

“Is there both a pink and a blue node?”

i

Result: TRUE/FALSE indicating if the wordwsatisfies the queryQ

(the queryQisfixed)

9/33

(46)

Query evaluation on words

Database: awordwwhere nodes have a color from an alphabet

?

QueryQ: asentence(yes/no question) inmonadic second-order logic(MSO)

“Is there both a pink and a blue node?”

i

Result: TRUE/FALSE indicating if the wordwsatisfies the queryQ

Computational complexityas a function ofw (the queryQisfixed)

9/33

(47)

Monadic second-order logic (MSO)

P (x)means “xis blue”; alsoP (x),P (x)

xymeans “xis the predecessor ofy”

Propositional logic:formulas withAND∧,OR∨,NOT¬

P (x)P (y)means“Nodexis pink and nodeyis blue”

First-order logic:addsexistential quantifier∃and universal quantifier∀

x y P (x)P (y)means“There is both a pink and a blue node”

Monadic second-order logic (MSO):addsquantifiers over sets

Sx S(x)means“there is a setScontaining every elementx

• Can expresstransitive closurexy, i.e.,xis beforey

x P (x)⇒ ∃y P (y)xy

means“There is a blue node after every pink node”

10/33

(48)

Monadic second-order logic (MSO)

P (x)means “xis blue”; alsoP (x),P (x)

xymeans “xis the predecessor ofy”

Propositional logic:formulas withAND∧,OR∨,NOT¬

P (x)P (y)means“Nodexis pink and nodeyis blue”

First-order logic:addsexistential quantifier∃and universal quantifier∀

x y P (x)P (y)means“There is both a pink and a blue node”

Monadic second-order logic (MSO):addsquantifiers over sets

Sx S(x)means“there is a setScontaining every elementx

• Can expresstransitive closurexy, i.e.,xis beforey

x P (x)⇒ ∃y P (y)xy

means“There is a blue node after every pink node”

10/33

(49)

Monadic second-order logic (MSO)

P (x)means “xis blue”; alsoP (x),P (x)

xymeans “xis the predecessor ofy”

Propositional logic:formulas withAND∧,OR∨,NOT¬

P (x)P (y)means“Nodexis pink and nodeyis blue”

First-order logic:addsexistential quantifier∃and universal quantifier∀

x y P (x)P (y)means“There is both a pink and a blue node”

Monadic second-order logic (MSO):addsquantifiers over sets

Sx S(x)means“there is a setScontaining every elementx

• Can expresstransitive closurexy, i.e.,xis beforey

x P (x)⇒ ∃y P (y)xy

means“There is a blue node after every pink node”

10/33

(50)

Monadic second-order logic (MSO)

P (x)means “xis blue”; alsoP (x),P (x)

xymeans “xis the predecessor ofy”

Propositional logic:formulas withAND∧,OR∨,NOT¬

P (x)P (y)means“Nodexis pink and nodeyis blue”

First-order logic:addsexistential quantifier∃and universal quantifier∀

x y P (x)P (y)means“There is both a pink and a blue node”

Monadic second-order logic (MSO):addsquantifiers over sets

Sx S(x)means“there is a setScontaining every elementx

• Can expresstransitive closurexy, i.e.,xis beforey

x P (x)⇒ ∃y P (y)xy

means“There is a blue node after every pink node”

10/33

(51)

Word automata

Translate the queryQto adeterministic word automaton

Alphabet: w: Q:x y P (x)∧P (y)

States:{⊥,B,P,>}

Final states:{>}

Initial function: ⊥ P B

Transitions(examples): ⊥

P P

>

>

> Theorem (Büchi, 1960)

MSOandword automatahave the sameexpressive poweron words Corollary

Query evaluation of MSO on words is inlinear time.

11/33

(52)

Word automata

Translate the queryQto adeterministic word automaton

Alphabet: w:

P P > >

Q:x y P (x)∧P (y)

States:{⊥,B,P,>}

Final states:{>}

Initial function: ⊥ P B

Transitions(examples): ⊥

P P

>

>

> Theorem (Büchi, 1960)

MSOandword automatahave the sameexpressive poweron words Corollary

Query evaluation of MSO on words is inlinear time.

11/33

(53)

Word automata

Translate the queryQto adeterministic word automaton

Alphabet: w: Q:x y P (x)∧P (y)

States:{⊥,B,P,>}

Final states:{>}

Initial function: ⊥ P B

Transitions(examples): ⊥

P P

>

>

> Theorem (Büchi, 1960)

MSOandword automatahave the sameexpressive poweron words Corollary

Query evaluation of MSO on words is inlinear time.

11/33

(54)

Word automata

Translate the queryQto adeterministic word automaton

Alphabet: w:

P P > >

Q:x y P (x)∧P (y)

States:{⊥,B,P,>}

Final states:{>}

Initial function: ⊥ P B

Transitions(examples): ⊥

P P

>

>

> Theorem (Büchi, 1960)

MSOandword automatahave the sameexpressive poweron words Corollary

Query evaluation of MSO on words is inlinear time.

11/33

(55)

Word automata

Translate the queryQto adeterministic word automaton

Alphabet: w:

Q:x y P (x)∧P (y)

States:{⊥,B,P,>}

Final states:{>}

Initial function: ⊥ P B

Transitions(examples): ⊥

P P

>

>

> Theorem (Büchi, 1960)

MSOandword automatahave the sameexpressive poweron words Corollary

Query evaluation of MSO on words is inlinear time.

11/33

(56)

Word automata

Translate the queryQto adeterministic word automaton

Alphabet: w:

P P > >

Q:x y P (x)∧P (y)

States:{⊥,B,P,>}

Final states:{>}

Initial function: ⊥ P B

Transitions(examples): ⊥

P P

>

>

>

Theorem (Büchi, 1960)

MSOandword automatahave the sameexpressive poweron words Corollary

Query evaluation of MSO on words is inlinear time.

11/33

(57)

Word automata

Translate the queryQto adeterministic word automaton

Alphabet: w:

P Q:x y P (x)∧P (y)

States:{⊥,B,P,>}

Final states:{>}

Initial function: ⊥ P B

Transitions(examples): ⊥

P P

>

>

>

Theorem (Büchi, 1960)

MSOandword automatahave the sameexpressive poweron words Corollary

Query evaluation of MSO on words is inlinear time.

11/33

(58)

Word automata

Translate the queryQto adeterministic word automaton

Alphabet: w:

P P

> >

Q:x y P (x)∧P (y)

States:{⊥,B,P,>}

Final states:{>}

Initial function: ⊥ P B

Transitions(examples): ⊥

P P

>

>

>

Theorem (Büchi, 1960)

MSOandword automatahave the sameexpressive poweron words Corollary

Query evaluation of MSO on words is inlinear time.

11/33

(59)

Word automata

Translate the queryQto adeterministic word automaton

Alphabet: w:

P P > Q:x y P (x)∧P (y)

States:{⊥,B,P,>}

Final states:{>}

Initial function: ⊥ P B

Transitions(examples): ⊥

P P

>

>

>

Theorem (Büchi, 1960)

MSOandword automatahave the sameexpressive poweron words Corollary

Query evaluation of MSO on words is inlinear time.

11/33

(60)

Word automata

Translate the queryQto adeterministic word automaton

Alphabet: w:

P P > > Q:x y P (x)∧P (y)

States:{⊥,B,P,>}

Final states:{>}

Initial function: ⊥ P B

Transitions(examples): ⊥

P P

>

>

>

Theorem (Büchi, 1960)

MSOandword automatahave the sameexpressive poweron words Corollary

Query evaluation of MSO on words is inlinear time.

11/33

(61)

Word automata

Translate the queryQto adeterministic word automaton

Alphabet: w:

P P > > Q:x y P (x)∧P (y)

States:{⊥,B,P,>}

Final states:{>}

Initial function: ⊥ P B

Transitions(examples): ⊥

P P

>

>

>

Theorem (Büchi, 1960)

MSOandword automatahave the sameexpressive poweron words

Query evaluation of MSO on words is inlinear time.

11/33

(62)

Word automata

Translate the queryQto adeterministic word automaton

Alphabet: w:

P P > > Q:x y P (x)∧P (y)

States:{⊥,B,P,>}

Final states:{>}

Initial function: ⊥ P B

Transitions(examples): ⊥

P P

>

>

>

Theorem (Büchi, 1960)

MSOandword automatahave the sameexpressive poweron words Corollary

Query evaluation of MSO on words is inlinear time.

11/33

(63)

Query evaluation on trees

Database: atreeTwhere nodes have a color from an alphabet

?

QueryQ: asentencein monadic

second-order logic (MSO)

P (x)means “xis blue”

xymeans “xis the parent ofy”

“Is there both a pink and a blue node?”

x y P (x)∧P (y)

i

Result: TRUE/FALSE indicating if the treeTsatisfies the queryQ

Computational complexityas a function ofT (the queryQisfixed)

12/33

(64)

Query evaluation on trees

Database: atreeTwhere nodes have a color from an alphabet

?

QueryQ: asentencein monadic

second-order logic (MSO)

P (x)means “xis blue”

xymeans “xis the parent ofy”

“Is there both a pink and a blue node?”

x y P (x)∧P (y)

i

Result: TRUE/FALSE indicating if the treeTsatisfies the queryQ

Computational complexityas a function ofT (the queryQisfixed)

12/33

(65)

Query evaluation on trees

Database: atreeTwhere nodes have a color from an alphabet

?

QueryQ: asentencein monadic

second-order logic (MSO)

P (x)means “xis blue”

xymeans “xis the parent ofy”

“Is there both a pink and a blue node?”

x y P (x)∧P (y)

i

Result: TRUE/FALSE indicating if the treeTsatisfies the queryQ

(the queryQisfixed)

12/33

(66)

Query evaluation on trees

Database: atreeTwhere nodes have a color from an alphabet

?

QueryQ: asentencein monadic

second-order logic (MSO)

P (x)means “xis blue”

xymeans “xis the parent ofy”

“Is there both a pink and a blue node?”

x y P (x)∧P (y)

i

Result: TRUE/FALSE indicating if the treeTsatisfies the queryQ

Computational complexityas a function ofT (the queryQisfixed)

12/33

(67)

Tree automata Tree alphabet:

Bottom-up deterministictree automaton

“Is there both a pink and a blue node?”

States:{⊥,B,P,>}

Final states: {>}

Initial function: ⊥ P B

Transitions(examples): P

P

> B P

Theorem [Thatcher and Wright, 1968]

MSOandtree automatahave the sameexpressive poweron trees Corollary

Query evaluation of MSO on trees is inlinear time.

13/33

(68)

Tree automata

Tree alphabet:

Bottom-up deterministictree automaton

“Is there both a pink and a blue node?”

States:{⊥,B,P,>}

Final states: {>}

Initial function: ⊥ P B

Transitions(examples): P

P

> B P

Theorem [Thatcher and Wright, 1968]

MSOandtree automatahave the sameexpressive poweron trees Corollary

Query evaluation of MSO on trees is inlinear time.

13/33

(69)

Tree automata

Tree alphabet:

Bottom-up deterministictree automaton

“Is there both a pink and a blue node?”

States:{⊥,B,P,>}

Final states: {>}

Initial function: ⊥ P B

Transitions(examples): P

P

> B P

Theorem [Thatcher and Wright, 1968]

MSOandtree automatahave the sameexpressive poweron trees Corollary

Query evaluation of MSO on trees is inlinear time.

13/33

(70)

Tree automata

Tree alphabet:

Bottom-up deterministictree automaton

“Is there both a pink and a blue node?”

States:{⊥,B,P,>}

Final states: {>}

Initial function: ⊥ P B

Transitions(examples): P

P

> B P

Theorem [Thatcher and Wright, 1968]

MSOandtree automatahave the sameexpressive poweron trees Corollary

Query evaluation of MSO on trees is inlinear time.

13/33

(71)

Tree automata

Tree alphabet:

Bottom-up deterministictree automaton

“Is there both a pink and a blue node?”

States:{⊥,B,P,>}

Final states: {>}

Initial function: ⊥ P B

Transitions(examples): P

P

> B P

Theorem [Thatcher and Wright, 1968]

MSOandtree automatahave the sameexpressive poweron trees Corollary

Query evaluation of MSO on trees is inlinear time.

13/33

(72)

Tree automata Tree alphabet:

B

P

Bottom-up deterministictree automaton

“Is there both a pink and a blue node?”

States:{⊥,B,P,>}

Final states: {>}

Initial function: ⊥ P B

Transitions(examples): P

P

> B P

Theorem [Thatcher and Wright, 1968]

MSOandtree automatahave the sameexpressive poweron trees Corollary

Query evaluation of MSO on trees is inlinear time.

13/33

(73)

Tree automata Tree alphabet:

B

P

Bottom-up deterministictree automaton

“Is there both a pink and a blue node?”

States:{⊥,B,P,>}

Final states: {>}

Initial function: ⊥ P B

Transitions(examples):

P P

>

B P

MSOandtree automatahave the sameexpressive poweron trees Corollary

Query evaluation of MSO on trees is inlinear time.

13/33

(74)

Tree automata Tree alphabet:

B

B

P

P

Bottom-up deterministictree automaton

“Is there both a pink and a blue node?”

States:{⊥,B,P,>}

Final states: {>}

Initial function: ⊥ P B

Transitions(examples):

P P

>

B P

Theorem [Thatcher and Wright, 1968]

MSOandtree automatahave the sameexpressive poweron trees Corollary

Query evaluation of MSO on trees is inlinear time.

13/33

(75)

Tree automata Tree alphabet:

>

B

B

P

P

Bottom-up deterministictree automaton

“Is there both a pink and a blue node?”

States:{⊥,B,P,>}

Final states: {>}

Initial function: ⊥ P B

Transitions(examples):

P P

>

B P

MSOandtree automatahave the sameexpressive poweron trees Corollary

Query evaluation of MSO on trees is inlinear time.

13/33

(76)

Tree automata Tree alphabet:

>

B

B

P

P

Bottom-up deterministictree automaton

“Is there both a pink and a blue node?”

States:{⊥,B,P,>}

Final states: {>}

Initial function: ⊥ P B

Transitions(examples):

P P

>

B P

Theorem [Thatcher and Wright, 1968]

MSOandtree automatahave the sameexpressive poweron trees

Corollary

Query evaluation of MSO on trees is inlinear time.

13/33

(77)

Tree alphabet:

>

B

B

P

P

Bottom-up deterministictree automaton

“Is there both a pink and a blue node?”

States:{⊥,B,P,>}

Final states: {>}

Initial function: ⊥ P B

Transitions(examples):

P P

>

B P

Theorem [Thatcher and Wright, 1968]

MSOandtree automatahave the sameexpressive poweron trees Corollary

Query evaluation of MSO on trees is inlinear time. 13/33

(78)

Query evaluation on trees

Database: atreeTwhere nodes have a color from an alphabet

?

QueryQ: asentencein monadic

second-order logic (MSO)

P (x)means “xis blue”

xymeans “xis the parent ofy”

“Is there both a pink and a blue node?”

x y P (x)∧P (y)

i

Result: TRUE/FALSE indicating ifT satisfies the queryQ

Computational complexityas a function of thetreeT (the queryQisfixed)

14/33

(79)

Query evaluation on treelike data

Database: atreelike databaseT

???

?

QueryQ: asentencein monadic second-order logic (MSO)

xymeans “xis the parent ofy”

(Metro|RER)

|(Bus|Tram)

i

Result: TRUE/FALSE indicating ifT satisfies the queryQ

Computational complexityas a function of thetreeT (the queryQisfixed)

14/33

(80)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(81)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(82)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(83)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(84)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(85)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(86)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(87)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(88)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(89)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(90)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(91)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(92)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(93)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(94)

Treewidth

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(95)

Treewidth by example:

Treeshave treewidth1

Cycleshave treewidth2

k-cliquesand(k1)-gridshave treewidthk−1

→ Treelike: thetreewidthis bounded by aconstant

15/33

(96)

Courcelle’s theorem

(RER|metro)*

|(bus|tram)*

MSO query Treelike data

Theorem [Courcelle, 1990]

For any fixed Boolean MSO queryQandk∈N, given a databaseDof treewidthk,

we can compute inlinear timeinDwhetherDsatisfiesQ

16/33

(97)

Courcelle’s theorem

Tree automaton (RER|metro)*

|(bus|tram)*

MSO query Treelike data

For any fixed Boolean MSO queryQandk∈N, given a databaseDof treewidthk,

we can compute inlinear timeinDwhetherDsatisfiesQ

16/33

(98)

Courcelle’s theorem

Tree automaton Tree encoding

(RER|metro)*

|(bus|tram)*

MSO query Treelike data

linear

Theorem [Courcelle, 1990]

For any fixed Boolean MSO queryQandk∈N, given a databaseDof treewidthk,

we can compute inlinear timeinDwhetherDsatisfiesQ

16/33

(99)

Courcelle’s theorem

Tree automaton Tree encoding

(RER|metro)*

|(bus|tram)*

MSO query Treelike data

Query answer

TRUE

linear linear

For any fixed Boolean MSO queryQandk∈N, given a databaseDof treewidthk,

we can compute inlinear timeinDwhetherDsatisfiesQ

16/33

(100)

Courcelle’s theorem

Tree automaton Tree encoding

(RER|metro)*

|(bus|tram)*

MSO query Treelike data

Query answer

TRUE

linear linear

Theorem [Courcelle, 1990]

For any fixed Boolean MSO queryQandk∈N, given a databaseDof treewidthk,

we can compute inlinear timeinDwhetherDsatisfiesQ 16/33

(101)

Introduction Existing tools

Provenance circuits and probabilistic query evaluation Other applications

17/33

(102)

Probabilistic query evaluation on treelike data

DatabaseDwithtreewidthk

for some constantk

Probabilityof each fact ofD to be actually present in the data (independently from other facts)

?

QueryQ: asentencein monadic

second-order logic (MSO)

(Metro|RER)

|(Bus|Tram)

i

Result:Probabilitythat the databaseDsatisfies queryQ

Computational complexityas a function of thedatabaseD (the queryQisfixed)

18/33

(103)

Probabilistic query evaluation on treelike data

DatabaseDwithtreewidthk

for some constantk

Probabilityof each fact ofD to be actually present in the data (independently from other facts)

?

QueryQ: asentencein monadic

second-order logic (MSO)

(Metro|RER)

|(Bus|Tram)

i

Result:Probabilitythat the databaseDsatisfies queryQ

Computational complexityas a function of thedatabaseD (the queryQisfixed)

18/33

(104)

Probabilistic query evaluation on treelike data

DatabaseDwithtreewidthk

for some constantk

Probabilityof each fact ofD to be actually present in the data (independently from other facts)

?

QueryQ: asentencein monadic

second-order logic (MSO)

(Metro|RER)

|(Bus|Tram)

i

Result: Probabilitythat the databaseDsatisfies queryQ

Computational complexityas a function of thedatabaseD (the queryQisfixed)

18/33

(105)

DatabaseDwithtreewidthk

for some constantk

Probabilityof each fact ofD to be actually present in the data (independently from other facts)

?

QueryQ: asentencein monadic

second-order logic (MSO)

(Metro|RER)

|(Bus|Tram)

i

Result: Probabilitythat the databaseDsatisfies queryQ

Computational complexityas a function of thedatabaseD (the queryQisfixed)

18/33

(106)

Roadmap

Tree automaton Tree encoding

(RER|metro)*

|(bus|tram)*

MSO query Treelike data

linear

19/33

(107)

Tree automaton Tree encoding

(RER|metro)*

|(bus|tram)*

MSO query Treelike data

linear linear

Provenance circuit

19/33

(108)

Roadmap

Tree automaton Uncertain tree encoding

(RER|metro)*

|(bus|tram)*

MSO query Probabilistic treelike data

linear linear

Provenance circuit

Probability

95%

linear

+probabilities

19/33

(109)

Uncertain trees

1

5

6 7 2

3 4

keep(1) ordiscard(0) node labels Valuation: {2,3,77→1, ∗ 7→0}

A:“Is there both a pink and a blue node?”

20/33

(110)

Uncertain trees

1

5

6 7 2

3 4

Avaluationof a tree decides whether to keep(1) ordiscard(0) node labels

Valuation: {2,3,77→1, ∗ 7→0}

A:“Is there both a pink and a blue node?”

20/33

(111)

Uncertain trees

1

5

6 7 2

3 4

Avaluationof a tree decides whether to keep(1) ordiscard(0) node labels Valuation: {2,3,77→1, ∗ 7→0}

20/33

(112)

Uncertain trees

1

5

6 7 2

3 4

Avaluationof a tree decides whether to keep(1) ordiscard(0) node labels Valuation: {27→1, ∗ 7→0}

A:“Is there both a pink and a blue node?”

20/33

(113)

Uncertain trees

1

5

6 7 2

3 4

Avaluationof a tree decides whether to keep(1) ordiscard(0) node labels Valuation: {2,77→1, ∗ 7→0}

20/33

(114)

Uncertain trees

1

5

6 7 2

3 4

Avaluationof a tree decides whether to keep(1) ordiscard(0) node labels Valuation: {2,77→1, ∗ 7→0}

A:“Is there both a pink and a blue node?”

20/33

(115)

1

5

6 7 2

3 4

Avaluationof a tree decides whether to keep(1) ordiscard(0) node labels Valuation: {2,3,77→1, ∗ 7→0}

A:“Is there both a pink and a blue node?”

The tree automatonAaccepts

20/33

(116)

Uncertain trees

1

5

6 7 2

3 4

Avaluationof a tree decides whether to keep(1) ordiscard(0) node labels Valuation: {27→1, ∗ 7→0}

A:“Is there both a pink and a blue node?”

The tree automatonArejects

20/33

(117)

1

5

6 7 2

3 4

Avaluationof a tree decides whether to keep(1) ordiscard(0) node labels Valuation: {2,77→1, ∗ 7→0}

A:“Is there both a pink and a blue node?”

The tree automatonAaccepts

20/33

(118)

Boolean circuit

¬

x

y

Directed acyclic graph ofgates

Outputgate:

Variablegates: x

Internalgates: ¬

Valuation: function from variables to{0,1} Example:ν ={x7→0, y7→1}... mapped to1

21/33

(119)

Boolean circuit

¬

x

y

Directed acyclic graph ofgates

Outputgate:

Variablegates: x

Internalgates: ¬

Valuation: function from variables to{0,1} Example:ν ={x7→0, y7→1}... mapped to1

21/33

(120)

Boolean circuit

¬

x

y

Directed acyclic graph ofgates

Outputgate:

Variablegates: x

Internalgates: ¬

Valuation: function from variables to{0,1} Example:ν ={x7→0, y7→1}... mapped to1

21/33

Références

Documents relatifs

L'ambition de cette première partie de notre étude consiste à mettre en relief le panorama le plus large mais aussi le plus fouillé du centre ville de Jijel et

For discrete probabilistic KBs (T , A), we can define a counting problem cor- responding to probabilistic query entailment that is solved by counting possible worlds in the

Relational databases manage data, represented here as a labeled graph WorksAtA. Antoine Télécom Paris Antoine

• PQE(Q) is #P-hard for any Q closed under homomorphisms unless it is equivalent to a safe UCQ. • PQE(Q) is #P-hard for any self-join-free

Does query evaluation on probabilistic data have lower complexity when the structure of the data is close to a tree.. • Existing tools for

Does query evaluation on probabilistic data have lower complexity when the structure of the data is close to a tree?. In

→ Lower bound: Tractable complexity in TID data and query seems unlikely, even for tree-shaped queries and data. → Can we compute lineages more efficiently in

Some results can be transferred between probabilistic relational databases and probabilistic XML [Amarilli and Senellart,