• Keine Ergebnisse gefunden

Reliance-Based Optimization of Existential Rule Reasoning

N/A
N/A
Protected

Academic year: 2022

Aktie "Reliance-Based Optimization of Existential Rule Reasoning"

Copied!
72
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Reliance-Based Optimization of Existential Rule Reasoning

Alex Ivliev

TU Dresden

(2)

Introduction

leadRole(a, r , m) → stars(a, m) stars(a, m) ∧ stars(b, m) → costar(a, b, m)

bigBudget(m) → ∃a. stars(a, m) ∧ famous(a)

leadRole A 2 R 1 M 2

bigBudget M 1 M 2

stars A 1 M 1 A 2 M 1

A 1 M 2

famous A 2

costar

(3)

Introduction

leadRole(a, r , m) → stars(a, m) stars(a, m) ∧ stars(b, m) → costar(a, b, m)

bigBudget(m) → ∃a. stars(a, m) ∧ famous(a)

leadRole A 2 R 1 M 2

bigBudget M 1

stars A 1 M 1 A 2 M 1

A 1 M 2

famous A 2

costar

(4)

Introduction

leadRole(a, r , m) → stars(a, m) stars(a, m) ∧ stars(b, m) → costar(a, b, m)

bigBudget(m) → ∃a. stars(a, m) ∧ famous(a)

h = {m 7→ M 1 } leadRole

A 2 R 1 M 2 bigBudget

M 1 M 2

stars A 1 M 1 A 2 M 1

A 1 M 2

famous A 2

costar

(5)

Introduction

leadRole(a, r , m) → stars(a, m) stars(a, m) ∧ stars(b, m) → costar(a, b, m)

bigBudget(m) → ∃a. stars(a, m) ∧ famous(a)

h = {m 7→ M 1 } leadRole

A 2 R 1 M 2 bigBudget

M 1

stars A 1 M 1 A 2 M 1

A 1 M 2

famous A 2

costar

(6)

Introduction

leadRole(a, r , m) → stars(a, m) stars(a, m) ∧ stars(b, m) → costar(a, b, m)

bigBudget(m) → ∃a. stars(a, m) ∧ famous(a)

h = {m 7→ M 2 } leadRole

A 2 R 1 M 2 bigBudget

M 1 M 2

stars A 1 M 1 A 2 M 1

A 1 M 2

famous A 2

costar

(7)

Introduction

leadRole(a, r , m) → stars(a, m) stars(a, m) ∧ stars(b, m) → costar(a, b, m)

bigBudget(m) → ∃a. stars(a, m) ∧ famous(a)

leadRole A 2 R 1 M 2

bigBudget M 1

stars A 1 M 1 A 2 M 1

A 1 M 2 n M

famous A 2

n

costar

(8)

Introduction

leadRole(a, r , m) → stars(a, m) stars(a, m) ∧ stars(b, m) → costar(a, b, m)

bigBudget(m) → ∃a. stars(a, m) ∧ famous(a)

leadRole A 2 R 1 M 2

bigBudget M 1 M 2

stars A 1 M 1 A 2 M 1

A 1 M 2 n M 2

famous A 2

n

costar

(9)

Introduction

leadRole(a, r , m) → stars(a, m) stars(a, m) ∧ stars(b, m) → costar(a, b, m)

bigBudget(m) → ∃a. stars(a, m) ∧ famous(a)

stars A 1 M 1 A 2 M 1 A 1 M 2 n M

./

stars A 1 M 1 A 2 M 1 A 1 M 2 n M

=

costar A 1 A 1 M 1 A 1 A 2 M 1 A 2 A 1 M 1

. . .

(10)

Introduction

leadRole(a, r , m) → stars(a, m) stars(a, m) ∧ stars(b, m) → costar(a, b, m)

bigBudget(m) → ∃a. stars(a, m) ∧ famous(a)

leadRole A 2 R 1 M 2

bigBudget M 1 M 2

stars A 1 M 1 A 2 M 1

A 1 M 2 n M 2

famous A 2

n

costar A 1 A 1 M 1 A 1 A 2 M 1

