Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from...

58
Answer Set Programming Graphs for Answer Set Programs Construction of Explanation Graphs from Extended Dependency Graphs Choosing Assumptions Answer Set Programming Graphs for Answer Set Programs Construction of Explanation Graphs from Extended Dependency Graphs Choosing Assumptions 1

Transcript of Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from...

Page 1: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Answer Set Programming Graphs for Answer Set Programs Constructionof Explanation Graphs from Extended Dependency Graphs ChoosingAssumptions Answer Set Programming Graphs for Answer Set ProgramsConstruction of Explanation Graphs from Extended Dependency GraphsChoosing Assumptions

1

Page 2: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Construction of Explanation Graphs from ExtendedDependency Graphs for Answer Set Programs

Ella Albrecht, Patrick Krumpelmann, Gabriele Kern-Isberner

Lehrstuhl Informatik I, Technische Universitat Dortmund

11. September 2013

1

Page 3: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Overview

Answer Set Programming

Graphs for Answer Set Programs2.1 Extended Dependency Graph2.2 Explanation Graph

Construction of Explanation Graphs from Extended Dependency Graphs

Choosing Assumptions

2

Page 4: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Outline

Answer Set Programming

Graphs for Answer Set Programs2.1 Extended Dependency Graph2.2 Explanation Graph

Construction of Explanation Graphs from Extended Dependency Graphs

Choosing Assumptions

Answer Set Programming 3

Page 5: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Answer Set Programming

Definition (Extended Logic Program)

An extended logic program P is a set of rules r of the formr : h← a1, . . . ,am,not b1, . . . ,not bn.

I body(r) = {a1, . . . ,am,b1, . . . ,bn}I pos(r) = {a1, . . . ,am}, neg(r) = {b1, . . . ,bn}I herbrand basis H (P): set of all grounded literals of P

Definition (Answer Set)

I M ⊆H (P): consistent set of literals

I M is closed under P if head(r) ∈M whenever pos(r)⊆M andneg(r)∩M = /0 for all rules r ∈ P

I M is an answer set of P if M is closed and minimal w.r.t. set inclusionAnswer Set Programming 4

Page 6: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Outline

Answer Set Programming

Graphs for Answer Set Programs2.1 Extended Dependency Graph2.2 Explanation Graph

Construction of Explanation Graphs from Extended Dependency Graphs

Choosing Assumptions

Graphs for Answer Set Programs 5

Page 7: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Extended Dependency Graphs

Definition (Extended Dependency Graph)

The EDG for a logic program P is a directed graph EDG (P) = (V ,E )with nodes V and edges E ⊆ V ×V ×{+,−}.

a1

b2

c3 c4

d5 e6 f 7

++

+

+

++

+

+

− −

−r1 : a← not b.

r2 : b← not a.

r3 : c ← not a.

r4 : c ← e.

r5 : d ← c .

r6 : e← not d .

r7 : f ← e, not f .

Graphs for Answer Set Programs 6

Page 8: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Extended Dependency Graphs

Definition (Extended Dependency Graph)

The EDG for a logic program P is a directed graph EDG (P) = (V ,E )with nodes V and edges E ⊆ V ×V ×{+,−}.

a1

b2

c3 c4

d5 e6 f 7

a1

b2

c3 c4

d5 e6 f 7

++

+

+

++

+

+

− −

−r1 : a← not b.

r2 : b← not a.

r3 : c ← not a.

r4 : c ← e.

r5 : d ← c .

r6 : e← not d .

r7 : f ← e, not f .

Graphs for Answer Set Programs 6

Page 9: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Explanation Graph

Definition (Explanation Graph)

An Explanation Graph for a literal a ∈H p ∪H n in a program P w.r.t. an answer setM and an assumption U ⊆H (P) is a directed graph G = (V ,E)

I node set V ⊆H p ∪H n ∪{>,⊥,assume}I edge set E ⊆ V ×V ×{+,−}I H p = {a+ | a ∈H (P)}, H n = {a− | H (P)}.

k+

