Decidable Classes of Datalog Programs with Arithmetic
Mark Kaminski
joint work with Bernardo Cuenca Grau, Egor Kostylev, Boris Motik, and Ian Horrocks
Department of Computer Science, University of Oxford
Metafinite 2017
Decidable Classes of Datalog Programs with Arithmetic Mark Kaminski - - PowerPoint PPT Presentation
Decidable Classes of Datalog Programs with Arithmetic Mark Kaminski joint work with Bernardo Cuenca Grau, Egor Kostylev, Boris Motik, and Ian Horrocks Department of Computer Science, University of Oxford Metafinite 2017 Data Analytics
Mark Kaminski
joint work with Bernardo Cuenca Grau, Egor Kostylev, Boris Motik, and Ian Horrocks
Department of Computer Science, University of Oxford
Metafinite 2017
market predictions, spot production bottlenecks, …
Alvaro et al. 2010, Markl 2014, Seo et al. 2015, Shkapsky et al. 2016
Loo et al. 2009, Alvaro et al. 2010, Eisner & Filardo 2011, Chin et al. 2015, Seo et al. 2015, Wang et al. 2015, Shkapsky et al. 2016 Alvaro et al. 2010, Markl 2014, Seo et al. 2015, Shkapsky et al. 2016
Van Gelder 1993, Ross & Sagiv 1997, Greco 1999, Mazuran et al. 2013
Consens & Mendelzon 1993, Greco 1999, Faber et al. 2011
unifying formal foundation for declarative analytics
A(x ) ∧ B(x,y,m ) ∧ C(y,z,n ) ∧ (m +1 ≤ 2 ·n) → D(y,z,m +n)
A(x ) ∧ B(x,y,m ) ∧ C(y,z,n ) ∧ (m +1 ≤ 2 ·n) → D(y,z,m +n)
datalog atoms
A(x ) ∧ B(x,y,m ) ∧ C(y,z,n ) ∧ (m +1 ≤ 2 ·n) → D(y,z,m +n) numeric atoms
A(x ) ∧ B(x,y,m ) ∧ C(y,z,n ) ∧ (m +1 ≤ 2 ·n) → D(y,z,m +n)
per atom m n m +n
A(x ) ∧ B(x,y,m ) ∧ C(y,z,n ) ∧ (m +1 ≤ 2 ·n) → D(y,z,m +n) comparison atoms
A(x ) ∧ B(x,y,m ) ∧ C(y,z,n ) ∧ (m +1 ≤ 2 ·n) → D(y,z,m +n)
A(x ) ∧ B(x,y,m ) ∧ C(y,z,n ) ∧ (m +1 ≤ 2 ·n) → D(y,z,m +n)
two-sorted FO interpretation with integers
A(x ) ∧ B(x,y,m ) ∧ C(y,z,n ) ∧ (m +1 ≤ 2 ·n) → D(y,z,m +n)
∞
A(x ) ∧ B(x,y,m ) ∧ C(y,z,n ) ∧ (m +1 ≤ 2 ·n) → D(y,z,m +n)
∞
A(x,m ) ∧ (m ≤ n ) → A(x,n ) for A a min predicate B(x,m ) ∧ (n ≤ m ) → B(x,n ) for B a max predicate
A(x,m ) ∧ (m ≤ n ) → A(x,n ) for A a min predicate B(x,m ) ∧ (n ≤ m ) → B(x,n ) for B a max predicate
limit predicates
cheapest route from London to Reykjavík?
flight(x,y,c) → route(x,y,c) route(x,z,c1) ∧ flight(z,y,c2) → route(x,y,c1+c2)
route a min predicate
flight London Hamburg 100 Hamburg Reykjavík 150 London Reykjavík 300
cheapest route from London to Reykjavík?
flight(x,y,c) → route(x,y,c) route(x,z,c1) ∧ flight(z,y,c2) → route(x,y,c1+c2)
route a min predicate
flight London Hamburg 100 Hamburg Reykjavík 150 London Reykjavík 300 route London Reykjavík 250 London Reykjavík 300 … … …
cheapest route from London to Reykjavík?
flight(x,y,c) → route(x,y,c) route(x,z,c1) ∧ flight(z,y,c2) → route(x,y,c1+c2)
route a min predicate
flight London Hamburg 100 Hamburg Reykjavík 150 London Reykjavík 300 route London Reykjavík 250 London Reykjavík 300 … … …
store only the minimal/maximal k ∈ ℤ s.t. J ⊧ A(a,k )
store only the minimal/maximal k ∈ ℤ s.t. J ⊧ A(a,k )
has a pseudo-model J with |J | ≤ |P |
→ A(0) A(x1) ∧ … ∧ A(xn) ∧ p(x1,…,xn)=0 → B P ⊧ B iff p(x1,…,xn)=0 has non-negative integer solution
→ A(0) A(x1) ∧ … ∧ A(xn) ∧ p(x1,…,xn)=0 → B P ⊧ B iff p(x1,…,xn)=0 has non-negative integer solution
disallow multiplication between limit variables
→ A(0) A(x1) ∧ … ∧ A(xn) ∧ p(x1,…,xn)=0 → B P ⊧ B iff p(x1,…,xn)=0 has non-negative integer solution
disallow multiplication between limit variables A(x ) ∧ B(y ) → C(x ·y ) not limit linear
→ A(0) A(x1) ∧ … ∧ A(xn) ∧ p(x1,…,xn)=0 → B P ⊧ B iff p(x1,…,xn)=0 has non-negative integer solution
disallow multiplication between limit variables A(x ) ∧ B(y ) → C(x ·y ) not limit linear A(x ) ∧ B(y ) → C(x ·y ) limit linear
and coNP-complete in data complexity
A(x ) → B(x +1) ↝ ∀x.defA ∧ (x ≤valA) → defB ∧ (x +1≤valB)
exponentially bounded using Chistikov & Haase 2016
Square Tiling input: finite set T of tiles horizontal compatibility relation H⊆T⨯T vertical compatibility relation V⊆T⨯T number N problem: is there a function N⨯N → T satisfying H and V (tiling)?
as a candidate tiling; initialise n with 0 · -
as a candidate tiling; initialise n with 0
· -
as a candidate tiling; initialise n with 0
· -
2· 2
as a candidate tiling; initialise n with 0
· -
2· 2
I = { A(1) B(0) } A(0) B(-1) A(-1) B(-2) ⋮ ⋮
I = { A(1) B(0) } A(0) B(-1) A(-1) B(-2) ⋮ ⋮
I = { A(1) B(0) } A(0) B(-1) A(-1) B(-2) ⋮ ⋮
does not apply to
I = { A(1) B(0) } A(0) B(-1) A(-1) B(-2) ⋮ ⋮
does not apply to
→ B(0) A → B(1) simulates not A → C ⎡B(0)⎤→ C
I = { A(1) B(0) } A(0) B(-1) A(-1) B(-2) ⋮ ⋮
if A,B both max predicates
if A,B both max predicates
fact entailment for stratified-linear datalogℤ Δ2 -complete and Δ2-complete in data complexity
deterministic compositions of limit-linear programs
EXP P
fact entailment for stratified-linear datalogℤ Δ2 -complete and Δ2-complete in data complexity
deterministic compositions of limit-linear programs
by simulating a DTM with an NP oracle
complexity class C in the polynomial hierarchy, then L is Exp(C )-hard in combined complexity
EXP P P
P
i.e., metafinite structures?
P P
i.e., metafinite structures?
P P
rather than a half-open interval following Ross & Sagiv. 1997 ≈ put⎡⎤around every limit atom
in PPosSLP=BP(Pℝ) as defined in Allender et al. 2009