Exercise 12: Dependencies Database Theory 2020-07-13 Maximilian - - PowerPoint PPT Presentation

exercise 12 dependencies
SMART_READER_LITE
LIVE PREVIEW

Exercise 12: Dependencies Database Theory 2020-07-13 Maximilian - - PowerPoint PPT Presentation

Exercise 12: Dependencies Database Theory 2020-07-13 Maximilian Marx, David Carral 1 / 49 Exercise 1 Exercise. Let L be a fragment of first-order logic for which finite model entailment and arbitrary model entailment coincide, i.e., for every L


slide-1
SLIDE 1

Exercise 12: Dependencies

Database Theory 2020-07-13 Maximilian Marx, David Carral

1 / 49

slide-2
SLIDE 2

Exercise 1

  • Exercise. Let L be a fragment of first-order logic for which finite model entailment and arbitrary model entailment

coincide, i.e., for every L-theory T and every L-formula ϕ, we find that ϕ is true in all models of T if and only if ϕ is true in all finite models of T .

  • 1. Give an example for a proper fragment of first-order logic with this property.
  • 2. Give an example for a proper fragment of first-order logic without this property.
  • 3. Show that entailment is decidable in any fragment with this property.

2 / 49

slide-3
SLIDE 3

Exercise 1

  • Exercise. Let L be a fragment of first-order logic for which finite model entailment and arbitrary model entailment

coincide, i.e., for every L-theory T and every L-formula ϕ, we find that ϕ is true in all models of T if and only if ϕ is true in all finite models of T .

  • 1. Give an example for a proper fragment of first-order logic with this property.
  • 2. Give an example for a proper fragment of first-order logic without this property.
  • 3. Show that entailment is decidable in any fragment with this property.

Solution.

3 / 49

slide-4
SLIDE 4

Exercise 1

  • Exercise. Let L be a fragment of first-order logic for which finite model entailment and arbitrary model entailment

coincide, i.e., for every L-theory T and every L-formula ϕ, we find that ϕ is true in all models of T if and only if ϕ is true in all finite models of T .

  • 1. Give an example for a proper fragment of first-order logic with this property.
  • 2. Give an example for a proper fragment of first-order logic without this property.
  • 3. Show that entailment is decidable in any fragment with this property.

Solution.

  • 1. First-order formulae of the form ∃x. ∀y. ϕ[x, y] without function symbols.

4 / 49

slide-5
SLIDE 5

Exercise 1

  • Exercise. Let L be a fragment of first-order logic for which finite model entailment and arbitrary model entailment

coincide, i.e., for every L-theory T and every L-formula ϕ, we find that ϕ is true in all models of T if and only if ϕ is true in all finite models of T .

  • 1. Give an example for a proper fragment of first-order logic with this property.
  • 2. Give an example for a proper fragment of first-order logic without this property.
  • 3. Show that entailment is decidable in any fragment with this property.

Solution.

  • 1. First-order formulae of the form ∃x. ∀y. ϕ[x, y] without function symbols.
  • 2. First-order formulae where predicate symbols have arity at most two.

5 / 49

slide-6
SLIDE 6

Exercise 1

  • Exercise. Let L be a fragment of first-order logic for which finite model entailment and arbitrary model entailment

coincide, i.e., for every L-theory T and every L-formula ϕ, we find that ϕ is true in all models of T if and only if ϕ is true in all finite models of T .

  • 1. Give an example for a proper fragment of first-order logic with this property.
  • 2. Give an example for a proper fragment of first-order logic without this property.
  • 3. Show that entailment is decidable in any fragment with this property.

Solution.

  • 1. First-order formulae of the form ∃x. ∀y. ϕ[x, y] without function symbols.
  • 2. First-order formulae where predicate symbols have arity at most two.
  • 3. Consider an L-theory T and an L-formula ϕ. Does T |= ϕ hold?

◮ Use any of the sound and complete deduction calculi for first-order logic, e.g., Resolution, Tableaux, etc., to check if T |= ϕ.

6 / 49

slide-7
SLIDE 7

Exercise 1

  • Exercise. Let L be a fragment of first-order logic for which finite model entailment and arbitrary model entailment

coincide, i.e., for every L-theory T and every L-formula ϕ, we find that ϕ is true in all models of T if and only if ϕ is true in all finite models of T .

  • 1. Give an example for a proper fragment of first-order logic with this property.
  • 2. Give an example for a proper fragment of first-order logic without this property.
  • 3. Show that entailment is decidable in any fragment with this property.