>

+

l−

−c−

assume

j+

k+

>

l−

+

+ −

Graphs for Answer Set Programs 7

Page 10: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Outline

Answer Set Programming

Graphs for Answer Set Programs2.1 Extended Dependency Graph2.2 Explanation Graph

Construction of Explanation Graphs from Extended Dependency Graphs

Choosing Assumptions

Construction of Explanation Graphs from Extended Dependency Graphs 8

Page 11: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

1. Removing irrelevant edges and nodes

2. Marking nodes

3. Construct Explanation Graphs differing five cases of transformation

4. Determination of assumptions

5. Fitting graph to chosen assumption

6. Continue marking and construction process

Construction of Explanation Graphs from Extended Dependency Graphs 9

Page 12: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG - Removing irrelevant edgesand nodes

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

f 6−

I Irrelevant edge: An edge(aki ,a

lj ,s) is irrelevant if

ν(aki ) ν(alj ) s

green green −green red +red green +red red −

I Irrelevant node: A node aki isirrelevant if ν(aki ) = red and thereexists l > 0 where ν(ali ) = green.

Construction of Explanation Graphs from Extended Dependency Graphs 10

Page 13: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG - Removing irrelevant edgesand nodes

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

f 6−

I Irrelevant edge: An edge(aki ,a

lj ,s) is irrelevant if

ν(aki ) ν(alj ) s

green green −green red +red green +red red −

I Irrelevant node: A node aki isirrelevant if ν(aki ) = red and thereexists l > 0 where ν(ali ) = green.

Construction of Explanation Graphs from Extended Dependency Graphs 10

Page 14: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG - Removing irrelevant edgesand nodes

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

f 6−

I Irrelevant edge: An edge(aki ,a

lj ,s) is irrelevant if

ν(aki ) ν(alj ) s

green green −green red +red green +red red −

I Irrelevant node: A node aki isirrelevant if ν(aki ) = red and thereexists l > 0 where ν(ali ) = green.

Construction of Explanation Graphs from Extended Dependency Graphs 10

Page 15: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG - Removing irrelevant edgesand nodes

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

f 6−

I Irrelevant edge: An edge(aki ,a

lj ,s) is irrelevant if

ν(aki ) ν(alj ) s

green green −green red +red green +red red −

I Irrelevant node: A node aki isirrelevant if ν(aki ) = red and thereexists l > 0 where ν(ali ) = green.

Construction of Explanation Graphs from Extended Dependency Graphs 10

Page 16: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG - Removing irrelevant edgesand nodes

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

f 6−

I Irrelevant edge: An edge(aki ,a

lj ,s) is irrelevant if

ν(aki ) ν(alj ) s

green green −green red +red green +red red −

I Irrelevant node: A node aki isirrelevant if ν(aki ) = red and thereexists l > 0 where ν(ali ) = green.

Construction of Explanation Graphs from Extended Dependency Graphs 10

Page 17: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG - Removing irrelevant edgesand nodes

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

f 6testtt−

I Irrelevant edge: An edge(aki ,a

lj ,s) is irrelevant if

ν(aki ) ν(alj ) s

green green −green red +red green +red red −

I Irrelevant node: A node aki isirrelevant if ν(aki ) = red and thereexists l > 0 where ν(ali ) = green.

Construction of Explanation Graphs from Extended Dependency Graphs 10

Page 18: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG - Removing irrelevant edgesand nodes

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

I Irrelevant edge: An edge(aki ,a

lj ,s) is irrelevant if

ν(aki ) ν(alj ) s

green green −green red +red green +red red −

I Irrelevant node: A node aki isirrelevant if ν(aki ) = red and thereexists l > 0 where ν(ali ) = green.

Construction of Explanation Graphs from Extended Dependency Graphs 10

Page 19: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

I Start marking process at nodeswithout incoming edges

I Transformation of fact nodes akia+i

>

+

a+

>

+

e+

>

+

I Transformation of unfoundednodes alja−j

b−

g−

Construction of Explanation Graphs from Extended Dependency Graphs 11

