• Aucun résultat trouvé

July10th,2015 AntoineAmarilli ,PierreBourhis ,PierreSenellart ProvenanceCircuitsforTreesandTreelikeInstances

N/A
N/A
Protected

Academic year: 2022

Partager "July10th,2015 AntoineAmarilli ,PierreBourhis ,PierreSenellart ProvenanceCircuitsforTreesandTreelikeInstances"

Copied!
129
0
0

Texte intégral

(1)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance Circuits for Trees and Treelike Instances

Antoine Amarilli1, Pierre Bourhis2, Pierre Senellart1,3

1Télécom ParisTech

2CNRS-LIFL

3National University of Singapore

July 10th, 2015

(2)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

General idea

We consider a query and arelational instance

Often it is notsufficient to merelyevaluate the query:

We needquantitative information

We need the link from theoutputto theinput data

Computequery provenance!

(3)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

General idea

We consider a query and arelational instance

Often it is notsufficient to merelyevaluate the query:

We needquantitative information

We need the link from theoutputto theinput data

Computequery provenance!

(4)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 1: security for a conjunctive query

Consider theconjunctive query: ∃xyz R(x,y)∧R(y,z) Consider therelational instance below:

R a b b c d e e d f f

Result: true

Add security annotations: Public, Confidential, Secret, Top secret, Never available

What is the minimal security clearancerequired?

Result: Confidential

(5)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 1: security for a conjunctive query

Consider theconjunctive query: ∃xyz R(x,y)∧R(y,z) Consider therelational instance below:

R a b b c d e e d f f

Result: true

Add security annotations: Public, Confidential, Secret, Top secret, Never available

What is the minimal security clearancerequired?

Result: Confidential

(6)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 1: security for a conjunctive query

Consider theconjunctive query: ∃xyz R(x,y)∧R(y,z) Consider therelational instance below:

R a b Public b c Secret d e Confidential e d Confidential f f Top secret

Result: true

Add security annotations: Public, Confidential, Secret, Top secret, Never available

What is the minimal security clearancerequired?

Result: Confidential

(7)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 1: security for a conjunctive query

Consider theconjunctive query: ∃xyz R(x,y)∧R(y,z) Consider therelational instance below:

R a b Public b c Secret d e Confidential e d Confidential f f Top secret

Result: true

Add security annotations: Public, Confidential, Secret, Top secret, Never available

What is the minimal security clearancerequired?

Result: Confidential

(8)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 1: security for a conjunctive query

Consider theconjunctive query: ∃xyz R(x,y)∧R(y,z) Consider therelational instance below:

R a b Public b c Secret d e Confidential e d Confidential f f Top secret

Result: true

Add security annotations: Public, Confidential, Secret, Top secret, Never available

What is the minimal security clearancerequired?

Result: Confidential

(9)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 1: security for a conjunctive query

Consider theconjunctive query: ∃xyz R(x,y)∧R(y,z) Consider therelational instance below:

R a b Public b c Secret d e Confidential e d Confidential f f Top secret

Result: true

Add security annotations: Public, Confidential, Secret, Top secret, Never available

What is the minimal security clearancerequired?

Result: Confidential

(10)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 1: security for a conjunctive query

Consider theconjunctive query: ∃xyz R(x,y)∧R(y,z) Consider therelational instance below:

R a b Public b c Secret d e Confidential e d Confidential f f Top secret Result: true

Add security annotations: Public, Confidential, Secret, Top secret, Never available

What is the minimal security clearancerequired?

Result: Confidential

(11)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 1: security for a conjunctive query

Consider theconjunctive query: ∃xyz R(x,y)∧R(y,z) Consider therelational instance below:

R a b Public b c Secret d e Confidential e d Confidential f f Top secret

Result: true

Add security annotations: Public, Confidential, Secret, Top secret, Never available

What is the minimal security clearancerequired?

Result: Confidential

(12)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 2: bag queries

Consider again: ∃xyz R(x,y)∧R(y,z).