Solution.

  • 1. First-order formulae of the form ∃x. ∀y. ϕ[x, y] without function symbols.
  • 2. First-order formulae where predicate symbols have arity at most two.
  • 3. Consider an L-theory T and an L-formula ϕ. Does T |= ϕ hold?

◮ Use any of the sound and complete deduction calculi for first-order logic, e.g., Resolution, Tableaux, etc., to check if T |= ϕ. ◮ Otherwise, for increasingly larger k ≥ 1, construct all possible T -models M of size k and check M |= ϕ.

7 / 49

slide-8
SLIDE 8

Exercise 1

  • Exercise. Let L be a fragment of first-order logic for which finite model entailment and arbitrary model entailment

coincide, i.e., for every L-theory T and every L-formula ϕ, we find that ϕ is true in all models of T if and only if ϕ is true in all finite models of T .

  • 1. Give an example for a proper fragment of first-order logic with this property.
  • 2. Give an example for a proper fragment of first-order logic without this property.
  • 3. Show that entailment is decidable in any fragment with this property.

Solution.

  • 1. First-order formulae of the form ∃x. ∀y. ϕ[x, y] without function symbols.
  • 2. First-order formulae where predicate symbols have arity at most two.
  • 3. Consider an L-theory T and an L-formula ϕ. Does T |= ϕ hold?

◮ Use any of the sound and complete deduction calculi for first-order logic, e.g., Resolution, Tableaux, etc., to check if T |= ϕ. ◮ Otherwise, for increasingly larger k ≥ 1, construct all possible T -models M of size k and check M |= ϕ. ◮ One of these two procedures will terminate; run them in parallel.

8 / 49

slide-9
SLIDE 9

Exercise 2

Consider the following set of tgds Σ: A(x) → ∃y. R(x, y) ∧ B(y) B(x) → ∃y. S(x, y) ∧ A(y) R(x, y) → S(y, x) S(x, y) → R(y, x) Does the oblivious chase universally terminate for Σ? What about the restricted chase?

9 / 49

slide-10
SLIDE 10

Exercise 2

Consider the following set of tgds Σ: A(x) → ∃y. R(x, y) ∧ B(y) B(x) → ∃y. S(x, y) ∧ A(y) R(x, y) → S(y, x) S(x, y) → R(y, x) Does the oblivious chase universally terminate for Σ? What about the restricted chase? Solution.

10 / 49

slide-11
SLIDE 11

Exercise 2

Consider the following set of tgds Σ: A(x) → ∃y. R(x, y) ∧ B(y) B(x) → ∃y. S(x, y) ∧ A(y) R(x, y) → S(y, x) S(x, y) → R(y, x) Does the oblivious chase universally terminate for Σ? What about the restricted chase? Solution. ◮ No, the oblivious chase does not universally terminate for Σ. In particular, it does not terminate on the critical instance I⋆.

11 / 49

slide-12
SLIDE 12

Exercise 2

Consider the following set of tgds Σ: A(x) → ∃y. R(x, y) ∧ B(y) B(x) → ∃y. S(x, y) ∧ A(y) R(x, y) → S(y, x) S(x, y) → R(y, x) Does the oblivious chase universally terminate for Σ? What about the restricted chase? Solution. ◮ No, the oblivious chase does not universally terminate for Σ. In particular, it does not terminate on the critical instance I⋆. ◮ No, the restricted chase does not, in general, universally terminate for Σ either.

12 / 49

slide-13
SLIDE 13

Exercise 2

Consider the following set of tgds Σ: A(x) → ∃y. R(x, y) ∧ B(y) B(x) → ∃y. S(x, y) ∧ A(y) R(x, y) → S(y, x) S(x, y) → R(y, x) Does the oblivious chase universally terminate for Σ? What about the restricted chase? Solution. ◮ No, the oblivious chase does not universally terminate for Σ. In particular, it does not terminate on the critical instance I⋆. ◮ No, the restricted chase does not, in general, universally terminate for Σ either. ◮ However, if the full dependencies are prioritised in the restricted chase, then the chase terminates on all database instances.

13 / 49

slide-14
SLIDE 14

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ?

14 / 49

slide-15
SLIDE 15

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

15 / 49

slide-16
SLIDE 16

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge.

16 / 49

slide-17
SLIDE 17

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge. A, 1 B, 1 C, 1 R, 1 R, 2 S, 1 S, 2

17 / 49

slide-18
SLIDE 18

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge. A, 1 B, 1 C, 1 R, 1 R, 2 S, 1 S, 2