Page 20: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

I Start marking process at nodeswithout incoming edges

I Transformation of fact nodes akia+i

>

+

a+

>

+

e+

>

+

I Transformation of unfoundednodes alja−j

b−

g−

Construction of Explanation Graphs from Extended Dependency Graphs 11

Page 21: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

I Start marking process at nodeswithout incoming edges

I Transformation of fact nodes akia+i

>

+

a+

>

+

e+

>

+

I Transformation of unfoundednodes alja−j

b−

g−

Construction of Explanation Graphs from Extended Dependency Graphs 11

Page 22: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

testtt

testtt

I Start marking process at nodeswithout incoming edges

I Transformation of fact nodes akia+i

>

+

a+

>

+

e+

>

+

I Transformation of unfoundednodes alja−j

b−

g−

Construction of Explanation Graphs from Extended Dependency Graphs 11

Page 23: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

I Start marking process at nodeswithout incoming edges

I Transformation of fact nodes akia+i

>

+

a+

>

+

e+

>

+

I Transformation of unfoundednodes alja−j

b−

g−

Construction of Explanation Graphs from Extended Dependency Graphs 11

Page 24: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

testtt

testtt

I Start marking process at nodeswithout incoming edges

I Transformation of fact nodes akia+i

>

+

a+

>

+

e+

>

+

I Transformation of unfoundednodes alja−j

b−

g−

Construction of Explanation Graphs from Extended Dependency Graphs 11

Page 25: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

c2 f 7

I A green node aki can be marked ifI all predecessor nodes alj marked

I if ν(alj ) = green: there exists n,such that anj marked

I Local consistent Explanation(LCE) to a literal ai : minimal setof literals which directly influencetruth value of ai

I LCE for a green node: all directpredecessors

I Transformation of dependentgreen nodes aki

Construction of Explanation Graphs from Extended Dependency Graphs 12

Page 26: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

c2 f 7

I A green node aki can be marked ifI all predecessor nodes alj marked

I if ν(alj ) = green: there exists n,such that anj marked

I Local consistent Explanation(LCE) to a literal ai : minimal setof literals which directly influencetruth value of ai

I LCE for a green node: all directpredecessors

I Transformation of dependentgreen nodes aki

Construction of Explanation Graphs from Extended Dependency Graphs 12

Page 27: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

c2 f 7testtt testtt

I A green node aki can be marked ifI all predecessor nodes alj marked

I if ν(alj ) = green: there exists n,such that anj marked

I Local consistent Explanation(LCE) to a literal ai : minimal setof literals which directly influencetruth value of ai

I LCE for a green node: all directpredecessors

I Transformation of dependentgreen nodes aki

Construction of Explanation Graphs from Extended Dependency Graphs 12

Page 28: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

c2 f 7testtt testtt

I Local consistent Explanation(LCE) to a literal ai : minimal setof literals which directly influencetruth value of ai

I LCE for a green node: all directpredecessors

I Transformation of dependentgreen nodes aki

Construction of Explanation Graphs from Extended Dependency Graphs 12

Page 29: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

c2 f 7testtt testtt

I Local consistent Explanation(LCE) to a literal ai : minimal setof literals which directly influencetruth value of ai

I LCE for a green node: all directpredecessors

I Transformation of dependentgreen nodes aki

a+i

EG (aj1) EG (aj2) ,,, EG (ajn)

s1 s2

sn

Construction of Explanation Graphs from Extended Dependency Graphs 12

Page 30: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

c2 f 7testtt testtttesttt

I Local consistent Explanation(LCE) to a literal ai : minimal setof literals which directly influencetruth value of ai

I LCE for a green node: all directpredecessors

I Transformation of dependentgreen nodes aki

c+

Construction of Explanation Graphs from Extended Dependency Graphs 12

Page 31: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

c2 f 7testtt testtttesttt

testtt testtt

+

I Local consistent Explanation(LCE) to a literal ai : minimal setof literals which directly influencetruth value of ai

