Overall idea
•
Query:Q(x1, . . . ,xn)withfree variablesx1, . . . ,xn•
Goal:find all tuplesa1, . . . ,ansuch thatQ(a1, . . . ,an)holds→ Addspecial nodes: for each nodenand variablexi, add a nodeniwhich is coloredrediffxi is the noden
n n0 n00
⇒
n
•
•
n0 n00 n1 n2
•
Rewrite the query to aBoolean querywhich uses the new nodesni to read the valuation ofxi•
This can be done inlinear timein the input tree•
Remark: same construction for freesecond-order variablesOverall idea
•
Query:Q(x1, . . . ,xn)withfree variablesx1, . . . ,xn•
Goal:find all tuplesa1, . . . ,ansuch thatQ(a1, . . . ,an)holds→ Addspecial nodes: for each nodenand variablexi, add a nodeniwhich is coloredrediffxi is the noden
n n0 n00
⇒
n
•
•
n0 n00 n1 n2
•
Rewrite the query to aBoolean querywhich uses the new nodesni to read the valuation ofxi•
This can be done inlinear timein the input tree•
Remark: same construction for freesecond-order variablesOverall idea
•
Query:Q(x1, . . . ,xn)withfree variablesx1, . . . ,xn•
Goal:find all tuplesa1, . . . ,ansuch thatQ(a1, . . . ,an)holds→ Addspecial nodes: for each noden and variablexi, add a nodeniwhich is coloredrediffxi is the noden
n n0 n00
⇒
n
•
•
n0 n00 n1 n2
•
Rewrite the query to aBoolean querywhich uses the new nodesni to read the valuation ofxi•
This can be done inlinear timein the input tree•
Remark: same construction for freesecond-order variablesOverall idea
•
Query:Q(x1, . . . ,xn)withfree variablesx1, . . . ,xn•
Goal:find all tuplesa1, . . . ,ansuch thatQ(a1, . . . ,an)holds→ Addspecial nodes: for each noden and variablexi, add a nodeniwhich is coloredrediffxi is the noden
n n0 n00
⇒
n
•
•
n0 n00 n1 n2
•
Rewrite the query to aBoolean querywhich uses the new nodesni to read the valuation ofxi•
This can be done inlinear timein the input tree•
Remark: same construction for freesecond-order variablesOverall idea
•
Query:Q(x1, . . . ,xn)withfree variablesx1, . . . ,xn•
Goal:find all tuplesa1, . . . ,ansuch thatQ(a1, . . . ,an)holds→ Addspecial nodes: for each noden and variablexi, add a nodeniwhich is coloredrediffxi is the noden
n n0 n00
⇒
n
•
•
n0 n00 n1 n2
•
Rewrite the query to aBoolean querywhich uses the new nodesni to read the valuation ofxi•
This can be done inlinear timein the input treeUncertain trees
Now: Boolean query on a tree where the color of nodes isuncertain 1
5
6 7 2
4 3
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?”
Uncertain trees
Now: Boolean query on a tree where the color of nodes isuncertain 1
5
6 7 2
4 3
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?”
Uncertain trees
Now: Boolean query on a tree where the color of nodes isuncertain 1
5
6 7 2
4 3
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?”
Uncertain trees
Now: Boolean query on a tree where the color of nodes isuncertain 1
5
6 7 2
4 3
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?”
Uncertain trees
Now: Boolean query on a tree where the color of nodes isuncertain 1
5
6 7 2
4 3
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?”
Uncertain trees
Now: Boolean query on a tree where the color of nodes isuncertain 1
5
6 7 2
4 3
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?”
Uncertain trees
Now: Boolean query on a tree where the color of nodes isuncertain 1
5
6 7 2
4 3
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
Uncertain trees
Now: Boolean query on a tree where the color of nodes isuncertain 1
5
6 7 2
4 3
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
Uncertain trees
Now: Boolean query on a tree where the color of nodes isuncertain 1
5
6 7 2
4 3
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
Set circuit
•
Tree automatonA, uncertain treeT, circuitC•
Variable gatesofC: nodes ofT•
Condition:Letνbe a valuation ofT, thenA acceptsν(T)iff the setS(g0)of the output gateg0 contains{g∈C|ν(g) =1}.Query:Is there both a pink and a blue node?
×
Set circuit
•
Tree automatonA, uncertain treeT, circuitC•
Variable gatesofC: nodes ofT•
Condition:Letνbe a valuation ofT, thenA acceptsν(T)iff the setS(g0)of the output gateg0 contains{g∈C|ν(g) =1}.Query:Is there both a pink and a blue node?
×
Set circuit
•
Tree automatonA, uncertain treeT, circuitC•
Variable gatesofC: nodes ofT•
Condition:Letνbe a valuation ofT, thenA acceptsν(T)iff the setS(g0)of the output gateg0 contains{g∈C|ν(g) =1}.Query:Is there both a pink and a blue node?
×
Set circuit
•
Tree automatonA, uncertain treeT, circuitC•
Variable gatesofC: nodes ofT•
Condition:Letνbe a valuation ofT, thenA acceptsν(T)iff the setS(g0)of the output gateg0 contains{g∈C|ν(g) =1}.Query:Is there both a pink and a blue node?
×
Set circuit
•
Tree automatonA, uncertain treeT, circuitC•
Variable gatesofC: nodes ofT•
Condition:Letνbe a valuation ofT, thenA acceptsν(T)iff the setS(g0)of the output gateg0 contains{g∈C|ν(g) =1}.Query:Is there both a pink and a blue node?
×
Building provenance circuits on trees
Theorem
For any bottom-uptree automatonAand inputtreeT, we can build ad-DNNF set circuitofAonTinO(|A| × |T|)
•
Alphabet:•
Automaton:“Is there both a pink and a blue node?”Building provenance circuits on trees
Theorem
For any bottom-uptree automatonAand inputtreeT, we can build ad-DNNF set circuitofAonTinO(|A| × |T|)
•
Alphabet:•
Automaton:“Is there both a pink and a blue node?”Building provenance circuits on trees
Theorem
For any bottom-uptree automatonAand inputtreeT, we can build ad-DNNF set circuitofAonTinO(|A| × |T|)
•
Alphabet:•
Automaton:“Is there both a pink and a blue node?”Building provenance circuits on trees
Theorem
For any bottom-uptree automatonAand inputtreeT, we can build ad-DNNF set circuitofAonTinO(|A| × |T|)
•
Alphabet:•
Automaton:“Is there both a pink and a blue node?”Building provenance circuits on trees
Theorem
For any bottom-uptree automatonAand inputtreeT, we can build ad-DNNF set circuitofAonTinO(|A| × |T|)
•
Alphabet:•
Automaton:“Is there both a pink and a blue node?”Building provenance circuits on trees
Theorem
For any bottom-uptree automatonAand inputtreeT, we can build ad-DNNF set circuitofAonTinO(|A| × |T|)
•
Alphabet:•
Automaton:“Is there both a pink and a blue node?”Building provenance circuits on trees
Theorem
For any bottom-uptree automatonAand inputtreeT, we can build ad-DNNF set circuitofAonTinO(|A| × |T|)
•
Alphabet:•
Automaton:“Is there both a pink and a blue node?”Building provenance circuits on trees
Theorem
For any bottom-uptree automatonAand inputtreeT, we can build ad-DNNF set circuitofAonTinO(|A| × |T|)
•
Alphabet:•
Automaton:“Is there both a pink and a blue node?”Circuits as factorized representations of query results
→ Theset circuitofQis now afactorized representation which describes all the tuples that makeQtrue
Example query:
Theorem [Bagan, 2006, Kazana and Segoufin, 2013]
We can enumerate the answers of MSO queries on trees with linear-time preprocessing and constant delay.
Semi-open question:what about memory usage?
Circuits as factorized representations of query results
→ Theset circuitofQis now afactorized representation which describes all the tuples that makeQtrue Example query:
Theorem [Bagan, 2006, Kazana and Segoufin, 2013]
We can enumerate the answers of MSO queries on trees with linear-time preprocessing and constant delay.
Semi-open question:what about memory usage?
Circuits as factorized representations of query results
→ Theset circuitofQis now afactorized representation which describes all the tuples that makeQtrue Example query:
Theorem [Bagan, 2006, Kazana and Segoufin, 2013]
We can enumerate the answers of MSO queries on trees with linear-time preprocessing and constant delay.
Semi-open question:what about memory usage?
Circuits as factorized representations of query results
→ Theset circuitofQis now afactorized representation which describes all the tuples that makeQtrue Example query:
Theorem [Bagan, 2006, Kazana and Segoufin, 2013]
We can enumerate the answers of MSO queries on trees with linear-time preprocessing and constant delay.
Semi-open question:what about memory usage?
Circuits as factorized representations of query results
→ Theset circuitofQis now afactorized representation which describes all the tuples that makeQtrue Example query:
Theorem [Bagan, 2006, Kazana and Segoufin, 2013]
We can enumerate the answers of MSO queries on trees with linear-time preprocessing and constant delay.
Semi-open question:what about memory usage?
Circuits as factorized representations of query results
→ Theset circuitofQis now afactorized representation which describes all the tuples that makeQtrue Example query:
Theorem [Bagan, 2006, Kazana and Segoufin, 2013]
We can enumerate the answers of MSO queries on trees with linear-time preprocessing and constant delay.
Semi-open question:what about memory usage?
Circuits as factorized representations of query results
→ Theset circuitofQis now afactorized representation which describes all the tuples that makeQtrue Example query:
Theorem [Bagan, 2006, Kazana and Segoufin, 2013]
We can enumerate the answers of MSO queries on trees with linear-time preprocessing and constant delay.
Semi-open question:what about memory usage?
Circuits as factorized representations of query results
→ Theset circuitofQis now afactorized representation which describes all the tuples that makeQtrue Example query:
Theorem [Bagan, 2006, Kazana and Segoufin, 2013]
We can enumerate the answers of MSO queries on trees with linear-time preprocessing and constant delay.
Semi-open question:what about memory usage?
Circuits as factorized representations of query results
→ Theset circuitofQis now afactorized representation which describes all the tuples that makeQtrue Example query:
Theorem [Bagan, 2006, Kazana and Segoufin, 2013]
We can enumerate the answers of MSO queries on trees with linear-time preprocessing and constant delay.