A 2 A 1 M 1

. . .

(11)

Introduction

leadRole(a, r , m) → stars(a, m) stars(a, m) ∧ stars(b, m) → costar(a, b, m)

bigBudget(m) → ∃a. stars(a, m) ∧ famous(a)

leadRole A 2 R 1 M 2

bigBudget M 1

stars A 1 M 1 A 2 M 1

A 1 M 2 n M

famous A 2

n

costar A 1 A 1 M 1 A 1 A 2 M 1

A 2 A 1 M 1

. . .

(12)

Introduction

leadRole(a, r , m) → stars(a, m) stars(a, m) ∧ stars(b, m) → costar(a, b, m)

bigBudget(m) → ∃a. stars(a, m) ∧ famous(a)

h alt = {m 7→ M 1 , a 7→ A 2 } leadRole

A 2 R 1 M 2 bigBudget

M 1 M 2

stars A 1 M 1 A 2 M 1

A 1 M 2 n M 2 A 2 M 2

famous A 2

n

costar A 1 A 1 M 1 A 1 A 2 M 1

A 2 A 1 M 1

. . .

(13)

Introduction

leadRole(a, r , m) → stars(a, m) stars(a, m) ∧ stars(b, m) → costar(a, b, m)

bigBudget(m) → ∃a. stars(a, m) ∧ famous(a)

costar(a, b, m) ∧ famous(a) → famousCostar(a, b)

costar A

1

A

1

M

1

A

1

A

2

M

1

. . . A

2

A

2

M

2

./

famous A

2

n

(14)

Optimization Goals

Optimization 1: Minimize number of alternative Matches Avoids introducing redundant facts

Might lead to core models

Optimization 2: Minimize number of rule applications Avoids splitting facts across multiple tables

Reduces number of temporary unions of blocks

Current approach by VLog: Cycle through rules but prefer datalog rules

(15)

Datalog First

book(x) → ∃v . writtenBy(x, v ) ∧ author(v ) author(x) → ∃w . authorOf(x, w ) ∧ book(w ) authorOf(x, y ) → writtenBy(y , x)

writtenBy(x, y ) → authorOf(y , x )

book 1 author 1 book 2 . . .

writtenBy authorOf writtenBy writtenBy authorOf

authorOf

(16)

Datalog First

book(x) → ∃v . writtenBy(x, v ) ∧ author(v ) author(x) → ∃w . authorOf(x, w ) ∧ book(w ) authorOf(x, y ) → writtenBy(y , x)

writtenBy(x, y ) → authorOf(y , x )

book 1

author 1 book 2 . . .

writtenBy authorOf writtenBy writtenBy authorOf

authorOf

(17)

Datalog First

book(x) → ∃v . writtenBy(x, v ) ∧ author(v ) author(x) → ∃w . authorOf(x, w ) ∧ book(w ) authorOf(x, y ) → writtenBy(y , x)

writtenBy(x, y ) → authorOf(y , x )

book 1 author 1

book 2 . . .

writtenBy

authorOf writtenBy writtenBy authorOf

authorOf

(18)

Datalog First

book(x) → ∃v . writtenBy(x, v ) ∧ author(v ) author(x) → ∃w . authorOf(x, w ) ∧ book(w ) authorOf(x, y ) → writtenBy(y , x)

writtenBy(x, y ) → authorOf(y , x )

book 1 author 1 book 2

. . . writtenBy

authorOf

writtenBy

writtenBy

authorOf

authorOf

(19)

Datalog First

book(x) → ∃v . writtenBy(x, v ) ∧ author(v ) author(x) → ∃w . authorOf(x, w ) ∧ book(w ) authorOf(x, y ) → writtenBy(y , x)

writtenBy(x, y ) → authorOf(y , x )

book 1 author 1 book 2 . . .

writtenBy authorOf

writtenBy writtenBy authorOf

authorOf

(20)

Datalog First

book(x) → ∃v . writtenBy(x, v ) ∧ author(v ) author(x) → ∃w . authorOf(x, w ) ∧ book(w ) authorOf(x, y ) → writtenBy(y , x)

