Query Answering with Guarded Rules and Expressive Constraints
Antoine Amarilli1,2, Michael Benedikt2, Pierre Bourhis3, Michael Vanden Boom2 October 20, 2016
1Télécom ParisTech, Paris, France
2University of Oxford, Oxford, United Kingdom
3CNRS CRIStAL, Lille 1/33
Open-world query answering (QA)
• We aregiven:
RelationalinstanceI(ground facts)
! LogicalconstraintsΣ
? Boolean conjunctivequeryq
(existentially quantified conjunction of atoms)
• Weask:
• Consider all possiblecompletionsJ⊇I
• Restrict to those that satisfy theconstraintsΣ
→ Isqcertainamong them?
Open-world query answering (QA)
• We aregiven:
RelationalinstanceI(ground facts)
! LogicalconstraintsΣ
? Boolean conjunctivequeryq
(existentially quantified conjunction of atoms)
• Weask:
• Consider all possiblecompletionsJ⊇I
• Restrict to those that satisfy theconstraintsΣ
→ Isqcertainamong them?
2/33
QA example
Relational instanceI
• CoSup(Jamie)–Jamie is a co-supervised student
! Logical constraintsΣ
• ∀xCoSup(x)→ ∃y zAdv(x,y)∧Adv(x,z)∧Knows(y,z)∧y6=z A co-supervised student has two advisors that know each other
• ∀x yAdv(x,y)→Knows(x,y) Advisors know their students
• ∀x yKnows(x,y)→Knows(y,x)
“Knows” is symmetric
? Boolean conjunctive queryq
• ∃x y zKnows(x,y)∧Knows(y,z)∧Knows(x,z) Is there a clique of 3 people that know each other?
→ The query iscertainunder the instance and constraints
QA example
Relational instanceI
• CoSup(Jamie)–Jamie is a co-supervised student
! Logical constraintsΣ
• ∀xCoSup(x)→ ∃y zAdv(x,y)∧Adv(x,z)∧Knows(y,z)∧y6=z A co-supervised student has two advisors that know each other
• ∀x yAdv(x,y)→Knows(x,y) Advisors know their students
• ∀x yKnows(x,y)→Knows(y,x)
“Knows” is symmetric
? Boolean conjunctive queryq
• ∃x y zKnows(x,y)∧Knows(y,z)∧Knows(x,z) Is there a clique of 3 people that know each other?
→ The query iscertainunder the instance and constraints
3/33
QA example
Relational instanceI
• CoSup(Jamie)–Jamie is a co-supervised student
! Logical constraintsΣ
• ∀xCoSup(x)→ ∃y zAdv(x,y)∧Adv(x,z)∧Knows(y,z)∧y6=z A co-supervised student has two advisors that know each other
• ∀x yAdv(x,y)→Knows(x,y) Advisors know their students
• ∀x yKnows(x,y)→Knows(y,x)
“Knows” is symmetric
? Boolean conjunctive queryq
• ∃x y zKnows(x,y)∧Knows(y,z)∧Knows(x,z) Is there a clique of 3 people that know each other?
→ The query iscertainunder the instance and constraints
QA example
Relational instanceI
• CoSup(Jamie)–Jamie is a co-supervised student
! Logical constraintsΣ
• ∀xCoSup(x)→ ∃y zAdv(x,y)∧Adv(x,z)∧Knows(y,z)∧y6=z A co-supervised student has two advisors that know each other
• ∀x yAdv(x,y)→Knows(x,y) Advisors know their students
• ∀x yKnows(x,y)→Knows(y,x)
“Knows” is symmetric
? Boolean conjunctive queryq
• ∃x y zKnows(x,y)∧Knows(y,z)∧Knows(x,z) Is there a clique of 3 people that know each other?
→ The query iscertainunder the instance and constraints
3/33
QA example
Relational instanceI
• CoSup(Jamie)–Jamie is a co-supervised student
! Logical constraintsΣ
• ∀xCoSup(x)→ ∃y zAdv(x,y)∧Adv(x,z)∧Knows(y,z)∧y6=z A co-supervised student has two advisors that know each other
• ∀x yAdv(x,y)→Knows(x,y) Advisors know their students
• ∀x yKnows(x,y)→Knows(y,x)
“Knows” is symmetric
? Boolean conjunctive queryq
• ∃x y zKnows(x,y)∧Knows(y,z)∧Knows(x,z) Is there a clique of 3 people that know each other?
→ The query iscertainunder the instance and constraints
QA example
Relational instanceI
• CoSup(Jamie)–Jamie is a co-supervised student
! Logical constraintsΣ
• ∀xCoSup(x)→ ∃y zAdv(x,y)∧Adv(x,z)∧Knows(y,z)∧y6=z A co-supervised student has two advisors that know each other
• ∀x yAdv(x,y)→Knows(x,y) Advisors know their students
• ∀x yKnows(x,y)→Knows(y,x)
“Knows” is symmetric
? Boolean conjunctive queryq
• ∃x y zKnows(x,y)∧Knows(y,z)∧Knows(x,z) Is there a clique of 3 people that know each other?
→ The query iscertainunder the instance and constraints
3/33
QA tasks
Is QAdecidable, and what is thecomplexity?
→ Depends on the language used forlogical constraints
→ E.g., for arbitraryfirst-orderconstraints, QA isundecidable (becausesatisfiabilityis undecidable)
→ Find fragments offirst-order logicwithdecidable QA
QA tasks
Is QAdecidable, and what is thecomplexity?
→ Depends on the language used forlogical constraints
→ E.g., for arbitraryfirst-orderconstraints, QA isundecidable (becausesatisfiabilityis undecidable)
→ Find fragments offirst-order logicwithdecidable QA
4/33
QA tasks
Is QAdecidable, and what is thecomplexity?
→ Depends on the language used forlogical constraints
→ E.g., for arbitraryfirst-orderconstraints, QA isundecidable (becausesatisfiabilityis undecidable)
→ Find fragments offirst-order logicwithdecidable QA
QA tasks
Is QAdecidable, and what is thecomplexity?
→ Depends on the language used forlogical constraints
→ E.g., for arbitraryfirst-orderconstraints, QA isundecidable (becausesatisfiabilityis undecidable)
→ Find fragments offirst-order logicwithdecidable QA
4/33
Tuple-generating dependencies (or existential rules)
∀x yφ(x,y)→ ∃zψ(y,z)
where thebodyφandheadψareconjunctions of atoms
→ Guarded TGDs:bodyφhas an atom withallbody variablesx,y
∀x y1y2S(x,y1)∧S(x,y2)∧U(x,y1,y2)→ ∃z S(y2,z)∧T(y1)
→ Frontier-one TGDs:thefrontieryhas onlyonevariable
∀xyS(x,y)→ ∃z S(y,z)
→ Frontier-guarded TGDs (FGTGDs):
bodyφhas an atom withallfrontier variablesy
∀x y1y2S(x,y1)∧S(x,y2)∧R(y1,y2)→ ∃z S(y2,z)∧T(y1)
→ QA for FGTGDs isdecidable[Baget et al., 2011]
Tuple-generating dependencies (or existential rules)
∀x yφ(x,y)→ ∃zψ(y,z)
where thebodyφandheadψareconjunctions of atoms
→ Guarded TGDs:bodyφhas an atom withallbody variablesx,y
∀x y1y2S(x,y1)∧S(x,y2)∧U(x,y1,y2)→ ∃z S(y2,z)∧T(y1)
→ Frontier-one TGDs:thefrontieryhas onlyonevariable
∀xyS(x,y)→ ∃z S(y,z)
→ Frontier-guarded TGDs (FGTGDs):
bodyφhas an atom withallfrontier variablesy
∀x y1y2S(x,y1)∧S(x,y2)∧R(y1,y2)→ ∃z S(y2,z)∧T(y1)
→ QA for FGTGDs isdecidable[Baget et al., 2011]
5/33
Tuple-generating dependencies (or existential rules)
∀x yφ(x,y)→ ∃zψ(y,z)
where thebodyφandheadψareconjunctions of atoms
→ Guarded TGDs:bodyφhas an atom withallbody variablesx,y
∀x y1y2S(x,y1)∧S(x,y2)∧U(x,y1,y2)→ ∃z S(y2,z)∧T(y1)
→ Frontier-one TGDs:thefrontieryhas onlyonevariable
∀xyS(x,y)→ ∃z S(y,z)
→ Frontier-guarded TGDs (FGTGDs):
bodyφhas an atom withallfrontier variablesy
∀x y1y2S(x,y1)∧S(x,y2)∧R(y1,y2)→ ∃z S(y2,z)∧T(y1)
→ QA for FGTGDs isdecidable[Baget et al., 2011]
Tuple-generating dependencies (or existential rules)
∀x yφ(x,y)→ ∃zψ(y,z)
where thebodyφandheadψareconjunctions of atoms
→ Guarded TGDs:bodyφhas an atom withallbody variablesx,y
∀x y1y2S(x,y1)∧S(x,y2)∧U(x,y1,y2)→ ∃z S(y2,z)∧T(y1)
→ Frontier-one TGDs:thefrontieryhas onlyonevariable
∀xyS(x,y)→ ∃z S(y,z)
→ Frontier-guarded TGDs (FGTGDs):
bodyφhas an atom withallfrontier variablesy
∀x y1y2S(x,y1)∧S(x,y2)∧R(y1,y2)→ ∃z S(y2,z)∧T(y1)
→ QA for FGTGDs isdecidable[Baget et al., 2011]
5/33
Tuple-generating dependencies (or existential rules)
∀x yφ(x,y)→ ∃zψ(y,z)
where thebodyφandheadψareconjunctions of atoms
→ Guarded TGDs:bodyφhas an atom withallbody variablesx,y
∀x y1y2S(x,y1)∧S(x,y2)∧U(x,y1,y2)→ ∃z S(y2,z)∧T(y1)
→ Frontier-one TGDs:thefrontieryhas onlyonevariable
∀xyS(x,y)→ ∃z S(y,z)
→ Frontier-guarded TGDs (FGTGDs):
bodyφhas an atom withallfrontier variablesy
∀x y y S(x,y )∧S(x,y )∧R(y ,y )→ ∃z S(y ,z)∧T(y )
FGTGDs cannot express everything
• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors
→ Handled byguarded logicsandguarded negation logics
• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace
→ ∀xy1y2 Born(x,y1)∧Born(x,y2)→y1 =y2 unguarded frontier!
• Transitivity:isLocatedIn, isPartOf, subclass...
→ ∀x y1y2Part(y1,x)∧Part(x,y2)→Part(y1,y2) unguarded frontier!
• Totality:All elephants are bigger than all mice
→ ∀y1y2Elephant(y1)∧Mouse(y2)→y1<y2 unguarded frontier!
6/33
FGTGDs cannot express everything
• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors
→ Handled byguarded logicsandguarded negation logics
• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace
→ ∀xy1y2 Born(x,y1)∧Born(x,y2)→y1 =y2 unguarded frontier!
• Transitivity:isLocatedIn, isPartOf, subclass...
→ ∀x y1y2Part(y1,x)∧Part(x,y2)→Part(y1,y2) unguarded frontier!
• Totality:All elephants are bigger than all mice
→ ∀y1y2Elephant(y1)∧Mouse(y2)→y1<y2 unguarded frontier!
FGTGDs cannot express everything
• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors
→ Handled byguarded logicsandguarded negation logics
• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace
→ ∀xy1y2 Born(x,y1)∧Born(x,y2)→y1 =y2 unguarded frontier!
• Transitivity:isLocatedIn, isPartOf, subclass...
→ ∀x y1y2Part(y1,x)∧Part(x,y2)→Part(y1,y2) unguarded frontier!
• Totality:All elephants are bigger than all mice
→ ∀y1y2Elephant(y1)∧Mouse(y2)→y1<y2 unguarded frontier!
6/33
FGTGDs cannot express everything
• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors
→ Handled byguarded logicsandguarded negation logics
• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace
→ ∀xy1y2Born(x,y1)∧Born(x,y2)→y1 =y2
unguarded frontier!
• Transitivity:isLocatedIn, isPartOf, subclass...
→ ∀x y1y2Part(y1,x)∧Part(x,y2)→Part(y1,y2) unguarded frontier!
• Totality:All elephants are bigger than all mice
→ ∀y1y2Elephant(y1)∧Mouse(y2)→y1<y2 unguarded frontier!
FGTGDs cannot express everything
• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors
→ Handled byguarded logicsandguarded negation logics
• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace
→ ∀xy1y2Born(x,y1)∧Born(x,y2)→y1 =y2 unguarded frontier!
• Transitivity:isLocatedIn, isPartOf, subclass...
→ ∀x y1y2Part(y1,x)∧Part(x,y2)→Part(y1,y2) unguarded frontier!
• Totality:All elephants are bigger than all mice
→ ∀y1y2Elephant(y1)∧Mouse(y2)→y1<y2 unguarded frontier!
6/33
FGTGDs cannot express everything
• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors
→ Handled byguarded logicsandguarded negation logics
• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace
→ ∀xy1y2Born(x,y1)∧Born(x,y2)→y1 =y2 unguarded frontier!
• Transitivity:isLocatedIn, isPartOf, subclass...
→ ∀x y1y2Part(y1,x)∧Part(x,y2)→Part(y1,y2) unguarded frontier!
• Totality:All elephants are bigger than all mice
→ ∀y1y2Elephant(y1)∧Mouse(y2)→y1<y2 unguarded frontier!
FGTGDs cannot express everything
• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors
→ Handled byguarded logicsandguarded negation logics
• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace
→ ∀xy1y2Born(x,y1)∧Born(x,y2)→y1 =y2 unguarded frontier!
• Transitivity:isLocatedIn, isPartOf, subclass...
→ ∀x y1y2Part(y1,x)∧Part(x,y2)→Part(y1,y2)
unguarded frontier!
• Totality:All elephants are bigger than all mice
→ ∀y1y2Elephant(y1)∧Mouse(y2)→y1<y2 unguarded frontier!
6/33
FGTGDs cannot express everything
• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors
→ Handled byguarded logicsandguarded negation logics
• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace
→ ∀xy1y2Born(x,y1)∧Born(x,y2)→y1 =y2 unguarded frontier!
• Transitivity:isLocatedIn, isPartOf, subclass...
→ ∀x y1y2Part(y1,x)∧Part(x,y2)→Part(y1,y2) unguarded frontier!
• Totality:All elephants are bigger than all mice
→ ∀y1y2Elephant(y1)∧Mouse(y2)→y1<y2 unguarded frontier!
FGTGDs cannot express everything
• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors
→ Handled byguarded logicsandguarded negation logics
• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace
→ ∀xy1y2Born(x,y1)∧Born(x,y2)→y1 =y2 unguarded frontier!
• Transitivity:isLocatedIn, isPartOf, subclass...
→ ∀x y1y2Part(y1,x)∧Part(x,y2)→Part(y1,y2) unguarded frontier!
• Totality:All elephants are bigger than all mice
→ ∀y1y2Elephant(y1)∧Mouse(y2)→y1<y2 unguarded frontier!
6/33
FGTGDs cannot express everything
• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors
→ Handled byguarded logicsandguarded negation logics
• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace
→ ∀xy1y2Born(x,y1)∧Born(x,y2)→y1 =y2 unguarded frontier!
• Transitivity:isLocatedIn, isPartOf, subclass...
→ ∀x y1y2Part(y1,x)∧Part(x,y2)→Part(y1,y2) unguarded frontier!
unguarded frontier!
FGTGDs cannot express everything
• Disjunction:Professors must have a PhDoran equivalent title Negation:Professorswithoutan HDR must have co-supervisors
→ Handled byguarded logicsandguarded negation logics
• Number constraints:Co-supervised students havetwo advisors Functionality:Any person is born inexactly oneplace
→ ∀xy1y2Born(x,y1)∧Born(x,y2)→y1 =y2 unguarded frontier!
• Transitivity:isLocatedIn, isPartOf, subclass...
→ ∀x y1y2Part(y1,x)∧Part(x,y2)→Part(y1,y2) unguarded frontier!
• Totality:All elephants are bigger than all mice
→ ∀y1y2Elephant(y1)∧Mouse(y2)→y1<y2 unguarded frontier!
6/33
This talk
Can we extend frontier-guarded TGDs to capture some unguarded constraints while preserving the decidability of QA?
1. Combining Existential Rules and Description Logics A. A., Michael Benedikt, IJCAI’15.
→ Extend FGTGDs withdescription logicconstraints
on arity-two data (includes disjunction, negation, counting) 2. Query Answering with Transitive and Linear-Ordered Data
A. A., Michael Benedikt, P. Bourhis, M. Vanden Boom, IJCAI’16
→ Extend FGTGDs withtransitive relations
andorder relationsthat cannot be used as guards
This talk
Can we extend frontier-guarded TGDs to capture some unguarded constraints while preserving the decidability of QA?
1. Combining Existential Rules and Description Logics A. A., Michael Benedikt, IJCAI’15.
→ Extend FGTGDs withdescription logicconstraints
on arity-two data (includes disjunction, negation, counting)
2. Query Answering with Transitive and Linear-Ordered Data A. A., Michael Benedikt, P. Bourhis, M. Vanden Boom, IJCAI’16
→ Extend FGTGDs withtransitive relations
andorder relationsthat cannot be used as guards
7/33
This talk
Can we extend frontier-guarded TGDs to capture some unguarded constraints while preserving the decidability of QA?
1. Combining Existential Rules and Description Logics A. A., Michael Benedikt, IJCAI’15.
→ Extend FGTGDs withdescription logicconstraints
on arity-two data (includes disjunction, negation, counting) 2. Query Answering with Transitive and Linear-Ordered Data
A. A., Michael Benedikt, P. Bourhis, M. Vanden Boom, IJCAI’16
Table of contents
Introduction
Combining Existential Rules and Description Logics
Query Answering with Transitive and Linear-Ordered Data
Conclusion
8/33
Rich Description Logics
Rich description logics(DLs) FGTGDs
Emp v CEOt(∃Mgr−.Emp) ∀pwvAcpt(p,w,v) → ∃f Trip(p,f,v) Arity-twoonly Arbitraryarity
Rich:disjunction, etc. Conjunctionandimplicationonly Functionality
asserts Funct(Mgr−)
! n/a
Rich Description Logics
Rich description logics(DLs) FGTGDs
Emp v CEOt(∃Mgr−.Emp) ∀pwvAcpt(p,w,v) → ∃f Trip(p,f,v)
Arity-twoonly Arbitraryarity
Rich:disjunction, etc. Conjunctionandimplicationonly Functionality
asserts Funct(Mgr−)
! n/a
9/33
Rich Description Logics
Rich description logics(DLs) FGTGDs
Emp v CEOt(∃Mgr−.Emp) ∀pwvAcpt(p,w,v) → ∃f Trip(p,f,v) Arity-twoonly Arbitraryarity
Rich:disjunction, etc. Conjunctionandimplicationonly Functionality
asserts Funct(Mgr−)
! n/a
Rich Description Logics
Rich description logics(DLs) FGTGDs
Emp v CEOt(∃Mgr−.Emp) ∀pwvAcpt(p,w,v) → ∃f Trip(p,f,v) Arity-twoonly Arbitraryarity
Rich:disjunction, etc. Conjunctionandimplicationonly
Functionality asserts Funct(Mgr−)
! n/a
9/33
Rich Description Logics
Rich description logics(DLs) FGTGDs
Emp v CEOt(∃Mgr−.Emp) ∀pwvAcpt(p,w,v) → ∃f Trip(p,f,v) Arity-twoonly Arbitraryarity
Rich:disjunction, etc. Conjunctionandimplicationonly Functionality
asserts Funct(Mgr−)
! n/a
Our problem
Can we have the best of both worlds?
• QA is decidable forfrontier-guarded TGDs
• QA is decidable forrich DLs(i.e., expressible inGC2, guarded two-variable first-order logic with counting)
→ Is QA decidable forrich DLs+ someclasses of FGTGDs? We show:
• QA isundecidablefor richDLsandFGTGDs
• QA with rich DLs isdecidablefor some newFGTGD classes
• Functional dependenciescan be added under someconditions even tohigher-arity relations
10/33
Our problem
Can we have the best of both worlds?
• QA is decidable forfrontier-guarded TGDs
• QA is decidable forrich DLs(i.e., expressible inGC2, guarded two-variable first-order logic with counting)
→ Is QA decidable forrich DLs+ someclasses of FGTGDs?
We show:
• QA isundecidablefor richDLsandFGTGDs
• QA with rich DLs isdecidablefor some newFGTGD classes
• Functional dependenciescan be added under someconditions even tohigher-arity relations
Our problem
Can we have the best of both worlds?
• QA is decidable forfrontier-guarded TGDs
• QA is decidable forrich DLs(i.e., expressible inGC2, guarded two-variable first-order logic with counting)
→ Is QA decidable forrich DLs+ someclasses of FGTGDs?
We show:
• QA isundecidablefor richDLsandFGTGDs
• QA with rich DLs isdecidablefor some newFGTGD classes
• Functional dependenciescan be added under someconditions even tohigher-arity relations
10/33
Our problem
Can we have the best of both worlds?
• QA is decidable forfrontier-guarded TGDs
• QA is decidable forrich DLs(i.e., expressible inGC2, guarded two-variable first-order logic with counting)
→ Is QA decidable forrich DLs+ someclasses of FGTGDs?
We show:
• QA isundecidablefor richDLsandFGTGDs
• QA with rich DLs isdecidablefor some newFGTGD classes
• Functional dependenciescan be added under someconditions
Undecidability of frontier-guarded plus DLs
Theorem
QA isundecidablefor rich DLs and FGTGDs
Problem:
• DLs can expressFunct(↔functional dependencies, FDs)
• FGTGDs can expressinclusion dependencies(IDs)
∀x yA(x,y)→ ∃zB(y,z)with no variable repetitions
• Implicationof IDs and FDs isundecidable[Mitchell, 1983]
• Implicationreduces toQA [Calì et al., 2003]
→ Restrict tofrontier-oneTGDs: ∀xyφ(x,y)→ ∃zψ(y,z)
11/33
Undecidability of frontier-guarded plus DLs
Theorem
QA isundecidablefor rich DLs and FGTGDs Problem:
• DLs can expressFunct(↔functional dependencies, FDs)
• FGTGDs can expressinclusion dependencies(IDs)
∀x yA(x,y)→ ∃zB(y,z)with no variable repetitions
• Implicationof IDs and FDs isundecidable[Mitchell, 1983]
• Implicationreduces toQA [Calì et al., 2003]
→ Restrict tofrontier-oneTGDs: ∀xyφ(x,y)→ ∃zψ(y,z)
Undecidability of frontier-guarded plus DLs
Theorem
QA isundecidablefor rich DLs and FGTGDs Problem:
• DLs can expressFunct(↔functional dependencies, FDs)
• FGTGDs can expressinclusion dependencies(IDs)
∀x yA(x,y)→ ∃zB(y,z)with no variable repetitions
• Implicationof IDs and FDs isundecidable[Mitchell, 1983]
• Implicationreduces toQA [Calì et al., 2003]
→ Restrict tofrontier-oneTGDs: ∀xyφ(x,y)→ ∃zψ(y,z)
11/33
Undecidability of frontier-one plus DLs
• Restrict tofrontier-oneTGDs: ∀xyφ(x,y)→ ∃zψ(y,z)
• QA for frontier-oneIDsplus FDs isdecidable(separability)
However: Theorem
QA isundecidablefor rich DLs and frontier-one TGDs
Problem:
• Rule heads and bodies may containcycles
• We haveFunctassertions
→ We can build agridand encodetiling problems
Undecidability of frontier-one plus DLs
• Restrict tofrontier-oneTGDs: ∀xyφ(x,y)→ ∃zψ(y,z)
• QA for frontier-oneIDsplus FDs isdecidable(separability) However:
Theorem
QA isundecidablefor rich DLs and frontier-one TGDs
Problem:
• Rule heads and bodies may containcycles
• We haveFunctassertions
→ We can build agridand encodetiling problems
12/33
Undecidability of frontier-one plus DLs
• Restrict tofrontier-oneTGDs: ∀xyφ(x,y)→ ∃zψ(y,z)
• QA for frontier-oneIDsplus FDs isdecidable(separability) However:
Theorem
QA isundecidablefor rich DLs and frontier-one TGDs
Problem:
• Rule heads and bodies may containcycles
• We haveFunctassertions
Undecidability of frontier-one plus DLs: proof We reduce fromtiling problems:
• finite set ofcolors: , ,
• horizontalandverticalallowed pairs:
Thetiling problemis:
• input:initial configuration:
• output: is there aninfinite tiling?
. . . . . . . . . ... ... ... ... ... ...
→ Undecidablefor some sets of colors and configurations
13/33
Undecidability of frontier-one plus DLs: proof We reduce fromtiling problems:
• finite set ofcolors: , ,
• horizontalandverticalallowed pairs:
Thetiling problemis:
• input:initial configuration:
• output: is there aninfinite tiling?
. . . . . . . . . ... ... ... ... ... ...
→ Undecidablefor some sets of colors and configurations
Undecidability of frontier-one plus DLs: proof We reduce fromtiling problems:
• finite set ofcolors: , ,
• horizontalandverticalallowed pairs:
Thetiling problemis:
• input:initial configuration:
• output: is there aninfinite tiling?
. . . . . . . . . ... ... ... ... ... ...
→ Undecidablefor some sets of colors and configurations
13/33
Undecidability of frontier-one plus DLs: proof We reduce fromtiling problems:
• finite set ofcolors: , ,
• horizontalandverticalallowed pairs:
Thetiling problemis:
• input:initial configuration:
• output: is there aninfinite tiling?
. . . . . . . . . ... ... ... ... ... ...
→ Undecidablefor some sets of colors and configurations
Undecidability of frontier-one plus DLs: proof We reduce fromtiling problems:
• finite set ofcolors: , ,
• horizontalandverticalallowed pairs:
Thetiling problemis:
• input:initial configuration:
• output: is there aninfinite tiling? . . .
. . . . . . ... ... ... ... ... ...
→ Undecidablefor some sets of colors and configurations
13/33
Undecidability of frontier-one plus DLs: proof We reduce fromtiling problems:
• finite set ofcolors: , ,
• horizontalandverticalallowed pairs:
Thetiling problemis:
• input:initial configuration:
• output: is there aninfinite tiling? . . .
. . . . . .
Undecidability of frontier-one plus DLs: proof, cont’d
• FunctionalrelationsDfordownandRforright
• Unary predicateTfortilesandC for eachcolor
Initial instance:C −−−−→R C −−−−→R C −−−−→R C
! Constraints:
• DL Disjunctionto color tiles:TvC tC tC
• Frontier-one TGD:∀yT(y)⇒ ∃tzw
T(y) −−−−→R T(t)
y
D
y
D
T(z) −−−−→R T(w)
? Query: ∃x y C (x)−−−−→R C (y)for all forbidden pairs
→ There is anextension of the instanceiff there is atiling
14/33
Undecidability of frontier-one plus DLs: proof, cont’d
• FunctionalrelationsDfordownandRforright
• Unary predicateTfortilesandC for eachcolor Initial instance:C −−−−→R C −−−−→R C −−−−→R C
! Constraints:
• DL Disjunctionto color tiles:TvC tC tC
• Frontier-one TGD:∀yT(y)⇒ ∃tzw
T(y) −−−−→R T(t)
y
D
y
D
T(z) −−−−→R T(w)
? Query: ∃x y C (x)−−−−→R C (y)for all forbidden pairs
→ There is anextension of the instanceiff there is atiling
Undecidability of frontier-one plus DLs: proof, cont’d
• FunctionalrelationsDfordownandRforright
• Unary predicateTfortilesandC for eachcolor Initial instance:C −−−−→R C −−−−→R C −−−−→R C
! Constraints:
• DL Disjunctionto color tiles:TvC tC tC
• Frontier-one TGD:∀yT(y)⇒ ∃tzw
T(y) −−−−→R T(t)
y
D
y
D
T(z) −−−−→R T(w)
? Query: ∃x y C (x)−−−−→R C (y)for all forbidden pairs
→ There is anextension of the instanceiff there is atiling
14/33
Undecidability of frontier-one plus DLs: proof, cont’d
• FunctionalrelationsDfordownandRforright
• Unary predicateTfortilesandC for eachcolor Initial instance:C −−−−→R C −−−−→R C −−−−→R C
! Constraints:
• DL Disjunctionto color tiles:TvC tC tC
• Frontier-one TGD:∀yT(y)⇒ ∃tzw
T(y) −−−−→R T(t)
y
D
y
D
T(z) −−−−→R T(w)
? Query: ∃x y C (x)−−−−→R C (y)for all forbidden pairs
→ There is anextension of the instanceiff there is atiling
Undecidability of frontier-one plus DLs: proof, cont’d
• FunctionalrelationsDfordownandRforright
• Unary predicateTfortilesandC for eachcolor Initial instance:C −−−−→R C −−−−→R C −−−−→R C
! Constraints:
• DL Disjunctionto color tiles:TvC tC tC
• Frontier-one TGD:∀yT(y)⇒ ∃tzw
T(y) −−−−→R T(t)
y
D
y
D
T(z) −−−−→R T(w)
? Query:∃x y C (x)−−−−→R C (y)for all forbidden pairs
→ There is anextension of the instanceiff there is atiling
14/33
Decidability of non-looping frontier-one and DLs
Idea:prohibitcyclesin FGTGDs
• R(x,y)S(y,z)T(z,x)is acycle
• R(z,x,y)S(x,y,w)is also acycle
Formally:
• Berge cycle: cycle in the atom–variableincidence graph
• Non-loopingconjunction: no cycle except, e.g.,R(x,y)S(x,y)
• Non-looping frontier-one: non-looping body and head Theorem
QA isdecidablefor non-looping frontier-one TGDs + rich DLs
x y z
R(x,y) T(z,x) S(y,z)
x y
z w
R(z,x,y) S(x,y,w)
Decidability of non-looping frontier-one and DLs
Idea:prohibitcyclesin FGTGDs
• R(x,y)S(y,z)T(z,x)is acycle
• R(z,x,y)S(x,y,w)is also acycle
Formally:
• Berge cycle: cycle in the atom–variableincidence graph
• Non-loopingconjunction: no cycle except, e.g.,R(x,y)S(x,y)
• Non-looping frontier-one: non-looping body and head Theorem
QA isdecidablefor non-looping frontier-one TGDs + rich DLs
15/33
x y z
R(x,y) T(z,x) S(y,z)
x y
z w
R(z,x,y) S(x,y,w)
Decidability of non-looping frontier-one and DLs
Idea:prohibitcyclesin FGTGDs
• R(x,y)S(y,z)T(z,x)is acycle
• R(z,x,y)S(x,y,w)is also acycle
Formally:
• Berge cycle: cycle in the atom–variableincidence graph
• Non-loopingconjunction: no cycle except, e.g.,R(x,y)S(x,y)
• Non-looping frontier-one: non-looping body and head Theorem
QA isdecidablefor non-looping frontier-one TGDs + rich DLs
x y z
R(x,y) T(z,x) S(y,z)
x y
z w
R(z,x,y) S(x,y,w)
Decidability of non-looping frontier-one and DLs
Idea:prohibitcyclesin FGTGDs
• R(x,y)S(y,z)T(z,x)is acycle
• R(z,x,y)S(x,y,w)is also acycle
Formally:
• Berge cycle: cycle in the atom–variableincidence graph
• Non-loopingconjunction: no cycle except, e.g.,R(x,y)S(x,y)
• Non-looping frontier-one: non-looping body and head Theorem
QA isdecidablefor non-looping frontier-one TGDs + rich DLs
15/33
x y z
R(x,y) T(z,x) S(y,z)
x y
z w
R(z,x,y) S(x,y,w)
Decidability of non-looping frontier-one and DLs
Idea:prohibitcyclesin FGTGDs
• R(x,y)S(y,z)T(z,x)is acycle
• R(z,x,y)S(x,y,w)is also acycle
Formally:
• Berge cycle: cycle in the atom–variableincidence graph
• Non-loopingconjunction: no cycle except, e.g.,R(x,y)S(x,y)
• Non-looping frontier-one: non-looping body and head
Theorem
QA isdecidablefor non-looping frontier-one TGDs + rich DLs
x y z
R(x,y) T(z,x) S(y,z)
x y
z w
R(z,x,y) S(x,y,w)
Decidability of non-looping frontier-one and DLs
Idea:prohibitcyclesin FGTGDs
• R(x,y)S(y,z)T(z,x)is acycle
• R(z,x,y)S(x,y,w)is also acycle
Formally:
• Berge cycle: cycle in the atom–variableincidence graph
• Non-loopingconjunction: no cycle except, e.g.,R(x,y)S(x,y)
• Non-looping frontier-one: non-looping body and head Theorem
QA isdecidablefor non-looping frontier-one TGDs + rich DLs
15/33
x y z
R(x,y) T(z,x) S(y,z)
x y
z w
R(z,x,y) S(x,y,w)
Decidability of non-looping frontier-one and DLs (proof )
• ShredR(a,b,c)toR1(f,a),R2(f,b),R3(f,c)
• AxiomatizetheRi, e.g.,∀f ∃=1xR1(f,x)
→ QA for theshreddedinstance, TGDs, query, and axioms isequivalentto QA for the original instance, TGDs, query
• Rewriteshredded non-looping frontier-one TGDs toGC2:
• Rewrite∀xyφ(x,y)⇒ ∃zψ(y,z)to∀yφ0(y)⇒ψ0(y),
withφ0(y)andψ0(y)the shredding of∃xφ(x,y)and∃zψ(y,z)
• Example:φ(y) :=∃x1x2T(y,x1)∧R(y,y,x2)∧A(x2)
→ ∃x1x2f T(y,x1)∧R1(f,y)∧R2(f,y)∧R3(f,x2)∧A(x2)
→
∃x1T(y,x1)
∧
∃x2f R1(f,y)∧R2(f,y)∧ ∃y2R3(f,y2)∧A(y2)
→ Reduces toQA for GC2: decidable [Pratt-Hartmann, 2009]
Decidability of non-looping frontier-one and DLs (proof )
• ShredR(a,b,c)toR1(f,a),R2(f,b),R3(f,c)
• AxiomatizetheRi, e.g.,∀f ∃=1xR1(f,x)
→ QA for theshreddedinstance, TGDs, query, and axioms isequivalentto QA for the original instance, TGDs, query
• Rewriteshredded non-looping frontier-one TGDs toGC2:
• Rewrite∀xyφ(x,y)⇒ ∃zψ(y,z)to∀yφ0(y)⇒ψ0(y),
withφ0(y)andψ0(y)the shredding of∃xφ(x,y)and∃zψ(y,z)
• Example:φ(y) :=∃x1x2T(y,x1)∧R(y,y,x2)∧A(x2)
→ ∃x1x2f T(y,x1)∧R1(f,y)∧R2(f,y)∧R3(f,x2)∧A(x2)
→
∃x1T(y,x1)
∧
∃x2f R1(f,y)∧R2(f,y)∧ ∃y2R3(f,y2)∧A(y2)
→ Reduces toQA for GC2: decidable [Pratt-Hartmann, 2009]
16/33