• Aucun résultat trouvé

Uncertain Data Management Boolean c-tables

N/A
N/A
Protected

Academic year: 2022

Partager "Uncertain Data Management Boolean c-tables"

Copied!
64
0
0

Texte intégral

(1)

Definitions Boolean c-tables Expressiveness

Uncertain Data Management Boolean c-tables

Antoine Amarilli1, Silviu Maniu2

1Télécom ParisTech

2LRI

November 30th, 2015

(2)

Definitions Boolean c-tables Expressiveness

c-tables

Rememberc-tables:

Member ▷◁Booking id date teacher class room 1 2015-12-07 NULL1 UDM NULL2 2 2015-12-07 NULL1 UDM NULL2

3 2015-12-07 NULL1 UDM NULL2 ifNULL0 is “UDM”

Variant: Only allowNULLs in theconditions

(3)

Definitions Boolean c-tables Expressiveness

c-tables

Rememberc-tables:

Member ▷◁Booking id date teacher class room 1 2015-12-07 NULL1 UDM NULL2 2 2015-12-07 NULL1 UDM NULL2

3 2015-12-07 NULL1 UDM NULL2 ifNULL0 is “UDM”

Variant: Only allowNULLs in the conditions

(4)

Definitions Boolean c-tables Expressiveness

NULLs in conditions

The possible tuplesare exactly therows Each row may either be kept ordeleted

Depends on thecondition

Finitenumber of possible worlds

at most2N if we haveNrows

(5)

Definitions Boolean c-tables Expressiveness

NULLs in conditions

The possible tuplesare exactly therows Each row may either be kept ordeleted

Depends on thecondition

Finitenumber of possible worlds

at most2N if we haveNrows

(6)

Definitions Boolean c-tables Expressiveness

NULLs in conditions

The possible tuplesare exactly therows Each row may either be kept ordeleted

Depends on thecondition

Finitenumber of possible worlds

at most2N if we haveNrows

(7)

Definitions Boolean c-tables Expressiveness

Example

Member ▷◁Booking id date teacher class room

1 2015-12-07 Antoine UDM C42 if NULL1 is “Antoine”

2 2015-12-07 Antoine UDM C42 if NULL1 is “Antoine”

3 2015-12-07 Antoine UDM C42 if NULL1 is “Antoine”

1 2015-12-07 Silviu UDM C42 if NULL1 is “Silviu”

2 2015-12-07 Silviu UDM C42 if NULL1 is “Silviu”

3 2015-12-07 Silviu UDM C42 if NULL1 is “Silviu”

(8)

Definitions Boolean c-tables Expressiveness

Table of contents

1 Definitions

2 Boolean c-tables

3 Expressiveness

(9)

Definitions Boolean c-tables Expressiveness

Boolean c-tables

WithBoolean c-tables, we impose:

the possible values of each NULLi are True andFalse

We cansimplify notation

We write theNULLs asBoolean variablesxi

We replace xi=True by justxi

We replace xi=False by¬xi

We can rewrite:

xi=xj to(xixj)(¬xi∧ ¬xj) xi̸=xj to(xi∧ ¬xj)(¬xixj)

The conditions becomeBoolean expressions

(10)

Definitions Boolean c-tables Expressiveness

Boolean c-tables

WithBoolean c-tables, we impose:

the possible values of each NULLi are True andFalse We cansimplify notation

We write theNULLs asBoolean variablesxi

We replace xi=True by justxi

We replace xi=False by¬xi

We can rewrite:

xi=xj to(xixj)(¬xi∧ ¬xj) xi̸=xj to(xi∧ ¬xj)(¬xixj)

The conditions becomeBoolean expressions

(11)

Definitions Boolean c-tables Expressiveness

Boolean c-tables

WithBoolean c-tables, we impose:

the possible values of each NULLi are True andFalse We cansimplify notation

We write theNULLs asBoolean variablesxi

We replace xi=True by justxi

We replace xi=False by¬xi

We can rewrite:

xi=xj to(xixj)(¬xi∧ ¬xj) xi̸=xj to(xi∧ ¬xj)(¬xixj)

The conditions becomeBoolean expressions