writtenBy(x, y ) → authorOf(y , x )

book 1

author 1 book 2 . . .

writtenBy authorOf writtenBy writtenBy authorOf

authorOf

(21)

Datalog First

book(x) → ∃v . writtenBy(x, v ) ∧ author(v ) author(x) → ∃w . authorOf(x, w ) ∧ book(w ) authorOf(x, y ) → writtenBy(y , x)

writtenBy(x, y ) → authorOf(y , x )

book 1 author 1

book 2 . . .

writtenBy

authorOf writtenBy writtenBy authorOf

authorOf

(22)

Datalog First

book(x) → ∃v . writtenBy(x, v ) ∧ author(v ) author(x) → ∃w . authorOf(x, w ) ∧ book(w ) authorOf(x, y ) → writtenBy(y , x)

writtenBy(x, y ) → authorOf(y , x )

book 1 author 1

book 2 . . . writtenBy authorOf writtenBy

writtenBy

authorOf

authorOf

(23)

Datalog First

book(x ) → ∃v , i . writtenBy(x , v , i ) ∧ author(v ) author(x ) → ∃w , i . authorOf(x , w , i ) ∧ book(w ) authorOf(x , y , j ) → ∃i . writtenBy(y , x , i )

writtenBy(x , y , j ) → ∃i . authorOf(y , x , i)

book 1 author 1 book 2 . . .

writtenBy authorOf writtenBy writtenBy authorOf

authorOf

(24)

Reliances

Positive Reliances: ρ 1 ≺ + ρ 2 Restraint Reliances: ρ 1 ≺ ρ 2

I a

I b

J

@ J @

h 11 )

h 22 ) h 22 )

I a = {leadRole(A 2 , R 1 , M 2 )}

I b = I a ∪ {stars(A 2 , M 2 )}

leadRole(a, r , m) → stars(a, m)

stars(a, m) ∧ stars(b, m)

→ costar(a, b, m)

J

I a

I b

h 22 )

h 11 )

h 2 alt

I a = J ∪ {stars(n, M 2 ), famous(n)}

I b = I a ∪ {stars(A 2 , M 2 )}

J = {bigBudget(M 2 ), famous(A 2 )}

leadRole(a, r, m) → stars(a, m) bigBudget(m)

→ ∃a. stars(a, m) ∧ famous(a)

(25)

Reliances

Positive Reliances: ρ 1 ≺ + ρ 2 Restraint Reliances: ρ 1 ≺ ρ 2

I a

I b

J

@ J @

h 11 )

h 22 ) h 22 )

I a = {leadRole(A 2 , R 1 , M 2 )}

I b = I a ∪ {stars(A 2 , M 2 )}

leadRole(a, r , m) → stars(a, m)

stars(a, m) ∧ stars(b, m)

→ costar(a, b, m)

J

I a

I b

h 22 )

h 11 )

h 2 alt

I a = J ∪ {stars(n, M 2 ), famous(n)}

I b = I a ∪ {stars(A 2 , M 2 )}

J = {bigBudget(M 2 ), famous(A 2 )}

leadRole(a, r, m) → stars(a, m) bigBudget(m)

→ ∃a. stars(a, m) ∧ famous(a)

(26)

Reliances

Positive Reliances: ρ 1 ≺ + ρ 2 Restraint Reliances: ρ 1 ≺ ρ 2

I a

I b

J

@ J @

h 11 )

h 2 (ρ 2 )

h 22 )

I a = {leadRole(A 2 , R 1 , M 2 )}

I b = I a ∪ {stars(A 2 , M 2 )}

leadRole(a, r , m) → stars(a, m)

stars(a, m) ∧ stars(b, m)

→ costar(a, b, m)

J

I a

I b

h 22 )

h 11 )

h 2 alt

I a = J ∪ {stars(n, M 2 ), famous(n)}

I b = I a ∪ {stars(A 2 , M 2 )}

J = {bigBudget(M 2 ), famous(A 2 )}

leadRole(a, r, m) → stars(a, m) bigBudget(m)

→ ∃a. stars(a, m) ∧ famous(a)

(27)

Reliances