I LCE for a green node: all directpredecessors

I Transformation of dependentgreen nodes aki

c+

EG (a) EG (b)

+

Construction of Explanation Graphs from Extended Dependency Graphs 12

Page 32: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

c2 f 7testtt testtttesttt

testtt testtt

+

I Local consistent Explanation(LCE) to a literal ai : minimal setof literals which directly influencetruth value of ai

I LCE for a green node: all directpredecessors

I Transformation of dependentgreen nodes aki

c+

a+ b−

> ⊥

+

+ −

Construction of Explanation Graphs from Extended Dependency Graphs 12

Page 33: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e4

g0

testtt testtt

testtt

testtt

c2 f 7testtt testtt

I Local consistent Explanation(LCE) to a literal ai : minimal setof literals which directly influencetruth value of ai

I LCE for a green node: all directpredecessors

I Transformation of dependentgreen nodes aki

c+

a+ b−

> ⊥

+

+ −

f +

g−

Construction of Explanation Graphs from Extended Dependency Graphs 12

Page 34: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e5

g0

c2 f 7

d3 d4

testtt testtt

testtt

testtt

testtt testtt

I A red node aki can be marked if

I at least one predecessor node aljmarked

I if ν(alj ) = red : for all n node anjmarked

Construction of Explanation Graphs from Extended Dependency Graphs 13

Page 35: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e5

g0

c2 f 7

d3 d4

testtt testtt

testtt

testtt

testtt testtt

testtt testtt

I A red node aki can be marked if

I at least one predecessor node aljmarked

I if ν(alj ) = red : for all n node anjmarked

Construction of Explanation Graphs from Extended Dependency Graphs 13

Page 36: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e5

g0

c2 f 7

d3 d4

testtt testtt

testtt

testtt

testtt testtt

testtt testtt

I A red node aki can be marked if

I at least one predecessor node aljmarked

I if ν(alj ) = red : for all n node anjmarked

I LCE for a red node akiI considering all nodes representing aiI one predecessor of each node

Construction of Explanation Graphs from Extended Dependency Graphs 13

Page 37: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e5

g0

c2 f 7

d3 d4

testtt testtt

testtt

testtt

testtt testtt

testtt testtt

I Transformation of dependent red nodesaki

a−i

EG(b1) EG(b2) ,,, EG(bn)

s1 s2

sn

Construction of Explanation Graphs from Extended Dependency Graphs 13

Page 38: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e5

g0

c2 f 7

d3 d4

testtt testtt

testtt

testtt

testtt testtt

testtt testtttesttt testtt

I pn(d3) ={c2,e5}

pn(d4) ={f 7}

L(d) ={{c, f },{e, f }}

d−

EG(c) EG(f )

Construction of Explanation Graphs from Extended Dependency Graphs 13

Page 39: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e5

g0

c2 f 7

d3 d4

testtt testtt

testtt

testtt

testtt testtt

testtt testtttesttt testtt

testtt testtt testtt

+

++

I pn(d3) ={c2,e5}

pn(d4) ={f 7}

L(d) ={{c, f },{e, f }}

d−

EG(c) EG(f )

+

Construction of Explanation Graphs from Extended Dependency Graphs 13

Page 40: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Transformation EDG ⇒ EG

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

+

−−

− −

− −

+

−−

−−

−−

+

−−

a1 b0

e5

g0

c2 f 7

d3 d4

testtt testtt

testtt

testtt

testtt testtt

testtt testtttesttt testtt

testtt testtt testtt

+

++

I pn(d3) ={c2,e5}

pn(d4) ={f 7}

L(d) ={{c, f },{e, f }}

d−

EG(c) EG(f )

c+

a+ b−

f +

g−

⊥> ⊥

+

+

+

+

−−

Construction of Explanation Graphs from Extended Dependency Graphs 13

Page 41: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Well-founded model

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

testtt testtt

testtt testtt

testtt

testtt

testtt testtt

+

−−

− −

− −

+

−−

−−

−−

+

− − Proposition