R

a b

b c

d e

e d

f f

Result: true

Add multiplicity annotations How many query matches?

Result: 1 + 1 + 1 + 1 = 4

(13)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 2: bag queries

Consider again: ∃xyz R(x,y)∧R(y,z).

R

a b

b c

d e

e d

f f

Result: true

Add multiplicity annotations How many query matches?

Result: 1 + 1 + 1 + 1 = 4

(14)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 2: bag queries

Consider again: ∃xyz R(x,y)∧R(y,z).

R

a b 1

b c 1

d e 1

e d 1

f f 1

Result: true

Add multiplicity annotations

How many query matches?

Result: 1 + 1 + 1 + 1 = 4

(15)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 2: bag queries

Consider again: ∃xyz R(x,y)∧R(y,z).

R

a b 1

b c 1

d e 1

e d 1

f f 1

Result: true

Add multiplicity annotations How manyquery matches?

Result: 1 + 1 + 1 + 1 = 4

(16)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 2: bag queries

Consider again: ∃xyz R(x,y)∧R(y,z).

R

a b 1

b c 1

d e 1

e d 1

f f 1

Result: true

Add multiplicity annotations How manyquery matches?

Result: 1

+ 1 + 1 + 1 = 4

(17)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 2: bag queries

Consider again: ∃xyz R(x,y)∧R(y,z).

R

a b 1

b c 1

d e 1

e d 1

f f 1

Result: true

Add multiplicity annotations How manyquery matches?

Result: 1 +1

+ 1 + 1 = 4

(18)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 2: bag queries

Consider again: ∃xyz R(x,y)∧R(y,z).

R

a b 1

b c 1

d e 1

e d 1

f f 1

Result: true

Add multiplicity annotations How manyquery matches?

Result: 1 + 1 +1

+ 1 = 4

(19)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 2: bag queries

Consider again: ∃xyz R(x,y)∧R(y,z).

R

a b 1

b c 1

d e 1

e d 1

f f 1

Result: true

Add multiplicity annotations How manyquery matches?

Result: 1 + 1 + 1 +1

= 4

(20)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 2: bag queries

Consider again: ∃xyz R(x,y)∧R(y,z).

R

a b 1

b c 1

d e 1

e d 1

f f 1

Result: true

Add multiplicity annotations How manyquery matches?

Result: 1 + 1 + 1 + 1 = 4

(21)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 3: uncertain facts

Consider again: ∃xyz R(x,y)∧R(y,z).

R

a b

b c

d e

e d

f f

Result: true

Assume facts areuncertain, give thematomic annotations For which subinstancesdoes the query hold?

Result: (f1∧f2)(f3∧f4)∨f5

(22)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 3: uncertain facts

Consider again: ∃xyz R(x,y)∧R(y,z).

R

a b

b c

d e

e d

f f

Result: true

Assume facts areuncertain, give thematomic annotations For which subinstancesdoes the query hold?

Result: (f1∧f2)(f3∧f4)∨f5

(23)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 3: uncertain facts

Consider again: ∃xyz R(x,y)∧R(y,z).

R a b f1 b c f2 d e f3 e d f4 f f f5

Result: true

Assume facts areuncertain, give thematomic annotations

For which subinstancesdoes the query hold?

Result: (f1∧f2)(f3∧f4)∨f5

(24)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 3: uncertain facts

Consider again: ∃xyz R(x,y)∧R(y,z).

R a b f1 b c f2 d e f3 e d f4 f f f5

Result: true

Assume facts areuncertain, give thematomic annotations For which subinstancesdoes the query hold?

Result: (f1∧f2)(f3∧f4)∨f5

(25)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 3: uncertain facts

Consider again: ∃xyz R(x,y)∧R(y,z).

R

a b f1

b c f2

d e f3 e d f4 f f f5

Result: true

Assume facts areuncertain, give thematomic annotations For which subinstancesdoes the query hold?

Result: (f1∧f2)

