Theoremadvanced
Weak acyclicity and chase termination
Also called weakly acyclic dependencies.
If the dependency graph of the tgds has no cycle through a special edge, each chase stops in polynomially many steps, for a fixed set of dependencies, in the size of the instance (data complexity).
Weak acyclicity is a syntactic condition on a set of tuple-generating dependencies (tgds) that makes the chase stop. If no cycle of the dependency graph goes through a special edge, then every chase sequence with these tgds and any set of equality-generating dependencies (egds) has a length bounded by a polynomial in the size of the instance. The bound is in data complexity: the polynomial depends on the fixed set of dependencies. The condition is sufficient for termination but not necessary. This page proves the termination theorem; the data exchange problem page uses it as its standard assumption on target dependencies, and the universal solution page uses the chase result it guarantees.
Statement
A tgd has the form . The variables occur in the body and in the head and are the frontier variables. The variables are the existential variables. An egd has the form . Values are constants or labeled nulls , and instances are sets of facts.
Positions and the dependency graph. A position is a pair of a relation and an argument number . The dependency graph of a set of tgds has the positions as nodes. For each tgd of , each frontier variable and each position where occurs in the body:
- there is a regular edge from to each position where occurs in the head;
- there is a special edge from to each position where an existential variable occurs in the head.
is weakly acyclic if no cycle of the dependency graph goes through a special edge.
Chase steps. Let be an instance. A tgd step uses a tgd and a map of its body into such that no extension of maps the head into . It adds the facts , with fresh nulls for the existential variables. An egd step uses an egd and a map of its body into with . If both values are constants, the chase fails. Otherwise it replaces a null among the two by the other value everywhere in . A chase sequence of with starts at and makes one step at a time.
Theorem. Let be a finite set of tgds and egds whose tgds are weakly acyclic. There is a polynomial such that, for each instance , each chase sequence of with has at most steps. So for a fixed , each chase stops, with a result or with a failure, after a number of steps polynomial in the size of (data complexity).
In plain words
The chase repairs an instance by adding missing facts. Some rules invent new unknown values, and an invented value can trigger a rule that invents another one, and so on forever.
Draw a graph whose nodes are the columns of the relations. Draw an arrow when a rule copies a value from one column to another, and a marked arrow when a rule invents a value in a column because of a value in another column. If no loop of arrows contains a marked arrow, invented values cannot keep making new invented values: the depth of invention has a limit. So the number of invented values is bounded by a polynomial in the size of the data, and the chase must stop. The rules that make two values equal only remove values, so they do not break this.
Proof
Let be the number of values of , let be the number of positions, let be the largest number of frontier variables and the largest number of existential variables of a tgd of .
Rank. The rank of a position is the largest number of special edges on a walk that ends at . If a walk had special edges, two of their end positions would be equal. The part of the walk between them is a closed walk that contains a special edge . The rest of that closed walk goes from back to and contains a simple path from to , so the edge and the path form a cycle through a special edge. This is false for a weakly acyclic set, so each rank is at most . A regular edge gives , and a special edge gives . Let be the set of positions of rank at most .
Three facts about steps.
- A tgd step puts at a head position either a value of a frontier variable, which already occurs at a body position with a regular edge , so ; or a fresh null. In the second case each frontier variable occurs only at body positions with a special edge to , so all frontier values come from .
- An egd step that does not fail replaces one null by a value everywhere. After it, never occurs again, because each later null is fresh.
- For times , let be the composition of the replacements of the egd steps between and . Then , because a tgd step only adds facts and an egd step applies its replacement to all facts.
Tokens. Fix . We hand out tokens to the values that occur at positions of . At time 0, each such value of gets a new token. When a tgd step puts a fresh null at a position of , the null gets a new token. When an egd step replaces by , and holds a token and holds none, then takes the token of ; otherwise the token of , if any, is dropped. By induction on the steps, using fact 1 for copied values and fact 2 for egd steps, two statements hold at each time .
- (T1) Each value that occurs at a position of holds exactly one token, and no two values hold the same token.
- (T2) If a token is held by at time and by at a later time , then .
Let be the number of tokens created at level over the whole sequence. Then .
One tgd fires a bounded number of times. Let be a tgd whose frontier variables all occur at body positions of . Map each step that applies at time , with the map , to the tuple of tokens at level held by at time . Assume that two steps at times , with maps and , give the same tuple. The step at adds , so by fact 3, contains for . By (T1) and (T2), for each . Then extends to the head by , so the step at is not a tgd step, which is a contradiction. So fires at most times if , and at most once if , as its head then holds forever. In both cases the count is at most .
The recursion. By fact 1, a fresh null at a position of rank at most comes from a tgd whose frontier variables all occur at positions of rank at most . Each step makes at most nulls. So, with ,
By induction on , is at most a polynomial in of degree at most , with coefficients that depend only on . Each position has rank at most , so bounds the number of all values that ever occur.
The length. Each tgd has its frontier variables at positions of rank at most , so by the bound above there are at most tgd steps. By fact 2, each egd step that does not fail removes a null for good, so there are at most of them, and at most one step fails. So each chase sequence has at most
steps. Since is at most the largest arity times , this is a polynomial in for a fixed .
Consequences
- Existence of solutions. Let a schema mapping have source-to-target tgds and target dependencies that are egds and weakly acyclic tgds. Then run a chase. If it fails, no solution exists. If it succeeds, the result is a universal solution. So the existence of a solution is decidable in polynomial time in data complexity. Without a condition of this kind the problem is undecidable in general.
- Query answering. The certain answers of a union of conjunctive queries are the null-free answers of naive evaluation on the chase result, so they take polynomial time in data complexity.
- The core. Gottlob and Nash showed that the core of the universal solutions can then also be computed in polynomial time in data complexity (see core computation for data exchange).
- Any order of steps. The bound holds for each chase sequence, so an implementation may choose the order of the steps freely.
Tightness
- Sufficient, not necessary. Take the single tgd . The variable occurs at in the body and occurs at in the head, so there is a special edge from to itself, and the set is not weakly acyclic. But each chase stops: a step needs , no step adds to , and after one step with a given the head holds for . So there are at most steps.
- Without the condition, the chase may not stop. With and , each step adds a fact whose new null starts a new step. The special edge from to itself is a cycle.
- The bound is not polynomial in combined complexity. Take the tgds and, for , , each with all its variables universally quantified. All edges go from to , so the set is weakly acyclic, and has rank . Each pair of nulls of gives a new fact, so for values in . With and , the chase makes facts in the counts 4, 16 and 256. The number of steps is doubly exponential in the number of tgds, so the degree of must grow with .
History
Fagin, Kolaitis, Miller and Popa defined weakly acyclic sets of tgds and proved the polynomial bound on chase sequences in their paper on data exchange, presented at ICDT 2003 and published in Theoretical Computer Science in 2005. Before that, the chase was mostly used with full dependencies, which make no new values and so always stop. Weak acyclicity became the usual assumption on target dependencies in data exchange, and later work found larger classes of tgds with a terminating chase.
References
- Ronald Fagin, Phokion G. Kolaitis, Renée J. Miller and Lucian Popa, Data exchange: semantics and query answering, Theoretical Computer Science 336(1), 2005, weakly acyclic sets of tgds and the polynomial bound on the length of chase sequences
- Marcelo Arenas, Pablo Barceló, Leonid Libkin and Filip Murlak, Foundations of Data Exchange, Cambridge University Press, 2014, Chapter 5, Existence of solutions
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 41NFV7 Edit this page History Report an error Markdown