Algorithm Search⌘K

Definitionadvanced

Tuple-generating dependency

Also called TGD, embedded implicational dependency.

A first-order constraint that whenever some tuples are present, tuples with possibly new values must be present too.

A tuple-generating dependency (TGD) says that whenever some pattern of tuples occurs in a database, another pattern of tuples occurs too, possibly with values that are not in the first pattern. Both patterns are conjunctions of relational atoms, as in a conjunctive query. TGDs cover multivalued dependencies, join dependencies and inclusion dependencies in one form. Together with equality-generating dependencies they make up the embedded implicational dependencies of Fagin (1982), and Beeri and Vardi (1984) gave the chase as a general proof procedure for them. Today TGDs are also the language of schema mappings in data exchange and of rules with existential variables in ontologies.

Definition

We use set semantics: a relation is a set of tuples. A conjunction of atoms is a formula A1∧⋯∧AmA_1 \wedge \cdots \wedge A_m where each AiA_i is a relational atom R(t1,…,tr)R(t_1, \ldots, t_r) over variables and constants.

Definition (Beeri and Vardi 1984). A tuple-generating dependency is a first-order sentence

∀xˉ (φ(xˉ)→∃yˉ  ψ(xˉ,yˉ)),\forall \bar x \, \big( \varphi(\bar x) \rightarrow \exists \bar y \; \psi(\bar x, \bar y) \big),

where φ\varphi, the body, and ψ\psi, the head, are conjunctions of atoms, φ\varphi is not empty, and the variables of yˉ\bar y do not occur in φ\varphi. In ASCII it is written phi(x) -> exists y psi(x, y). A database DD satisfies the TGD if every valuation vv of xˉ\bar x with v(φ)⊆Dv(\varphi) \subseteq D extends to a valuation v′v' of xˉyˉ\bar x \bar y with v′(ψ)⊆Dv'(\psi) \subseteq D.

  • The TGD is full if yˉ\bar y is empty: no new values are needed.
  • It is embedded if yˉ\bar y is not empty.
  • The variables of xˉ\bar x that occur in ψ\psi are the frontier. Let fˉ\bar f be the frontier. Then DD satisfies the TGD if and only if Qφ(D)⊆Qψ(D)Q_\varphi(D) \subseteq Q_\psi(D) for the two conjunctive queries Qφ(fˉ): ⁣−φQ_\varphi(\bar f) \mathbin{:\!-} \varphi and Qψ(fˉ): ⁣−ψQ_\psi(\bar f) \mathbin{:\!-} \psi.

A TGD with several atoms in the head that share existential variables, such as R(x)→∃y (S(x,y)∧T(y))R(x) \rightarrow \exists y \, (S(x, y) \wedge T(y)), can not be split into TGDs with one atom each, because yy must be the same value in both atoms.

The chase step. If v(φ)⊆Dv(\varphi) \subseteq D and no extension v′v' maps ψ\psi into DD, the chase adds the facts v′(ψ)v'(\psi), where v′v' sends each variable of yˉ\bar y to a new labeled null. For full TGDs the chase adds only tuples over the values already in DD, so it stops. For embedded TGDs it may run forever.

Examples and non-examples