18 / 49

slide-19
SLIDE 19

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge. A, 1 B, 1 C, 1 R, 1 R, 2 S, 1 S, 2

19 / 49

slide-20
SLIDE 20

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge. A, 1 B, 1 C, 1 R, 1 R, 2 S, 1 S, 2

20 / 49

slide-21
SLIDE 21

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge. A, 1 B, 1 C, 1 R, 1 R, 2 S, 1 S, 2

21 / 49

slide-22
SLIDE 22

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge. A, 1 B, 1 C, 1 R, 1 R, 2 S, 1 S, 2

22 / 49

slide-23
SLIDE 23

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge. A, 1 B, 1 C, 1 R, 1 R, 2 S, 1 S, 2

23 / 49

slide-24
SLIDE 24

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge. A, 1 B, 1 C, 1 R, 1 R, 2 S, 1 S, 2

24 / 49

slide-25
SLIDE 25

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge. A, 1 B, 1 C, 1 R, 1 R, 2 S, 1 S, 2

25 / 49

slide-26
SLIDE 26

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge. A, 1 B, 1 C, 1 R, 1 R, 2 S, 1 S, 2

26 / 49

slide-27
SLIDE 27

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge. A, 1 B, 1 C, 1 R, 1 R, 2 S, 1 S, 2

  • 1. Since A, 1 =⇒ B, 1 −→ A, 1 is a cycle

involving a special edge, Σ is not weakly acyclic.

27 / 49

slide-28
SLIDE 28

Exercise 3

  • Exercise. Is the following set of tgds Σ weakly acyclic?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y) Does the skolem chase universally terminate for Σ? Solution.

Definition (Weak Acyclicity, Lecture 18, slide 19)

A predicate position is a pair p, i with p a predicate symbol and 1 ≤ i ≤ arity(p). For an atom p(t1, . . . , tn), the term at position p, i is ti. The dependency graph of a tgd set Σ has the set of all positions in predicates of Σ as its nodes. For every rule ρ, and every variable x at position p, i in the head of ρ, the graph contains the following edges: ◮ If x is universally quantified and occurs at position q, j in the body of ρ, then there is an edge q, j → p, i. ◮ If x is existentially quantified and another variable y occurs at position q, j in the body of ρ, then there is a special edge q, j ⇒ p, i. Σ is weakly acyclic if its dependency graph does not contain a cycle that involves a special edge. A, 1 B, 1 C, 1 R, 1 R, 2 S, 1 S, 2

  • 1. Since A, 1 =⇒ B, 1 −→ A, 1 is a cycle

involving a special edge, Σ is not weakly acyclic.

  • 2. The skolem chase for Σ terminates on the

critical instance I⋆, therefore it terminates universally.

28 / 49

slide-29
SLIDE 29

Exercise 4

Termination of the oblivious (resp. restricted) chase over a set of tgds Σ implies the existence of a finite universal model for Σ. Is the converse true? That is, does the existence of a finite universal model for Σ imply termination of the

  • blivious (resp. restricted) chase?

29 / 49

slide-30
SLIDE 30

Exercise 4

Termination of the oblivious (resp. restricted) chase over a set of tgds Σ implies the existence of a finite universal model for Σ. Is the converse true? That is, does the existence of a finite universal model for Σ imply termination of the

  • blivious (resp. restricted) chase?

Solution.

30 / 49

slide-31
SLIDE 31

Exercise 4

Termination of the oblivious (resp. restricted) chase over a set of tgds Σ implies the existence of a finite universal model for Σ. Is the converse true? That is, does the existence of a finite universal model for Σ imply termination of the

  • blivious (resp. restricted) chase?

Solution. ◮ No, consider, e.g., Σ = {A(x) → ∃y. R(x, y) ∧ A(y), → ∃x. A(x)}.

31 / 49

slide-32
SLIDE 32

Exercise 4

Termination of the oblivious (resp. restricted) chase over a set of tgds Σ implies the existence of a finite universal model for Σ. Is the converse true? That is, does the existence of a finite universal model for Σ imply termination of the

  • blivious (resp. restricted) chase?

Solution. ◮ No, consider, e.g., Σ = {A(x) → ∃y. R(x, y) ∧ A(y), → ∃x. A(x)}. ◮ M = {A(n), R(n, n)} with n a null is a finite universal model of Σ.

32 / 49

slide-33
SLIDE 33

Exercise 4