(12)

Definitions Boolean c-tables Expressiveness

Boolean c-tables

WithBoolean c-tables, we impose:

the possible values of each NULLi are True andFalse We cansimplify notation

We write theNULLs asBoolean variablesxi

We replace xi=True by justxi

We replace xi=False by¬xi

We can rewrite:

xi=xj to(xixj)(¬xi∧ ¬xj) xi̸=xj to(xi∧ ¬xj)(¬xixj)

(13)

Definitions Boolean c-tables Expressiveness

Expressiveness

Theorem

We can always rewrite a c-table havingNULLs only in conditions to a Boolean c-table.

Twosteps:

1 We can pick the NULLs in afinite domain

2 We can rewrite any finite domaintoTrue andFalse

(14)

Definitions Boolean c-tables Expressiveness

Expressiveness

Theorem

We can always rewrite a c-table havingNULLs only in conditions to a Boolean c-table.

Twosteps:

1 We can pick the NULLs in afinite domain

2 We can rewrite anyfinite domain toTrue andFalse

(15)

Definitions Boolean c-tables Expressiveness

Reducing to a finite domain

We can choose among infinitely many values for theNULLs However, the values only appear in theconditions:

NULLi =NULLj

NULLi = “c”

Boolean combinations

We call two assignments of values toNULLs equivalent if all conditions evaluate to thesame

(16)

Definitions Boolean c-tables Expressiveness

Reducing to a finite domain

We can choose among infinitely many values for theNULLs However, the values only appear in theconditions:

NULLi =NULLj

NULLi = “c”

Boolean combinations

We call two assignments of values toNULLsequivalent if all conditions evaluate to thesame

(17)

Definitions Boolean c-tables Expressiveness

Reducing to a finite domain (example)

Call two assignments of values to NULLs equivalent if all conditions evaluate to thesame.

Consider the following:

NULL1 =NULL2 NULL2 = “c”

E.g.: The assignment(a,d) is equivalentto (b,d)

What are the possible assignments? (c,c)

true,true (x,c)withx̸=c

false,true (x,x)withx̸=c

true, false

(y,x)withx̸=candy̸=x

false, false

(18)

Definitions Boolean c-tables Expressiveness

Reducing to a finite domain (example)

Call two assignments of values to NULLs equivalent if all conditions evaluate to thesame.

Consider the following:

NULL1 =NULL2 NULL2 = “c”

E.g.: The assignment(a,d) is equivalentto (b,d)

What are the possible assignments?

(c,c)

true,true (x,c)withx̸=c

false,true (x,x)withx̸=c

true, false

(y,x)withx̸=candy̸=x

false, false

(19)

Definitions Boolean c-tables Expressiveness

Reducing to a finite domain (example)

Call two assignments of values to NULLs equivalent if all conditions evaluate to thesame.

Consider the following:

NULL1 =NULL2 NULL2 = “c”

E.g.: The assignment(a,d) is equivalentto (b,d)

What are the possible assignments?

(c,c)

true,true

(x,c)withx̸=c

false,true (x,x)withx̸=c

true, false

(y,x)withx̸=candy̸=x

false, false

(20)

Definitions Boolean c-tables Expressiveness

Reducing to a finite domain (example)

Call two assignments of values to NULLs equivalent if all conditions evaluate to thesame.

Consider the following:

NULL1 =NULL2 NULL2 = “c”

E.g.: The assignment(a,d) is equivalentto (b,d)

What are the possible assignments?

(c,c)

true,true (x,c)withx̸=c

false,true

(x,x)withx̸=c

true, false

(y,x)withx̸=candy̸=x

false, false

(21)

Definitions Boolean c-tables Expressiveness

Reducing to a finite domain (example)

Call two assignments of values to NULLs equivalent if all conditions evaluate to thesame.

Consider the following:

NULL1 =NULL2 NULL2 = “c”

E.g.: The assignment(a,d) is equivalentto (b,d)

What are the possible assignments?

(c,c)

true,true (x,c)withx̸=c

false,true (x,x)withx̸=c

true, false

(y,x)withx̸=candy̸=x

false, false