(f3∧f4)∨f5

(26)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 3: uncertain facts

Consider again: ∃xyz R(x,y)∧R(y,z).

R a b f1 b c f2

d e f3

e d f4

f f f5

Result: true

Assume facts areuncertain, give thematomic annotations For which subinstancesdoes the query hold?

Result: (f1∧f2)(f3∧f4)

∨f5

(27)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 3: uncertain facts

Consider again: ∃xyz R(x,y)∧R(y,z).

R a b f1 b c f2

d e f3

e d f4

f f f5

Result: true

Assume facts areuncertain, give thematomic annotations For which subinstancesdoes the query hold?

Result: (f1∧f2)(f3∧f4)

∨f5

(28)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 3: uncertain facts

Consider again: ∃xyz R(x,y)∧R(y,z).

R a b f1 b c f2 d e f3 e d f4

f f f5

Result: true

Assume facts areuncertain, give thematomic annotations For which subinstancesdoes the query hold?

Result: (f1∧f2)(f3∧f4)∨f5

(29)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 3: uncertain facts

Consider again: ∃xyz R(x,y)∧R(y,z).

R a b f1 b c f2 d e f3 e d f4 f f f5

Result: true

Assume facts areuncertain, give thematomic annotations For which subinstancesdoes the query hold?

Result: (f1∧f2)(f3∧f4)∨f5

(30)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 4: the universal semiring N [X]

Consider again: ∃xyz R(x,y)∧R(y,z).

Annotate input factswith atomic annotationsX=f1, . . . ,fn Most general semiring: N[X]of polynomials onX

R a b f1 b c f2 d e f3 e d f4 f f f5

Result: (f1⊗f2)(f3⊗f4)(f4⊗f3)(f5⊗f5)

(31)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 4: the universal semiring N [X]

Consider again: ∃xyz R(x,y)∧R(y,z).

Annotate input factswith atomic annotationsX=f1, . . . ,fn Most general semiring: N[X]of polynomials onX

R a b f1 b c f2 d e f3 e d f4 f f f5

Result:

(f1⊗f2)(f3⊗f4)(f4⊗f3)(f5⊗f5)

(32)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 4: the universal semiring N [X]

Consider again: ∃xyzR(x,y)∧R(y,z).

Annotate input factswith atomic annotationsX=f1, . . . ,fn Most general semiring: N[X]of polynomials onX

R

a b f1

b c f2 d e f3 e d f4 f f f5

Result:

(f1⊗f2)(f3⊗f4)(f4⊗f3)(f5⊗f5)

(33)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 4: the universal semiring N [X]

Consider again: ∃xyzR(x,y)∧R(y,z).

Annotate input factswith atomic annotationsX=f1, . . . ,fn Most general semiring: N[X]of polynomials onX

R

a b f1

b c f2 d e f3 e d f4 f f f5

Result: (f1⊗f2)

(f3⊗f4)(f4⊗f3)(f5⊗f5)

(34)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 4: the universal semiring N [X]

Consider again: ∃xyzR(x,y)∧R(y,z).

Annotate input factswith atomic annotationsX=f1, . . . ,fn Most general semiring: N[X]of polynomials onX

R a b f1 b c f2

d e f3

e d f4 f f f5

Result: (f1⊗f2)

(f3⊗f4)(f4⊗f3)(f5⊗f5)

(35)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 4: the universal semiring N [X]

Consider again: ∃xyzR(x,y)∧R(y,z).

Annotate input factswith atomic annotationsX=f1, . . . ,fn Most general semiring: N[X]of polynomials onX

R a b f1 b c f2

d e f3

e d f4 f f f5

Result: (f1⊗f2)(f3⊗f4)

(f4⊗f3)(f5⊗f5)

(36)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 4: the universal semiring N [X]

Consider again: ∃xyzR(x,y)∧R(y,z).

Annotate input factswith atomic annotationsX=f1, . . . ,fn Most general semiring: N[X]of polynomials onX