Termination of the oblivious (resp. restricted) chase over a set of tgds Σ implies the existence of a finite universal model for Σ. Is the converse true? That is, does the existence of a finite universal model for Σ imply termination of the

  • blivious (resp. restricted) chase?

Solution. ◮ No, consider, e.g., Σ = {A(x) → ∃y. R(x, y) ∧ A(y), → ∃x. A(x)}. ◮ M = {A(n), R(n, n)} with n a null is a finite universal model of Σ. ◮ However, neither the oblivious nor the restricted chase for Σ terminates on the empty database instance.

33 / 49

slide-34
SLIDE 34

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

34 / 49

slide-35
SLIDE 35

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution.

35 / 49

slide-36
SLIDE 36

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ.

36 / 49

slide-37
SLIDE 37

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase:

37 / 49

slide-38
SLIDE 38

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase: ◮ If, at any point, a cyclic term appears, we know that Σ is not MFA.

38 / 49

slide-39
SLIDE 39

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase: ◮ If, at any point, a cyclic term appears, we know that Σ is not MFA. ◮ If the chase terminates without generating a cyclic term, we know that Σ is MFA.

39 / 49

slide-40
SLIDE 40

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase: ◮ If, at any point, a cyclic term appears, we know that Σ is not MFA. ◮ If the chase terminates without generating a cyclic term, we know that Σ is MFA. ◮ If the chase does not terminate within ℓ steps, it must generate a cyclic term at some point, thus Σ is not MFA.

40 / 49

slide-41
SLIDE 41

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase: ◮ If, at any point, a cyclic term appears, we know that Σ is not MFA. ◮ If the chase terminates without generating a cyclic term, we know that Σ is MFA. ◮ If the chase does not terminate within ℓ steps, it must generate a cyclic term at some point, thus Σ is not MFA.

2.

◮ Critical instance I⋆ = {A(⋆), B(⋆), C(⋆), S(⋆, ⋆), R(⋆, ⋆)}.

41 / 49

slide-42
SLIDE 42

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase: ◮ If, at any point, a cyclic term appears, we know that Σ is not MFA. ◮ If the chase terminates without generating a cyclic term, we know that Σ is MFA. ◮ If the chase does not terminate within ℓ steps, it must generate a cyclic term at some point, thus Σ is not MFA.

2.

◮ Critical instance I⋆ = {A(⋆), B(⋆), C(⋆), S(⋆, ⋆), R(⋆, ⋆)}. ◮ Chase for Σ ∪ I⋆: { } ∪ I⋆

42 / 49

slide-43
SLIDE 43

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase: ◮ If, at any point, a cyclic term appears, we know that Σ is not MFA. ◮ If the chase terminates without generating a cyclic term, we know that Σ is MFA. ◮ If the chase does not terminate within ℓ steps, it must generate a cyclic term at some point, thus Σ is not MFA.

2.

◮ Critical instance I⋆ = {A(⋆), B(⋆), C(⋆), S(⋆, ⋆), R(⋆, ⋆)}. ◮ Chase for Σ ∪ I⋆: {S(⋆, f(⋆)) } ∪ I⋆

43 / 49

slide-44
SLIDE 44

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase: ◮ If, at any point, a cyclic term appears, we know that Σ is not MFA. ◮ If the chase terminates without generating a cyclic term, we know that Σ is MFA. ◮ If the chase does not terminate within ℓ steps, it must generate a cyclic term at some point, thus Σ is not MFA.

2.

◮ Critical instance I⋆ = {A(⋆), B(⋆), C(⋆), S(⋆, ⋆), R(⋆, ⋆)}. ◮ Chase for Σ ∪ I⋆: {S(⋆, f(⋆)), R(⋆, g(⋆)), B(g(⋆)) } ∪ I⋆

44 / 49

slide-45
SLIDE 45

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase: ◮ If, at any point, a cyclic term appears, we know that Σ is not MFA. ◮ If the chase terminates without generating a cyclic term, we know that Σ is MFA. ◮ If the chase does not terminate within ℓ steps, it must generate a cyclic term at some point, thus Σ is not MFA.

2.

◮ Critical instance I⋆ = {A(⋆), B(⋆), C(⋆), S(⋆, ⋆), R(⋆, ⋆)}. ◮ Chase for Σ ∪ I⋆: {S(⋆, f(⋆)), R(⋆, g(⋆)), B(g(⋆)), S(g(⋆), f(g(⋆))), A(g(⋆))} ∪ I⋆

45 / 49