(22)

Definitions Boolean c-tables Expressiveness

Reducing to a finite domain (example)

Call two assignments of values to NULLs equivalent if all conditions evaluate to thesame.

Consider the following:

NULL1 =NULL2 NULL2 = “c”

E.g.: The assignment(a,d) is equivalentto (b,d)

What are the possible assignments?

(c,c)

true,true (x,c)withx̸=c

false,true (x,x)withx̸=c

(23)

Definitions Boolean c-tables Expressiveness

Reducing to a finite domain (concluding)

Consider allconstantsthat appear: C ConsiderNdifferent values V, whereNis the number of NULLs

Gives ourdomain D ··=C ⊔ V Lemma

For any c-table withNULLs only in conditions, its set of possible worlds is the same:

under the standard semantics when NULLs range over the finite D.

For simplicity, let’spadD

to have exactly 2k values for somek

(24)

Definitions Boolean c-tables Expressiveness

Reducing to a finite domain (concluding)

Consider allconstantsthat appear: C ConsiderNdifferent values V, whereNis the number of NULLs

Gives ourdomain D ··=C ⊔ V

Lemma

For any c-table withNULLs only in conditions, its set of possible worlds is the same:

under the standard semantics when NULLs range over the finite D.

For simplicity, let’spadD

to have exactly 2k values for somek

(25)

Definitions Boolean c-tables Expressiveness

Reducing to a finite domain (concluding)

Consider allconstantsthat appear: C ConsiderNdifferent values V, whereNis the number of NULLs

Gives ourdomain D ··=C ⊔ V Lemma

For any c-table withNULLs only in conditions, its set of possible worlds is the same:

under the standard semantics when NULLs range over the finite D.

For simplicity, let’spadD

to have exactly 2k values for somek

(26)

Definitions Boolean c-tables Expressiveness

Reducing to a finite domain (concluding)

Consider allconstantsthat appear: C ConsiderNdifferent values V, whereNis the number of NULLs

Gives ourdomain D ··=C ⊔ V Lemma

For any c-table withNULLs only in conditions, its set of possible worlds is the same:

under the standard semantics when NULLs range over the finite D.

(27)

Definitions Boolean c-tables Expressiveness

Rewriting to Boolean variables

The domainhas size2k.

Write its values in binary

Encode each NULLi to variables x1i, . . . ,xki

Can we translatethe conditions?

(28)

Definitions Boolean c-tables Expressiveness

Rewriting to Boolean variables

The domainhas size2k. Write its values inbinary

Encode each NULLi to variables x1i, . . . ,xki

Can we translatethe conditions?

(29)

Definitions Boolean c-tables Expressiveness

Rewriting to Boolean variables

The domainhas size2k. Write its values inbinary

Encode each NULLi to variables x1i, . . . ,xki

Can we translatethe conditions?

(30)

Definitions Boolean c-tables Expressiveness

Rewriting to Boolean variables (example)

NULL7= 001

x17= 0andx27= 0 andx37= 1

¬x17∧ ¬x27x37 NULL7̸= 001

negatethe above NULL7=NULL8

x17=x18 andx27=x28 andx37=x38 NULL7̸=NULL8

negatethe above

(31)

Definitions Boolean c-tables Expressiveness

Rewriting to Boolean variables (example)

NULL7= 001

x17= 0andx27= 0 andx37= 1

¬x17∧ ¬x27x37 NULL7̸= 001

negatethe above NULL7=NULL8

x17=x18 andx27=x28 andx37=x38 NULL7̸=NULL8

negatethe above

(32)

Definitions Boolean c-tables Expressiveness

Rewriting to Boolean variables (example)

NULL7= 001

x17= 0andx27= 0 andx37= 1

¬x17∧ ¬x27x37

NULL7̸= 001

negatethe above NULL7=NULL8

x17=x18 andx27=x28 andx37=x38 NULL7̸=NULL8

negatethe above

(33)

Definitions Boolean c-tables Expressiveness

Rewriting to Boolean variables (example)

NULL7= 001

x17= 0andx27= 0 andx37= 1

¬x17∧ ¬x27x37 NULL7̸= 001