Positive Reliances: ρ 1 ≺ + ρ 2 Restraint Reliances: ρ 1 ≺ ρ 2

I a

I b

@ J @

h 11 )

h 2 (ρ 2 ) h 22 )

I a = {leadRole(A 2 , R 1 , M 2 )}

I b = I a ∪ {stars(A 2 , M 2 )}

leadRole(a, r , m) → stars(a, m)

stars(a, m) ∧ stars(b, m)

→ costar(a, b, m)

J

I a

I b

h 22 )

h 11 )

h 2 alt

I a = J ∪ {stars(n, M 2 ), famous(n)}

I b = I a ∪ {stars(A 2 , M 2 )}

J = {bigBudget(M 2 ), famous(A 2 )}

leadRole(a, r, m) → stars(a, m) bigBudget(m)

→ ∃a. stars(a, m) ∧ famous(a)

(28)

Reliances

Positive Reliances: ρ 1 ≺ + ρ 2 Restraint Reliances: ρ 1 ≺ ρ 2

I a

I b

J

@ J @

h 11 )

h 2 (ρ 2 ) h 22 )

I a = {leadRole(A 2 , R 1 , M 2 )}

I b = I a ∪ {stars(A 2 , M 2 )}

leadRole(a, r , m) → stars(a, m)

stars(a, m) ∧ stars(b, m)

→ costar(a, b, m)

J

I a

I b

h 22 )

h 11 )

h 2 alt

I a = J ∪ {stars(n, M 2 ), famous(n)}

I b = I a ∪ {stars(A 2 , M 2 )}

J = {bigBudget(M 2 ), famous(A 2 )}

leadRole(a, r, m) → stars(a, m) bigBudget(m)

→ ∃a. stars(a, m) ∧ famous(a)

(29)

Reliances

Positive Reliances: ρ 1 ≺ + ρ 2 Restraint Reliances: ρ 1 ≺ ρ 2

I a

I b

@ J @

h 11 )

h 22 )

h 22 )

I a = {leadRole(A 2 , R 1 , M 2 )}

I b = I a ∪ {stars(A 2 , M 2 )}

leadRole(a, r , m) → stars(a, m)

stars(a, m) ∧ stars(b, m)

→ costar(a, b, m)

J

I a

I b

h 22 )

h 11 )

h 2 alt

I a = J ∪ {stars(n, M 2 ), famous(n)}

I b = I a ∪ {stars(A 2 , M 2 )}

J = {bigBudget(M 2 ), famous(A 2 )}

leadRole(a, r, m) → stars(a, m) bigBudget(m)

→ ∃a. stars(a, m) ∧ famous(a)

(30)

Reliances

Positive Reliances: ρ 1 ≺ + ρ 2 Restraint Reliances: ρ 1 ≺ ρ 2

I a

I b

J

@ J @

h 11 )

h 2 (ρ 2 ) h 22 )

I a = {leadRole(A 2 , R 1 , M 2 )}

I b = I a ∪ {stars(A 2 , M 2 )}

leadRole(a, r , m) → stars(a, m)

stars(a, m) ∧ stars(b, m)

→ costar(a, b, m)

J

I a

I b

h 22 )

h 11 )

h 2 alt

I a = J ∪ {stars(n, M 2 ), famous(n)}

I b = I a ∪ {stars(A 2 , M 2 )}

J = {bigBudget(M 2 ), famous(A 2 )}

leadRole(a, r, m) → stars(a, m) bigBudget(m)

→ ∃a. stars(a, m) ∧ famous(a)

(31)

Reliances

Positive Reliances: ρ 1 ≺ + ρ 2 Restraint Reliances: ρ 1 ≺ ρ 2

I a

I b

@ J @

h 11 )

h 2 (ρ 2 ) h 22 )

I a = {leadRole(A 2 , R 1 , M 2 )}

I b = I a ∪ {stars(A 2 , M 2 )}

leadRole(a, r , m) → stars(a, m)

stars(a, m) ∧ stars(b, m)

→ costar(a, b, m)

J

I a

h 22 )

h 11 )

h 2 alt