slide-46
SLIDE 46

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase: ◮ If, at any point, a cyclic term appears, we know that Σ is not MFA. ◮ If the chase terminates without generating a cyclic term, we know that Σ is MFA. ◮ If the chase does not terminate within ℓ steps, it must generate a cyclic term at some point, thus Σ is not MFA.

2.

◮ Critical instance I⋆ = {A(⋆), B(⋆), C(⋆), S(⋆, ⋆), R(⋆, ⋆)}. ◮ Chase for Σ ∪ I⋆: {S(⋆, f(⋆)), R(⋆, g(⋆)), B(g(⋆)), S(g(⋆), f(g(⋆))), A(g(⋆))} ∪ I⋆ ◮ No cyclic terms, so Σ is MFA.

46 / 49

slide-47
SLIDE 47

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase: ◮ If, at any point, a cyclic term appears, we know that Σ is not MFA. ◮ If the chase terminates without generating a cyclic term, we know that Σ is MFA. ◮ If the chase does not terminate within ℓ steps, it must generate a cyclic term at some point, thus Σ is not MFA.

2.

◮ Critical instance I⋆ = {A(⋆), B(⋆), C(⋆), S(⋆, ⋆), R(⋆, ⋆)}. ◮ Chase for Σ ∪ I⋆: {S(⋆, f(⋆)), R(⋆, g(⋆)), B(g(⋆)), S(g(⋆), f(g(⋆))), A(g(⋆))} ∪ I⋆ ◮ No cyclic terms, so Σ is MFA.

3.

◮ Since Σ is MFA, the skolem chase for Σ on I⋆ contains no cyclic terms.

47 / 49

slide-48
SLIDE 48

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase: ◮ If, at any point, a cyclic term appears, we know that Σ is not MFA. ◮ If the chase terminates without generating a cyclic term, we know that Σ is MFA. ◮ If the chase does not terminate within ℓ steps, it must generate a cyclic term at some point, thus Σ is not MFA.

2.

◮ Critical instance I⋆ = {A(⋆), B(⋆), C(⋆), S(⋆, ⋆), R(⋆, ⋆)}. ◮ Chase for Σ ∪ I⋆: {S(⋆, f(⋆)), R(⋆, g(⋆)), B(g(⋆)), S(g(⋆), f(g(⋆))), A(g(⋆))} ∪ I⋆ ◮ No cyclic terms, so Σ is MFA.

3.

◮ Since Σ is MFA, the skolem chase for Σ on I⋆ contains no cyclic terms. ◮ Since the number of non-cyclic terms is bounded, the chase must be finite.

48 / 49

slide-49
SLIDE 49

Exercise 5

Consider a set of tgds Σ that does not contain any constants. A term is cyclic if it is of the form f(t1, . . . , tn) and, for some i ∈ {1, . . . , n}, the function symbol f syntactically occurs in ti. Then Σ is model-faithful acyclic (MFA) iff no cyclic term occurs in the skolem chase of Σ ∪ I⋆, where I⋆ is the critical instance. Show the following claims:

  • 1. Checking MFA membership is decidable.
  • 2. Is the set of tgds from Exercise 12.3 MFA?

B(x) → ∃y. S(x, y) ∧ A(x) A(x) ∧ C(x) → ∃y. R(x, y) ∧ B(y)

  • 3. If a set of tgds Σ without constants is MFA, then the skolem chose universally terminates for Σ.

Solution. 1.

◮ For a fixed set Σ of tgds, the number of non-cyclic terms over the signature is (double-exponentially) bounded; call this bound ℓ. ◮ We can therefore decide MFA membership by computing the chase: ◮ If, at any point, a cyclic term appears, we know that Σ is not MFA. ◮ If the chase terminates without generating a cyclic term, we know that Σ is MFA. ◮ If the chase does not terminate within ℓ steps, it must generate a cyclic term at some point, thus Σ is not MFA.

2.

◮ Critical instance I⋆ = {A(⋆), B(⋆), C(⋆), S(⋆, ⋆), R(⋆, ⋆)}. ◮ Chase for Σ ∪ I⋆: {S(⋆, f(⋆)), R(⋆, g(⋆)), B(g(⋆)), S(g(⋆), f(g(⋆))), A(g(⋆))} ∪ I⋆ ◮ No cyclic terms, so Σ is MFA.

3.

◮ Since Σ is MFA, the skolem chase for Σ on I⋆ contains no cyclic terms. ◮ Since the number of non-cyclic terms is bounded, the chase must be finite. ◮ The skolem chase for Σ on the critical instance terminates, therefore the skolem chase for Σ is universally terminating.

49 / 49