R a b f1 b c f2 d e f3

e d f4

f f f5

Result: (f1⊗f2)(f3⊗f4)

(f4⊗f3)(f5⊗f5)

(37)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 4: the universal semiring N [X]

Consider again: ∃xyzR(x,y)∧R(y,z).

Annotate input factswith atomic annotationsX=f1, . . . ,fn Most general semiring: N[X]of polynomials onX

R a b f1 b c f2 d e f3

e d f4

f f f5

Result: (f1⊗f2)(f3⊗f4)(f4⊗f3)

(f5⊗f5)

(38)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 4: the universal semiring N [X]

Consider again: ∃xyzR(x,y)∧R(y,z).

Annotate input factswith atomic annotationsX=f1, . . . ,fn Most general semiring: N[X]of polynomials onX

R a b f1 b c f2 d e f3 e d f4

f f f5

Result: (f1⊗f2)(f3⊗f4)(f4⊗f3)

(f5⊗f5)

(39)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 4: the universal semiring N [X]

Consider again: ∃xyzR(x,y)∧R(y,z).

Annotate input factswith atomic annotationsX=f1, . . . ,fn Most general semiring: N[X]of polynomials onX

R a b f1 b c f2 d e f3 e d f4

f f f5

Result: (f1⊗f2)(f3⊗f4)(f4⊗f3)(f5⊗f5)

(40)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example 4: the universal semiring N [X]

Consider again: ∃xyz R(x,y)∧R(y,z).

Annotate input factswith atomic annotationsX=f1, . . . ,fn Most general semiring: N[X]of polynomials onX

R a b f1 b c f2 d e f3 e d f4 f f f5

Result: (f1⊗f2)(f3⊗f4)(f4⊗f3)(f5⊗f5)

(41)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Specialization and homomorphisms

These examples are captured by commutative semirings:

securitysemiring(K,min,max,Public,Never available) bagsemiring(N,+,×,0,1)

Booleansemiring(PosBool[X],,,f,t) universalsemiring(N[X],+,×,0,1)

N[X]is theuniversal semiring:

The provenance forN[X] can bespecializedto anyK[X] Bycommutation with homomorphisms, atomic annotations inXcan be replaced by their value in K

Computing N[X]provenancesubsumes all tasks

It can be done inPTIME data complexity for CQs

(42)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Specialization and homomorphisms

These examples are captured by commutative semirings:

securitysemiring(K,min,max,Public,Never available) bagsemiring(N,+,×,0,1)

Booleansemiring(PosBool[X],,,f,t) universalsemiring(N[X],+,×,0,1) N[X]is theuniversal semiring:

The provenance forN[X] can bespecializedto anyK[X]

Bycommutation with homomorphisms, atomic annotations inXcan be replaced by their value in K

Computing N[X]provenancesubsumes all tasks

It can be done inPTIME data complexity for CQs

(43)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Specialization and homomorphisms

These examples are captured by commutative semirings:

securitysemiring(K,min,max,Public,Never available) bagsemiring(N,+,×,0,1)

Booleansemiring(PosBool[X],,,f,t) universalsemiring(N[X],+,×,0,1) N[X]is theuniversal semiring:

The provenance forN[X] can bespecializedto anyK[X]

Bycommutation with homomorphisms, atomic annotations inXcan be replaced by their value in K

Computing N[X]provenancesubsumes all tasks

It can be done inPTIME data complexity for CQs

(44)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance and probability

Probabilistic query evaluation:

FixedCQq, and inputTID instance:

R a b 0.6 b c 0.9

Computing theprobabilityof thePosBool[X]-provenance

#P-hard in data complexity

(45)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance and probability

Probabilistic query evaluation:

FixedCQq, and inputTID instance:

R a b 0.6 b c 0.9

Computing theprobabilityof thePosBool[X]-provenance

#P-hard in data complexity

(46)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance and probability

Probabilistic query evaluation:

FixedCQq, and inputTID instance:

R a b 0.6 b c 0.9

Computing theprobabilityof thePosBool[X]-provenance

#P-hard in data complexity

(47)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Trees and treelike instances

Idea: restrict the instances to trees andtreelike instances Tree decompositionof an instance: cover all facts

Treewidth: minimal width (bag size) of a decomposition Treeshave treewidth1

Cycleshave treewidth2

k-cliquesandk-gridshave treewidthk1 Treelike: thetreewidthis bounded by aconstant

(48)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Trees and treelike instances

Idea: restrict the instances to trees andtreelike instances Tree decompositionof an instance: cover all facts Treewidth: minimal width (bag size) of a decomposition

Treeshave treewidth1 Cycleshave treewidth2

k-cliquesandk-gridshave treewidthk1 Treelike: thetreewidthis bounded by aconstant

(49)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Trees and treelike instances

Idea: restrict the instances to trees andtreelike instances Tree decompositionof an instance: cover all facts Treewidth: minimal width (bag size) of a decomposition

Treeshave treewidth1 Cycleshave treewidth2

k-cliquesandk-gridshave treewidthk1

Treelike: thetreewidthis bounded by aconstant

(50)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Trees and treelike instances

Idea: restrict the instances to trees andtreelike instances Tree decompositionof an instance: cover all facts Treewidth: minimal width (bag size) of a decomposition

Treeshave treewidth1 Cycleshave treewidth2

k-cliquesandk-gridshave treewidthk1 Treelike: thetreewidth is bounded by aconstant

(51)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Problem statement

Many tasks have tractable data complexity ontreelike instances:

MSO query evaluationislinear[Courcelle, 1990]

MSO result countingislinear [Arnborg et al., 1991]

Probability evaluationislinearfortrees[Cohen et al., 2009]

(MSOcovers relational algebra, UCQs, monadic Datalog...)

Can we define provenance in this setting?

Can we computeit efficiently?

Can we generalizethe above results?

(52)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Problem statement

Many tasks have tractable data complexity ontreelike instances:

MSO query evaluationislinear[Courcelle, 1990]

MSO result countingislinear [Arnborg et al., 1991]

Probability evaluationislinearfortrees[Cohen et al., 2009]

(MSOcovers relational algebra, UCQs, monadic Datalog...)

Can we define provenance in this setting?

Can we computeit efficiently?

Can we generalizethe above results?

(53)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Problem statement

Many tasks have tractable data complexity ontreelike instances:

MSO query evaluationislinear[Courcelle, 1990]

MSO result countingislinear [Arnborg et al., 1991]

Probability evaluationislinearfortrees[Cohen et al., 2009]

(MSOcovers relational algebra, UCQs, monadic Datalog...)

Can we define provenance in this setting?

Can we computeit efficiently?

Can we generalizethe above results?

(54)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Problem statement

Many tasks have tractable data complexity ontreelike instances:

MSO query evaluationislinear[Courcelle, 1990]

MSO result countingislinear [Arnborg et al., 1991]

Probability evaluationislinearfortrees[Cohen et al., 2009]

(MSOcovers relational algebra, UCQs, monadic Datalog...)

Can we define provenance in this setting?

Can we computeit efficiently?

Can we generalizethe above results?

(55)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Table of contents

1 Introduction

2 Bool[X]-provenance

3 N[X]-provenance

4 Conclusion

(56)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

General idea

Bool[X]-provenance on treesand treelike instances The world of trees:

Query: MSO on trees The world of treelike instances:

Query: MSO on the instance

Reduces to trees[Courcelle, 1990]

Start with Bool[X]-provenance for queries ontrees

(57)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

General idea

Bool[X]-provenance on treesand treelike instances The world of trees:

Query: MSO on trees The world of treelike instances:

Query: MSO on the instance

Reduces to trees[Courcelle, 1990]

Start with Bool[X]-provenance for queries ontrees

(58)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Uncertain trees

1

5

