• Keine Ergebnisse gefunden

Computing Cores for Existential Rules with the Standard Chase and ASP

N/A
N/A
Protected

Academic year: 2022

Aktie "Computing Cores for Existential Rules with the Standard Chase and ASP"

Copied!
27
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Computing Cores for Existential Rules

with the Standard Chase and ASP

Markus Krötzsch

Knowledge-Based Systems, TU Dresden

(2)

Rules are simple, but what do they mean?

R1 : father (x , y) → male (y)

R2 : person (x) → ∃v . father (x , v) ∧ male (v) person ( ada ) father ( ada , george )

person

male

fa th er

male

person

male

fa th er

fa th er

(3)

Rules are simple, but what do they mean?

R1 : father (x , y) → male (y)

R2 : person (x) → ∃v . father (x , v) ∧ male (v) person ( ada ) father ( ada , george )

person

male

fa th er

male

person

male

fa th er

fa th er

(4)

Rules are simple, but what do they mean?

R1 : father (x , y) → male (y)

R2 : person (x) → ∃v . father (x , v) ∧ male (v) person ( ada ) father ( ada , george )

person

male fa th

er

male

person

male

fa th er

fa th er

(5)

Rules are simple, but what do they mean?

R1 : father (x , y) → male (y)

R2 : person (x) → ∃v . father (x , v) ∧ male (v) person ( ada ) father ( ada , george )

person

male fa th

er

male

person

male

fa th er

fa th er

(6)

Rules are simple, but what do they mean?

R1 : father (x , y) → male (y)

R2 : person (x) → ∃v . father (x , v) ∧ male (v) person ( ada ) father ( ada , george )

person

male fa th

er

male

person

male

fa th

fa th er er

(7)

Rules are simple, but what do they mean?

R1 : father (x , y) → male (y)

R2 : person (x) → ∃v . father (x , v) ∧ male (v) person ( ada ) father ( ada , george )

person

male fa th

er

male

person

male fa th

fa th er er

(8)

Rules are simple, but what do they mean?

R1 : father (x , y) → male (y)

R2 : person (x) → ∃v . father (x , v) ∧ male (v) person ( ada ) father ( ada , george )

person

male fa th

er

male

person

male fa th

fa th er er

(9)

The Core

Simplification: We will only talk about finite chases here.

A core is a finite structure C where every homomor- phism C → C is an isomorphism.

person

male

X Core

fa th er

× No core

male

person

male fa th

fa th er er

homomorphism

(10)

The Core

Simplification: We will only talk about finite chases here.

A core is a finite structure C where every homomor- phism C → C is an isomorphism.

person

male

X Core

fa th er

× No core

male

person

male fa th

fa th er er

homomorphism

(11)

Cores in Practice

The core is the “best among all universal solutions”

– Fagin, Kolaitis, and Popa 2005

• Can be computed effectively

• Possible during the chase: “core chase”

And yet: No current system implements the core chase!

Problem: Computing the core takes exponential time in

the size of the chase.

(12)

Cores in Practice

The core is the “best among all universal solutions”

– Fagin, Kolaitis, and Popa 2005

• Can be computed effectively

• Possible during the chase: “core chase”

And yet: No current system implements the core chase!

Problem: Computing the core takes exponential time in

the size of the chase.

(13)

Cores from the Standard Chase

Idea: Couldn’t we get cores with the standard chase?

Analysis: What went wrong here?

male

person

male fa th

fa th er er

• We applied rule R2 to a match:

person ( ada ) → father ( ada , null) ∧ male (null)

• In the final chase, this instance is satisfied by an alternative match:

person ( ada ) → father ( ada , george ) ∧ male ( george )

Theorem:

Every chase without alternative matches yields a core.

(14)

Cores from the Standard Chase

Idea: Couldn’t we get cores with the standard chase?

Analysis: What went wrong here?

male

person

male fa th

fa th er er

• We applied rule R2 to a match:

person ( ada ) → father ( ada , null) ∧ male (null)

• In the final chase, this instance is satisfied by an alternative match:

person ( ada ) → father ( ada , george ) ∧ male ( george )

Theorem:

Every chase without alternative matches yields a core.

(15)

Cores from the Standard Chase

Idea: Couldn’t we get cores with the standard chase?

Analysis: What went wrong here?

male

person

male fa th

fa th er er

• We applied rule R2 to a match:

person ( ada ) → father ( ada , null) ∧ male (null)

• In the final chase, this instance is satisfied by an alternative match:

person ( ada ) → father ( ada , george ) ∧ male ( george )

Theorem:

Every chase without alternative matches yields a core.

(16)

Cores from the Standard Chase

Idea: Couldn’t we get cores with the standard chase?

Analysis: What went wrong here?

male

person

male fa th

fa th er er

• We applied rule R2 to a match:

person ( ada ) → father ( ada , null) ∧ male (null)

• In the final chase, this instance is satisfied by an alternative match:

person ( ada ) → father ( ada , george ) ∧ male ( george )

Theorem:

Every chase without alternative matches yields a core.

(17)

A Characterisation in ASP

Idea: Characterise alternative-match-free standard chases in ASP.

