Knowledge Representation for the Semantic Web [2ex...

82
Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics Knowledge Representation for the Semantic Web Lecture 6: Answer Set Programming I Daria Stepanova partially based on slides by Thomas Eiter D5: Databases and Information Systems Max Planck Institute for Informatics WS 2017/18 1 / 45

Transcript of Knowledge Representation for the Semantic Web [2ex...

Page 1: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Knowledge Representation for the Semantic Web

Lecture 6: Answer Set Programming I

Daria Stepanovapartially based on slides by Thomas Eiter

D5: Databases and Information SystemsMax Planck Institute for Informatics

WS 2017/18

1 / 45

Page 2: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Unit Outline

Introduction

Horn Logic Programming

Negation in Logic Programs

Answer Set Semantics

2 / 45

Page 3: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

French Phrases, Italian Soda

� Six people sit at a round table.

� Each drinks a different kind of soda.

� Each plans to visit a different French-speaking country.

� The person who is planning a trip to Quebec, who drank eitherblueberry or lemon soda, didn’t sit in seat number one.

� Jeanne didn’t sit next to the person who enjoyed the kiwi soda.

� The person who has a plane ticket to Belgium, who sat in seat fouror seat five, didn’t order the cherry soda.

� . . .

Question:

� What is each of them drinking, and where is each of them going?

3 / 45

Page 4: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Sudoku

6 1 4 58 3 5 6

2 18 4 7 6

6 37 9 1 45 2

7 2 6 94 5 8 7

Task:

Fill in the grid so that every row, every column, and every 3x3 box containsthe digits 1 through 9.

4 / 45

Page 5: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Graph 3-colouring

– a rule r, if Head(r) ∩ S 6= ∅ whenever Body+(r) ⊆ S and Body−(r) ∩ S = ∅;– a logic program P (I is a model of P), if it satisfies all rules r of P .

Definition 8. A model I of a logic program P is called minimal, if there is no model I ′ of P , such that I ′ ⊂ I .

The semantics of ASP programs is given in terms of answer sets (or stable models).

Definition 9. Given a positive logic program P , an interpretation I is an answer set (stable model) of P if I |= P andthere does not exist I ′ ⊂ I , such that I ′ |= P . AS(P) denotes the set of all answer sets.

The notion of answer sets for logic programs with negation is defined using the Gelfond-Lifshitz reduct.

Definition 10. Given a logic program P and an interpretation I of P the Gelfond-Lifshitz (GL-)reduct denoted by PIGL is

constructed from ground(P) by

– deleting all rules r from ground(P) s.t. Body−(r) ∩ I 6= ∅, and– deleting the negative body for all of the remaining rules.

Note that for any program and interpretation the GL-reduct is positive. The definition of answer sets for arbitrary logicprograms is then as follows:

Definition 11. An answer set of a program P is an interpretation I ⊆ HBP , such that I is an answer set of the positiveprogram PI

GL.

The availability of advanced reasoners makes the ASP formalism applicable to solving practical tasks. The standardreasoner comprises two components: a grounder and a solver. The list of the most well-known grounders include: dlv4,gringo5, lparse6, etc. Among the solvers one can mention dlv, clasp7, claspd8, gnt9. Potassco10 represents a collection ofASP reasoning tools, combining clasp and gringo into a system architecture.

We now present an example that illustrates the basic notions of the Answer Set Programming that we have inroduced.

Example 10. Consider a graph 3-colourability problem, in which we are given a graph and three colours, e.g. red, blue andgreen, and we aim at finding the assignment of colours to the nodes of a graph in such a way that no adjacent nodes sharethe same color. The encoding of this problem is as follows.

1

2

6

3

5

4

PI =

(1) node(1 . . . 6 ); (2) edge(1 , 2 ); . . . (8) edge(5 , 6 );(9) coloured(V , red)← not coloured(V , blue), not coloured(V , green), node(V );(10) coloured(V , green)← not coloured(V , blue), not coloured(V , red), node(V );(11) coloured(V , blue)← not coloured(V , green), not coloured(V , red), node(V );(12) ⊥ ← coloured(V , C ), coloured(V , C ′), C 6= C′;(13) ⊥ ← coloured(V , C ), coloured(V ′, C ), edge(V , V ′)

The facts of the programs P describe the nodes and edges of the graph from above. The rules (9)-(11) state that eachnode has to be colored in at least one of the three colours. The constraint (12) forbids the nodes to be colored in more thenone color, while the constraint (13) says that two nodes connected via an edge must have different colours.

4 http://www.dlvsystem.com/5 http://potassco.sourceforge.net/6 http://www.tcs.hut.fi/Software/smodels/7 http://potassco.sourceforge.net/8 http://www.cs.uni-potsdam.de/claspD/9 http://www.tcs.hut.fi/Software/gnt/

10 http://potassco.sourceforge.net/

Task:

Colour the nodes of the graph in three colors such that none of the twoadjacent nodes share the same colour.

5 / 45

Page 6: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Wanted!

� A general-purpose approach for modeling and solving these andmany other problems.

� Issues:� Diverse domains� Spatial and temporal reasoning� Constraints� Incomplete information� Frame problem

� Proposal:

� Answer-set programming (ASP) paradigm!

6 / 45

Page 7: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Answer Set Programming

� Answer Set Programming (ASP) is a recent problem solvingapproach, based on declarative programming.

� The term was coined by Vladimir Lifschitz [1999,2002].

� Proposed by other people at about the same time, e.g., by Marekand Truszczynski [1999] and Niemela [1999].

� It has roots in knowledge representation, logic programming, andnonmonotonic reasoning.

� At an abstract level, ASP relates to SAT solving and constraintsatisfaction problems (CSPs).

7 / 45

Page 8: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Answer Set Programming (cont’d)

� Important logic programming method

� Developed in the early 1990s by Gelfond and Lifschitz.

Left: Michael Gelfond (Texas Tech Univ., Lubbock)

Right: Vladimir Lifschitz (Univ. of Texas, Austin)

� Both are graduates from the Steklov Mathematical Institute,St.Petersburg (then: Leningrad).

8 / 45

Page 9: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Answer Set Programming (cont’d)

� ASP is an approach to declarative programming, combining� a rich yet simple modeling language� with high-performance solving capacities

� ASP has its roots in� deductive databases� logic programming with negation� knowledge representation and nonmonotonic reasoning� constraint solving (in particular, SATisfiability testing)

� ASP allows for solving all search problems in NP (and NPNP) in auniform way

9 / 45

Page 10: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Answer Set Programming (cont’d)

� ASP is an approach to declarative programming, combining� a rich yet simple modeling language� with high-performance solving capacities

� ASP has its roots in� deductive databases� logic programming with negation� knowledge representation and nonmonotonic reasoning� constraint solving (in particular, SATisfiability testing)

� ASP allows for solving all search problems in NP (and NPNP) in auniform way

9 / 45

Page 11: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Declarative Programming

10 / 45

Page 12: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Answer Set Programming (cont’d)

� ASP is an approach to declarative programming, combining� a rich yet simple modeling language� with high-performance solving capacities

� ASP has its roots in� deductive databases� logic programming with negation� knowledge representation and nonmonotonic reasoning� constraint solving (in particular, SATisfiability testing)

� ASP allows for solving all search problems in NP (and NPNP) in auniform way

11 / 45

Page 13: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Nonmonotonic Reasoning

� Nonmonotonicity means that conclusions may be invalidated in thelight of new information.

� More specifically, an inference relation |= is nonmonotonic if itviolates the monotonicity principle:

if T |= φ and T ⊆ T ′, then T ′ |= φ.

� Note: inference in description logics is monotonic.

Example: Monotonicity of description logics

� T = {Bird v Flier ,Bird(tweety)}

� T |= Flier(tweety)

� T ′ = T ∪ {¬Flier(tweety)}

� T ′ |= Flier(tweety) (actually T ′ is inconsistent)

12 / 45

Page 14: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Nonmonotonic Reasoning

� Nonmonotonicity means that conclusions may be invalidated in thelight of new information.

� More specifically, an inference relation |= is nonmonotonic if itviolates the monotonicity principle:

if T |= φ and T ⊆ T ′, then T ′ |= φ.

� Note: inference in description logics is monotonic.

Example: Nonmonotonic inference

If bird(x) holds and there is no evidence for¬flies(x), then infer flies(x). I.e., if bird(x), assume flies(x) by default.

12 / 45

Page 15: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

ASP Systems

ASP gains increasing importance for knowledge representation

� High expressiveness� Efficient solvers available: DLV, clasp, . . .

Source: Wikipedia (Dec 6, 2017)13 / 45

Page 16: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

ASP: General Idea

� ASP are logic programs;

� Their semantics adheres to the multiple preferred models approach:

� given as a selection of the collection of all classical models;

� selected (intended) models are called stable models or answer sets.

� Fundamental characteristics:

� models, not proofs, represent solutions;

� requires techniques to compute models (rather than techniques tocompute proofs)

14 / 45

Page 17: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

ASP: General Idea

� ASP are logic programs;

� Their semantics adheres to the multiple preferred models approach:

� given as a selection of the collection of all classical models;

� selected (intended) models are called stable models or answer sets.

� Fundamental characteristics:

� models, not proofs, represent solutions;

� requires techniques to compute models (rather than techniques tocompute proofs)

14 / 45

Page 18: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

ASP: General Idea (cont’d)

� Given a search problem Π and an instance I, reduce it to theproblem of computing intended models of a logic program:

1. Encode (Π, I) as a logic program P such that the solutions of Π forthe instance I are represented by the intended models of P .

2. Compute some intended model M of P .3. Extract a solution for I from M .

� Variant:� Compute multiple/all intended models to obtain multiple/all solutions

15 / 45

Page 19: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Motivation Ontologies and Rules Inconsistencies in DL-programs Nonmonotonic Rule Mining Ongoing and Future Work

Declarative Programming Paradigm

26 / 3816 / 45

Page 20: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Motivation Ontologies and Rules Inconsistencies in DL-programs Nonmonotonic Rule Mining Ongoing and Future Work

Declarative Programming Example

Graph 3-colorability

– a rule r, if Head(r) ∩ S 6= ∅ whenever Body+(r) ⊆ S and Body−(r) ∩ S = ∅;– a logic program P (I is a model of P), if it satisfies all rules r of P .

Definition 8. A model I of a logic program P is called minimal, if there is no model I ′ of P , such that I ′ ⊂ I .

The semantics of ASP programs is given in terms of answer sets (or stable models).

Definition 9. Given a positive logic program P , an interpretation I is an answer set (stable model) of P if I |= P andthere does not exist I ′ ⊂ I , such that I ′ |= P . AS(P) denotes the set of all answer sets.

The notion of answer sets for logic programs with negation is defined using the Gelfond-Lifshitz reduct.

Definition 10. Given a logic program P and an interpretation I of P the Gelfond-Lifshitz (GL-)reduct denoted by PIGL is

constructed from ground(P) by

– deleting all rules r from ground(P) s.t. Body−(r) ∩ I 6= ∅, and– deleting the negative body for all of the remaining rules.

Note that for any program and interpretation the GL-reduct is positive. The definition of answer sets for arbitrary logicprograms is then as follows:

Definition 11. An answer set of a program P is an interpretation I ⊆ HBP , such that I is an answer set of the positiveprogram PI

GL.

The availability of advanced reasoners makes the ASP formalism applicable to solving practical tasks. The standardreasoner comprises two components: a grounder and a solver. The list of the most well-known grounders include: dlv4,gringo5, lparse6, etc. Among the solvers one can mention dlv, clasp7, claspd8, gnt9. Potassco10 represents a collection ofASP reasoning tools, combining clasp and gringo into a system architecture.

We now present an example that illustrates the basic notions of the Answer Set Programming that we have inroduced.

Example 10. Consider a graph 3-colourability problem, in which we are given a graph and three colours, e.g. red, blue andgreen, and we aim at finding the assignment of colours to the nodes of a graph in such a way that no adjacent nodes sharethe same color. The encoding of this problem is as follows.

1

2

6

3

5

4

PI =

(1) node(1 . . . 6 ); (2) edge(1 , 2 ); . . . (8) edge(5 , 6 );(9) coloured(V , red)← not coloured(V , blue), not coloured(V , green), node(V );(10) coloured(V , green)← not coloured(V , blue), not coloured(V , red), node(V );(11) coloured(V , blue)← not coloured(V , green), not coloured(V , red), node(V );(12) ⊥ ← coloured(V , C ), coloured(V , C ′), C 6= C′;(13) ⊥ ← coloured(V , C ), coloured(V ′, C ), edge(V , V ′)

The facts of the programs P describe the nodes and edges of the graph from above. The rules (9)-(11) state that eachnode has to be colored in at least one of the three colours. The constraint (12) forbids the nodes to be colored in more thenone color, while the constraint (13) says that two nodes connected via an edge must have different colours.

4 http://www.dlvsystem.com/5 http://potassco.sourceforge.net/6 http://www.tcs.hut.fi/Software/smodels/7 http://potassco.sourceforge.net/8 http://www.cs.uni-potsdam.de/claspD/9 http://www.tcs.hut.fi/Software/gnt/

10 http://potassco.sourceforge.net/

For the logic program P , the grounding ground(P) is obtained by substituting the variables V, V ′, C, C ′ with constantsfrom the set {1, 2, 3, 5, 6, blue, green, red} in all possible ways.

Let us now look at the interpretation I = {coloured(1 , red),node(1 ),node(2 )} and the following ground rules ofground(P):

r1 : coloured(1 , red)← not coloured(1 , blue), not coloured(1 , green), node(1 );r2 : coloured(2 , green)← not coloured(1 , blue), not coloured(1 , red), node(2 )

We have that I |= node(1 ). Furthermore, I |= r1, and I 6|= r2.Consider now an interpretation I , which apart from the graph description contains the facts: coloured(1 , red), coloured(2 , blue), coloured(3 , red), coloured(4 , green), coloured(6 , green),

coloured(5 , blue).The GL-reduct PI

GL of P is as follows:

PIGL =

(1) node(1 . . . 6 ); . . . (8) edge(5 , 6 );(9) coloured(1 , red)← node(1 );(10) coloured(3 , red)← node(3 );(11) coloured(4 , green)← node(4 );(12) coloured(6 , green)← node(6 );(13) coloured(2 , blue)← node(2 );(14) coloured(5 , blue)← node(5 )

One can see that I is the minimal model of the positive program PIGL, and thus an answer set of P . Furthermore, it

encodes the following valid graph coloring:

1

2

6

3

5

4

B Related Work

From the theoretical side the problem of learning nonmonotonic rules from the data has been studied in several works bothin discrete and probabilistic settings. However, many available techniques are heavily based on CWA, and thus can notbe directly applied to our setting. For example, Bain and Muggleton [3] developed the algorithm called Closed WorldSpecialization (CWS), in which an initial program and an intended interpretation that a learned program should satisfy aregiven. In this setting, any atom which is not included in the interpretation is considered false. For example, let the programcontain the rule {flies(X)← bird(X).} Furthermore, let the KB be as follows: {bird(eagle), flies(eagle), bird(emu)}.The CWS algorithm would interpret flies(emu) as false, and would specialize P to {flies(X)← bird(X),not ab(X)},from which the fact {ab(emu)} would be learned.

The Open World Specialization (OWS) [9] is a modification of the CWS algorithm, which avoids using CWA to derivenegative instances by considering a three-valued setting. The OWS technique does not involve confidence degrees of therules that are mined, which prevents it from being used for our purpose.

node(1 . . . 6); edge(1, 2); . . .

col(V , red)← not col(V , blue), not col(V , green), node(V );

col(V , green)← not col(V , blue), not col(V , red), node(V );

col(V , blue)← not col(V , green), not col(V , red), node(V );

⊥ ← col(V , C), col(V , C′), C 6= C′;⊥ ← col(V , C), col(V ′, C), edge(V , V ′)

node(1 . . . 6); edge(1, 2); . . .col(1, red), col(2, blue),col(3, red), col(4, green),col(6, green), col(5, blue)

26 / 3816 / 45

Page 21: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

ASP Applications

Use ASP to solve search problems, like

� k-colourability:

� assign one of k colours to each node of a given graph such thatadjacent nodes always have different colours

� Sudoku:� find a solution to a given Sudoku puzzle

� Satisfiability (SAT):� find all models of a propositional formula

� Time Tabling:� find a lecture room assignment for courses

17 / 45

Page 22: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

ASP Applications (cont’d)

� Semantic Web

� games, puzzles

� information integration

� constraint satisfaction, configuration

� planning, routing, scheduling

� diagnosis, repair

� security, verification

� systems biology / biomedicine

� knowledge management

� musicology

� . . .

See AI Magazine article on ASP [Erdem et al., 2016] for overview

18 / 45

Page 23: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

ASP Applications (cont’d)

� Semantic Web

� games, puzzles

� information integration

� constraint satisfaction, configuration

� planning, routing, scheduling

� diagnosis, repair

� security, verification

� systems biology / biomedicine

� knowledge management

� musicology

� . . .

See AI Magazine article on ASP [Erdem et al., 2016] for overview

18 / 45

Page 24: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

ASP Applications (cont’d)

� USA-Advisor [Nogueira et al., 2001]

� decision support system to control the Space Shuttle during flight

� issue: problems with the oxygen transport (pipes and valves)

� failure scenario: also multiple system failures occur

� Biological Network Repair [Kaminski et al., 2013]

� model nodes (substances, etc) in a large scale biological influencegraph, with roles (e.g. inhibitor, activator)

� repair inconsistencies (modify roles, add links between nodes, etc)

� Anton [Boenn et al., 2011] http://www.cs.bath.ac.uk/~mjb/anton/

� automatic system for the composition of renaissance-style music.

� musical knowledge ≈ 500 ASP rules (melody, harmony, rhythm)

� can generate musical pieces, check pieces for violations.

19 / 45

Page 25: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Horn Logic Programming

Alfred Horn

20 / 45

Page 26: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Syntax

� Assume a vocabulary Φ comprised of nonempty finite sets of� constants (e.g., frankfurt)� variables (e.g., X)� predicate symbols (e.g., connected)

� A term is either a variable, a constant, or inductively built fromother terms using function symbols.

� An atom is an expression of form p(t1, . . . , tn), where

� p is a predicate symbol of arity n ≥ 0 from Φ, and� t1, . . . , tn are terms.

(e.g., connected(frankfurt))

� A term or an atom is ground if it contains no variable.(e.g., connected(frankfurt) is ground, connected(X ) is nonground.)

21 / 45

Page 27: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Syntax

� Assume a vocabulary Φ comprised of nonempty finite sets of� constants (e.g., frankfurt)� variables (e.g., X)� predicate symbols (e.g., connected)

� A term is either a variable, a constant, or inductively built fromother terms using function symbols.

� An atom is an expression of form p(t1, . . . , tn), where

� p is a predicate symbol of arity n ≥ 0 from Φ, and� t1, . . . , tn are terms.

(e.g., connected(frankfurt))

� A term or an atom is ground if it contains no variable.(e.g., connected(frankfurt) is ground, connected(X ) is nonground.)

21 / 45

Page 28: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Syntax

� Assume a vocabulary Φ comprised of nonempty finite sets of� constants (e.g., frankfurt)� variables (e.g., X)� predicate symbols (e.g., connected)

� A term is either a variable, a constant, or inductively built fromother terms using function symbols.

� An atom is an expression of form p(t1, . . . , tn), where

� p is a predicate symbol of arity n ≥ 0 from Φ, and� t1, . . . , tn are terms.

(e.g., connected(frankfurt))

� A term or an atom is ground if it contains no variable.(e.g., connected(frankfurt) is ground, connected(X ) is nonground.)

21 / 45

Page 29: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Syntax

� Assume a vocabulary Φ comprised of nonempty finite sets of� constants (e.g., frankfurt)� variables (e.g., X)� predicate symbols (e.g., connected)

� A term is either a variable, a constant, or inductively built fromother terms using function symbols.

� An atom is an expression of form p(t1, . . . , tn), where

� p is a predicate symbol of arity n ≥ 0 from Φ, and� t1, . . . , tn are terms.

(e.g., connected(frankfurt))

� A term or an atom is ground if it contains no variable.(e.g., connected(frankfurt) is ground, connected(X ) is nonground.)

21 / 45

Page 30: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Positive Logic Programs

Def.: Positive logic programs

A positive logic program, P , is a finite set of rules (clauses) of the form

a← b1, . . . , bm, (1)

where a, b1, . . . , bm are atoms.

� a is the head of the rule

� b1, . . . , bm is the body of the rule.

� If m = 0, the rule is a fact (written shortly a)

Intuitively, (1) can be seen as material implication

∀~x b1 ∧ · · · ∧ bm → a, where ~x

is the list of all variables occurring in (1).

22 / 45

Page 31: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

� Ground rule: “If Franfurt is a hub airport, and there is a linkbetween Frankfurt and Saarbrucken, then Saarbrucken is aconnected airport.”

connected(srb)←hub airport(frankfurt), link(frankfurt , srb)

� Non-ground rule: “All airports with a link to a hub airport areconnected.”

connected(X )←hub airport(Y ), link(Y ,X )

can be read as a universally quantified clause

∀X,Y hub airport(Y ) ∧ link(Y,X)→ connected(X).

23 / 45

Page 32: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

� Ground rule: “If Franfurt is a hub airport, and there is a linkbetween Frankfurt and Saarbrucken, then Saarbrucken is aconnected airport.”

connected(srb)←hub airport(frankfurt), link(frankfurt , srb)

� Non-ground rule: “All airports with a link to a hub airport areconnected.”

connected(X )←hub airport(Y ), link(Y ,X )

can be read as a universally quantified clause

∀X,Y hub airport(Y ) ∧ link(Y,X)→ connected(X).

23 / 45

Page 33: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Herbrand Semantics

Def.: Herbrand universe, base, interpretation

� Given a logic program P , the Herbrand universe of P , HU(P ), is the set ofall terms which can be formed from constants and functions symbols in P(resp., the vocabulary Φ of P , if explicitly known).

� The Herbrand base of P , HB(P ), is the set of all ground atoms which canbe formed from predicates and terms t ∈ HU(P ).

� A (Herbrand) interpretation is a first-order interpretation I = (D, ·I) of thevocabulary with domain D = HU(P ) where each term t ∈ HU(P ) isinterpreted by itself, i.e., tI = t.

� I is identified with the set { p(t1, . . . , tn) ∈ HB(P ) | 〈tI1, . . . , tIn〉 ∈ pI }.

Informally, a (Herbrand) interpretation can be seen as a set denoting whichground atoms are true in a given scenario.

Named after logician Jacques Herbrand.

24 / 45

Page 34: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Herbrand Semantics

Def.: Herbrand universe, base, interpretation

� Given a logic program P , the Herbrand universe of P , HU(P ), is the set ofall terms which can be formed from constants and functions symbols in P(resp., the vocabulary Φ of P , if explicitly known).

� The Herbrand base of P , HB(P ), is the set of all ground atoms which canbe formed from predicates and terms t ∈ HU(P ).

� A (Herbrand) interpretation is a first-order interpretation I = (D, ·I) of thevocabulary with domain D = HU(P ) where each term t ∈ HU(P ) isinterpreted by itself, i.e., tI = t.

� I is identified with the set { p(t1, . . . , tn) ∈ HB(P ) | 〈tI1, . . . , tIn〉 ∈ pI }.

Informally, a (Herbrand) interpretation can be seen as a set denoting whichground atoms are true in a given scenario.

Named after logician Jacques Herbrand.

24 / 45

Page 35: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Herbrand Semantics

Def.: Herbrand universe, base, interpretation

� Given a logic program P , the Herbrand universe of P , HU(P ), is the set ofall terms which can be formed from constants and functions symbols in P(resp., the vocabulary Φ of P , if explicitly known).

� The Herbrand base of P , HB(P ), is the set of all ground atoms which canbe formed from predicates and terms t ∈ HU(P ).

� A (Herbrand) interpretation is a first-order interpretation I = (D, ·I) of thevocabulary with domain D = HU(P ) where each term t ∈ HU(P ) isinterpreted by itself, i.e., tI = t.

� I is identified with the set { p(t1, . . . , tn) ∈ HB(P ) | 〈tI1, . . . , tIn〉 ∈ pI }.

Informally, a (Herbrand) interpretation can be seen as a set denoting whichground atoms are true in a given scenario.

Named after logician Jacques Herbrand.

24 / 45

Page 36: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Herbrand Semantics

Def.: Herbrand universe, base, interpretation

� Given a logic program P , the Herbrand universe of P , HU(P ), is the set ofall terms which can be formed from constants and functions symbols in P(resp., the vocabulary Φ of P , if explicitly known).

� The Herbrand base of P , HB(P ), is the set of all ground atoms which canbe formed from predicates and terms t ∈ HU(P ).

� A (Herbrand) interpretation is a first-order interpretation I = (D, ·I) of thevocabulary with domain D = HU(P ) where each term t ∈ HU(P ) isinterpreted by itself, i.e., tI = t.

� I is identified with the set { p(t1, . . . , tn) ∈ HB(P ) | 〈tI1, . . . , tIn〉 ∈ pI }.

Informally, a (Herbrand) interpretation can be seen as a set denoting whichground atoms are true in a given scenario.

Named after logician Jacques Herbrand.

24 / 45

Page 37: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Herbrand Semantics

Def.: Herbrand universe, base, interpretation

� Given a logic program P , the Herbrand universe of P , HU(P ), is the set ofall terms which can be formed from constants and functions symbols in P(resp., the vocabulary Φ of P , if explicitly known).

� The Herbrand base of P , HB(P ), is the set of all ground atoms which canbe formed from predicates and terms t ∈ HU(P ).

� A (Herbrand) interpretation is a first-order interpretation I = (D, ·I) of thevocabulary with domain D = HU(P ) where each term t ∈ HU(P ) isinterpreted by itself, i.e., tI = t.

� I is identified with the set { p(t1, . . . , tn) ∈ HB(P ) | 〈tI1, . . . , tIn〉 ∈ pI }.

Informally, a (Herbrand) interpretation can be seen as a set denoting whichground atoms are true in a given scenario.

Named after logician Jacques Herbrand.24 / 45

Page 38: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Program P :

p(X,Y, Z)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

h(X,Z ′)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

p(0, 0, b). h(0, 0). t(a, b, r).

� Constant symbols: 0, a, b, r.

� Herbrand universe HU(P ): {0, a, b, r}� Herbrand base HB(P ) : { p(0, 0, 0), p(0, 0, a), . . . , p(r, r, r),

h(0, 0), h(0, a), . . . , h(r, r, r),t(0, 0, 0), t(0, 0, a), . . . , t(r, r, r)}

� Some Herbrand interpretations:

I1 = ∅; I2 = HB(P ); I3 = {h(0, 0), t(a, b, r), p(0, 0, b)}.

25 / 45

Page 39: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Program P :

p(X,Y, Z)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

h(X,Z ′)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

p(0, 0, b). h(0, 0). t(a, b, r).

� Constant symbols: 0, a, b, r.

� Herbrand universe HU(P ): {0, a, b, r}� Herbrand base HB(P ) : { p(0, 0, 0), p(0, 0, a), . . . , p(r, r, r),

h(0, 0), h(0, a), . . . , h(r, r, r),t(0, 0, 0), t(0, 0, a), . . . , t(r, r, r)}

� Some Herbrand interpretations:

I1 = ∅; I2 = HB(P ); I3 = {h(0, 0), t(a, b, r), p(0, 0, b)}.

25 / 45

Page 40: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Program P :

p(X,Y, Z)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

h(X,Z ′)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

p(0, 0, b). h(0, 0). t(a, b, r).

� Constant symbols: 0, a, b, r.

� Herbrand universe HU(P ): {0, a, b, r}

� Herbrand base HB(P ) : { p(0, 0, 0), p(0, 0, a), . . . , p(r, r, r),h(0, 0), h(0, a), . . . , h(r, r, r),t(0, 0, 0), t(0, 0, a), . . . , t(r, r, r)}

� Some Herbrand interpretations:

I1 = ∅; I2 = HB(P ); I3 = {h(0, 0), t(a, b, r), p(0, 0, b)}.

25 / 45

Page 41: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Program P :

p(X,Y, Z)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

h(X,Z ′)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

p(0, 0, b). h(0, 0). t(a, b, r).

� Constant symbols: 0, a, b, r.

� Herbrand universe HU(P ): {0, a, b, r}� Herbrand base HB(P ) : { p(0, 0, 0), p(0, 0, a), . . . , p(r, r, r),

h(0, 0), h(0, a), . . . , h(r, r, r),t(0, 0, 0), t(0, 0, a), . . . , t(r, r, r)}

� Some Herbrand interpretations:

I1 = ∅; I2 = HB(P ); I3 = {h(0, 0), t(a, b, r), p(0, 0, b)}.

25 / 45

Page 42: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Program P :

p(X,Y, Z)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

h(X,Z ′)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

p(0, 0, b). h(0, 0). t(a, b, r).

� Constant symbols: 0, a, b, r.

� Herbrand universe HU(P ): {0, a, b, r}� Herbrand base HB(P ) : { p(0, 0, 0), p(0, 0, a), . . . , p(r, r, r),

h(0, 0), h(0, a), . . . , h(r, r, r),t(0, 0, 0), t(0, 0, a), . . . , t(r, r, r)}

� Some Herbrand interpretations:

I1 = ∅; I2 = HB(P ); I3 = {h(0, 0), t(a, b, r), p(0, 0, b)}.

25 / 45

Page 43: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Grounding ExampleProgram P :

p(X,Y, Z)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

h(X,Z ′)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

p(0, 0, b). h(0, 0). t(a, b, r).

� The ground instances of the first rule are

p(0, 0, 0)← p(0, 0, 0), h(0, 0), t(0, 0, r). X = Y = Z = Z ′ = 0

. . .

p(0, r, 0)← p(0, r, 0), h(0, r), t(0, 0, r). X = Z = Z ′ = 0, Y = r

. . .

p(r, r, r)← p(r, r, r), h(r, r), t(r, r, r). X = Y = Z = Z ′ = r

� The single ground instance of the last rule is

t(a, b, r)

26 / 45

Page 44: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Grounding ExampleProgram P :

p(X,Y, Z)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

h(X,Z ′)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

p(0, 0, b). h(0, 0). t(a, b, r).

� The ground instances of the first rule are

p(0, 0, 0)← p(0, 0, 0), h(0, 0), t(0, 0, r). X = Y = Z = Z ′ = 0

. . .

p(0, r, 0)← p(0, r, 0), h(0, r), t(0, 0, r). X = Z = Z ′ = 0, Y = r

. . .

p(r, r, r)← p(r, r, r), h(r, r), t(r, r, r). X = Y = Z = Z ′ = r

� The single ground instance of the last rule is

t(a, b, r) 26 / 45

Page 45: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Herbrand Models

Def.: Herbrand models

An interpretation I is a (Herbrand) model of

� a ground (variable-free) clause C = a← b1, . . . , bm, symbolicallyI |= C, if either {b1, . . . , bm} * I or a ∈ I;

� a clause C, symbolically I |= C, if I |= C ′ for every C ′ ∈ grnd(C);

� a program P , symbolically I |= P , if I |= C for every clause C in P .

Proposition

For every positive logic program P , HB(P ) is a model of P .

27 / 45

Page 46: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Herbrand Models

Def.: Herbrand models

An interpretation I is a (Herbrand) model of

� a ground (variable-free) clause C = a← b1, . . . , bm, symbolicallyI |= C, if either {b1, . . . , bm} * I or a ∈ I;

� a clause C, symbolically I |= C, if I |= C ′ for every C ′ ∈ grnd(C);

� a program P , symbolically I |= P , if I |= C for every clause C in P .

Proposition

For every positive logic program P , HB(P ) is a model of P .

27 / 45

Page 47: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Reconsider program P :

p(X,Y, Z)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

h(X,Z ′)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

p(0, 0, b). h(0, 0). t(a, b, r).

Which of the following interpretations are models of P?

� I1 = ∅

no

� I2 = HB(P )

yes

� I3 = {h(0, 0), t(a, b, r), p(0, 0, b)}

no

28 / 45

Page 48: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Reconsider program P :

p(X,Y, Z)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

h(X,Z ′)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

p(0, 0, b). h(0, 0). t(a, b, r).

Which of the following interpretations are models of P?

� I1 = ∅ no

� I2 = HB(P )

yes

� I3 = {h(0, 0), t(a, b, r), p(0, 0, b)}

no

28 / 45

Page 49: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Reconsider program P :

p(X,Y, Z)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

h(X,Z ′)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

p(0, 0, b). h(0, 0). t(a, b, r).

Which of the following interpretations are models of P?

� I1 = ∅ no

� I2 = HB(P ) yes

� I3 = {h(0, 0), t(a, b, r), p(0, 0, b)}

no

28 / 45

Page 50: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Reconsider program P :

p(X,Y, Z)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

h(X,Z ′)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

p(0, 0, b). h(0, 0). t(a, b, r).

Which of the following interpretations are models of P?

� I1 = ∅ no

� I2 = HB(P ) yes

� I3 = {h(0, 0), t(a, b, r), p(0, 0, b)} no

28 / 45

Page 51: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Minimal Model Semantics

� A logic program has multiple models in general.

� Select one of these models as the canonical model.

� Commonly accepted: truth of an atom in model I should be“founded” by clauses.

Given:P1 = {a← b. b← c. c},

truth of a in the model I = {a, b, c} is “founded”.

Given:P2 = {a← b. b← a. c},

truth of a in the model I = {a, b, c} is not founded.

29 / 45

Page 52: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Minimal Model Semantics (cont’d)

Semantics follows Occam’s razor principle: prefer models with true-partas small as possible.

Def: Minimal models

A model I of P is minimal, if there exists no model J of P such thatJ ⊂ I.

Theorem

Every positive logic program P has a single minimal model (called theleast model), denoted LM(P ).

This is a consequence of the following property:

Proposition (Intersection closure)

If I and J are models of a positive program P , then I ∩ J is also amodel of P .

30 / 45

Page 53: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Minimal Model Semantics (cont’d)

Semantics follows Occam’s razor principle: prefer models with true-partas small as possible.

Def: Minimal models

A model I of P is minimal, if there exists no model J of P such thatJ ⊂ I.

Theorem

Every positive logic program P has a single minimal model (called theleast model), denoted LM(P ).

This is a consequence of the following property:

Proposition (Intersection closure)

If I and J are models of a positive program P , then I ∩ J is also amodel of P .

30 / 45

Page 54: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Minimal Model Semantics (cont’d)

Semantics follows Occam’s razor principle: prefer models with true-partas small as possible.

Def: Minimal models

A model I of P is minimal, if there exists no model J of P such thatJ ⊂ I.

Theorem

Every positive logic program P has a single minimal model (called theleast model), denoted LM(P ).

This is a consequence of the following property:

Proposition (Intersection closure)

If I and J are models of a positive program P , then I ∩ J is also amodel of P .

30 / 45

Page 55: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

� For P1 = { a← b. b← c. c }, we have LM(P1) = {a, b, c}.

� For P2 = { a← b. b← a. c }, we have LM(P2) = {c}.

� For P from above,

p(X,Y, Z)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

h(X,Z ′)← p(X,Y, Z ′), h(X,Y ), t(Z,Z ′, r).

p(0, 0, b). h(0, 0). t(a, b, r).

we have

LM(P ) = {h(0, 0), t(a, b, r), p(0, 0, b), p(0, 0, a), h(0, b)}.

31 / 45

Page 56: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Negation in Logic Programs

32 / 45

Page 57: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Negation in Logic Programs

Why negation?

� Natural linguistic concept.

� Facilitates convenient, declarative descriptions (definitions).

E.g., “Men who are not husbands are singles”.

Def: Normal logic program

A normal logic program is a set of rules of the form

a← b1, . . . , bm,not c1, . . . ,not cn (n,m ≥ 0) (2)

where a and all bi, cj are atoms.

The symbol “not ” is called negation as failure (or default negation, weaknegation).

33 / 45

Page 58: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Programs with Negation

� Prolog: logic-based programming language (developed in the 1970s), withparticular algorithm for proving goals (queries) 〈X〉

� Negation in Prolog:“not 〈X〉” means “negation as failure (to prove) 〈X〉”.

� Closed World Assumption (CWA): whatever cannot be derived is false.

Different from classical negation in first-order logic!

Negation as failure (default negation) not

At a rail road crossing cross the road if no train is known to approach

walk ← at(X ), crossing(X ),not train approaches(X )

Classical negation ¬

At a rail road crossing cross the road if no train approaches

walk ← at(X ), crossing(X ),¬train approaches(X )

34 / 45

Page 59: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Programs with Negation

� Prolog: logic-based programming language (developed in the 1970s), withparticular algorithm for proving goals (queries) 〈X〉

� Negation in Prolog:“not 〈X〉” means “negation as failure (to prove) 〈X〉”.

� Closed World Assumption (CWA): whatever cannot be derived is false.

Different from classical negation in first-order logic!

Negation as failure (default negation) not

At a rail road crossing cross the road if no train is known to approach

walk ← at(X ), crossing(X ),not train approaches(X )

Classical negation ¬

At a rail road crossing cross the road if no train approaches

walk ← at(X ), crossing(X ),¬train approaches(X )

34 / 45

Page 60: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Programs with Negation (cont’d)

Example:

man(dilbert).

single(X)← man(X),not husband(X).

� Can not prove husband(dilbert) from rules.

� Single intended minimal model: {man(dilbert), single(dilbert)}.

35 / 45

Page 61: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Programs with Negation (cont’d)

Example:

Modifying the last rule of P5, let the result be P1:

man(dilbert).

single(X)← man(X),not husband(X).

husband(X)← man(X),not single(X).Semantics???

Problem: not a single intuitive model!

Two intuitive Herbrand models:

M1= {man(dilbert), single(dilbert)}, and

M2= {man(dilbert), husband(dilbert)}.Which one to choose?

36 / 45

Page 62: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Programs with Negation (cont’d)

Example:

Modifying the last rule of P5, let the result be P1:

man(dilbert).

single(X)← man(X),not husband(X).

husband(X)← man(X),not single(X).Semantics???

Problem: not a single intuitive model!

Two intuitive Herbrand models:

M1= {man(dilbert), single(dilbert)}, and

M2= {man(dilbert), husband(dilbert)}.Which one to choose?

36 / 45

Page 63: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Semantics of Negation in Logic Programs

� “War of Semantics” in LP (1980/90ies):Meaning of programs like the Dilbert example above

� Single model vs. multiple model semantics

� To date:

� Well-Founded Semantics by Gelder, Ross & Schlipf (1991)

Partial model: man(dilbert) is true,single(dilbert), husband(dilbert) are unknown

� Stable Model (alias Answer Set) Semanticsby Gelfond and Lifschitz (1990)

Alternative models: M1 = {man(dilbert), single(dilbert)},M2 = {man(dilbert), husband(dilbert)}.

37 / 45

Page 64: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Semantics of Negation in Logic Programs

� “War of Semantics” in LP (1980/90ies):Meaning of programs like the Dilbert example above

� Single model vs. multiple model semantics

� To date:

� Well-Founded Semantics by Gelder, Ross & Schlipf (1991)

Partial model: man(dilbert) is true,single(dilbert), husband(dilbert) are unknown

� Stable Model (alias Answer Set) Semanticsby Gelfond and Lifschitz (1990)

Alternative models: M1 = {man(dilbert), single(dilbert)},M2 = {man(dilbert), husband(dilbert)}.

37 / 45

Page 65: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Semantics of Negation in Logic Programs

� “War of Semantics” in LP (1980/90ies):Meaning of programs like the Dilbert example above

� Single model vs. multiple model semantics

� To date:

� Well-Founded Semantics by Gelder, Ross & Schlipf (1991)

Partial model: man(dilbert) is true,single(dilbert), husband(dilbert) are unknown

� Stable Model (alias Answer Set) Semanticsby Gelfond and Lifschitz (1990)

Alternative models: M1 = {man(dilbert), single(dilbert)},M2 = {man(dilbert), husband(dilbert)}.

37 / 45

Page 66: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Semantics of Negation in Logic Programs

� “War of Semantics” in LP (1980/90ies):Meaning of programs like the Dilbert example above

� Single model vs. multiple model semantics

� To date:

� Well-Founded Semantics by Gelder, Ross & Schlipf (1991)

Partial model: man(dilbert) is true,single(dilbert), husband(dilbert) are unknown

� Stable Model (alias Answer Set) Semanticsby Gelfond and Lifschitz (1990)

Alternative models: M1 = {man(dilbert), single(dilbert)},M2 = {man(dilbert), husband(dilbert)}.

37 / 45

Page 67: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Semantics of Negation in Logic Programs

� “War of Semantics” in LP (1980/90ies):Meaning of programs like the Dilbert example above

� Single model vs. multiple model semantics

� To date:

� Well-Founded Semantics by Gelder, Ross & Schlipf (1991)

Partial model: man(dilbert) is true,single(dilbert), husband(dilbert) are unknown

� Stable Model (alias Answer Set) Semanticsby Gelfond and Lifschitz (1990)

Alternative models: M1 = {man(dilbert), single(dilbert)},M2 = {man(dilbert), husband(dilbert)}.

37 / 45

Page 68: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Stable Models: Intuition

Consider program P1:

man(dilbert). (f1)

single(dilbert)← man(dilbert),not husband(dilbert). (r1)

husband(dilbert)← man(dilbert),not single(dilbert). (r2)

� Consider M ′ = {man(dilbert)}.

� Assuming that man(dilbert) is true and husband(dilbert) is false, byr1 also single(dilbert) should be true.

� M ′ does not represent a coherent or “stable” view of the informationgiven by P1.

� Consider M ′′ = {man(dilbert), single(dilbert), husband(dilbert)}.� The bodies of r1 and r2 are not true w.r.t. M ′′, hence there is no

evidence for single(dilbert) and husband(dilbert) being true.� M ′′ is not “stable” either.

38 / 45

Page 69: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Stable Models: Intuition

Consider program P1:

man(dilbert). (f1)

single(dilbert)← man(dilbert),not husband(dilbert). (r1)

husband(dilbert)← man(dilbert),not single(dilbert). (r2)

� Consider M ′ = {man(dilbert)}.

� Assuming that man(dilbert) is true and husband(dilbert) is false, byr1 also single(dilbert) should be true.

� M ′ does not represent a coherent or “stable” view of the informationgiven by P1.

� Consider M ′′ = {man(dilbert), single(dilbert), husband(dilbert)}.� The bodies of r1 and r2 are not true w.r.t. M ′′, hence there is no

evidence for single(dilbert) and husband(dilbert) being true.� M ′′ is not “stable” either.

38 / 45

Page 70: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Stable Models: Intuition

Consider program P1:

man(dilbert). (f1)

single(dilbert)← man(dilbert),not husband(dilbert). (r1)

husband(dilbert)← man(dilbert),not single(dilbert). (r2)

� Consider M ′ = {man(dilbert)}.

� Assuming that man(dilbert) is true and husband(dilbert) is false, byr1 also single(dilbert) should be true.

� M ′ does not represent a coherent or “stable” view of the informationgiven by P1.

� Consider M ′′ = {man(dilbert), single(dilbert), husband(dilbert)}.� The bodies of r1 and r2 are not true w.r.t. M ′′, hence there is no

evidence for single(dilbert) and husband(dilbert) being true.� M ′′ is not “stable” either.

38 / 45

Page 71: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Stable Models

Def: Gelfond-Lifschitz reduct, stable models, answer sets

� The GL-reduct (or simply reduct) of a ground program P w.r.t. aninterpretation M , denoted PM , is the program obtained from P byperforming the following two steps:

1. remove all rules with some not a in its body s.t. a ∈M ; and2. remove all default negated literals from the remaining rules.

� An interpretation M of P is a stable model (or answer set) of P if

M = LM(PM ).

39 / 45

Page 72: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Stable Models (cont’d)

Intuition behind GL-reduct:

� M makes an assumption about what is true and what is false.

� The GL-reduct PM incorporates this assumption.

� As a “not”-free program, PM derives positive facts, given by theleast model LM(PM ).

� If this coincides with M , then the assumption of M is “stable”.

Observe:

� PM = P for any “not”-free program P .

� For any positive program P , LM(P ) (=LM(PM )) is its singlestable model.

40 / 45

Page 73: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Consider again the grounding of P1:

man(dilbert). (f1)

single(dilbert)← man(dilbert),not husband(dilbert). (r1)

husband(dilbert)← man(dilbert),not single(dilbert). (r2)

Candidate interpretations:

� M1 = {man(dilbert), single(dilbert)},� M2 = {man(dilbert), husband(dilbert)},� M3 = {man(dilbert), single(dilbert), husband(dilbert)},� M4 = {man(dilbert)}.

M1 and M2 are stable models.

41 / 45

Page 74: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example

Consider again the grounding of P1:

man(dilbert). (f1)

single(dilbert)← man(dilbert),not husband(dilbert). (r1)

husband(dilbert)← man(dilbert),not single(dilbert). (r2)

Candidate interpretations:

� M1 = {man(dilbert), single(dilbert)},� M2 = {man(dilbert), husband(dilbert)},� M3 = {man(dilbert), single(dilbert), husband(dilbert)},� M4 = {man(dilbert)}.

M1 and M2 are stable models.

41 / 45

Page 75: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example (cont’d)

Recall the program P1:

man(dilbert). (f1)

single(dilbert)← man(dilbert),not husband(dilbert). (r1)

husband(dilbert)← man(dilbert),not single(dilbert). (r2)

Consider M1 = {man(dilbert), single(dilbert)}:

GL-reduct PM11 of M1 is as follows:

man(dilbert).

single(dilbert)← man(dilbert).

The least model of PM11 is {man(dilbert), single(dilbert)} = M1.

By symmetry of husband and single, alsoM2 = {man(dilbert), husband(dilbert)} is stable.

42 / 45

Page 76: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example (cont’d)

Recall the program P1:

man(dilbert). (f1)

single(dilbert)← man(dilbert),not husband(dilbert). (r1)

husband(dilbert)← man(dilbert),not single(dilbert). (r2)

Consider M1 = {man(dilbert), single(dilbert)}:

GL-reduct PM11 of M1 is as follows:

man(dilbert).

single(dilbert)← man(dilbert).

The least model of PM11 is {man(dilbert), single(dilbert)} = M1.

By symmetry of husband and single, alsoM2 = {man(dilbert), husband(dilbert)} is stable.

42 / 45

Page 77: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example (cont’d)

Recall the program P1:

man(dilbert). (f1)

single(dilbert)← man(dilbert),not husband(dilbert). (r1)

husband(dilbert)← man(dilbert),not single(dilbert). (r2)

Consider M1 = {man(dilbert), single(dilbert)}:

GL-reduct PM11 of M1 is as follows:

man(dilbert).

single(dilbert)← man(dilbert).

The least model of PM11 is {man(dilbert), single(dilbert)} = M1.

By symmetry of husband and single, alsoM2 = {man(dilbert), husband(dilbert)} is stable.

42 / 45

Page 78: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Example (cont’d)

Recall the program P1:

man(dilbert). (f1)

single(dilbert)← man(dilbert),not husband(dilbert). (r1)

husband(dilbert)← man(dilbert),not single(dilbert). (r2)

Consider M1 = {man(dilbert), single(dilbert)}:

GL-reduct PM11 of M1 is as follows:

man(dilbert).

single(dilbert)← man(dilbert).

The least model of PM11 is {man(dilbert), single(dilbert)} = M1.

By symmetry of husband and single, alsoM2 = {man(dilbert), husband(dilbert)} is stable.

42 / 45

Page 79: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

Introduction Horn Logic Programming Negation in Logic Programs Answer Set Semantics

Summary

1. Introduction and background

2. Horn logic programming� Positive logic programs� Minimal model semantics

3. Negation in logic programs� Negation in prolog� Semantics of negation in logic programs

4. Answer-Set semantics� Semantic properties of stable models� Computational properties

43 / 45

Page 80: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

References I

Georg Boenn, Martin Brain, Marina De Vos, and John ffitch.

Anton - A rule-based composition system.

In Proceedings of the 2011 International Computer Music Conference,ICMC 2011, Huddersfield, UK, July 31 - August 5, 2011. MichiganPublishing, 2011.

Esra Erdem, Michael Gelfond, and Nicola Leone.

Applications of answer set programming.

AI Magazine, 37(3):53–68, 2016.

Roland Kaminski, Torsten Schaub, Anne Siegel, and Santiago Videla.

Minimal intervention strategies in logical signaling networks with ASP.

TPLP, 13(4-5):675–690, 2013.

Page 81: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

References II

Vladimir Lifschitz.

Answer set planning.

In Proc. 16th International Conference on Logic Programming (ICLP),,pages 23–37, 1999.

Vladimir Lifschitz.

Answer Set Programming and Plan Generation.

Artificial Intelligence, 138:39–54, 2002.

Victor W. Marek and Miros law Truszczynski.

Stable Models and an Alternative Logic Programming Paradigm.

In K. Apt, V. W. Marek, M. Truszczynski, and D. S. Warren, editors, TheLogic Programming Paradigm – A 25-Year Perspective, pages 375–398.Springer, 1999.

Page 82: Knowledge Representation for the Semantic Web [2ex ...people.mpi-inf.mpg.de/~dstepano/KRSW/slides/lecture6.pdf · Knowledge Representation for the Semantic Web Lecture 6: Answer Set

References III

Ilkka Niemela.

Logic Programming with Stable Model Semantics as ConstraintProgramming Paradigm.

Annals of Mathematics and Artificial Intelligence, 25(3–4):241–273, 1999.

Monica Nogueira, Marcello Balduccini, Michael Gelfond, Richard Watson,and Matthew Barry.

An a-prolog decision support system for the space shuttle.

In I. V. Ramakrishnan, editor, Practical Aspects of Declarative Languages,Third International Symposium, PADL 2001, Las Vegas, Nevada, March11-12, 2001, Proceedings, volume 1990 of Lecture Notes in ComputerScience, pages 169–183. Springer, 2001.