negatethe above NULL7=NULL8

x17=x18 andx27=x28 andx37=x38 NULL7̸=NULL8

negatethe above

(34)

Definitions Boolean c-tables Expressiveness

Rewriting to Boolean variables (example)

NULL7= 001

x17= 0andx27= 0 andx37= 1

¬x17∧ ¬x27x37 NULL7̸= 001

negatethe above

NULL7=NULL8

x17=x18 andx27=x28 andx37=x38 NULL7̸=NULL8

negatethe above

(35)

Definitions Boolean c-tables Expressiveness

Rewriting to Boolean variables (example)

NULL7= 001

x17= 0andx27= 0 andx37= 1

¬x17∧ ¬x27x37 NULL7̸= 001

negatethe above NULL7=NULL8

x17=x18 andx27=x28 andx37=x38 NULL7̸=NULL8

negatethe above

(36)

Definitions Boolean c-tables Expressiveness

Rewriting to Boolean variables (example)

NULL7= 001

x17= 0andx27= 0 andx37= 1

¬x17∧ ¬x27x37 NULL7̸= 001

negatethe above NULL7=NULL8

x17=x18 andx27=x28 andx37=x38

NULL7̸=NULL8

negatethe above

(37)

Definitions Boolean c-tables Expressiveness

Rewriting to Boolean variables (example)

NULL7= 001

x17= 0andx27= 0 andx37= 1

¬x17∧ ¬x27x37 NULL7̸= 001

negatethe above NULL7=NULL8

x17=x18 andx27=x28 andx37=x38 NULL7̸=NULL8

negatethe above

(38)

Definitions Boolean c-tables Expressiveness

Rewriting to Boolean variables (example)

NULL7= 001

x17= 0andx27= 0 andx37= 1

¬x17∧ ¬x27x37 NULL7̸= 001

negatethe above NULL7=NULL8

x17=x18 andx27=x28 andx37=x38 NULL7̸=NULL8

negatethe above

(39)

Definitions Boolean c-tables Expressiveness

Concluding

We have moved to afinite domain (without changing the table)

We have rewrittento Boolean variables (we changed the table)

It sufficesto study Boolean c-tables

(40)

Definitions Boolean c-tables Expressiveness

Concluding

We have moved to afinite domain (without changing the table)

We have rewrittento Boolean variables (we changed the table)

It sufficesto study Boolean c-tables

(41)

Definitions Boolean c-tables Expressiveness

Concluding

We have moved to afinite domain (without changing the table)

We have rewrittento Boolean variables (we changed the table)

It sufficesto study Boolean c-tables

(42)

Definitions Boolean c-tables Expressiveness

Table of contents

1 Definitions

2 Boolean c-tables

3 Expressiveness

(43)

Definitions Boolean c-tables Expressiveness

Strong representation system

Are Boolean c-tables astrong representation system for relational algebra? ...

Yes!

c-tablesare

NULLs will neverappearby themselves

(44)

Definitions Boolean c-tables Expressiveness

Strong representation system

Are Boolean c-tables astrong representation system for relational algebra? ...

Yes!

c-tablesare

NULLs will neverappearby themselves

(45)

Definitions Boolean c-tables Expressiveness

Strong representation system

Are Boolean c-tables astrong representation system for relational algebra? ...

Yes!

c-tablesare

NULLs will neverappearby themselves

(46)

Definitions Boolean c-tables Expressiveness

Capturing all uncertain relations

Fix a set ofpossible tuples

A possible world: a subset of the possible tuples An uncertain relation: set ofpossible worlds

Booking

date teacher room 23 Antoine C017 23 Silviu C017 23 Silviu C47 30 Antoine C017 30 Antoine C47 30 Silviu C017

Booking

date teacher room 23 Antoine C017

23 Silviu C017

23 Silviu C47 30 Antoine C017 30 Antoine C47 30 Silviu C017

Can we capture alluncertain relations?

(47)

Definitions Boolean c-tables Expressiveness

Capturing all uncertain relations

Fix a set ofpossible tuples

A possible world: a subset of the possible tuples An uncertain relation: set ofpossible worlds

