the power of the terminating chase
play

THE POWER OF THE TERMINATING CHASE Markus Krtzsch Maximilian Marx - PowerPoint PPT Presentation

THE POWER OF THE TERMINATING CHASE Markus Krtzsch Maximilian Marx Sebastian Rudolph TU Dresden Download Paper Lisbon, ICDT 2019 Invited Tutorial Fig. 1: The Chase Part 1: Tuple-Generating Dependencies Part 1: Existential Rules


  1. ✱ ✱ ✳ ✱ ✱ ✱ ✱ ✱ ✱ ✳ ✱ Reasoning for existential rules is difficult Theorem: Query entailment under constraints is undecidable (but recursively enumerable). There is a fixed rule set Σ and BCQ q , such that {D | Σ ✱ D | = q } is undecidable. Proof (sketch): Use a standard encoding of a Turing machine in logical rules, and apply it to a universal Turing machine. Existential quantifiers are used to create new memory cells and time points. � Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 11 of 54

  2. Reasoning for existential rules is difficult Theorem: Query entailment under constraints is undecidable (but recursively enumerable). There is a fixed rule set Σ and BCQ q , such that {D | Σ ✱ D | = q } is undecidable. Proof (sketch): Use a standard encoding of a Turing machine in logical rules, and apply it to a universal Turing machine. Existential quantifiers are used to create new memory cells and time points. � This also implies that we cannot restrict to finite models. Example: Consider a database r ( a ✱ b ) with constraints r ( x ✱ y ) → ∃ z ✳ r ( y ✱ z ) r ( x ✱ y ) → t ( x ✱ y ) t ( x ✱ y ) ∧ r ( y ✱ z ) → t ( x ✱ z ) The BCQ ∃ x ✳ t ( x ✱ x ) is not entailed by this theory, but it holds in all finite models. Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 11 of 54

  3. Universal models Certain answer semantics: What is true in all models? But it is often enough to consider “most general models”: Definition: A model I of a set of rules Σ is universal if it admits a homomor- phism h : I → J to every model J of Σ . Fact: The BCQs entailed by rule set Σ are exactly the BCQs that hold true on any of its universal models. (The same works for all query languages whose models are closed under homomorphisms) Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 12 of 54

  4. Decidable fragments In the search for decidable fragments, several main principles have been explored: • Finite models: there is a finite universal model – full dependencies (no ∃ ) – many acyclicity notions (more on this later) • Tree-like models: there is universal model of bounded treewidth – Guarded rules – Frontier-guarded rules • Rewritability: entailment can be reduced to first-order model checking – Linear tgds – Sticky rules None of the general criteria are decidable, but the concrete conditions are. Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 13 of 54

  5. Part 2: The Chase

  6. Applying a rule Database D Rule ρ = ϕ [ x ✱ y ] → ∃ z ✳ ψ [ x ✱ z ] Definition: Rule ρ is applicable to D if: 1. there is a function h : x ∪ y → adom ( D ) such that h ( ϕ ) ⊆ D (a match) 2. there is no function h ′ : x ∪ z → adom ( D ) with h ′ ( x ) = h ( x ) for all x ∈ x and h ′ ( ψ ) ⊆ D The D ′ is the result of applying ρ to D under h if D ′ = D ∪ ˆ h ( ψ ) and: • ˆ h ( x ) = h ( x ) for all x ∈ x • ˆ h ( z ) is a fresh null for all z ∈ z Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 15 of 54

  7. The Chase(s) A chase constructs a sequence of databases D 0 = D ✱ D 1 ✱ D 2 ✱ . . . by applying rules. The Standard Chase (a.k.a. restricted chase) • Apply rules to matches in some order (strategy) The Skolem Chase (a.k.a. semi-oblivious chase) • Apply skolemised rules (in any order) The Datalog-first Chase • Apply rules to matches in some order that prioritises the application of rules without existential quantifiers Other prominent chases: oblivious chase and core chase Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 16 of 54

  8. ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 17 of 54

  9. ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the standard chase may yield: Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 17 of 54

  10. ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the standard chase may yield: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 17 of 54

  11. ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the standard chase may yield: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 17 of 54

  12. ✱ ✱ ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the standard chase may yield: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } D 3 = D 2 ∪ { properPartOf ( n 1 ✱ n 2 ) ✱ Bicycle ( n 2 ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 17 of 54

  13. ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the standard chase may yield: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } D 3 = D 2 ∪ { properPartOf ( n 1 ✱ n 2 ) ✱ Bicycle ( n 2 ) } D 4 = D 3 ∪ { hasPart ( n 2 ✱ n 3 ) ✱ Wheel ( n 3 ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 17 of 54

  14. ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the standard chase may yield: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 5 = D 4 ∪ { partOf ( n 1 ✱ n 2 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } D 3 = D 2 ∪ { properPartOf ( n 1 ✱ n 2 ) ✱ Bicycle ( n 2 ) } D 4 = D 3 ∪ { hasPart ( n 2 ✱ n 3 ) ✱ Wheel ( n 3 ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 17 of 54

  15. ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the standard chase may yield: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 5 = D 4 ∪ { partOf ( n 1 ✱ n 2 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } D 6 = D 5 ∪ { hasPart ( n 2 ✱ n 1 ) } D 3 = D 2 ∪ { properPartOf ( n 1 ✱ n 2 ) ✱ Bicycle ( n 2 ) } D 4 = D 3 ∪ { hasPart ( n 2 ✱ n 3 ) ✱ Wheel ( n 3 ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 17 of 54

  16. ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the standard chase may yield: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 5 = D 4 ∪ { partOf ( n 1 ✱ n 2 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } D 6 = D 5 ∪ { hasPart ( n 2 ✱ n 1 ) } D 3 = D 2 ∪ { properPartOf ( n 1 ✱ n 2 ) ✱ Bicycle ( n 2 ) } D 7 = D 6 ∪ { partOf ( n 3 ✱ n 2 ) } D 4 = D 3 ∪ { hasPart ( n 2 ✱ n 3 ) ✱ Wheel ( n 3 ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 17 of 54

  17. Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the standard chase may yield: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 5 = D 4 ∪ { partOf ( n 1 ✱ n 2 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } D 6 = D 5 ∪ { hasPart ( n 2 ✱ n 1 ) } D 3 = D 2 ∪ { properPartOf ( n 1 ✱ n 2 ) ✱ Bicycle ( n 2 ) } D 7 = D 6 ∪ { partOf ( n 3 ✱ n 2 ) } D 4 = D 3 ∪ { hasPart ( n 2 ✱ n 3 ) ✱ Wheel ( n 3 ) } D 8 = D 7 ∪ { partOf ( n 3 ✱ n 4 ) ✱ Bicycle ( n 4 ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 17 of 54

  18. Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the standard chase may yield: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 5 = D 4 ∪ { partOf ( n 1 ✱ n 2 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } D 6 = D 5 ∪ { hasPart ( n 2 ✱ n 1 ) } D 3 = D 2 ∪ { properPartOf ( n 1 ✱ n 2 ) ✱ Bicycle ( n 2 ) } D 7 = D 6 ∪ { partOf ( n 3 ✱ n 2 ) } D 4 = D 3 ∪ { hasPart ( n 2 ✱ n 3 ) ✱ Wheel ( n 3 ) } D 8 = D 7 ∪ { partOf ( n 3 ✱ n 4 ) ✱ Bicycle ( n 4 ) } The chase can continue forever . . . Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 17 of 54

  19. ✱ ✱ ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 18 of 54

  20. ✱ ✱ ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the Datalog-first chase yields: Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 18 of 54

  21. ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the Datalog-first chase yields: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 18 of 54

  22. ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the Datalog-first chase yields: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 18 of 54

  23. ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the Datalog-first chase yields: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } D 3 = D 2 ∪ { properPartOf ( n 1 ✱ n 2 ) ✱ Bicycle ( n 2 ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 18 of 54

  24. ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the Datalog-first chase yields: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } D 3 = D 2 ∪ { properPartOf ( n 1 ✱ n 2 ) ✱ Bicycle ( n 2 ) } D 4 = D 3 ∪ { partOf ( n 1 ✱ n 2 ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 18 of 54

  25. Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the Datalog-first chase yields: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 5 = D 4 ∪ { hasPart ( n 2 ✱ n 1 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } D 3 = D 2 ∪ { properPartOf ( n 1 ✱ n 2 ) ✱ Bicycle ( n 2 ) } D 4 = D 3 ∪ { partOf ( n 1 ✱ n 2 ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 18 of 54

  26. Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → ∃ v ✳ hasPart ( x ✱ v ) ∧ Wheel ( v ) Wheel ( x ) → ∃ w ✳ properPartOf ( x ✱ w ) ∧ Bicycle ( w ) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the Datalog-first chase yields: D 1 = D ∪ { hasPart ( c ✱ n 1 ) ✱ Wheel ( n 1 ) } D 5 = D 4 ∪ { hasPart ( n 2 ✱ n 1 ) } D 2 = D 1 ∪ { partOf ( n 1 ✱ c ) } D 3 = D 2 ∪ { properPartOf ( n 1 ✱ n 2 ) ✱ Bicycle ( n 2 ) } D 4 = D 3 ∪ { partOf ( n 1 ✱ n 2 ) } No further rules are applicable. The chase terminates. Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 18 of 54

  27. ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → hasPart ( x ✱ w ( x )) ∧ Wheel ( w ( x )) Wheel ( x ) → properPartOf ( x ✱ b ( w )) ∧ Bicycle ( b ( w )) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 19 of 54

  28. ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → hasPart ( x ✱ w ( x )) ∧ Wheel ( w ( x )) Wheel ( x ) → properPartOf ( x ✱ b ( w )) ∧ Bicycle ( b ( w )) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the skolem chase yields: Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 19 of 54

  29. ✱ ✱ ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → hasPart ( x ✱ w ( x )) ∧ Wheel ( w ( x )) Wheel ( x ) → properPartOf ( x ✱ b ( w )) ∧ Bicycle ( b ( w )) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the skolem chase yields: D 1 = D ∪ { hasPart ( c ✱ w ( c )) ✱ Wheel ( w ( c )) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 19 of 54

  30. ✱ ✱ ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → hasPart ( x ✱ w ( x )) ∧ Wheel ( w ( x )) Wheel ( x ) → properPartOf ( x ✱ b ( w )) ∧ Bicycle ( b ( w )) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the skolem chase yields: D 1 = D ∪ { hasPart ( c ✱ w ( c )) ✱ Wheel ( w ( c )) } D 2 = D 1 ∪ { partOf ( w ( c ) ✱ c ) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 19 of 54

  31. ✱ ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → hasPart ( x ✱ w ( x )) ∧ Wheel ( w ( x )) Wheel ( x ) → properPartOf ( x ✱ b ( w )) ∧ Bicycle ( b ( w )) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the skolem chase yields: D 1 = D ∪ { hasPart ( c ✱ w ( c )) ✱ Wheel ( w ( c )) } D 2 = D 1 ∪ { partOf ( w ( c ) ✱ c ) } D 3 = D 2 ∪ { properPartOf ( w ( c ) ✱ b ( w ( c ))) ✱ Bicycle ( b ( w ( c ))) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 19 of 54

  32. ✱ ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → hasPart ( x ✱ w ( x )) ∧ Wheel ( w ( x )) Wheel ( x ) → properPartOf ( x ✱ b ( w )) ∧ Bicycle ( b ( w )) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the skolem chase yields: D 1 = D ∪ { hasPart ( c ✱ w ( c )) ✱ Wheel ( w ( c )) } D 4 = D 3 ∪ { partOf ( w ( c ) ✱ b ( w ( c ))) } D 2 = D 1 ∪ { partOf ( w ( c ) ✱ c ) } D 3 = D 2 ∪ { properPartOf ( w ( c ) ✱ b ( w ( c ))) ✱ Bicycle ( b ( w ( c ))) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 19 of 54

  33. ✱ ✱ Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → hasPart ( x ✱ w ( x )) ∧ Wheel ( w ( x )) Wheel ( x ) → properPartOf ( x ✱ b ( w )) ∧ Bicycle ( b ( w )) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the skolem chase yields: D 1 = D ∪ { hasPart ( c ✱ w ( c )) ✱ Wheel ( w ( c )) } D 4 = D 3 ∪ { partOf ( w ( c ) ✱ b ( w ( c ))) } D 2 = D 1 ∪ { partOf ( w ( c ) ✱ c ) } D 5 = D 4 ∪ { hasPart ( b ( w ( c )) ✱ w ( c )) } D 3 = D 2 ∪ { properPartOf ( w ( c ) ✱ b ( w ( c ))) ✱ Bicycle ( b ( w ( c ))) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 19 of 54

  34. Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → hasPart ( x ✱ w ( x )) ∧ Wheel ( w ( x )) Wheel ( x ) → properPartOf ( x ✱ b ( w )) ∧ Bicycle ( b ( w )) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the skolem chase yields: D 1 = D ∪ { hasPart ( c ✱ w ( c )) ✱ Wheel ( w ( c )) } D 4 = D 3 ∪ { partOf ( w ( c ) ✱ b ( w ( c ))) } D 2 = D 1 ∪ { partOf ( w ( c ) ✱ c ) } D 5 = D 4 ∪ { hasPart ( b ( w ( c )) ✱ w ( c )) } D 3 = D 2 ∪ { properPartOf ( w ( c ) ✱ b ( w ( c ))) ✱ D 6 = D 5 ∪ { hasPart ( b ( w ( c )) ✱ w ( b ( w ( c )))) ✱ Bicycle ( b ( w ( c ))) } Wheel ( w ( b ( w ( c )))) } Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 19 of 54

  35. Will it terminate? D = { Bicycle ( c ) } Bicycle ( x ) → hasPart ( x ✱ w ( x )) ∧ Wheel ( w ( x )) Wheel ( x ) → properPartOf ( x ✱ b ( w )) ∧ Bicycle ( b ( w )) properPartOf ( x ✱ y ) → partOf ( x ✱ y ) hasPart ( x ✱ y ) → partOf ( y ✱ x ) partOf ( x ✱ y ) → hasPart ( y ✱ x ) Applying the skolem chase yields: D 1 = D ∪ { hasPart ( c ✱ w ( c )) ✱ Wheel ( w ( c )) } D 4 = D 3 ∪ { partOf ( w ( c ) ✱ b ( w ( c ))) } D 2 = D 1 ∪ { partOf ( w ( c ) ✱ c ) } D 5 = D 4 ∪ { hasPart ( b ( w ( c )) ✱ w ( c )) } D 3 = D 2 ∪ { properPartOf ( w ( c ) ✱ b ( w ( c ))) ✱ D 6 = D 5 ∪ { hasPart ( b ( w ( c )) ✱ w ( b ( w ( c )))) ✱ Bicycle ( b ( w ( c ))) } Wheel ( w ( b ( w ( c )))) } The chase will certainly continue forever . . . Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 19 of 54

  36. Chase termination Some observations: • Termination is strategy-dependent for standard and Datalog-first chase, but not for skolem chase • Whenever skolem chase terminates, standard chase terminates for all strategies • Whenever standard chase terminates (for some/all strategies), Datalog-first chase terminates (for all/some strategies) • Termination always depends on the concrete database instance Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 20 of 54

  37. Chase termination Some observations: • Termination is strategy-dependent for standard and Datalog-first chase, but not for skolem chase • Whenever skolem chase terminates, standard chase terminates for all strategies • Whenever standard chase terminates (for some/all strategies), Datalog-first chase terminates (for all/some strategies) • Termination always depends on the concrete database instance We can define rule classes based on their termination behaviour: Termination on . . . instance D all instances CT sk CT sk Skolem chase D ∀ CT std CT std Standard chase (all strategies) D∀ ∀∀ CT dlf CT dlf Datalog-first chase (all strategies) D∀ ∀∀ Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 20 of 54

  38. The chase termination problem Theorem (Gogacz & Marcinkowski, ICALP’14; Grahne & Onet, Fund.Inf.’18): The classes CT x D ( ∀ ) and CT x ∀ ( ∀ ) are undecidable for all x ∈ { sk ✱ std ✱ dlf } . Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 21 of 54

  39. The chase termination problem Theorem (Gogacz & Marcinkowski, ICALP’14; Grahne & Onet, Fund.Inf.’18): The classes CT x D ( ∀ ) and CT x ∀ ( ∀ ) are undecidable for all x ∈ { sk ✱ std ✱ dlf } . The cases CT x D ( ∀ ) are simple: • Simulate a Turing machine in a standard encoding • Halting reduces to chase termination These cases are recursively enumerable (r.e.). Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 21 of 54

  40. The chase termination problem Theorem (Gogacz & Marcinkowski, ICALP’14; Grahne & Onet, Fund.Inf.’18): The classes CT x D ( ∀ ) and CT x ∀ ( ∀ ) are undecidable for all x ∈ { sk ✱ std ✱ dlf } . The cases CT x D ( ∀ ) are simple: • Simulate a Turing machine in a standard encoding • Halting reduces to chase termination These cases are recursively enumerable (r.e.). Membership of CT sk ∀ in r.e. is also simple, due to the following result [Marnette, PODS’09]: D ∗ , where D ∗ is the critical instance Proposition: Σ ∈ CT sk ∀ if and only if Σ ∈ CT sk consisting of all atoms that can be stated over the signature using constants from Σ and an additional constant ∗ . Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 21 of 54

  41. Universal chase termination Hardness of CT sk ∀ is more tricky: how to simulate a Turing machine starting from D ∗ ? • Every conjunctive query already matches • It is difficult to apply rules in any orderly fashion Solved by [Gogacz & Marcinkowski, ICALP’14] (showing r.e.-completeness) Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 22 of 54

  42. Universal chase termination Hardness of CT sk ∀ is more tricky: how to simulate a Turing machine starting from D ∗ ? • Every conjunctive query already matches • It is difficult to apply rules in any orderly fashion Solved by [Gogacz & Marcinkowski, ICALP’14] (showing r.e.-completeness) The case of CT std ∀∀ (and with it CT dlf ∀∀ ) is more difficult. The critical instance is no longer relevant for all-instances termination: Observation: Every rule set is in CT std D ∗ . Indeed, CT std ∀∀ and CT dlf ∀∀ are no longer r.e., although the exact degree of their undecidability remains open. Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 22 of 54

  43. Decidable cases Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 23 of 54

  44. Decidable cases The (supposed) undecidability of chase termination has motivated significant research activities for finding sufficient termination criteria: • omega-restrictedness [Syrjänen, LPNMR 2001] • weak-acyclicity [Fagin et al., Theo. Comp. Sci. 2005] • lambda restrictedness [Gebser, Schaub, Thiele, LPNMR 2007] • finite domain [Calimeri et al. ICLP 2008] • super-weak acyclicity [Marnette, PODS 2009] • safety [Meier, Schmidt, & Lausen, Proc. VLDB 2009] • argument restrictedness [Lierler & Lifschitz, ICLP 2009] • joint acyclicity [MK & Rudolph, IJCAI 2011] • acyclic graph of rule dependencies [Baget et al., Artif. Intell. 2011] • Ω -acyclicity [Greco, Spezzano, & Trubitsyna, ICLP 2012] • model faithful & model summarising ayclicity [Cuenca Grau et al., J. Artif. Intell. Res. 2013] All of these criteria apply to CT sk ∀ . Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 23 of 54

  45. Chase variants in practice Standard chase rule applications are harder than skolem chase rule applications: • Skolem chase: guess match and verify absence of conclusions – NP • Standard chase: guess match and verify non-entailment of conclusion – NP NP ( = Σ 2 p ) Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 24 of 54

  46. Chase variants in practice Standard chase rule applications are harder than skolem chase rule applications: • Skolem chase: guess match and verify absence of conclusions – NP • Standard chase: guess match and verify non-entailment of conclusion – NP NP ( = Σ 2 p ) Nevertheless, the standard chase is implemented by many existential rule engines: • DEMo [Pichler & Savenkov, VLDB’09] • RDFox [Motik et al., AAAI’14] • Llunatic [Geerts et al., VLDB’14] • Pegasus [Meier, VLDB’14] • PDQ [Benedikt, Leblay, & Tsamoura, VLDB’14; VLDB’15] • Graal [Baget et al., RuleML ’15] • VLog [Urbani, Jacobs, & MK, AAAI’16; Urbani et al., IJCAR’18] See [Benedikt et al., PODS’17] and [Urbani et al., IJCAR’18] for recent benchmarks. Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 24 of 54

  47. Part 3: Expressivity

  48. ✱ ✳ Expressive power What is the expressive power of fragments of existential rules for which the chase terminates? Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 27 of 54

  49. ✱ ✳ Expressive power What is the expressive power of fragments of existential rules for which the chase terminates? Follow-up question: what is “expressive power”? Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 27 of 54

  50. Expressive power What is the expressive power of fragments of existential rules for which the chase terminates? Follow-up question: what is “expressive power”? � descriptive, not computational complexity Definition: Consider a finite signature R EDB of (extensional) database relations. An abstract query over R EDB is a set D of concrete databases over R EDB . A set of rules Σ and BCQ q realise D if, for every database D over R EDB , D ✱ Σ | = q exactly if D ∈ D ✳ where Σ and q may use additional relations beyond R EDB . � Expressivity = abstract queries that can be realised (by a rule fragment) Note: This is closer to the program view than to the ontology view. Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 27 of 54

  51. A note on Datalog Distinguishing extensional (EDB) and intensional (IDB) predicates is common for Datalog. Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 28 of 54

  52. A note on Datalog Distinguishing extensional (EDB) and intensional (IDB) predicates is common for Datalog. Datalog as Second-Order Language • EDB predicates = FO predicates; IDB prediates = SO variables • Query answering: Second-order model checking • Query containment et al.: undecidable Datalog as First-Order Language • EDB predicates = input predicates; IDB prediates = auxiliary/output predicates • Query answering: first-order entailment • Query containment et al.: decidable Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 28 of 54

  53. A note on Datalog Distinguishing extensional (EDB) and intensional (IDB) predicates is common for Datalog. Datalog as Second-Order Language • EDB predicates = FO predicates; IDB prediates = SO variables • Query answering: Second-order model checking • Query containment et al.: undecidable Datalog as First-Order Language • EDB predicates = input predicates; IDB prediates = auxiliary/output predicates • Query answering: first-order entailment • Query containment et al.: decidable We only use EDB predicates to define expressivity. Everything here is first order. Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 28 of 54

  54. ✱ ✱ ✱ ✱ Data complexity for CT sk ∀ Marnette [PODS 2009] showed the following general result: Theorem: For every Σ ∈ CT sk ∀ and concrete database D , the skolem chase over Σ and D is polynomial in the size of D . The data complexity of BCQ entailment over CT sk ∀ is PTime-complete. Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 29 of 54

  55. ✱ ✱ ✱ ✱ Data complexity for CT sk ∀ Marnette [PODS 2009] showed the following general result: Theorem: For every Σ ∈ CT sk ∀ and concrete database D , the skolem chase over Σ and D is polynomial in the size of D . The data complexity of BCQ entailment over CT sk ∀ is PTime-complete. Proof: There is a tuple-preserving mapping h from any database D to the critical instance D ∗ : • h ( c ) = c for all constants in Σ • h ( c ) = ∗ for all other constants h extends to function terms by setting h ( f ( c ) = f ( h ( c )) . Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 29 of 54

  56. ✱ ✱ Data complexity for CT sk ∀ Marnette [PODS 2009] showed the following general result: Theorem: For every Σ ∈ CT sk ∀ and concrete database D , the skolem chase over Σ and D is polynomial in the size of D . The data complexity of BCQ entailment over CT sk ∀ is PTime-complete. Proof: There is a tuple-preserving mapping h from any database D to the critical instance D ∗ : • h ( c ) = c for all constants in Σ • h ( c ) = ∗ for all other constants h extends to function terms by setting h ( f ( c ) = f ( h ( c )) . This extended mapping satisfies: r ( t ) ∈ chase sk ( Σ ✱ D ) implies r ( h ( t )) ∈ chase sk ( Σ ✱ D ∗ ) . Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 29 of 54

  57. Data complexity for CT sk ∀ Marnette [PODS 2009] showed the following general result: Theorem: For every Σ ∈ CT sk ∀ and concrete database D , the skolem chase over Σ and D is polynomial in the size of D . The data complexity of BCQ entailment over CT sk ∀ is PTime-complete. Proof: There is a tuple-preserving mapping h from any database D to the critical instance D ∗ : • h ( c ) = c for all constants in Σ • h ( c ) = ∗ for all other constants h extends to function terms by setting h ( f ( c ) = f ( h ( c )) . This extended mapping satisfies: r ( t ) ∈ chase sk ( Σ ✱ D ) implies r ( h ( t )) ∈ chase sk ( Σ ✱ D ∗ ) . In particular: the depth and structure of function terms in chase sk ( Σ ✱ D ) is restricted to the depth and structure of terms in chase sk ( Σ ✱ D ∗ ) . Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 29 of 54

  58. Data complexity for CT sk ∀ Marnette [PODS 2009] showed the following general result: Theorem: For every Σ ∈ CT sk ∀ and concrete database D , the skolem chase over Σ and D is polynomial in the size of D . The data complexity of BCQ entailment over CT sk ∀ is PTime-complete. Proof: There is a tuple-preserving mapping h from any database D to the critical instance D ∗ : • h ( c ) = c for all constants in Σ • h ( c ) = ∗ for all other constants h extends to function terms by setting h ( f ( c ) = f ( h ( c )) . This extended mapping satisfies: r ( t ) ∈ chase sk ( Σ ✱ D ) implies r ( h ( t )) ∈ chase sk ( Σ ✱ D ∗ ) . In particular: the depth and structure of function terms in chase sk ( Σ ✱ D ) is restricted to the depth and structure of terms in chase sk ( Σ ✱ D ∗ ) . The only data-dependent part are the additional constants in D : the number of distinct terms and tuples is polynomial in this respect. � Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 29 of 54

  59. ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ ✱ From CT sk ∀ to Datalog The previous insight can be taken further [MK & Rudolph IJCAI’11; Zhang, Zhang & You AAAI’15] ∀ and BCQ q , there is a set of Datalog rules Σ ′ and Theorem: For every Σ ∈ CT sk BCQ q ′ such that {D | D ✱ Σ | = q } = {D | D ✱ Σ ′ | = q ′ } . Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 30 of 54

  60. From CT sk ∀ to Datalog The previous insight can be taken further [MK & Rudolph IJCAI’11; Zhang, Zhang & You AAAI’15] ∀ and BCQ q , there is a set of Datalog rules Σ ′ and Theorem: For every Σ ∈ CT sk BCQ q ′ such that {D | D ✱ Σ | = q } = {D | D ✱ Σ ′ | = q ′ } . Proof (idea): The terms in any skolem chase over Σ are bounded in size. One can “flatten” such terms by increasing the arity of predicates, e.g., p ( f ( a ✱ b )) �→ ˆ p ( f ✱ a ✱ b ) Arities must be large enough to accommodate all possible terms, but unused positions can be filled by a special constant � , e.g., q ( f ( s ( a ✱ b ) ✱ t ( c ✱ d ))) �→ ˆ q ( f ✱ s ✱ a ✱ b ✱ t ✱ c ✱ d ) q ( f ( a ✱ g ( b ))) �→ ˆ q ( f ✱ a ✱ � ✱ � ✱ g ✱ b ✱ � ) It is easy to apply these replacements to rules and queries. � Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 30 of 54

  61. Discussion Summary: Essentially all known chase termination criteria recognise fragments of existential rules that are basically syntactic simplifications of Datalog. • Existential rules are usually more concise (flattening may incur exponential predicate arity) • Combined complexity is accordingly higher (typically 2ExpTime-complete) • But the expressive power is not more than Datalog Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 31 of 54

  62. Discussion Summary: Essentially all known chase termination criteria recognise fragments of existential rules that are basically syntactic simplifications of Datalog. • Existential rules are usually more concise (flattening may incur exponential predicate arity) • Combined complexity is accordingly higher (typically 2ExpTime-complete) • But the expressive power is not more than Datalog Thesis Previous research on chase termination is best motivated from an ontological view, while not leading to significant advances for using rules as declarative programs/queries. Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 31 of 54

  63. ✱ ✱ ✱ ✱ ✱ ✱ Beyond P Surprisingly, this severe restriction in expressivity is specific to the skolem chase: Theorem: There is a rule set Σ ∈ CT dlf ∀∀ and a BCQ q that express a non-elementary Boolean query. Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 32 of 54

  64. ✱ ✱ ✱ ✱ ✱ ✱ Beyond P Surprisingly, this severe restriction in expressivity is specific to the skolem chase: Theorem: There is a rule set Σ ∈ CT dlf ∀∀ and a BCQ q that express a non-elementary Boolean query. Proof: We reduce from the following non-elementary decision problem: Input: A Turing machine M and a number k Question: When started on the empty tape, does M halt in at most 2 2 ··· 2 steps? ���� k times Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 32 of 54

  65. Beyond P Surprisingly, this severe restriction in expressivity is specific to the skolem chase: Theorem: There is a rule set Σ ∈ CT dlf ∀∀ and a BCQ q that express a non-elementary Boolean query. Proof: We reduce from the following non-elementary decision problem: Input: A Turing machine M and a number k Question: When started on the empty tape, does M halt in at most 2 2 ··· 2 steps? ���� k times Three ingredients are needed: 1. Rules that receive an input chain first ( e 0 ) ✱ next ( e 0 ✱ e 1 ) ✱ . . . ✱ next ( e k − 1 ✱ e k ) ✱ last ( e k ) and construct a k -exponentially long chain (interesting) 2. Rules that simulate a Turing machine in time and space bounded by this chain (boring) 3. Rules that ensure termination even on malformed inputs (interesting) Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 32 of 54

  66. Building a long chain We construct a series of k full binary trees of depth 2 ✱ 2 2 ✱ 2 2 2 ✱ . . . (we omit the roots) Tree #1 Tree #2 next left, right level counter Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 33 of 54

  67. Building a long chain We construct a series of k full binary trees of depth 2 ✱ 2 2 ✱ 2 2 2 ✱ . . . (we omit the roots) Tree #1 Tree #2 Tree #3 next left, right level counter Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 33 of 54

  68. Building a long chain We construct a series of k full binary trees of depth 2 ✱ 2 2 ✱ 2 2 2 ✱ . . . (we omit the roots) Tree #1 Tree #2 Tree #3 next left, right level counter Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 33 of 54

  69. Building a long chain We construct a series of k full binary trees of depth 2 ✱ 2 2 ✱ 2 2 2 ✱ . . . (we omit the roots) Tree #1 Tree #2 Tree #3 next left, right level counter Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 33 of 54

  70. Building a long chain We construct a series of k full binary trees of depth 2 ✱ 2 2 ✱ 2 2 2 ✱ . . . (we omit the roots) Tree #1 Tree #2 Tree #3 next left, right level counter Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 33 of 54

  71. Building a long chain We construct a series of k full binary trees of depth 2 ✱ 2 2 ✱ 2 2 2 ✱ . . . (we omit the roots) Tree #1 Tree #2 Tree #3 next left, right level counter Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 33 of 54

  72. Building a long chain We construct a series of k full binary trees of depth 2 ✱ 2 2 ✱ 2 2 2 ✱ . . . (we omit the roots) Tree #1 Tree #2 Tree #3 next left, right level counter Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 33 of 54

  73. Building a long chain We construct a series of k full binary trees of depth 2 ✱ 2 2 ✱ 2 2 2 ✱ . . . (we omit the roots) Tree #1 Tree #2 Tree #3 next left, right level counter Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 33 of 54

  74. Building a long chain We construct a series of k full binary trees of depth 2 ✱ 2 2 ✱ 2 2 2 ✱ . . . (we omit the roots) Tree #1 Tree #2 Tree #3 next left, right level counter Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 33 of 54

  75. Building a long chain We construct a series of k full binary trees of depth 2 ✱ 2 2 ✱ 2 2 2 ✱ . . . (we omit the roots) Tree #1 Tree #2 Tree #3 next left, right level counter Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 33 of 54

  76. Building a long chain We construct a series of k full binary trees of depth 2 ✱ 2 2 ✱ 2 2 2 ✱ . . . (we omit the roots) Tree #1 Tree #2 Tree #3 . . . next left, right level counter Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 33 of 54

  77. Building a long chain And here are the rules: first ( v ) → ∃ x ✳ start ( x ✱ x ✱ v ) ∧ end ( x ) start ( x ✱ u ✱ v ) ∧ end ( u ) ∧ next ( v ✱ v ′ ) → ∃ y 1 ✱ y 2 ✳ start ( y 1 ✱ x ✱ v ′ ) ∧ succ ( y 1 ✱ y 2 ) ∧ end ( y 2 ) start ( x ✱ u ✱ v ) ∧ succ ( u ✱ u ′ ) → ∃ y ✳ left ( x ✱ y ) ∧ start ( y ✱ u ′ ✱ v ) left ( x ✱ y ) → ∃ y ′ ✳ right ( x ✱ y ′ ) ∧ succ ( y ✱ y ′ ) right ( x ✱ y ) ∧ succ ( x ✱ x ′ ) → ∃ y ′ ✳ left ( x ′ ✱ y ′ ) ∧ succ ( y ✱ y ′ ) end ( x ) ∧ right ( x ✱ y ) → end ( y ) Markus Krötzsch, ICDT 2019 – Invited Tutorial The Power of the Terminating Chase slide 34 of 54

Recommend


More recommend