I a = J ∪ {stars(n, M 2 ), famous(n)}

I b = I a ∪ {stars(A 2 , M 2 )}

J = {bigBudget(M 2 ), famous(A 2 )}

leadRole(a, r, m) → stars(a, m) bigBudget(m)

→ ∃a. stars(a, m) ∧ famous(a)

(32)

Reliances

Positive Reliances: ρ 1 ≺ + ρ 2 Restraint Reliances: ρ 1 ≺ ρ 2

I a

I b

J

@ J @

h 11 )

h 2 (ρ 2 ) h 22 )

I a = {leadRole(A 2 , R 1 , M 2 )}

I b = I a ∪ {stars(A 2 , M 2 )}

leadRole(a, r , m) → stars(a, m)

stars(a, m) ∧ stars(b, m)

→ costar(a, b, m)

J

I a

I b

h 22 )

h 11 )

h 2 alt

I a = J ∪ {stars(n, M 2 ), famous(n)}

I b = I a ∪ {stars(A 2 , M 2 )}

J = {bigBudget(M 2 ), famous(A 2 )}

leadRole(a, r, m) → stars(a, m)

bigBudget(m)

→ ∃a. stars(a, m) ∧ famous(a)

(33)

Reliances

Positive Reliances: ρ 1 ≺ + ρ 2 Restraint Reliances: ρ 1 ≺ ρ 2

I a

I b

@ J @

h 11 )

h 2 (ρ 2 ) h 22 )

I a = {leadRole(A 2 , R 1 , M 2 )}

I b = I a ∪ {stars(A 2 , M 2 )}

leadRole(a, r , m) → stars(a, m)

stars(a, m) ∧ stars(b, m)

→ costar(a, b, m)

J

I a

I b

h 22 )

h 11 )

h 2 alt

I a = J ∪ {stars(n, M 2 ), famous(n)}

J = {bigBudget(M 2 ), famous(A 2 )}

leadRole(a, r, m) → stars(a, m) bigBudget(m)

→ ∃a. stars(a, m) ∧ famous(a)

(34)

Calculating Reliances – Unification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

(35)

Calculating Reliances – Unification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

(36)

Calculating Reliances – Unification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

(37)

Calculating Reliances – Unification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

(38)

Calculating Reliances – Unification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

(39)

Calculating Reliances – Unification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

(40)

Calculating Reliances – Unification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

(41)

Calculating Reliances – Unification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

(42)

Calculating Reliances – Verification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

1 Compute unifer η

2 I a = ϕ 1 η ∪ ϕ 22 η

3 I b = I a ∪ ψ 1 η

4 Check I b 6| = ψ 2 η

η = {x 2 /x 1 /y 1 7→ c xy , v 7→ n v , y 2 7→ n v , z 1 7→ c z }

I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

(43)

Calculating Reliances – Verification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

1 Compute unifer η

2 I a = ϕ 1 η ∪ ϕ 22 η

3 I b = I a ∪ ψ 1 η

4 Check I b 6| = ψ 2 η

η = {x 2 /x 1 /y 1 7→ c xy , v 7→ n v , y 2 7→ n v , z 1 7→ c z }

I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

(44)

Calculating Reliances – Verification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

1 Compute unifer η

2 I a = ϕ 1 η ∪ ϕ 22 η

3 I b = I a ∪ ψ 1 η

4 Check I b 6| = ψ 2 η

η = {x 2 /x 1 /y 1 7→ c xy , v 7→ n v , y 2 7→ n v , z 1 7→ c z }

I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

(45)

Calculating Reliances – Verification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

1 Compute unifer η

2 I a = ϕ 1 η ∪ ϕ 22 η

3 I b = I a ∪ ψ 1 η

4 Check I b 6| = ψ 2 η

η = {x 2 /x 1 /y 1 7→ c xy ,

v 7→ n v , y 2 7→ n v , z 1 7→ c z }

I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

(46)

Calculating Reliances – Verification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

1 Compute unifer η

2 I a = ϕ 1 η ∪ ϕ 22 η

3 I b = I a ∪ ψ 1 η

4 Check I b 6| = ψ 2 η