Booking

date teacher room 23 Antoine C017 23 Silviu C017 23 Silviu C47 30 Antoine C017 30 Antoine C47 30 Silviu C017

Booking

date teacher room 23 Antoine C017

23 Silviu C017

23 Silviu C47 30 Antoine C017 30 Antoine C47 30 Silviu C017

Can we capture alluncertain relations?

(48)

Definitions Boolean c-tables Expressiveness

Capturing all uncertain relations

Fix a set ofpossible tuples

A possible world: a subset of the possible tuples An uncertain relation: set ofpossible worlds

Booking

date teacher room 23 Antoine C017 23 Silviu C017 23 Silviu C47 30 Antoine C017 30 Antoine C47 30 Silviu C017

Booking

date teacher room 23 Antoine C017

23 Silviu C017

23 Silviu C47 30 Antoine C017 30 Antoine C47 30 Silviu C017

(49)

Definitions Boolean c-tables Expressiveness

Capturing uncertain relations

Make multiple copies of possible worlds so there are 2k possible worlds

Write each possible worldin binary

00 v w a d b e c f

01 v w a d b e c f

10 v w a d b e c f

11 v w a d b e c f

(50)

Definitions Boolean c-tables Expressiveness

Capturing uncertain relations

Make multiple copies of possible worlds so there are 2k possible worlds

Write each possible worldin binary 00

v w a d b e c f

01 v w a d b e c f

10 v w a d b e c f

11 v w a d b e c f

(51)

Definitions Boolean c-tables Expressiveness

Capturing uncertain relations

Make multiple copies of possible worlds so there are 2k possible worlds

Write each possible worldin binary 00

v w a d b e c f

01 v w a d b e c f

10 v w a d b e c f

11 v w a d b e c f

(52)

Definitions Boolean c-tables Expressiveness

Numbering tuples

For eachtuple, write the possible worlds where it appears

00 v w a d b e c f

01 v w a d b e c f

10 v w a d b e c f

11 v w a d b e c f v w

a d 00 01 10 11

b e 01

c f 01 10 11

(53)

Definitions Boolean c-tables Expressiveness

Numbering tuples

For eachtuple, write the possible worlds where it appears 00

v w a d b e c f

01 v w a d b e c f

10 v w a d b e c f

11 v w a d b e c f

v w

a d 00 01 10 11

b e 01

c f 01 10 11

(54)

Definitions Boolean c-tables Expressiveness

Numbering tuples

For eachtuple, write the possible worlds where it appears 00

v w a d b e c f

01 v w a d b e c f

10 v w a d b e c f

11 v w a d b e c f v w

a d 00 01 10 11

b e 01

(55)

Definitions Boolean c-tables Expressiveness

Making a condition

Create onenon-Boolean variable

chooses the world

Obtain a non-Booleanc-table

v w

a d 00 01 10 11

b e 01

c f 01 10 11

v w

a d x= 00∨x= 01∨x= 10∨x= 11

b e x= 01

c f x= 01∨x= 10∨x= 11

(56)

Definitions Boolean c-tables Expressiveness

Making a condition

Create onenon-Boolean variable

chooses the world

Obtain a non-Booleanc-table v w

a d 00 01 10 11

b e 01

c f 01 10 11

v w

a d x= 00∨x= 01∨x= 10∨x= 11

b e x= 01

c f x= 01∨x= 10∨x= 11

(57)

Definitions Boolean c-tables Expressiveness

Making a condition

Create onenon-Boolean variable

chooses the world

Obtain a non-Booleanc-table v w

a d 00 01 10 11

b e 01

c f 01 10 11

v w

a d x= 00∨x= 01∨x= 10∨x= 11

b e x= 01

c f x= 01∨x= 10∨x= 11

(58)

Definitions Boolean c-tables Expressiveness

Making a Boolean c-table

Use theprevious trick to rewrite to aBoolean c-table

v w

a d x= 00∨x= 01∨x= 10∨x= 11

b e x= 01

c f x= 01∨x= 10∨x= 11 v w

a d ¬x1∧ ¬x2∨ ¬x1∧x2∨x1∧ ¬x2∨x1∧x2