7 6

2

4 3

A valuationof a tree decides whether to keepor discard node labels.

Example query:

“Is there both a red and a green node?”

Valuation: {1,2,3,4,5,6,7} The query is true

(59)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Uncertain trees

1

5

7 6

2

4 3

A valuationof a tree decides whether to keepor discard node labels.

Example query:

“Is there both a red and a green node?”

Valuation: {1,2,5,6} The query is false

(60)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Uncertain trees

1

5

7 6

2

4 3

A valuationof a tree decides whether to keepor discard node labels.

Example query:

“Is there both a red and a green node?”

Valuation: {2,7} The query is true

(61)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance formulae and circuits

1

5

7 6

2

4 3

Whichvaluations satisfy the query?

Provenance formula of a query q on an uncertain treeT:

Boolean formulaϕ onvariablesx1. . .x7

ν(T)satisfiesqiffν(ϕ)istrue Provenance circuit ofq onT [Deutch et al., 2014]

Boolean circuitC withinput gatesg1. . .g7

ν(T)satisfiesqiffν(C)is true

(62)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance formulae and circuits

1

5

7 6

2

4 3

Whichvaluations satisfy the query?

Provenance formula of a query q on an uncertain treeT:

Boolean formulaϕ onvariablesx1. . .x7

ν(T)satisfiesqiffν(ϕ)istrue

Provenance circuit ofq onT [Deutch et al., 2014]

Boolean circuitC withinput gatesg1. . .g7

ν(T)satisfiesqiffν(C)is true

(63)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance formulae and circuits

1

5

7 6

2

4 3

Whichvaluations satisfy the query?

Provenance formula of a query q on an uncertain treeT:

Boolean formulaϕ onvariablesx1. . .x7

ν(T)satisfiesqiffν(ϕ)istrue Provenance circuit ofq onT [Deutch et al., 2014]

Boolean circuitC withinput gatesg1. . .g7

ν(T)satisfiesqiffν(C)is true

(64)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example

1

5

7 6

2

4 3

Is there both a red and agreennode?

Provenance formula: (x2∨x3)∧x7 Provenance circuit:

g7

g2 g3

(65)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example

1

5

7 6

2

4 3

Is there both a red and agreennode?

Provenance formula: (x2∨x3)∧x7

Provenance circuit:

g7

g2 g3

(66)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Example

1

5

7 6

2

4 3

Is there both a red and agreennode?

Provenance formula: (x2∨x3)∧x7 Provenance circuit:

g7

g2 g3

(67)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Our main result on trees

Theorem

For any fixedMSO query q (first order + quantify on sets), for any inputtree T,

we can build aBool[X]provenance circuitof q on T inlinear time in T.

Key ideas:

Compile q to a tree automaton[Thatcher and Wright, 1968] Write thepossible transitions of the automaton onT

Corollary

If tree nodes have a probabilityof being independently kept, we can compute thequery probability in linear time.

(68)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Our main result on trees

Theorem

For any fixedMSO query q (first order + quantify on sets), for any inputtree T,

we can build aBool[X]provenance circuitof q on T inlinear time in T.

Key ideas:

Compile q to a tree automaton[Thatcher and Wright, 1968]

Write thepossible transitions of the automaton onT

Corollary

If tree nodes have a probabilityof being independently kept, we can compute thequery probability in linear time.

(69)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Our main result on trees

Theorem

For any fixedMSO query q (first order + quantify on sets), for any inputtree T,

we can build aBool[X]provenance circuitof q on T inlinear time in T.

Key ideas:

Compile q to a tree automaton[Thatcher and Wright, 1968]

Write thepossible transitions of the automaton onT Corollary

If tree nodes have aprobability of being independently kept, we can compute thequery probability in linear time.

(70)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Treelike instances

Tree encodings: represent treelike instances as trees

MSO queryon an instanceMSO query on the tree encoding

Uncertain instance: each fact can be present or absent

