Coalgebra & Data Clemens Kupke University of Strathclyde - - PowerPoint PPT Presentation

coalgebra data
SMART_READER_LITE
LIVE PREVIEW

Coalgebra & Data Clemens Kupke University of Strathclyde - - PowerPoint PPT Presentation

Coalgebra & Data Clemens Kupke University of Strathclyde Glasgow, Scotland Alcop 2015, Delft, 7 May 2015 C. Kupke Coalgebra & Data Overview I iteration-free coalgebraic PDL I brief overview I completeness I Datalog I Intro:


slide-1
SLIDE 1

Coalgebra & Data

Clemens Kupke University of Strathclyde Glasgow, Scotland Alcop 2015, Delft, 7 May 2015

  • C. Kupke

Coalgebra & Data

slide-2
SLIDE 2

Overview

I iteration-free coalgebraic PDL

I brief overview I completeness

I Datalog±

I Intro: ontology-based data access & Datalog± I the problem with negative information I normal Datalog±

I Coalgebra & Data

  • C. Kupke

Coalgebra & Data

slide-3
SLIDE 3

Part 0: Basics of Coalgebraic Logics in 4 slides

  • C. Kupke

Coalgebra & Data

slide-4
SLIDE 4

Coalgebraic Modal Logic & PDL

I Observation: Kripke models are P-coalgebras, ie, pairs

(X, γ) with γ : X ! PX

I in this context X is usually a set I Idea: Develop modal logic for T-coalgebras, where T is an

  • endofunctor. Development should be parametric in T.
  • C. Kupke

Coalgebra & Data

slide-5
SLIDE 5

Coalgebraic Logic: Syntax

Given a modal similarity type Λ (ie., a collection of modal

  • perators) and a set Var of propositional variables.

Definition

The set F(Λ) of formulas over Λ is defined a follows: F(Λ) 3 ϕ ::= p 2 Var |?| ¬ϕ | ϕ ^ ϕ | ~ϕ, ~ 2 Λ

Note

In this talk the (basic) similarity type will consist of one unary modality only!

  • C. Kupke

Coalgebra & Data

slide-6
SLIDE 6

Coalgebraic Logic: Semantics

In order to be able to interpret modal formulas we need

I a set functor T I for every modal operator ~ 2 Λ a natural transformation

~ : P ! PT, where P denotes the contravariant power set functor. Formulas are then interpreted over T-models (X, γ, V) consisting of γ : X ! TX and V : Var ! P(X). [ [p] ] = V(p) for p 2 Var . . . [ [~ϕ] ] = Pγ(~([ [ϕ] ])) = γ1(~([ [ϕ] ]))

  • C. Kupke

Coalgebra & Data

slide-7
SLIDE 7

Equivalently

~ : P ! PT is in one-to-one correspondence to

I b

~ : T ! P

  • pP (T-coalgebras to neighbourhood frames)

x | = ~ϕ iff [ [ϕ] ] 2 (b ~ γ)(x).

I ˘

~ : T2 ! 2 (“allowed 0-1 patterns”) X

χ[

[ϕ] ]

/

γ

2 T(X)

T(χ[

[ϕ] ]) / T(2)

˘ ~

/ 2