Let RR have the attributes AA, BB and CC.

  • Multivalued dependency. A↠BA \twoheadrightarrow B on R(A,B,C)R(A, B, C) is the full TGD
    ∀a,b,c,b′,c′ (R(a,b,c)∧R(a,b′,c′)→R(a,b,c′)).\forall a, b, c, b', c' \, \big( R(a, b, c) \wedge R(a, b', c') \rightarrow R(a, b, c') \big).
  • Join dependency. ⋈[AB,BC,CA]\bowtie[AB, BC, CA] on R(A,B,C)R(A, B, C) is the full TGD R(a,b,c′)∧R(a′,b,c)∧R(a,b′,c)→R(a,b,c)R(a, b, c') \wedge R(a', b, c) \wedge R(a, b', c) \rightarrow R(a, b, c). Each body atom agrees with the head on one component of the join.
  • Inclusion dependency. For R(A,B)R(A, B) and S(C,D)S(C, D), the IND R[A]⊆S[D]R[A] \subseteq S[D] is the embedded TGD R(x,y)→∃z  S(z,x)R(x, y) \rightarrow \exists z \; S(z, x).
  • Transitivity. E(x,y)∧E(y,z)→E(x,z)E(x, y) \wedge E(y, z) \rightarrow E(x, z) is a full TGD. It is also a Datalog rule: a full TGD with one head atom is a Datalog rule, read as a constraint.
  • Source-to-target mapping. Flight(x,y)→∃z (Leg(x,z)∧Leg(z,y))\mathit{Flight}(x, y) \rightarrow \exists z \, (\mathit{Leg}(x, z) \wedge \mathit{Leg}(z, y)) says that each flight of the source is two legs in the target, through some stop zz. TGDs of this form, with the body over the source and the head over the target, are source-to-target TGDs.
  • Non-example: functional dependency. A→BA \to B asks for equal values, not for tuples: R(a,b,c)∧R(a,b′,c′)→b=b′R(a, b, c) \wedge R(a, b', c') \rightarrow b = b'. It is an equality-generating dependency. No set of TGDs without constants is equivalent to it: the relation of all 8 tuples over {0,1}\{0, 1\} satisfies every such TGD, because any head atom can be matched there, but it violates A→BA \to B.
  • Non-example: disjunction. R(x)→S(x)∨T(x)R(x) \rightarrow S(x) \vee T(x) is not a TGD. It is a disjunctive TGD, and the chase must branch.
  • Non-example: negation. R(x)∧¬S(x)→T(x)R(x) \wedge \neg S(x) \rightarrow T(x) is not a TGD, because the body is not a conjunction of atoms.
  • Equality-generating dependency. The other half of the embedded implicational dependencies: the head is an equality xi=xjx_i = x_j. See equality-generating dependency.
  • Embedded implicational dependency. Fagin (1982) defined the class of sentences ∀xˉ (φ→∃yˉ ψ)\forall \bar x \, (\varphi \rightarrow \exists \bar y \, \psi) where ψ\psi is a conjunction of atoms or of equalities. It contains both TGDs and EGDs. The name is sometimes used for TGDs alone, but it is the larger class.
  • Implication. Implication of embedded implicational dependencies is undecidable (Chandra, Lewis and Makowsky 1981). For full TGDs and EGDs the chase stops, so implication is decidable. For embedded TGDs, when the chase of the body of the goal stops, its result decides implication; when the chase does not stop, a finite part of it can still prove that the goal holds. See the dependency implication problem.
  • Weak acyclicity. A set of TGDs is weakly acyclic if its dependency graph has no cycle through an edge that creates a new value. Then every chase stops after polynomially many steps in the size of the database. See weak acyclicity.
  • Schema mapping and data exchange. A schema mapping is a set of source-to-target TGDs, often with target TGDs and EGDs. The chase builds a universal solution, and queries are answered by their certain answers.
  • Datalog. A Datalog program is a set of full TGDs with one head atom, read as rules that compute the smallest database that satisfies them.

References

  1. Catriel Beeri and Moshe Y. Vardi, A proof procedure for data dependencies, Journal of the ACM 31(4), 718 to 741 (1984), tuple-generating and equality-generating dependencies, and the chase as a proof procedure for their implication
  2. Ronald Fagin, Horn clauses and database dependencies, Journal of the ACM 29(4), 952 to 985 (1982), embedded implicational dependencies as Horn sentences, which cover tuple-generating and equality-generating dependencies
  3. Ashok K. Chandra, Harry R. Lewis and Johann A. Makowsky, Embedded implicational dependencies and their inference problem, Proceedings of the 13th Annual ACM Symposium on Theory of Computing (STOC), 342 to 354 (1981), the undecidability of implication for embedded implicational dependencies
  4. Serge Abiteboul, Richard Hull and Victor Vianu, Foundations of Databases, Addison-Wesley (1995), Chapter 10 (a larger perspective), tuple-generating and equality-generating dependencies and the chase

Where this leads

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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/6AV13D/text.yaml