Possible subinstancesare possible valuationsof the encoding R

a b b c b d

R(a1,a2)

R(a2,a3) R(a2,a3)

(71)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Treelike instances

Tree encodings: represent treelike instances as trees

MSO queryon an instanceMSO query on the tree encoding Uncertain instance: each fact can be present or absent

Possible subinstancesare possible valuationsof the encoding R

a b b c b d

R(a1,a2)

R(a2,a3) R(a2,a3)

(72)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Treelike instances

Tree encodings: represent treelike instances as trees

MSO queryon an instanceMSO query on the tree encoding Uncertain instance: each fact can be present or absent

Possible subinstancesare possible valuationsof the encoding R

a b b c b d

R(a1,a2)

R(a2,a3) R(a2,a3)

(73)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Treelike instances

Tree encodings: represent treelike instances as trees

MSO queryon an instanceMSO query on the tree encoding Uncertain instance: each fact can be present or absent

Possible subinstancesare possible valuationsof the encoding R

a b b c b d

R(a1,a2)

R(a2,a3) R(a2,a3)

(74)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Treelike instances

Tree encodings: represent treelike instances as trees

MSO queryon an instanceMSO query on the tree encoding Uncertain instance: each fact can be present or absent

Possible subinstancesare possible valuationsof the encoding R

a b b c b d

R(a1,a2)

R(a2,a3) R(a2,a3)

(75)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Our result and consequences

Theorem

For any fixedMSO query q and k∈N, for any inputinstance I of treewidth≤k,

we can build inlinear time aBool[X]provenance circuit of q on I.

Corollary

MSO queries havelineardata complexity on treelike TID instances.

Corollary

MSO counting haslinear timecomplexity (already known).

(76)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Our result and consequences

Theorem

For any fixedMSO query q and k∈N, for any inputinstance I of treewidth≤k,

we can build inlinear time aBool[X]provenance circuit of q on I.

Corollary

MSO queries havelineardata complexity on treelike TID instances.

Corollary

MSO counting haslinear timecomplexity (already known).

(77)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Our result and consequences

Theorem

For any fixedMSO query q and k∈N, for any inputinstance I of treewidth≤k,

we can build inlinear time aBool[X]provenance circuit of q on I.

Corollary

MSO queries havelineardata complexity on treelike TID instances.

Corollary

MSO counting haslinear timecomplexity (already known).

(78)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Table of contents

1 Introduction

2 Bool[X]-provenance

3 N[X]-provenance

4 Conclusion

(79)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

First problem: non-monotone queries

We want to movefrom Bool[X]toN[X]

Semirings and negationdon’t mix [Amsterdamer et al., 2011]

Our previous construction builds circuits with NOT-gates

q monotoneif I|=q impliesI |=q for all I ⊇I

Provenance circuits for monotone queries can bemonotone

(80)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

First problem: non-monotone queries

We want to movefrom Bool[X]toN[X]

Semirings and negationdon’t mix [Amsterdamer et al., 2011]

Our previous construction builds circuits with NOT-gates

q monotoneif I|=q impliesI |=q for all I ⊇I

Provenance circuits for monotone queries can bemonotone

(81)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

First problem: non-monotone queries

We want to movefrom Bool[X]toN[X]

Semirings and negationdon’t mix [Amsterdamer et al., 2011]

Our previous construction builds circuits with NOT-gates

q monotoneif I|=q impliesI |=q for all I ⊇I

Provenance circuits for monotone queries can bemonotone

(82)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Second problem: intrinsic definition

Boolean provenance has an intrinsic definition:

“Characterize which subinstances satisfy the query”

Independent from how the query iswritten

Independent from itsencodingon trees N[X]-provenance was definedoperationally

Depends on how the query iswritten

We restrict to (Boolean) UCQs from now on

(83)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Second problem: intrinsic definition

Boolean provenance has an intrinsic definition:

“Characterize which subinstances satisfy the query”

Independent from how the query iswritten