b e ¬x1∧x2

c f ¬x1∧x2∨x1∧ ¬x2∨x1∧x2

(59)

Definitions Boolean c-tables Expressiveness

Making a Boolean c-table

Use theprevious trick to rewrite to aBoolean c-table v w

a d x= 00∨x= 01∨x= 10∨x= 11

b e x= 01

c f x= 01∨x= 10∨x= 11

v w

a d ¬x1∧ ¬x2∨ ¬x1∧x2∨x1∧ ¬x2∨x1∧x2

b e ¬x1∧x2

c f ¬x1∧x2∨x1∧ ¬x2∨x1∧x2

(60)

Definitions Boolean c-tables Expressiveness

Making a Boolean c-table

Use theprevious trick to rewrite to aBoolean c-table v w

a d x= 00∨x= 01∨x= 10∨x= 11

b e x= 01

c f x= 01∨x= 10∨x= 11 v w

a d ¬x1∧ ¬x2∨ ¬x1∧x2∨x1∧ ¬x2∨x1∧x2

b e ¬x1∧x2

c f ¬x1∧x2∨x1∧ ¬x2∨x1∧x2

(61)

Definitions Boolean c-tables Expressiveness

Conclusion

We have studied:

First:

Codd tableswithNULLs v-tableswithnamedNULLs

c-tableswithnamedNULLs andconditions

Then:

c-tables withNULLsonly in conditions Booleanc-tables: Boolean variables We have shown:

Any c-tablewith NULLsonly in conditions rewrites to a Boolean c-table

Boolean c-tables captureall finite uncertain tables

Boolean c-tables are a strong representation system

c-tables are a strong representation system

(62)

Definitions Boolean c-tables Expressiveness

Conclusion

We have studied:

First:

Codd tableswithNULLs v-tableswithnamedNULLs

c-tableswithnamedNULLs andconditions Then:

c-tables withNULLsonly in conditions Booleanc-tables: Boolean variables

We have shown:

Any c-tablewith NULLsonly in conditions rewrites to a Boolean c-table

Boolean c-tables captureall finite uncertain tables

Boolean c-tables are a strong representation system

c-tables are a strong representation system

(63)

Definitions Boolean c-tables Expressiveness

Conclusion

We have studied:

First:

Codd tableswithNULLs v-tableswithnamedNULLs

c-tableswithnamedNULLs andconditions Then:

c-tables withNULLsonly in conditions Booleanc-tables: Boolean variables We have shown:

Any c-tablewith NULLs only in conditions rewrites to a Boolean c-table

Boolean c-tables captureall finite uncertain tables

Boolean c-tables are a strong representation system

c-tables are a strong representation system

(64)

References I

Abiteboul, S., Hull, R., and Vianu, V. (1995).

Foundations of Databases.

Addison-Wesley.

http://webdam.inria.fr/Alice/pdfs/all.pdf.

Suciu, D., Olteanu, D., Ré, C., and Koch, C. (2011).

Probabilistic Databases.

Morgan & Claypool.

Unavailable online.

Références

Documents relatifs

“The place and function of Venus in Ovid...”. “Computed backscattering function of Venus and

Antoine Amarilli 1 , Silviu Maniu 2 November 21st, 2017... Class 1 (Nov 21): Introduction and

• In SQL, values can be True, False, or Unknown (NULL).. • Essentially anything that involves NULL

Booking date teacher room 21 Antoine Saphir 21 Silviu Saphir 21 Silviu C47 28 Antoine Saphir 28 Antoine C47 28 Silviu Saphir. Booking date teacher room 21 Antoine Saphir 21

Inspired by the relational algebra query of the previous section, we will write an SQL query that projects the Claims table to the source column and computes the correct

Inspired by the relational algebra query of the previous section, we will write an SQL query that projects the Claims table to the source column and computes the correct

Este enfoque, al que llamaremos “Enfoque Estándar”, sostiene que la noción de posibilidad física está dada por la estructura nomológica de las teorías físicas: ser

The second part of the paper involves an estimate of the probability of the previous scenario, guided by the principle that the actual world is the mean (PAM) and using