All unmarked nodes areundefined by thewell-founded model.

Construction of Explanation Graphs from Extended Dependency Graphs 14

Page 42: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Outline

Answer Set Programming

Graphs for Answer Set Programs2.1 Extended Dependency Graph2.2 Explanation Graph

Construction of Explanation Graphs from Extended Dependency Graphs

Choosing Assumptions

Choosing Assumptions 15

Page 43: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Assumptions

I Tentative assumptions in an EDG:T A (G ′) = {ai | aki ∈V ′,ν(aki ) = red ,(aki ,a

lj ,−)∈ E ,aki not marked}

I G = (V ,E ): validly colored EDGI G ′ = (V ′,E ′): EDG after removing irrelevant edges and nodes and

marking nodes

I Assumption: Subset U ⊆T A (G ′) such that all nodes in the EDGcan be marked.

I Indeterminateness arises from cycles ⇒ consideration ofdependencies within and between cycles

Lemma

In an EDG without cycles all nodes can be marked.

Choosing Assumptions 16

Page 44: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 1

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

testtt testtt

testtt testtt

testtt

testtt

testtt testtt

+

−−

− −

− −

+

−−

−−

−−

+

−−

I One tentative assumption from eachminimal cycle

I C1 ={h8,p16,n14,o15}

C2 ={j10,k11, l12,p16}

C3 ={h8, i9, j10,k11, l12,m13,n14,o15}

C4 ={r18,s19}

I Assumptions(G ′) ={{p,k, r},{p, i , r},{p,m, r},{p,o, r},{o,k, r}}

Choosing Assumptions 17

Page 45: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

a1

c2

b0

d3

e5 f 6

d4

f 7

g0

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

testtt testtt

testtt testtt

testtt

testtt

testtt testtt

+

−−

− −

− −

+

−−

−−

−−

+

−−

I Linked cycles: strongly connected components

I 1. Start at linked cycles without externalincoming edges

2. Find critical nodes3. Determine pre-conditions of each

critical node4. Find successful combinations of

pre-conditions5. Determine pre-condition paths and path

assumptions6. Built assumptions for the linked cycle

Choosing Assumptions 18

Page 46: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

− −

+

−−

−−

−−

+

−−

I Linked cycles: strongly connected components

I 1. Start at linked cycles without externalincoming edges

2. Find critical nodes3. Determine pre-conditions of each

critical node4. Find successful combinations of

pre-conditions5. Determine pre-condition paths and path

assumptions6. Built assumptions for the linked cycle

Choosing Assumptions 18

Page 47: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

− −

+

−−

−−

−−

+

−−

I Linked cycles: strongly connected components

I 1. Start at linked cycles without externalincoming edges

2. Find critical nodes3. Determine pre-conditions of each

critical node4. Find successful combinations of

pre-conditions5. Determine pre-condition paths and path

assumptions6. Built assumptions for the linked cycle

Choosing Assumptions 18

Page 48: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

− −

+

−−

−−

−−

+

−−

I Linked cycles: strongly connected components

I 1. Start at linked cycles without externalincoming edges

2. Find critical nodes3. Determine pre-conditions of each

critical node4. Find successful combinations of

pre-conditions5. Determine pre-condition paths and path

assumptions6. Built assumptions for the linked cycle

Choosing Assumptions 18

Page 49: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

− −

+

−−

−−

−−

+

−−

I Critical nodes: {j10,n14}I Successfull combination: {i9,p16}, {m13,p16}I PA (path(i9)) ={i ,o}

PA (path(p16)) ={p,k,o}

PA (path(m13)) ={m,k}

I Assumptions(LCred ) ={{i ,p},{i ,k},{i ,o},{o,p},{o,k},{o}}∪{{p,m},{p,k},{k,m},{k},{o,m},{o,k}}

I µAssumptions(LCred ) = {{o},{k},{i ,p},{p,m}}

Choosing Assumptions 19

Page 50: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

− −

+

−−

−−

−−

+

−−