Independent from itsencodingon trees N[X]-provenance was definedoperationally

Depends on how the query iswritten

We restrict to (Boolean) UCQs from now on

(84)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance of a Boolean CQ

R a a x1 b c x2 c b x3

Query: q:∃xy R(x,y)∧R(y,x)

Provenance:

(x1⊗x1)(x2⊗x3)(x3⊗x2) akax21+ 2x2x3

Definition:

Sumover query matches Multiplyover matched facts How isN[X]more expressive thanPosBool[X]?

Coefficients: counting multiple derivations

Exponents: using facts multiple times

(85)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance of a Boolean CQ

R a a x1 b c x2 c b x3

Query: q:∃xyR(x,y)∧R(y,x) Provenance:

(x1⊗x1)(x2⊗x3)(x3⊗x2) akax21+ 2x2x3

Definition:

Sumover query matches Multiplyover matched facts How isN[X]more expressive thanPosBool[X]?

Coefficients: counting multiple derivations

Exponents: using facts multiple times

(86)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance of a Boolean CQ

R a a x1 b c x2 c b x3

Query: q:∃xyR(x,y)∧R(y,x) Provenance:

(x1⊗x1)

(x2⊗x3)(x3⊗x2) akax21+ 2x2x3

Definition:

Sumover query matches Multiplyover matched facts How isN[X]more expressive thanPosBool[X]?

Coefficients: counting multiple derivations

Exponents: using facts multiple times

(87)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance of a Boolean CQ

R a a x1 b c x2 c b x3

Query: q:∃xyR(x,y)∧R(y,x) Provenance:

(x1⊗x1)

(x2⊗x3)(x3⊗x2) akax21+ 2x2x3

Definition:

Sumover query matches Multiplyover matched facts How isN[X]more expressive thanPosBool[X]?

Coefficients: counting multiple derivations

Exponents: using facts multiple times

(88)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance of a Boolean CQ

R a a x1 b c x2 c b x3

Query: q:∃xyR(x,y)∧R(y,x) Provenance:

(x1⊗x1)(x2⊗x3)

(x3⊗x2) akax21+ 2x2x3

Definition:

Sumover query matches Multiplyover matched facts How isN[X]more expressive thanPosBool[X]?

Coefficients: counting multiple derivations

Exponents: using facts multiple times

(89)

Introduction Bool[X]-provenance N[X]-provenance Conclusion

Provenance of a Boolean CQ

R a a x1 b c x2 c b x3

Query: q:∃xyR(x,y)∧R(y,x) Provenance:

(x1⊗x1)(x2⊗x3)

(x3⊗x2) akax21+ 2x2x3

Definition:

Sumover query matches Multiplyover matched facts How isN[X]more expressive thanPosBool[X]?

Coefficients: counting multiple derivations

Exponents: using facts multiple times

Références

Documents relatifs

Pour toute union de requêtes conjonctives q fixée et k ∈ N , pour toute instance d’entrée I de largeur d’arbre ≤ k, on peut construire en temps linéaire.. un circuit de

→ (Non ordonné : largeur non bornée) Tous les opérateurs sauf × minimal préservent la

For any fixed MSO query q (first order + quantify on sets) we can compute a provenance circuit C for any input tree T in linear time in the input T. →

Consider the taxonomy: partial order Consider all possible total orders. (Ties can be made negligible) Solve each total order

Creative provenance representations (arithmetic circuits) Intrinsic definitions of provenance (rather than operational) Extending provenance to MSO (PosBool[X] only for

Creative provenance representations (arithmetic circuits) Intrinsic definitions of provenance (rather than operational) Extending provenance to MSO (PosBool[X] only for

Uncertain Version Control in Open Collaborative Editing of Tree-Structured Documents.. DocEng’13,

⇒ We can identify examples of hard TPQJ query classes (e.g., the image of classes of non-hierarchical CQs) MSO evaluation over PrXML {ind,mux} is linear time. ⇒ Read-once