η = {x 2 /x 1 /y 1 7→ c xy , v 7→ n v , y 2 7→ n v ,

z 1 7→ c z }

I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

(47)

Calculating Reliances – Verification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

1 Compute unifer η

2 I a = ϕ 1 η ∪ ϕ 22 η

3 I b = I a ∪ ψ 1 η

4 Check I b 6| = ψ 2 η

η = {x 2 /x 1 /y 1 7→ c xy , v 7→ n v , y 2 7→ n v , z 1 7→ c z } I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

(48)

Calculating Reliances – Verification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

1 Compute unifer η

2 I a = ϕ 1 η ∪ ϕ 22 η

3 I b = I a ∪ ψ 1 η

4 Check I b 6| = ψ 2 η

η = {x 2 /x 1 /y 1 7→ c xy , v 7→ n v , y 2 7→ n v , z 1 7→ c z } I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

(49)

Calculating Reliances – Verification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

1 Compute unifer η

2 I a = ϕ 1 η ∪ ϕ 22 η

3 I b = I a ∪ ψ 1 η

4 Check I b 6| = ψ 2 η

η = {x 2 /x 1 /y 1 7→ c xy , v 7→ n v , y 2 7→ n v , z 1 7→ c z } I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

(50)

Calculating Reliances – Verification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

1 Compute unifer η

2 I a = ϕ 1 η ∪ ϕ 22 η

3 I b = I a ∪ ψ 1 η

4 Check I b 6| = ψ 2 η

η = {x 2 /x 1 /y 1 7→ c xy , v 7→ n v , y 2 7→ n v , z 1 7→ c z } I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

I b 6| = ∃w. a(w , w) ∧ b(c xy )

(51)

Calculating Reliances – Verification

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

1 Compute unifer η

2 I a = ϕ 1 η ∪ ϕ 22 η

3 I b = I a ∪ ψ 1 η

4 Check I b 6| = ψ 2 η

η = {x 2 /x 1 /y 1 7→ c xy , v 7→ n v , y 2 7→ n v , z 1 7→ c z } I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

I b | = ∃w. a(w , w)

(52)

Calculating Reliances – Completeness

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

J a = {r (7), a(1, 1), b(2), p(1, 1)}

J b = J a ∪ {p(1, n v ), q(n v , 1)}

I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

h(ρ 1 ) η(ρ 1 )

τ = {c xy 7→ 1, c z 7→ 2}

(53)

Calculating Reliances – Completeness

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

J a = {r (7), a(1, 1), b(2), p(1, 1)}

J b = J a ∪ {p(1, n v ), q(n v , 1)}

I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

h(ρ 1 )

η(ρ 1 )

τ = {c xy 7→ 1, c z 7→ 2}

(54)

Calculating Reliances – Completeness

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

J a = {r (7), a(1, 1), b(2), p(1, 1)}

J b = J a ∪ {p(1, n v ), q(n v , 1)}

I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

h(ρ 1 ) η(ρ 1 )

τ = {c xy 7→ 1, c z 7→ 2}

(55)

Calculating Reliances – Completeness

a(x 1 , y 1 ) ∧ b(z 1 ) →∃v . p(x 1 , v ) ∧ q(v , y 1 )

p(x 2 , x 2 ) ∧ p(x 2 , y 2 ) ∧ q(y 2 , x 2 ) → ∃w . a(w , w ) ∧ b(x 2 )

J a = {r (7), a(1, 1), b(2), p(1, 1)}

J b = J a ∪ {p(1, n v ), q(n v , 1)}

I a = {a(c xy , c xy ), b(c z ), p(c xy , c xy )}

I b = I a ∪ {p(c xy , n v ), q(n v , c xy )}

h(ρ 1 ) η(ρ 1 )

(56)

Rule Order – Ideal Case

stars(a, m) ∧ stars(b, m) → costar(a, b, m) leadRole(a, r , m) → stars(a, m) bigBudget(m)

→ ∃a. stars(a, m) ∧ famous(a)

+ +

Core-stratified = No cycle containing a ≺ -reliance Possible to compute a core model