(X, γ, V), x | = ~ϕ iff ˘ ~(T(χ[

[ϕ] ])(c(x)) = 1.

  • C. Kupke

Coalgebra & Data

slide-8
SLIDE 8

Examples

I T = P, ~ = 2:

~(U) = {V ✓ X | U ✓ V}, b ~(V) = {U ✓ X | U ✓ V} and ˘ ~(V ✓ P2) = 1 iff 0 62 V

I T = M, ~ = 2:

~(U) = {N 2 MX | U 2 N} b ~(N) = N ˘ ~(N 2 M2) = 1 iff 1 2 N . . .

  • C. Kupke

Coalgebra & Data

slide-9
SLIDE 9

Part I: Coalgebraic PDL (joint work H.H. Hansen, R.Leal)

  • C. Kupke

Coalgebra & Data

slide-10
SLIDE 10

Propositional Dynamic Logic (PDL)

Fischer & Ladner, 1977. Reason about program correctness. [α]ϕ “after all successful executions of program α, ϕ holds”

I Syntax:

formulas ϕ ::= p 2 P0 | ¬ϕ | ϕ _ ϕ | [α]ϕ programs α 2 A ::= a 2 A0 | α; α | α [ α | α⇤ | ϕ? composition (;), choice ([), iteration (⇤), tests (ϕ?)

I Multi-modal Kripke semantics: M = (X, {Rα | α 2 A}, V)

where X is state space,

I Rα : X

! P(X) (relation, nondeterministic programs),

I V: P0

! P(X) is a valuation.

M, x | = [α]ϕ iff 8y 2 X. xRαy ! M, y | = ϕ.

  • C. Kupke

Coalgebra & Data

slide-11
SLIDE 11

Standard PDL Models

I Def. M = (X, {Rα | α 2 A}, V) is standard if

Rα;β = Rα Rβ (relation composition) Rα[β = Rα [ Rβ Rα∗ = R⇤

α (reflexive, transitive closure)

Rϕ? = {(x, x) | x 2 [ [ϕ] ]}

I Sound and (weakly) complete axiomatisation of standard

models [Kozen & Parikh 1981]: PDL = Normal modal logic K (ML of Kripke frames) plus: [α; β]ϕ $ [α][β]ϕ [α [ β]ϕ $ [α]ϕ ^ [β]ϕ [ψ?]ϕ $ (ψ ! ϕ) ϕ ^ [α][α⇤]ϕ $ [α⇤]ϕ ϕ ^ [α⇤](ϕ ! [α]ϕ) ! [α⇤]ϕ

  • C. Kupke

Coalgebra & Data

slide-12
SLIDE 12

Game Logic (GL)

Parikh, 1985. Strategic ability in determined 2-player games. hγiϕ “player 1 has strategy in γ to ensure outcome satisfies ϕ” (“player 1 is effective for ϕ”)

I Syntax: PDL syntax extended with dual operation on

games:

I γ1; γ2: play γ1 then γ2, I γ1 [ γ2: player 1 chooses to play γ1 or γ2, I γ⇤: player 1 chooses when to stop. I γd: players switch roles.

I Semantics: Game model M = (X, {Eγ | γ 2 Γ}, V) where

Eγ : X ! PP(X) is monotonic neighbourhood function: If U 2 Eγ(x) and U ✓ U0 then U0 2 Eγ(x). U 2 Eγ(x) iff player 1 is effective for U in γ starting in x. Modal semantics: M, x | = hγiϕ iff [ [ϕ] ] 2 Eγ(x)

  • C. Kupke

Coalgebra & Data

slide-13
SLIDE 13

Standard GL Models

I Standard GL model: similar to PDL notion,

U 2 Eγd(x) iff X \ U / 2 Eγ(x).

I GL = monotonic modal logic M (ML of

  • mon. nbhd. frames) plus

hγ; δiϕ $ hγihδiϕ hγ [ δiϕ $ hγiϕ _ hδiϕ hψ?iϕ $ (ψ ^ ϕ) hγdiϕ $ ¬hγi¬ϕ ϕ _ hγihγ⇤iϕ ! hγ⇤iϕ ϕ _ hγiϕ ! ψ hγ⇤iϕ ! ψ

I Without dual: sound and (weakly) complete [Parikh 1985]. I Without iteration: sound and strongly complete [Pauly

2001].

I Completeness of full GL still open.

  • C. Kupke

Coalgebra & Data

slide-14
SLIDE 14

Towards Coalgebraic Dynamic Logic

Basic observation:

I P is monad (P, η, µ) with:

ηX(x) = {x}, µX({Ui | i 2 I}) = S

i2I Ui. I M is a monad (M, η, µ) with:

ηX(x) = {U ✓ X | x 2 U} µX(W) = {U ✓ X | ηP(X)(U) 2 W}

I Composition of programs and games is Kleisli composition.

Basic setup:

I Action/program X

! TX where T a Set-monad (T describes computation type, side-effects, ...)

I Sequential composition as Kleisli composition ⇤T. I Multi-program setting: X

! (TX)A (A-labelled T-coalgebra) where A is a set of program labels.

  • C. Kupke

Coalgebra & Data

slide-15
SLIDE 15

Coalgebra-Algebra

Two perspectives: ξ : X ! (TX)A TA-coalgebra, modal logic b ξ : A ! (TX)X algebra homomorphism, program operations Questions:

I What are “program” operations like [ and d? I What is a standard model? I Which compositionality axioms? I How to prove soundness and completeness?

  • C. Kupke

Coalgebra & Data

slide-16
SLIDE 16

Pointwise Program Operations via Natural Operations

I An n-ary natural operation on T is a natural

transformation σ: Tn ! T

I σ: Tn

! T yields pointwise operation on (TX)X, e.g., σX

X(c1, c2)(x) = σX(c1(x), c2(x)) I Given finitary signature functor Σ,

a natural Σ-algebra is natural transformation θ: ΣT ! T, and yields pointwise Σ-algebra θX

X : Σ((TX)X)

! (TX)X.

  • C. Kupke

Coalgebra & Data

slide-17
SLIDE 17

Natural and Pointwise Operations: Examples

Natural operations on P:

I Union [: P ⇥ P

! P is a natural operation, since f[U [ U0] = f[U] [ f[U0] (Pf(U) = f[U]) The pointwise extension of [: P ⇥ P ! P is union of relations (R1 [ R2)(x) = R1(x) [ R2(x).

I Observation: Intersection and complement are not natural

  • perations on P.

Natural operations on M:

I [ and \ (since preserved by f1). I Dual operation d : M

! M where for all N 2 M(X), and U ✓ X, U 2 Nd iff X \ U / 2 N. Dual game operation is the pointwise extension.

  • C. Kupke

Coalgebra & Data

slide-18
SLIDE 18

Standard dynamic models

Given a countable set A0 of atomic programs, and a signature functor Σ. Let A = Σ [ {; }-terms over A0. We define:

I Given natural algebra θ: ΣT

! T then ξ : X ! (TX)A is θ-standard iff b ξ : A ! (TX)X is a Σ-algebra homomorphism.

I If T is a monad, then ξ : X

! (TX)A is ;-standard iff for all α, β 2 A, b ξ(α; β) = b ξ(α) ⇤ b ξ(β).

  • C. Kupke

Coalgebra & Data

slide-19
SLIDE 19

Sound Axioms for Pointwise Operations

I Example: PDL axiom for choice [α [ β]p $ [α]p ^ [β]p. I Idea: b

~: T ! N turns operations θ on T into operations χ

  • n N.

Tn

θ

↵◆

b ~n +3 N n χ

↵◆

T

b ~

+3 N

For example: P ⇥ P

[

↵◆

b 2n +3 N ⇥ N \

↵◆

P

b 2

+3 N

From χ: N n ! N, we get rank-1 formula ϕ(χ, α1, . . . , αn, p) (not in this talk).

Lemma

If ξ : X ! (TX)A is θ-standard and χ: N n ! N is such that b ~ θ = χ b ~n, then the rank-1 formula [θ(α1, . . . , αn)]p $ ϕ(χ, α1, . . . , αn, p) is valid in ξ.

  • C. Kupke

Coalgebra & Data

slide-20
SLIDE 20

Coalgebraic Logic (Def)

A (modal) logic is a triple L = (Λ, A, Θ) where

I Λ is a similarity type, I A ✓ Prop(Λ(Prop(Var))) is a set of rank-1 axioms, and I Θ ✓ F(Λ) is a set of frame conditions

If ϕ 2 F(Λ), we write `L ϕ if ϕ can be derived from A [ Θ with the help of propositional reasoning (tautologies + MP), uniform substitution, and the congruence rule. ϕ $ ψ ~ϕ $ ~ψ

  • C. Kupke

Coalgebra & Data

slide-21
SLIDE 21

Dynamic Syntax

Given

I Σ, a signature (functor). I P0, a countable set of atomic propositions. I A0, a countable set of atomic programs.

we define formulas F(P0, A0, Σ) 3 ϕ ::= p 2 P0 | ¬ϕ | ϕ _ ϕ | [α]ϕ programs A(P0, A0, Σ) 3 α ::= a 2 A0 | α; α | σ(α1, . . . , αn) where σ 2 Σ is n-ary. (Tests are incorporated later)

  • C. Kupke

Coalgebra & Data

slide-22
SLIDE 22

(T, θ)-Dynamic Logic

Given

I base logic Lb = ({2}, Ax(2, T), ;)

(rank-1)

I θ: ΣT

! T and set A0 of atomic actions. We define Λ = {[α] | α 2 A}, Ax = Ax(2, T)A [ “θ-axioms00 , Fr = {[α; β]p $ [α][β]p | α, β 2 A, some fresh p 2 P0}, L(θ) = (Λ, Ax, ;), L(θ, ; ) = (Λ, Ax, Fr). L(θ) and L(θ, ; ) are (T, θ)-dynamic logics over Lb.

  • C. Kupke

Coalgebra & Data

slide-23
SLIDE 23

Conditions for Soundness

Sequential composition axiom: [α; β]p $ [α][β]p. Recall: b ~ : T ! P

  • pP

11

$ ˘ ~: T2 ! 2

Lemma

If ξ : X ! (TX)A is ;-standard, and b ~: T ! P

  • pP is a monad

morphism, then the axiom [α; β]p $ [α][β]p is valid in ξ, for all α, β 2 A. Remark:

I Kelly & Power, 1993:

Monad morphism T ! P

  • pP

Eilenberg-Moore algebra T2 ! 2

  • C. Kupke

Coalgebra & Data

slide-24
SLIDE 24

Examples

I Example: ~ for Kripke 3 corr. to free algebra PP(1)

  • ! P(1), so b

~: P ! P

  • pP is monad morphism. Also ¬~¬.

I Example: Monotonic λ, b

λ: M ! P

  • pP is natural inclusion,

hence monad morphism.

I Bad Example: for the sub-distribution monad Dω there

appears to be no interesting EM-algebra Dω2 ! 2 (and: difficult to imagine what an axiom for sequential composition would look like)

Our conclusion

Need to move to many-valued logics when discussing probabilistic systems (similarly for weighted).

  • C. Kupke

Coalgebra & Data

slide-25
SLIDE 25

Strong Completeness Result

If base logic L satisfies conditions for quasi-canonical T-model, then

I L(θ) is sound and strongly complete wrt θ-standard

TA-models (standard methods from coalgebraic modal logic, quasi-canonical model theorem)

I L(θ, ; ) is sound and strongly complete wrt θ, ;-standard

TA-models (use quasi-canonical model for L(θ) to generate θ, ;-standard model, show quasi-canonical)

Key property of the canonical model

For all MCSs Γ and all formulas ϕ we have γ(Γ) 2 ~( ˆ ϕ) iff ~ϕ 2 Γ where ˆ ϕ = {∆ 2 MCS | ϕ 2 ∆}.

  • C. Kupke

Coalgebra & Data

slide-26
SLIDE 26

Adding Tests

Informally: given formula ϕ, program ϕ? tests whether ϕ holds. If the test fails, the program aborts, otherwise do nothing.

I Syntax: ϕ? is a program, when ϕ is a formula. Formulas

and programs defined by mutual induction.

I Semantics: need T to be “pointed”: for each set X, TX

contains a distinguished element ?TX (“abort”), and for all f : X ! Y, Tf(?TX) = ?TY.

I Extend dynamic coalgebraic semantics ξ : X

! (TX)A, b ξ(ϕ?)(x) = ⇢ ηX(x) if x 2 [ [ϕ] ]M ?TX

  • therwise

(standard wrt tests, b ξ and [ [ϕ] ] def’d by mutual induction.)

  • C. Kupke

Coalgebra & Data

slide-27
SLIDE 27

Axiomatising Tests

In PDL: [ϕ?]p $ (ϕ ! p)

  • r

hϕ?ip $ (ϕ ^ p) In GL: hϕ?ip $ (ϕ ^ p)

I Predicate lifting ~: P

! P T is – box-like if for all X and U ✓ X, ?TX 2 ~X(U). – diamond-like if for all X and U ✓ X, ?TX 62 ~X(U). Lemma: Any ~: P ! PT either box-like or diamond-like.

I Axioms:

– If ~ in dynamic semantics is box-like, then add [ϕ?]p $ (ϕ ! p) to Fr, – If ~ in dynamic semantics is diamond-like, then add [ϕ?]p $ (ϕ ^ p) to Fr.

I Theorem: L(θ, ; , ?) is strongly complete wrt dynamic

models. (modify quasi-canonical model, extend to standard model, show quasi-canonical)

  • C. Kupke

Coalgebra & Data

slide-28
SLIDE 28

PDL Conclusion

I possible criticism: no new results; PDL without iteration

not interesting

I one seemingly new result for the lift monad 1 + X I adding *-operator is (important) work in progress; uses

coalgebraic weak completeness proof & a strengthened coherence condition for quasi-canonical models

  • C. Kupke

Coalgebra & Data

slide-29
SLIDE 29

Part II: Datalog± (joint work with Gottlob, Hernich, Lukasiewicz)

  • C. Kupke

Coalgebra & Data

slide-30
SLIDE 30

Ontology-Based Data Access

Database Axioms/ Constraints Knowledge Base/ Ontology Conjunctive Query entails? expressed, e.g., in:

  • a description logic
  • Datalog±
  • C. Kupke

Coalgebra & Data

slide-31
SLIDE 31

Intuition: ontology unifies and completes the data

Consider a hotel database (collection of atoms) D = {Hotel(a), 4Star(a), 4Star(b)} the rules Hotel, 4Star v 9Pool 4Star v Hotel, and the query Q(x) 9y Hotel(x) ^ Pool(x, y). The certain answers (choice of semantics) for the query will be ; without ontology {a, b} with ontology

  • C. Kupke

Coalgebra & Data

slide-32
SLIDE 32

Another ontology language: Datalog±

[Cali, Gottlob, Lukasiewicz] A general Datalog-based framework for tractable query answering over ontologies. Journal of Web Semantics (2012)

  • C. Kupke

Coalgebra & Data

slide-33
SLIDE 33

Motivation for Datalog±

I relations of arbitrary arity I ontology languages for data access need to be lightweight:

lightweight DLs exist, but definitions are involved

I integration of database typical reasoning such as

“negation-as-failure-to-prove” (if there is no flight connection between Edinburgh and Amsterdam in the database, then we conclude ¬Connection(EDI, AMS) - this does not mean that it follows from the facts in the DB using logical deduction)

  • C. Kupke

Coalgebra & Data

slide-34
SLIDE 34

Datalog± Programs

Author(x) ! 9y, z(Article(x, y) ^ publishedAt(y, z)) publishedAt(x, y) ^ publishedAt(x, z) ! y = z publishedAt(x, y) ^ Conference(y) ^ Journal(y) !? Using DL-Notation: Author v 9Article 9publishedAt funct publishedAt 9publishedAt u Conference v ¬Journal

  • C. Kupke

Coalgebra & Data

slide-35
SLIDE 35

Datalog± Programs: General Shape

A program is a finite set of Datalog± rules: R1(x1) ^ · · · ^ Rk(xk) ! ψ where

I Ri(xi) are atoms, I ψ is of one of the following forms:

I ψ ⌘ 9z (S1(y1) ^ . . . · · · ^ Sn(yn)), where the yi’s contain

  • nly variables in z or in the rule body, or

I ψ ⌘ y1 = y2, where y1 and y2 occur in the rule body, or I ψ ⌘?

Simplification: in the talk we will only consider Boolean queries.

  • C. Kupke

Coalgebra & Data

slide-36
SLIDE 36

Semantics: two equivalent definitions

For a given database D and Datalog±-rules Σ: Semantics I: Certain answers A query holds if it holds in all possible models of D [ Σ Semantics II: Canonical model A query holds if it holds in the minimal model of D [ Σf where Σf is the skolemisation of Σ, e.g., a rule R1(x1, . . . , xk) ! 9y.S(x, y) is replaced by R1(x1, . . . , xk) ! S(x, g(x1, . . . , xk)) where g is a new function symbol.

  • C. Kupke

Coalgebra & Data

slide-37
SLIDE 37

Logic Programming

I Skolemisation turns a Datalog± program Σ into a logic

program!

I Query answering relative to a Datalog± program can be

done using logic programming techniques.

I Nevertheless is Datalog± interesting on its own: programs

have particular syntactic shapes, need to restrict to “tractable” fragments

I “Tractable” here means polynomial in the data complexity.

  • C. Kupke

Coalgebra & Data

slide-38
SLIDE 38

Data complexity (Vardi 1982)

I complexity of answering query Q relative to a database D

and a program Σ is measured in data complexity

I this means: Q and Σ are fixed - size of the input is the size

  • f D

I Idea: size of D the dominating factor

  • C. Kupke

Coalgebra & Data

slide-39
SLIDE 39

Some Tractable Cases (Incomplete)

Gua Guarded Da Datalo log±

[Calì-Gottlob-Lukasiewicz '09]

St Sticky ky Datalog±

[Calì-Gottlob-Pieris '10]

Li Linear Data talog±

[Calì-Gottlob-Lukasiewicz '09]

St Sticky cky-Join D Datalog±

[Calì-Gottlob-Pieris '10]

Fr Frontier-Guarded D Datalog±

[Baget-Mugnier-Rudolph-Thomazo '11]

= less general than

  • C. Kupke

Coalgebra & Data

slide-40
SLIDE 40

Adding negated atoms

The minimal model of a logic program is obtained as the least fixpoint of a monotone operator TP : P(At) ! P(At) such that M is the smallest set of atoms that is closed under application of a (substituted) rule. Simple Example (propositional program) with negation ¬q,p

  • !

q

  • !

p TP(;) = {p}, T2

P(;) = {p, q}

TP(;) = {p}, T2

P(;) = {p, q}, T3 P(;) ?

= {p} ) TP not monotone!

  • C. Kupke

Coalgebra & Data

slide-41
SLIDE 41

Solutions

The addition of nonmonotonic negation to logic programs is well researched, we focused on two options:

I well-founded semantics: canonical model does exist, but

monotone operator more complicated and model is three-valued (F,T,U)

I stable semantics: two valued models, but no canonical

model - in particular, models cannot be obtained as unique least fixpoint of a monotone operator Problem: No previously existing complexity (or even decidability) results for logic programs involving function symbols.

  • C. Kupke

Coalgebra & Data

slide-42
SLIDE 42

Well-Founded Semantics: Definition

van Gelder-Ross-Schlipf ’91

Number(0), Even(0) Number(x) ! Number(s(x)) Number(x) ^ ¬Even(x) ! Even(s(x)) Number(0), Even(0) Number(s(0)), ¬Even(s(0)) Number(s2(0)), Even(s2(0))

I Start with empty set

  • f literals.

I In each step

I Apply the rules to

infer new atoms.

I Add negations of

atoms that can no longer be derived.

I This converges to

the well-founded model!

  • C. Kupke

Coalgebra & Data

slide-43
SLIDE 43

Proof in the positive case

Constant derivation depth Proof “tree” Query Q

h

h(Q)

  • C. Kupke

Coalgebra & Data

slide-44
SLIDE 44

This fails in the negative case

Deciding whether a literal belongs to WFS(D, Σ) may require an infinite number of iterations: R(0, 1), P(0) R(x, y) ! R(y, f(x, y)) R(x, y) ^ ¬P(x) ! Q(y) R(x, y) ^ P(x) ^ ¬Q(y) ! P(y) R(x, y) ^ ¬P(y) ! S(0)

1 2 3 P ¬Q 1 2 3 ¬Q P ¬Q 1 2 ¬Q P ¬Q P

  • C. Kupke

Coalgebra & Data

slide-45
SLIDE 45

Forward Proofs

Schlipf ’95

I Forward proof of an atom R(a) from a program P:

α1

r1

/ α2

r2

/ α3

r3

/

rn

/ R(a)

i.e., a series of rule applications ignoring negative side atoms.

I ¬R(a) will be derived if every forward proof for it “uses” a

negative literal ¬S(b), with S(b) already known to be true.

I R(a) will be derived if there exists a forward proof such

that all side literals are already known to be true.

  • C. Kupke

Coalgebra & Data

slide-46
SLIDE 46

Query answering

I alternating algorithm that either tries to find a forward

proof of a given atom or to show that no such proof for a given negative literal exists

I configurations of the algorithm roughly correspond to

atoms and subsets of their type (in WFS(P))

I key observation: we can identify configurations that are

“X-isomorphic” (where X is the set of relevant constants)

  • C. Kupke

Coalgebra & Data

slide-47
SLIDE 47

Back to the positive case

Constant derivation depth Query Q

h

h(Q) Proof “tree” for the positive program

  • C. Kupke

Coalgebra & Data

slide-48
SLIDE 48

Complexity results

# " !

Input A database D, a guarded normal Datalog± program Σ, and a Boolean conjunctive query Q with negation Question Is Q true in WFS(D, Σ)?

I PTIME-complete in data complexity I EXPTIME-complete if predicate’s arities are bounded by a

constant

I 2-EXPTIME-complete in general

  • C. Kupke

Coalgebra & Data

slide-49
SLIDE 49

A hidden assumption

I the translation into logic programming implies that we

treat all elements of our models as distinct

I Example:

Employee(x) ! 9y hasEmployer(x, y) together with D = {Employee(John), Employee(Sam)}.

I Answer of the query

9x(hasEmployer(John, x) ^ ¬ hasEmployer(Sam, x)) depends on whether we generate for John and Sam distinct employers by applying the rule

I ) Equality-Friendly Well-founded Semantics

  • C. Kupke

Coalgebra & Data

slide-50
SLIDE 50

Guarded Fixed Point Logic

The set of formulas of GFP over R is built from atomic formulas

  • ver R (including equality atoms) using Boolean combinations,

and the following two additional formula formation rules:

  • I. If α is an atomic formula over R containing the variables

in x, and ψ is a GFP formula over R whose free variables

  • ccur in α, then 9x (α ^ ψ) and 8x (α

! ψ) are GFP formulas over R. The formula α is called guard.

  • II. Let R be a k-ary predicate, x a k-tuple of variables, and

ψ(R, x) a GFP formula over R [ {R} whose free variables

  • ccur in x, and where R appears only positively (in the

scope of an even number of negation symbols) and not in

  • guards. Then, [lfpR,x ψ](x) and [gfpR,x ψ](x) are GFP

formulas over R with free variables x.

  • C. Kupke

Coalgebra & Data

slide-51
SLIDE 51

Example Formula GFP

The following GFP formula says that binary relation E is well-founded, i.e., no element is the endpoint of an infinite E-path: 8x, y

  • E(x, y)

! [lfpW,x 8y

  • E(y, x)

! W(y)

  • ](x)
  • .

[Gr¨ adel & Walukiewicz] 2-ExpTime decidability (ExpTime with bounded arities)

  • C. Kupke

Coalgebra & Data

slide-52
SLIDE 52

Translation of WFS into GFP (Idea)

Construct a GFP sentence efwfs(P) whose models closely correspond to the databases in EFWFS(P), i.e., such that for all queries (“covered NBCQs”) Q over the schema of P, we have EFWFS(P) | = Q iff efwfs(P) | = Q⇤.

I The key is to “existentially quantify” all the instances of

NTGDs that we use to compute the WFS, and to mimic the fixed-point definition of the WFS using those instances.

I Fixpoint in WFS is modeled with lfp (derivable atoms) and

gfp (those atoms that certainly cannot be derived).

I Upper bound on set of derived positive atoms and

coveredness for derived negative atoms provides guards.

  • C. Kupke

Coalgebra & Data

slide-53
SLIDE 53

Stable semantics

I Both approaches also work with the stable semantics I Data Complexity increases to coNP I Intuition: Need to check query on all stable models

  • C. Kupke

Coalgebra & Data

slide-54
SLIDE 54

Ref’s

I [Gottlob, Hernich, K., and Lukasiewicz] Equality-friendly

well-founded semantics and applications to description

  • logics. AAAI 2012

I [Hernich, K., Lukasiewicz and Gottlob] Well-founded

semantics for extended datalog and ontological reasoning. PODS 2013

I [Gottlob, Hernich, K., and Lukasiewicz] Stable model

semantics for guarded existential rules and description

  • logics. KR2014
  • C. Kupke

Coalgebra & Data

slide-55
SLIDE 55

Part III: The connections (Future Work!)

  • C. Kupke

Coalgebra & Data

slide-56
SLIDE 56

Datalog±

Issues

I query-rewriting using backward-chaining: very useful - not

sufficiently explored

I need for reasoning with probabilities, weight, preferences

and combinations

I need to operate over semi-structured data

Goals

I Use backward-chaining algorithm from coalgebraic LP to

  • btain “parallellizable” query-rewriting algorithm

I Extend this to Datalog± with nonmonotonic negation I Extend Datalog± to Coalgebraic Datalog± for other types

  • f data.
  • C. Kupke

Coalgebra & Data

slide-57
SLIDE 57

Coalgebraic Datalog±

I Goals:

I extend Datalog± with features such as probabilities, weights

and preferences

I provide efficient algorithms for query-rewriting and query

answering

I Two Approaches:

I generalise coalgebraic LP to other functors I add fixpoint operators to coalgebraic predicate logic to

create coalgebraic LFP or GFP

I [Komendantskaya, Schmidt, and Power] Coalgebraic logic

programming: from semantics to implementation. Journal

  • f Logic and Computation (2014)

I [Litak, Pattinson, Sano, and Schr¨

  • der] Coalgebraic

predicate logic. ICALP (2012)

  • C. Kupke

Coalgebra & Data

slide-58
SLIDE 58

Coalgebraic semi-structured data

I represent tree and graph-structured data coalgebraically I develop theory of data-labelled coalgebras, similar to recent

work on XML trees [Figueira, Figueira, and Areces] Basic Model Theory of XPath on Data Trees. ICDT 2014.

I develop theory of automata operating on data-labelled

structures

  • C. Kupke

Coalgebra & Data

slide-59
SLIDE 59

Coalgebraic (core) XPath

I our starting point is core XPath for data graphs: The path formulae of the two flavors of GXPath are given

  • below. In both cases a ranges over Σ.

Path expressions of Regular graph XPath, denoted by GXPathreg, are given by: α, β := ε | _ | a | a | [ϕ] | α · β | α [ β | α | α⇤ Path expressions of Core graph XPath denoted by GXPathcore are given by: α, β := ε | _ | a | a | a⇤ | a⇤ | [ϕ] | α·β | α[β | α I build coalgebraic core XPath starting from coalgebraic

PDL:

I add * I add non-natural operations I extend path-expressions to properties of the data, e.g. α=,

α6= or regular expressions with memory

I probabilistic or weighted graphs

  • C. Kupke

Coalgebra & Data

slide-60
SLIDE 60

On the connection (G)XPath & PDL

I [Libkin, Martens, and Vrgoc] Querying graph databases

with XPath. ICDT (2013)

I [Alechina, Immermann] Reachability Logic: An Efficient

Fragment of Transitive Closure Logic. Logic Journal of the IGPL (2000)

I [ten Cate, Marx] Navigational XPath: calculus and

  • algebra. ACM SIGMOD Record (2007)

I [ten Cate, Fontaine, Litak] Some modal aspects of XPath.

Journal of Applied Non-Classical Logics (2010)

  • C. Kupke

Coalgebra & Data

slide-61
SLIDE 61

Further steps

I

Ontological query answering for path queries.

I [Cardelli, Ghelli] TQL: a query language for semistructured

data based on the ambient logic. Mathematical Structures in Computer Science (2004)

I long-term: “continuous” queries over streaming data?

  • C. Kupke

Coalgebra & Data

slide-62
SLIDE 62

Thanks!

  • C. Kupke

Coalgebra & Data