I Critical nodes: {j10,n14}I Successfull combination: {i9,p16}, {m13,p16}I PA (path(i9)) ={i ,o}

PA (path(p16)) ={p,k,o}

PA (path(m13)) ={m,k}

I Assumptions(LCred ) ={{i ,p},{i ,k},{i ,o},{o,p},{o,k},{o}}∪{{p,m},{p,k},{k,m},{k},{o,m},{o,k}}

I µAssumptions(LCred ) = {{o},{k},{i ,p},{p,m}}

Choosing Assumptions 19

Page 51: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

− −

+

−−

−−

−−

+

−−

I Assumption: o

o−

assume

h+

o−

assume

I Two cases:

1. All nodes of the EDG marked ⇒ DONE2. There are still unmarked nodes in the

EDG ⇒ Remove marked nodes andstart again with the determination ofassumptions

Choosing Assumptions 20

Page 52: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

− −

+

−−

−−

−−

+

−−

testtt−

− −

+

−−

−−

−−

+

−−

I Assumption: o

o−

assume

h+

o−

assume

I Two cases:

1. All nodes of the EDG marked ⇒ DONE2. There are still unmarked nodes in the

EDG ⇒ Remove marked nodes andstart again with the determination ofassumptions

Choosing Assumptions 20

Page 53: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

− −

+

−−

−−

−−

+

−−

testtt−

− −

+

−−

−−

−−

+

−−−

I Assumption: o

o−

assume

h+

o−

assume

I Two cases:

1. All nodes of the EDG marked ⇒ DONE2. There are still unmarked nodes in the

EDG ⇒ Remove marked nodes andstart again with the determination ofassumptions

Choosing Assumptions 20

Page 54: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

− −

+

−−

−−

−−

+

−−

testtt−

− −

+

−−

−−

−−

+

−−

I Assumption: o

o−

assume

h+

o−

assume

I Two cases:

1. All nodes of the EDG marked ⇒ DONE2. There are still unmarked nodes in the

EDG ⇒ Remove marked nodes andstart again with the determination ofassumptions

Choosing Assumptions 20

Page 55: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

− −

+

−−

−−

−−

+

−−

testtt−

− −

+

−−

−−

−−

+

−−

I Assumption: o

o−

assume

h+

o−

assume

I Two cases:

1. All nodes of the EDG marked ⇒ DONE2. There are still unmarked nodes in the

EDG ⇒ Remove marked nodes andstart again with the determination ofassumptions

Choosing Assumptions 20

Page 56: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

− −

+

−−

−−

−−

+

−−

testtt−

− −

+

−−

−−

−−

+

−−

testtt

I Assumption: o

o−

assume

h+

o−

assume

I Two cases:

1. All nodes of the EDG marked ⇒ DONE2. There are still unmarked nodes in the

EDG ⇒ Remove marked nodes andstart again with the determination ofassumptions

Choosing Assumptions 20

Page 57: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Choosing Assumptions - Approach 2

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

h8 i9

j10

k11l12m13

n14

o15

p16

q17 r18

s19

− −

+

−−

−−

−−

+

−−

testtt−

− −

+

−−

−−

−−

+

−−

testtt testtt

testtt

testtttesttttesttt

testtt

testtt

testtt

testtt testtt

testtt

− −

+

−−

−−

−−

+

−−

I Assumption: o

o−

assume

h+

o−

assume

I Two cases:

1. All nodes of the EDG marked ⇒ DONE2. There are still unmarked nodes in the

EDG ⇒ Remove marked nodes andstart again with the determination ofassumptionsChoosing Assumptions 20

Page 58: Construction of Explanation Graphs from Extended ... · Construction of Explanation Graphs from Extended Dependency Graphs for Answer Set Programs Ella Albrecht, Patrick Kr umpelmann,

Summary

I Construction of Explanation Graphs from validly colored ExtendedDependency Graphs

I Marking nodesI Five types of transformation

I Choosing assumptionsI Approach 1: linear, but non-minimalI Approach 2: exponential, but minimal

Choosing Assumptions 21