Possible to apply every rule only once

(57)

Rule Order – Non-Stratified Case

+

+

+

+

+ +

+

+

rule

applicable

selected

(58)

Rule Order – Non-Stratified Case

+

+

+

+

+ +

+

+

rule

applicable

selected

(59)

Rule Order – Non-Stratified Case

+

+

+

+

+ +

+

+

rule

applicable

selected

(60)

Rule Order – Non-Stratified Case

+

+

+ +

+

+

rule

applicable

selected

(61)

Rule Order – Non-Stratified Case

+ +

+

+

rule

applicable

selected

(62)

Rule Order – Non-Stratified Case

+ +

+

+

rule

applicable

selected

(63)

Rule Order – Non-Stratified Case

+ +

+

+

rule

applicable

selected

(64)

Rule Order – Non-Stratified Case

rule

applicable

selected

(65)

Rule Order – Non-Stratified Case

+ +

+

+

rule

applicable

selected

(66)

Unrestrained First

book(x ) → ∃v , i . writtenBy(x , v , i ) ∧ author(v ) author(x ) → ∃w , i . authorOf(x , w , i ) ∧ book(w ) authorOf(x , y , j ) → ∃i . writtenBy(y , x , i )

writtenBy(x , y , j ) → ∃i . authorOf(y , x , i)

(67)

Evaluation

Implemented reliance calculating and ordering strategy into VLog Measured performance on several knowledge bases

ChaseBench: Deep , LUBM , Ontology-256 , STB-128 , Doctors , UOBM

Real World: UniProt , Reactome

Created: Cycle

(68)

Average Rule Applications

Cycle Deep LUBM UniProt

0 5 10 15

Avg. #Rule A p plications

VLog

PosFirst

UnresFirst

(69)

Time Measurements

1 2 3 4 5

Sp eedup

PosFirst

(70)

Alternative Matches

Dataset Strat. Facts PosFst UnresFst

Sel. Delta Sel. Delta

Cycle 3 0.4M 0 0 0 0

Doctors 3 0.8M 0 0 0 0

Reactome 3 11.4M 0 0 0 0

STB 3 1.9M 0 0 0 0

UniProt 3 24.2M 0 0 0 0

LUBM 7 18.7M 3 0 0 0

Deep 7 0.9M 1148 +19K 2032 -0.5K

Ontology 7 5.7M 123 0 64 0

UOMB 7 18.6M 21 +35K 6 -12K

(71)

Cost of Computing Reliances

96.4 % VLog

3.6 %

Reliances

(72)

Summary

Summary:

We optimized the order of rule execution by analysing the relationships between rules of a given program

Positive reliance: Avoids unnecessary rule executions Restraint reliance: Avoids redundant facts

Strategy shows potential for improving run times No significant reduction in the number of derived facts Computation reliances is cheap even on larger rule sets Future work:

Repeat experiments with larger input facts or other rule sets Problem: Strategy might exclude terminating runs

Analyze factors that influence run time outside of reliances

Referenzen

ÄHNLICHE DOKUMENTE

For a rule set without strong restraining relations, if there exists an unfair non-terminating restricted chase sequence, then there exists a fair non-terminating restricted

Instead of considering a linear order, the existential rule query that we define for a given Turing machine will gener- ate all finite lists containing elements of the domain.. Some

The KB consists of nonmono- tonic existential rules that formally describe molecular structures and chemical classes; this representation can subsequently be used to determine

For the discussed languages with exponential time data complexity (i.e. weakly guarded and weakly frontier-guarded rules), we showed that, extended with negation on input facts,

Because it held previously that ad homineslaws raise issues under the rule of law (see Baka v. 117), the Court concluded that the amendment violates the rule of law and constitutes

that the TEU prohibits the European Council to exercise legislative functions and c) the Conclusions suspend the application of the regulation until the end of the potential action

The two most likely ways the Supreme Court can get involved relate to the election outcome. With the mail-in and absentee votes central to the 2020 election, a delayed.. result

Therefore, all statutory law enacted by parliament and all measures taken by the government and other authorities have to fully comply with the Austrian constitutional framework.. The