Encoding:

• Use terms with (skolem) function symbols instead of named nulls

• Augment rules with precondition that they are “not blocked”

• Add rules that derive that a rule is “blocked” when an alternative match is found

Theorem: Cores from a chase without alternative

matches correspond to the stable models of suitable nor-

mal logic programs.

(18)

A Characterisation in ASP

Idea: Characterise alternative-match-free standard chases in ASP.

Encoding:

• Use terms with (skolem) function symbols instead of named nulls

• Augment rules with precondition that they are “not blocked”

• Add rules that derive that a rule is “blocked” when an alternative match is found

Theorem: Cores from a chase without alternative

matches correspond to the stable models of suitable nor-

mal logic programs.

(19)

A Characterisation in ASP

Idea: Characterise alternative-match-free standard chases in ASP.

Encoding:

• Use terms with (skolem) function symbols instead of named nulls

• Augment rules with precondition that they are “not blocked”

• Add rules that derive that a rule is “blocked” when an alternative match is found

Theorem: Cores from a chase without alternative

matches correspond to the stable models of suitable nor-

(20)

Chasing for Cores

Can we guide the standard chase to produce a core?

Core Stratification:

• Define R1 ≺ R2 to mean “R1 could produce structures that enable alternative matches for R2”

• Stratify the order of rule applications w.r.t. ≺

(together with a more usual positive “dependency” ≺ + )

Results:

• Core stratification of a rule set can be decided in Σ P 2 .

• If a chase is core stratified, then it has no alternative

matches (and therefore yields a core).

(21)

Chasing for Cores

Can we guide the standard chase to produce a core?

Core Stratification:

• Define R1 ≺ R2 to mean “R1 could produce structures that enable alternative matches for R2”

• Stratify the order of rule applications w.r.t. ≺

(together with a more usual positive “dependency” ≺ + )

Results:

• Core stratification of a rule set can be decided in Σ P 2 .

• If a chase is core stratified, then it has no alternative

(22)

Finite universal model (=finite core)

Computed by a standard chase

Computed by chase without alternative matches

Core stratified chase

Polynomial core stratified chase

(23)

Existentials and Negation

A (classically) stratified logic program:

R1 : father(x , y) → male(y)

R2 : person(x) → ∃v . father(x , v) ∧ male(v) R3 : father(x , y) → equals(y , y)

R4 : father(x , y 1 ) ∧ father(x , y 2 ) ∧

not equals(y 1 , y 2 ) → distinct(y 1 , y 2 )

X Core

person

male fa th

er

X Core

male

person

male fa th

fa th er er

distinct

(24)

Existentials and Negation

A (classically) stratified logic program:

R1 : father(x , y) → male(y)

R2 : person(x) → ∃v . father(x , v) ∧ male(v) R3 : father(x , y) → equals(y , y)

R4 : father(x , y 1 ) ∧ father(x , y 2 ) ∧

not equals(y 1 , y 2 ) → distinct(y 1 , y 2 )

X Core

person

male fa th

er

X Core

male

person

male fa th

fa th er er

distinct

(25)

Perfect Core Models

Idea: Combine core stratification & classical stratification.

{ “Full stratification”

Theorem: A finite, fully stratified chase yield a unique stable model that is a core, the perfect core model.

person

male fa th

er

male

person

male fa th

fa th er er

distinct

(26)

Perfect Core Models

Idea: Combine core stratification & classical stratification.

{ “Full stratification”

Theorem: A finite, fully stratified chase yield a unique stable model that is a core, the perfect core model.

person

male fa th

er

male

person

male fa th

fa th er er

distinct

(27)

Main insight: Cores are in reach for practical uses

• Existing ASP engines can compute them

• Existing chase implementations can compute them

• Cores could be key to mix existentials and non-monotonic negation

Next questions:

• How do practical implementations perform?

• Is core stratification common in practice?

• Can we generalise perfect core models?

Referenzen

ÄHNLICHE DOKUMENTE

In this section, we present equality model-faithful acyclic- ity (EMFA), an acyclicity notion based on model-faithful acyclicity (MFA) (Cuenca Grau et al. 2013) that can be di-

A fully stratified chase sequence is a standard chase that is based on the set of rules Σ + obtained from Σ by omitting the negative body χ ¯ in each rule, and such that for all steps

We develop Disjunctive Model Faithful Acyclic- ity (DMFA) as a novel acyclicity notion for the disjunctive skolem chase variant by using ideas from Model Faithful Acyclicity (MFA)

J The previous observation that the stable chase sequence yields a core cover, together with the BCQ-equivalence of stable chase and Σ (Theorem 31), lets us apply Theorem 18 to

Ontologies for Knowledge Graphs: Breaking the Rules, Kr¨ otzsch & Thost [ISWC

We extend the Datalog engine VLog to develop a column-oriented implementation of the skolem and the restricted chase – two variants of a sound and complete algorithm used for

The maximal nesting depth of function terms in the chase tree is bounded by the number of existentially quantified variables in R, since a greater depth can only be achieved

David Carral, Irina Dragoste, Markus Krötzsch TU Dresden... BCQ entailment: co-N2ExpTime