Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT...

357
VRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN V AKGROEP I NFORMATICA S R E V I N U I T E I T E J I R V B R U S S E L E C N I V R E T E N E B R A S A I T N E I C S Logisch Programmeren, Beslissingen en Spelen Proefschrift ingediend met het oog op het behalen van de graad van Dokter in de Wetenschappen Door: Marina De Vos Promotor: Prof. Dr. D. Vermeir december, 2001

Transcript of Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT...

Page 1: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

VRIJE UNIVERSITEIT BRUSSEL

FACULTEIT WETENSCHAPPEN

VAKGROEP INFORMATICA

SREVINU

ITEIT

EJIR

V

BRUSS

EL

ECNIVRE T EN

EB

RA

S

AI

TN

EIC

S

Logisch Programmeren,Beslissingen en Spelen

Proefschrift ingediend met het oog op het behalen van de graad van Dokterin de Wetenschappen

Door: Marina De Vos

Promotor: Prof. Dr. D. Vermeir

december, 2001

Page 2: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

ii

Page 3: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Samenvatting

In dit proefschrift onderzoeken we het gebruik van logisch programmeren ombeslissingsproblemen te modeleren. Met dit als doel introduceren we verschil-lende formalismen met steeds een grotere expressiviteit. Het eenvoudigste, keuze-toelatend logisch programmeren (choice logic programming), laat toe om te re-deneren over beslissingen die afhankelijk zijn van de situatie. De stabiele mo-dellen stemmen overeen met de rationele oplossingen van hetgerepresenteerdebeslissingsprobleem. Voor het ondersteunen van dynamische voorkeursafhanke-lijke besluitvorming werd ons formalisme uitgebreid naar geordend keuze-toelatendlogisch programmeren (ordered choice logic programming).Om de verschillendewijzen te ondersteunen waarop twee alternatieven met een zelfde voorkeur behan-deld worden, werden zowel de sceptische stabiele-modellen-semantiek en de meerbesluitvormende antwoordenverzamelingen-semantiek voorgesteld. Beslissingenmoeten vaak genomen worden zonder dat al de nodige informatie beschikbaaris. Om met dergelijke onzekerheid rekening te kunnen houdenwerden dynamischgeordende probabilistische keuze-toelatende logische programma’s naar voren ge-schoven. De stabiele modellen van deze programma’s geven die oplossingen weerdie op een rationele manier omgaan met onzekerheid.

Speltheorie, een collectie van analytische methoden voor het bestuderen van deinteractie die plaatsvindt tussen besluitnemers, wordt gebruikt om het nut en debruikbaarheid van onze formalismen aan te tonen. Strategische spelen en uit-gebreide spelen met perfecte informatie kunnen op een elegante wijze gerepre-senteerd worden door onze programma’s zodanig dat de equilibria van de spelenovereenstemmen met de stabiele modellen of de antwoordenverzamelingen vande programma’s. Deze equilibria zijn niet noodzakelijk spelerdeterministisch, indie zin dat een enkele speler, met kennis van de acties van de overige spelers, hetequilibrium op een rationele manier kan verlaten. Om deze reden stellen wij spe-lerdeterministische, genaamd voorzichtige, Nash en deelspel perfecte equilibria

iii

Page 4: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

iv

voor als de sceptische stabiele modellen van het overeenkomstige programma.

Voor het bestuderen van het beslissingsproces en de interactie tussen de verschil-lende besluitnemers introduceren wij een raamwerk voor logische programma-agenten. Wanneer we dit toepassen op speltheorie laat dit ons toe om elke spelerafzonderlijk op te volgen en te redeneren over haar kennis enveronderstellingen.

Page 5: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

VRIJE UNIVERSITEIT BRUSSEL

FACULTY OF SCIENCE

DEPARTMENT OFCOMPUTER SCIENCE

SREVINU

ITEIT

EJIR

V

BRUSS

EL

ECNIVRE T EN

EB

RA

S

AI

TN

EIC

S

Logic Programming, Decisions and Games

A dissertation submitted in partial fulfillment of the requi rements of thedegree of Doctor in Sciences

By: Marina De Vos

Advisor: Prof. Dr. D. Vermeir

December, 2001

Page 6: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

ii

Page 7: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Abstract

In this dissertation we investigate logic programming to model decision-making.To this extent, we introduce three formalisms with increasing expressiveness. Themost basic one, called choice logic programming, allows circumstance-dependentdecisions. The stable models of the program correspond to the rational solu-tions of the represented decision-problem. To support dynamic preference-baseddecision-making, we extend our formalism to ordered choicelogic programming.To accommodate the various ways two equally preferred alternatives are dealtwith, both the skeptical stable model semantics and the morecredulous answerset semantics are introduced. Decisions often have to be made without completeinformation. In order to deal with uncertainty, dynamically ordered probabilisticchoice logic programs are presented. The stable models of these programs repre-sent those solutions that deal with uncertainty in a rational manner. Game theory,a collection of analytical tools for studying the interaction of decision-makers,is used to demonstrate the effectiveness of our formalisms.Strategic games andextensive games with perfect information can be elegantly represented in our for-malism such that the equilibria of the games can be retrievedas the stable modelsor answer sets of the programs. These equilibria are not player-deterministic inthe sense that a single player, given the other players’ actions, could rationallyleave an equilibrium state. We introduce player-deterministic, called cautious,Nash and subgame perfect equilibria as the skeptical stablemodels of the trans-formed game. To study the decision-process and the interaction between variousdecision-makers, we introduce a framework for logic programming agents. Whenapplied to game theory, this enables us to monitor and reasonabout the knowledgeand beliefs of each single player.

iii

Page 8: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

iv ABSTRACT

Page 9: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Contents

Abstract iii

Acknowledgements ix

1 Introduction 1

1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Preliminary Mathematical Notions 7

3 Logic Programming 13

3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.2 Positive Logic Programs . . . . . . . . . . . . . . . . . . . . . . 16

3.3 Introducing Negation as Failure . . . . . . . . . . . . . . . . . . 22

3.4 Disjunctive Logic Programming . . . . . . . . . . . . . . . . . . 31

3.4.1 Stable Model Semantics . . . . . . . . . . . . . . . . . . 32

3.4.2 Possible Model Semantics . . . . . . . . . . . . . . . . . 39

3.5 Extended Disjunctive Logic Programs . . . . . . . . . . . . . . . 43

3.6 Beyond Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

3.7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

4 Game Theory 57

v

Page 10: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

vi CONTENTS

4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

4.2 Strategic Games . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

4.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 60

4.2.2 Nash Equilibria . . . . . . . . . . . . . . . . . . . . . . . 61

4.2.3 Mixed Strategy Nash Equilibria . . . . . . . . . . . . . . 65

4.3 Extensive Games with Perfect Information . . . . . . . . . . . .. 69

4.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 69

4.3.2 Nash Equilibria . . . . . . . . . . . . . . . . . . . . . . . 70

4.3.3 Subgame Perfect Equilibria . . . . . . . . . . . . . . . . 75

4.4 Game Theory and Logic . . . . . . . . . . . . . . . . . . . . . . 80

4.4.1 Logic Games . . . . . . . . . . . . . . . . . . . . . . . . 80

4.4.2 Game Logic . . . . . . . . . . . . . . . . . . . . . . . . . 80

4.5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

5 Choice Logic Programming 83

5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

5.2 Choice Logic Programs . . . . . . . . . . . . . . . . . . . . . . . 86

5.3 Simulating Semi-Negative Logic Programs . . . . . . . . . . . .95

5.4 Unfounded sets and Stable Models . . . . . . . . . . . . . . . . . 112

5.4.1 Unfounded Sets . . . . . . . . . . . . . . . . . . . . . . . 113

5.4.2 A Fixpoint-Operator forGUSP . . . . . . . . . . . . . . 119

5.4.3 Unfounded Sets and Stable Models . . . . . . . . . . . . 122

5.4.4 A Fixpoint Semantics for Stable Models . . . . . . . . . . 127

5.4.5 An Algorithm for Computing Stable Models . . . . . . . 132

5.5 Choice Logic Programs and Game Theory . . . . . . . . . . . . . 142

5.6 Relationship with Other Approaches . . . . . . . . . . . . . . . . 146

5.6.1 Logic Programming Formalisms . . . . . . . . . . . . . . 146

5.6.2 Logic Programming and Strategic Games . . . . . . . . . 153

Page 11: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

CONTENTS vii

5.7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

6 Ordered Choice Logic Programming 157

6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

6.2 Ordered Choice Logic Programs . . . . . . . . . . . . . . . . . . 160

6.3 The Stable Model Semantics . . . . . . . . . . . . . . . . . . . . 165

6.3.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . 165

6.3.2 Fixpoint Characterization . . . . . . . . . . . . . . . . . . 170

6.3.2.1 Extending Unfounded sets . . . . . . . . . . . . 170

6.3.2.2 Detecting Stable Models . . . . . . . . . . . . . 178

6.3.2.3 Stable Models as Fixpoints . . . . . . . . . . . 184

6.3.2.4 Procedural Semantics . . . . . . . . . . . . . . 189

6.3.2.5 The Algorithm . . . . . . . . . . . . . . . . . . 193

6.4 Skeptical vs. Credulous . . . . . . . . . . . . . . . . . . . . . . . 203

6.4.1 The Answer Set Semantics . . . . . . . . . . . . . . . . . 204

6.4.2 A Credulous Fixpoint Characterization . . . . . . . . . . 214

6.4.2.1 Assumption sets . . . . . . . . . . . . . . . . . 215

6.4.2.2 Assumption Sets for Answer Set Detection . . . 219

6.4.2.3 Answer Sets as Fixpoints . . . . . . . . . . . . 220

6.4.2.4 Procedural Declaration . . . . . . . . . . . . . 223

6.4.2.5 The Credulous Algorithm . . . . . . . . . . . . 225

6.5 Logic Programming in OCLP . . . . . . . . . . . . . . . . . . . . 231

6.6 OCLP and Game Theory . . . . . . . . . . . . . . . . . . . . . . 237

6.6.1 Modeling Extensive Games with Perfect Information . .. 237

6.6.2 Cautious Equilibria . . . . . . . . . . . . . . . . . . . . . 248

6.7 Relationship with Other Approaches . . . . . . . . . . . . . . . . 251

6.7.1 Ordered Logic Programming . . . . . . . . . . . . . . . . 251

6.7.2 OCLP and Game Theory . . . . . . . . . . . . . . . . . . 258

Page 12: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

viii CONTENTS

6.7.3 Preferences/Order . . . . . . . . . . . . . . . . . . . . . 259

6.8 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261

7 DOP-CLP 265

7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265

7.2 DOP-CLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268

7.3 An Application of DOP-CLPs: Game theory . . . . . . . . . . . . 287

7.4 Relationships to Other Approaches . . . . . . . . . . . . . . . . . 299

7.4.1 Logic Programming . . . . . . . . . . . . . . . . . . . . 299

7.4.2 Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . 299

7.4.3 Uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . 301

7.4.4 Games . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

7.5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302

8 Logic Programming Agents 303

8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303

8.2 Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

8.3 Playing Games . . . . . . . . . . . . . . . . . . . . . . . . . . . 317

8.3.1 Phase 1: OCLPs Representing Games . . . . . . . . . . . 317

8.3.2 Phase 2: Player Based OCLPs . . . . . . . . . . . . . . . 318

8.3.3 Phase 3: Multi-agent Systems . . . . . . . . . . . . . . . 321

8.4 Relationship with Other Approaches . . . . . . . . . . . . . . . . 324

8.5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325

9 Conclusions and Future Research 327

9.1 General Conclusions . . . . . . . . . . . . . . . . . . . . . . . . 327

9.2 Further Research . . . . . . . . . . . . . . . . . . . . . . . . . . 327

Page 13: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Acknowledgements

I would like to express my gratitude to a number of people who helped me, directlyor indirectly, with the realization of this dissertation.

First of all, most of my gratitude goes to Prof. Dr. D. Vermeirfor being a greatadvisor. With a perfect balance between giving me the freedom to work at myown pace and steering me in the right direction, he is the bestadvisor I couldhave wished for. Thanks for the many hours of discussion, guidance and the manyresearch opportunities you created for me. It is a great pleasure working with sucha stimulating and enthusiastic mentor.

I am very grateful to the people of the Flemish Science Foundation (FWO-Vlaan-deren) for the scholarship they gave me. With their financialsupport I was able toconcentrate totally on my research. Thank you very much for this opportunity.

To my proof readers, Werner De Vos, Johan Fabry and Davy Van Nieuwenborgh,many thanks for reading and correcting all the drafts of thisdissertation. I alsowish to thank Alessandro Provetti for the suggestions he made at the risk of miss-ing his flight.

I also would like to thank my colleague Davy Van Nieuwenborghfor being a goodfriend. Thanks, Davy, for the pleasant atmosphere, the technical back-up and theinteresting discussions.

I would like to express my deep appreciation to my parents fortheir never-endingcare and support. Without them, I probably would not have started a Ph.D. in thefirst place. To my mother, my best friend, thanks for being there for me all theseyears.

Last but not least, to you who is reading my dissertation at the moment, thank youfor your interest in my research. I hope you appreciate it.

Marina De Vos.

ix

Page 14: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

x ACKNOWLEDGEMENTS

Page 15: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Chapter 1

Introduction

This dissertation is dedicated to the study of decision-making in a logic program-ming environment. In this chapter we present the motivationfor our thesis and abrief sketch of each of the formalisms that we will develop.

1.1 Motivation

Logic programming and more precisely answer set programming is increasinglyrecognized as a valuable tool for knowledge representation. In the time of infor-mation expansion, decision-support systems become more important than ever.The natural and elegant representation skill of logic programming formalisms andthe similarities between the models of a logic program and the solutions of adecision-problem are the main motivation for this dissertation. More precisely,we make the following claim.

Thesis. Modeling and solving decision-problems can be achieved ina very expressive and natural way by adopting a logic programmingapproach.

The main theme of this dissertation is the transformation ofdecision-problems to(extensions of) logic programs such that the semantics of the programs reflect the

1

Page 16: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

2 CHAPTER 1. INTRODUCTION

solutions of the represented problems. Graphically, this can be represented by thefollowing diagram.

Solution Model

semantics

Decision−problem D Logic Program P(D)

solve

$f$

Figure 1.1: The main theme

Of course, the value of this approach depends on the convenience off . In thisthesis we will consider a number of extensions of logic programming that willenablef to be straightforward and intuitive.

Further on (Chapter 8) we will refine the above correspondence even more wherethe programP (D) will be extended to a structure of programs, each representinga participant in the decision-making process. The added relationship betweenprograms then represents the communication between the decision-makers.

To demonstrate the effectiveness of our formalism, we use game theory, a collec-tion of analytical tools for studying the interaction between decision-makers, as atest case.

A natural question to ask is whether the mappingf can be reversed. I.e. can onederive interesting game theoretic notions from the logic programming formalismsthat we propose?

A small step in this direction can already be found in Chapter6 where we definethe notion of “cautious equilibrium” which follows naturally from semantic con-siderations for ordered choice logic programs. Also, it is clear that e.g. orderedchoice logic programs can represent “games” that are more complex than standardgames, with respect to the environment and the interaction between the players.

For example, consider a modification of the Prisoner’s Dilemma, where there isan extra condition that one prisoner caught the rumor that the other was an un-dercover agent. With this information, he knows that he simply has to remainsilent. In a logic program one can simply add this new information. In traditionalstrategic games, players cannot anticipate information from the environment.

Page 17: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

1.2. OVERVIEW 3

1.2 Overview

In this section, we briefly sketch the contents of the rest of this dissertation.

Chapter 2 provides preliminary mathematical notions needed in later chapters. Anoverview of logic programming, especially the various total semantics that havebeen proposed, is presented in Chapter 3. Chapter 4 introduces game theory, inparticular the notions of strategic games and extensive games with perfect infor-mation. To model those outcomes of the game where each playeracts rationally,we recall various equilibria for both types of games.

In Chapter 5, we present our first simple formalism to represent decisions: choicelogic programs. These consist simply of rules of the formA B whereA andB are sets of atoms whereB is a conjunction andA an exclusive disjunction. Inother words, ifB is true, one is forced to choose exactly one of the alternativesin A. We provide a simple semantics where models are minimal interpretationsthat satisfy the rules. A stable semantics is provided through a variant of theGelfond-Lifschitz transformation which, given an interpretationI, transforms achoice logic programP into a positive logic programP I . A stable modelM thencoincides with the unique minimal model ofPM . A fixpoint characterization andan associated bottom-up algorithm to compute stable modelsis provided. More-over, we show that minimal models and stable models coincide(a property thatwill no longer hold for ordered programs).

Although choice logic programs do not use negation, a semi-negative programcan be transformed into an equivalent (under the stable model semantics) choiceprogram, as long as the original program is positive-acyclic, thus showing thatexclusive disjunction can be used to simulate negation.

The rules in choice logic programs can obviously be used to model players instrategic games, where the bodyB of a ruleA B represents the conditionsunder which a player chooses one of the actions inA. It can be shown that, undera natural construction, the Nash equilibria of a strategic gameG coincide with thestable models of the corresponding choice logic programPG.

For basic decision-problems, choice logic programming works fine. But often,when a number of alternatives are possible, the decision-maker will express somepreference. To allow preference-based decision-making, we extend, in Chapter 6,choice logic programming to ordered choice logic programming. We define apreference relation on choice logic programs which are called components, whereeach rule has the same preference. In each component, information from less

Page 18: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4 CHAPTER 1. INTRODUCTION

preferred components can be used as long as no contradictions occur. Wheneverconflicts arise, the alternative forced in the most specific component should beaccepted. The rule forcing the other alternative is said to be defeated. Just as forchoice logic programs, atoms become alternatives when theyappear together inan applicable choice (a ruleA B, whereB is consider to be true). To allowdecisions,A B, to be defeated, we require that for everya 2 A a betterforced alternative exists. We provide a simple model semantics demanding thatfor every ruler : A B eitherB is false, one element fromA is chosen or thatr is defeated. A stable semantics is provided through a variant of the Gelfond-Lifschitz transformation which, given an interpretationI, transforms an orderedchoice logic programP into a choice logic programP I by removing all defeatedrules. A stable modelM of P corresponds to a stable model ofPM . For orderedchoice logic programs we no longer have an equivalence between the stable modelsemantics and the minimal model semantics. Nevertheless, every stable model isminimal. A fixpoint characterization and a bottom-up algorithm for stable modelsis provided using the implicit appearance of negation.

Although ordered choice logic programs do not contain any form of negation, anextended logic program can be transformed into an ordered choice logic programsuch that the answer sets of the former coincide with the stable models of thelatter. In addition, we demonstrate that ordered choice logic programming is ageneralization of ordered logic programming.

The stable model semantics for ordered choice logic programs is rather skeptical.Whenever two or more alternatives are equally preferred or unrelated, the seman-tics remains indecisive. In a number of situations it is crucial that a decision ismade no matter what. This new semantics, the answer set semantics, uses a morecredulous version of defeating, called c-defeating. A ruleA B may now beignored, i.e. c-defeated, when, for eacha 2 A, a ruleA0 B0 exists in a not lesspreferred component withA0 a set of alternatives ofa such thatB0 is true and thatexact one alternativea0 2 A0 is considered to be true. An answer setM of P is aninterpretation which is a stable model of the reductPM obtained by removing allc-defeated rules fromP . A fixpoint characterization and an associated algorithmis also provided for the answer set semantics using the hidden presence of nega-tion. We demonstrate that this more credulous semantics is no longer a minimalmodel semantics.

We propose an elegant and natural transformation from an extensive game withperfect informationG to an ordered choice logic programPG such that, depending

Page 19: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

1.2. OVERVIEW 5

on the transformation, either the Nash equilibria or subgame perfect equilibria ofG coincide with the answer sets ofPG. We argue that these equilibria are notplayer-deterministic in the sense that a single player can be responsible for makingthe outcome of the game not deterministic. To this extent, weintroduce the notionof cautious equilibria as the stable models of the corresponding ordered choicelogic program.

To model uncertainty in the decision making process, we introduce in Chapter 7dynamically ordered probabilistic choice logic programs (dop-clp) as a generali-zation of choice logic programs. A dop-clp consists of a set of rulesA p B,which indicate that the the conditionsB support the choice between the alterna-tivesA with a static priorityp. WhenB can only be considered true with a certainprobability, we must adjust the static priority with this probability. This is calledthe dynamic probability of the rule. The dynamic priority ofan atom is the sumof all the dynamic priorities of the rulesr for which a is a conclusion. An in-terpretation for a dop-clp is a probability distribution over the interpretations ofthe underlying choice logic program. A model is an interpretation which makessure that for every ruleA p B either the probability ofB is zero, there is onealternativea 2 A with a non-zero probability and no two atomsa; b 2 A can betrue at the same time, or for everya 2 A an alternative with a non-zero probabi-lity and a dynamic priority at least as high asa exists. A stable model semanticsis provided. A modelM for a dop-clpP is a stable model whenM generatesa probability distribution of the alternatives of a decision. In addition, an atommay only be given a probability when no other alternative exists with a higher dy-namic priority. Furthermore, each atom must contribute equally to every situationto whichM assigns a positive probability.

We demonstrate that the stable model semantics is a generalization of the stablemodel semantics for choice logic programs. For positive logic programs, we evenhave a unique stable modelM only assigning a non-zero probability to a singlesituation corresponding to the minimal model of the logic program.

The specific way probabilities are treated by a dop-clp makesthe programmingformalism an elegant tool for the representation of strategic games. The mixedstrategy Nash equilibria of the game correspond exactly with the stable models ofthe program.

Decision-making often involves a number of decision-makers that need to interactwith each other in order to come to a conclusion. Previous system were designedto represent and solve decision-problems. The interactionbetween the partici-

Page 20: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6 CHAPTER 1. INTRODUCTION

pants is not their main concern. In Chapter 8, we propose a framework for logicprogramming agents that enables us not only to obtain the solutions of a decision-problem but also to monitor the interaction between the participants. Each frame-work consists of a number of agents connected by means of uni-direction chan-nels. The communication between agents is done by putting interpretations ontothe output channels. Each agent updates her private information with the infor-mation she receives from her input channels. We propose a stable model and ananswer set semantics. A stable model (resp. an answer set) ofthe framework isthe output generated by the output agent when each agentA passes a stable model(resp. an answer set) of her updated program to the connectedagents.

We demonstrate that extensive games with perfect information have a natural for-mulation as a framework of logic programming agents with a particularly simpleinformation-flow structure between the agents. The answer set semantics of sucha system is shown to coincide with the game’s equilibria (Nash or subgame per-fect, depending on the transformation used to construct theagents). Moreover, thefixpoint computation of a model closely mirrors the actual reasoning of a playerin reaching a conclusion corresponding to an equilibrium.

We end this dissertation with Chapter 9, providing the general conclusions and thedirections for future research.

Page 21: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Chapter 2

Preliminary Mathematical Notions

In this chapter, we briefly review some mathematical concepts that will be usefullater on.

Definition 2.0.1 LetS be a set. ArelationR onS is a subset ofS � S. We usexRy to denote an element(x; y) 2 R. Similarly, a relation between two setsAandB is a subset ofA� B.

Partial orders are relations that have certain properties.

Definition 2.0.2 A relationR on a setS is a partial order if the following condi-tions are satisfied:

1. xRx, for all x 2 S (i.e.R is reflexive); and

2. xRy andyRx implyx = y, for all x; y 2 S (i.e.R is anti-symmetric); and

3. xRy andyRz implyxRz, for all x; y; z 2 S (i.e.R is transitive).

A setS endowed with a partial ordering relation is called apartially ordered setor poset.

Definition 2.0.3 A relationR on a setS is a strict partial order if the followingconditions are fulfilled:

1. x6Rx, for all x 2 S (i.e.R is anti-reflexive); and

7

Page 22: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

8 CHAPTER 2. PRELIMINARY MATHEMATICAL NOTIONS

2. xRy andyRz implyxRy for all x; y; z 2 S (i.e.R is transitive)

A setS endowed with a strict partial ordering relation is called a strict partiallyordered set.

Notice that a strict partial order is also anti-symmetric. Suppose for a momentthat elementsx; y 2 S exist such thatxRy andyRx. Transitivity implies thatxRx which is in contradiction withR being anti-reflexive.

Definition 2.0.4 A (strict) partial order is called a(strict) total orderiff8x; y 2 S � x 6= y ) xRy or yRx :Definition 2.0.5 A (strict) partial order is called a(strict) pointed partial orderiff 9x 2 S � 8y 2 S � x 6= y ) xRyIn this case we callx the leastelement.

Example2.0.1 Given a setS, one can easily see that2S endowed with the inclu-sion relation� is a poset. Even more precise, it is a pointed poset with; as theleast element.On the other hand, it can be checked that the set of natural numbers is a stricttotal pointed order w.r.t.� . Here we have that0 is the least element.

From now on we will use the standard notation to denote a partial order, i.e4 . AsetS with a partial order4, a poset, is denotedS;4 .

Definition 2.0.6 Consider the posetS;4 . An elementa 2 S is anupper boundof a subsetX of S if x 4 a, for all x 2 X. Similarly,b 2 S is a lower boundofX if b 4 x, for all x 2 X.

Definition 2.0.7 Let S;4 be a poset. Thena 2 S is the least upper boundof asubsetX of S, denotedlub(X), if a is an upper bound ofX and, for all upperboundsa0 of X, we havea 4 a0. Similarly,b 2 S is thegreatest lower boundofa subsetX of S, denotedglb(X), if b is a lower bound ofX and, for all lowerboundsb0 ofX, we haveb0 4 b.

Page 23: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

9

Notice that both the greatest lower bound and the least upperbound ofX areunique, if they exist. When they do, we have a lattice.

Definition 2.0.8 Let L;4 be a poset. Iflub(X) exists for every subsetX of L,thenL;4 is a complete meet-semilattice.

Definition 2.0.9 Let L;4 be a poset. Ifglb(X) exists for every subsetX of L,thenL;4 is a complete join-semilattice.

Notice that a complete join-semilattice is immediately a pointed poset.

Definition 2.0.10 A posetL;4 is acomplete latticeiff it is both a complete meet-semilattice and a complete join-semilattice.

For a complete latticeL;4 we use> to denote thetop elementlub(L) while?is used to denote thebottom elementglb(L).Example2.0.2 Let us reconsider Example 2.0.1. It is easy to verify that2S;� isa complete lattice. The least upper bound for a setX � 2S is the union of theelements in the set, i.e.lub(X) = SX. On the other hand, the greatest lowerbound ofX is the intersection of the elements in the set, i.e.glb(X) = TX.Furthermore, we have> = S and? = ;.Definition 2.0.11 LetL;4 be a complete lattice andX 2 L. We sayX isdirectedif every subset ofX has an upper bound inX.

Example2.0.3 Consider the lattice2D;�withD = ftri eratops; tyrannosaurus,velo iraptor ;bra hiosaurusg. The subsetX = fD1 = fvelo iraptorg; D2 =fbra hiosaurusgg is not directed becauseX does not have an upper bound inX.We haveD1 * D2 andD2 * D1.Definition 2.0.12 A function, or operator, mapping, f : A! B from a setA toa setB is a relation fromA toB such that

1. all elements ofA are related to some element ofB; and

2. 8x; 8y1; y2 2 B � xfy1 ^ xfy2 ) y1 = y2.

Page 24: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

10 CHAPTER 2. PRELIMINARY MATHEMATICAL NOTIONS

Instead of using xfy for a function, we usey = f(x), wherey is called theimageof x by f . WhenA is a set of n-tuples, we will writey = f(a1; : : : ; an) forevery tuple(a1; : : : ; an). In this case, we say thatf ’s arity is n. The elementsai are called the arguments of the functionf . WhenA is not a set of tuples,fhas an arity of 1. The setA is called thedomainof the functionf . The imageof the functionf is a subsetf(A) of B such that8a 2 A � f(a) 2 f(A) and8b 2 f(A) � 9a 2 A � f(a) = b. When the domain of a function is clear from thecontext, we often identify the function by its image.

Definition 2.0.13 LetL1;41 andL2;42 be two complete lattices. The mappingT : L1 ! L2 is monotonicif T (x) 42 T (y) wheneverx 41 y.

Example2.0.4 Consider the lattice2N;� and the functionmax : 2N ! N suchthat y = max(X) iff y 2 X and8z 2 X : z � y. It is easy to see that thisfunction is monotonic.

Set operations will be used extensively in the continuationof this dissertation.Therefore, it is important that we know which of these set operations are mono-tonic when we fix one of their arguments.

Theorem 2.0.1 Let S;� be a complete lattice withS a set of sets. Consider thesetsA;B;X; Y 2 S such thatA � B andX � Y . Then:� (A \X) � (B \X)� (A \X) � (A \ Y )� (A [X) � (B [X)� (A [X) � (A [ Y )� (A nX) � (B nX)Notice that set difference is not monotonic with respect to its second argument.

Some elements of a function domain are of more interest to us than others. Forexample: elements that are unchanged after the function call, these are calledfixpoints.

Page 25: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

11

Definition 2.0.14 LetL;4 be a complete lattice andT : L ! L be a mapping.An elementx 2 L is called afixpoint of T iff T (x) = x. We say thata 2 L is theleast fixpointof T , denotedlfp(T ), if a is a fixpoint ofT and for all fixpointsb ofT , we havea 4 b. Similarly, we define thegreatest fixpointof T , denotedgfp(T ).We can maintain this definition whenT : L1 ! L2 with L2 � L1.We usefn(x) to denote the n-fold application off on x. When a fixpoint isreached from a elementx by a certain number of consecutive function applicationswe will write f!(x).The next theorem, formulated by Tarski [Tar55], gives us an indication of theexistence of a fixpoint of a given function.

Theorem 2.0.2 ([Tar55]) LetL;4 be a complete lattice and letf : L ! L be amonotone function, then:

1. f has at least one fixpoint inL;

2. the set of fixpoints off is a complete lattice.

Page 26: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

12 CHAPTER 2. PRELIMINARY MATHEMATICAL NOTIONS

Page 27: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Chapter 3

Logic Programming

In this chapter we will discuss the history of logic programming and provide thebasic notions underlying the theory and their intuition. Later on in this disserta-tion, when we define our own formalisms, we will use these as a starting point.Supplying a full and detailed overview of this research fieldwould lead us beyondthe scope of this dissertation; we simply want to give the reader an overall taste ofthe subject.

3.1 Introduction

Problem-solving in standard programming languages, like C++ or Java, requiresthat the programmer supplies the necessary algorithms to solve the problem. Inother words, the programmer needs to explain how to reason about the problem.In logic programming languages it suffices to supply a description of the problemto an logic interpreter. The internal inference mechanism of this interpreter willdo all the rest. These logic programming languages use a verysimple yet power-ful syntax based on extended “if-then” rules. When the conditions are satisfied,the conclusion has to be fulfilled as well. Let us demonstratethis with a simpleexample.

Example3.1.1 Imagine that , you have invited some of your friends over for din-ner. Some of them have a real passion for fine wines. Deciding which wine youwill serve is not an easy thing to do; there are a lot of rules that prescribe whichwine should accompany which dish. For example, when servingfish, it is always

13

Page 28: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

14 CHAPTER 3. LOGIC PROGRAMMING

best to have white wine, while red wine is preferred with red meat. Suppose youhave a bottle of Riocha (red) and a bottle of Pouilly Fume (white) in your cellar.Tonight you have put steak (red meat) on the menu. This simplified situation canbe modeled by means of a logic program.white �sh (1)red red meat (2)pouilly fume white (3)rio ha red (4)red meat steak (5)steak (6)The first rule,white �sh, tells us that we should have white wine (precondi-

tion) whenever there is fish (conclusion) on the menu. The last rule, steak ,sets tonight’s menu to be steak. This knowledge triggers rule number (5) to acceptthat steak is red meat. This satisfies the preconditions in rule (2), which gives usthe advice to take red wine. Rule (4) assures us that we can open the bottle of Ri-ocha in this case. The preconditions of rules (1) and (3) are not fulfilled, so there isno reason to consider white wine and Pouilly Fume. We can assume these atomsto be false by lack of proof. In the end, the program tells us toconsider steak,red meat, red wine and Riocha to be true while white wine and Pouilly Fume canbe assumed to be false. This assignment of truth values, which makes sure thatconclusions are true whenever the preconditions are met is called a model. Thesuggested model corresponds exactly with what we expect as asolution to ourproblem.

The above example demonstrates how information can be extracted from a logicprogram. All information that we can obtain in such a way is stored in a so-calledmodel, which gives our program a semantics. In other words, asemantics tellsus which information should be considered true given the program; it supplies ameaning for the program.

Given this example, it is not hard to see that logic programming originated fromfirst order logic. In a sense, it provides a procedural approach for first order logic.However, there are some crucial differences. For instance,the implications usedin the program should not be considered in the classical sense, e.g. the rulea bmay not be considered equivalent witha _ :b. A logic programming rule statesonly that if b is true thena should also be true. This means that:b may not beconsidered to be true whena is assumed not to be true. It does not state thatb

Page 29: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.1. INTRODUCTION 15

should be false in the classical sense. This implies that contraposition (:b :a),as known in first order logic, is not valid in logic programming. As a side effect,classical negation (:), cannot be retrieved from the program unless we explicitlyincorporate it into our programs. Nevertheless, in the above example we arguedthat white wine and Pouilly Fume should be considered false. This is not becausewe could prove that they are indeed false in a logical sense, but because we areunable to proof that they should be considered to be true. So they are assumedfalse by lack of proof. This type of negation is called negation as failure ([Cla78]).It is a very intuitive mechanism frequently used by humans. For example, whenyou feel fine you will assume that your not sick. However, unless you go to seea doctor you do not have a proof that this is indeed the case. This negation ofeverything that is not considered to be true is called the closed world assumption([Rei78]).

Over the years, logic program formalisms have been extendedin several waysmaking it possible to represent more complex problems. For each of these gener-alizations, a model semantics was defined. The most widely accepted semanticsfor all these extensions is the answer set semantics of [GL91].

Having the theoretical foundations is an important first step, but to make thesemore useful to the outside world, it should be possible to compute the seman-tics of a program. The Prolog language ([PPW78]) is probablythe most well-known logic programming language. Prolog allows you to specify a logic programand to verify the validity of information using this program. This verification iscalled querying. The most accepted semantics is the answer set semantics. Re-cently, two systems for the computation of answer sets, smodels ([NS97]) anddlv ([ELM+98]), have become very popular. Such systems are called answer setssolvers. Their industrial usefulness was demonstrated by [NBG+01] were theauthors implemented a decision-support system for the propulsion of the spaceshuttle. In this dissertation we will restrict ourselves tothe theoretical side oflogic programming.

This chapter is organized as follows. In the next section (Section 3.2), we intro-duce the basic logic programming language called positive logic programming.The example discussed on the previous page is such a program.Negation asfailure is only used here as a truth value. After defining the minimal model se-mantics, we extend our programs (Section 3.3) such that negation as failure canplay an active role. More precisely, it can be used to derive positive information.Since negation as failure is based on lack of proof and not on derivability, we

Page 30: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

16 CHAPTER 3. LOGIC PROGRAMMING

call these programs semi-negative. For this formalism we first extend the minimalmodel semantics. However, in the presence of negation as failure, this semanticsmay produce some unintuitive models. To overcome this problem, we introducethe stable model semantics. Until now the rules in the program contained a singleconsequence. In a lot of cases, it is important to have a consequence consistingof several alternatives from which you have to choose at least one. Programs al-lowing this type of rules are called disjunctive logic programs (Section 3.4). Thestable model semantics (Subsection 3.4.1) is also here the most widely acceptedsemantics. Nevertheless, we also introduce the possible model semantics (Subsec-tion 3.4.2), which allows both inclusive and exclusive treatment of the disjunctiveconclusions. The possibility to use negation as failure as part of a conclusionand to have classical negation would be very practical. To accommodate this,extended disjunctive logic programs are proposed. As a generalization of stablemodels, answer sets have become the most widely accepted semantics for this typeof programs (Section 3.5). Logic programming formalisms can be extended evenfurther, enabling them to represent more complex problems.These extensions areon the cutting edge of research. Therefore, we will just mention them briefly inSection 3.6 before concluding in Section 3.7.

3.2 Positive Logic Programs

This section introduces the most basic logic programming formalism. It will allowus to obtain positive information from facts and rules present in the program. Asemantics for these programs should only accept those atomsthat ought to beconsidered true in order to validate the rules in a program. All other informationis redundant (i.e. there is no good reason to consider this information to be true)and therefore false. This is accomplished by the least Herbrand model.

At the end of this section we define the immediate consequenceoperator whichwill allow us to obtain the least Herbrand model as its least fixpoint. The mainreference of this section is [Llo84].

Before we get to models and fixpoints, we first define the language that is used byour programs.

Definition 3.2.1 A logic program uses a language that hastermswhich are in-ductively closed. A term is avariable or a constant; a function symbolwithterms as its arguments is a term. Anatom is denoteda(t1; : : : ; tn), wherea is a

Page 31: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.2. POSITIVE LOGIC PROGRAMS 17

predicate of arityn andt1; : : : ; tn , its arguments, are terms. A term or an atom iscalledground if it does not contain any variables.

Atoms are used to represent the consequences and preconditions of rules.

Definition 3.2.2 A rule in a positive logic program is a clause of the form:a b1; : : : ; bk k � 0 or b1; : : : ; bk ;wherea; b1; : : : bk are atoms. We callfag thehead1 of r, denotedHr. Thebodyofr is the conjunctionfb1; : : : ; bkg of body atoms, denotedBr.A rule with empty head, i.e.Hr = ;, is called an(integrity) constraint. A rulewith empty body, i.e.Br = ;, is called afact.

The head of a rule contains the consequence, if any, while thebody is made out ofpreconditions. A constraint states that the preconditionsshould never be satisfiedwhile a fact should always be true.

Together, a collection of rules constitutes a program that logically encodes a cer-tain (decision) problem.

Definition 3.2.3 A positive logic programis a countable set of rules.

A program is calledground when it contains no variables. Often, a finite groundprogram is called apropositional program. A program without any integrity con-straints is referred to asdeductive. A finite deductive program without any func-tion symbols of positive arity is called adeductive databaseor datalog.

Definition 3.2.4 Let P be a positive logic program. The set of all ground termsappearing inP is called theHerbrand universe, denotedUP . TheHerbrand baseBP of P is the set containing all ground atoms that can be constructed from thepredicates inP and the terms inUP .

If a programP is finite and contains no function symbols with positive arity (func-tion symbols with no arguments are allowed), thenUP andBP are finite; other-wise, they could be countably infinite.

1For this type of programs the head is either a singleton or theempty set. In case of the former,we often just consider the element as being the head.

Page 32: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

18 CHAPTER 3. LOGIC PROGRAMMING

Let r be a rule in a programP and let� be a mapping from variables occurring inr to the terms ofUP . A ground instance of the ruler is obtained fromr by replac-ing every variableX in r by �(X). Theground versionof a programP , noted asground(P ), is obtained by replacing each rule by all its ground instances. Becausethe Herbrand universe of a program can be countably infinite,ground(P ) couldbe countably infinite. This is the reason why we allowed programs to be countablyinfinite even when programmers can only write a finite number of rules.

Example3.2.1 Consider the following positive logic program:dish(X) order(Y ); favorite(X; Y )order(me) favorite( hop shoy;me) The Herbrand universe equals:UP = fme; hop shoyg :The Herbrand base is:BP = forder(me); order( hop shoy); dish(me); dish( hop shoy);favorite( hop shoy ;me); favorite(me; hop shoy);favorite( hop shoy ; hop shoy); favorite(me;me)g :A few ground instances for this program are:dish( hop shoy) order(me); favorite( hop shoy;me)order(me) favorite( hop shoy;me) Example3.2.2 Reconsider the programP from Example 3.1.1. This program isalready grounded. The Herbrand universe is empty, i.eUP = ;. The Herbrandbase equals:BP = fwhite; �sh; red ; red meat ; pouilly fume; rio ha; steakg :In the remainder of this section we will assume that all programs are alreadygrounded. This will have no effect on the results, but simplifies notations.

So far we have only defined the syntax of a program, which boilsdown to supply-ing tools for representing a problem, but not discussing themechanisms to solveit. In the following we will address this by supplying a semantics, i.e. a solutionconcept, for our programs.

Page 33: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.2. POSITIVE LOGIC PROGRAMS 19

Definition 3.2.5 Let P be a positive logic program. Aninterpretationof P is asubsetI � BP of ground atoms that are true. The set of all interpretationsofP isdenoted byIP .

Given an interpretationI, an atoma is said to be true whena 2 I; otherwiseais considered false. So basically, an interpretation assigns a truth value to everyatom appearing in the Herbrand base. Nevertheless, little attention is paid so farto the structure of the program nor to the representation of rules as preconditionstriggering consequences.

Definition 3.2.6 LetP be a positive logic program and letI be an interpretation.A rule r 2 P is said to beapplicablew.r.t I whenBr � I and to beappliedw.r.t.I whenr is applicable andHr \ I 6= ;. The ruler is satisfiedw.r.t. I iff r is eitherapplied or not applicable w.r.t.I. The interpretationI is said to bedeductivelyclosediff it satisfies all the rules inP .

The interpretations that conform with the structure of the program are called mo-dels.

Definition 3.2.7 LetP be a positive logic program. An interpretationM of P isa modeliff M is deductively closed.

Example3.2.3 Reconsider the wine selection programP of Example 3.1.1 andtwo of its interpretations:I = fred ; �shg andJ = fsteak ; red ; red meat ;rio ha;pouilly fumeg. The interpretationI is not a model because the rulewhite �shis applicable but not applied. The interpretationJ fulfills the requirements to bea model ofP .

For a program without constraints, it is easy to see that the Herbrand base itself isa model.

Theorem 3.2.1 Every deductive positive logic program has at least one model.

Example3.2.4 Certain food ingredients may curdle when they are mixed together.An example of such a pair is milk and lemon.lemon milk lemon;milk

Page 34: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

20 CHAPTER 3. LOGIC PROGRAMMING

This program cannot have any model, since every subset ofBP will leave at leastone rule applicable but unapplied.

Although models supply a reasonable semantics for our programs, this semanticsis certainly not optimal, as demonstrated by the example below.

Example3.2.5 Reconsider the modelJ from Example 3.2.3 for the programPof Example 3.1.1. Notice that this model contains redundantinformation. Thereis no rule inP that justifies the presence of the atompouilly fume. The rulepouilly fume white is not applicable w.r.t.J . If we deletepouilly fume fromJ , we obtain the interpretationM which is also a model ofP . This model corres-ponds exactly with the solution we expect for this problem.

The above example demonstrates that an intuitive semanticsfor positive logic pro-grams needs to consider only those models that contain as fewatoms as possible.

Theorem 3.2.2 LetP be a positive logic program andS be a set of all models ofP . Then,TS is a model ofP .

Combining the results from Theorems 3.2.1 and 3.2.2, we see that deductive po-sitive logic programs always have a unique minimal model. Asa result, a positivelogic program has a unique minimal model as soon as it admits amodel.

Definition 3.2.8 LetP be a positive logic program. The model obtained from theintersection of all models forP is called theleast Herbrand modelor minimalmodel.

Example3.2.6 The minimal model of the program in Example 3.1.1 equals:M = fsteak ; red ; red meat ; rio hag ;which corresponds exactly with our intuition.

Above we have seen that the minimal model semantics providesus with an intu-itive semantics for positive logic programs. However, checking whether an inter-pretation is a model or not, requires a check of all other models as well. For thisreason we say that Definition 3.2.8 provides a declarative semantics for positivelogic programs. A monotonic operator that links this declarative semantics to aprocedural one, is defined in the following definition. This definition was firstformulated in [vEK76].

Page 35: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.2. POSITIVE LOGIC PROGRAMS 21

Definition 3.2.9 Let P be a program andX � BP . We define theimmediateconsequence operatorTP : 2BP 7! 2BP as:TP (X) = fa j a A 2 P ^ A � Xg :Clearly this operator is monotonic in2BP .

This operator is an easy tool for identifying models, as demonstrated by the nexttheorem.

Theorem 3.2.3 Let P be a deductive positive logic program and letI be an in-terpretation. Then,I is a model ofP iff TP (I) � I.

This theorem is no longer valid when constraints are involved, as illustrated in thefollowing example.

Example3.2.7 Reconsider the programP of Example 3.2.4 and assume the in-terpretationI = fmilk ; lemong for P . Applying theTP -operator onI, we obtain:TP (I) = fmilk ; lemong :Although we haveTP (I) � I, I cannot be considered a model, because the con-straint is not satisfied.

The least Herbrand model can also be retrieved by means of theimmediate con-sequence operator.

Theorem 3.2.4 LetP be a deductive positive logic program. The unique minimalHerbrand model equals the least fixpoint. Furthermore,T !P (;) = lpf (TP ) .

Example3.2.8 Reconsider for the last time the wine program of Example 3.1.1.When we apply the above fixpoint characterization to this program we obtain theminimal model:TP (;) = fsteakg = V1TP (V1) = fsteak ; red meatg = V2TP (V2) = fsteak ; red meat ; redg = V3TP (V3) = fsteak ; red meat ; red ; rio hag = V4TP (V4) = V4 = T !P (;)

Page 36: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

22 CHAPTER 3. LOGIC PROGRAMMING

In this section we have introduced the basic logic programming formalism, namelypositive logic programs. We both both a declarative and procedural definition forthe semantics of positive logic programs, based on the unique minimal model orHerbrand model. In the next section we extend these positivelogic programs withnegation as failure. This will allow us to model more accurately human reasoningand to represent more complex decision-making problems.

3.3 Introducing Negation as Failure

In the previous section we introduced positive logic programs. When we wish tomodel human reasoning as closely as possible, we need to add amechanism thatallows us to reason even when there is no proof that somethingis either true orfalse in the classical sense. For example, take a diabetic who goes to a restaurantwith her friends. Unless she is sure (i.e. proof) that the dessert does not containany sugar, she better leaves it untouched. To make this possible in logic program-ming we introduce the notion of negation as failure, denotedby ’not ’. The storyof the diabetic could be represented as in the example below.

Example3.3.1 leave dessert ; not sureeat dessert ; suredessert Because there is no guarantee that the dessert is indeed sugar-free, the diabetic

cannot be sure. Therefore she decides to skip the dessert.

Adding negation as failure does not only allow us to reason with default informa-tion, but it also introduces non-determinism to logic programming.

Example3.3.2 Suppose you are going to a cocktail bar. This evening you feellike having either a margarita or a gin fizz. This situation could be modeled asfollowed: margarita not gin �zzgin �zz notmargaritaThe first rule states that when you do not have agin �zz you will order amargarita. Intuitively you would like to have two models for this program. One

that makesmargarita true and one that allowsgin �zz to be true.

Page 37: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.3. INTRODUCING NEGATION AS FAILURE 23

Logic programs that allow negation as failure in their bodies are called generallogic programs or semi-negative programs. Just like we did for positive logic pro-grams, we will define models and minimal models. Unfortunately, the minimalmodel semantics is not sufficient in the presence of negationas failure: some-times it provides unintuitive models. To address this, the stable model semanticswas introduced ([GL88]). We will present this semantics both declaratively andprocedurally. In this section we use [GL88] as our main reference.

The language and atoms used for semi-negative logic programs are identical tothe ones given for positive logic programs in Definition 3.2.1.

Definition 3.3.1 A literal is an atoma or a negated2 atomnot a. Apositive literalis an atom. Anegative literalis the negation of an atom. A literalp is called thecomplementof a literal q iff p = not q. For a set of literalsX, we usenot X todenote the setfnot l j l 2 Xg. A set of literalsX is consistentiff X \notX = ;.We useX+ to denote the positive part ofX, i.e. X+ = fl 2 X j l is an atomg.Similar,X� is the set of atoms that appear negatively inX, i.e. X� = fnot l jl 2 X andL is a negative literalg.Definition 3.3.2 A general or semi-negative logic programis a countable infiniteset of clauses of the form:a b1; : : : ; bk k � 0 or b1; : : : ; bk ;wherea is an atom andb1; : : : ; bk are literals. The setfag or fg is theheadof r,denotedHr. Thebodyof r is the conjunctionfb1; : : : ; bkg, denotedBr.Clearly, positive logic programs are a specific class of semi-negative logic pro-grams.

The Herbrand universe and the Herbrand base for semi-negative logic programsare the same as in Definition 3.2.4. For the remainder of this section we willassume that all programs are already grounded. This assumption does not affectin any way the given results and the generality of the formalism.

Just like for positive programs, we define interpretations as an assignment of truthvalues to every element in the Herbrand base.

2In this dissertation we will usenot to denote negation as failure. In literature you may alsofind : for it, but we use: to represent only classical negation, which conforms with the currentnotations in answer set programming.

Page 38: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

24 CHAPTER 3. LOGIC PROGRAMMING

Definition 3.3.3 LetP be a semi-negative logic program. A consistent subset ofBP [ not BP is called a(partial) interpretationofP . A interpretationI is totalwhen every atom in the Herbrand base is present as a literal, i.e. I+ [ I� = BP .The set of all interpretations ofP is denoted asIP .

Given an interpretationI, an atoma is said to be true (or false, or unknown) iffa 2 I (a 2 I�, a =2 I+ [ I�).

In this dissertation, our attention is restricted to semantics based on models thatassign the value true or false to every atom in the Herbrand base. However, aswe will see later on, not every program admits an intuitive model based on totalinterpretations. For this reason, partial model semanticswere introduced, [Prz89]and [GRS88b]. These partial models allow atoms to have ’unknown’ as a truthvalue. The 3-valued stable model semantics ([Prz89]) and the well-founded modelsemantics ([GRS88b]) are the most common ones. However, in this dissertationwe will only use partial interpretations to move towards a total interpretation withcertain properties.

In order to have a reasonable semantics we can at least presume than an interpre-tation pays attention to the structure of the rules.

Definition 3.3.4 Let P be a semi-negative logic programs and letI be an inter-pretation for it. A ruler 2 P is applicablew.r.t. I if Br � I. An applicable ruler 2 P is appliedw.r.t. I whenHr 2 I. The ruler 2 P is satisfiedw.r.t. I if r isapplied or not applicable.

A model is a total interpretation that satisfies every rule inthe program.

Definition 3.3.5 Let P be a semi-negative logic program and letM be a totalinterpretation. WhenM satisfies every rule inP , we say thatM is amodel.

Example3.3.3 Consider the programP of Example 3.3.1 and letI = fdessert ;not sure;not leave;not eatg andJ = fdessert ;leave;sure;eatg be two total inter-pretations forP . The interpretationI cannot be a model, because the applicablerule leave dessert ; not sure is left unapplied. On the other hand,J is a model.

In the previous section we argued that models in general are not suitable to beused for a semantics. They allow positive information to be considered without

Page 39: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.3. INTRODUCING NEGATION AS FAILURE 25

rules that support it. Because semi-negative logic programs are an extension ofpositive logic programs, we can expect them to have the same problem. This isdemonstrated by the modelJ in the above example. The assumption ofsure alsomakeseat redundant. When positive logic programs are considered, weintro-duced minimal models to eliminate this superfluous information. The same willbe done for logic programs allowing negation as failure.

Definition 3.3.6 A model for a semi-negative logic programP is called amini-mal modelif no modelN for P exists such thatN+ �M+.

Note that whenP is a positive program, this definition coincides with Defini-tion 3.2.8.

Example3.3.4 The program of Example 3.3.1 has one minimal model, namelyM = fdessert ; leave; not sure; not eatg :In the previous section, we have seen that deductive positive logic programs have aunique minimal model (i.e Theorem 3.2.2). Because negationas failure introducesnon-determinism, this can no longer be true for semi-negative logic programs. Wewill illustrate this with the following example.

Example3.3.5 Consider the program of Example 3.3.2. This program has twominimal models, namely:M1 = fmargarita; not gin �zzg andM2 = fgin �zz ; notmargaritag :Although the minimal model semantics gives intuitive solutions to the programsin the above examples, the following example will demonstrate that something isstill missing.

Example3.3.6 Imagine you are making your favorite dessert. The recipe tellsyou that at the end you are supposed to add a little bit of sugar. To0 much of itwould spoil your dessert. Just at that critical moment you get distracted. Gettingback to business you are not sure whether you already added some sugar or not.

Page 40: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

26 CHAPTER 3. LOGIC PROGRAMMING

To be on the safe side you add some (more). This situation is represented by thefollowing programP : deli ious sugarsugar not sugarThis program has one minimal model, namelyM = fsugar ; deli iousg :Intuitively, you add sugar because you are uncertain. However, there is a possibi-lity that you already have put some in. Concluding that your dessert is deliciousseems a bit presumptuous at least. So,M cannot be considered to be a valid se-mantics for our program. More formally, you assume thatsugar is true becauseotherwise the second rule would be left unsatisfied. However, there is no rulesupporting this.

In order to obtain a more suitable semantics for semi-negative programs, we in-troduce the stable model semantics. This semantics is basedon a transformationto a positive logic program, called the Gelfond-Lifschitz transformation,

Definition 3.3.7 LetP be a semi-negative logic program and letI be an interpre-tation. TheGelfond-Lifschitz transformationof P w.r.t. I, is the positive logicprogramP I obtained fromP by deleting� each rule that has a negative literalnot b in the body withb 2 I,� all negative literals in the bodies of the remaining rules.

A stable model is a total interpretation that can ’reproduce’ itself.

Definition 3.3.8 LetP be a semi-negative program. A total interpretationI ofPis called astable model3 if I+ coincides with the unique minimal model ofP I (ifit exists).

So, in a sense, a stable model is a fixpoint of the Gelfond-Lifschitz transformation.3Originally stable models were called stable sets.

Page 41: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.3. INTRODUCING NEGATION AS FAILURE 27

Example3.3.7 In Example 3.3.6, we argued that it was impossible to considerthe minimal modelI = fdeli ious; sugarg to be an intuitive model. The Gelfond-Lifschitz transformation of this programP w.r.t. I yields:deli ious sugarIt is easy to see that the minimal model ofP I equals the empty set. So,I is not astable model forP , which is exactly what we intended.

For the other two programs we have been looking at in this section, the stablemodels coincides with the minimal models of the program.

Example3.3.8 The program of example Example 3.3.1 has one stable model,namely its minimal modelM = fleave; dessert ; not eat ; not sureg :Example3.3.9 The minimal modelsM1 = fmargarita; not gin �zzg andM2 = fgin �zz ; notmargaritagof the program in Example 3.3.2 are the only stable models.

The definition of a stable model is based on an interpretation. Yet, we use the termmodel. The following theorem justifies this.

Theorem 3.3.1 ([LRS97]) Every stable model for a semi-negative logic programP is also a minimal model ofP .

For deductive positive logic programs we were able to demonstrate that everyprogram admits an unique minimal model. The programs in Examples 3.3.6 and3.3.2 illustrate that deductive semi-negative logic programs can have either nostable models or multiple stable models. This makes it difficult to let the stablemodels correspond to the least fixpoint of an operator. In thefollowing paragraphswe define a new operator,WP , based on an extended version of theTP -operatorwhich also takes negative information into account. This operator will be used asthe procedural semantics for semi-negative logic programs. We will demonstratethat the total fixpoints ofWP can characterize the stable model semantics.

Page 42: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

28 CHAPTER 3. LOGIC PROGRAMMING

The stable model semantics is, as Theorem 3.3.1 demonstrates, based on minimalmodels. This means not only that we accept as little information as needed butthat we try also to maximize the amount of negative information. Especially thelatter becomes more important in semi-negative logic programs, since negativeliterals play an active role in forcing atoms to be considered true. To this extent,we want to pin-point those atoms that, considering the (partial) interpretationI,are not necessary to extendI to a model or are not responsible for making certainrules applied. We call such a group of atoms an unfounded set.

Definition 3.3.9 LetP be a semi-negative program and letI be a (partial) inter-pretation. A set of atomsX � BP is anunfounded setof P w.r.t. I iff for eachatomx 2 X and for every ruler 2 P withHr = x, at least one of the followingholds:

1. Br \ not I 6= ;; or

2. B+r \X 6= ; .

Intuitively, a set of atomsX is unfounded if one can show that, givenI, therewill never be any support for any of the atoms inX. The rules that satisfy the firstcondition will always be inapplicable. When the elements ofX are only supportedby each other, as in the second condition, we can expect all these atoms to be falsein an extension ofI, because all their rules would become inapplicable.

Example3.3.10 Consider the following programP :fries steak ; not pepper ream sausefries pepper ream sause; notmayonaisesteak friespepper ream sau e steakThe setsfmayonaiseg, fsteak ; pepper ream sau e; friesg, fsteak ;mayonaise;pepper ream sau e; friesg are three unfounded sets ofP w.r.t. ;. Consider thesetX = fsteak ; pepper ream sau e; fries;mayonaiseg. X is indeed an un-founded set w.r.t.;. When we apply the definition of an unfounded set toX, wesee thatmayonaise has no rules, so it is trivially satisfied. For bothsteak andpepper ream sau e, we have a single rule which contains an element ofX inthe body. The same applies for the two rules that containfries in the head. Intu-itively this unfounded setX means thatmayonaise can never be proven from the

Page 43: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.3. INTRODUCING NEGATION AS FAILURE 29

program, but also, there is no hope of provingsteak ,fries, pepper ream sau e,since none of them can be derived without the aid of the others.

In the preceding example the unfounded setX is the union of all unfounded setsw.r.t. ;. It is not hard to see that the union of any number of unfoundedsets isagain an unfounded set, which leads us to the following definition.

Definition 3.3.10 LetI be an interpretation for a semi-negative logic programP .Thegreatest unfounded setof P w.r.t. I, denotedGUSP (I), is the union of allunfounded sets w.r.t.I.

Intuitively, the greatest unfounded set is the collection of atoms that are not neces-sary in a model extension ofI. For positive logic programs, we have seen that theimmediate consequence operator returns those atoms that have to be included inthe model extension ofI. When we generalize thisTP operator, we can use it incombination withGUSP (I) to move towards a model extension ofI. This newoperator is called theWP -operator.

Definition 3.3.11 We define the following operators for a semi-negative logic pro-gramP :� Theimmediate consequence operatorTPTP : 2BP [ not BP ! 2BPI 7! fa 2 BP j 9a A 2 P �A � Ig :� The operatorWP which combinesGUSP and TP into a suitable conse-

quence operator for general logic programs.WP : IP ! 2BP [ not BPI 7! TP (I) [ not GUSP (I) :The operatorWP -operator is monotonic and, thus, has a least fixpointW!P .

Example3.3.11 Reconsider the program from Example 3.3.1. Here we have:WP (;) = fdessert ; not sureg = V1WP (;) = fdessert ; leave; not sure; not eatg = V2WP (V2) = V2 = W!PSo the least fixpoint ofWP coincides with the stable model ofP .

Page 44: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

30 CHAPTER 3. LOGIC PROGRAMMING

Example3.3.12 Consider the Cocktail-program of Example 3.3.2. and its stablemodels:M1 = fmargarita; not gin �zzg andM2 = fgin �zz ; not margaritag :Here,W!P = ; whileWP (M1) = M1 andWP (M2) = M2.In the above example we have seen that the least fixpoint does not necessarilycoincide with the stable model(s). This should not come as a big surprise sinceTP andGUSP are both deterministic operators; they do not make any choices thatcould be invalidated during later applications. Since a program is able to admitmore than one stable model, it is impossible that they all coincide with the singleleast fixpoint. On the other hand, the example shows us that stable models arefixpoints of theWP -operator, which implies that the least fixpoint is always asubset. These findings are formalized by the following theorems.

Theorem 3.3.2 LetP be a deductive semi-negative logic program. A total inter-pretationM is a stable model ofP iff M is a total fixpoint of theWP -operator.

Theorem 3.3.3 LetP be a semi-negative logic program. The least fixpoint of theWP -operator, denotedW!P , is a subset of every stable model ofP .

The least fixpoint of theWP -operator,W!P , is very important for the stable modelsemantics, since it contains those literals that should be included in every model ofthe program. Moreover,W!P leaves no applicable rule unapplied. This makes it theleast partial model, which attracted the attention of researchers.W!P became thebasis for a partial model semantics, called the well-founded semantics [GRS88b].Currently,W!P is being put to good use by a number of algorithms that computethe stable models of semi-negative logic programs. The well-founded semanticsis used to reduce the number of rules and body elements in the programs, whichsignificantly improves the efficiency of the algorithms.

In this section we have introduced negation as failure to ourprograms. This allowsus to represent more sophisticated problems and to obtain a better approximationof human reasoning. For these programs, called semi-negative logic programs,we introduced the stable model semantics, which permits us to filter out unintu-itive minimal models. We supplied both a declarative and procedural definitionfor this semantics. In the following section we extend theseprograms to allowconsequences to be a disjunction of atoms representing various alternatives.

Page 45: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.4. DISJUNCTIVE LOGIC PROGRAMMING 31

3.4 Disjunctive Logic Programming

In this section we go a step further in approximating human reasoning by allow-ing disjunctions in the head. This allows us for example a more natural way ofrepresenting decision problems. Imagine for example that you go to an ArgentineSteak house were you want to order today’s menu. A side order is included in theprice and you have the choice between an oven potato or a grilled corncob. Thisvery simple situation is represented in the following example.

Example3.4.1 The above described situation could be modeled as the programP1: potato _ orn ob menumenu Based on intuition, we should obtain two solutions:fmenu; potato; not orn obg,andfmenu; orn ob; not potatog. Suppose you would like both side dishes. Forthe restaurant this is not a problem at all, they simply charge you extra for thesecond side dish. In this situation, the programP2 could look like:potato _ orn ob menumenu potato orn ob orn ob potatoextra orn ob; potatoThis time, it should be possible to obtainfmenu; potato; orn ob; extrag as a

result.

When we look at the programP2 in the above example, we see that the disjunctionin the head is considered to be inclusive. If there are good reasons to assume thatboth head atoms are true, then this should be allowed.

In this section we formalize logic programs that allow disjunctions in the head oftheir rules. For these programs, called disjunctive logic programs, we will extendthe stable model semantics. Just like for semi-negative logic programs, we willdefine the stable model semantics [Prz91] both declarative and procedural. Formost programs, a semantics based on minimal models is exactly what is needed.However, there are many situations where one wants to investigate models thattreat disjunction as inclusive or exclusive as the situation at hand requires. In the

Page 46: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

32 CHAPTER 3. LOGIC PROGRAMMING

stable model semantics this is impossible or highly impractical. Therefore, thepossible models semantics or possible world semantics [SI94] was introduced.We use [Prz91, LRS97, DVV01b, SI94] as our main references inthis section.

3.4.1 Stable Model Semantics

In this part we will focus on the generalization of the stablemodel semantics forsemi-negative logic programs to disjunctive logic programs. But before introduc-ing this semantics, we will first formalize the syntax used toexpress disjunctivelogic programs.

The terms of the language are defined in the usual way (see Definition 3.2.1). Theatoms and literals, the building blocks of rules, are the same as in Definitions 3.2.1and 3.3.1.

Definition 3.4.1 A disjunctive logic programis a countable set of rules of theform: a1 _ : : : _ an b1; : : : ; bm n;m � 0 ;wherea1; : : : an are atoms andb1; : : : bm are literals. For a ruler we call thedisjunctiona1 _ : : : _ an thehead, while the conjunctionb1; : : : ; bm is thebody.We denote byHr the setfa1; : : : ; ang of r’s head atoms, and byBr the set of bodyliterals fb1; : : : ; bmg of r.The Herbrand universe and Herbrand base for disjunctive logic programs is de-fined similarly to positive logic programs (Definition 3.2.4). Just as before, weassume that all programs are grounded.

We adopt Definition 3.3.3 to introduce partial and total interpretations for disjunc-tive logic programs.

A reasonable demand for a semantics of a program, is that all its rules are satisfied.This means that whenever the conditions are fulfilled (i.e. the body of the rule istrue) then also the consequence must be considered to be true. For this type ofprograms we have that the consequence of a rule is a disjunction of atoms. Inorder to satisfy such a disjunction it is sufficient that at least one of its atoms isassumed true.

Page 47: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.4. DISJUNCTIVE LOGIC PROGRAMMING 33

Definition 3.4.2 LetP be a disjunctive logic program. An interpretationI satis-fiesa rule r 2 P iff (Hr \ I) 6= ; (Hr is true) wheneverBr � I (Br is true). AninterpretationI is deductively closediff its satisfies every rule inP .

Definition 3.4.3 A modelfor a disjunctive logic programP is a total deductivelyclosed interpretation.

Example3.4.2 Consider the very simple programP1 of Example 3.4.1. This pro-gram has three modelsfmenu; potatoe; orn obg, fmenu; potatoe; not orn obgand fmenu; orn ob; not potatoeg. Clearly, the first model accepts too manyatoms, because there is only one side dish included in the menu.The programP2 of Example 3.4.1 has only one model:fmenu; potatoe; orn ob;extrag.When working with models for disjunctive logic programs we are, just as before,interested in those models that contain as few atoms as possible. Therefore weadopt the notion of a minimal model described in Definition 3.3.6 for disjunctivelogic programs.

Example3.4.3 The programP1 of Example 3.4.1 has two minimal models:fmenu; potatoe; not orn obg andfmenu; orn ob; not potatoeg:The only model ofP2 is also its minimal model.

For semi-negative logic programs we argued that the minimalmodel semanticsprovides unrealistic solutions for some problems, as illustrated by Example 3.3.6.Because disjunctive logic programs are a generalization ofsemi-negative logicprograms, we also know that the minimal model semantics cannot be completelysatisfactory. General logic programs solved the problem ofundesirable minimalmodels by introducing stable models. We will extend this definition to disjunctivelogic programs.

For semi-negative logic programs, the definition of stable models was based ona transformation to a positive logic program. This transformation, called theGelfond-Lifschitz transformation, removed those rules from the program that werealready non-applicable when only the negative informationin the interpretationwas considered. Afterwards, all negations were removed from the remainingrules. For disjunctive logic programs we do exactly the same, only now a po-sitive disjunctive logic program is obtained.

Page 48: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

34 CHAPTER 3. LOGIC PROGRAMMING

Definition 3.4.4 LetP be a disjunctive logic program and letI be an interpreta-tion ofP . TheGelfond-Lifschitz transformationof P w.r.t. I, is the programP Iobtained fromP by deleting:

1. each rule that has a negative literalnot b in its body withb 2 I, and

2. all negative literals in the bodies of the remaining rules.

The reason for the above transformation is to compute those atoms that can bederived without relying on negation as failure.

Definition 3.4.5 LetI be a total interpretation for a disjunctive logic programP .I is calledstable modelfor P iff I is a minimal model of the positive programP I .In a sense, a stable model can be viewed as a fixpoint of the Gelfond-Lifschitztransformation.

Clearly, this definition is a generalization of Definition 3.3.8.

Example3.4.4 Today you are expecting guests for dinner. To surprise them youdecide to make something exotic. After checking out your cookbooks, you comeup with three Indian dishes: maas kolharpuri (a spicy beef-potato curry fromKolhapur in the Maharashtra region), biryani (a rice dish with lamb, nuts andspices) and tandoori murghi (grilled chicken marinated in aspecial mixture ofspices and yogurt. Traditionally, tandoori meat is prepared in a specially designedoven made of clay). Except for biryani, the dishes should be accompanied by somerice. You have chosen for kesar pilau: rice with safran and raisins which wasvery popular at the Moghul court. This situation is represented by the followingprogramP :maas kolhapuri _ birjani _ tandoori murghi kesar pilau not birjaniConsider the total interpretation:M = fbirjani ; not maas kolhapuri ; not tandoori murghi ; not kesar pilaug :This interpretation is indeed a stable model becausePM equals:maas kolhapuri _ birjani _ tandoori murghi

Page 49: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.4. DISJUNCTIVE LOGIC PROGRAMMING 35PM has three minimal models andM is one of them.Besides the stable modelM , P admits two other stable models:fmaas kolhapuri ; kesar pilau; not birjani ; not tandoori murghig andftandoori murghi ; kesar pilau; not birjani ; notmaas kolhapurig :The definition of a stable model is based on a total interpretation. Neverthelesswe use the word “model” to characterize it. The next theorem justifies the use ofthis terminology.

Theorem 3.4.1 ([LRS97]) Let P be a disjunctive logic program. Every stablemodel ofP is also a minimal model ofP .

The definition of a stable model gives us an intuitive semantics for disjunctivelogic programs. However, to check whether or not a total interpretation is a stablemodel, we need to transform our program into a positive disjunctive program forwhich we have to compute all minimal models. For semi-negative logic programswe have seen that an operator exists for which the total fixpoints exactly coin-cide with the stable models of the program. We will extend this operator to takedisjunctions into account.

This operator,WP , is the combination of two other operators, namelyTP andGUSP . In order to extendWP , we need to generalize those two as well. Westart with the greatest unfounded set operatorGUSP (I). For this operator, twoversions, [DVV01b] and [LRS97], exist which coincide when considering totalinterpretation but they behave differently when partial interpretations are used. Inthis dissertation we will use the one from [DVV01b, DVV98a],because it is, inour opinion, more intuitive than the one from [LRS97].

The intuition behind unfounded sets remains unchanged: they should containthose atoms that are not forced by the interpretation and anyof its extensions.An atoma that appears only in non-applicable rules or rules with another headatom being considered to be true are of little or no use to a program. The sameapplies for a group of atoms that rely on each other for their acceptance.

Definition 3.4.6 Let P be a disjunctive logic program and letI be a (partial)interpretation forP . A setX � BP is called anunfounded setofP w.r.t. I iff foreachp 2 X and for eachr 2 P such thatp 2 Hr one of the following conditionshold:

Page 50: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

36 CHAPTER 3. LOGIC PROGRAMMING

1. Br [ I is inconsistent , or

2. Br \X 6= ; , or

3. (Hr nX) [ (I [Br) 6= ; .

The set of all unfounded sets w.r.t.I is denotedUP (I). For any interpretationI, wedefineGUSP (I) = SUP (I). We say thatI is unfounded-freeif I \ GUSP (I) =;. The set of all unfounded-free interpretations is denotedIuP .

Instead of requiringBr \ not I 6= ; (Definition 3.3.9 and [LRS97]), we demandthatBr [ I should be inconsistent. This subsumesBr \ not I 6= ; and alsocovers rules likea b; not b which should never be used to introducea, andshould therefore not preventa from belonging to an unfounded set. The secondcondition was already present in Definition 3.3.9, since atoms should not only relyon each other to be considered true. The third condition is added to accommodatedisjunction in the head. If one knows that an atom already exists that should beconsidered to be true, then all the others may be considered false. In [LRS97],this is translated into the condition(Hr n X) \ I 6= ;. [DVV01b] extends thisto the third condition. This change acknowledges that a rulelike a _ b b; isuseless since, if it were applicable, it could not be used to introduce new atoms.In particular, it cannot be used to provea and therefore should not preventa frombelonging to an unfounded set.

Clearly,GUSP , is a monotonic operator. However, the presence of set differencein the definition has as a result that the union of two unfounded sets is not neces-sarily an unfounded set.

Example3.4.5 Two flavors of tea are very popular in Turkey: the traditionalblack tea and the sweeter apple tea.bla k tea _ apple tea Consider the interpretationI = fbla k tea; apple teag. This program has two

unfounded sets w.r.t.I, namelyfbla k teag andfapple teag. Notice that theirunion is not an unfounded set. Actually this is rather intuitive because unfoundedsets represent those atoms that are not necessary for transforming an interpreta-tion into a model. If you remove either unfounded set from theinterpretationI,one obtains a stable model. Removing both atoms would resultin an applicablebut unapplied rule.

Page 51: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.4. DISJUNCTIVE LOGIC PROGRAMMING 37

For a certain class of interpretations, we do have that the union of all unfoundedsets is itself an unfounded set.

Theorem 3.4.2 ([DVV01b]) LetP be a disjunctive logic program and letI be anunfounded-free interpretation ofI. Then,GUSP (I) 2 UP (I).Before we can define theWP -operator, we still need to generalize the immediateconsequence operator. The intuition behind this operator remains unchanged inthe presence of disjunction. That is, it should return thoseatoms that are abso-lutely necessary in order to obtain a model from the current interpretation. Previ-ously in Definition 3.3.11, it was sufficient to have an applicable rule. Then, thehead atom would be in the image ofTP . With disjunction in the head, we stillneed the rule to be applicable, but we also need that all otherhead atoms are false.Another possibility would have been that the other head atoms should have beenfalse or unknown. However, this would make the immediate consequence opera-tor no longer deterministic: in this case the operator has tomake a choice amongthe unknown atoms. Besides, there would be a chance that these decisions couldbe invalidated later on in the model extension process.

Definition 3.4.7 Let P be a disjunctive logic program. Theimmediate conse-quence operatorTP is defined as:TP : 2BP [ not BP ! 2BPI 7! fa 2 BP j 9a _ A B 2 P � A � I�; B � Ig :It should not be hard to see thatTP is a monotonic operator.

Example3.4.6 Consider the programP of Example 3.4.4 and letI = ;. Then,TP (I) = ; although the first rule is applicable. BecauseI does not containany information concerning at least two of the head atoms,TP (I) cannot make ainformed decision. Therefore,TP (I) remains indecisive.

Now that we have definedGUSP (I), the set of atoms that are not necessary in anymodel extension ofI, andTP (I), the set of atoms that are absolutely required inany model extension ofI, we can combine them by means ofWP (I).

Page 52: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

38 CHAPTER 3. LOGIC PROGRAMMING

Definition 3.4.8 Let P be a disjunctive logic program. Define theWP -operatoras follows: WP : IP ! 2BP [ not BPI 7! TP (I) [ not GUSP (I) :Example3.4.7 When we look back at the programP of Example 3.4.4, we seethatWP (M) = M for every stable modelM ofP .

In the above example we have seen that the stable models coincide with the totalfixpoints of theWP -operator, which is not a coincidence, as is demonstrated bythe following theorem.

Theorem 3.4.3 ([LRS97]) LetP be a deductive disjunctive logic program. Then,a total interpretationM is a stable model ofP iff M is a total fixpoint ofWP .

Composed out of two monotonic operators by means of set union, we have thatWP is also monotonic. This implies that this operator has a least fixpointW!P . Forsemi-negative logic programs we have thatW!P is included in every stable model,which remains valid for disjunctive logic programs.

Theorem 3.4.4 ([LRS97]) Let P be a disjunctive logic program. Then,W!P �M , for every stable modelM ofP .

The least fixpoint of theWP -operator was deductively closed for semi-negativelogic programs. Unfortunately, this is no longer true when disjunctions are intro-duced.

Example3.4.8 Consider the programP of Example 3.4.5. The least fixpoint oftheWP -operator equals W!P = ; ;while the rule is applicable but not applied.

The reason for this is the inability to draw positive conclusions from disjunctiverules.

For semi-negative logic programs,W!P was responsible for the well-founded se-mantics. In the presence of disjunction this can no longer bepossible. Being

Page 53: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.4. DISJUNCTIVE LOGIC PROGRAMMING 39

deductively closed is a necessary prerequisite of a semantics. [Ros89] introducestwo generalizations of this well-founded semantics which are no longer totallybased onW!P . The difference between the two generalizations can be found in theway they treat disjunctions (inclusive or exclusive). Separately, the three-valuedstable model semantics was introduced by [Prz91]. Its procedural declaration wassupplied by [RM95]. Because this dissertation deals with decision-making, wewill restrict ourselves to total semantics and not give an overview of partial se-mantics.

In this section we introduced a declarative and procedural approach to the stablemodel semantics for disjunctive logic programs. This semantics is probably themost widely accepted one for this type of programs. Nevertheless, we will intro-duce in the next part a semantics which is a valuable alternative in some situations.

3.4.2 Possible Model Semantics

Traditionally, the declarative semantics of logic programming and deductive data-bases have been studied using the notion of minimal models. The minimal modelsreflect Occam’s razor: “only those objects should be assumedto exist which areminimally required by the context”. This is also the case in the context of disjunc-tive logic programs which are logic programs containing indefinite information.The stable model semantics uses only minimal models. However, such a min-imalism is not always appropriate in a theory containing indefinite information.In fact, the minimal model semantics minimizes truth as muchas possible, henceit usually interprets disjunction exclusively and maximizes negative information.Suppose your boss gives you a certain budget to buy yourself acomputer. Yourcomputer retailer suggest a basic model to which you can add anumber of func-tionalities. Your budget allows you to have this basic modeland, lets say, twoextra features. For the sake of minimality, will you be satisfied with just the basicmodel?In this part, we introduce a semantics which allows you to consider the disjunc-tions in the head as inclusive or exclusive as required by thesituation at hand.This semantics developed by [Sak89, SI94] is therefore called the possible modelsemantics. An equivalent semantics, called possible worldsemantics, was inde-pendently introduced by [Cha93]. In this section, we will restrict ourselves tothe declarative definition of [SI94] and a comparison between the possible modelsemantics and the stable models semantics.

Page 54: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

40 CHAPTER 3. LOGIC PROGRAMMING

The possible model semantics was first defined by [Sak89] for positive disjunctivelogic programs. According to [Sak89] a positive disjunctive logic program canbe considered to represent a set of positive facts that mighthave been true inthe actual world. The same can be said for general disjunctive logic programs,only now it is also possible that information can only be considered true in theabsence of proof (negation as failure). The possible model semantics is intendedto formulate this situation.

The definition of a possible model is based on the notion of a split program. Eachdisjunction is torn apart, such that every disjunct can become true in a separateprogram.

Definition 3.4.9 Given a disjunctive logic programP , a split programis definedas a disjunctive-free logic program obtained fromP by replacing each rule of theform a1 _ : : : _ an b1; : : : ; bmwith the following rules, calledsplit clauses:a1 b1; : : : ; bm for everyai 2 S ;whereS is some non-empty subset offa1; : : : ; ang .

Example3.4.9 Consider the Indian cuisine program of Example 3.4.4. This pro-gram has seven split programs:maas kolhapuri kesar pilau not birjani birjani kesar pilau not birjanitandoori murghi kesar pilau not birjani maas kolhapuri birjani kesar pilau not birjanimaas kolhapuri tandoori murghi kesar pilau not birjani birjani tandoori murghi kesar pilau not birjanimaas kolhapuri birjani tandoori murghi kesar pilau not birjani

Page 55: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.4. DISJUNCTIVE LOGIC PROGRAMMING 41

By creating these split clauses, we create a separate program for every possibleway that a disjunction can be satisfied. This makes it possible to treat disjunctionsas inclusive or exclusive as required by the represented problem. By demandingthat a possible model is a stable model of some split program,[SI94] guaran-tees both inclusive and exclusive treatment of disjunctions and avoids includingredundant positive information.

Definition 3.4.10 LetP be a disjunctive logic program and letM be a total in-terpretation forP . M is a possible modelfor P iff M is a stable model of anysplit program ofP .

Example3.4.10 Reconsider the Indian cuisine programP of Example 3.4.4. InExample 3.4.9, we have seen that this program has 7 split programs. Each ofthese split programs admits a single stable model, which results in seven possiblemodels4 for P :fmaas kolhapuri ; kesar pilaug; fbirjanig; ftandoori murghi ; kesar pilaug;fmaas kolhapuri ; birjanig; fmaas kolhapuri ; tandoori murghi ; kesar pilaug;fbirjani ; tandoori murghig; fmaas kolhapuri ; birjani ; tandoori murghig :When we take a look at the context of this program, we see that these possiblemodels reflect all possible combinations of the offered dishes. In India it is verycommon to serve your guest a larger selection of dishes. So inthis sense, thepossible model semantics is closer to reality than the stable model semantics,which just suggest the first three.

The following theorem demonstrates that the word “model” inthe notion of apossible model is well-chosen.

Theorem 3.4.5 ([SI94]) Let P be a disjunctive logic program and letM be apossible model forP . Then,M is a model ofP .

For semi-negative logic programs, the possible model semantics coincides withthe stable model semantics.

Theorem 3.4.6 ([SI94]) LetP be a semi-negative logic program. Then, the set ofpossible models forP coincides with the set of stable models ofP .

4To reduce space, we will only mention the positive part of themodels.

Page 56: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

42 CHAPTER 3. LOGIC PROGRAMMING

When we examine the possible models of the program in Example3.4.10 we seethat the minimal ones are exactly the stable models of the program. Unfortunately,this is not true in general as the following example demonstrates.

Example3.4.11 In India you will always have naan, a kind of bread, to accom-pany your meal. Nevertheless the host will ask you whether you want rice, pilau,or bread, naan. In case you order rice, you will get a smaller portion of naan.pilau _ naan naan pilauatjar not pilauThis program has two possible models:M1 = fpilau; naan; not atjarg, M2 =fnaan; atjar ; not pilaug. AlthoughM1 is minimal, it is not a stable model. It

is easy to check that this model is not unfounded-free, whichis necessary to be astable model (Theorem 3.4.3).

The above example illustrates that the minimal possible models and stable modelsdo not coincide. However, every stable model is a minimal possible model.

Theorem 3.4.7 Let P be a disjunctive logic program. Then, every stable modelofP is a minimal possible model.

For positive disjunctive logic programs, both sets coincide.

Theorem 3.4.8 Let M be a total interpretation for a positive disjunctive logicprogramP . Then,M is a stable model iffM is a minimal possible model forP .

In this subsection we introduced the possible model semantics as an alternativefor the stable model semantics. With its variable treatmentof disjunctions, thepossible model semantics reflects reality better than the stable model semantics incertain situations. Its bounded escape from minimality makes it especially appro-priate for configuration tasks.

In the next section, we will extend disjunctive logic programs even further. Thistime we will allow both classical negation and negation as failure in the programand this in both the heads and bodies of the rules. This allowsa more elegant andintuitive representation of various problems.

Page 57: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.5. EXTENDED DISJUNCTIVE LOGIC PROGRAMS 43

3.5 Extended Disjunctive Logic Programs

In Section 3.3, we extended positive logic programs to semi-negative ones, so thatwe could use negation as failure in the bodies of the rules. This notion of negationis based on the closed world assumption ([Rei78]) which states that everythingthat cannot be derived from the program should be consideredto be false. Despiteits intuitive definition, the use of negation as failure (not) in logic programs doessometimes lead to undesirable properties that can be eliminated by substitutingclassical negation (:) for it.

Example3.5.1 Fungi can be eaten under the condition that they are not poi-sonous. This can be represented by the following rule:eat not poisonousIf the absence of the atompoisonous in the database is interpreted as the fungusbeing not poisonous. But this knowledge representation convention is unaccept-able if information about this fungus is unavailable. For example if it concerns anew discovered sample. The situation is slightly differentwhen classical negationwould be used. This would result in the program:eat : poisonousThen,eat should not be included in any solution concept, unless explicit infor-

mation is provided to sustain: poisonous.The above example demonstrates that in some cases classicalnegation is moreappropriate for knowledge representation than negation asfailure. Nevertheless,the latter is a very convenient tool to express that something should be consideredfalse when no proof for the opposite can be obtained.

So far we have only allowed negation as failure to appear in the body of a rule.Suppose you want to represent the following statement in a logic programmingformalism: somebody who is not convicted should be considered not guilty. Thefirst not could be represented by classical negation, because not convicted is some-thing you can be sure of, while not guilty is more uncertain. In order to representthe above statement in a natural way, we need to allow negation as failure in thehead of our rules.

Page 58: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

44 CHAPTER 3. LOGIC PROGRAMMING

Example3.5.2 Imagine somebody has blind-folded you and she presents you anatural edible substance. She asks you to guess whether or not it contains sugar.The only test you are permitted to conduct is tasting. The program below mightrepresent the way to reach your answer.not sugar not sweetsugar sweetThe first rule states that if the substance does not have a sweet taste, you will haveno detectable evidence that it contains sugar. Writing: sugar would be wrong.In case they would present you a lemon, which has definitely not a sweet taste,you are not allowed to say that you found a proof that the lemondoes not containsugar. Lemons actually do contain a lot of sugar, even more than some very sweetfruit.

In this section we formalize the logic programming formalism which allows forboth types of negation, classical and as failure, to appear in both the heads andbodies of the rules. This generalization of disjunctive logic programming is calledextended disjunctive logic programming. The most widely accepted semanticsfor this type of programs is the answer set semantics ([GL91]). This semantics, ageneralization of the stable model semantics was first defined for programs with-out negation as failure. After defining answer sets we will demonstrate that theaddition of classic negation does not have any computational repercussions. Witha simple preprocessor, we can easily replace any occurrenceof classical nega-tion. Similarly, the presence of negation as failure in the head can be eliminated.In other words, we will show that an extended disjunctive logic program can betransformed to an equivalent disjunctive logic program. For detailed informationwe refer to the main references of the section: [Lif00] and [GL91].

The language used for extended disjunctive logic programs is identical to the oneof Definition 3.2.1. Because we will now be able to represent two types of nega-tions we need to adapt our notion of a literal.

Definition 3.5.1 An atom is denoteda(t1; : : : ; tn), wherea is a predicate of arityn andt1; : : : tn, its arguments, are terms. Ac-literal5 is an expression of the forma, : a, wherea is an atom. A c-literalp is called thecomplementof a c-literal q5In [GL91] literals are used to refer to an atom or its classical negation. To avoid confusion

with previous definitions we decided to use the term c-literal instead.

Page 59: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.5. EXTENDED DISJUNCTIVE LOGIC PROGRAMS 45

iff p = : q. For a set of c-literalsX, : X denotes the setf: l j l 2 Xg. A set ofc-literalsX is consistentiff X \:X = ;. A literal6 is an expression of the formlor not l with l a c-literal. Given a set of literalsX, we useX+ andX� to denoterespectively the setsfljl c-literal andl 2 X andfljl c-literal andnot l 2 X .

Definition 3.5.2 An extended disjunctive logic programis a countable set ofrules of the form: h1 _ : : : _ hn b1; : : : ; bm n;m � 0 ;whereh1; : : : ; hn; bj; : : : bm are all literals.a The disjunctionh1 _ : : : _ hn iscalled theheadof the rule while the conjunctionb1; : : : bm is thebody. The setfh1; : : : ; hng andfb1; : : : ; bmg are abbreviated as respectivelyHr andBr.The class of extended disjunctive logic programs is indeed ageneralization of thethe class of disjunctive logic programs.

An extended disjunctive logic program is calledpositivewhen it contains no ne-gation as failure.

The Herbrand universe and Herbrand base of an extended disjunctive logic pro-gram are defined in the usual way (Definition 3.2.4).The set of c-literals that can appear in a programP is denotedLit P (i.e. Lit P =BP [ : BP ).

The notion of an answer set was first defined for positive programs. We willfollow the more logic programming oriented definition of [Lif00]. The answerset semantics is a total semantics, in the sense that every element ofLit P will beassigned a truth value. This allows us to mention only those elements that oughtto be considered true.

Definition 3.5.3 LetP be a positive extended disjunctive logic program. A con-sistent set of c-literalsX � Lit P is closedunderP iff for every ruler 2 P holdsthatHr \X 6= ; wheneverBr � X.

Notice that, for positive disjunctive logic programs without classical negation,saying that a setX is closed is equivalent with saying that a set is deductivelyclosed (Definition 3.4.2).

6In [GL91] they use the term rule element.

Page 60: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

46 CHAPTER 3. LOGIC PROGRAMMING

Definition 3.5.4 LetP be a positive extended disjunctive logic program. A con-sistent set of c-literalsX � Lit P is ananswer setofP iff X is minimal under thesets closed underP .

Clearly, for positive disjunctive logic programs without classical negation, wehave that the answer sets coincide with the stable models of the program.

Example3.5.3 Consider the following extended versions of the fungus program.(Example 3.5.1).P1 : eat : poisonous y fungus P2 : eat : poisonousmushroom : poisonous mushroomThe programP1 hasf y fungusg as an answer set. Imagine the consequencesof replacing: with not . The programP2 has also a single answer set, namelyfeat ;: poisonous;mushroomg.Now that we have defined the answer set semantics for positiveextended disjunc-tive logic programs, we use it as the basis for general extended disjunctive logicprograms which allow negation as failure in both the head andthe body of a rule.

In order to do so, we need an extension of the Gelfond-Lifschitz transformationfor normal disjunctive logic programs.

Definition 3.5.5 LetP be an extended disjunctive logic program and letX be aconsistent set of literals (i.e.X � Lit P ). Thereductof P w.r.t. X, denotedPX ,is the positive extended disjunctive logic program:PX = fH+r B+r jr 2 P;H�r � X;B�r \X = ;g :The reduct w.r.t to consistent setX keeps to positive part of those rules for whichapplicable and not yet applied as far as the negative parts ofthe head and body areconcerned.

Definition 3.5.6 LetP be an extended disjunctive logic program. A consistent setof literalsX � Lit P is ananswer setfor P iff X is an answer set forPX.

It should not be hard to see that the answer set semantics is a generalization of thestable model semantics for disjunctive logic programs.

Page 61: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.5. EXTENDED DISJUNCTIVE LOGIC PROGRAMS 47

Example3.5.4 Consider the programP of Example 3.5.2. The reduct ofP w.r.t.the consistent setX = fsweet ; sugarg equals: sugar sweetObviously,PX does not admit any answer set. Thus,X is not an answer set forP . The programP has only one answer set, namely;.

A suitable semantics must first and for most make sure that itssolutions are de-ductively closed, i.e. for every rule with satisfied conditions we must have that atleast one of the consequences is satisfied.

Definition 3.5.7 LetP be an extended disjunctive logic program. A consistent setof literalsX is deductively closedunderP iff for every ruler H+r \ X 6= ; orH�r * X holds wheneverB+ � X andB�r \X = ;.The following theorem demonstrates that answer sets are deductively closed.

Theorem 3.5.1 ([Lif00]) LetS be an answer set for an extended disjunctive logicprogramP . Then,S is a deductively closed set underP .

The answer set semantics is not a minimal semantics, as demonstrated by thefollowing example.

Example3.5.5 Consider the following very simple programP :dinner _ not dinner This program has two answer sets:fdinnerg and;.The presence of classical negation makes it a lot easier to represent certain prob-lems. However, allowing classical negation does not allow us to represent morecomplex problems, since classical negation can be easily substituted by a simplepreprocessor. This is demonstrated by the following theorem.

Page 62: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

48 CHAPTER 3. LOGIC PROGRAMMING

Theorem 3.5.2 ([GL91]) Let P be an extended disjunctive logic program. LetP 0 be an extended disjunctive logic program without classicalnegation obtainedfromP by replacing every occurrence of the literal: a by a0 and by the addingthe constraints a; a0. Then, there is a one-to-one mapping between the answersets of both programs.

Not only have we eliminated classical negation from extended disjunctive logicprograms but it is also possible to remove negation as failure from the head of ruleswithout changing its semantics. This means that we can transform an extendeddisjunctive logic program to an equivalent disjunctive logic program.

Definition 3.5.8 LetP be an extended disjunctive logic program without classicalnegation. The corresponding disjunctive logic program (without negations in thehead)Pd can be constructed fromP in the following way: for every ruler 2 PwithH�r 6= ; we replacer by the following rules:

1. pr _ nr Br , and

2. pr H�r , and

3. H+r pr; Br , and

4. nr not a, 8a 2 H�r .

Notice that a minimal model will always contain eitherpr or nr but never both.The rules of type two and three make sure of that.

Example3.5.6 Consider the following simple programP and its transformationPd representing the choice between going out to dinner or not.P Pdout _ not out p _ n p outout pn not outThe programP has two answer sets:foutg and; :

Page 63: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.5. EXTENDED DISJUNCTIVE LOGIC PROGRAMS 49

which correspond with the stable modelsfp; out ; not ng andfn; not out ; not pg :Theorem 3.5.3 LetP be an extended disjunctive logic program without classicalnegation and letPd be its corresponding disjunctive logic program according toDefinition 3.5.8. Then,M is a stable model7 of Pd iff N = M \ BP is an answerset ofP .

Proof:� N is an answer set ofP . We construct the total interpretationM in thefollowing way:M = N [ fpr j 9r 2 P �H�r 6= ;; H�r � Ng [fnr j 9r 2 P �H�r 6= ;; H�r * Ng :In order to prove thatM is a stable model ofPd we need to demonstrate thatM is a minimal model ofPMd . We will prove this in two steps.

– M is a model ofPMd . We will verify each type of rule separately.� Constraints. Letr 2 PMd be a constraint. This constraint comesfrom a ruler0 2 Pd with B�r0 \M = ;. The construction ofPdassures thatr0 2 P . This implies thatr 2 PN , sinceBr0 � BPandB�r0 \ N = ;. BecauseN is an answer set ofP , it is, byTheorem 3.5.1, deductively closed underPN . This yieldsBr *N . So,r is satisfied.� Rules coming from a rule without negation in the head. Letr 2PMd be such a rule and supposeBr � M . With the same rea-soning as above, we obtainr 2 PN with Br � N . SinceN isdeductively closed underPN , we know thatHr \M 6= ;. Thus,r is satisfied byM .� Rules of type 1. This follows immediately from the constructionof M . For each ruler with H�r 6= ; we have eitherpr or nr aselement ofM .

7To make the notations in the proof easier to read, we will onlymention the positive part of thetotal interpretation of a disjunctive logic programs. The negative part can easily be deduced fromthe positive elements.

Page 64: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

50 CHAPTER 3. LOGIC PROGRAMMING� Rules of type 2. The satisfaction of these rules is guaranteed bythe construction ofM .� Rules of type 3. Letr be a rule inPMd which originates from a ruler0 of type 3. Assume thatBr � M . This implies thatB+r0 � MandB�r0 \M = ;. Sincepr� 2 B+r0 , we havepr� 2 M , with r�the rule inP from whichr0 is created. Due to construction ofM ,this implies thatH�r� � M . This yields thatHr B+r� 2 PNwith (Br nfprg) = B+r� � N . BecauseN is closed underPN , weknow thatHr \N = Hr \M 6= ;. Thus,r is satisfied.� Rules of type 4. The creation ofM makes sure thatnr is in Mfrom the moment that one element ofH�r , with r the originalrule, is false. It is only in this case that a rule is maintained inPMd . Thus such rules are satisfied.

After verifying all the rules inPMd , we may conclude that they are allsatisfied w.r.t.M . So,M is a model forPMd .

– M is minimal. To prove this we have to demonstrate that noM 0 �Mcan ever be considered a model ofPMd . We will investigate the threecases in whichM 0 can have less elements thanM .LetN 0 = M 0 \ BP . ClearlyN 0 � N .� N 0 � N : SinceN is an answer set and, thus, minimally closed

underPN , we must have thatN 0 cannot be closed underPN .Thus, a rule inPN is applicable but unapplied. This cannot be aconstraint asPN is a positive program. Since this rule is inPN ,we know:9r 2 P �H�r �M;H+r \N 0 = ;; B+r � N 0; B�r \M = ; :In caseH�r = ;, we have thatHr B+r 2 PMd ;withB+r �M 0 andHr\M 0 = ;. So in this case we can concludethatM 0 is not a valid model ofPMd .If H�r 6= ;, the above information, together with the constructionof Pd, yields:pr _ nr 2 B+r 2 PMd andH+r pr; B+r 2 PMd :

Page 65: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.5. EXTENDED DISJUNCTIVE LOGIC PROGRAMS 51

Let us start with the first rule. This rule is already applicable.From the construction ofM we know thatpr 2 M andnr =2 M .This means thatnr =2 M 0 either. To make this rule appliedN hasto containpr. If not, then we have to conclude thatM 0 is not amodel ofPMd . So assumepr 2 N . This makes the second ruleapplicable. However, this rule can never be applied, asH+r \M 0 =;. Thus,M 0 cannot be a model either.� 9pr 2M � pr =2M 0. The construction ofM implies that:9r 2 P �H�r 6= ;; H�r �M :In order forM 0 to stand a chance to be considered a model, wemust have thatH�r � M 0, sinceH�r � N = N 0 � BP . Theconstruction ofPd, introduces the rulepr H�r . Since this isa positive rule, it is also included inPMd . This rule cannot besatisfied byM 0, sincepr =2 M 0 andH�r � M 0. Thus,M 0 is not avalid model ofPMd .� 9nr 2M �nr =2M 0. This yields, with the construction ofM , that9r 2 P �H�r 6= ;; H�r *M :This implies9a 2 H�r �a =2M . The construction ofPd is respon-sible for the creation of the rulenr not a, which is transformedin the factnr 2 PMd . This immediately implies thatM 0 is nota valid model ofPMd .

After considering every possible way in whichM 0 can differ fromM ,we can conclude thatM 0 can never be model forPMd . This permits usto conclude thatM is a minimal model forPMd .

SinceM is a minimal model forPMd , we can conclude thatM is a stablemodel ofPd.� M is a stable model ofPd. Now we need to prove thatN = M \ BPis an answer set ofP . This is equivalent, thanks to definition 3.5.6, withdemonstrating thatN is minimally closed underPN . Again we will provethis in two steps.

– N is a model ofPN . Once more we look at the different types of rules.Let r 2 PN and letr0 be the rule from whichr originates.

Page 66: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

52 CHAPTER 3. LOGIC PROGRAMMING� r is a constraint. With the construction ofPd, it is easy to see thatr 2 PMd . BecauseM is a stable model ofPd and, thus, a minimalmodel ofPMd , we know thatBr *M . SinceBr � BP , we obtainBr * N , which satisfies the rule.� H�r0 = ;. Once more the construction ofPd assures us thatr 2PMd . SinceM is a model for this program and becauseHr; Br �BP , we know thatN satisfies this type of rule as well.� H�r0 6= ;. Suppose thatr is applicable. If not,r is immediatelysatisfied. This means that forr0 holds thatB+r0 �M ,B�r0 \M = ;andH�r0 � M . The construction ofPd creates the following tworules inPMd : pr0 H�r0 andHr pr0; Br :SinceH�r0 � M andM model forPMd , we obtainpr0 2 M . Thismakes the second rule applicable, asBr �M by assumption. ForM to be a model ofPMd , we must haveHr \M = Hr \ N 6= ;.Sor is satisfied.

After verifying every ruler 2 PN , we can conclude thatN is indeeda model ofPN .

– N is minimal. In order to prove thatN is a minimal model ofPN , itsuffices to demonstrate that everyN 0 � N is not a valid model for thisprogram. Given such aN 0, we createM 0 as:M 0 = N 0 [ (M n BP ) :SoM 0 is an interpretation just containing the elements ofN 0 and thepr andnr atoms which were included inM . It is easy to see thatM 0 � M . SinceM is a minimal model ofPMd , this implies thatM 0can never be a valid model forPMd . According to the definition, a rulehas to existr 2 PMd which is applicable yet unapplied (i.e.Br � M 0andHr \ M 0 = ;). Our construction ofM 0 andM being a modelguarantees that the headHr of this ruler contains only elements ofBP . The presence ofr in PMd implies that9r0 2 Pd �Hr0 = Hr; B+r0 = Br; B�r0 \M = ; :Every ruler0 comes from a ruler00 2 P . We distinguish two possibili-ties:

Page 67: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.5. EXTENDED DISJUNCTIVE LOGIC PROGRAMS 53� H�r00 = ;. This possibility yields thatr00 = r0, which impliesr 2 PN . SinceHr \M 0 = Hr \N 0 = ; whileBr � N 0, we mustconclude thatN 0 is not closed underPN .� H�r00 6= ;. Then,r0 must be of the formH+r00 pr00 ; Br00 withpr00 2 M . pr00 can only be part of a minimal model iffH�r00 � M .If we combine this withB�r \M = ;, we obtain thatHr B+r00 2PN . This rule will never be satisfied byN 0 asB+r00 � Br � N 0andHr \N 0 = ;. Thus,N 0 is not closedPN .

We have demonstrated that in neither caseN 0 can be considered closedunderPN . Thus,N is minimally closed underPN .

We have verified thatN is indeed minimally closed under its reductPN .So, we may conclude thatN is an answer set ofP . 2

Notice that in the above transformation we replace every rule which contains ne-gation as failure in the head by a number of negation-free rules. This makes itcomputationally uninteresting to perform the transformation in order to obtain theanswer sets of the original program. Nevertheless, it showsthat normal and ex-tended disjunctive logic programs can represent the same problems.

Corollary 3.5.1 Let P be an extended disjunctive logic program. Then, a dis-junctive logic programP 0 exists such that the answer sets ofP correspond to thestable models ofP 0.Proof: First transform, with Theorem 3.5.2,P to an extended disjunctive logicprogram without classical negationPt. Afterwards apply Definition 3.5.8 toPt.This will result in the programP 0. Theorems 3.5.2 and 3.5.3 guarantee that theanswer sets ofP correspond to the stable models ofP 0. 2In this section we introduced the answer set semantics for extended disjunctivelogic programs. This semantics, which is a generalization of the stable model se-mantics, is the most widely accepted one for logic programming. It is able to dealwith both classical negation and negation as failure appearing in both the head andthe body of the disjunctive rules. Although these extensions do not have an impacton the complexity of the represented problems, they allow for a more intuitive andelegant representation.

Page 68: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

54 CHAPTER 3. LOGIC PROGRAMMING

3.6 Beyond Rules

In previous sections we have introduced several logic programming formalismswith increasing generality. The first logic programming formalism, positive logicprograms, allowed us to model problems where conclusions are based on posi-tive information only. Later we made it possible to draw conclusions based onpositive information and negation as failure. So far conclusions were single ele-ments (atoms). For a lot of problems this is not sufficient. Decision-problems areamong them. They are based on alternatives from which the decision-maker has tochoose. To encompass this, disjunctive logic programs wereintroduced. Allowingboth types of negation to appear in every part of the program makes the representa-tion of problems even more expressive. However, for a numberof problems this isstill not enough. What should be done with exceptions to certain rules? How canpreference be encoded into programs? What should be done with programs thatneed to be updated? In order to get answers to these questions, several systems,[AP00, AAP+98, BE99, BFL99, BLR98, KS90, LV00, SI96, VN01, DVV00b]amongst others, were introduced. A detailed description ofall these systemswould be far beyond the scope of this dissertation. Nevertheless, we will return tosome of them when we discuss our own preference-based formalism in Chapter 6. An overview of some of the systems mentioned here can be found in [VN01].

Adding the ability to represent preference or order in some way solves a numberof problems. But what if you were confronted with probabilistic information orhad to draw probabilistic conclusions? To allow this we needto extend previousformalisms and their semantics even further. A semantics will then involve aprobability distribution or a combination of such distributions. Various systemshave been proposed; [Bac90, Ngo96, NS91, Poo92, DVV00a] arejust a few ofthem. We will discuss this further in Chapter 7 where we introduce our system ofprobabilistic logic programming.

3.7 Conclusions

In this chapter we introduced the basic notions of logic programming, restrictedto the total-model semantics is concerned. First we introduced positive logic pro-grams with its minimal model semantics. We argued that negation as failure hadonly a passive role in the decision-making process. In orderto give negative infor-mation a more active role, semi-negative logic programs were introduced. For this

Page 69: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

3.7. CONCLUSIONS 55

type of programs the minimal model is no longer sufficient. Therefore, the sta-ble model semantics, based on a fixpoint-like Gelfond-Lifschitz transformation,was defined. Semi-negative logic programs were extended to disjunctive logicprograms to allow conclusions formulated by means of a disjunction of alterna-tives. Again the stable model semantics was extended to takethese disjunctionsinto account. The system at the end of this generalization chain allows us to useboth classical negation and negation as failure in both the head and the body ofrules. The answer set semantics for these extended disjunctive logic programs isa generalization of the stable model semantics. We have demonstrated that theseextended disjunctive logic programs allow for a very elegant and intuitive repre-sentation of problems. In the previous section we mentionedextensions of logicprogramming that consider order, preference and probabilistic information. Wewill come back to this later on in this dissertation. First wewill give, in the nextchapter, a brief introduction to game theory and its equilibria states. We will usegames and their steady states as test cases for our logic programming formalisms.

Page 70: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

56 CHAPTER 3. LOGIC PROGRAMMING

Page 71: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Chapter 4

Game Theory

In the next three chapters we will discuss our logic programming formalismswhich have been developed for representing and solving problems that involve de-cisions made by agents. Later in this dissertation, we will demonstrate that thesesystems and their corresponding semantics form an intuitive and elegant tool forthe representation of various games. In this chapter we introduce the necessarygame theoretic notions. Our main reference is [OR96].

4.1 Introduction

In everyday life we often see situations where a number of decision-makers in-teract with each other. Each of these people will try to make some assumptionsabout what the other partners are expecting of the interaction and how they mightrespond to certain actions. Each decision-maker will of course try to get as muchprofit as possible out of the interaction, which of course depends on the other par-ticipants as well. Take, for example, that you want to buy a car. You go to yourcar-dealer and you hope to get a nice discount. The car-dealer on her side willtry to keep the price as high as possible, knowing that if she asks too much youmight go to another seller. After negotiations the car will be sold for a price thatis acceptable for both parties. On your side, you would have preferred to havethe price even lower, but at such a price the car was not for sale. The car dealeron her side would have appreciated a higher price, but then you would not havebought the car. So both parties have agreed to compromise. Later on we will call

57

Page 72: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

58 CHAPTER 4. GAME THEORY

this compromise an equilibrium state. Given the other party’s actions, you cannotobtain a better price for the car.

Basicly, game theory is a growing field of science with roots in mathematics,economics and philosophy. It provides analytical tools designed to improve theunderstanding of the phenomena observed when decision-makers interact. Model-ing such interactions always starts from the assumption that the decision-makersare rational (e.g. the actions they undertake serve a well-defined objective) andthat they take into account their knowledge or expectationsof the other decision-makers’ behavior (e.g. the players of the game act strategically). This way, gametheoretic models can anticipate the outcomes of complex interactions with multi-ple players/actors.The first publications in this area date back to 1944 ([VNM44]), when game the-ory was used to examine complex economic behavior.The models of game theory are highly abstract mathematical representations ofclasses of real-life situations. Their abstractness allows them to be used for thestudy of a wide spectrum of phenomena. For example, game theory has been ap-plied to study oligopolistic and political competition, toexplain the distributionsof tongue length in bees and tube length in flowers and to illuminate social phe-nomena like threats and promises. In computer science, gametheory has beenhelpful in obtaining a large number of theoretical results.The full completenessof multiplicative linear logic and the full abstractness oflazy lambda calculus([Abr92, AO93]) are just two examples of this. Game theory also contributes tomore practical areas of computer science. The use of evolutionary stable strategiesfor the resource allocation in modern network management improves significantlythe network utilization ([Ola96]).

A game is a description of a strategic interaction that includes the constraints onthe actions that the players are allowed to take and the players’ interests, but it doesnot specify the actions that the players take. A solution is asystematic descriptionof the outcomes that may emerge in a family of games. Game theory suggestsreasonable solutions, called equilibria, for classes of games and examines theirproperties. In all theoretic models the basic entity is a player. A player may beinterpreted as an individual or as a group of individuals making joint decisions(e.g. a board of directors). Once the set of players is defined, one can distinguishtwo types of models: those in which the sets of possible actions of individualplayers are primitives and those in which the actions are determined by the setsof possible joint actions of groups of players. In this dissertation we will restrictourselves to the first type of games, the so-called non-cooperative games. Each

Page 73: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4.1. INTRODUCTION 59

agent is considered totally selfish: they are only concernedabout maximizing theirown reward; they are not interested in maximizing the rewardof a group of agents,possibly by putting their own reward at stake.

A basic assumption in game theory is rationality: each decision-maker has to berational in the sense that she is aware of her alternatives, forms expectations aboutany unknowns, has clear preferences, and chooses her actions deliberately aftersome process of optimization. In most cases we will have thatthe participants’choices are deterministic. However, this makes the existence of equilibria uncer-tain. By assigning, for each player, a probability distribution (or lottery) on theset of available actions and maximizing the expected outcome (rationality), wecan always obtain an outcome of the game coming from rationalactions of theplayers.

In the next sections we will discuss strategic games and extensive games withperfect information and their respective equilibria. A strategic game is a model ofa situation in which each player chooses her plan of action once, and all players’decisions are made simultaneously. This implies that each player chooses her planof action without being informed of the plan of action chosenby any of the otherplayers. In contrast, the model of an extensive game specifies the possible ordersof events; each player can consider her plan of action not only at the beginningof the game but also whenever she has to make a decision. Extensive gamescome in two flavors: with or without perfect information. In the former case,the participants are fully informed about each others’ moves, and they can fullyexploit this information. In the latter case, they may be just partially informed.This implies that they have to make decisions under uncertainty. We will restrictourselves to extensive games with perfect information.

For both strategic games and extensive games with perfect information, we willdiscuss two equilibria. For the former, we will start with Nash equilibria. Sincethere is no certainty that a game admits at least one such Nashequilibrium, wewill introduce mixed strategy Nash equilibria. For extensive games with perfectinformation we also define a Nash equilibrium for which we demonstrate that theoutcomes are not always intuitive. To overcome this problem, subgame perfectequilibria are needed.

These games and their equilibria will be used later on in thisdissertation to demon-strate that logic programming formalisms and their semantics can be used to rea-son about games and their equilibria. A detailed description of the other types ofgames is beyond the scope of this dissertation.

Page 74: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

60 CHAPTER 4. GAME THEORY

4.2 Strategic Games

This section is devoted to the most commonly known type of game, namely strate-gic games. We will introduce the two most used equilibria forthis type of games.

4.2.1 Introduction

A strategic game, or in the terminology of von Neuman and Morgenstern [VNM44]a “game in normal form” models a strategic interaction. Thismodel specifies foreach player a set of possible actions and a preference ordering over the set ofall outcomes (profiles) of the game. Each outcome is associated with the actionstaken by all the participants. This type of game has already proven its usefulnessin, for example, political sciences.Probably the most common known game of this type is the prisoner’s dilemma.This game is made famous by Axelrod ([Axe84]) who started a competition tofind out the best strategy for playing this game repeatedly with the same players.The game tells the story of two suspects arrested for a crime they have committedtogether. Each one is separately requested to betray the other. If they both keepquiet they will be convicted for a minor offense. If they bothconfess, they getthe a sentence which is higher than what they would receive ifthey both keepsilent. Their main concern is that the one being loyal to his mate risks the maxi-mum sentence if the other does not return the favor. Neither is willing to take thischance, so they end up having the sentence for their crime instead of a convictionfor a minor offense. So by fearing the other’s reaction they end up in a situationwhich is not optimal for either one of them but from which theycannot escape.Game theory can predict the “unfortunate” end of this story.We will see that theoutcome of this story is called a Nash equilibrium.

After defining the concept of a strategic game, we will introduce the first andmost widely used solution concept for strategic games, namely Nash equilibria.Nash equilibria are steady state solution concepts in whicheach player’s decisiondepends on the knowledge of the equilibrium. In this sense Nash equilibria canbe seen as some kind of fixpoint. Afterwards we will introducemixed strategyequilibria that allow players to assign a probability distribution on their availableactions. In this case players will try to maximize their expected payoff instead ofthe actual payoff, which remains uncertain.

Page 75: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4.2. STRATEGIC GAMES 61

4.2.2 Nash Equilibria

A strategic game models a situation where several agents (called players) inde-pendently make a decision about which action to take out of a limited set of pos-sibilities. The result of the actions is determined by the combined effect of thechoices made by each player separately. Players have a preference for certain out-comes (called profiles) over others. These preferences are made public, so thatthey can be used by the players to anticipate the actions of the other participantsof the game. Each player is supposed to act rationally and in her own interest.

Definition 4.2.1 A strategic gameis a tuplehN; (Ai)i2N ; (<i)i2Ni where

1. N is a finite set ofplayers;

2. for each playeri 2 N , Ai is a non-empty set ofactionsthat are availableto her (we assume thatAi \ Aj = ; wheneveri 6= j); and

3. for each playeri 2 N , <i is a preference relationonA = �j2NAj .

An elementa 2 A is called aprofile. For a profilea we useai to denote thecomponent ofa in Ai. For any playeri 2 N , we defineA�i = �j2NnfigAj.Similarly, an element ofA�i will often be denoted asa�i. For a�i 2 A�i andai 2 Ai, we will abbreviate as(a�i; ai) the profilea0 2 A for whicha0i = ai anda0j = aj for all j 6= i .

The high level of abstraction of this model allows it to be applied to a wide varietyof situations. A player may be an individual human being or any other decision-making entity like a government, a board of directors or evena flower, an animalor nature itself. The model places no restrictions on the setof available actions,which may, for example, contain just a few elements or be a huge set containingcomplicated plans of actions. However, the range of applications for this model islimited by the requirement that each player has to associatea preference relationon the possible outcomes of the game. A player’s preference relation may simplyreflect the player’s feelings about the possible outcomes or, in the case of an or-ganism that does not act consciously, the chances of its reproductive success.The abstractness of the model is an advantage to the extent that it allows appli-cations in a wide range of situations, but it is a drawback in the sense that theimplications of the model cannot rely on any specific featureof a situation. Forexample, in some situations agents are more likely to hold preference over the

Page 76: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

62 CHAPTER 4. GAME THEORY2; 10; 0 0; 01; 2A eptB Reje tBA eptAReje tAFigure 4.1: A political compromise.

consequences of their actions instead of the actions themselves. When modelingan olipology, for example, we may take the set of players to bea collection offirms and the set of actions of each firm to be the set of prices; but we may wish tomodel the assumption that each firm cares only about its profit, not about the pro-file of prices generating this profit. To do so, we define a setC of consequences,a functiong : A ! C that associates consequences with action profiles, and aprofile4�i of preference relations overC. Then the preference relation4i of eachplayer i on the strategic game is defined as follows:a 4i b iff g(a) 4�i g(b).Other situations in which the preferences of the players do not directly depend onthe actions chosen can be modeled in a similar way.

Under a wide range of circumstances the preference relation4i of playeri in astrategic game can be represented indirectly by apayoff function ui : A! R, inthe sense thata <i b wheneverui(a) < ui(b). A payoff function is sometimesreferred to as autility function. We refer to values of such a function aspayoffs(or utilities). For examples we will often specify a player’s preference relationindirectly by giving a payoff function that represents it.

Example4.2.1 Two political parties,A andB, form a coalition in the federalchamber in order to obtain the majority. One day they have to decide whether ornot they will accept or reject a certain law on the agenda. PartyA is more in favorof accepting whileB is more inclined to reject. However, despite their differencesthey agree some consensus has to be achieved. Having different opinions to theoutside world would be bad publicity for their coalition. This situation can bewritten down as the strategic gamehN;AA; AB;<1;<2i with:� N = fA;Bg ;� Ai = fa epti; reje t ig for i 2 N ;

Page 77: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4.2. STRATEGIC GAMES 63Silent2 Betray2�1;�1Silent1 0;�4Betray1 �4; 0�2;�2Figure 4.2: The prisoner’s dilemma.� (a eptA; a eptB) �A (reje tA; reje tB) �A (a eptA; reje tB) =A(reje tA; a eptB) and(reje tA; reje tB) �B (a eptA; a eptB) �B (a eptA; reje tB) =B(reje tA; a eptB) .

In cases where preferences can be mapped to payoff functions, we will use a moreconcise notation as displayed in Figure 4.1. The actions of partyA are identifiedwith the rows and the once of partyB with the columns. The two numbers in thebox formed by rowr and column are the players’ payoffs when the row playerchoosesr and the column player decides on , the first component being the payoffof the row player. We have chosen for the payoffs 2,1,0 to illustrate respectivelythat the preferred action is opted for, the other alternative is chosen and neitherparty is satisfied as no compromise is established.

In the above game the outcomes are fairly simple to find, namely both partiesdecide to both accept or reject the proposal. The situation is not always that clear,as demonstrated below.

Example4.2.2 In the introduction we told the story of the prisoner’s dilemma.Figure 4.2 represents this game using a payoff function. Thepayoffs represent thenumber of years they will lose their freedom. At first sight one might expect thatboth prisoners will remain silent. However, they are both soafraid that the othermight betray them, which would result in a maximum sentence.So they decide totake the initiative and betray the other.

Playing a gamehN; (Ai)i2N ; (<i)i2N i consists of each playeri 2 N selecting asingle action from the set of actionsAi available to her. Since players are thoughtto be rational, it is assumed that a player will select an action that leads to some“preferred” profile. The problem, of course, is that a playerneeds to make adecision not knowing what the other players will do.

Page 78: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

64 CHAPTER 4. GAME THEORY

The notion of a Nash equilibrium ([Nas50]) shows that, in many cases, it is stillpossible to predict the possible outcomes (profiles) of the game.

Definition 4.2.2 A Nash equilibrium([Nas50]) of a strategic gamehN; (Ai)i2N ;(<i)i2N i is a profilea� satisfying:8ai 2 Ai � (a��i; a�i ) <i (a��i; ai) :Intuitively, a profilea� is a Nash equilibrium if no player can unilaterally improveupon her choice. Put in another way, given the other players’actionsa��i, a�i is thebest playeri can do1.

Example4.2.3 The strategic game of Example 4.2.1 has two Nash equilibria:(a eptA; a eptB) and (reje tA; reje tB) :Their is only a single Nash equilibrium for the Prisoner’s Dilemma of Exam-ple 4.2.2: (Betray1;Betray2 ) :The ideal outcome(Silent1; Silent2) can never be considered as a Nash equi-librium. Both prisoners could benefit from the other party’soffer by choosingBetray instead ofSilent . This would yield them a payoff of 0 instead of -1.

Given a strategic game, it is only natural to consider only those moves that are thebest for a player, given the other players’ choices.

Definition 4.2.3 Let hN; (Ai)i2N ; (<i)i2Ni be a strategic game. Thebest re-sponsefunctionBi for playeri 2 N is defined by:Bi(a�i) = fai 2 Ai j 8a0i 2 Ai � (a�i; ai) <i (a�i; a0i)g :It is not hard to see that a Nash equilibrium is composed out ofbest responses.

Although Nash equilibria supply strategic games with intuitive and rational out-comes, it is not possible to find such a solution for every strategic game. This isdemonstrated by the following example.

1Note that the actions of the other players are not actually known toi.

Page 79: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4.2. STRATEGIC GAMES 650; 00; 3 3; 0 0; 3S issors20; 03; 0 0; 3 3; 00; 0Sheet1Stone1 Stone2Sheet2S issors1Figure 4.3: The Sheet-Stone-Scissors game.

Example4.2.4 (Sheet-Stone-Scissors)There is popular children’s game calledSheet-Stone-Scissors. Each of two players has to choose between a sheet of paper,a stone or a pair of scissors. When both players choose the same object, nobodywins the game. A paper can defeat a stone, since the paper can be wrapped aroundit. The paper itself is defeated by the scissors, because they cut the paper. Sincethe stone can break the scissors, the stone will defeat the scissors. The winnerreceives three points. This strategic game is displayed in Figure 4.3. This gameadmits no Nash equilibria, since for each action profile there will be at least oneplayer that can come up with a better action to win the game.

4.2.3 Mixed Strategy Nash Equilibria

Above we have seen that not every strategic game can be assigned a Nash equi-librium. In this section we introduce a different type of steady state that allowsplayers to make their actions non-deterministic. This non-determinism will beregulated by probabilistic rules. Before turning to definitions, let us take a look ata simple example of a coin toss.

Example4.2.5 (Matching Pennies)Two people toss a coin. Each of them has tochoose heads or tails. If the choices differ, person 1 pays person 2 an Euro; if theyare the same, person 2 pays person 1 an Euro. Each person caresonly about theamount of money that she receives. The game modeling this situation is depictedin Fig. 4.4. This game does not have a Nash equilibrium.

We, humans, would almost automatically say: ”Why not chooseheads and tailswith each a 50% chance? At least then we can be certain that in 25% of thetime we will make a profit.” As we will see later on, this reasoning corresponds tomixed strategy Nash equilibria, the steady state that we areabout to define. Agents

Page 80: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

66 CHAPTER 4. GAME THEORY1; 00; 1 0; 11; 0tail 1 head2 tail2head1Figure 4.4: Matching Pennies (Example 4.2.5).

will assign a probability distribution on their actions instead of just pinpointingone of them.

In this section we allow players to make their choices non-deterministic. To makethis possible we need extra primitives to represent preferences over lotteries orprobability distributions onA. Following the current conventions in game theory,we will assume that the preference relation of each playeri can be represented2

by the expected value of some functionui : A ! R. Thus our basic model ofstrategic interaction in this chapter is a tuplehN; (Ai); (ui)i that differs from astrategic game as we previously defined it in thatui : A ! R for eachi 2 N isa function whose expected value represents player i’s preferences over the set oflotteries onA. Nevertheless, we simply refer to the model as astrategic game.

Let G = hN; (Ai); (ui)i be a strategic game. We denote by�(Ai) the set ofprobability distributions overAi and refer to a member of�(Ai) as amixed stra-tegy of player i. We assume that the players’ mixed strategies are independentrandomizations. Sometimes we will refer to a member ofAi as apure strategyinstead of simply an action. For a finite setX andÆ 2 �(X), we denote byÆ(x)the probability thatÆ assigns tox 2 X and define thesupportof Æ to be the setof elementsx 2 X for which Æ(x) > 0. A profile (�j)j2N of mixed strategiesinduces a probability distribution over the setA; if, for example, eachAj is finitethen, given the independence of the randomizations, the probability of the actionprofilea = (aj)j2N equals

Qj2N �j(aj), so that player i’s evaluation of(�j)j2NisPa2A(Qj2N �j(aj))ui(a).

To make the definition of a steady state with probabilities easier to understand,we derive from aG another strategic game, called the “mixed extension” ofG, inwhich the set of actions of each playeri is the set of�(Ai) of her mixed strategiesin G.

2This is always possible when the preference relation satisfies the assumption of von Neumanand Morgenstern [VNM44].

Page 81: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4.2. STRATEGIC GAMES 67

Definition 4.2.4 Themixed extensionof the strategic gamehN; (Ai); (ui)i is thestrategic gamehN; (�(Ai)); (Ui)i in which�(Ai) is the set of probability dis-tributions overAi, andUi : �j2N�(A)j ! R assigns to each� 2 �j2N�(A)jthe expected value underui of the lottery overA that is induced by� (so thatUi(�) =Pa2A(Qj2N �j(a))ui(a) if A is finite) .

Note that in the case in which eachAi is finite we have:Ui(�) = Xai2�i �i(ai)Ui(��i; e(ai)) ;for any mixed strategy profile�, wheree(ai) is the degenerated mixed strategy ofplayeri that attaches probability 1 toai 2 Ai.Now that we have the mixed extension of a strategic game, it isvery easy to definethe equilibrium state.

Definition 4.2.5 Amixed strategy Nash equilibriumof a strategic game is a Nashequilibrium of its mixed extension.

Example4.2.6 Although the matching pennies game (Example 4.2.5) does nothave a Nash equilibrium, it has a single mixed strategy Nash equilibrium:ffhead1 : 1=2; tail1 : 1=2g; fhead2 : 1=2; tail2 : 1=2ggwhich corresponds to the way humans maximize their profit.

One can show that every Nash equilibrium is also a mixed strategy Nash equili-brium where for eachAi a single action receives a positive probability and viceversa.

Theorem 4.2.1 Every Nash equilibrium of a strategic gamehN; (Ai); (ui)i is amixed strategy Nash equilibrium for this game and every mixed strategy Nashequilibrium that assigns probability 1 to a single action ofevery playeri is aNash equilibrium for this game.

We just argued that the set of Nash equilibria of a strategic game is a subset ofits set of mixed strategy Nash equilibria. Example 4.2.5 demonstrated that thereare games for which the set of Nash equilibria is empty. Gamesalso exist forwhich the set of mixed strategy Nash equilibria is empty. However, every gamein which the action set for each player is finite admits at least one mixed strategyNash equilibrium, as the following result shows.

Page 82: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

68 CHAPTER 4. GAME THEORY

Theorem 4.2.2 Every finite strategic game has a mixed strategy Nash equili-brium.

The expected payoff of an action, given a profile of mixed strategies, is the payoffthe player would get if she was sure to undertake this action while the other playersact according to their mixed strategy.

Definition 4.2.6 (Expected payoff)LetG = hN; (Ai); (ui)i be a finite strategicgame. Given profile� of mixed strategies, we define the expected payoff of anactionai 2 Ai of playeri 2 N asUi(��i; e(ai)) .

Previously, in Definition 4.2.2, we defined a mixed strategy Nash equilibrium ofa strategic game as a Nash equilibrium of its mixed extension. This definitiondoes not make it easy to identify a mixed strategy profile as a mixed strategy Nashequilibrium. The next theorem supplies us with better toolsto do so, as it showsthat mixed strategy Nash equilibria can solely be characterized on the basis ofexpected payoff.

Theorem 4.2.3 The mixed strategy profile�� is a mixed strategy Nash equili-brium of a finite strategic gamehN; (Ai); (ui)i iff for every playeri,� the expected payoff of every action to which��i assigns positive probability

is the same, given���i ; and� the expected payoff of every action to which��i assigns probability 0 is atmost the expected payoff to any action in the support of��i , given���i .

When the set of actions is no longer finite the above result needs to be modified.In this case,�� is a mixed strategy Nash equilibrium of a strategic game if andonly if, for every playeri: (i) no action inAi yields, given���i, a payoff to playeri that exceeds her equilibrium payoff, and (ii) the set of actions that yield, given���i, a payoff less than this equilibrium payoff has��-measure zero.

Example4.2.7 Reconsider the political game of Example 4.2.1. Previously, wehave seen that this game admits two Nash equilibria:(A eptA;A eptB) and(Reje tA;Reje tB). Suppose that(�A; �B) is a mixed strategy Nash equilibrium.If �A(A eptA) is zero or one, we obtain the two pure Nash equilibria. If0 <

Page 83: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4.3. EXTENSIVE GAMES WITH PERFECT INFORMATION 69�A(A eptA) < 1 then, given�B, by Theorem 4.2.3, playerA’s actionsA eptAandReje tA must yield the same expected payoff, so we must have2�B(A eptB) =�B(Reje tB). This makes�B(A eptB) = 1=3. Since0 < �B(A eptB) < 1,it follows from the same theorem that playerB’s actionsA eptB andReje tBshould have the same expected payoff, such that�A(A eptA) = 2�A(Reje tA),or �A(A eptA) = 2=3. Thus, the only non-degenerated mixed strategy Nashequilibrium of the game equals:ffa eptA : 2=3; reje tA : 1=3g ; fa eptB : 1=3; reje tB : 2=3gg :Example4.2.8 When we look back at the Prisoner’s Dilemma of Example 4.2.2,we see that the single Nash equilibrium(Betray1;Betray2) is also the singlemixed strategy Nash equilibrium.

Example4.2.9 In Example 4.2.4 we have seen that the Sheet-Stone-Scissorsgamedoes not admit any Nash equilibria. However, just like the Matching Penniesgame, there is a mixed strategy Nash equilibrium:ffSheet1 : 1=3; Stone1 : 1=3; S issors1 : 1=3g;fSheet2 : 1=3; Stone2 : 1=3; S issors2 : 1=3gg :4.3 Extensive Games with Perfect Information

After defining our first game theoretic concept in the previous section, we willextend this notion to allow players to revise their decisions during the game.

4.3.1 Introduction

An extensive game is an explicit description of the sequential structure of theunderlying decision problems encountered by the agents in astrategic situation.The model supplies us with a framework to study solutions that allow each playerto reconsider her plan of action not only at the beginning of the game but also atany point of time at which she has to make a decision. By contrast, the model ofa strategic game restricts us to solutions in which each player chooses her planof action once and for all. This plan can cover unlimited contingencies, but themodel of a strategic game does not allow a player to reconsider her plan of actionafter some events in the game have unfolded.

Page 84: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

70 CHAPTER 4. GAME THEORY

Extensive games come in two flavors: with perfect or with imperfect information.Perfect information in extensive games implies that each player will know exactlywhat has happened in the game before she has to make a decision. So, if necessary,she can use this information to take a more beneficial decision. Extensive gameswith imperfect information differ in the sense that playerscannot fully distinguishbetween previous actions of other players. For example, if the previous player wasable to make a choice between actionsa, b and it is quite possible that the currentplayer cannot tell whethera or b is played but knows that was not chosen. In thisdissertation we will restrict ourselves to extensive gameswith perfect information.More information concerning imperfect information can be found in [OR96].

A good example of an extensive game with perfect informationcould be a courtcase where the lawyers of both parties try to win the case. Each party will try tobe prepared for every possible move of the other party. However, court cases canbe unpredictable sometimes, for example the counter party might come up withsome witness that the other party did not expect. In this casethe former partywill change their course of action. The sequential structure of the game is set bythe court system that alternates between the defense and prosecutor. Since bothparties will closely monitor each other’s actions, we obtain an extensive gamewith perfect information.

In the following subsections we will introduce this new typeof game togetherwith two of its most common equilibria. First we define Nash equilibria for exten-sive games. In some situations Nash equilibria tend to be unnatural steady states.In order to prevent this subgame perfect equilibria were introduced. They willoperate as some kind of a filter for unwanted Nash equilibria.

4.3.2 Nash Equilibria

An extensive game is a detailed description of a sequential structure representingthe decision problems encountered by agents (calledplayers) in strategic decisionmaking (agents are able to reason about their actions in a rational manner). Playershave a preference for certain outcomes over others. The agents in the game areinformed of all events that occurred previously. Therefore, they can decide upontheir action(s) using information about the actions which have already taken place.This is done by means of passinghistoriesof previous actions to the decidingagent. Terminal historiesare obtained when all the agents/players have madetheir decision(s).

Page 85: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4.3. EXTENSIVE GAMES WITH PERFECT INFORMATION 71

Definition 4.3.1 Anextensive game with perfect informationis a tuplehN;H; P; (<i)i2N i with the following components:� A setN of players.� A prefix-closed3 setH of finite4 sequences. Each element ofH is called ahistory; each component of a history is anaction chosen by a player. Ahistoryh is terminal if 6 9ak+1 � (h; ak+1) 2 H. We useZ to denote the setof terminal histories.� A functionP that assigns to each nonterminal history fromH nZ a memberof N . (P is theplayer function, P (h) being the player making a decisionafter historyh).� For each playeri 2 N a preference relation<i onZ (the preference rela-tion of playeri).

If h is a history of lengthk then we denote by(h; a) the history of lengthk + 1consisting ofh followed by a. Playing the game works as follows: after anynonterminal historyh playerP (h) chooses an action from the setA(h) = fa j (h; a) 2 Hg :The empty history is the starting point of the game; we sometimes will refer to it asthe initial history. At this point playerP (;) chooses a member ofA(;). For eachpossible choicea0 from this set playerP (a0) subsequently chooses a member ofthe setA(a0); this choice determines the next player’s move, and so on. A historyafter which no more choices have to be made is terminal.

With strategic games we argued that a preference relation onthe outcome is some-times to abstract. To overcome this problem, we based the preference relation onan external function that is able to take all necessary information into account.The preference relations of the game will prefer the outcomewhich is favored bythe external function. A similar strategy can also be used for extensive games withperfect information. The use of a payoff function is, just asfor strategic games,the most common way of representing the preference relation. In such cases wewill denote the extensive game ashN;H; P; (ui)i with ui the payoff function as-sociated to playeri.

3A setX of sequences is prefix-closed if8s 2 X;8x � (x; y) = s � x 2 X .4We restrict ourselves to so-called games with a finite horizon, i.e. games for which all histories

are finite.

Page 86: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

72 CHAPTER 4. GAME THEORYb��������� PPPPPPPPP1(2; 1) (1; 1) (0; 2)r��� ���2y1 n1r2; 0 r0; 0 r��� ���2y2 n2r1; 1 r0; 0 r��� ���2y3 n3r0; 2 r0; 0Figure 4.5: The Sharing-an-Object game of Example 4.3.1.

Example4.3.1 Two people use the following procedure to share two desirableidentical objects. One of them proposes an allocation, which the other either ac-cepts or rejects. In the event of rejection, neither person receives either of theobjects.An extensive game with perfect information that models the individuals’ predica-ment ishN;H; P; (<i)i2Ni where� N = f1; 2g ;� H consists of ten histories;; (2; 0); (1; 1); (0; 2); ((2; 0); y1); ((2; 0); n1);((1; 1); y2); (1; 1); n2); ((0; 2); y3); ((0; 2); n3) ;� P (;) = 1 andP (h) = 2 for the non-terminal histies(2; 0); (1; 1); (0; 2) ;� ((2; 0); y1) >1 ((1; 1); y2) >1 ((0; 2); y3) =1 ((2; 0); n1) =1 ((1; 1); n2) =1((0; 2); n2) and((0; 2); y3) >2 ((1; 1); y2) >2 ((2; 0); y1) =2 ((2; 0); n1) =2((1; 1); n2) =2 ((0; 2); n3) .

A more convenient representation of this game is shown in Fig. 4.5. The smallcircle at the top represents the initial history;. The 1 above this circle indicatesthatP (;) = 1 (player 1 makes the opening move). The three lines that emanatefrom the circle correspond to the three members ofA(;) (the possible actions ofplayer 1 at the initial history); the labels beside these line segments are the namesof the actions. The whole tree is constructed in a similar way. Each path in thetree starting at the root symbolizes a history while a node isa choice point forthe player whose turn it is after the history formed by the path from the root tothis node. The numbers next to nodes represent the players while the labels ofthe arcs represent an action. The number below the terminal histories are payoffsrepresenting the players’ preferences (The first number is the payoff of the firstplayer and the second number is the payoff of the second player).

Page 87: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4.3. EXTENSIVE GAMES WITH PERFECT INFORMATION 73

When you want to play a game, you need some plan of action or strategy thatanticipates all possible actions of the other players. Moreformally, a strategy ofa player in an extensive game is a plan that specifies the actions chosen by theplayer when it is her turn to move.

Definition 4.3.2 Let hN;H; P; (<i)i2Ni be a finite extensive game with perfectinformation. Astrategyfor a playeri 2 N is a function that assigns an action ofA(h) to each non-terminal historyh 2 (H n Z) for whichP (h) = i .

A strategy profiles is a set containing a strategy for each playeri 2 N , i.e.s = (si)i2N .

TheoutcomeO(s) for a strategy profiles is defined as the terminal history whichis reached when each playeri 2 N follows the precepts ofsi. That is,O(s) isthe history(a1; : : : ; ak) 2 Z such that, for0 � l < k, sP ((a1;:::;al))((a1; : : : ; al)) =al+1 .

Notice that a strategy of a playeri in an extensive game with perfect informationdoes not depend on4i. Looking at the graphical representation of a game, onecould say that a strategy solely depends on the structure of the tree, without takingthe contents of the leafs into account.

Example4.3.2 Reconsider the game of Example 4.3.1. Player 1 has to choose anintial action from(2; 0), (1; 1) and(0; 2). So we can identify each of her strategieswith one of these possible actions. Player 2 chooses an action after each of thehistories(2; 0), (1; 1) and(0; 2). In each case she has two possible actions:yi orni with i 2 f1; 2; 3g. Thus, her strategy will be a triplefa1; b2; 3g, with a, b and equal to eithery or n. The interpretation of player 2’s strategyfa1; b2; 3g isthat it is a contingency plan: if player 1 chooses(2; 0) then player 2 will playa1;if player 1 opts for(1; 1) then player 2 goes forb2; and when player 1 decides for(0; 2) then player 2 takes 3.The following example illustrates that a strategy for a player specifies an actionfor every history after which it is her turn to move, even for histories that, if thestrategy is followed are never reached.

Example4.3.3 The game depicted in Figure 4.6 models an individuals’ predica-ment in the following situation: two ladies have decided that they wanted fruit

Page 88: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

74 CHAPTER 4. GAME THEORYb����� HHHHH1buy baker r(0; 0)r����� HHHHH2strawberries herriesr r(2; 1)r���� HHHH1 ream no reamr(3; 3) r(1; 1)Figure 4.6: The Cake-game of Example 4.3.3.

cake for dessert. There are two possibilities: they either bake a cake or they buyone. At the bakery shop one can choose between strawberry andcherry cake. Forstrawberry cake there is the possibility to have whipped cream on top. They agreethat the first lady will decide on how to get the cake and, if necessary, whether atopping is wanted or not. The second lady will be picking the type of fruit cake.In this game, the first lady has four strategiesfbake; reamg, fbake; no reamg,fbuy ; reamg andfbuy ; no reamg. This means that her strategy even specifiesan action for the history(buy ; strawberries) when she decided to go for the ac-tion bake in the first place. In this sense, a strategy differs from whatwe wouldconsider to be a plan of action.Consider now the strategy profileffbuy ; reamg; herriesg. This profile pro-duces the outcome(buy ; herries) which yields a payoff 2 to the first lady and 1to the second.

For strategic games we a Nash equilibrium (see Subsection 4.2.2) as an actionprofile such that, given the other players’ actions, no player could benefit fromchanging her actions. A similar concept exists for extensive games with perfectinformation. Before defining it, let us demonstrate it first by means of an example.

Example4.3.4 Reconsider the Cake-game from Example 4.3.3 and the strategyprofile s = ffbuy ; reamg; f herriesgg. If the second lady would have knownthat the first one was thinking of having ream on top of the cake, she wouldhave chosenstrawberries instead of the herries. Sos cannot be considered asa good solution to the game. On the other hand,ffbuy ; reamg; fstrawberriesggis, because no lady can benefit from making another decision.

Definition 4.3.3 A Nash Equilibrium of an extensive game with perfect informa-tion hN;H; P; (<i)i2N i is a strategy profiles� such that for every playeri 2 N

Page 89: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4.3. EXTENSIVE GAMES WITH PERFECT INFORMATION 75

we have5 O((s��i; s�i )) <i O((s��i; si)) for every strategysi of playeri :Notice that this first solution concept for an extensive gamewith perfect informa-tion ignores the sequential structure of the game; it treatsthe strategies as choicesthat are made once and for all, before the actual game starts.Intuitively, a strategy profiles� is a Nash equilibrium if no player can unilaterallyimprove upon her choice. In other words, given the other players’ actionss��i, s�iis the best playeri can do6.

Example4.3.5 The extensive game with perfect information of Example 4.3.1 hasnine Nash equilibria:ff(2; 0)g; fy1; y2; y3; gg; ff(2; 0)g; fy1; y2; n3gg; ff(2; 0)g; fy1; n2; y3gg;ff(2; 0)g; fy1; n2; n3gg; ff(1; 1)g; fn1; y2; y3gg; ff(1; 1)g; fn1; y2; n3gg;ff(0; 2)g; fn1; n2; y3gg; ff(2; 0)g; fn1; n2; y3gg; ff(2; 0)g; fn1; n2; n3gg :Example4.3.6 The game of Example 4.3.3 has two Nash equilibria:ffbuy ; reamg; fstrawberriesgg andffbuy ; no reamg; f herriesgg :4.3.3 Subgame Perfect Equilibria

Although the Nash equilibria for an extensive game with perfect information havean intuitive definition, they have, in some situations, undesirable properties due tonot exploiting the sequential structure of the game. These undesirable propertiesare illustrated by the following examples.

Example4.3.7 Being a parent can sometimes be hard. Especially when yourchild asks for a pet. His two favorite animals are cats and spiders and you re-ally hate spiders. However, your son prefers the cat since itis more affection-ate. The game corresponding to this situation is depicted inFigure 4.7. This

5(s�i; si) is the abbreviation for the strategy profiles0 which is such thatsi = s0i andsj = s0jfor all j 2 N andj 6= i.

6Note that the strategies of the other players are not actually known toi, as the choice for astrategy has been made before the play starts. As stated before, no advantage is drawn from thesequential structure.

Page 90: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

76 CHAPTER 4. GAME THEORYb����� HHHHHParentno pet petr2; 0 rr����� HHHHHChild

cat spiderr2; 2 r0; 1Figure 4.7: The Spider Threat of Example 4.3.7 .

game has three Nash equilibriaffno petg; f atgg, ffno petg; fspidergg andffpetg; f atgg.The strategy profileffno pet ; spidergg is an unintuitive Nash equilibrium sinceit is sustained by the threat that the child would opt for the spider when a pet wasallowed. However, the child would never go for a spider (payoff 1) since a cat ismore playful (payoff 2).

A similar way of reasoning can be used on the Object-game of Example 4.3.1.

Example4.3.8 Reconsider the Object-game of Example 4.3.1. In Example 4.3.5we have seen that this game admits nine Nash equilibria. Except fromff(2; 0)g;fy1; y2; y3gg andff(1; 1)g; fn1; y2; y3gg, all these equilibria involve an action ofplayer 2 that is implausible after some history (since she rejects a proposal thatgrants her at least one of the objects).

In this subsection we introduce a new notion of equilibrium state that rules out theunintuitive equilibria we have seen in the above examples.

Above we have seen that the strategies contributing to a Nashequilibrium arechosen once and for all at the start of the game. Players are not allowed to changethem during the game. Furthermore, these strategies just have to be optimal asfar as the outcome is concerned. The definition does not tell us anything aboutthe choices during the game. For our new equilibrium we require, instead of justdemanding that the strategy profile is optimal, that the strategy is optimal afterevery history. In order to do so, we introduce the notion of a subgame.

Definition 4.3.4 A subgameof the extensive game with� = hN;H; P; (<i)i2Nithat follows the historyh is the extensive game�(h) = hN;Hjh; P jh; (4i jh)ii,whereHjh is the set of sequencesh0 of actions for which(h; h0) 2 H, P jh isdefined byP jh(h0) = P ((h; h0)) for eachh0 2 Hjh, and4i jh is defined byh0 4i jhh00 iff (h; h0) 4i (h; h00) .

Page 91: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4.3. EXTENSIVE GAMES WITH PERFECT INFORMATION 77

The notion of equilibrium that we are about to define requiresthat the actions pre-scribed by each player’s strategy are optimal, given the other player’s strategies,and this aftereveryhistory. Given a strategysi of playeri and a historyh in theextensive game�, sijh denotes the strategy thatsi induces in the subgame�(h)(i.e. sijh(h0) = si((h; h0))). We will useOh to denote the outcome function of�(h).Definition 4.3.5 A subgame perfect equilibriumof an extensive game with per-fect information� = hN;H; P; (<i)i2Ni is a strategy profiles� such that for everyplayer i 2 N and every non-terminal historyh 2 H n Z for whichP (h) = i wehave: Oh(s��ijh; s�i jh) <i jhOh((s��ijh; sijh)for every strategysi of playeri in the subgame�(h) .

Equivalently, we can say that a subgame perfect equilibriumneeds to be a Nashequilibrium in every subgame.Because subgames start from the bottom of the tree and then work themselves upto the top, this mechanism is often called backward induction. Every subgamecan be seen as that part of a game that is still uncertain or as the future. The partabove this subgame is common knowledge to all players, sincewe are dealingwith an extensive game with perfect information. So these decisions are alreadya thing of the past. The player that has to make a decision at the bottom of thegame tree does not have to make any assumption about the behavior of the otherplayers. Thus, she only has to worry about her own benefit. Theplayer who madethe previous decision can anticipate this choice and can take it into account. Thisprocess works its way back to the top.Another way of looking at this is that the players revise their strategy after everychoice made by any other player.

The notion of subgame perfect equilibrium eliminates Nash equilibria in whichthe players’ threats are not credible. This will be demonstrated in the followingexamples.

Example4.3.9 Reconsider the game of Example 4.3.7. When we look at the sub-game perfect equilibria of this game, we see thatffpetg; f atg andffno petg;f atg are the only ones. The unintuitive Nash equilibriumffno petg; fspidergis no longer accepted

Page 92: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

78 CHAPTER 4. GAME THEORY

Example4.3.10 Reconsider the Object-game from Example 4.3.7. From its nineNash equilibria, we have thatff(2; 0); fy1y2y3gg andff(1; 1)g; fn1y2y3gg cor-respond with the subgame perfect equilibria of the game. Allother Nash equilibriaare based on implausible threats.

Example4.3.11 The Cake-game of Example 4.3.3 admits only one subgame per-fect equilibrium:ffbuy; reamg; fstrawberriesgg .

Looking back at the examples we see that every subgame perfect equilibrium isalso a Nash equilibrium. This should not come as a big surprise since a subgameperfect equilibrium needs to be a Nash equilibrium for everysubgame. This meansthat it also has to be a Nash equilibrium of the total game.

Theorem 4.3.1 ([OR96]) Let� = hN;H; P; (<i)i2N i be an extensive game withperfect information. Then, every subgame perfect equilibrium for� is also a Nashequilibrium.

To identify a subgame perfect equilibrium, Definition 4.3.5requires that, for everyplayer i and every subgame, we check that there is no strategy that leads to anoutcome that playeri prefers. The following result shows we can restrict ourattention, for each playeri and each subgame, to alternative strategies that differfrom s�i in the actions they prescribe after justonehistory. Specifically, a strategyprofile is a subgame perfect equilibrium if and only if for each subgame the playerwho makes the first move cannot obtain a better outcome by changing only herinitial action.

Theorem 4.3.2 ([OR96]) Let� = hN;H; P; (<i)i2N i be an extensive game withperfect information. The strategy profiles� is a subgame perfect equilibrium ifffor every playeri 2 N and every historyh 2 H for whichP (h) = i we haveOh(s��ijh) <i Oh(s��ijh; si)for every strategysi of playeri in the subgame�(h) that differs froms�i jh only inthe action it prescribes after the initial history of�(h) .

This theorem is often referred to as the “one deviation”-property.

In the section about strategic games we have seen that some ofthese games donot admit a Nash equilibrium. The situation is different forfinite extensive gameswith perfect information as the following theorem demonstrates.

Page 93: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4.3. EXTENSIVE GAMES WITH PERFECT INFORMATION 79

Theorem 4.3.3 ([OR96]) Every finite extensive game with perfect informationhas a subgame perfect equilibrium.

This result is also known as Kuhn’s theorem.

Before ending this section, we would like to briefly place twoextensions of ex-tensive games with perfect information into the spotlights.

For the first type we add uncertainty. An extensive game with perfect informationand chance moves is a tuplehN;H; P; f ; (<i)i where N is a finite set of players,H is a set of histories andP is a function from non-terminal histories inH toN [f g (If P (h) = thenchancedetermines the action taken after the historyh).Furthermore, for eachh 2 H with P (h) = , f (:jh) is a probability distributiononA(h); each such probability distribution is assumed to be independent of everysuch measure.f (ajh) is the probability thata occurs after the historyh. For eachplayeri 2 N , <i is a preference relation on lotteries over the set of terminal his-tories. For these type of games it can be shown that the “one-deviation” propertyand Kuhn’s theorem remain valid.

The second extension allows players to move simultaneouslyafter certain his-tories, each of them fully informed of all the past events when making theirchoice. To allow for this, we just need minor adaptations to the definition ofextensive games with perfect information. In this case we will have a tuplehN;H; P; (<i)i2N i whereN , H, and4i for eachi 2 N remain the same.Pis a function that assigns to each non-terminal history a setof players, andH andP jointly satisfy the condition that for every non-terminal historyh there is a col-lectionfAi(h)gi2P (h) of sets for whichA(h) = fa : (h; a) 2 Hg = �i2P (h)Ai(h).A history in such a game is a sequence of vectors; the components of each vectorare the actions taken by the players whose turn it is to move. The choices of theplayers inP (h) are considered to be simultaneous. The definition of a subgameperfect equilibrium is the same as Definition 4.3.5 except for i 2 P (h) insteadof P (h) = i. The “one-deviation”-property remains valid for extensive gameswith perfect information and simultaneous moves but Kuhn’stheorem does not.The invalidation of the latter is easy to understand since strategic games are aspecial case of this type of extensive games with perfect information. Take thecoin-tossing game for example (Example 4.2.5). This game does not admit anyNash equilibrium, so it cannot have a subgame perfect equilibrium due to Theo-rem 4.3.3.

Page 94: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

80 CHAPTER 4. GAME THEORY

4.4 Game Theory and Logic

In previous sections we introduced the basic notions of gametheory. In the con-tinuation of this dissertation we will link these concepts to logic programming.In this section we have a closer look at the interaction between logic and gametheory.

This interaction can be viewed in two ways: logic games and game logics. Theformer uses games for the purpose of logic, while the latter deals with logic insidegame theory. A detailed description of both research streams can be found in [vB].Our research, which will be presented in the following chapters, is situated in thecategory of game logics. For this reason we will give a selective overview of logicgames wand discuss game logic in more detail.

4.4.1 Logic Games

When we think of logic, we always consider formulas and theirtruth-values. Mostof the time we are busy trying to derive a certain formula froma set of otherformulas or to verify whether a formula is a logic consequence. This way ofreasoning reflects the two common stances in logic: proof-theoretic and model-theoretic. Game theory provides a new stance by consideringvalidity in terms ofwinning strategies for arguments. This new twist in logic highlights two centralfeatures of reasoning, namely its dynamic character as a process over time and itssocial character as an activity involving several agents indifferent roles ([vB]).Within standard logic, the game based view provides an interesting second look atestablished areas. This view provides new uniformities across apparently differentnotions as proofs, models or analogies between situations.[vB88, HS97, Bla92,Abr92, AO93, VP00] are just a few papers that demonstrate theusefulness of thisnew approach.

4.4.2 Game Logic

When we previously introduced strategic games and extensive games with perfectinformation, we also had to define in which way such a game is played. So everygame comes with a number of rules on how the game can be played.Such rulescan be easily represented in logic. Players in a game need to take the possibleactions of the other players into account, so they need to make some assumptions

Page 95: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

4.4. GAME THEORY AND LOGIC 81

about their opponents’ knowledge. Epistemic and model logic incorporate knowl-edge operators into their language. Given these reflections, it is not surprisingthat a logical stance on games has been introduced. In some cases new languageswere introduced to study the logical structure of games. Thedynamic game logicof Parikh ([Par85]) and linear game logic of Blass and Abramsky ([Bla92, Abr92])are two examples of this. When we look at more general purposelogics, we noticethat the logical foundations of game theory have been studied for a long time inthe confines of epistemic logic, see [BB] for a good overview.[Bon98, Bon92]are two examples of this.

However, to the best of our knowledge, very little research has been conductedusing logic programming-like formalisms to model game-theoretic concepts. Thesystems of [Dun95] and [Poo97] are two important exceptions.

[Dun95] develops a theory of argumentation whose central notion is the accep-tability of arguments. An argumentation framework is a pairconsisting of a setof arguments and a binary relation on this set that defines the, so-called, attackrelationship between arguments. A set of arguments is said to be conflict-free ifthere is no element in this set that attacks an other element of this set. A conflict-free set of arguments is called a stable extension when the set attacks each ele-ment that does not belong to the set. It can be shown that the “von Neumannand Morgenstern”-solutions ([VNM44]) of a cooperative n-person game corres-pond with the stable extensions of the argumentation framework formed by theimputations of the game and the dominates relation. An imputation is the payoffdistributed among the agents. An imputation is said to dominate an other impu-tation if, although the single payoffs are perhaps higher inthe former, a group ofagents can obtain a better result if they work together according to the latter im-putation. A set of imputations is called a solution of the game if no imputation ofthe set is dominated by another imputation of this set and theset dominates everyimputation which is not part of the solution.[Dun95] defines a mapping from argumentation frameworks to logic programssuch that the stable extensions of the former correspond with the stable models ofthe latter. This implies that cooperative n-person games can be mapped to logicprograms such that the solutions correspond with the stablemodels of the pro-gram.

[Poo97] introduces a formalism called “Independent ChoiceLogic” (ICL) whichuses (acyclic) logic programs to deterministically model theconsequencesof choi-ces made by agents. Since choices are external to the logic program, [Poo97]

Page 96: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

82 CHAPTER 4. GAME THEORY

restricts to deterministic programs: each choice leads to aunique stable modelFurthermore his programs have to be independent: literals representing alterna-tives may not influence each other (e.g. they may not appear inthe head of rules)ICL is further extended to reconstruct much of classical game theory and otherrelated fields. However, in order to do so [Poo97] puts game theoretic constructson top of his language. This means that he needs to go out of therealm of logicprogramming to retrieve equilibrium states.

4.5 Conclusions

In this chapter we introduced the basic notions of Game Theory. First we definedstrategic games: a model of strategic interaction where allparticipants simul-taneously decide on their action. Each of these players willmake assumptionsconcerning the behavior of the others. Each decision-makeris considered to be-have rationally and to be concerned only about her own benefit. For this type ofgame we proposed two equilibria: Nash equilibria and subgame perfect equilibria.The former is the more traditional one and allows players to decide on a single ac-tion. In the latter equilibria, players can opt for assigning a probability distributionon the available actions. For both types of equilibria, no player can improve bydiverting from the equilibrium state, given the actions of the other players. After-wards, we introduced extensive games with perfect information which allowed usto represent a sequence of decisions in which players have full knowledge aboutwhat previously happened in the game. For this type of games we defined Nashequilibria, but in a number of situations they do not provideus with very intuitivesteady states. To eliminate these unfavorable ones, subgame perfect equilibriawere proposed. Instead of demanding that the decisions simply make the out-come optimal, we now request that every decision is optimal.This is establishedby means of subgames. To end this chapter, we gave a brief overview on the rela-tion between game theory and logic. In the following three chapters we will seefour logic programming formalisms that allow us to reason about games.

Page 97: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Chapter 5

Choice Logic Programming

In this chapter we will introduce our basic logic programming formalism, choicelogic programming, which will be used and extended throughout the rest of thisdissertation.

5.1 Introduction

When modeling agents using logic programs, one often has to describe situa-tions where an agent needs to make a decision, based on some context. The sta-ble model semantics1 ([GL88]) can be regarded as introducing non-determinisminto logic programs, as has been convincingly argued in [SZ90, Sac97]. Thus,using semi-negative (also called “normal”) programs, decision-making, and withit choice, can be modeled indirectly using the stable model semantics.

To demonstrate this, consider the following example.

Example5.1.1 In the bush a freshly killed carcass is found2. Who will devour it,the foraging lions or the scavenging hyaenas? This situation could be modeledlike this: lions not hyaenashyaenas not lions

1See Section 3.3 for detailed information.2Most of the examples in this chapter come from personal experience. More information about

African animals can be found in [SS97].

83

Page 98: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

84 CHAPTER 5. CHOICE LOGIC PROGRAMMING

This program has no (unique) total well-founded model (e.g.[GRS91]) but it hastwo total stable models, namely:flions; not hyaenasg andfhyaenas; not lionsg ;representing achoicebetweenlions andhyaenas (note that this choice is, how-ever, not exclusive, as e.g.lions may very well lead tohyaenas in a larger pro-gram, which would lead to an impossible situation).

This non-determinism may not show up in the actual models, asin the program:lions not hyenashyenas not lionslions killkill Here we have learned that the lions actually killed the animal, yielding them to-day’s feast. This is reflected inflions; not hyaenasg being the only acceptablechoice (the other alternative leads to contradiction).

In this chapter, we simplify matters by providing an explicit choice construct in thehead of rules, enabling explicit context-based decisions.Using lions � hyaenasto denote a choice betweenlions andhyaenas, the first program of Example 5.1.1can be rewritten as:

Example5.1.2 lions � hyaenas The second program is similar except from the added positiverules.

Intuitively,� is interpreted as “exclusive or”, i.e. eitherlions or hyaenas, but notboth, should be accepted in the above programs.

It turns out that thesechoice logic programs([DVV99a, DVV99b, DVV01d]),which do not allow negation in the body (nor in the head), can meaningfully sim-ulate arbitrary semi-negative logic programs, at least as far as their (total) stablemodel semantics is concerned. The converse is also valid, therefore, we can con-clude that, in a sense, choice is equivalent to negation. This hidden appearance ofnegation can be used to our advantage in the search for stablemodels. The means

Page 99: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.1. INTRODUCTION 85

for this are supplied by the notion of unfounded sets: sets ofatoms or alternativesthat are unnecessary for making the correct decisions. In other words, they areconsidered as unsuitable candidates. With the help of thesesets of superfluousatoms, we are able to provide a fixpoint-semantics and a bottom-up algorithm forstable models. These can also be put to work in the detection of stable models.

Providing explicit choice as the conclusion of a rule allowsfor the natural expres-sion of several interesting problems. In this chapter, we show e.g. that strate-gic games[OR96] can be conveniently represented using choice logic programs.Moreover, the stable models of such a program exactly characterize the Nash equi-libria of the game.

The rest of this chapter is organized as follows. In Section 5.2 we introduce choicelogic programming and its stable model semantics. The main result of this sectionis the proof of equivalence between the stable model semantics and the minimalmodel semantics (Theorem 5.2.1).

Section 5.3 is dedicated to the relation between choice logic programs and semi-negative logic programs, with respect to their stable modelsemantics. First, weshow a general transformation exists such that the stable models of the latter co-incide with the rational stable models of the former (Theorem 5.3.1). Next, weprove that for a certain class of semi-negative logic programs, namely the positive-acyclic programs, the rationality requirement can be dropped (Theorem 5.3.2).The existence of a transformation from choice logic programs to semi-negativelogic programs that preserves stable models is guaranteed by Theorem 5.3.3.

The other aspect of the hidden negation in choice logic programs is the maintheme of Section 5.4, where we investigate the different properties of unfoun-ded sets with respect to the stable model semantics of choicelogic programs.In Subsection 5.4.1, we introduce our version of unfounded sets which, unlikewith unfounded sets for logic programs, are able to handle constraints in pro-grams. In Subsection 5.4.2, we supply a fixpoint-operator for the greatest un-founded set (Theorem 5.4.8) and a necessary and sufficient tool for checking theunfounded-free property (Theorem 5.4.7). Subsection 5.4.3 characterizes stablemodels using unfounded sets (Theorem 5.4.11). Subsection 5.4.4 offers a fixpointcharacterization (Theorem 5.4.13) and the unique startingpoint for the bottom-upcomputation of the stable models (Theorem 5.4.14), which isfurther developed inSubsection 5.4.5.

In Section 5.5 we consider applications of choice logic programs. We focus ongame theory, specifically on strategic games. We establish asimple and intuitive

Page 100: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

86 CHAPTER 5. CHOICE LOGIC PROGRAMMING

translation of strategic games using choice logic programssuch that the Nashequilibria of the games coincide with the stable models of the program.

We end this chapter a section on the relationships with otherapproaches (Sec-tion 5.6), and a section with conclusions (Section 5.7).

5.2 Choice Logic Programs

Just as for semi-negative logic programs we have that aliteral is either an atomp or a negated atomnot p. The literalsp andnot p are each other’scomplement.Wherel is any literal, we denote its complement bynot l. This notation is ex-tended to sets so that for a setX of literals,not X denotesfnot l j l 2 Xg. A setof literalsX is said to beconsistentif X \ not X = ;.Definition 5.2.1 A choice logic program, or CLP for short, is a countable3 set ofrules of the formA B whereA andB are finite sets of atoms.

Intuitively, atoms inA are assumed to be xor’ed together whileB is read as aconjunction. The setA is called theheadof the rule, denotedHr , while the setBis called thebody, denotedBr. If Hr is empty,r is called aconstraint.In examples, we often use ’�’ to denote exclusive or, while ‘;’ is used to denoteconjunction.

Example5.2.1 (Eternal Enemies)One day two eternal enemies, the lions andthe hyaenas, meet on the African plains. Today’s cause of argument is a juicypiece of meat. Both the lions and the hyaenas are keen on devouring it. To obtaintheir share there are two possibilities: they can either divide the piece among themembers of both groups or they can fight for it with the risk of getting injured.Knowing the other group’s temper it is always best to attack:either both partiesare willing to fight or the peace-loving group will be chased away. However, bothparties know that they get the most meat without any risk if they are both willingto share. Despite this, no pride is willing to take the risk oflosing out on this freelunch. The following simple choice logic program models this eternal feud.

3We assume that all rules are grounded; i.e. any rule containing variables has been replacedwith all its ground instances. Allowing for countable infinite programs supports this assumptionin the case where the Herbrand universe is infinite.

Page 101: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.2. CHOICE LOGIC PROGRAMS 87share lions � �ght lions sharehyaenas � �ghthyaenas �ght lions sharehyaenas�ght lions �ghthyaenas�ghthyaenas share lions�ghthyaenas �ght lionsThe set of all atoms appearing in a programP is called theHerbrand base, de-notedBP . The interpretations of the program indicate which atoms are assumedto be true, false or unknown in the current context.

Definition 5.2.2 LetP be a CLP. A(partial) interpretationofP is any consistentsubset ofBP [ not BP . The set of all interpretations ofP is denoted byIP .

For a partial interpretationI of P , we useI+ to denote its positive part, i.e.I+ = I \BP . Similarly, we useI� to denote the negative part ofI, i.e. I� = fa jnot a 2 Ig4. The undefined partIo of P is defined asIo = BP n (I+ [ I�).An interpretationI is total iff I+ [ I� = BP .

Thepositive complementof an interpretationI, denotedI, equalsBP n I+.

Given an interpretation we say that an atoma is true (falseor unknown) if a 2 I+(a 2 I� or a 2 Io, respectively). When it is clear from the context that we areworking with total interpretations, we will omit the negative part, as it can easilybe derived from the positive one.

The following definition shows that the head of a rule is to be interpreted as anexclusive choice between alternatives.

Definition 5.2.3 Let I be an interpretation for a CLPP . A ruler 2 P is said tobeapplicablew.r.t. I iff Br � I.An applicable ruler 2 P is appliedw.r.t. whenjHr \ Ij = 1.I is deductively closediff all rules are either not applicable or applied.

Models and minimal models for choice logic programs are defined in the usualway.

4Note thatI� � BP .

Page 102: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

88 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Definition 5.2.4 LetP be a CLP. A total deductively closed interpretation forPis called amodelofP . A modelM is calledminimal iff M+ is minimal accordingto set inclusion, i.e. no modelN of P exists such thatN+ �M+.

Most logic programming paradigms have some kind of stable model semanticswhich is based on a variant of the Gelfond-Lifschitz transformation.

Definition 5.2.5 LetP be a CLP and letI be an interpretation for it. TheGelfond-Lifschitz transformationfrom P w.r.t. I is the positive logic programP I , con-taining constraints, obtained fromP in the following way:� remove all false atoms from the head of each ruler with more than one head

atom; and� replace all rulesr wherejHrj > 1 (after deletion) with the following con-straint: Br; Hr :

Just as the original definition for logic programs with negation as failure (see Defi-nition 3.3.8 on page 26), we have that stable models are the total interpretationswhich are minimal models for their Gelfond Lifschitz transformation.

Definition 5.2.6 Let M be a total interpretation for a CLPP . M is a stablemodelfor P iff M is a minimal model forPM .

The Gelfond-Lifschitz transformation transforms every choice rule into a a rulewith at most one head atom. To make sure that this positive program can onlyforce atoms that are considered true by the interpretation,we delete all false atomsfrom the head of the choice rules. When none of the atoms are true, we obtaina constraint. The programP I can now only produce a model when the bodyof this constraint is false or, in other words, when there is no choice triggeredby the original rule. When, after the deletion of false atoms, we still obtain achoice rule, we have to make sure that the transformed program cannot acceptboth the body of this rule and the true atoms as part of a (minimal) model. Tomake this impossible, we replace the rule by a constraint containing the body andall true head atoms. Since the Gelfond-Lifschitz transformation is only used toverify whether an interpretation is a stable model or not, wedo not need a set

Page 103: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.2. CHOICE LOGIC PROGRAMS 89

of constraints containing every combination of two true head atoms. Even ifP Iadmits a minimal model it will not contain all true head atomsof this rule, sincethis would invalidate the constructed constraint.

Choice logic programs are useful in various domains, as illustrated in the follo-wing examples. The first example is inspired by Game Theory.

Example5.2.2 (Eternal Enemies Continued)The program from Example 5.2.1has one stable model f�ght lions ; �ghthyaenasg ;which explains why the two species remain enemies: neither wants to give sharinga try as they fear that the other will take advantage by attacking.This example is a variation on the famous prisoner’s dilemma(e.g. Example 4.2.2on page 4.2.2).

Example5.2.3 (Graph 3-colorability) Given the graph depicted in Figure 5.1,assign each node one of three colors such that no two adjacentnodes have thesame color. This problem is know as graph 3-colorability andcan be easily trans-eb d

a Figure 5.1: Example graph which is 3-colorable.

Page 104: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

90 CHAPTER 5. CHOICE LOGIC PROGRAMMING

formed in the following choice program5: olor (X; b)� olor (X; y)� olor (X; r) node(X) edge(X;Y ); olor (X;C); olor (Y;C)node(a) node(b) node( ) node(d) node(e) edge(a; b) edge(a; ) edge(a; d) edge(b; ) edge(b; e) edge( ; d) edge(d; e) The first rule states that every node should have one and only one of the threeavailable colors: black, yellow and red. The second demandsthat two adjacentnodes have different colors. The other rules are facts describing the graph ofFigure 5.1. The stable models for this program reflect the possible solutions forthis graph’s 3-colorability:N1 = G [ f olor(a; r); olor(b; y); olor( ; b); olor(d; y); olor(e; r)g ;N2 = G [ f olor(a; r); olor(b; y); olor( ; b); olor(d; y); olor(e; b)g ;N3 = G [ f olor(a; r); olor(b; b); olor( ; b); olor(d; b); olor(e; r)g ;N4 = G [ f olor(a; r); olor(b; b); olor( ; y); olor(d; b); olor(e; y)g ;N5 = G [ f olor(a; y); olor(b; b); olor( ; r); olor(d; b); olor(e; r)g ;N6 = G [ f olor(a; y); olor(b; r); olor( ; b); olor(d; r); olor(e; b)g ;N7 = G [ f olor(a; y); olor(b; r); olor( ; b); olor(d; r); olor(e; y)g ;N8 = G [ f olor(a; y); olor(b; b); olor( ; r); olor(d; b); olor(e; y)g ;N9 = G [ f olor(a; b); olor(b; y); olor( ; r); olor(d; y); olor(e; r)g ;N10 = G [ f olor(a; b); olor(b; y); olor( ; r); olor(d; y); olor(e; r)g ;N11 = G [ f olor(a; b); olor(b; r); olor( ; y); olor(d; r); olor(e; y)g ;N12 = G [ f olor(a; b); olor(b; r); olor( ; y); olor(d; r); olor(e; b)g ;

5To keep the program more concise, we have used variables in the program.

Page 105: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.2. CHOICE LOGIC PROGRAMS 91

whereG stands for the atoms building up the graph:G = fnode(a); node(b); node( ); node(d); node(e); edge(a; b);edge(a; ); edge(a; d); edge(b; ); edge(b; e); edge( ; d); edge(d; e)g :Example5.2.4 (The Albert Einstein Riddle) Consider the following riddle6:

There are five houses painted in five different colors. In eachhouse, a person witha different nationality lives. The owners drink a certain beverage, smoke a certainbrand of cigarettes and keep a certain pet. No owner has the same pet, prefers thesame drink or smokes the same brand. Question: Who owns the fish?Hints:� The Brit lives in the red house.� The Swede keeps a dog.� The Dane drinks tea.� The green house is on the left of the white house.� The green house’s owner drinks coffee.� The person who smokes Pall Mall rears birds.� The owner of the yellow house smokes Dunhill.� The man living in the house right in the center drinks milk.� The Norwegian lives in the first house.� The man who smokes Blend lives next to the one who has cats.� The man who has horses lives next to the Dunhill smoker.� The owner who smokes Bluemaster drinks beer.� The German smokes Princess.� The Norwegian lives next to the blue house.� The man who smokes Blend has a neighbour who drinks water.

6Rumor is that Albert Einstein invented this riddle.

Page 106: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

92 CHAPTER 5. CHOICE LOGIC PROGRAMMING

The corresponding choice logic program equals:houses(1) houses(2) houses(3) houses(4) houses(5) h(N; red)� h(N;wh)� h(N; gr)� h(N; ye)� h(N; bl) houses(N)n(N; br)� n(N; sw)� n(N; no)� n(N; da)� n(N; ge) houses(N)a(N; dog)� a(N; bi)� a(N; a)� a(N; ho)� a(N; �) houses(N)b(N; tea)� b(N; o)� b(N;mi)� b(N; be)� b(N;wa) houses(N) (N; pm)� (N; bl)� (N; bm)� (N; du)� (N; pr) houses(N) h(S;H); h(T;H); T 6= S b(S;B); b(T;B); T 6= S (S;C); (T; C); T 6= S n(S;N); n(T;N); T 6= S a(S;A); a(T;A); T 6= Sn(O; br) h(O; red)n(O; sw) a(O; dog)n(O; da) b(O; tea)h(G; gr) h(W;wh); G = W � 1h(O; gr) b(O; o)a(O; bi) (O; pm)h(O; ye) (O; du)b(3;mi) n(1; no) a(O1; a)� a(O2; a) (O; bl); O1 = O + 1; O2 = O � 1a(O1; ho)� a(O2; ho) (O; du); O1 = O + 1; O2 = O � 1b(O; be) (O; bm)n(O; ge) (O; pr)n(O1; no)� n(O2; no) h(O; bl); O1 = O + 1; O2 = O � 1 (O1; bl)� (O2; bl) b(O;wa); O1 = O + 1; O2 = O � 1The solution to this riddle is:

Page 107: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.2. CHOICE LOGIC PROGRAMS 93

number color nationality pet beverage cigarettes1 yellow Norwegian cats water Dunhill2 blue Dane horses tea Blend3 red Brit birds milk Pall Mall4 green German fish coffee Princess5 white Swede dog beer Bluemaster

This coincides exactly with the unique stable modelM of the above choice logicprogram:M = fh(1; ye); n(1; no); a(1; a); b(1;wa); (1; du)h(2; bl); n(2; da); a(2; ho); b(2; tea); (2; bl)h(3; red); n(3; br); a(3; bi); b(3;mi); (3; pm)h(4; gr); n(4; ge); a(4; �); b(4; o); (4; pr)h(5;wh); n(5; sw); a(5; dog); b(5; be); (5; bm);houses(1); houses(2); houses(3); houses(4); houses(5)g :For choice logic programs, stable models and minimal modelscoincide.

Theorem 5.2.1 LetM be a total interpretation for a CLPP . M is a stable modelfor P iff M is a minimal model forP .

Proof: ): Let M be a stable model forP . This implies thatM is a minimalmodel forPM . We will first prove thatM is a model forP , i.e. for every ruler 2 P with Br �M holds thatjHr \M j = 1. Let r be such thatBr �M . Thereare three possibilities:

1. jHr \M j > 1: LetHr \M = S with jSj > 1. Thus, by construction,PMcontains a rule Br; S 2 PM . SinceS [Br �M , this contradicts thatMis a model ofPM .

2. jHr \M j = 0. In this case there are two possibilities that depend on thenumber of elements in the head. In caseHr contains more than one atom,we have, with the Gelfond-Lifschitz transformation, that aconstraint inPMexists which is not satisfied byM . If jHrj � 1, Hr Br is not satisfied inPM , which contradicts thatM is a model ofPM .

3. jHr \M j = 1 and thusr is satisfied byM .

Page 108: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

94 CHAPTER 5. CHOICE LOGIC PROGRAMMING

So we can conclude thatM is indeed a model ofP .It remains to be proven thatM is minimal. We will demonstrate this by showingthat every total interpretationN , with N � M , cannot be a model ofP . Givensuch an arbitraryN , we have thatN is not a model ofPM , sinceM is minimalfor this program, which implies that a rule remains unsatisfied. This cannot be aconstraint, since any constraint C satisfied byM is also satisfied by any suchN . So the unsatisfied rule must be a rule with a non-empty head. Such rules inPM come from rulesr 2 P with jHr \M j = 1 or jHrj = 1. N does not satisfiessuch rulesr asBr � N andHr \ N = ;. ThusN is not a model ofP andM isminimal.(: Let M be a minimal model forP . We will demonstrate thatM is a stablemodel forP . First we will prove thatM is a model ofPM . SinceM is a modelfor P we know for each ruler eitherBr * M or jHr \ M j = 1. Becauseconstraints inPM are either copied fromP or created from rulesr0 2 P withjHr0 \M j 6= 1, we have thatBr0 * M and thus these constraints are satisfied inPM . This yields that we have to consider only rules with non-empty head inPM .We need to show that if for such a ruler holds thatBr � M , then we must alsohaveHr 2M . This ruler originates from a ruler0 2 P with Br0 = Br. SinceMis a model forP , we have thatjHr0 \M j = 1, withHr = Hr0 \M . So the ruleris satisfied, which implies thatM is a model forPM .

Now, it remains to be proven thatM is also a minimal model forPM . This meansthat we have to demonstrate that no total interpretationN with N � M standsa chance to be a model forPM . Let N be an arbitrary total interpretation suchthatN � M . BecauseM is a minimal model forP , we know thatN cannot bea model forP . This implies that a ruler 2 P exists such thatBr � N whilejHr \ N j 6= 1. We can already be certain thatr is not a constraint sinceN � MandBr contains only atoms. BecauseBr � N andN � M , we know thatBr � M . SinceM is a model forP , this yieldsjHr \M j = 1. This allows usto conclude thatjHr \N j = 0. Applying the Gelfond-Lifschitz transformation tothis rule, we obtaina Br 2 PM , with fag = Hr \M . For the interpretationN , we know thatBr � N while a =2 N , which immediately implies thatN cannever be a model forPM .Therefore, we can conclude thatM has to be a minimal model forPM . Thisyields, with Definition 5.2.6, thatM is a stable model forP . 2

Page 109: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.3. SIMULATING SEMI-NEGATIVE LOGIC PROGRAMS 95

5.3 Simulating Semi-Negative Logic Programs

While negation is not explicitly present in choice logic programs, it does appearimplicitly. E.g. deciding ona in a rulea� b implicitly excludesb from anymodel; which can be read as “not b is true”. A similar effect can be observed forconstraints: if e.g.a is true, then the presence of a rule a; b implies thatb mustbe false.Still, there is a difference with semi-negative programs7 because, although im-plicitly implied negative information may prevent the further application of cer-tain rules, such information can never be used toenablethe inference of furtheratoms. The latter is possible e.g. in semi-negative logic programs or disjunc-tive logic programs where the body of a rule may contain negated atoms. Hencechoice logic programs can be regarded as an interesting intermediate system inbetween purely positive logic programs, where a model can becomputed withouttaking into account any negative information8 and semi-negative logic programsthat do allow negation as failure in the bodies of their rules. To obtain a betterunderstanding of the similarities and differences betweenboth types of programs,we investigate in this section the relationship between thestable model semanticsof normal semi-negative logic programs and the stable modelsemantics of choicelogic programs.

We start with a transformation from normal logic programs tochoice logic pro-grams. The proposed transformation resembles the one used in [SI94] for thetransformation of general disjunctive programs into negation-free disjunctive pro-grams.

Definition 5.3.1 Let P be a semi-negative logic program. The correspondingCLP P� is obtained fromP by replacing each ruler : a B; not C from P ,whereB [ C � BP andC 6= ;, byar �KC B (r01)a ar (r02)8 2 C �KC (r03)

7We use the term semi-negative programs to express the possible use of of negation as failurein the body of rules while classical negation is not allowed.

8Of course, as a last step, the complement of the positive interpretation can be declared falseas a consequence of the closed world assumption.

Page 110: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

96 CHAPTER 5. CHOICE LOGIC PROGRAMMING

and each constraintr : B; not C fromP , withB [ C � BP andC 6= ;, byKC B (r04)8 2 C �KC (r03)wherear andKC are new atoms that are uniquely associated with the ruler.Intuitively,KC is an “epistemic” atom which stands for “the (non-exclusive) dis-junction of atoms fromC is believed”. If the positive part of a rule in the originalprogramP is true,P� will choose (ruler01) between accepting the conclusionandKC , whereC is the negative part of the body. Deciding onKC prevents ruleapplication (inP ). Each conclusion is tagged with the corresponding rule (r02), sothat rules with the same conclusion can be processed independently. Finally, thetruth of any member ofC implies the truth ofKC (rule r03); expressing that theconjunction of literals innot C can no longer be assumed.

Definition 5.3.2 Let P be a semi-negative logic program and letP� be the cor-responding CLP. An interpretationI for P� is calledrational iff:8KC 2 I � I \ C 6= ; :Intuitively, a rational interpretation contains a justification for every acceptedKC .

Theorem 5.3.1 Let P be a semi-negative program and letP� be its correspon-ding CLP according to Definition 5.3.1.M is a rational stable model ofP� iffM \ BP is a stable model ofP .

Proof: Thanks to Theorem 5.2.1, we can, without any problems, interchange thenotions of minimal and stable models for choice logic programs. To show the “if”part, letM be a stable model ofP . We construct the total interpretationM� as:M� = M [ fKC j 9r 2 P : a B; not C or B; not C �M \ C 6= ;g[ far j 9r 2 P : a B; not C �B �M ^ C \M = ;g :Clearly,M = M� \ BP . It remains to be shown thatM� is a rational stablemodel ofP�. Following Theorem 5.2.1, this implies thatM� has to be a rationalminimal model ofP�.We will start with the rational part. This follows automatically from the creation

Page 111: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.3. SIMULATING SEMI-NEGATIVE LOGIC PROGRAMS 97

of M�: KC 2M� iff 9r 2 P : a B; not C or B; not C �M \C 6= ;. Dueto that same creation ofM�, it holds thatM � M�. This implies that:8KC 2 M� �M� \ C 6= ; ;which makes, by Definition 5.3.2, thatM� is rational.We continue by showing thatM� is a model ofP�. This implies that all rulesand constraints need to be satisfied. Constraints cause no troubles as they are alsoincluded inP . M is a stable model ofP and by that a model ofP . Combiningthis with M� \ BP = M and the knowledge that the constraints only containatoms fromBP , we can conclude that constraints inP� are satisfied byM�. Sothe only rules that still need to be considered are the ones with a non-empty head.According to definitions 5.2.3 and 5.2.6, we need to prove that:8r0 2 P� : Br0 2M� � jM� \Hr0j = 1 :BecauseM is a stable model ofP , it is also a model for it. This means that forevery ruler : a B; not C 2 P one of the following conditions is satisfied:

1. B *M , or

2. C \M 6= ;, or

3. a 2M .

In caser is a positive rule or constraint, we know, by Definition 5.3.1, thatr = r0which automatically satisfiesr0. This becauseM is a model ofP andr containsonly elements ofBP .Let us now consider the different types of rules created by the transformationof Definition 5.3.1. We start with rules of typer01. In case the first condition isfulfilled, we have thatr01 is satisfied, sinceB � BP andB *M = M�\BP implyB * M�. When the second condition holds, we also have thatr01 is satisfied: thecreation ofM� guarantees in this case thatKC 2 M� and ar =2 M� whichmakesjfar; KCg \ M�j = 1 . When both the first and second conditions failwe have, by the creation ofM�, thatKC =2 M� andar 2 M�. So, once more,jfar; KCg \M�j = 1.Rules of typer02 are always satisfied because of the combination ofM being amodel and the creation ofM� which makes thatar 2M� whenevera 2M�.The same can be said for rules of typer03. BecauseKC 2 M� when9 2 C � 2

Page 112: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

98 CHAPTER 5. CHOICE LOGIC PROGRAMMINGM , we have that the ruleKC is satisfied. The others are automaticallyfulfilled.The rules of typer04 are the last we have to verify. For these rules it sufficesto demonstrate thatKC is an element ofM� wheneverB � M . According toDefinition 5.3.1, these rules are created out of constraintswith negative literals inthe body. This implies that the third condition for a model ofP is never fulfilled.Combing this information withM = M� \ BP , yields that the second conditionhas to be satisfied. The creation ofM� allows us to conclude thatKC 2M�.Thus we can conclude thatM� is a model ofP�.So it remains to be shown thatM� is minimal. To obtain this, we have to provethat each total interpretationN� � M� for P� cannot be a model forP�. Givensuch aN�, there are three possibilities:

1. (N� \ BP = N) �M : M is a stable model forP which means, accordingto Definition 3.3.8, thatM is a minimal model of the positive programPMusing the Gelfond-Lifschitz transformation. SoN cannot be a model forPM . This implies that99r0 : a B 2 PM �B � N ^ a =2 N :Because of the definition of the Gelfond-Lifschitz transformation, this yields:9r : a B; not C 2 P �B � N ^ C \M = ; ^ a =2 N :SinceN � M , we have thatB � M . This gives rise toa 2 M , sinceMis a model forP . According the creation ofM� this impliesKC =2M� anda; ar 2M�.Let us now return to the choice programP� and especially to the rules thatoriginate from thisr. Now, if r was a positive rule we immediately havethatN� is not a model forP�, sinceB 2 N anda =2 N . In caser is anegative rule we have, amongst others, the rulesar �KC B anda arin P�. To satisfy the former we have to choose eitherar orKC but not both,asB � N . If we opt forar we have to conclude thatN is not a model sincethe rulea ar does not hold, asa =2 N . We cannot decide forKC eitherbecause this would invalidateN �M sinceKC =2M .This leaves us only to conclude that in these circumstancesN is not a modelfor P�.

9The unsatisfied rule can never be a constraint, becauseN � M assures that positive con-straints are easier satisfied.

Page 113: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.3. SIMULATING SEMI-NEGATIVE LOGIC PROGRAMS 99

2. 9KC 2M� �KC =2 N�: We can assume that the first possibilityN�\BP �M is invalidated. This implies thatN� \ BP = M , sinceN� �M�.KC 2M� implies, by the creation ofM�, that9r : a B; not C or B; not C 2 P �M \ C 6= ; :SinceN� \ BP = M� \ BP andM \ C � BP , we have that9 2 C � 2 N� :Following Definition 5.3.1,r gives rise to the creation of the ruleK .This makes that, in this situation,N� is not a model forP�, as 2 N� andKC =2 N�.

3. 9ar 2M� � ar =2 N : Again we can assume that previous conditions areinvalid, which especially implies thatN� \ BP = M� \ BP .Fromar 2M�, we can conclude, by means of the construction ofM�, that9r : a B; not C � B � M and thatKC =2 M�. According to Defini-tion 5.3.1, the existence of the ruler yields the rulear � KC B. Thisrule is applicable sinceB � N�, due toM = N� \ BP andB � M . Bothar andKC cannot be part ofN�. A choice for the latter would invalidateN� �M�. So,N� is, also in this situation, not a valid model.

In all possible situations, we have seen that there is no way thatN� could be avalid model forP�.This allows us to conclude thatM� has to be minimal. Summarizing,M� is arational minimal model which is, by Theorem 5.2.1, the same as saying thatM�is rational stable model forP�.

To show the “only if” part, letM� be a rational stable model forP�. DefineM = M� \ BP and letPM be the result of applying the Gelfond-Lifschitz onPw.r.t. M . We show thatM is a minimal model ofPM .Just as before we start proving thatM is a model ofPM .By definition, this implies that:8r 2 PM : Br �M �Hr 2 M :Let us first examine the constraints inPM . Let r0 : B be a such a constraintin PM . Either this constraint is also a rule inP or 9 B; not C � C \M = ;.The former case is trivial, since those constraints are alsorules inP� andM� is a

Page 114: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

100 CHAPTER 5. CHOICE LOGIC PROGRAMMING

model for it. In the second case, we know thatKC B is a rule inP�. Since noelements ofC are elements ofM orM� (i.e.,M = M�\BP ), we have, thanks tothe rationality ofM�, thatKC =2M�. BecauseM� is a model forP andB � BP ,we can be sure thatB *M . So the constraints inPM are always satisfied.Let us continue with the standard rules. Letr0 : a B be a rule inPM such thatB �M . Now there are two possibilities:� r0 2 P , or� 9r : a B; not C 2 P � C \M = ;.The former case is trivial since the positive ruler0 will also be a rule inP� andM�is a model for it. Thus,a 2 M . In the latter case we have thatar�KC B 2 P�.ForM� to be a model it should choosear orKC . The possibility of choosingKCis made impossible by the rationality ofM�. Rationality requires thatKC canonly be part ofM� iff C \M� 6= ;, butC \M� = C \M = ;, asC � BP .So, ar 2 M�. If we combine this withM� being a model, we have that ruler02 : a ar implies thata 2M� anda 2 M .So we can conclude thatM is a model ofPM .This leaves us to prove thatM is also minimal forPM . To this extent we haveto demonstrate that every total interpretationN � M cannot be a model forPM .LetN be such an interpretation. We createN� in the following way:N� = N [ fKC j 9r : a B; not C or B; not C 2 P �M \ C 6= ;g[ far j 9r : a B; not C 2 P : B � N ^M \ C = ;gIt is easy to see thatN� � M�. BecauseM� is a minimal model ofP�, we knowthatN� is not a model for it. According to Definition 5.2.6, this implies109r 2 P� �Br � N� ^ jHr \N�j 6= 1 :Let us now take a look at the various type of rules inP�:� r 2 P : This means thatr is a positive rule or a positive constraint which

is also included inPM . This automatically implies thatN will never be amodel forPM .

10r will never be a constraint because positive constraints aremore easily satisfied with lessatoms.

Page 115: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.3. SIMULATING SEMI-NEGATIVE LOGIC PROGRAMS 101� r01 : ar � KC B: By the construction ofN� we always have at mostone of the head elements. Whenever the body is true inN� we have exactlyone. This means that this type of rule is always satisfied.� r02 : a ar: According to the creation ofN�, we have thatar 2 BP when9r : a B; not C 2 P �B � N ^ C \M = ; :This implies thatr0 : a B 2 PM . Because we have thata =2 N� and,sincea 2 BP , a =2 N , we obtain thatN is cannot be model.� r03 : KC : Rules of this type are automatically satisfied by means of thecreation ofN�.� r04 : KC B: When this rule is not satisfied byN�, this implies that, bythe creation ofN� andN = N� \ BP thatB � N andC \M = ;. Thisyields that B 2 PM . This constraint is not satisfied byN . SoN is notfit to be model ofPM .

We have proven that the only way to make sure thatN� is not a model ofP� is tomake sure thatN is not a model ofPM . This means thatM is a minimal modelof PM which implies thatM is a stable model ofP . 2The necessity for the rationality condition is illustratedby the next example.

Example5.3.1 Consider the following logic programP and its correspondingCLPP�: P P�impalas not leopard ) impalasr � Kleopard impalas impalasrKleopard leopardP has one stable model, namelyM = fimpalasg, corresponding to the rationalstable modelM� = fimpalasr; impalasg ofP�. P� has also the irrational stablemodelfKleopardg which does not correspond to any stable model ofP .

For a large class of programs, namelypositive-acyclicprograms, the rationalityrequirement can be dismissed.

Page 116: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

102 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Definition 5.3.3 A semi-negative logic programP is called positive-acycliciffthere is an assignment of a natural number to each element ofBP such that thenumber of the head of any (grounded) rule is greater than the numbers assignedto the atoms appearing in the body.

Note that, obviously, all stratified[Prz89] programs are positive-acyclic. Still,many other “nondeterministic” programs also have this property.

Example5.3.2 (Scavengers)Consider the following logic programs describingthe scene of a kill after the departure of the predator. The first program indicatesthat scavengers do not allow others to eat from the carcass when they are feasting.The second program explains that if you see one type of scavenger, you will alsosee the others.P1 : hyaenas not ja kals P2 : vultures hyaenasja kals not hyaenas hyaenas ja kalsja kals vulturesProgramP1 is positive-acyclic while programP2 is not.

Definition 5.3.4 Let P be a positive-acyclic semi-negative logic program. Thecorresponding CLPP a� contains the following rules:

1. For each atomp 2 BP , P a� contains the rulep� p� .

2. For each ruleH B; not C in P with jHj � 1 add the rule11H B;C�toP a�.

3. For each atomp 2 BP , and for eachXp � BPa� which is a minimal setsuch that(Q� [ R) \ Xp 6= ; and for each rulep Q; not R in P , addp� Xp to P a�.

Intuitively, p stands for “there is a proof forp” while p� stands for “there is noproof for p”. Rules of the first type force the program to choose between thesealternatives for every atom in the program. The second type of rule rewrites thenegation. The rules concludingp�, the rules of type 3, are constructed in such away that the truth of the body effectively blocks all possible proofs forp.

11For a setX of atoms, we useX� to denote the setfx� j x 2 Xg.

Page 117: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.3. SIMULATING SEMI-NEGATIVE LOGIC PROGRAMS 103

Example5.3.3 The hyaenas just found their corpse for the day. The jackals alsosensed the corpse and are looking to join the feast. Of coursethe hyaenas will notagree to this, as it is their meal. Also other hyaenas are not invited. This translatesinto the following positive-acyclic program:hyaenas not ja kalshyaenas not hyaenasja kals not hyaenasThe equivalent choice logic program ishyaenas � hyaenas� ja kals � ja kals� hyaenas� hyaenas; ja kalsja kals� hyaenashyaenas ja kals�hyaenas hyaenas�ja kals hyaenas�The corresponding stable models arefhyaenasg and fhyaenas; ja kals�g for

the logic program and the choice logic program respectively.

Theorem 5.3.2 LetP be a semi-negative positive-acyclic program.M is a stablemodel ofP a� iff M \ BP is a stable model ofP .

Proof: Due to Theorem 5.2.1, we can treat stable models as minimal models andvice versa. To show the “if” part, letM be a stable model ofP . According to thedefinition of stable models, this implies thatM is a minimal model ofPM (e.g.Definition 3.3.8 on page 26). DefineMa� = M [ fa� j a =2Mg :First of all, it is easy to see thatM = Ma� \ BP . Now we need to show that,by Definition 5.2.6,Ma� is a minimal model ofP a�. We will split up the processin two pieces by first showing thatMa� is a model, and afterwards that it is alsominimal.� Ma� is a model: To prove this, we have to show that every rule inP a� is

satisfied. We will examine the different types of rules inP a� one at the time:

Page 118: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

104 CHAPTER 5. CHOICE LOGIC PROGRAMMING

1. p� p� : This type of rule is automatically satisfied by means of thecreation ofMa�: p� is an element ofMa� iff p is not an element ofM .

2. B;C�: Due to the creation ofP a� (Definition 5.3.4), we know thatthe constraint B; not C 2 P . BecauseM is a model ofP , we haveeitherB * M or C \M 6= ;. Combining this with the constructionof Ma�, we obtain(B [C�) *Ma�. This implies that our constraint issatisfied.

3. a B;C�: To prove that such rules are satisfied we demonstrate thata 2M wheneverB [ C� �Ma�. Thus, letB [ C� �Ma�.A rule of this type can only be part ofP a� if9r : a B; not C 2 P :We have forr thatB � M andC \M = ;. The former is satisfiedbecauseB � (Ma� \ BP ) = M . The latter is true due to the creationof Ma� stating thatC� can only be part ofMa� if C \M = ;. Thisimplies that 9r0 : a B 2 PM :such thatB � M . SinceM is a model ofPM , we have thata 2 M .Thus, this yields that the rules of type 2 are always satisfied, asM �Ma�.

4. a� Xa: In order to prove that these rules are satisfied, we have toshow that, in caseXa � Ma�, a� is also an element ofMa�. Let r be arule inP a� such thatXa � Ma�. If we look to the transformation ofPto P a�, we see thatXa must obey the following condition:8r0 : a Q; not R 2 P � (Q� [R) \Xa 6= ; = D :This implies that for all rulesr0 holds:Q *M _ R \M 6= ; ;due to the creation ofMa�.SinceM is a stable model ofP , it is by definition a minimal modelof PM . Stable models are also minimal models of the program itself(Theorem 3.3.1 on page 27). This yields that in case of the rulesr0with a in their head,a should not be an element ofM , sinceM n fagis also a model. The creation ofMa� makes sure, in this case, thata� 2Ma�. This allows the rules of typea� Xa to be satisfied.

Page 119: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.3. SIMULATING SEMI-NEGATIVE LOGIC PROGRAMS 105

So we can conclude thatMa� is a model ofP a�.� Ma� is minimal: It is easy to see thatMa� has to be minimal. Suppose thatyou remove eithera or a� from the modelMa�. BecauseMa� is a model,we know that eithera or a� has to be an element in order to satisfy therule a� a� . The removal of this element causes this rule to becomeunsatisfied. This leads to the conclusion thatMa� has to be minimal.

Thus, we can conclude thatMa� is a stable model forP a�.

To show the “only-if” part, letMa� be a stable model ofP a�. With Theorem 5.2.1,this implies thatMa� is a minimal model ofP a�.We now have to show thatM = Ma� \ BP is a stable model forP . Due toDefinition 3.3.8, this implies thatM has to be a minimal model of the programPM .We start by proving thatM is a model ofPM . To this extent, we demonstrate thatfor every rulea B 2 PM with B � M , a 2 M holds and for each constraint B 2 PM ,B 6�M is valid. Let us start with the latter. Given such a constraint,we have, with the Gelfond-Lifschitz transformation:9r : B; not C 2 P � C \M = ; :With Definition 5.3.4 and the construction ofM out ofMa�, this implies9r : B;C� � C� �Ma� :BecauseMa� is a model ofP a�, we automatically obtainB *Ma�. SinceB � BPandM = Ma� \ BP , this yieldsB * M , which implies that the constraint issatisfied.Now it remains to be shown that the rules with non-empty head are also satisfied.Given such a rule, we know that9r : a B; not C 2 P �B �M ^ C \M = ; :BecauseMa� \ BP = M andC � BP , we haveMa� \ C = ;. Ma� being a modeland the existence of the rules � � for each 2 C imply thatC� � Ma�.The creation ofP a�, transforms the ruler in:a B;C� :

Page 120: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

106 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Combining thatMa� is a model forP a� and(B [ C�) � Ma�, yields thata 2Ma�.Sincea 2 BP , we automatically have thata 2 M . This means that all rules inPM are satisfied and, thus, thatM is a model ofPM .Now we are left with having to prove thatM is also a minimal model ofPM .Therefore, we have to show that every total interpretationN with N � M cannotbe a model for it. LetN be a total interpretation such thatN �M .Before we continue we prove the following lemma.

Lemma 5.3.1 LetMa� be a stable model of a CLPP a� constructed from a semi-negative logic programP by means of Definition 5.3.4. For eacha 2Ma�:9r : a B;C� 2 P a� � (B [ C�) �Ma� ;and for eacha� 2Ma�:9r : a� Xa 2 P a� � (Xa) �Ma� :12

Proof: BecauseMa� is a model we know that for eacha 2 BP eithera or a�, butnot both, is an element ofMa�, due to the rules of type 1. Thanks to the creationof the rules of type 2 and 3, we have that:8r : a� Xa 2 P a� � 8r0 : a B;C� 2 P � j(B [ C�) \X�a j 4 1 :Such rulesr are created for each minimalXa.Combining all this information results in:8a 2Ma� � 9r : a B;C� 2 P a� � (B [ C�) �Ma�.Suppose that this is invalid for every rule witha as its single head atom. Thiswould imply that at least one element of the body is false. Combining all theseelements in the setD will automatically result in a subset ofD� forming the bodyof a rule witha� as the head element. BecauseD\Ma� = ;, we haveD� �Ma�.This would forcea� to be true, asMa� is a model ofP a�. However, this contradictswith a 2Ma�, as this would invalidate the rulea� a� .8a� 2Ma� � 9r : a� Xa 2 P a� � (Xa) �Ma�.Suppose that this would be invalid. This implies that for every such rule at leastone body element is false. Combining these elements in the set D results in a

12Notice that this implies that the choice rulesa � a� are only used to trigger the processand not to maintain the choice for an atom. The latter is done by the other rules.

Page 121: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.3. SIMULATING SEMI-NEGATIVE LOGIC PROGRAMS 107

subset ofD� which forms the body of a rulea B;C�, since there is, accordingto Definition 5.3.4, a rulea� Xa for each minimal setXa, becauseD\Ma� = ;,we haveD� � Ma�. This would forcea to be true, asMa� is a model ofP a�.However, this contradicts witha� 2Ma�, as this invalidates the rulea� a� .2Now that we have proven the lemma, we can continue our proof showing thatM has to be a minimal model ofPM . To this extent, we have to show that thearbitrary total interpretationN with N � M cannot be a valid candidate to be amodel.BecauseP is positive-acyclic, we can, according to Definition 5.3.3,assign anatural number to every atom inBP such that the number of the head is higherthan the numbers assigned to the positive body elements. Letb be an atom withthe smallest number such thatb 2M andb =2 N .SinceMa� is a stable model ofP a�, we have, with Lemma 5.3.1, that:9r : b B;C� 2 P a� � (B [ C�) �Ma� :Following the creation ofP a� with definition 5.3.4, we obtain:9r0 : b B; not C 2 P �B � M ^ C \M = ; ;sinceM = Ma� \ BP . This yields that9r00 : b B 2 PM :Becauseb is the element with the smallest number inM that is not an element ofN , we obtain, withP being positive acyclic, thatB � N . This implies that therule r00 is not satisfied, asb =2 N .Thus, we can conclude thatN could never be a model ofPM .Summarizing,M is a minimal model ofPM and thus a stable model ofP . 2The suggested transformation works only for positive-acyclic programs as demon-strated in the following example.

Example5.3.4 (Inseparable)On the African plains two species really enjoy eachother’s company: the zebra and the gnu. If you see one, you will automaticallysee the other. This knowledge can be represented by the following logic program

Page 122: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

108 CHAPTER 5. CHOICE LOGIC PROGRAMMING

together with the reactions to and from the lions.P P a�zebra gnu; not lions zebra � zebra� gnu zebra gnu � gnu� lions not gnu lions � lions� zebra gnu; lions�gnu zebra) lions gnu�lions� gnugnu� zebra�zebra� gnu�; lionsThe original program has only one stable model, namelyflionsg. However, thetransformed program has two stable models:flions; gnu�; zebra�g andfzebra;gnu; lions�g.Until now we have concentrated on transforming semi-negative logic programsinto equivalent choice logic programs. The reverse is also possible.

Definition 5.3.5 LetP be a CLP. Its corresponding semi-negative logic programPnot is constructed as follows: For each ruleA B fromP :� jAj � 1 : A B 2 Pnot ;� jAj > 1 : 8a 2 A :

– a B; not (A n fag) 2 Pnot , and

– 8 2 (A n fag) � a; ; B 2 Pnot .

Intuitively, the last type of rule ensures the choice of a single conclusion fromA.

Theorem 5.3.3 LetP be a CLP and letPnot be its corresponding semi-negativelogic program according to Definition 5.3.5. Then,M is a stable model ofP iffM is a stable model ofPnot.

Page 123: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.3. SIMULATING SEMI-NEGATIVE LOGIC PROGRAMS 109

Proof: Because of Theorem 5.2.1, we know that the minimal model semanticsequals the stable model semantics.To show the “only-if”-part, letM be stable model forP . By definition of thestable models for a logic program we have to prove thatM is a minimal model ofPMnot.

1. M is a model ofPMnot. PMnot contains two types of rules: the rules with non-empty head and the constraints. Let us first continue with theordinary ruleswith non-empty head. ForM satisfying this kind of rules, it suffices to showthat in case the body is true, the head must also be true. Letr : a B 2PMnot be such a rule (i.e.,B � M ). According to the Gelfond-Lifschitztransformation this implies:9r0 : a B:not C 2 Pnot : B �M ^ C \M = ; :For r0 there exists a corresponding ruler" : a� C B 2 P such thatB �M andC \M = ;. SinceM is a model ofP this yields:a 2M ;which makes thatr is satisfied inPM .Let us continue with the constraintsr : a; ; B. This constraintr caneither be part ofP or is originated from a rulea� � C B 2 P :The former case is trivially solved, asM is a model ofP . For the latterpossibility, sinceM is a model ofP , we either haveB 6� M or j(fa; g [C) \M j = 1. In both cases we have that the constraintr is satisfied: eithera, orB is false.So we can conclude that every rule inPMnot is satisfied byM .

2. M is a minimal model forPMnot. This means that we have to prove that everytotal interpretation which is a subset ofM is not a decent candidate for amodel ofPMnot. LetN be such a total interpretation (i.e.,N �M ).BecauseM is a minimal model ofP , we know thatN can never be a modelfor it as well. This implies that:9r : A B 2 P �B � N ^ jA \N j 6= 1 :

Page 124: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

110 CHAPTER 5. CHOICE LOGIC PROGRAMMING

BecauseN � M andM is a model ofP , we have thatB � M andA \M = fag. The latter immediately implies thatjA \ N j = 0 and thatr cannot be a constraint. Following Definition 5.3.5, the ruler gives rise tothe creation ofr0 : a B; not C 2 P with A = fag [ C ;such thatB � N ,C\N = ; anda =2 N . Since(A = C[fag)\M = fag,we have thatC \M = ;. According to Definition 3.3.8, this yields:r00 : a B 2 PM ;with B � N anda =2 N .This implies thatN is not a model ofPM , since it is unable to satisfyr00 2PM .

Thus, we can conclude thatM is a minimal model ofPM which makes it a stablemodel ofP .

To show the “if” part, letM be a stable model ofPnot. To demonstrate thatM isa stable model ofP , we have to prove thatM is a minimal model forP . Again,we will do this in two steps: first we prove thatM is a model, then we will showthatM is also minimal.

1. M is a model ofP . ForM to be a model it is sufficient to have thatjA \M j = 1 wheneverB � M . Let r : A B be an arbitrary rule such thatB � M . The possibility ofr being a constraint is excluded as those rulesare also rules inPnot and this whileM is a model forPnot. So they areimmediately satisfied.According to Definition 5.3.5, two types of rules were created from r inPnot:� 8a 2 A � r0 : a B; not C 2 Pnot with C [ fag = A. These types

of rules allow us to conclude thatjA \M j > 0. In case none of theelements ofA were true inM whileB � M , we would have that forall r0 thatB �M andC\M = ;whilea =2 M . This would invalidateour assumption thatM is a stable model, and thus a model, ofPnot.� 8a; b 2 A : a 6= b � r00 : a; b; B 2 Pnot. SinceM is a model ofPnot,we have, sinceB � M , that at leasta or b is not an element ofM .Because we have created such a constraint for every two elements ofA, we can conclude thatjA \M j � 1.

Page 125: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.3. SIMULATING SEMI-NEGATIVE LOGIC PROGRAMS 111

Combining the two conclusions from above, we obtain thatjA \M j = 1.Thus,M is a model ofP .

2. M is a minimal model ofP . According to Definition 5.2.6, this means thatwe have to prove that every total interpretationN with N � M can neverbe a model. Assume such a total interpretationN . BecauseM is a minimalmodel ofPMnot, we have thatN can never be a model ofPMnot. This meansthat there exists a rule which is not satisfied byN . This rule cannot be aconstraint sinceN �M .This implies that:9r : a B 2 PMnot �B � N ^ a =2 N :Sincer 2 PMnot, we have, according to Definition 3.3.8, that9r0 : a B; not C 2 Pnot � C \M = ; :This implies, due toN � M , thatC \ N = ;. Following the creation ofPnot, we have:9r00 : a� C B 2 P � a =2 N ^ C \N = ; ^ B � N :This implies thatN is unable to satisfyr00, which makes it impossible forN to be a model. So we can conclude thatM is a minimal model ofP .

Finally we can conclude, using Theorem 5.2.1 thatM is a stable model forP . 2Example5.3.5 (Rhinos) On the African plains one can detect two types of rhi-noceros: the white13 and the black rhino. The white rhino is much bigger andheavier than the black rhino and is further distinguished bya large hump on thehind neck. Suppose now that an amateur biologist is sent out to try to identifyrhinos. Inexperienced as she is, she thinks that she came across a small rhinowith a hump (she did not notice that it was a youngster). With this observation

13The name ’white’ rhino is a misnomer from the old Dutch wordweit meaning ’wide’, dueto the wide, square mouth which is adapted to grazing. In factall rhinos are grayish or grayishbrown in color.

Page 126: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

112 CHAPTER 5. CHOICE LOGIC PROGRAMMING

she will be unable to draw any conclusion. The above information is representedby the following programP . rhino white � bla k rhinobla k smallwhite humpsmall hump It will not come as a big surprise that this program has no stable model.The corresponding logic programPnot is:rhino bla k not white; rhinowhite not bla k ; rhino white; bla k ; rhinobla k smallwhite humpsmall hump This program does not produce a stable model either. This is due to the constraintwhich prevents the observer from concluding that the rhino is black as well aswhite.

5.4 Unfounded sets and Stable Models

Although negation is not explicitly present in choice logicprograms, it does ap-pear implicitly (Section 5.3). This “implicit negation” will be formalized usingunfounded sets, which can be put to good use in the computation of stable mo-dels. A similar procedure for the stable models of disjunctive logic programs wasintroduced in [LRS97], which generalizes the one from [GRS88a]. The main dif-ference with our approach is that the unfounded sets from [LRS97] are not suitedfor programs that allow constraints (e.g., rules with empty-head). It turns out thatmany of the results of [LRS97] remain valid or can even be strengthened:

1. For choice logic programs, the greatest unfounded set is defined for anyinterpretation, which is not the case for disjunctive programs.

Page 127: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 113

2. Contrary to disjunctive programs, the results for choicelogic programs re-main valid in the presence of constraints.

3. For choice logic programs, theRP;I-operator (see Definition 5.4.2), whenrepeatedly applied toBP , always yields the greatest unfounded set w.r.t.I.

4. Because of (1) above, theWP -operator (see Definition 5.4.4) can be usedin the computation of a stable model. For disjunctive programs, this is notpossible because there is no guarantee that an intermediateinterpretationhas a greatest unfounded set. Especially in cases with a large number ofconstraints and rules with more than one head element, this performs betterthanTP to prune the search space.

The only property that we lose is the ability to completely characterize stablemodels in terms of unfounded sets. One has to be sure that the candidate stablemodel is a model in the first place. However this is just a minorproblem as modelchecking can be done in linear time given a fixed program and a total interpreta-tion. It is a small price to pay for the ability to represent exclusive disjunction andconstraints and for having the assurance that the greatest unfounded set alwaysexists.

5.4.1 Unfounded Sets

Atoms that are part of an unfounded set are not needed in the interpretationI forwhich the unfounded set is computed: they can easily be assumed false in anymodel extension ofI.

Definition 5.4.1 Let I be an interpretation for a CLPP . A setX � BP is anunfounded setfor P w.r.t. an interpretationI iff for each p 2 X one of thefollowing three conditions holds:

1. 9r : A� p B 2 P � A \ I 6= ; ^ B � I, or

2. 9r : B; p 2 P �B � I, or

3. 8r : A� p B 2 P at least one of the following conditions is satisfied:

(a) B \ not I 6= ;, or

Page 128: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

114 CHAPTER 5. CHOICE LOGIC PROGRAMMING

(b) B \X 6= ;, or

(c) A \ B 6= ;.The set of all unfounded sets forP w.r.t. I is denotedUP (I). Thegreatest unfoun-ded set14 w.r.t. I, denotedGUSP (I), is defined byGUSP (I) = SX2UP (I)X. I iscalledunfounded-freeiff I \ GUSP (I) = ;. We denote the set of all unfoundedinterpretations forP asIuP .

Condition (1) above expresses that choice is exclusive and thus, alternatives of theactual choice ought to be considered false. Condition (2) implies that any atomthat would cause a constraint to be violated must be considered false. Condition(3) resembles the traditional definition of an unfounded setby specifying when arule cannot be used to infer a new atom: in case (a), the rule is“blocked” by thecurrent interpretation; in case (b), the rule’s application depends on an unfoundedliteral, while case (c) indicates that the rule is useless, since the body contains oneof the choices in the head. We slightly changed the conditionof Definition 3.4.615

to accommodate the use of exclusive disjunction.

Example5.4.1 (The Law of the Jungle)When a lioness comes into heat she willchoose herself a partner after which they both leave the group for a week of hon-eymoon bliss. That week is solely dedicated to love, so neither party feels the urgeto eat. Their honeymoon could easily be disturbed at the end,when another fe-male, also in heat, shows interest for the groom. However, there is no way that hewill accept this generous offer, not out of loyalty, but because he could not surviveanother week of love. To solve this dilemma he simply calls for his brother to dothe honors.This story is represented in the following CLPP :lion lioness honeymoon lion; lionessquiet � female honeymoonboth � brother female lion; bothdead both

14It will be shown (Theorem 5.4.1) thatGUSP (I) is indeed unfounded.15Definition 3.4.6 uses(A nX) \ (I [ B) 6= ; .

Page 129: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 115

Consider the (partial) interpretation:I = flion; lioness; femaleg :The greatest unfounded set w.r.t.I equals:GUSP (I) = fboth; deadg :So the greatest unfounded set indicates the alternatives the lion should not take inorder to stay alive.

The next theorem shows that “greatest unfounded set” is a well-chosen name forthe union of all unfounded sets,GUSP (I).Theorem 5.4.1 Let I be an interpretation for the CLPP . Then,GUSP (I) 2UP (I).Proof: We need to show thatGUSP (I) is an unfounded set ofP . In Definition5.4.1, we definedGUSP (I) as

SUP (I). This implies8p 2 GUSP (I) that9X 2 UP (I) � p 2 X :BecauseX is an unfounded set, we have, according the same definition, that either

1. 9r : A� p B 2 P � A \ I 6= ; ^ B � I , or

2. 9r : B; p 2 P �B � I , or

3. 8r : A� p B 2 P one of the following conditions is fulfilled:

(a) B \ not I 6= ; , or

(b) B \X 6= ; or

(c) A \B 6= ; .

Except for condition (b) all the conditions are immediatelytransferable fromXto GUSP (I).Condition (b) yields that, as set inclusion is monotonic,B \ GUSP (I) 6= ;. Thisis also one of the conditions for an unfounded set. Since one of the conditions is

Page 130: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

116 CHAPTER 5. CHOICE LOGIC PROGRAMMING

always satisfied, we have thatGUSP (I) is an unfounded set w.r.t.I. Equivalently,we can sayGUSP (I) 2 UP (I). 2Note that the above theorem is false for disjunctive logic programs [LRS97].In fact, for such programs,GUSP (I) 2 UP (I) can only be guaranteed ifI isunfounded-free or d-unfounded-free[DVV98b]. They have totake into accountthat the head of an applied rule may contain several true atoms. This results in thecondition(Hr nX)\I 6= ;, which is not monotonic when the number of elementsin X increases.

A very important property for an operator likeGUSP is its monotocity.

Theorem 5.4.2 LetP be a CLP and letI andJ be two interpretations forP suchthat I � J . Then,GUSP (I) � GUSP (J).Proof: We will prove that every unfounded setX of P w.r.t. I is also an un-founded set w.r.t.J . Since, by Theorem 5.4.1, the greatest unfounded set w.r.t.an interpretation is also an unfounded set w.r.t. that interpretation, we will auto-matically have thatGUSP (I) � GUSP (J). So letX 2 UP (I). According toDefinition 5.4.1, this implies that for allp 2 X one of the following conditionsmust be satisfied:

1. 9r : A� p B 2 P � A \ I 6= ; ^ B � I , or

2. 9r : B; p 2 P �B � I , or

3. 8r : A� p B 2 P one of the following conditions is satisfied:

(a) B \ not I 6= ; , or

(b) B \X 6= ; or

(c) A \ B 6= ; .

SinceI � J , we can rewrite condition 1, 2 and (a) respectively as:� 9r : A� p B 2 P � A \ J 6= ; ^ B � J ,� 9r : B; p 2 P �B � J , and� B \ J 6= ;.

Page 131: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 117

This yields that the conditions forX being an unfounded set w.r.t.J are fulfilled.So8X 2 UP (I) � X � GUSP (J), which impliesGUSP (I) � GUSP (J), as thegreatest unfounded set is also an unfounded set itself, by Theorem 5.4.1. 2Adding negative information obtained from its greatest unfounded set to an inter-pretation will not result in extra information about atoms that can be assumed tobe false.

Theorem 5.4.3 Let I be an unfounded-free16 interpretation for a CLPP .Then,GUSP (I) = GUSP (I [ not GUSP (I)).Proof: The inclusionGUSP (I) � GUSP (I [ not GUSP (I)) follows imme-diately from Theorem 5.4.2. To demonstrate the other inclusion, we will provethat the union of an unfounded setX of I [ not GUSP (I) with the greatest un-founded set w.r.t.I is an unfounded set w.r.t.I. Or in a more mathematicalnotation: 8X 2 UP (I [ not GUSP (I)) �X [ GUSP (I) 2 UP (I) :This would imply thatX � GUSP (I) which proves the inclusion.So letX 2 UP (I [ not GUSP (I)). Now we can distinguish two different cases:� X 2 UP (I). In this case the problem is trivially solved.� X =2 UP (I). BecauseX 2 UP (I [ not GUSP (I)), we have, by Definition

5.4.1, that for everyp 2 X one of the following conditions is fulfilled:

1. 9r : A� p B 2 P such thatA \ (I [ not GUSP (I)) 6= ; andB � (I [ not GUSP (I)). This can be simplified, since both head andbody of a rule are positive, as9r : A� p B 2 P such thatA \ I 6= ; andB � I :

2. 9r : B; p 2 P such thatB � (I [ not GUSP (I)). This is equiva-lent with: 9r : B; p 2 P such thatB � I :sinceB contains only atoms.

16This condition is needed, otherwise one would try to calculate the greatest unfounded set ofan inconsistent set of literals, which is not defined.

Page 132: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

118 CHAPTER 5. CHOICE LOGIC PROGRAMMING

3. 8r : A� p B 2 P one of the following conditions must be true:

(a) B\(not I[GUSP (I)) 6= ;. This makes that eitherB\not I 6= ;or B \ GUSP (I) 6= ; must be true. In case the latter is satisfiedwe also have thatB \ (X [ GUSP (I)) 6= ; is fulfilled.

(b) B \X 6= ;. This can be rewritten asB \ (X [ GUSP (I)) 6= ;,as the intersection-operator is monotonic.

(c) A \B 6= ; .

So in every possible situation we have that one of the conditions forX [GUSP (I) being an unfounded set w.r.t.I is satisfied.Therefore,(X [ GUSP (I)) 2 UP (I) which implies(X [ GUSP (I)) �GUSP (I). Because this is true for every unfounded set ofI[not GUSP (I),we have, by Theorem 5.4.1,GUSP (I [ not GUSP (I)) � GUSP (I). 2

According to Definition 5.4.1, testing the unfounded-freeness of an interpreta-tion I involves verifying thatX is not an unfounded set for anyX that satisfiesX \ I 6= ;.The next theorem demonstrates that, in case of a total interpretation, we can re-strict ourselves to checking the sets of atoms contained in this interpretation.

Theorem 5.4.4 LetI be a total interpretation for the CLPP . I is unfounded-freeiff no non-empty set of atoms contained inI is an unfounded set forP w.r.t. I.

Proof: (We proceed by contraposition. LetI be not unfounded-free. Accord-ing to Definition 5.4.1, this impliesGUSP (I) \ I 6= ; or equivalently:9X 2 UP (I) �X \ I = Y with Y 6= ; :We will show thatY is an unfounded set forP w.r.t. I. Let p 2 Y . BecauseX 2 UP (I), we have that at least one of the following conditions is fulfilled:

1. 9A� p B 2 P � A \ I 6= ; ^B � I , or

2. 9 B; p 2 P �B � I , or

3. 8A� p B 2 P one of the following conditions is true:

Page 133: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 119

(a) B \ not I 6= ; , or

(b) B \X 6= ; , or

(c) A \B 6= ; .

Condition (b) yields, becauseI is total, two possibilities:� B \ Y 6= ; , or� B \ I� 6= ; .

The latter impliesB \ not I 6= ;. Thus we have that at least one of the conditionsfor an unfounded set is satisfied for eachp 2 Y which yieldsY 2 UP (I).) An interpretation is unfounded-free iffGUSP (I) \ I = ;. Following thedefinition of the greatest unfounded set, this is equivalentwith I \X = ; for allX 2 UP (I). So it is easy to see that no non-empty subset of atoms inI is anunfounded set w.r.t.I. 2The next example illustrates that the restriction to total interpretations is necessary.

Example5.4.2 Consider the following CLP, describing a crocodile’s lunch:bu�alo � bushbu k ro odileand the partial interpretation:I = fbushbu kg :The setfbushbu kg cannot be considered as an unfounded set w.r.t.I. However,this interpretation is not unfounded-free asGUSP (I) = fbu�alo; bushbu k ; ro� odileg.5.4.2 A Fixpoint-Operator for GUSPTheorem 5.4.4 yields an elegant, but not particularly efficient, way of checkingwhether a total interpretation is unfounded-free or not. Inthis section we intro-duce the more efficient fixpoint-operator,RP;I, for verifying the unfounded-freeproperty of a total interpretation. Moreover, we will see thatRP;I can also be usedto compute the greatest unfounded set of an interpretation.

Page 134: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

120 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Definition 5.4.2 Let I be an interpretation for a CLPP . DefineRP;I : 2BP !2BP by:RP;I(X) = fa 2 X j 9r : A� a B 2 P : A \ I 6= ; ^ B � I ; or9 B; a 2 P : B � I ; or8r : A� a B 2 P : B \ (not I [X) 6= ; ; or(A [ fag) \ B 6= ;g :Notice that althoughRP;I resembles the definition for an unfounded set, the inputdoes not have to be an unfounded set (nor does the output, for that matter). Onesimply filters out the atoms that cannot belong to any unfounded set which mightbe contained in the input.

Example5.4.3 Consider the following CLPP to distinguish baboons:olive � yellow baboonbaboon mane oliveand the interpretations:I = fg andJ = fyellow ; baboong :For X = folive;manegwe obtain: RP;I(X) = fmaneg =2 UP (I) ;while RP;J(X) = X 2 UP (J) :The latter result (i.e. applyingRP;J on an unfounded set results in the same un-founded set) is not a coincidence, as is demonstrated by the next theorem.

Theorem 5.4.5 Let P be a CLP, and letI be an interpretation for it. Then,RP;I(X) = X iff X 2 UP (I).

Page 135: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 121

Proof: Obvious if one compares the definition for an unfounded set (Defini-tion 5.4.1) and the definition ofRP;I (Definition 5.4.2). 2It is rather easy to see thatRP;I is a monotonic operator. Given a setX � BP , it isobvious that the sequenceR0 = X, Rn = RP;I(Rn�1) decreases monotonicallyand converges to a limit, denoted byR!P;I(X).TheR!P;I(J)-operator gathers all atoms contained both inJ and in an unfoundedset forP w.r.t. I.

Lemma 5.4.1 Let P be a CLP, letI be a interpretation forP and letJ � BP .Then, every unfounded set forP which is contained inJ is also a subset ofR!P;I(J).Proof: Due to Theorem 5.4.5, we obtain thatRP;I(X) = X for an unfoundedsetX 2 UP (I). BecauseRP;I is monotonic this yieldsX � R!P;I(J). 2R!P;I(J) can be used to verify whether a total interpretation is unfounded-free ornot, by just starting the process with the positive part of the interpretation.

Theorem 5.4.6 LetI be a total interpretation for a CLPP . If R!P;I(I+) = ; thenI is unfounded-free.

Proof: This follows immediately from the combination of Lemma 5.4.1 andTheorem 5.4.4. 2The next lemma demonstrates that the limit ofRP;I(X) always yields an unfoun-ded set w.r.t.I.

Lemma 5.4.2 Let I be an interpretation for a CLPP . Then,R!P;I(X) 2 UP (I).Proof: According to the definition,R!P;I(X) = Y implies thatRP;I(Y ) = Y .Combining this with Theorem 5.4.5 yieldsY 2 UP (I). Thus we can concludethatR!P;I(X) 2 UP (I). 2With the help of the above lemma we are able to show thatR!P;I(I+) = ; is anecessary and sufficient condition forI being unfounded-free.

Theorem 5.4.7 Let I be a total interpretation for a CLPP . Then,R!P;I(I+) = ;iff I is unfounded-free.

Page 136: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

122 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Proof: The “only-if” part follows immediately from Theorem 5.4.6.For the “if” part, we proceed by contraposition. To this extend, letR!P;I(I+) =S 6= ;. We shall prove thatI cannot be unfounded-free in this case. By Lemma5.4.2,R!P;I(I+) = S implies S 2 UP (I). With the definition of unfounded-freeness, this yields thatI cannot be unfounded-free, asS � I+. 2TheR!P;I operator has another interesting property, besides telling us whether aninterpretation is unfounded-free or not. It is also able to compute the greatestunfounded set of an interpretation. HenceRP;I can be used as a fixpoint-operatorfor GUSP (I).Theorem 5.4.8 Let I be an interpretation for a CLPP . Then,R!P;I(BP ) =GUSP (I).Proof: Lemma 5.4.2 tells us thatR!P;I(BP ) is an unfounded set w.r.t.I. FromLemma 5.4.1 we know thatR!P;I(BP ) contains every unfounded set w.r.t.I con-tained inBP . Since the greatest unfounded set can only contain elementsfrom theHerbrand base, it is rather obvious thatR!P;I(BP ) = GUSP (I) = SX2UP (I)X. 2In Theorem 5.4.7 we have shown thatR!P;I(I+) can be used to verify whether atotal interpretation is unfounded-free or not. The following corollary demonstratesthat this operator can also be used without the prerequisiteof totality. In this caseone has to apply the operator on the total Herbrand Base instead of the positivepart of the interpretation.

Corollary 5.4.1 Let I be an interpretation for a CLPP . Then,I is unfounded-free iffR!P;I(BP ) \ I = ;.Proof: Follows immediately from Theorem 5.4.8 and Definition 5.4.1. 25.4.3 Unfounded Sets and Stable Models

In this part we demonstrate that unfounded sets are a useful tool for the identifica-tion of (stable) models.

The negative part of a model is an unfounded set.

Theorem 5.4.9 LetM be a model for the CLPP . Then,M� 2 UP (M).

Page 137: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 123

Proof: We proceed by means of contradiction. Assume thatM� is not an un-founded set w.r.t.M (i.e. M� =2 UP (M)). We prove that, in this case,M cannever be a model. According to Definition 5.4.1,M� not being an unfoundedset implies that there exists an atoma 2 M� such that the following conditions(amongst others) hold:

1. 8A� a B 2 P with B �M �A \M = ; , and

2. 9r : C � a D 2 P �D \ notM = ; .

The second condition yields that the ruler is of type 1, sinceD \ not M = ;impliesD �M , asM is total.The first condition implies for the ruler that jfA; ag \M j = 0 6= 1. So, we havedemonstrated the presence of at least one unsatisfied rule, which automaticallyrules out the possibility ofM being a model ofP . 2The reverse implication does not hold, as demonstrated by the next example.

Example5.4.4 (Young Animals) Consider the following CLP which representsthe first hunting experience of a young cheetah. She caught a young Thomsongazelle who is now fighting for her life. Since the cheetah is very unexperienced,she plays with her victim leading to a slow death for the youngThomson17. As aspectator you can only choose the side of one of the animals.young heetah � young Thomson gazelle young heetah young Thompson gazelle Consider the interpretationI = fyoung heetah; young Thomson gazelleg :I is not a model althoughI� 2 UP (I).For semi-negative disjunctive logic programs, the converse does hold[LRS97].

So models cannot be entirely characterized in terms of unfounded sets. But, whatfails for normal models succeeds for stable models, as shownbelow.

17Cheetahs normally suffocate their victims.

Page 138: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

124 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Theorem 5.4.10LetM be a model for the CLPP . M is a stable model iffM isunfounded-free.

Proof: )We proceed by contradiction. Suppose thatM is not unfounded-free.According to Theorem 5.4.4, this implies:9X �M+ �X 2 UP (M) ;with X 6= ;. We will now show thatN = (M nX) [ not Xis a model forP contradicting the minimality ofM . M is a stable model, andthus, by Theorem 5.2.1, minimal.In order to illustrate thatN is also a model ofP , we can restrict ourselves toconstraints that contain an element ofX and rules with an atom ofX in theirhead. The others are automatically satisfied, sinceM is a model.BecauseX is an unfounded set w.r.t.M , we obtain, with definition 5.4.1, that8a 2 X one of the following conditions has to be satisfied:

1. 9r : a� A B 2 P �B �M ^A\M 6= ; : Such a rule will never exist,since this condition impliesjHr \M j > 1, asa 2 M+. The existence ofsuch a rule would invalidate thatM is a model ofP .

2. 9r : B; a 2 P �B �M . Again the presence of such a rule would implythatM is not a model ofP , asBr �M .

3. 8r0 : a� A B 2 P one of the following conditions is true:

(a) B \ not M 6= ; . SinceB � BP andM� � N�, we obtainB \not N 6= ;. This implies that these rules are satisfied byN .

(b) B \X 6= ; . By the construction ofN , we know thatX � N�. ThisyieldsB \ not N 6= ;. So, rules of this type are satisfied by N.

(c) A \ B 6= ; . This condition yields two possibilities: eitherB * Nor B � N . Only the latter case needs some extra attention. BecauseN+ � M+ andB � BP , we haveB � M andA \M 6= ;. Thisbrings us back to condition 1, which was stated to be impossible. Thisleaves only the possibility thatB * N which satisfies the rule.

Page 139: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 125

This allows us to conclude thatN is indeed a model ofP , contradicting the mini-mality of P .This leaves us no other option then to conclude thatM has to be unfounded-free.( For this implication we proceed with the contrapositive. Wewill show that, incaseM is not stable, we can prove that it is also not unfounded-free. So, letM bea model which is not stable. According to Theorem 5.2.1, thisimpliesM is notminimal which yields the existence of a modelN such thatN+ �M+.We will show that X = M+ nN+ 6= ;is an unfounded set w.r.t.M .BecauseN is a model, we have, according to Theorem 5.4.9, thatN� 2 UP (N).SinceX � N�, the conditions for unfounded sets apply also to the elements ofX. Thus, we obtain that at least one of the following conditions has to be satisfiedfor everyx 2 X:

1. 9A� x B 2 P �B � N ^A \N 6= ;. Since bothA andB are positiveand becauseN+ �M+, this yields:9A� x B 2 P � A \M 6= ; ^B �M :

2. 9 B; x 2 P � B � N : Again sinceB is positive andN+ � M+, thisbecomes: 9 B; x �B �M :

3. 8A� a B 2 P at least one of the following condition must be fulfilled:

(a) B \ not N 6= ; . BecauseN is total and becauseB contains onlyatoms, this yields condition (b)

(b) B \ N� 6= ; . This gives rise to two possibilities: eitherB \X 6= ;orB \M� 6= ;. The latter impliesB \ notM 6= ;.

(c) B \ A 6= ; . This condition remains the same.

So in every possible situation one of the conditions forX being an unfoundedset w.r.t.M is satisfied. Thus,X 2 UP (M) which implies thatM can never beunfounded-free. 2If we combine the two previous results we obtain the main theorem of this sub-section.

Page 140: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

126 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Theorem 5.4.11LetM be a model of a CLPP . Then,M is a stable model ofPiff M� = GUSP (M).The necessity forM to be a model is demonstrated by the following example.

Example5.4.5 Let us return to the two prides of lions and hyaenas:lions � hyaenas lions Consider the interpretation: I = fhyaenasg :This interpretation is unfounded-free andGUSP (I) = flionsg = I�, but I iscertainly not a model. This is reasonable since unfounded sets represent thoseatoms that are not needed forI to become a model or would preventI to becomea model. They do not concern atoms that are actually needed byI.

A bottom-up algorithm that computes the stable models of a CLP could benefitfrom the next result. It indicates when a partial interpretation can no longer beused in the computation.

Theorem 5.4.12Let I be an interpretation for the CLPP . If I is not unfounded-free then no stable model will containI.

Proof: Following Definition 5.4.1,I being not unfounded-free means that:GUSP (I) \ I 6= ; :In case that a modelM of P exists such thatI � M , we have, following Theo-rem 5.4.2, that: GUSP (I) � GUSP (M) :This yields: GUSP (M) \M 6= ; :as set inclusion is monotonic.According to Definition 5.4.1, this means thatM is not unfounded-free.Combining this with Theorem 5.4.11, we obtain thatM cannot be a stable model.2So unfounded sets can be used to distinguish between interpretations, models andstable models.

Page 141: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 127

5.4.4 A Fixpoint Semantics for Stable Models

In this section, we will characterize stable models as fixpoints. This characteriza-tion will be used as the basis for the algorithm for computingstable models.

Definition 5.4.3 LetP be a CLP. Theimmediate consequence operator, denotedTP , is defined as follows:TP : 2BP [ not BP ! 2BPI 7! fa 2 BP j 9A� a B 2 P � A � not I ^ B � Ig :This operator adds those atoms that are absolutely needed inany model extensionof I. It is clearly monotonic.

TheWP operator, which uses the same intuition as the one defined in [GRS91],usesTP to extendI+ andGUSP to extendI�.

Definition 5.4.4 LetP be a CLP. Define theWP as follows:WP : IP ! 2BP [ not BPI 7! TP (I) [ not GUSP (I) :It is worth noting that theWP -operator is skeptical: it only adds literals thatmustbe in any model extension ofI. As a result, it makes no choices that could beinvalidated later on in the process.

Example5.4.6 Reconsider the lions’ honeymoon CLP of Example 5.4.1 and theinterpretationI = flion; lioness; femaleg with GUSP (I) = fboth; deadg. Theimmediate consequence operator yields:TP (I) = flion; lioness; honeymoong :This makes thatWP (I) = flion; lioness; honeymoon; not both; not deadg = J :If we apply theWP -operator again to the interpretationJ , it remains unchanged.SoJ is a (partial) fixpoint of theWP -operator.

Page 142: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

128 CHAPTER 5. CHOICE LOGIC PROGRAMMING

TheWP -operator can be used to detect stable models, as the following theoremdemonstrates. In other words, theWP -operator defines the fixpoint semantics forstable models.

Theorem 5.4.13LetP be a CLP and letM be a total interpretation for it.M isa stable model iffM is a fixpoint ofWP .

Proof: ) Let M be a stable model ofP . From Theorem 5.4.11, we know thatGUSP (M) = M�. This leaves us to prove thatM+ = TP (M):� M+ � TP (M). BecauseM is total and unfounded-free we have, by Theo-rem 5.4.4, that no non-empty set of atoms contained inM is an unfoundedset ofP w.r.t. M , with in particular the setsfag with a 2 M+. This im-plies thatfag violates every condition for an unfounded set. This means,amongst other conditions, that:

1. 8A� a B 2 P : if B �M thenA \M = ; , and

2. 9r : C � a D 2 P such thatD \ notM = ; .

Condition 2 impliesD � M , asM is a total interpretation. If we combinethis result with condition 1 we have thatC \M = ;, which is equivalentwith C � not M , again becauseM is total. This is exactly what is neededfor a to belongTP (M). Therefore,M+ � TP (M).� TP (M) � M+. Let a be an element ofTP (M). By Definition 5.4.3, thisimplies: 9A� a B : such thatB �M andA � notM :Given these circumstancesamust be an element ofM+ otherwiseM wouldnot be a model.Thus,TP (M) �M+.( Let M be a total fixpoint of theWP -operator. Then, by Definition 5.4.4,GUSP (M) = M�. Therefore, with Theorem 5.4.11, it remains to be shown

thatM is a model forP in order to conclude thatM is a stable model.We proceed by means of contradiction. To this extent, suppose that the total inter-pretationM is not a model. According to Definition 5.2.4, this implies:9r 2 P �Br �M ^ jHr \M j 6= 1 :Let us consider each possibility:

Page 143: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 129� Hr \M = ;. Now there are again two possibilities: eitherr is a constraintor it is not. The former yields, with the second condition of Definition 5.4.1,thatBr 2 UP (M). This contradicts withM� = GUSP (M), asBr � M+.The latter implies, due to Definition 5.4.3, thatHr � TP (M). However, thisis in contradiction withTP (M) = M+, asHr �M�.� jHr \M j > 1. With the first condition of definition 5.4.1, this implies thatHr \M 2 UP (M). This contradicts withM� = GUSP (M).

This means thatM has to be a model forP . Combining this withM� = GUSP (M),this yields, with Theorem 5.4.11, thatM is a stable model forP . 2As said before,WP draws no conclusions without compelling reasons. Hence,the application ofWP is monotonic and, given a fixpoint of this operator (eithertotal or not), every interpretation that is included in thisfixpoint is in the domainofWP .

Theorem 5.4.14Let I be an interpretation for a CLPP and letM be a fixpointofWP . If I �M , then

1. I belongs to the domainIP of theWP -operator, and

2. WP (I) �M .

Proof:

1. We have to prove thatI is consistent. SinceM is a fixpoint ofWP , it isconsistent (i.eM 2 IP ). Thus, becauseI � M , we automatically haveI 2 IP .

2. M is a fixpoint ofWP , so we have, by Definition 5.4.4, thatM� = GUSP (M).Because theGUSP -operator is monotonic this yields, by Theorem 5.4.2,GUSP (I) � GUSP (M). With Definition 5.4.4, this impliesWP (I)� �M�.This leaves us to prove thatWP (I)+ � M+ or, according to Definition5.4.4, thatTP (I) � M+. So leta 2 TP (I). By Definition 5.4.3, this im-plies 9A� a B : A � not I andB � I :

Page 144: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

130 CHAPTER 5. CHOICE LOGIC PROGRAMMING

As set inclusion is monotonic, this is equivalent with:9A� a B : A � notM andB �M :This implies thata 2 TP (M). BecauseM is a fixpoint ofWP , we have,according to Definition 5.4.4, thata 2 M+. Since this is true for everya 2 TP (I), we haveTP (I) �M+.Thus, we can concludeWP (I) �M . 2

The least fixpoint of theWP -operator, if it exists, can serve as the basis for abottom-up construction of stable models.

Definition 5.4.5 Let P be a finite CLP. LetfW0 : : :Wk : : :Wng be the finite se-

quence whosekth term is the k-fold application of theWP -operator on the emptyset (i.eW0 = ;,Wk =WP (Wk�1)) such that eitherWn =2 IP or Wn =WP (Wn).In the latter case we denoteWn asW!P and we say thatP is well-founded.

It is easy to see thatW!P does not always exist.

Example5.4.7 (Choosing Between Two Evils)Consider the following situation.Crossing the African savannah, you can encounter a lot of different species. Someof these species are better avoided. When coming across a horde of elephants, itis better to run into the bushes. Seeing a green mamba in the woods, you bettertry to keep out of its way by going to the open plains. Considernow the unfortu-nate situation where both species are waiting for you to comeby. The situation isrepresented by the following CLP.green mamba � elephants green mamba elephants For P we have:W0 = felephants; green mambag andW1 = felephants; green mamba; not elephants; not green mambag =2 IP :Thus, forP there exists noW!P , and thus a meeting is unavoidable.

Page 145: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 131

Checking the well-foundedness of a program gives a good indication of the exis-tence of stable models. If so,W!P can be used as the starting point in the compu-tation of the stable model of a program. If not, the program has no stable model.

Theorem 5.4.15LetP be a finite CLP.

1. If P is well-founded then for each stable modelM for P ,W!P �M .

2. If P is not well-founded, then there exists no stable model at all.

Proof:

1. W!P exists. In caseP admits a stable model, the statement follows imme-diately from Theorem 5.4.14. Indeed, becauseW0 = ; is trivially includedin any stable modelM . If we apply Theorem 5.4.14, we haveWP (;) �M .We can continue this process until we reachW!P . We will always obtainW!P , sinceP is well-founded. Thus,W!P � M , for all stable modelsM ofP . In case there is no stable model, the statement is triviallytrue.

2. W!P does not exist According to Definition 5.4.5, this implies that thereexists aWn such thatWn =2 IuP . This means thatWn is not an interpreta-tion. We proceed by contradiction by assuming that there exists some stablemodelM of P . We have thatW0 = ; � M . If we apply theorem 5.4.14,we obtainWP (W0) = W1 � M . We continue this process until we reachWP (Wn�1) = Wn � M . In this caseWn must be an interpretation other-wiseM could not be a model. This in contradiction withWn =2 IP .So we can conclude that, ifW!P does not exist, a stable model cannot existeither 2

Well-foundedness does not guarantee the existence of stable models.

Example5.4.8 Consider the following CLPP , illustrating a conflict over a preybetween a cheetah and a number of vultures. heetah vulturesvultures heetah heetah � vultures For this program,W!P equals the empty set although there are no stable models.

Page 146: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

132 CHAPTER 5. CHOICE LOGIC PROGRAMMING

If W!P is total, it is the single stable model.

Corollary 5.4.2 LetP be a finite well-founded CLP. IfW!P is a total interpreta-tion, then it is the unique stable model forP .

Proof: BecauseP is well-founded, we have thatW!P exists. When it is alsototal, we have, by Theorem 5.4.13, thatW!P is a stable model. Furthermore, byTheorem 5.4.15,W!P is included in every stable modelM of P . Hence, sinceW!Pis total,W!P = M . Therefore,W!P is the unique stable model ofP . 25.4.5 An Algorithm for Computing Stable Models

While Theorem 5.4.13 provides a fixpoint characterization of stable models, it isof little use for actually computing them. Nevertheless, the least fixpoint of theWP -operator offers a good starting point for the computation.If W!P does notexist, we can immediately stop our computation as there willbe no stable modelfor this program (Theorem 5.4.15). If it does exist, we can besure that it is asubset of each stable model. In the special situation whereW!P is total, we canconclude that we have found the unique stable model (Corollary 5.4.2). To furtherextendW!P 2 IuP to a stable model, we will employ choice sets18 that represent adecision on how to satisfy an exclusive disjunction. In thissection we will assumethat all programs are finite.

Definition 5.4.6 Let I be an interpretation for a CLPP . A choice setof P w.r.t.I is a set of literals of the formfa; not b1; : : : ; not bng with n 4 0, such that thereexits a ruler : a� b1 � : : :� bn B 2 P for whichHr \ I = ;, andBr � I.The set of all choice sets ofP w.r.t. I is denoted byCP (I).The existence of a choice set implies, by definition, that there exists an applicableyet unsatisfied rule. So we can conclude that there cannot be achoice set for aninterpretation to which only negative information needs tobe added in order toobtain a model.

Theorem 5.4.16LetI be an interpretation for the CLPP . If I [not I is a modelofP thenCP (I) = ;.

18A similar notion, called possibly-true conjunction, can befound in [LRS97].

Page 147: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 133

Proof: N = I [ not I is a model, and thus8r : A B 2 P �B * N or jA \N j = 1 :BecauseA [ B � BP , this implies8r : A B 2 P �B � I impliesA \ I 6= ;and thusCP (I) = ;. 2The reverse of the above statement does not hold.

Example5.4.9 Let P be the following CLP where one has to identify a type ofgiraffe. masai � rot hild 0s � reti ulated Consider now the interpretationI:I = fmasai ; rot hild 0sg :AlthoughCP (I) = ;, this interpretation is clearly not a model.

For unfounded-free interpretations, the reverse does hold.

Theorem 5.4.17Let I be an unfounded-free interpretation for a CLPP . Then,I [ not I is a model ofP iff CP (I) = ;.Proof: The “only-if” part follows immediately from Theorem 5.4.16.For the “if” part, letCP (I) = ; andN = I [ not I. By Definition 5.4.6, thisimplies: 8r : A B 2 P � jA \ Ij 6= 0 orB * I :The latter condition impliesB * N , sinceB is a set of atoms. The formercondition gives rise to two possibilities: eitherjA \ Ij = 1 or jA \ Ij > 1. Theformer yieldsjA \N j = 1, asA contains only atoms. The latter can be rewrittenasA \ I = S with jSj > 1. HenceS 2 UP (I), by means of the first conditionof unfounded sets (see Definition 5.4.1). This situation will, however, not occur,sinceI has to be unfounded-free. ThusjA \ Ij 6= ; reduces tojA \ N j = 1. Sowe may conclude thatN is a model. 2In the special case thatI =W!P , we have thatW!P is total and thus a stable modelif and only if there are no choice sets for it.

Page 148: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

134 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Theorem 5.4.18LetP be a well-founded CLP.W!P is a stable model iffCP (W!P ) = ;.Proof: The “only-if” part follows immediately from Theorem 5.4.16, becauseW!P [ notW!P =W!P , sinceW!P is total, andW!P is a model.To prove the “if” part, we need to show, with Corollary 5.4.2,thatW!P is total. Todemonstrate this, we need to show that for alla 2 BP holds:a 2 W!P+ or a 2 W!P� :With Definition 5.4.5, this yields:a 2 TP (W!P ) or a 2 GUSP (W!P ) :CP (W!P ) = ; implies:8r : a� A B 2 P �Hr \W!P 6= ; orBr *W!P :In caseHr \W!P = S 6= ; andB � W!P hold, there are three possibilities: eitherjSj > 1, S = fag or S = fbg with b 6= a. The first one impliesS 2 UP (W!P )which is impossible sinceW!P is unfounded-free. The second possibility yieldsa 2 TP (W!P ), sinceA 2 UP (W!P ) (condition 1), which meansnot A � W!P . Thelast possibility equalsa 2 GUSP (W!P ) by the first condition of Definition 5.4.1.If B * W!P holds for everyr, thenfag [ W!P 2 UP (W!P ), by condition (3b) ofDefinition 5.4.1. This yieldsa 2 GUSP (W!P ). Thus, we can conclude thatW!P istotal. 2Corollary 5.4.3 Let P be a well-founded CLP. IfCP (W!P ) = ; thenW!P is theunique stable model.

Proof: The result follows immediately from Theorem 5.4.18 and Corollary 5.4.2.2We have demonstrated that ifCP (I) is empty for an unfounded-free interpretationI, I [ not I is a model ofP . This is an interesting stop-criterion for an algorithmthat computes the stable models of a choice logic program, since unfounded-freemodels are automatically stable models (Theorem 5.4.10). However, it does nottell us anything on how to get fromW!P towards a stable model. The next theoremdemonstrates howCP (I) can also be of assistance in this matter.

Page 149: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 135

Theorem 5.4.19LetP be a CLP, letI be an interpretation and letM be a stablemodel ofP such thatI � M andI+ �M+. Then, a choice setX 2 CP (I) existssuch thatI [X �M .

Proof: M is a stable model ofP and thus also a minimal model forP (e.gTheorem 5.2.1). This implies thatI [ not I cannot be a model ofP . So theremust exist a ruler : A B 2 P such thatB � (I [ not I) while jA \ I+j 6= 1.There are two possibilities: eitherjA\ I+j > 1 orA\ I+ = ;. The former yieldsjA \M j > 1 while B � M , becauseI+ � M+ andB � BP . This contradictsthatM is a model ofP . Thus,A\I+ = ;. This gives also rise to two possibilities:eitherA � I� orA\ Iu 6= ;. A � I� is again not possible becauseM is a modelandI � M . ThusA \ Iu 6= ;. BecauseM is a model, we must have9a 2 Iu � a 2M ;from whichX = not (A n fag) [ fag 2 CP (I) andX �M . 2Corollary 5.4.4 LetP be a well-founded CLP such thatW!P is not stable forP .Then, for each stable modelM of P , a choice setX 2 CP (W!P ) exists such thatW!P � W!P [X �M .

Proof: From Theorem 5.4.15, we know thatW!P � M . The combination ofTheorem 5.4.11 and Theorem 5.4.3 yieldsW!P+ � M+. Thus, all the conditionsfor Theorem 5.4.19 are fulfilled, which implies:9X 2 CP (W!P ) �X �M : 2The above corollary suggests a simple way of moving towards the stable modelsof a choice logic program, starting from the least fixpointV0 of theWP -operator:simply add a choice set to the latter, thus obtaining an interpretationV1 = V0[X0for someX0 2 CP (V0). V1 can then be further extended toV2 = TP (V1) [ V1after which we can again add a choice set fromCP (V2). Since a choice setXn ischosen randomly fromCP (Vn), its incorporation may lead to an inconsistent set ofliterals or to an interpretation which is not a suitable candidate to become a stablemodel. The first problem can be fixed by demanding that at each stage the set ofliterals is consistent (e.g. an interpretation). For the latter it is sufficient to checkthe unfounded-free property at the end.

The above observations can be formalized by means of computations.

Page 150: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

136 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Definition 5.4.7 Let P be a well-founded CLP. A sequence of interpretationsfVngn2N is a computationofP when the following conditions hold:� V0 =W!P , and� If TP (Vn) n Vn 6= ; thenVn+1 = TP (Vn) [ Vn, otherwise

– If CP (Vn) 6= ; thenVn+1 = X [ Vn, for someX 2 CP (Vn)– elseVn+1 = Vn .

The next example explains the necessity of demanding that aninterpretation iscreated in every step.

Example5.4.10 (Gazelle Spotting)Let P be the following CLP where an ob-server has to decide which gazelle she sees19:gerenuk � grant all horns �male horns grant all hornsThis program is well-founded becauseW!P = ; :LetV0 =W!P = ;. The choice sets forV0 are:CP (V0) = ffgerenuk ; not grantg; fall horns; notmale hornsg;fgrant ; not gerenukg; fmale horns; not all hornsgg :We choosefall horns; not male hornsg to continue. Then,V1 = fall horns; not male hornsg :Now, V2 = V1 [ TP (V1) = fall horns; not male horns; grantg :BecauseV2 = V3 andV2 2 IP , we can say thatfV0; V1; V2; V3g is a computation.It is easy to see thatV3 is part of the stable modelfall horns; not male horns;grant ;not generukg.

19For the sake of the example we reduced the amount of information the decision maker re-ceives.

Page 151: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 137

In case we would have chosen the choice setfgerenuk ; not grantg instead offall horns; not male hornsg we would have had:V 01 = fgerenuk ; not grantg;V 02 = fgerenuk ; all horns; not male horns; not grantg;V 03 = fgerenuk ; grant ; bla k pat hes; not grant ; all horns; notmale hornsgV 04 = V 03 :However,fV0; V 01 ; V 02 ; V 03 ; V 04g is not a computation sinceV 04 =2 IP . BecauseV 04 isinconsistent it cannot be seen as a suitable candidate to be extended to a stablemodel.

Since we work with a finite Herbrand base, we know that each computationfVngn2N is a monotonic sequence (w.r.t.�) and converges to a limitVn, suchthatVn+1 = Vn; n 2 N . We useV ! to denote this limit.This limit is the most interesting part of the computation. It will be this interpre-tation that will be used as the basis for a possible stable model. So we need somekind of practical tool that checks whether the limit is reached or not. Once more,CP (I) comes to the rescue.

Theorem 5.4.20Let fVngn2N be a computation for a well-founded CLPP andlet Vn 2 fVngn2N . Then,Vn = V ! iff CP (Vn) = ;.Proof: The “only-if” part is immediate from Definition 5.4.7. To show the “if”part, letCP (Vn) = ;. According to Definition 5.4.7, it remains to be shown thatTP (Vn) � Vn. So leta 2 TP (Vn). By Definition 5.4.3 this implies:9r : a� A B 2 P �B � Vn andA � V �n :If a =2 Vn, we have(fag [ not A) 2 CP (Vn), contradictingCP (Vn) = ;. Hencea 2 Vn andTP (Vn) � Vn. 2Now that we are able to distinguish the limit of a computation, we can use thislimit for identifying stable models. Such a limit together with the negation of itspositive complement makes a good candidate for a stable model; one just has toverify that this union is unfounded-free.

Theorem 5.4.21Let fVngn2N be a computation for a well-founded CLPP . IfM = V ! [ not V ! is an unfounded-free interpretation thenM is a stable model.

Page 152: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

138 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Proof: According to Theorem 5.4.20, we haveCP (V !) = ;. BecauseM isunfounded-free,V ! is also unfounded-free, since theGUS-operator is monotonic.Thus, by Theorem 5.4.17,M is a model. Theorem 5.4.10 then implies thatM isa stable model. 2It should not come as a big surprise that each stable model consists of the limit ofa computation and the negation of its positive complement.

Theorem 5.4.22LetM be a stable model for a CLP. Then,M = V ! [ not V !for some computationfVngn2N ofP .

Proof: We will construct a computationfVngn2N whose elements are containedin M . Because there exists a stable model ofP we know, by Theorem 5.4.15, thatW!P exists andW!P � M . Let fVngn2N be the sequence of sets of literals suchthatV0 =W!P and, forn 4 0, Vn+1 is as follows:

1. If TP (Vn) 6= Vn+, thenVn+1 = TP (Vn); otherwise

2. If CP (Vn) 6= ;, thenVn+1 = Vn [X, whereX 2 CP (Vn) andX �M3. elseVn+1 = Vn.

We will prove by induction thatVn �M for eachn 2 N .

(Base of induction)V0 �M is guaranteed by Theorem 5.4.15.

(Induction step) Assume thatVn � M . BecauseM is a stable model andVn �M , we have, with Theorem 5.4.14 and Theorem 5.4.13, that(TP (Vn) [ Vn) �(TP (M) [ Vn) � M . Thus, ifVn+1 is constructed using (1), we haveVn+1 � M .In caseVn+1 is constructed with (2), Theorem 5.4.19 ensures the existence of achoice setX such thatX � M . So,Vn+1 = Vn [ X � M . If Vn+1 = Vn then,by the induction hypothesis,Vn+1 � M . This makesfVngn2N a computation forP such thatV ! � M . By Theorem 5.4.20,CP (V !) = ;. SinceM is unfounded-free andV ! � M , V ! is unfounded-free, by the monocity of theGUS-operator.Combining the last two results yields, with Theorem 5.4.17,thatV ! [ not V ! isa model. The minimality ofM implies thatV ! [ not V ! = M . 2Figure 5.2 on page 155 shows the algorithm for the computation of all stable mo-dels of a finite choice logic program which may contain constraints, based on theresults presented in this section.First, the least fixpointW!P is computed by therepeat-until statement in the

Page 153: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 139

main program. This computation uses, according to Theorem 5.4.8, the fixpointR!P;I(BP ) to compute the greatest unfounded set. If inconsistencies appear dur-ing this fixpoint computation, we know (Theorem 5.4.15), that the program doesnot have any stable models, so we end the program. If everything proceeds nor-mally andW!P is obtained, the conditionW!P+[W!P� = BP is used, according toCorollary 5.4.2, to verify whetherW!P is the unique stable model ofP . If so,W!Pis given as output and the program finishes. Otherwise, the procedureCompute-Stableis invoked to generate all computations ofP . The procedure uses recursionto simulate the backtracking technique on which the computation is based (e.g.you try every choice set until you find the right one to continue).

Theorem 5.4.23Given a finite CLPP , the algorithm of Figure 5.2 on page 155terminates in a finite amount of time and returns the stable models ofP .

Proof: Therepeat-until statement of themainprocedure in Figure 5.2 (page 155)computes the least fixpointW!P , if it exists. The only wayW!P could not exist iswhen an interpretation is computed which is not unfounded-free. In that situa-tion, Theorem 5.4.15 ensures thatP has no stable models, so we can exit the pro-gram. SinceWP is monotonic andBP is finite, this computation halts after a finitenumber of steps. Likewise, therepeat-until statement of the procedureCompute-Stablecomputes a sequenceIi whereI0 = Vn[X andIn+1 = TP (In)[ In. SinceTP is monotonic andBP is finite, this loop also halts finitely. Therefore, the algo-rithm of figure 5.2 terminates in a finite amount of time.As to correctness, we observe that the algorithm essentially generates all compu-tations ofP . Thus, Theorem 5.4.21 and 5.4.22 guaranty both the soundness andthe completeness of the algorithm. 2Example5.4.11 (Antelope Recognition)The programP below can be used todistinguish three kinds of Antelopes: Cooke’s Hartebeests, Topis and Impalas.antelope brown � plum pat hes antelopeboth horns �male horns antelopeimpala male hornshartebeest � topi both hornshartebeest brown; both hornstopi plum pat hes; both horns male horns; plum pat hes

Page 154: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

140 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Below you can see an abbreviated trace of the algorithm applied onP :mainI =W!P = fantelopegI+ [ I� = fantelopeg 6= BP

Compute-Stable(fantelopeg = In)CP (In) = ffbrown; not plum pat hesg; fplum pat hes; not browng;fboth horn; not male hornsg; fmale horns; not both hornggX = fbrown; not plum pat hesgIn+1 = fantelope; brown; not plum pat hesgCompute-Stable(fantelope; brown; not plum pat hesg = In)CP (In) = ffboth horn; notmale hornsg; fmale horns; not both hornggX = fboth horn; not male hornsgIn+1 = fantelope; brown; both horn; not plum pat hes;notmale horns; hartebeestg

Compute-Stable(In+1)CP (In) = ;RP;In[not In(I+n ) = ;outputfantelope; brown; both horn; hartebeest ;not plum pat hes; notmale horns; not impala; not topigX = fmale horns; not both horngIn+1 = fantelope; brown;male horns; not plum pat hes;not both horn; impalag

Compute-Stable(In+1)CP (In) = ;RP;In[not In(I+n ) = ;outputfantelope; brown;male horns; impala;not both horn; not plum pat hes; not hartebeest ; not topigX = fplum pat hes; not browngIn+1 = fantelope; plum pat hes; not browng

Compute-Stable(In+1)CP (In) = ffboth horn; notmale hornsg; fmale horns; not both hornggX = fboth horn; not male hornsgIn+1 = fantelope; plum pat hes; both horns;not brown; not male horns; topigCompute-Stable(In+1)CP (In) = ;RP;In[not In(I+n ) = ;

outputfantelope; plum pat hes; both horns; topi ;

Page 155: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.4. UNFOUNDED SETS AND STABLE MODELS 141not brown; notmale horns; not hartebeest ; not impalagX = fmale horns; not both horngIn+1 = fantelope; plum pat hes;male hornsnot both horn; not brown; impalagCompute-Stable(In+1)CP (In) = ;RP;In[not In(I+n ) = fplum pat hes;male hornsg 6= ;X = fboth horn; not male hornsgIn+1 = fantelope; both horn; not male hornsg

Compute-Stable(In)CP (In) = ffbrown; not plum pat hesg; fplum pat hes; not brownggX = fbrown; not plum pat hesgIn+1 = fantelope; brown; both horn; not plum pat hes;not male horns; hartebeestgCompute-Stable(In+1)CP (In) = ;RP;In[not In(I+n ) = ;

outputfantelope; brown; both horn; hartebeest ;not plum pat hes; notmale horns; not impala; not topigX = fplum pat hes; not browngIn+1 = fantelope; plum pat hes; both horns;not brown; notmale horns; topigCompute-Stable(In+1)CP (In) = ;RP;In[not In(I+n ) = ;

outputfantelope; plum pat hes; both horns; topi ;not brown; notmale horns; not hartebeest ; not impalagX = fmale horns; not both hornsgIn+1 = fantelope;male horns; not both horns; impalagCompute-Stable(In+1)CP (In) = ffbrown; not plum pat hesg; fplum pat hes; not brownggX = fbrown; not plum pat hesgIn+1 = fantelope; brown;male horns; not plum pat hes;not both horn; impalag

Compute-Stable(In+1)CP (In) = ;RP;In[not In(I+n ) = ;outputfantelope; brown;male horns; impala;

Page 156: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

142 CHAPTER 5. CHOICE LOGIC PROGRAMMINGnot both horn; not plum pat hes; not hartebeest ; not topigX = ffplum pat hes; not browngIn+1 = fantelope; plum pat hes;male hornsnot both horn; not brown; impalagCompute-Stable(In+1)CP (In) = ;RP;In[not In(I+n ) = fplum pat hes;male hornsg 6= ;

If we look back at the example above, we see that some stable models are pro-duced more than once: a different order of applying choice sets leading to thesame result. We could avoid this by applying theWP -operator instead ofTP . TheWP operator supplies the necessary negative literals for reducing the applicationsof choice sets. SinceTP never mingles with theGUSP we can, without losingthe result, interchangeWP with TP . However, this comes at a certain cost. TheWP -operator relies onR!P;I to compute the greatest unfounded set. Nevertheless,for programs where there are a lot of constraints and/or rules with more than onehead-atom, the cost for computing the greatest unfounded set in each function-callcan be compensated by the reduced depth of the recursion tree. When applyingthis strategy, we can drop the test for unfounded-freeness when a leaf of the treeis encountered.For more general programs, a compromise can be found. Instead of checking allconditions for unfounded sets, we restrict to just testing the first two. We shall callthis reduced unfounded sets. The reduced greatest unfounded set is denoted byGUSP . The computation of theGUSP has no need for a fixpoint-operator startingfrom the Herbrand Base. It suffices to look at all the real choice rules and con-straints, such that the necessary atoms can be added toGUSP . The combinationwith TP will be denotedWP . The use ofWP still requires the unfounded-freenesstest when the limit of a computation is reached. It should notbe hard to see thatwe can, without problems, useWP instead ofTP . In case of our example thiswould reduce the recursion level to 1 and prevent the repetition of stable models.

5.5 Choice Logic Programs and Game Theory

In this section we will take a closer look at one of the many application areasof choice logic programming, namely Game Theory. We will demonstrate that

Page 157: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.5. CHOICE LOGIC PROGRAMS AND GAME THEORY 143

strategic games20 can be elegantly transformed into choice logic programs suchthat the Nash equilibria can be obtained as the stable modelsof the program.

Example5.5.1 If we look back to the choice logic program in Example 5.2.1 wecan extract out of the program the strategic game:Shareh Fighth2; 2Share l 4; 0 0; 41; 1Fight lThis game has a single Nash Equilibrium:(Fight lions ;Fighthyaenas) :which is identical to the single stable model of the program (Example 5.2.2).

When we examine the relation between the program and the gamein the aboveexample, we see that the action set of each player has become the head of a choicerule. Furthermore, each possible action of one player corresponds to the body ofa rule with head the best response(s) of the other player in reaction to this. Weformalize these findings in the next definition.

Definition 5.5.1 LetG = hN; (Ai)i2N ; (<i)i2Ni be a strategic game. The choicelogic programPG associated withG contains the following rules:� For each playeri, PG contains the ruleAi .

This rule ensures that each playeri chooses exactly one action fromAi.� For each playeri and for eacha 2 A�i, PG contains a rule21 Bi(a) a .This rule models the fact that a player will select a “best response”, giventhe other players’ actions.

Essentially,PG simply forces players to choose an action. Moreover, the actionchosen should be a “best response” to the other players’ actual choices.

20See Section 4.2 on page 60 for detailed information.21We abuse notation by writinga for the set of components ofa.

Page 158: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

144 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Example5.5.2 It is commonly known that zebra and wildebeest like each other’scompany on the African plains. In the evening they migrate tothe mountains forshelter. During the day they can be found near the lake. Evening is falling but thezebra would like to graze some more while the wildebeest prefer to leave alreadyfor the mountains. But no matter the final decision, it is mostimportant that thetwo groups remain together. This gives them a better protection against predatorattacks.As a game this looks like: Mountainsw2; 10; 0Mountainsz 0; 01; 2LakewLakezThis game has two Nash equilibria:(Mountainszebra ;Mountainswildebeests) and(Lakezebra ;Lakewildebeests) :Transformed into a choice logic program, we obtain:mountainszebra � lakezebra mountainswildebeest � lakewildebeest mountainszebra mountainswildebeestlakezebra lakewildebeestlakewildebeest lakezebramountainswildebeest mountainszebraObviously, we have thatfmountainszebra ;mountainswildebeestnot lakezebra ; not lakewildebeestg andflakezebra ; lakewildebeest ; notmountainszebra ; not mountainswildebeestgare the stable models of the program.

This correspondence between stable models and Nash equilibria is formalized bythe following theorem.

Theorem 5.5.1 For every strategic gameG = hN; (Ai)i2N ; (<i)i2Ni a choicelogic programPG (Definition 5.5.1) exists such that the set of stable models of PGcoincides with the set of Nash equilibria ofG.

Page 159: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.5. CHOICE LOGIC PROGRAMS AND GAME THEORY 145

Proof:� Every stable model is a Nash equilibrium. LetM be a stable model ofPG,with PG constructed according to Definition 5.5.1. With Theorem 5.2.1, thisautomatically implies thatM is a model ofPG. We now have to show thatM coincides with a Nash equilibrium. Since Nash equilibria are profiles,we first need to demonstrate thatM contains one and only one elementfrom each action setAi, with i a player ofG. This is guaranteed by therules of typeAi andM being a model ofPG. For each rule of the typeAi , we have that the rule is applicable (the body is empty), thus, sinceM is a model, the rule has to be applied. This yields, with Definition 5.2.3,jAi \M j = 1. Since this is true for everyi 2 N , we have proven thatM isa profile ofG.To demonstrate that this profileM is a Nash equilibrium, we need to prove,according to Definitions 4.2.2 and 4.2.3, that every playeri, given the otherplayers’ actions, chooses one of her best responses. Thus, we only need tolook at the rules r:H M�i and this for every player22 i. BecauseMis a model and a profile, we have that(H \M = fag) � Ai. Due to thecreation ofPG (see Definition 5.5.1), we know thata is the best response forplayeri, in case the other players chooseM�i (e.ga 2 Bi(M�i)). Becausethis is true for every playeri, we obtain thatM is a Nash equilibrium of ourstrategic gameG.� Every Nash equilibrium is a stable model. LetE be a Nash equilibrium forthe strategic gamehN; (Ai)i2N ; (<i)i2Ni. We first show thatE is a modelfor PG. Because Nash equilibria are action profiles (Definition 4.2.2), weknow that one and only one action is undertaken from each action setAi.Therefore, all the rules of typeAi are satisfied, sincejAi \ Ej = 1. Itis easy to see that Nash equilibria are composed out of best responses. Thismakes that the other rules are satisfied as well. In the first place, if the bodydoes not contain all best responses to the other players’ actions, we havethat this rule is not applicable. If the body contains only best responses, weknow from the creation ofPG that the head contains the best responses tothe actions taken in the body. This makes, together withjAi \ Ej = 1, thatthese rules are also satisfied. This yields thatE is a model forPG.

22For each player such a rule exists, thanks to the creation ofPG (Definition 5.5.1).

Page 160: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

146 CHAPTER 5. CHOICE LOGIC PROGRAMMING

To end this proof, we have to show, with Theorem 5.2.1, thatE is alsoa minimal model ofPG. It is very easy to see that every model ofPG isminimal, thanks to the rulesAi . If one takes an atoma away fromE, theruleAi with a 2 Ai will no longer be satisfied, asjAi \ Ej would equal0 in this case. SoE is a minimal, and thus a stable (Theorem 5.2.1) model.2

5.6 Relationship with Other Approaches

5.6.1 Logic Programming Formalisms

In Section 5.3 we have already demonstrated that choice logic programs can sim-ulate semi-negative logic programs such that the stable models coincide. Nowwe investigate a number of other formalisms that can be simulated by means ofchoice logic programs. We also discuss how other formalismshandle the conceptof choice and constraints.

The first formalism we are interested in is disjunctive logicprogramming and itspossible model semantics23. This semantics allows for both inclusive and exclu-sive treatment of disjunction whenever possible. They alsogo beyond minimality,i.e. a possible model is not necessarily minimal.In this chapter we restrict ourselves to positive programs.However, a similartechnique combined with the proposed transformation for semi-negative logic pro-grams can be used for disjunctive logic programs with negation.

Example5.6.1 The big five of the African plains are not always fond of eachother’s company. For example the buffalo will avoid spending time with the lions,as these might attack him. Lions are not in favor of the buffalo either, since he isa dangerous prey to attack.elephant _ bu�alo bu�alo _ lion bu�alo; lion

23See Chapter 3 Section 3.4.2 on page 39 for detailed information.

Page 161: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.6. RELATIONSHIP WITH OTHER APPROACHES 147

This program has the following split programs:elephant bu�alo bu�alo; lion elephant bu�alo bu�alo; lionbu�alo bu�alo; lion bu�alo lion bu�alo; lionelephant bu�alo lion bu�alo; lionSince the last two split programs have no models, the possible models are:felephant ;bu�alo; not liong,felephant;lion; not bu�alog andfbu�alo;not ele�phant ; not liong.The following definition transforms a positive disjunctivelogic program into achoice logic program.

Definition 5.6.1 Let P be a positive disjunctive logic program. The correspon-ding choice logic programP P can be constructed fromP by replacing everydisjunctive ruler 2 P by the following rules:8a1 _ : : : _ an B 2 P; n > 1 � ai � fai B 2 P P with 1 � i � n and fa1 ; : : : ; fan 2 P P :The transformation introduces a new symbolfa for each atoma that appears inthe head of a disjunctive rule and putsfa together witha in the head of a choicerule. This new symbol should be read as “falsify a”. So in casethe body of thedisjunctive rule is true, a choice is forced between makinga true or false. Theconstraint is added to assure that at least one head atom is accepted. In otherwords, the constraint makes sure that the original rule is applied as soon as therule is applicable. This construction allows minimal models to take as many headatoms from the disjunction as they see fit, which is exactly the philosophy behindthe possible model semantics.

Page 162: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

148 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Example5.6.2 The corresponding choice logic program of the disjunctive logicprogram of Example 5.6.1 would look like:elephant � felephant bu�alo � fbu�alo lion � flion bu�alo; lion felephant ; fbu�alo fbu�alo ; flionThis program has 3 stable models, namely:felephant ; bu�alo; fliong; felephant; lion; fbu�alogfbu�alo; felephant ; fliong :The similarity between the possible models of Example 5.6.1and the stable mo-dels of Example 5.6.2 is not a coincidence, as demonstrated by the next theorem.

Theorem 5.6.1 Let P be a positive disjunctive logic program and letP P be thecorresponding choice logic program, according to Definition 5.6.1. Then,M is astable24 model ofP P iff M \ BP is a possible model ofP .

Proof:� Let M be a stable model ofP P . By Theorem 5.2.1,M is also a minimalmodel ofP P . We need to prove thatN = M \ BP is a possible model.Hence, according to Definition 3.4.10, it suffices to show that N is the sta-ble/minimal model of a split programP S. We will construct this split pro-gram. In case there are no disjunctive rules, we immediatelyhave our result,sinceP P = P = P S andM is a stable/minimal model ofP P . Otherwise,for each disjunctive ruler 2 P (i.e. jHrj > 1) we add the following rulestoP S: Hr \M = D : D 6= ; : 8a 2 D � a Br 2 P SD = ; : 8a 2 Hr � a Br 2 P S :Non-disjunctive rules and constraints are added unchangedtoP S. It is easyto see thatP S is indeed a split program, according to Definition 3.4.9.

24Since both semantics are total, we restrict ourselves to thepositive part of the interpretation.

Page 163: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.6. RELATIONSHIP WITH OTHER APPROACHES 149

We will demonstrate thatN is a minimal model ofP S. We start by provingthatN is a model ofP S. The only rules that need to be verified are thosethat originate from a disjunctive rule. Non-disjunctive rules and constraintsare also part ofP P and thus satisfied, sinceM is model ofP P . Assumer 2 P S is created from a disjunctive ruler0 2 P and letBr � N �M . Thetransformation ofP to P P (Definition 5.6.1) creates, for everya 2 Hr0, arulea� fa and a constraint25 fHr0 . BecauseM is a model ofP P , wemust have at least onea 2 (Hr0 \M). This implies that forr0 only thoserulesr are created withHr 2 N . Thusr is satisfied byN . This allows usto conclude thatN is a model ofP S.

It remains to be shown thatN is minimal. This can be done by proving thatevery total interpretationN 0 � N is not a valid model forP S. Take suchaN 0. Let M 0 = N 0 [ ffn 2 M j n � fn B;B � N 0g. It is easy tosee thatM 0 � M . BecauseM is a minimal model ofP P , we must havethat at least one ruler 2 P P is not satisfied byM 0. We already know thatr cannot be a constraint, since positive constraints are easier satisfied withless atoms. This leaves us two possibilities:r is either a choice rule or not.The former case yields a rule of the formn� fn B with B �M 0 �M ,fn; fng\M 0 = ; andn =2 N 0. The construction ofM 0 impliesfn =2M andB � N 0. BecauseM is a model, we must haven 2M . The creation ofP PandP S from P ensures the existence of a ruler0 : n B 2 P S. This ruleis definitely not satisfied byN 0, asB � N 0 andn 62 N 0. In caser is not achoice rule, we immediately know thatr 2 P andr 2 P S. This yields thatr will not be satisfied byN 0. So, we can conclude that in every situationN 0falsifies at least one rule. Thus,N 0 is not a model forP S.� Let M be a possible model ofP and letP S be the split program that pro-ducesM as a stable/minimal model. We will prove thatN = M [ ffa j H B 2 P; jHj > 1; B �M; a 2 Hr nMgis a stable model ofP P . The construction ofN guarantees thatM = N \BP . With Theorem 5.2.1, it suffices to demonstrate thatN is a minimalmodel ofP P .

We first show thatN is a model ofP P . The creation ofN ensures thatNsatisfies all the choice rules inP P . The satisfaction of the constraints that

25fHr0 is the abbreviation offfa j a 2 Hr0g.

Page 164: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

150 CHAPTER 5. CHOICE LOGIC PROGRAMMING

originate from a disjunctive rule is guaranteed by the creation ofP P andMbeing a model forP S. The remaining rules and constraints are immediatelysatisfied, since they appear inP S andM is a model for this program. Thus,N is a model ofP P .

It remains to be shown thatN is also minimal. We will demonstrate that ev-ery total interpretationN 0 � N is not a valid model. LetM 0 = N 0\BP . Letus first consider the case in whichM 0 6= M . SinceM is a stable/minimalmodel ofP S, we know thatM 0 is not a model ofP S. This implies that:9r : a B �B �M 0 ^ a 62M 0 :This yieldsB � N 0, B � M anda =2 N 0. BecauseM is a model ofthis program,a 2 M . In caser 2 P P , we automatically have thatN 0is not a model ofP P . Otherwise,r comes from a disjunctive rule. Thusa � fa B 2 P P with B � N 0 anda =2 N 0. Sincea 2 M , we know,because of the definition ofN , thatfa =2 N and thusfa =2 N 0, sinceN 0 �N . Thus, this rule is unsatisfied andN 0 is not a model ofP P . The onlypossibility that remains to be verified is whenN 0 � N andM 0 = M . Theonly difference betweenN andN 0 is the number offn that are consideredtrue. Letfa be an element ofN n N 0. There must be a disjunctive rulersuch thatBr � M , a 2 Hr anda =2 M . This ruler is responsible for thecreation ofr0 : a� fa Br. SinceM = M 0, we have thatN 0 falsifies thisrule (a =2 N 0, fa 62 N 0 andBr � N 0). Thus, also in this situation, we obtainthatN 0 is not a valid model ofP P . 2

In [SN98], a language for product configuration was defined. The language, calledCRL, coincides with disjunctive logic programs and the proposed semantics co-incides with the possible model semantics. This implies that we can implementCRL in our system and use choice logic programming for product configuration.In [SN99], the authors add exclusive choice to the CRL language. This allowsthem to represent product configuration more elegantly. Since our language isbased on exclusive choice we can easily accommodate this extra feature of CRL.

Example5.6.3 (Adapted from [SN99]) As an example of a configurable prod-uct, consider a PC. The components in a typical configurationmodel of a PCinclude different types of display units, hard disks, CD-Rom drives, floppy drives,extension cards and so on. These have rules on how they can be combined with

Page 165: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.6. RELATIONSHIP WITH OTHER APPROACHES 151

each other to form a working product. For example, a PC would typically be de-fined to have a storage device which must be chosen from a set ofalternatives,e.g. an IDE hard disk, a SCSI hard disk or a floppy drive. A computer would alsoneed a keyboard, which in Belgium could be either Querty or Azerty. Having aSCSI hard disk in the configuration of a PC would typically require that an addi-tional SCSI controller is included in the configuration as well. In addition, a PCmay optionally have a CD-Rom drive. A configuration model fora PC might alsodefine that unless otherwise specified, an IDE hard disk will be the default choicefor mass storage.This simple configuration model of a PC could consist of the following rules: omputer IDEdisk � no IDEdisk omputerSCSIdisk � no SCSIdisk omputer oppydrive � no oppydrive omputerIDEdisk no SCSIdisk ; no oppydriveAzertyKB � QuertyKB omputerSCSI ontroller SCSIdiskCDplayer � no CDplayer It is easy to see that the stable models of this choice logic program correspond

exactly with the computers that can be constructed according to the given specifi-cation.

[SN99] presents also an other application domain for their CRL language, namelyconstraint satisfaction problems (CSP). A CSP consists of aset of variables, aset of possible values for each variable, called the domain of the variable, and aset of constraints. A constraint defines the allowed combinations of values for aset of variables by specifying a subset of the Cartesian product of the domainsof the variables. A solution to a CSP is an assignment of values to all variablessuch that the constraints are satisfied. A DCSP is an extension of a CSP. Here itis not necessary that all variables receive a value in a solution. [SN99] definesa mapping from the DCSP formalism to CRL. Since CSPs are special DCSPs,the same mapping can be applied to CSPs. This mapping uses only the exclusivedisjunctive statements of the language. Hence, we can applythe same transforma-tion as for semi-negative logic programs to eliminate negations in order to obtainthe solutions of the DCSPs as rational stable models of the obtained choice logicprogram.

Page 166: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

152 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Example5.6.4 (Adapted from [SN99]) Consider a DCSP with two variables,package and sunroof, whose domains arefl ; d ; sg (i.e. luxury, deluxe and stan-dard) andfsr 1; sr 2g, respectively. The variable package is active, i.e. it mustreceive a value. There is also a constraint: ifpa kage has valueluxury , thensunroof is active (e.g. needs to get a value), The following choice logic programis produced: pa kage pa kage(l)� pa kage(d)� pa kage(s) pa kagesunroof (sr 1)� sunroof (sr2) sunroofsunroof pa kage(l)This choice logic program has four (rational) stable modelscorresponding to thefour solutions of the DCSP.

Until now we have only worked with logic programming formalisms that allownegation as failure in body. We have never considered the occurrence of truenegation. The reason for this is very simple, a program that has true negation (inboth head and body) can be replaced by an equivalent program without classicalnegation ([Lif00]).

Example5.6.5 (Black Rhino) Consider the following simple example26:poa hing _ prote ted bla k rhino prote ted:bla k rhino poa hingThis program has two possible models:fpoa hing;:bla k rhinog; fprote ted ; bla k rhinogThe corresponding program without classical negation is:poa hing _ prote ted bla k rhino prote tedno bla k rhino poa hing bla k rhino; no bla k rhinoThis program has two possible models that correspond to the possible models ofthe original program. One simply replaces:bla k rhino byno bla k rhino.

26: denotes classical negation.

Page 167: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.7. CONCLUSIONS 153

This example illustrates that the relationship with semi-negative logic programsand possible models for disjunctive logic programs remain valid in the presenceof classical negation.

5.6.2 Logic Programming and Strategic Games

In Section 4.4 we discussed several mechanisms that use logic for investigatinggame theoretic behavior. Most of this this research focuseson model and epis-temic logic. To our knowledge there are only two mechanisms that relate logicprogramming to game theory, namely [Dun95] and [Poo97]. Theformer uses therelation between argumentation frameworks and logic programming to establishthe result. However, [Dun95] discusses a totally differenttype of game, namelycooperation games where agents may work together to obtain abetter result. Sincestrategic games do not allow any interaction between the players it is not possi-ble to relate both systems. On the other hand, the latter system, ICL ([Poo97]),also models strategic games. The main difference with our approach is that we donot go outside of the realm of logic programming to recover the notion of Nashequilibria. Contrary to ICL, werely on non-determinism to represent alternatives,and on the properties of stable semantics to obtain Nash equilibria. As for theconsequences of choices, these are represented in choice logic programs, much asthey would be in ICL. Choice Logic Programming succeeded in recovering Nashequilibria without adding any fundamentally new features to logic programs (onthe contrary, we got rid of negation in the body). However, the results are re-stricted to so-called “pure” equilibria where each participant must choose a singleresponse. In a later chapter, Chapter 7 on page 265, we will introduce an ex-tension of choice logic programming that will allow each participant to assign aprobability distribution amongst her available actions.

5.7 Conclusions

In this chapter we introduced a formalism for modeling decisions, exclusive choi-ces between a number of alternatives. Our programs do not allow negation, eitherclassical or as failure, in the head or the body of rules. We demonstrated thatthis is not really a loss of expressiveness, as we can simulate semi-negative logicprograms (e.g. programs that allow negation as failure in the body of the rules)such that their stable model semantics coincides with the (rational) stable model

Page 168: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

154 CHAPTER 5. CHOICE LOGIC PROGRAMMING

semantics of the transformed program. The same can be said about disjunctivelogic programs and their possible model semantics. The appearance of classicalnegation is not a problem either, as argued in Section 5.6. Although negation isnot explicitly present in our programs, it does appear implicitly. For example, if achoice is made, we can conclude that the other alternatives have to be false and ifall atoms of a constraint except one are true then we are forced to make that lastatom false. These ideas are incorporated in our notion of unfounded sets, whichcan be used advantageously for the computation and detection of stable models ofchoice logic programs with constraints. While choice logicprograms can be usedin a wide range of domains, we focused on game theory, where CLP can be usedto model strategic games. We were able to retrieve the Nash equilibria of strategicgames as the stable models of the corresponding choice logicprogram.

In the next two chapters we will extend our choice logic programming formalismin order to model (dynamic) preferences amongst various alternatives of a decisionand to deal with and to reason about uncertainty. In these chapters we will alsosee that these two new approaches can be advantageously usedto model gametheoretic behavior.

Page 169: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

5.7. CONCLUSIONS 155

Input: A CLPP .Output: The stable models ofP .

ProcedureCompute-Stable(In :SetOfLiterals); /*In always consistent */var X, I 0n, In+1 : SetOfLiterals;begin

if CP (In) = ; /* no choices available */then if R!P;In[not In(I+n ) = ;; /* and unfounded-free */

output ”In [ not In is a stable model ofP ”;end-if;

else foreachX 2 CP (In) doIn+1 := In [X; /* Assume the truth of achoice set */

repeatI 0n := In+1;In+1 := TP (In+1) [ In+1;until In+1 = I 0n or In+1 \ not In+1 6= ;;if In+1 \ not In+1 = ; /* In+1 is consistent */then Compute-Stable(In+1);end-if;

end-for;end-if;

end-procedure;

var I,J : SetOfLiterals;G : SetOfAtoms;begin /*Main */I := ;;

repeat /* Computation ofW!P if it exists */J := I;G := GUSP (J); /* by means ofR!P;J(BP ) */if G \ J 6= ; /* J not unfounded-free */then exitend-if;I := TP (J) [ not G; /* =WP (J) */

until I = J ;if I+ [ I� = BPthen output ”I is the unique stable model ofP ”;elseCompute-Stable(I)end-if;

end.

Figure 5.2: Algorithm for the Computation of Stable Models for choice logicprograms.

Page 170: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

156 CHAPTER 5. CHOICE LOGIC PROGRAMMING

Page 171: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Chapter 6

Ordered Choice Logic Programming

In this chapter we extend choice logic programs to allow preference-based reaso-ning, which will allow us to represent more complex decision-problems.

6.1 Introduction

Preferences or order amongst defaults and alternatives of adecision play an impor-tant role in knowledge representation and non-monotonic reasoning, especially insystems that model the complex way that people reason in every day life. In caseof conflict, humans tend to prefer a default or an alternativewhich corresponds tomore reliable, more complete, more preferred or more specific information.

In recent years several proposals for the explicit representation of preference inlogic programming formalisms have been put forward. [LV00,BFL99] are justtwo examples of systems that mainly deal with exceptions to defaults.

Working with preferences/order has applications in various domains, e.g. law,object orientation, model based diagnosis or configurationtasks. However, mostsystems use the preferences when the model is already being computed, whichmeans that the decisions already have been made, or only support preferences be-tween rules with opposite consequences, which fixes the alternatives and leavesout the possibility to have decisions with more than two alternatives. In this chap-ter we present a formalism which enables us to reason about decisions involvingmultiple alternatives that may depend on the situation at hand. The dynamics ofour formalism is demonstrated by the following example.

157

Page 172: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

158 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Example6.1.1 It is the end of February and the time has come to plan the annualsummer vacation. This year the choice has been reduced to a city trip to Londonor a fortnight stay in either Spain or Mexico. A city trip to London is rather shortand Mexico is kind of expensive. Of course, with a larger budget, a trip to Mexicoin the Summer and a city trip to London in the Spring could possibly be combined.Given these considerations, there are two possible outcomes:� we have a small budget and we should opt for the Spanish sun, or� with a larger budget, we have a trip to Mexico and a weekend in London.

In both situations we have that Mexico, Spain and London are alternatives forthe choice of our travel destination, because having no summer vacation is notan option. For the first outcome, we simply take the best possible alternative, i.e.Spain. Otherwise, we have good reason to take more than one alternative. So wetake both Mexico and London.

To allow this kind of reasoning we need two mechanisms: one todetermine theconditional decisions and one to allow circumstance-dependent preferences forthe possible alternatives of the decisions. As argued in Chapter 5, choice logicprograms are an intuitive tool for representing decision-problems, as the seman-tics ensures that exactly one alternative is chosen when thecondition for the de-cision is met. For the preferences, we use a multi-alternative generalization ofthe ideas behind ordered logic programming, [GLV91]. Our formalism, calledOrdered Choice Logic Programming (OCLP) [DVV00b], combines the best ofboth formalisms by defining a strict partial order amongst choice logic programs,called components. Each component inherits the rules from less specific com-ponents. The standard model semantics is used until a conflict arises, then themore specific alternative is decided upon. Being confrontedwith two equally pre-ferred alternatives you have two options: either make no decision or pick a randomchoice. We will investigate both ways of reasoning. We equipour OCLPs with astable model semantics to obtain the more cautious rationalsolutions to the rep-resented decision-problem. A fixpoint characterization and an efficient algorithmfor this semantics will be provided. To investigate the morecredulous approach,we define the answer set semantics, which is also accommodated with a fixpointoperator and an algorithm. Furthermore we demonstrate thatextended logic pro-grams and choice logic programs can be elegantly transformed into negation-freeOCLPs such that the stable model semantics is maintained.

Page 173: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.1. INTRODUCTION 159

Although ordered choice logic programming can add new viewpoints to the abovementioned application domains, we will focus on a novel application in GameTheory. In [DVV00b], it was shown that an extensive game withperfect informa-tion can be transformed into an OCLP such that the answer setsof the programcorrespond, depending on the transformation, to the Nash orsubgame perfectequilibria of the game. Although these equilibria are very useful for predictingthe outcome of a game, it is still possible that a player, given the other players’actions, has a rational choice between multiple outcomes. In order to make theoutcome deterministic, we introduce cautious Nash and subgame-perfect equilib-ria as the stable models of the program corresponding to the game.

The rest of this chapter is organized as follows. In Section 6.2 we introduceour Ordered Choice Logic Programming formalism ([DVV00b])and its minimalmodel semantics. For choice logic programs (Chapter 5 on page 5) we demon-strated that the minimal model semantics and the stable model coincide (Theo-rem 5.2.1). For OCL-programs, the minimal model semantics is no longer suffi-cient. Therefore, we introduce, in Section 6.3, the stable model semantics for or-dered choice logic programs. In Subsection 6.3.1, we show that OCLP is a genera-lization of CLP when then stable model semantics is concerned (Theorem 6.3.1).In Subsection 6.3.2, we provide a fixpoint characterizationof stable models usingunfounded sets (Theorem 6.3.12) and a bottom-up algorithm (Theorem 6.3.26).

The stable model semantics is very skeptical when it concerns two equally pre-ferred alternatives of a decision. It simply remains indecisive. In some situationsa choice between these alternatives is more appropriate. Therefore, we intro-duce the more credulous answer set semantics in Section 6.4.In Subsection 6.4.1we demonstrate that an answer set is not necessarily a minimal model (Exam-ple 6.4.7). In addition we investigate the relationship between the stable modelsemantics and the answer set semantics. In Subsection 6.4.2we provide a fixpointcharacterization (Theorem 6.4.13) and a bottom-up algorithm (Theorem 6.4.25)for the answer set semantics based on assumption sets.

For choice logic programs we were unable to have a complete mapping betweenthe stable models of a logic program and the stable models of the correspondingchoice logic program. But what fails for choice logic programs succeeds for or-dered choice logic programs. In Section 6.5, we even go a stepfurther by showingthat the answer sets of an extended logic program can be retrieved as the stablemodels of its corresponding OCLP (Theorem 6.5.1).

In Section 6.6 we demonstrate that ordered choice logic programs are an elegant

Page 174: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

160 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

tool to represent extensive games with perfect informationsuch that the Nash andthe subgame perfect equilibria can be obtained as the answersets of the corres-ponding program (Theorems 6.6.1 and 6.6.2). These equilibria still allow a singleplayer to rationally leave its equilibrium state. This way it becomes difficult forthe other player to predict the outcome of the game. To eliminate this extra sourceof non-determinism, we introduce, in Subsection 6.6.2, cautious Nash and sub-game perfect equilibria as the stable models of the corresponding OCLP.

Before finishing this chapter with conclusions in Section 6.8, we look into therelations with other approaches in Section 6.7.

6.2 Ordered Choice Logic Programs

In this section we introduce the basic notions concerning ordered choice logicprogramming.

The language used by ordered choice logic programs is identical to the one usedby choice and semi-negative logic programming (Definitions3.2.1 and 3.3.1).

An ordered choice logic program [DVV00b] is a collection of choice logic pro-grams, called components, each representing a portion of information. The rele-vance or preciseness of each component with respect to the other components isexpressed by a strict pointed partial order1.

Definition 6.2.1 An Ordered Choice Logic Program, or OCLP, is a pairhC;�iwhereC is a finite set of choice logic programs2, calledcomponents, and “�” isa strict pointed partial order onC.For two componentsC1; C2 2 C, C1 � C2 implies thatC2 contains more generalinformation thanC1. An OCLP is calledfinitewhen all its components are finite.Throughout the examples, we will often represent an OCLPP by means of adirected acyclic graph (dag) in which the nodes represent the components and thearcs the�-relation.

1See Definition 2.0.5 on page 8 for detailed information.2We assume that all rules are grounded; i.e. any rule containing variables has been replaced

with all its ground instances.

Page 175: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.2. ORDERED CHOICE LOGIC PROGRAMS 161

P2P5 small � larger London larger

travel Spain P3P4P1 London

Mexi o largerLondon �Mexi o � Spain travelMexi o

Figure 6.1: The travel OCLP of Example 6.2.1

Example6.2.1 The decision problem from the introduction (Example 6.1.1)caneasily be written as an OCLP, as displayed by Figure 6.1. The rules in the com-ponentsP1, P2 and P3 express the preferences in case of a small budget. Therules inP4 explain that we want to travel and, because of this, we need tomakea decision concerning our destination. In componentP5, the first rule states thatthere is also the possibility of a larger budget. In this case, the two other rules inthis component tell us that we can have both London and Mexico.

OCLPs are designed to model preference-based information/knowledge by meansof rules in logic programs. Information should remain validin a program as longas there is no contradictive information present. For this reason we introduceP �as the CLP that contains all the rules that appear in one of thecomponents ofthe OCLPP . Here, each rule is assumed to be labeled by the component it wastaken from. Hence we can use (r) to retrieve the component of a rule inP �. TheHerbrand baseof an OCLP, denotedBP , is the Herbrand base of the choice logicprogramP �.In these circumstances, an interpretation for an OCLP is nothing more than aninterpretation forP �. Since we want to use the normal semantics until a conflictarises, we can adopt the notions for applicability and appliedness from CLP.

Page 176: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

162 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Definition 6.2.2 LetP be an OCLP. Aninterpretationfor P is any interpretationof P �. The set of all interpretations forP is denotedIP . For I 2 IP andr a rulein P , we say thatr is applicablew.r.t. I iff Br � I; r is appliedw.r.t. I iff r isapplicable andjHr \ Ij = 1.

When it is clear from the context that only total interpretations are considered,we will omit the negative part. If necessary it can be retrieved by means of thepositive complement.

Example6.2.2 Reconsider the travel OCLP from Example 6.2.1. The setsI =fMexi o;small ;not Spaing, J = ftravel ;Mexi o;small ; not London; not Spain;not largerg,K = ftravel ;Spain;small ; not larger ;not London;notMexi og andL = ftravel ;London;Spain;Mexi o;larger ;not smallg are all interpretations forthis OCLP. The interpretationI makes the rulesmall � larger applied whilethe ruleLondon is applicable but not applied. WhileJ , K andL are total,Iis not.

A decision involves a choice between several alternatives.In a CLP, decisionsare generated by so-calledchoice rules, i.e. rules with multiple head atoms. Weuse the same technique here, except that we need to take the partial order intoaccount as well. Hence we say that an atoma is analternativefor an atomb in acomponentC if there is an applicable choice rule present in a component at leastas preferred asC, such thata andb appear together in the head.

Definition 6.2.3 Let P = hC;�i be an OCLP, letI be an interpretation and letC 2 C. The set ofalternativesin C for an atoma 2 BP w.r.t. I, denotedIC(a),is defined as3:IC(a) = fb j 9r 2 P � � (r) 4 C ^ Br � I ^ a; b 2 Hr with a 6= bg :Example6.2.3 Reconsider the interpretationsI andJ from Example 6.2.2. Thealternatives forMexi o in P2 w.r.t. J are JP2(Mexi o) = fSpain;Londong.With respect toI we obtainIP2(Mexi o) = ;, since the choice rule inP3 is notapplicable. When we takeP5 instead ofP2, we obtain w.r.t.J : JP2(Mexi o) = ;.

34 is the reflexive closure of�.

Page 177: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.2. ORDERED CHOICE LOGIC PROGRAMS 163

Atoms that are each others’ alternative with respect to a certain interpretation willcontinue to be this in any extension of this interpretation.In other wordsP is amonotonic operator.

Theorem 6.2.1 LetP = hC;�i be an OCLP, letI; J be two interpretations4 forP with I+ � J+, and letC 2 C be a component ofP Then, for alla 2 BP :IC(a) � JC(a) :Proof: In order to prove this, letb be an alternative fora in C w.r.t. I. If nosuchb exists, then the inclusion is trivially true. Otherwise,b being an alternativeimplies: 9r 2 P � � (r) 4 C ^ Br � I ^ b; a 2 Hr :BecauseBr � BP andI+ � J+, we haveBr � J . With Definition 6.2.3, weobtainb 2 JC(a). 2As long as we do not encounter any conflicts, we can adapt the usual orderedlogic semantics [GLV91] where defeating among rules is usedto select a morepreferred alternative. But what happens if two alternatives are equally preferredor unrelated? Should you make an arbitrary choice between the alternatives or isit more appropriate to remain indecisive? Both points of view have their meritsand drawbacks. The former is a more credulous approach whichmakes a deci-sion whenever necessary but, by doing this, it provides an extra source of non-determinism. The latter is more cautious. It does not make any decisions whenthere is no persuasive reason. In some cases this is more advisable: for example,when two of your friends have an argument and ask you to take sides.

In Section 6.4 we will introduce the more credulous approach. In this section andin the next we will adopt the cautious approach where a ruler is defeated if thereare more preferred rules suggesting alternatives for each atom inHr.Definition 6.2.4 Let I be an interpretation for an OCLPP . A rule r 2 P � isdefeatedw.r.t. I iff8a 2 Hr � 9r0 2 P � � (r0) � (r) ^ Br0 � I ^ Hr0 � I (r)(a) :

4Notice that it is not necessary forJ to be an extension ofI . It suffices thatJ contains at leastthe same positive information.

Page 178: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

164 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Example6.2.4 Reconsider the interpretationsJ andL from Example 6.2.2. TheruleLondon is defeated w.r.t.J by the ruleMexi o . The ruleLondon �Mexi o�Spain is defeated w.r.t.L by the combination of the rulesMexi o larger andLondon larger .

Defeating is monotonic, as demonstrated by the following theorem.

Theorem 6.2.2 LetP be an OCLP and letI; J be two interpretations forP suchthatI+ � J+. If a rule r 2 P � is defeated w.r.t.I, thenr is also defeated w.r.t.J .

Proof: Let r 2 P � be a defeated rule w.r.t.I. By Definition 6.2.4, this implies:8a 2 Hr � 9r0 2 P � � (r0) � (r) ^ Br0 � I ^ Hr0 � I (r)(a) :Set inclusion being monotonic andBr0 � BP , yieldsBr0 � J , while Theo-rem 6.2.1 allows forHr0 � J (r)(a). Combining this, we obtain the necessaryconditions to conclude thatr is also defeated w.r.t.J . 2The model semantics defined for choice logic programs can be used until conflictsarise. In this case we should take the order of the componentsinto account byusing defeating as a third option besides non-applicability and appliedness.

Definition 6.2.5 Let P be an OCLP. A total interpretationI is a modeliff everyrule in P � is either not applicable, applied or defeated w.r.t.I. A modelM iscalledminimal iff M is minimal according to set inclusion, i.e. no modelN of Pexists such thatN+ �M+.

Example6.2.5 Reconsider the interpretationsI, J ,K andL from Example 6.2.2.Only K and L are models. ModelL is not minimal due to the modelZ =ftravel ;larger ;Mexi o;London;not Spain;not smallg. The minimal modelsKandZ correspond to the intuitive outcomes of the problem.

In this section we have introduced the basic mechanisms of ordered choice logicprogramming. We have extended the model semantics of choicelogic program-ming to take the preference between alternatives into account. For choice logicprograms we introduced the stable model semantics. In the next section we extendthe stable model semantics to ordered choice logic programs.

Page 179: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 165

P3P2P1 kikondo shark alley kikondo � shark alley half day

Figure 6.2: The diving OCLP of Example 6.3.1

6.3 The Stable Model Semantics

In this section we investigate the stable model semantics for ordered choice logicprogramming, both declaratively and procedurally. We willprovide an efficientalgorithm to retrieve all stable models of a program.

6.3.1 Definition

In Example 6.2.5 we have seen that the minimal models correspond to the intuitivesolutions of the problem. Unfortunately, this simple minimal semantics presentedabove does not always yield intuitive outcomes, as demonstrated by the followingtwo programs.

Example6.3.1 In front of Diani Beach, the nicest beach of Kenya, lies a reef. Itscoral and underwater life makes it an interesting place for divers. Shark alley andKikondo are just two of the diving spots on the reef. For safe diving it is necessarythat there is enough time between two dives. This time depends on the depth andduration of your dive. Shark alley and Kikondo require 20 meter dives, whichmakes it almost impossible to have them both in just half a day. Unless of course,you have two very short dives, but that is not really worth thetrouble. The OCLPof Figure 6.2 represents this situation. This program has two minimal models:M1 = fhalf day ; shark alleyg andM2 = fshark alley; kikondogg :The minimal modelM1 is not very intuitive since there is no reason to assumehalf day .

Page 180: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

166 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P2P1 tiger � eld dear tiger eld deareld dear tiger

Figure 6.3: The tiger OCLP of Example 6.3.2

Example6.3.2 In the wild the law of the jungle rules: the strong or the moreskilled survives. That should not prevent you to feel sympathy for the less for-tunate. However, in an encounter only one can be your favorite5. Consider thefollowing situation. On safari in Corbett game reserve in Uttar Pradesh, Indiayou witness a hunting scene. A young tiger goes to hunt for thefirst time. Her eyefalls on a young Eld’s dear, the rarest of all animals in India. Inexperienced asthe tiger is, the dear might see a chance to escape a cruel fate. As a spectator youcan only take one side. But the choice is hard. Every time you think you made achoice, the other animal does something to earn your sympathy. This situation isrepresented by the OCLP in Figure 6.3.2.This program has one minimal model, i.e.M = ftiger ; eld dearg. This is not avery realistic situation. Nature permits only one animal tobe the winner of thisconfrontation, so you should pick your favorite. This unintuitive model is builtupon the application of the defeated ruletiger � eld dear .

In this section, we will present the so-called stable model semantics which, whilepreserving minimality, will prevent unnatural models suchas the one in exam-ple 6.3.2. Just as for other logic programming formalisms, we define a Gelfond-Lifschitz transformation to obtain our stable models.

Definition 6.3.1 LetM be a total interpretation for an OCLPP . TheGelfond-Lifschitz transformationfor P w.r.t.M , denotedPM , is the choice logic programobtained fromP � by removing all defeated rules.M is called astable modelforP iff M is a stable model forPM .

Example6.3.3 The minimal modelM = ftiger ; eld dearg for the OCLP of Ex-ample 6.3.2 is, as we intended, not a stable model sincePM = P2 has a single

5Compare it with a football match: you can only support one team.

Page 181: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 167 olleaguetraveler kemer � fethye � kusadasi � bodrum

kusadasi � bodrum kemer � fethye kemer friendtravel agent

Figure 6.4: The multiple advisors OCLP of Example 6.3.4

stable modelfnot tiger ; not eld dearg 6= M . The minimal modelsK andZ ofExample 6.2.5 are both stable models.

The next example demonstrates that OCLPs can be put to good use when infor-mation is obtained from various sources.

Example6.3.4 Another year has gone by and it is again time to make travel plans.At least this time you already know to which country you want to go. You heardso many good comments about Turkey that you decide to take your vacation there.Now it is only a matter of picking the right place, since you like a nice city in agreen setting. In order to reach your decision, you ask around, giving people achoice between Kemer, Fethiye, Kusadasi and Bodrum. A colleague of you advisesyou to go to Bodrum or to Kusadasi. Your travel agent suggestsKemer or Fethiye.A very good friend of you who went to Turkey last year is very enthusiastic aboutKemer. With these different opinions, you attach more valueto your friends optionthan to the one of your colleague. However, an experienced travel agent probablycan give you the best advise.The above problem is represented by the OCLP in Figure 6.4. This program hasone stable model:M = fkemer ; not fethye; not kusadasi ; not bodrumg :which tells you where to go next Summer.

Page 182: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

168 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

trapezium(X) square(X)trapezium(X) diamond(X)Inheritan eDiamond isQuadrangle(X) trapezium(X) ir (s;X)� ir (d;X)� ir (t;X) trapezium(X)trapezium(a) diamond(b) Obje t

TrapeziumSquare ir (t;X) trapezium(X) ir (s;X) square(X) ir (d;X) diamond(X)Figure 6.5: The object-oriented OCLP of Example 6.3.5

The following example demonstrates that OCLPs can be very useful to reasonabout object-oriented systems.

Example6.3.5 In your system you have three classes: Trapezium, Square andDiamond. The class trapezium is the root class from which square and diamondinherit. Each of these classes implements the method giveCircumference whichwe shall abbreviate as circ. The method isQuadrangle is onlyimplemented bytrapezium. The others inherit the method. In our application there are two objectsa and b with respectively type Trapezium and Diamond. Which methods can becalled directly for each object?An OCLP that models this system is depicted in Figure 6.5. According to thenotions of object orientation we should obtain that for bothobjects the methodisQuadrangle from the class Trapezium can be executed. For the method giveCir-cumference this is somewhat different. For the objecta, we can use the methodfrom class Trapezium. For the diamondb we use the implementation of the classDiamond. Corresponding to this intuition we obtain a stablemodel6:M = ftrapezium(a); trapezium(b); diamond(b); isQuadrangle(trapezium; a);isQuadrangle(trapezium; b); ir (trapezium; a); ir (diamond ; b)g :The following theorem shows that ordered choice logic programs are indeed anextension of choice logic programs which preserves the stable model semantics.

6We will only mention the atoms present in the stable model.

Page 183: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 169

Theorem 6.3.1 Let P be a choice logic program.M is a stable model forP iffM is a stable model of the corresponding OCLPhfPg;�i.Proof: Since the rules of the OCLP are centralized in one component,therecan be no defeating according to Definition 6.2.4. This implies that the Gelfond-Lifschitz transformation will never delete any rule. The result follows imme-diately from Theorem 5.2.1 and Definition 6.3.1. 2For choice logic programs we were able to demonstrate that stable models andminimal models coincide (Theorem 5.2.1). Unfortunately, this is no longer truefor ordered choice logic programs. Example 6.3.2 provides acounter example.The reverse, as we might expect, remains valid.

Theorem 6.3.2 LetM be a stable model for an OCLPP . Then,M is a minimalmodel forP .

Proof: We will demonstrate this in two steps. First we will show thatM is amodel forP . Afterwards, we prove thatM is also minimal forP .

1. M is a model. In order to show this, we need to prove that every rule inP � is either non-applicable, applied or defeated w.r.t.M . Let us beginwith the constraints. Since they do not contain head atoms, they cannot bedefeated. This implies that they are automatically included inPM . SinceMis a stable model forPM and thus a model, we have that every constraint isnon-applicable inPM . This immediately implies that they are also satisfiedfor P .Let us now consider the rules with head atoms. Letr be such a rule. Assumethatr is applicable and not defeated w.r.t.M . If one of these conditions isnot met, we have thatr is satisfied w.r.t.M . Sincer is not defeated w.r.t.M , r must be inPM . SinceM is model andr is applicable,r has to beapplied inPM . This impliesjHr \ M j = 1, which makes thatr is alsoapplied inP .Since all rules inP � are satisfied, we obtain thatM is a model forP .

2. M is minimal. To demonstrate thatM is a minimal model forP , it sufficesto show that every total interpretationN such thatN+ � M+ is not avalid model forP . BecauseM is a stable model forPM , we have, with

Page 184: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

170 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Theorem 5.2.1, thatM is a minimal model forPM . This implies thatNcannot be a model forPM . So,9r 2 PM �Br � N ^ jHr \N j 6= 1 :BecauseM is a model andN+ � M+, we have forr thatBr � M andjHr \M j = 1. ForN , this yieldsjHr \N j = 0.Becauser 2 PM , we have thatr is not defeated w.r.t.M . Theorem 6.2.2allows us to conclude thatr is not defeated w.r.t.N either. So, we haveshown thatr is applicable, but not applied nor defeated. Thus, we can becertain thatN is not a model forP .

Combining the two, we may conclude thatM is a minimal model forP . 2Verifying whether a total interpretation is a stable model or not, first requires atransformation to a less complex choice logic program. Afterwards, we need tocheck that our interpretation is a minimal model for this newprogram. We caneither compute all models or we can see if our interpretationis a fixpoint of theWP -operator (Theorem 5.4.13). Would it not be more convenientto have a similaroperator right from the start? We will look into this in the next subsection.

6.3.2 Fixpoint Characterization

Although negation is not explicitly present in an ordered choice logic program, itdoes appear implicitly. Taking a decision implies that you select one alternativeto be true while the others need to be falsified. This implicitnegation will be for-malized using unfounded sets. They form the basis for a fixpoint characterizationand a corresponding algorithm for computing stable models.

6.3.2.1 Extending Unfounded sets

We extend the notion of unfounded sets for choice logic programs, Chapter 5 onpage 83, to handle preference. At first sight, it seems that simply a defeatingcondition needs to be added. Unfortunately, this is not sufficient since applicablechoice rules may contain more than one true head atom if the rule is defeated, inwhich case it would be wrong to put these atoms in an unfoundedset. For thisreason we first introduce the notion of indefeasible rules.

Page 185: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 171

P2P1 friday � saturday friday saturday Figure 6.6: The Taj-Mahal OCLP of Example 6.3.6

Definition 6.3.2 Let P be an OCLP. A ruler from P is said to beindefeasiblew.r.t. an interpretationI 2 IP iff r is not defeated w.r.t. any interpretationJ suchthat I � J .

Example6.3.6 Consider yourself visiting India. This Friday morning you leftJaipur, the pink city, to go to Agra, the last capital of the Moghul dynasty. Onyour way you will make a stop in Fatehpur Sikri, a deserted oldcapital city builtby Moghul Akbar. Currently the roads are in good shape, so youarrive, earlieras planned, in Agra in the evening just before the sun goes down. On tomorrow’sprogram there is the visit to the famous Taj Mahal. This architectural wonderwas build by Shah Jahan in honor of his wife Mumtaz Mahal. It istotally built inwhite marble and laid-in with semi-precious stones. The view is said to be veryspectacular during both sunset and sundown. But also a full moon, as tonight,gives an extra dimension to the already beautiful setting. The tour guide asks thegroup to choose between tonight or tomorrow morning. He alsotells the groupthat there is no entrance fee on Friday because of the Muslim day of prayer. Sincethe entrance fee of this visit is included in the tour price, there is no reason for notgoing twice. This situation is represented by the OCLP in Figure 6.6.Let I be the interpretationI = ffridayg. The ruler is not indefeasible. WithinterpretationJ = ffriday; saturdayg this rule becomes defeated.J is the stablemodel of this program. Assuming thatsaturday should be false becausefriday istrue would be a mistake.

Indefeasibility is a monotonic operator.

Theorem 6.3.3 LetP be an OCLP and letI andJ be two interpretations forPsuch thatI � J . If a rule r is indefeasible w.r.t.I thenr is indefeasible w.r.t.J .

Page 186: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

172 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Proof: Sincer is indefeasible w.r.t.I, we have, with Definition 6.3.2, thatr isnot defeated w.r.t. any interpretationK such thatI � K. BecauseI � J , wehave that every extensionL of J is also an extension forI. This implies thatris not defeated w.r.t.L and this for everyL � J . So, we may conclude, withDefinition 6.3.2, thatr is indefeasible w.r.t.J . 2The next corollary follows immediately from Definition 6.3.2.

Corollary 6.3.1 Let I be a total interpretation for an OCLPP and letr be a rulein P �. Then,r is not defeated w.r.t.I iff r is indefeasible w.r.t.I.

Definition 6.3.3 Let I be an interpretation for an OCLPP . A setX � BP iscalled anunfounded setw.r.t. I iff for eacha 2 X one of the following conditionsis satisfied:

1. 9r � (a� A B) 2 P � �B � I ^ A \ I 6= ; ^ r is indefeasiblew.r.t. I ; or

2. 9 B; a 2 P � �B � I ; or

3. 8r 2 P � wherea 2 Hr, one of the following conditions holds:

(a) Br \ not I 6= ; ; or

(b) Br \X 6= ; ; or

(c) r is defeated w.r.t.I ; or

(d) (Hr n fag) \ I 6= ; ; or

(e) Hr \ Br 6= ; .

The set of all unfounded sets forP w.r.t. I is denotedUP (I). Thegreatest un-founded setfor P w.r.t. I, denotedGUSP (I), is the union of all unfounded setsfor P w.r.t. I. I is said to beunfounded-freeiff I \ GUSP (I) = ;.Condition (1) above expresses that the choice is exclusive (r cannot be defeated,sojHr\Ij has to be 1 in order forI to be or become a model) and thus alternativesto the actual choice are to be considered false. Condition (2) implies that any atomthat would cause a constraint to be violated must be considered false. Condition(3) generalizes the one from Definition 5.4.1 on page 113 by adding conditions c)and d). The latter is a weaker version of condition (1). In case condition (3) issatisfied, we know that there is no reason to considera to be true.

Page 187: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 173

P3P2P1 hina town � al atraz japanese tea garden hina town oit tower � pier39 al atraz

P4 quiet japanese tea gardenquiet oit towertouristi pier39quiet � touristi � Figure 6.7: The San-Francisco OCLP of Example 6.3.7

Example6.3.7 On your way to the Nappa Valley in California, you decide youwill have a short visit of San Francisco. The Golden Gate Bridge aside, there aretwo tourist attractions: Chinatown and Alcatraz. Because you will only stay inSan Francisco for half a day, you have to make a choice betweenthe two. If youdecide to take a tour in China town, you will have time left to visit the Japanese teagarden in the Golden Gate park. This is a nice garden without too many tourists.If you plan to go to Alcatraz, you can afterwards climb the quiet Coit tower fora spectacular view of the bay, or you can go to the very crowdedPier39 to seethe sea lions. A quiet visit will make this sight-seeing day more relaxing. Thissituation is represented by the OCLP depicted in Figure 6.7.Consider the partial interpretationI = f hina town; quietg. The greatest un-founded set w.r.t.I equalsGUSP (I) = fal atraz ; pier39 ;Coit tower ; touristi g.When we would go to Alcatraz instead of China town, we haveGUSP (J) =f hina town; japanese tea gardeng, with J = fal atraz ; quietg. In this casewe have thattouristi is not part of the greatest unfounded set, because it is stillpossible that the ruler : quiet � touristi might be defeated. Indeed, no in-formation is present about the ruletouristi pier39 . Sor is not indefeasiblew.r.t. J , which implies that we can user to retrieve information.

The following example demonstrates the need for condition d) in the definition ofunfounded sets.

Page 188: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

174 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P3P2P1pantheon vati an � forum romanum forum romanum saint peters 0s athedral � pantheon vati an saint peter 0s athedralsaint peter 0s athedral vati an

Figure 6.8: The visiting ancient Rome OCLP of Example 6.3.8

Example6.3.8 Today you make your schedule for visiting Rome. Before leavinghome, you already made up some plans. First of all you decidedto work in themes.Two of them are Ancient Rome and Catholic Rome. For each themeyou will visitthe most important site, respectively the Forum Romanum andthe Vatican, andthe most important church or temple, respectively Saint-Peter’s Cathedral and thePantheon. If you decide to go visit the Vatican you can visit Saint-Peter’s at thesame time and vice versa. Nevertheless, today you decided totake the AncientRome tour, including the Forum Romanum and the Pantheon. This whole plan-ning operation is represented in Figure 6.8.Consider the interpretationI = fforum romanum; pantheong. The greatest un-founded set w.r.tI equalsGUSP (I) = fsaint peter 0s athedral ; vati ang. With-out condition d) the greatest unfounded set would have been;, since both choicerules are not indefeasible. However, this is not very intuitive, since there is noreason for these choice rules to become defeated: the two defeaters depend oneach other.

The next theorem demonstrates that it is justified to use the term greatest unfoun-ded set for the union of all unfounded sets with respect to an interpretation.

Theorem 6.3.4 Let I be an interpretation for an OCLPP . Then,GUSP (I) 2UP (I).Proof: We need to show thatGUSP (I) is an unfounded set ofP . In Defini-tion 6.3.3, we definedGUSP (I) as

SX2UP (I)X. This implies8x 2 GUSP (I)that: 9X 2 UP (I) � x 2 X :

Page 189: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 175

BecauseX is an unfounded set, we have, according the same definition, that ei-ther:

1. 9x� A B 2 P � �B � I ^ A \ I 6= ;; r is indefeasible w.r.t.I ; or

2. 9 B; x 2 p� �B � I ; or

3. for every rule inP � with x 2 Hr one of the following conditions is satisfied:

(a) Br \ not I 6= ; ; or

(b) Br \X 6= ; ; or

(c) r is defeated w.r.t.I ; or

(d) (Hr n fxg) \ I 6= ; ; or

(e) Hr \Br 6= ; .

The only condition that is not immediately transferable from X to GUSP (I) isd). Because intersection is monotonic, we obtain thatBr \ GUSP (I) 6= ;, asX � GUSP (I).So we obtain all necessary conditions to conclude thatGUSP (I) is an unfoundedset w.r.t.I. Thus,GUSP (I) 2 UP (I). 2TheGUSP -operator is a monotonic operator.

Theorem 6.3.5 Let I andJ be interpretations for an OCLPP such thatI � J .Then,GUSP (I) � GUSP (J).Proof: In order to prove this, we demonstrate that8X 2 GUSP (I) � X 2GUSP (I). Thanks to Theorem 6.3.4, we know thatGUSP (I) � GUSP (J). Solet X 2 GUSP (I). This implies, with Definition 6.3.3, that8x 2 X one of thefollowing conditions is satisfied:

1. 9x� A B 2 P � �B � I ^ A\I 6= ;; r is indefeasible w.r.t.I. BecauseI � J and Theorem 6.3.3, this yieldsB � J ,A\J 6= ; andr is indefeasiblew.r.t. J .

2. 9 B; x �B � I . SinceI � J , this impliesB � J .

3. 8r 2 P � with x 2 Hr one of the following conditions is fulfilled:

Page 190: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

176 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

(a) Br\not I 6= ; . The intersection being monotonic yieldsBr\not J 6=;.(b) Br \X 6= ;(c) r is defeated w.r.t.I . With Theorem 6.2.2, we obtain thatr is also

defeated w.r.t.J .

(d) (Hr n fxg) \ I 6= ;. SinceI � J , we have(Hr n fxg) \ J 6= ;.(e) Hr \ Br 6= ; .

Above we have demonstrated thatX satisfies at least one of the conditions tobe considered as an unfounded set w.r.t.J . Thus, by Definition 6.3.3,X �GUSP (J). 2The next theorem demonstrates that unfounded sets for OCLPsare a generaliza-tion for the ones defined for CLPs.

Theorem 6.3.6 Let P be a choice logic program, letP 0 = hP;�i be its cor-responding ordered choice logic program and letI be an interpretation for bothprograms. Then,X 2 BP is an unfounded set forP w.r.t I iff X is an unfoundedset forP 0 w.r.t. I.

Proof: When we investigate the differences between the definitionsfor unfoun-ded sets for both programs (Definition 5.4.1 for CLP and Definition 6.3.3 forOCLP), we see that condition (1) is extended for OCLPs and that conditions (c)and (d) have been added. Since defeating needs a more specificcomponent (Defi-nition 6.2.4) andP 0 has only a single one, we know that every rule is indefeasibleand not defeated, making that condition (1) identical for both definitions. Condi-tion (c) can never be used and condition (d) is subsumed by condition (1). So, wemay conclude that both definitions yield identical results. 2The above theorem might indicate that all properties which are valid for unfoun-ded sets for choice logic programs remain valid for ordered choice logic programs.Most of them do, but there is an important difference: addingnegative informa-tion can result in more atoms being added to the greatest unfounded set. In otherwords,GUSP (I [ not GUSP (I)) is not necessarily equal toGUSP (I), whichwas the case for choice logic programs (Theorem 5.4.3 on page117). The reasonfor this is the indefeasibility requirement in the first condition for unfounded sets.We will demonstrate this by means of an example.

Page 191: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 177

P2P1 le moulin rouge � le lido le moulin rouge timele lido timeFigure 6.9: The Parisian night life of Example 6.3.9

Example6.3.9 Paris, the city of light, is famous, amongst other things, for hernight entertainment. A number of theaters, like le Moulin Rouge and le Lido,feature two or three shows with music, dance and feathers every night. Everyshow usually includes the French Can Can. The OCLP in Figure 6.9 depicts ourevening plans.Consider the interpretationI = fle moulin rougeg. The greatest unfounded setequals:GUSP (I) = ftimeg. Adding this negatively toI, we obtainGUSP (J) =ftime; le lidog with J = I [ not GUSP (I) = fle moulin rouge; not timeg.Clearly,GUSP (I) 6= GUSP (J).Verifying the unfounded-free property can be rather tedious since we might needto check every possible subset of the Herbrand base in order to find the greatestunfounded set. For choice logic programs, we can shortcut this process when totalinterpretations are concerned (Theorem 5.4.4 on page 118).For ordered choicelogic programs, we can do exactly the same.

Theorem 6.3.7 LetP be an OCLP and letI be a total interpretation forP . Then,I is unfounded-free, i.e.I \ GUSP (I) = ;, iff no non-empty subset ofI+ is anunfounded set forP w.r.t. I.

Proof: ): I being an unfounded-free interpretation implies, by Definition 6.3.3,that I \ GUSP (I) = I+ \ GUSP (I) = ;. SinceGUSP (I) is the union of allunfounded sets, we can conclude that no non-empty subset ofI+ is an unfoundedset forP w.r.t. I.(: We proceed by the contrapositive, so assume thatI is not unfounded-free.With Definition 6.3.3, this yieldsI \ GUSP (I) = S with S 6= ;. We will demon-strate thatS � I+ is an unfounded set w.r.t.I. SinceS is a subset ofGUSP (I),we have that for all the elements ofS at least one of the conditions for unfoundedsets holds. The only condition in Definition 6.3.3 that actually uses the candidate

Page 192: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

178 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

unfounded set isBr \GUSP (I) 6= ; (e.g condition b.). Because our programs arepositive, we either haveBr \GUSP (I) � not I orBr \S 6= ;. Both possibilitiesare conditions forS to be an unfounded set w.r.t.I. Thus, we may conclude thatat least one of the prerequisites forS to be an unfounded set w.r.t.I is fulfilled.SoS 2 UP (I). 2The necessity for totality is demonstrated by the followingexample.

Example6.3.10 Let us go back to the Parisian night OCLP in Example 6.3.9.Consider the interpretationI = fle lido; le moulin rougeg. This interpreta-tion is not unfounded-free, sinceGUSP (I) = fle lido; le moulin rouge; timeg.However, no non-empty subset ofI is an unfounded set.

6.3.2.2 Detecting Stable Models

Defining unfounded sets is one thing, but what can they offer us? For choice logicprograms we have seen that unfounded sets play an important role in the detectionof (stable) models (Theorem 5.4.10 on page 124). Also for ordered choice logicprogram this would come in handy. For the moment we need to apply the Gelfond-Lifschitz transformation after which we need to check whether or not we have aminimal model. Would it not be nice to check this immediatelyby means of thegreatest unfounded set? In this section we will investigatethis possibility.

In a first step towards detecting stable models, the following theorem demonstratesthat the negative part of models are unfounded sets.

Theorem 6.3.8 LetM be a model for an OCLPP . Then,M� is an unfoundedset forP w.r.t. M , i.e.M� 2 UP (M).Proof: We proceed by contraposition. So, assume thatM� is not an unfoundedset w.r.t.M . With Definition 6.3.3, this implies that there exists an elementa ofM� such that none of the conditions of an unfounded set holds. Among otherthings, we have that9r 2 P � with a 2 Hr for which holds:Br \ notM = ; ^ (Hr n fag) \M = ; ^ r is not defeated w.r.t.M :SinceM is total,Br \ not M = ; yieldsBr � M . Becausea =2 M , we obtainHr \M = ;. Given these circumstances we have to conclude thatM cannot be amodel forP , asr is not satisfied byM . 2The need for a model is illustrated by the next example.

Page 193: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 179

P3P2P1 arlsbad averns � big bend NP big bend NP arlsbad averns

Figure 6.10: The Texas’ nature excursions OCLP of Example 6.3.11

Example6.3.11 Being in El Paso, Texas for a conference you decide to take anexcursion to a national park. Your guide book suggests the two parks in the area:Carlsbad Caverns and Big Bend National Park. The latter is rather far away, soless preferred. The OCLP in Figure 6.10 represents your travel plans. Considernow the interpretationI = fbig bend NP ; not arlsbad avernsg. This inter-pretation is surely not a model: the rule arlsbad averns in componentP3 isnot satisfied nor defeated. However,GUSP (I) = f arlsbad avernsg 2 UP (I).This is reasonable since unfounded sets are supposed to givean indication ofwhich atoms are not necessary in a model extension of the current interpretation.It gives no information about which atoms are indeed necessary.

When we have a model, we can use the unfounded-freeness property to detectminimal models.

Theorem 6.3.9 LetM be a model for an OCLPP . If M is unfounded-free w.r.t.M thenM is a minimal model forP .

Proof: We will demonstrate this by means of contraposition. To thisextend weassume thatM is not minimal. According to Definition 6.2.5, this implies thatthere exists a modelM1 such thatX = M+ nM+1 6= ;. We will show thatX is anunfounded set w.r.t.M . SinceM1 is a model forP , we have for each ruler 2 P �with x \Hr andx 2 X that:Br 6� M1 _ jHr \M1j = 1 _ r is defeated w.r.t.M1 :Br 6�M1 yieldsBr\notM1 6= ;, asM1 is total. BecauseM = (M1nnotX)[X,this impliesBr \ not M 6= ; or Br \ X 6= ;. jHr \ M1j = 1 gives rise to

Page 194: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

180 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMINGHr n fxg\M 6= ;. With Theorem 6.2.2 we know thatr is also defeated w.r.t.M ,sinceM+1 � M+ by construction. The above enables us to conclude thatX is anunfounded set w.r.t.M . Thus,M is not unfounded-free w.r.t.M , asX �M . 2For choice logic programs, the reverse of the above theorem is also true. This isno longer so for ordered choice logic programs, as demonstrated by the followingexample. Actually this is what we hoped for, otherwise it would be impossible touse unfounded sets to characterize stable models.

Example6.3.12 Reconsider the Bengali Tiger OCLP of Example 6.3.2. This pro-gram has a single minimal model, namelyI = ftiger ; eld dearg. This interpre-tation is not unfounded-free, becauseGUSP (I) equals the interpretation itself.

Theorem 6.3.10LetM be a model for an OCLPP . Then,M is a stable modeliff M is unfounded-free forP , i.e.M \ GUSP (M) = ;.Proof: Before we can start the actual proof, we need some lemmas to facilitatethe process.

Lemma 6.3.1 LetP be an OCLP and letI be a total interpretation forP . Then,GUSP (I) = GUSP I (I).Proof:� � : Let a 2 GUSP (I). According to Definition 6.3.3, this implies that one

of the following conditions is satisfied:

1. 9r : a� A B �B � I ^ A \ I 6= ; ^ r is indefeasible w.r.t.I :With Corollary 6.3.1, this implies thatr is not defeated w.r.t.I. Thus,r 2 P I.

2. 9 B; a 2 P � �B � I .

3. For allr 2 P � with a 2 Hr at least one of the following conditions isfulfilled:

(a) Br \ not I 6= ; .

(b) Br \ GUSP (I) 6= ; .

(c) r is defeated w.r.t.I. This implies thatr =2 P I.

Page 195: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 181

(d) (Hr n fag) \ I 6= ;. Assume that conditions (a) and (c) are notsatisfied. The latter implies thatr 2 P I. SinceI is total, theformer yieldsBr � I and(Hr n fag) \ I 6= ;, which is exactlythe first condition for an unfounded set of a choice logic program(Definition 5.4.1 on page 86).

(e) Hr \ Br = ;: In this case, there are two possibilities: eitherB \ GUSP (I) 6= ; or (Hr n fag) \ B 6= ;.Comparing the above conditions with the definition for an unfounded of achoice logic program (Definition 5.4.1 on page 86), it is easyto see thatGUSP (I) 2 UP I (I). Thus,GUSP (I) � GUSP I (I).� � : We will demonstrate thatGUSP I (I) is an unfounded set ofP w.r.t. I.By Theorem 6.3.4, this impliesGUSP I (I) � GUSP (I). BecauseGUSP I (I)is an unfounded set ofP I w.r.t. I we obtain for alla 2 GUSP I (I) that oneof the following conditions is satisfied:

1. 9r : a� A B 2 P I � B � I ^ A \ I 6= ; . Becauser 2 P I, weknow thatr is not defeated w.r.t.I. Combining this withI being total,we obtain, with Corollary 6.3.1, thatr is indefeasible w.r.t.I.

2. 9 B; a �B � I .

3. For allr 2 P IC with a 2 Hr one of the following conditions is fulfilled:

(a) Br \ not I 6= ; .

(b) Br \ GUSP I (I) 6= ; .

(c) (Hr n fag) \Br 6= ; .

For all r in P � with a 2 Hr, we either haver 2 PI or r is defeatedw.r.t. I.

In these circumstances, we can conclude thatGUSP I (I) is indeed an un-founded set forP w.r.t. I. 2

Corollary 6.3.2 Let I be a total interpretation for an OCLPP . I is unfounded-free forP I w.r.t. I iff I is unfounded-free forP w.r.t. I.

Lemma 6.3.2 LetM be a model for a OCLPP . Then,M is a model forPM .

Page 196: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

182 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P2P1 king baudouin king baudouin � blue one Figure 6.11: The Antarctica OCLP of Example 6.3.13

Proof: We have to show that every rule and every constraint inPM is satisfied byM (i.e. Definition 5.2.4 on page 88). The choice logic programPM is obtainedfrom P � (i.e. Definition 6.3.1) by deleting all defeated rules w.r.t. M . SinceM isa model ofP , we know that for the remaining rules must hold that eitherB * Mor jHr \ M j = 1. According to Definition 5.2.3, this implies that the rule issatisfied. So,M is deductively closed and, thus, a model ofPM . 2After these intermediate results we can proceed with our actual proof.) : SinceM is a stable model forP , we have, by Definition 6.3.1, thatM is astable model ofPM . With Theorem 5.4.10 on page 5.4.10, this yields thatM isunfounded-free forPM . With Corollary 6.3.2 we obtain thatM is also unfounded-free forP .( : M being a model ofP yields, by Lemma 6.3.2, thatM is also a model forPM . BecauseM is unfounded-free forP , we have, due to Corollary 6.3.2, thatM is unfounded-free forPM . With Theorem 5.4.10 on page 124, this yields thatM is a stable model forPM . By Definition 6.3.1, this implies thatM is a stablemodel forP . 2The combination of the Theorems 6.3.8 and 6.3.10 gives us a characterization ofstable models in terms of unfounded sets.

Corollary 6.3.3 Let P be an OCLP and letM be a model for it.M is a stablemodel ofP iff M� = GUSP (M).This characterization is not complete in terms of unfoundedsets since it requiresthat the interpretation is already a model. We demonstrate the necessity for thisby the following example.

Example6.3.13 November 4th 1997, Alain Hubert and Dixie Dansercoer begintheir endavour in Antarctica. Their aim was to cross this frozen continent in less

Page 197: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 183

than 100 days without any assistance from the outside world.They succeeded, buta small intervention was needed because one of their sledgescarrying all theirmaterial broke down.On November the 4th they started at the former King Baudouin base and 98 dayslater, February 10th 1998, after an eventful journey they arrived at the Ameri-can base McMurdo. They reached the South pole, the Amundson-Scott base, onJanuary 3th. The hardest part of their journey was yet to come. A detailed andpersonal description of their adventure can be found in [HDB98].The reason why Alain Hubert and Dixie Dansercoer choose the former King Bau-douin base as their starting point was in remembrance of the hundredth birthdayof the Belgica-expedition to Antarctica led by Adrien de Gerlache. Without thisreason they might have decided to start from Blue One, a SouthAfrican touristbase . This situation is represented by the OCLP depicted in Figure 6.11.Consider the interpretationI = fblue one; not king baudouing. This interpre-tation is clearly unfounded-free sinceGUSP (I) = fking baudouing. Clearly,Iis not a model.

Despite this extra condition, which can be verified in lineartime, we already knowthat an interpretation has to be unfounded-free, if it wantsto be considered as astable model. Since unfoundedness is monotonic, we can already rule out thepossibility that an interpretation which is not unfounded-free can be extended to astable model.

Theorem 6.3.11LetI be an interpretation for the OCLPP . If I is not unfounded-free then no stable model forP will containI.

Proof: Following Definition 6.3.3,I being not unfounded-free means that:GUSP (I) \ I 6= ; :In case a modelM of P exists such thatI � M , we have, following Theo-rem 6.3.5, that: GUSP (I) � GUSP (M) :This yields: GUSP (M) \M 6= ; :as set inclusion is monotonic.According to Definition 6.3.3, this means thatM is not unfounded-free.

Page 198: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

184 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Combining this with Theorem 6.3.10, we obtain thatM cannot be a stable modelfor P . 2So the above theorems have demonstrated that unfounded setscan be a valuabletool to distinguish between interpretations, models and (future) stable models.

6.3.2.3 Stable Models as Fixpoints

For all previous logic programming formalisms ( Chapters 3 and 5), we gave,besides a declarative definition, a procedural definition ofthe stable model se-mantics. For ordered choice logic programs this will not be different.

Previously we have seen that theGUSP -operator gathers all the atoms that are notnecessary for turning an interpretation into a model. The next operator producesthose atoms that must be in any model extension of its argument.

Definition 6.3.4 Let P be an OCLP. Theimmediate consequence operator, de-notedTP , is defined as follows:TP : 2BP [ not BP ! 2BPI 7! fa 2 BP j 9A� a B 2 P � � A � I� ^B � I ^ r is indefeasible w.r.t.Ig :TheTP -operator is clearly monotonic.

The combination ofTP andGUSP gives us an indication how to change an inter-pretation in order to extend it into a model.

Definition 6.3.5 LetP be an OCLP. Define the operatorWP as follows:WP : IP ! 2BP [ not BPI 7! TP (I) [ not GUSP (I) :TheWP -operator is both monotonic and skeptical: it does not make any guessesthat could be invalidated later on.

Example6.3.14 Recall the San Francisco OCLP of Example 6.3.7. Considerthe interpretationI = fal atraz ; quiet ; not hina towng for whichGUSP (J)=f hina town;japanese tea gardeng. Then,TP (I) = fal atrazg ;

Page 199: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 185

which tells us that there is no reason so far to considerquiet true. This makesWP (I) = fal atraz ; not hina town; not japanese tea gardeng = J :When we apply theWP -operator onJ we obtain againJ . Thus,J is a (partial)fixpoint forWP .

Example6.3.15 Consider the Antarctica OCLP from Example 6.3.13. There westudied the interpretationI = fblue one; not king baudouing. When we ap-ply theWP -operator we obtainfblue one; king baudouin; not king baudouingwhich is not an interpretation. This demonstrates that the result of applying theWP -operator is not always an interpretation. Nevertheless, it indicates that westarted on the wrong foot.When we start with the empty set, we getI =WP (;) = fking baudouing. Whenwe now useI as input, we obtainM = fking bauduion; not blue oneg which isa stable model and a total fixpoint ofWP .

The previous example already indicates that stable models and total fixpoints oftheWP -operator might coincide. The following theorem demonstrates that this isindeed so.

Theorem 6.3.12Let P be an OCLP. A total interpretationM 2 IP is a stablemodel ofP iff M is a fixpoint ofWP .

Proof: ): Let M be a stable model ofP . From Theorem 6.3.10, we know thatGUSP (M) = M�. This leaves us to prove thatM+ = TP (M):� M+ � TP (M). BecauseM is total and unfounded-free we have, by Theo-rem 6.3.7, that no non-empty set of atoms contained inM can be an un-founded set ofP w.r.t. M . This holds in particular for the setsfag witha 2 M+. This implies thatfag violates every condition for an unfoundedset. This means, amongst other conditions, that there exists a ruler 2 P �with a 2 Hr such that:

1. Br \ notM = ; ; and

2. r not defeated w.r.t.M ; and

3. (Hr n fag) \M = ; .

Page 200: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

186 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

The first condition can be rewritten asBr � M , asM is total. The sec-ond condition implies, with Corollary 6.3.1, thatr is indefeasible w.r.t.M .This is exactly what is needed fora to belong toTP (M) (Definition 6.3.4).Therefore,M+ � TP (M).� TP (M) � M+. Let a be an element ofTP (M). By Definition 6.3.4, thisimplies:9A� a B �B � M ^ A �M� ^ r indefeasible w.r.t.M :Corollary 6.3.1 yields thatr is not defeated w.r.t.M . Given these circum-stances,a must be an element ofM+ otherwiseM would not be a modelfor P . Theorem 6.3.2 tells us thatM is indeed a model.Thus,TP (M) �M+.(: Let M be a total fixpoint of theWP -operator. Then, by Definition 6.3.5,GUSP (M) = M�. Therefore, with Corollary 6.3.3, it remains to be shown thatM is a model forP in order to conclude thatM is a stable model forP .

We proceed by contradiction. To this extend, suppose that the total interpretationM is not a model forP . According to Definition 6.2.5, this implies:9r 2 P � �Br �M ^ jHr \M j 6= 1 ^ r is not defeated w.r.t.M :Let us consider each possibility:� Hr\M = ;. Now there are again two possibilities: eitherr is a constraint or

it is not. The former yields, with the second condition of Definition 6.3.3,thatBr 2 UP (M). This contradicts withM� = GUSP (M), asBr �M+. The latter implies, due to Definition 6.3.4, thatHr � TP (M), since,by Corollary 6.3.1, not defeated implies indefeasible. However, this is incontradiction withTP (M) = M+, asHr �M�.� jHr \M j > 1. Because of Corollary 6.3.1, we have thatr is indefeasiblew.r.t. M . This yields the necessary requirements for the first condition forunfounded sets (i.e. Definition 6.3.3). Thus,(Hr \ M) 2 UP (M). Thiscontradicts withM� = GUSP (M).

This means thatM has to be a model forP . Together withM� = GUSP (M),this yields, thanks to Corollary 6.3.3, thatM is a stable model forP . 2As said before,WP is monotonic. Given a fixpoint of this operator (either totalornot), every interpretation that is included in this fixpointis in the domain ofWP .

Page 201: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 187

Theorem 6.3.13Let I be an interpretation for an OCLPP and letM be a fix-point of theWP -operator. IfI � M , then

1. I belongs to the domain of theWP -operator, and

2. WP (I) �M .

Proof:

1. Obvious, sinceI was said to be an interpretation.

2. Because theGUSP -operator is monotonic this yields, by Theorem 6.3.5,GUSP (I) � GUSP (M). BecauseM is a fixpoint ofWP , we have, withDefinition 6.3.5, thatM� = GUSP (M). With Definition 6.3.5, this impliesWP (I)� �M�.This leaves us to prove thatWP (I)+ �M+ or, according to Definition 6.3.5,thatTP (I) � M+. Clearly,TP (Definition 6.3.4) is a monotonic operator.Thus,TP (I) � TP (M). With M being a fixpoint ofWP , we know thatM+ = TP (M). So we can concludeTP (I) � M . Combing this all, weobtainWP (I) � M . 2

The following definition constructs, if it exists, the leastfixpoint ofWP .

Definition 6.3.6 Let P be a finite OCLP. LetfW0 : : :Wk : : :Wng be the finitesequence whose k-th term is the k-fold application of theWP -operator on theempty set (i.eW0 = ;, Wk = WP (Wk�1)) such that eitherWn =2 IP or Wn =WP (Wn). In the latter case we say thatP is well-founded7 and denotedWn asW!P .

The following example illustrates that not every program iswell-founded.

Example6.3.16 Planning your trip to Brazil you have to decide whether you wantto go to the Amazon forest or to the Pantanal (wetlands near the border with

7We use the term well-founded in analogy with the well-founded semantics for logic programs.This semantics is based on theW!P . See Section 3.3 on page 22 for detailed information.

Page 202: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

188 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P3P2 pantanal budgetamazon budgetP1 amazon pantanal amazon � pantanal

Figure 6.12: The Brazilian nature OCLP of Example 6.3.16

Paraguay and home to the world’s largest rodent, the capivara). With both desti-nations equally desirable, it is an impossible choice to make. However, when thebudget permits, you can visit them both. This program is not well-founded sinceWP (WP (;)) = fpantanal ; amazon; not pantanal ; not amazon; not budgetg isan inconsistent set which is outside the domain ofWP . The lack of a least fix-point can intuitively be interpreted as a decision to stay athome until you havethe necessary budget to go to both places.

The least fixpointW!P ofWP , when existing, can be regarded as the ”kernel” ofany stable model. (e.g.W!P is a subset of every stable model). In case the leastfixpoint does not exist, we know that the program does not haveany stable model.

Theorem 6.3.14LetP be a finite OCLP.

1. If P is well-founded then for each stable modelM of P ,W!P �M .

2. If P is not well-founded, then there exists no stable model at all.

Proof:

1. W!P exists. There are two possible situations to consider:� P admits a stable model. LetM be a stable model forP . SinceW0 =;, W0 � M . This implies, with Theorem 6.3.13, thatWP (;) � M .We can continue applying this theorem until we reachW!P , which wewill always obtain sinceP is well-founded. Thus,W!P �M , for everystable modelM for P .

Page 203: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 189� There is no stable model forP . The statement is trivially true.

2. W!P does not exists. According to Definition 6.3.6, this impliesthat thereexists aWn such thatWn =2 IP . This means thatWn is not an interpretation.This result can only be obtained whenWn�1 is not unfounded-free. Com-bining this with Theorem 6.3.11, we obtain that there does not exist a stablemodel such thatWn�1 � M . Because theWP -operator is monotonic, thisimplies that there does not exist a stable model forP such that; �M . Thisleaves us no other option than to conclude thatP does not admit a stablemodel. 2

If W!P is total, it must be the unique stable model.

Corollary 6.3.4 Let P be a finite well-founded OCLP. IfW!P is a total interpre-tation, then it is the unique stable model ofP .

Proof: BecauseP is well-founded, we have thatW!P exists. WhenW!P is alsototal, we have, by Theorem 6.3.12, thatW!P is a stable model forP . Furthermore,by Theorem 6.3.14,W!P is included in every stable modelM of P . Hence, sinceW!P is total,W!P = M . Therefore,W!P is the unique stable model ofP . 2Although we characterized stable models as fixpoints of theWP -operator, we donot have a full procedural declaration for it. In the next paragraph we introducea fixpoint definition of the greatest unfounded set to complete the procedural se-mantics of stable models.

6.3.2.4 Procedural Semantics

ForWP to be useful in the computation of stable models, we need a wayto com-pute the greatest unfounded sets. For choice logic programswe used theRP -operator (Subsection 5.4.2 on page 119) to provide the greatest unfounded set andtools for checking the unfounded-free property of a, possibly partial, interpreta-tion. In this part we will extend this operator to ordered choice logic programs.

Page 204: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

190 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P2P1 jordan do umentssyria do umentsturkey do uments middle east jordan; syriamiddle east � turkey

Figure 6.13: The Going East OCLP of Example 6.3.17

Definition 6.3.7 Let I be an interpretation for an OCLPP . The operatorRP;I :2BP� ! 2BP� is defined by:

RP;I(X) = 8>>>>>>>>><>>>>>>>>>:a 2 X j9r : A� a B 2 P � � A \ I 6= ; ^B � I ^r is indefeasible w.r.t.I ; or9 B; a 2 P � �B � I ; or8r : A� a B 2 P � � B \ (not I [X) 6= ; ; orr is defeated w.r.t.I ; orA \ I 6= ; ; or

or(A [ fag) \B 6= ;g :9>>>>>>>>>=>>>>>>>>>;

Intuitively,RP;I(J) gathers all atoms that are contained in bothJ and some un-founded set w.r.t.I. Notice that althoughRP;I resembles the definition for anunfounded set, no output of an unfounded set is guaranteed. One simply filters outthose atoms that cannot belong to any unfounded set which might be contained inthe input.

Example6.3.17 Consider the OCLP in Figure 6.13 about destinations in the Mid-dle East. Since we have already visited Turkey, we prefer to take a tour aroundJordan and Syria. This is only possible when we can obtain thenecessary docu-ments.Consider the interpretation:I = fmiddle east ; do umentsg :For X = fjordan; syria; turkey ; do umentsg we have:RP;I(X) = fsyria; turkey ; jordang =2 UP (I) ;

Page 205: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 191

Although the output is not guaranteed to be an unfounded set,theRP -operatorcan be used as a verifying tool for unfounded sets, as demonstrated by the nexttheorem.

Theorem 6.3.15Let P be an OCLP and letI be an interpretation for it. Then,RP;I(X) = X iff X 2 UP (I).Proof: Obvious if one compares the definition for an unfounded set (i.e. Defini-tion 6.3.3) and the definition ofRP;I (i.e. Definition 6.3.7). 2It is rather easy to see thatRP;I is a monotonic operator. Given a setX � BP , it isobvious that the sequenceR0 = X, Rn = RP;I(Rn�1) decreases monotonicallyand converges to a limit, denoted byR!P;I(X).TheR!P;I(J)-operator gathers all atoms contained both inJ and in an unfoundedset forP w.r.t. I.

Lemma 6.3.3 Let I be an interpretation for an OCLPP and letJ � BP . Then,every unfounded set forP w.r.t I which is contained inJ is also a subset ofR!P;I(J).Proof: Due to Theorem 6.3.15, we obtain thatRP;I(X) = X for an unfoundedsetX 2 UP (I). BecauseRP;I is monotonic this yieldsX � R!P;I(J) if X � J .2Since a total interpretation can be considered unfounded-free when no non-emptysubset of atoms fulfills the unfounded set requirements, we can use theR!P;I-operator to check this property by simply using the positivepart as a startingpoint.

Theorem 6.3.16Let I be a total interpretation for an OCLPP . If R!P;I(I+) = ;thenI is unfounded-free.

Proof: This follows immediately from the combination of Lemma 6.3.3 andTheorem 6.3.7. 2The next lemma demonstrates that the result obtained fromR!P;I(X) is always anunfounded set.

Page 206: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

192 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Lemma 6.3.4 LetP be an OCLP, letI be an interpretation forP and letX � BP .Then,R!P;I(X) 2 UP (I).Proof: According to the definition,R!P;I(X) = Y implies thatRP;I(Y ) =Y . Combining this with Theorem 6.3.15, we obtainY 2 UP (I). Thus we canconclude thatR!P;I(X) 2 UP (I). 2The following theorem shows thatR!P;I(I+) is the perfect tool to check the un-founded-free property for total interpretations: the output being the empty set ornot tells it all.

Theorem 6.3.17LetI be a total interpretation for an OCLPP . Then,R!P;I(I+) =; iff I is unfounded-free.

Proof: The “only-if” part follows immediately from Theorem 6.3.16.For the “if” part, we proceed by means of contraposition. To this extend, letR!P;I(I+) = S 6= ;. We shall proof thatI cannot be unfounded-free in this case.By Lemma 6.3.4,R!P;I(I+) = S implies S 2 UP (I). With the definition ofunfounded-freeness, this yields thatI cannot unfounded-free, asS � I+. 2The above theorem shows thatR!P;I(I+) = ; is a necessary and sufficient condi-tion for the unfounded-freeness of an interpretationI. But theR!P;I-operator cando more. It is also an excellent tool for retrieving the greatest unfounded set of aninterpretation.

Theorem 6.3.18Let I be an interpretation for an OCLPP . Then,R!P;I(BP ) =GUSP (I).Proof: Lemma 6.3.4 tells us thatR!P;I(BP ) is an unfounded set w.r.t.I. FromLemma 6.3.3, we know thatR!P;I(BP ) contains every unfounded set w.r.t.I con-tained inBP . Since the greatest unfounded set can only contain elementsfrom theHerbrand base, it rather obvious thatR!P;I(BP ) = GUSP (I) = SX2UP (I)X. 2The greatest unfounded set and unfounded-freeness are tightly coupled: when youhave the former you know if the latter is true or not.

Corollary 6.3.5 LetI be an interpretation for an OCLPP . Then,I is unfounded-free iffR!P;I(BP ) \ I = ;.

Page 207: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 193

By obtaining the greatest unfounded set as a fixpoint of theR!P;I-operator, wehave a complete procedural definition of the stable model semantics.

Theorem 6.3.19LetM be a total interpretation for an OCLPP . Then,M is astable model ofP iff W 0P (M) = M withW 0 = TP (M) [ notR!P;M(BP ).Proof: This result is obtained by combining Theorems 6.3.18 and 6.3.12 withDefinition 6.3.5. 26.3.2.5 The Algorithm

The fixpoint semantics defined above is useful for verifying whether a total inter-pretation is a stable model or not. It does not tell us anything on how to obtaina stable model from scratch. Well this is not completely true, we do have theleast fixpoint ofWP -operator, if it exists, as a good starting point. It is the ker-nel of every stable model when the program is well-founded. Otherwise, we canbe sure that there is no stable model for this program (Theorem 6.3.14). WhenW!P is total, we have found the unique stable model (Corollary 6.3.4). Other-wise, a mechanism is required to proceed fromW!P towards a stable model. SinceW!P [notW!P cannot be a model, we know that there must exist an applicablerulewhich is not defeated and not yet applied. In this case we haveto choose whichof the head elements we will assume to be true; the others willbe assumed false.Such a combination of literals is called a choice set. In thispart we will assumethat all programs are finite.

Definition 6.3.8 Let I be an interpretation for an OCLPP . A choice setof Pw.r.t. I is a set of literals of the formfa; not b1; : : : ; not bng with n � 0, suchthat there exists a ruler : a� b1 � : : :� bn B 2 P � for which holds thatfa; b1; : : : ; bng \ I = ;,B � I andr is not defeated w.r.t.I. The set of all choicesets ofP w.r.t. I is denoted byCP (I).The reason whyW!P fails to reach a stable model is the inability of theTP -operatorto make non-deterministic decisions which could be invalidated later on in theprocess. A choice set represents those motivated guesses that theTP -operator isnot willing to take.

The following example demonstrates why rules should only benot defeated in-stead of indefeasible.

Page 208: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

194 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P3P2 niagara falls � hur hill distan e hur hill P1 niagara falls

Figure 6.14: The Canada OCLP of Example 6.3.18

Example6.3.18 Traveling in Canada involves covering large distances. Whenthis is no problem, you can easily combine the Niagara Falls with Churchill, asmall town North in the state of Manitoba. In the Summer you can see whalesand in the Winter polar bears come for a visit. In case distance matter, it isbetter to make choice between the two. This story is represented by the OCLP inFigure 6.14. Consider the interpretationI = fniagara fallg. Then,CP (I) = ff hur hillgg :The choice sets suggest a way to move fromI towards a stable modelM =f hur hill ;niagara falls; not distan eg. TheTP would never make this decisionsince the rule hur hill is not indefeasible w.r.tI.

Theorem 6.3.20Let I be an interpretation for the OCLPP . If I [ not I is amodel ofP thenCP (I) = ;.Proof: N = I [ not I is a model, and thus8r 2 P � �Br * N or jHr \N j = 1 or r is defeated w.r.t.N :BecauseA [ B � BP � and because less negative information does change thedefeatness ofr (i.e. Theorem 6.2.2), we obtain:8r 2 P � �Br * I or jHr \ Ij = 1 or r is defeated w.r.t.I :This implies that none of the rules fit the description neededfor a choice set (e.g.Definition 6.3.8) and thusCP (I) = ;. 2The reverse is not true, as illustrated by the following example.

Page 209: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 195

Example6.3.19 Reconsider the OCLP from Example 6.3.18. Consider the in-terpretationI = fniagara falls; hur hill ; distan eg. This interpretation is cer-tainly not a model, yetCP (I) = ;.The unfounded-freeness of the union of an interpretation and its negated positivecomplement is a necessary and sufficient condition for having the reverse of theabove theorem.

Theorem 6.3.21LetP be an OCLP and letI be an interpretation forP such thatN = I [ not I is unfounded-free. Then,N is a model ofP iff CP (I) = ;.Proof: The “only-if”-part follows immediately from Theorem 6.3.20.For the “if”-part, letCP (I) = ;. By Definition 6.3.8, this implies:8r 2 P � � jHr \ Ij 6= 0 orBr * I or r is defeated w.r.t.I :Because defeating is monotonic (e.g Theorem 6.2.2) and becauseBr � BP , weobtain: 8r 2 P � � jHr \N j 6= 0 orBr * N or r is defeated w.r.t.N :In order to prove thatN is a model, we need to demonstrate thatjHr \ N j = 1whenB � N andr is not defeated w.r.t.N . In this case, we already know thatjHr \ N j � 1. SinceN is total, we know in this case thatr is indefeasible (e.gCorollary 6.3.1) w.r.t.N . Now suppose thatHr \ N = S with jSj > 1. Thisimplies, because of the first condition of Definition 6.3.3, thatS is an unfoundedset w.r.t.N . SinceS � N , we have a contradiction withN being unfounded-free.Thus,jHr \N j = 1. SoN is a model. 2For choice logic programs, it is sufficient thatI is unfounded-free. This is nolonger true for ordered choice logic programs, because the amount of negative in-formation in an interpretation has impact on the greatest unfounded set and, thus,on the unfounded-freeness. Nevertheless,CP (I) is an interesting stop-criterionfor an algorithm that computes the stable models, since unfounded-free modelsare automatically stable models (e.g. Theorem 5.4.10). However, it does not tellus anything on how to get fromW!P towards a stable model. The next theoremshows that the result ofCP (I) is also useful in this case.

Theorem 6.3.22LetP be an OCLP, letI be an interpretation forP and letM bea stable model ofP such thatI � M andI+ � M+. Then, there exists a choicesetX 2 CP (I) such thatI [X �M .

Page 210: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

196 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Proof: M is a stable model ofP . We know, by Theorem 6.3.10, thatM isunfounded-free. Thus,Z = M+ n I+ with Z � M andZ 6= ; cannot be anunfounded set forP w.r.t.M . This implies, amongst other things, that there existsan atoma 2 Z for which there existsr 2 P � with a 2 Hr such that:

1. Br \ notM = ; , and

2. Br \ Z = ; , and

3. (Hr n fag) \M = ; , and

4. r is not defeated w.r.t.M .

The first condition yieldsBr � M . Combining this with the second condition,we obtainBr � I. The third condition implies(Hr n fag) � M�. From which(Hr n fag) \ I = ; can be derived. Together witha 2 Z, we haveHr \ I = ;.The last condition yields, as defeatedness is monotonic, thatr cannot be defeatedw.r.t. I.This enables us to conclude thatX = fa; not (Hr n fag)g 2 CP (I) such thatI [X �M . 2Corollary 6.3.6 LetP be a well-founded OCLP. IfW!P is not a stable model forP , then, for each stable modelM , there exists a choice setX 2 CP (W!P ) suchthatW!P [X �M .

Proof: SinceW!P is not a stable model, it holds, by virtue of Theorem 6.3.14,thatW!P �M . Thus the statement follows from Theorem 6.3.22. 2With the above theorem and corollary we have demonstrated that there is pathfrom the least fixpoint of theWP -operator to every stable model by simply addingchoice sets. When your goal, a stable model, is set nothing can go wrong; everytime you can pick the correct choice set to be added without running into contra-dictions. When you have no idea which interpretations are stable models, thereis always the risk of making the wrong choice. To reduce this risk as much aspossible, we should only use choice sets when no elements canbe added deter-ministically. Every time that a choice set is added to an interpretation we applytheWP -operator until a fixpoint is reached. When it is necessary wecan add anew choice set. In case we end up with a contradiction, we knowsomething hasgone wrong and that we will not reach a stable model.

Page 211: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 197

P3P2P1 suit ase

ba kpa k adventuroussuit ase � ba kpa k adventurous � sun Figure 6.15: Packing to go OCLP of Example 6.3.20

Definition 6.3.9 Let P be a well-founded OCLP. A sequence of interpretationsfVngn2N is acomputationof P iff the following hold:� V0 =W!P , and� If WP (Vn) n Vn 6= ; thenVn+1 =WP (Vn) [ Vn , otherwise

– If CP (Vn) 6= ; thenVn+1 = X [ Vn , for someX 2 CP (Vn)– elseVn+1 = Vn .

The next example demonstrates the need for a computation to be a sequence ofinterpretations.

Example6.3.20 Going on vacation means that you need to pack the things youwant to take with you. Some people take very little while it seems that others takeall their belongings. Of course, every journey has it own characteristics whichshould be taking into account when you start packing. Most people put their stuffin a suitcase. This is very practical for things that may not wrinkle but for anadventurous vacation were you go from one place to an other taking care of yourown luggage, a backpack is far more practical. This information is represented bythe OCLP in Figure 6.15.This OCLP is well-founded,W!P equals the empty set. For this interpretation wehave:CP (W!P ) = ffsuit aseg; fsuit ase; not ba kpa kg; fba kpa k; not suit aseg;fadventurous; not sung; fsun; not adventurousgg :

Page 212: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

198 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

We choose the choice setfsuit aseg to continue. Then,V1 = fsuit aseg :Now, V2 = V1 [WP (V1) = fsuit ase; not ba kpa kgfor whichCP (V2) = ffadventurous; not sung; fsun; not adventurousgg :This time we take the choice setfadventurous; not sung which gives usV3 = fsuit ase; not ba kpa k ; adventurous; not sung :When we now continue, we obtain:V4 = fsuit ase; not ba kpa k ; adventurous; not sun; ba kpa kg :This set of literals is not consistent, sofV1; : : : ; V4g is not a computation ofP .This is definitely not a bad thing since we cannot useV4 to obtain a stable modelwhich is exactly what we had in mind for computations.

Since we work with a finite Herbrand base, we know that each computationfVngn2N is a monotonic sequence (w.r.t.�) and converges to a limitVn, suchthatVn+1 = Vn; n 2 N . We useV ! to denote this limit.

The next theorem demonstrates that every limit of a computation is total.

Theorem 6.3.23Let fVngn2N be a computation for a well-founded OCLPP .Then,V ! is a total unfounded-free interpretation such thatCP (V !) = ;.Proof: Unfounded-freeness follows immediately from Definition 6.3.9. Its defi-nition states thatV ! is an interpretation and thatWP (V !) nV ! = ;. This impliesthatGUSP (V !) \ V ! = ;.V ! being the limit also implies thatCP (V !) = ;. According to Definition 6.3.8,this implies that for alla 2 BP and for all rulesr 2 P � with a 2 Hr holds:� Br * V ! ; or� Hr \W 6= ; ; or

Page 213: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 199� r is defeated w.r.tV ! .

It is easy to see that eithera 2 TP (V !) or a 2 GUSP (V !), and this for everya.SinceWP (V !) � V !, we must have thatV ! is total. 2Computations can indeed be used to build stable models bottom-up.

Theorem 6.3.24Let fVngn2N be a computation for a well-founded OCLPP .Then,V ! is a stable modelP .

Proof: BecauseV ! is fixpoint of fVngn2N , we have thatCP (V !) = ;. WithTheorem 6.3.23, we have know thatV ! is total and unfounded-free. Combiningthis with Theorem 6.3.21, we obtain thatV ! is a model ofP . Theorem 6.3.10then implies thatV ! is a stable model. 2Every stable model of an ordered choice logic program corresponds to the limitof some computation.

Theorem 6.3.25LetM be a stable model for an OCLPP . Then,M = V ! forsome computationfVngn2N of P .

Proof: We will construct a computationfVngn2N whose elements are containedin M . Because there exists a stable model ofP we know, by Theorem 6.3.14, thatW!P exists andW!P � M . Let fVngn2N be the sequence of sets of literals suchthatV0 =W!P and, forn � 0, Vn+1 it is as follows:

1. IfWP (Vn) n Vn+ 6= ;, thenVn+1 =WP (Vn) [ Vn; otherwise

2. If CP (Vn) 6= ;, thenVn+1 = Vn [X, whereX 2 CP (Vn) andX �M3. elseVn+1 = Vn.

We will prove by induction thatVn �M for eachn 2 N .

(Base of induction)V0 =W!P �M is guaranteed by Theorem 6.3.14.

(Induction step) Assume thatVn �M . BecauseM is a stable model andVn �M ,we have, with Theorem 6.3.12 and becauseWP is monotonic, that(WP (Vn) [Vn) � (WP (M) [ Vn) � M . Thus, if Vn+1 is constructed using (1), we haveVn+1 � M . In caseVn+1 is constructed with (2), Theorem 6.3.22 ensures theexistence of a choice setX 2 CP (Vn) such thatX �M . So,Vn+1 = Vn[X �M .

Page 214: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

200 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

If Vn+1 = Vn then, by the induction hypothesis,Vn+1 � M . BecauseM is astable model, it is consistent. Thus,Vn is consistent for eachn 2 N . This makesfVngn2N a computation forP such thatV ! � M . By Theorem 6.3.23,V ! istotal. This implies thatV ! = M . 2When we want to obtain all the stable models of ordered choicelogic programs bymeans of a bottom-up algorithm, we can use these computations. However, sincewe do not know the stable models in advance (which is obvious,otherwise wewould not need the algorithm), we do not know which choice sets lead to a stablemodel and which ones produce only contradictions. Therefore, it is important thatwe try every possible combination. You can see it as a tree withW!P as the root.Every internal node represents a choice set being added after whichWP is called.The paths from the root to a leaf represent either computations or an attempt tocreate a computation ending in an inconsistent set of literals. The former leavescorrespond exactly with the stable models of the program (Theorems 6.3.24 and6.3.25).

Figure 6.35 on page 262 shows the algorithm for the computation of all stablemodels of a finite ordered choice logic program which may contain constraints,based on the results presented in this section.First, the least fixpointW!P is computed by therepeat-until statement in the mainprogram. This computation uses, thanks to Theorem 6.3.18, the fixpointR!P;I(BP )to compute the greatest unfounded set. If, during this fixpoint computation, incon-sistencies appear, we know (Theorem 6.3.14) that the program does not have anystable models, so we end the program. If everything proceedsnormally andW!Pis obtained, we check its totality to verify whether or notW!P is the unique sta-ble model ofP (Corollary 5.4.2) . If so,W!P is given as output and the programterminates. Otherwise, the procedureCompute-Stableis invoked to generate allcomputations ofP . The procedure uses recursion to simulate the backtrackingtechnique on which the computation is based (e.g. you try every choice set untilyou find the right one to continue).

Theorem 6.3.26Given a finite OCLPP , the algorithm of Figure 6.35 on page 262terminates in a finite amount of time and returns the stable models ofP .

Proof: The repeat-until statement of themain procedure in Figure 6.35 com-putes the least fixpointW!P if it exists. The only wayW!P could not exist is whenan interpretation is computed which is not unfounded-free.In that situation, Theo-rem 6.3.14 ensures thatP has no stable models, so we can exit the program. Since

Page 215: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.3. THE STABLE MODEL SEMANTICS 201WP is monotonic andBP � is finite, this computation halts after a finite numberof steps. Likewise, therepeat-until statement of the procedureCompute-Stablecomputes a sequenceIi whereI0 = Vn[X andIn+1 =WP (In)[In. SinceWP ismonotonic andBP is finite, this loop also halts finitely. Therefore, the algorithmof Figure 6.35 terminates in a finite amount of time.

As to correctness, we observe that the algorithm essentially generates all compu-tations ofP . Thus, Theorems 6.3.24 and 6.3.25 guaranty both the soundness andthe completeness of the algorithm. 2Example6.3.21 Below you can see an abbreviated trace of the algorithm appliedon the OCLP of Example 6.3.20:mainI =W!P = ;I+ [ I� = ; 6= BP

Compute-Stable(; = In)CP (In) = ffsuit aseg; fsuit ase; not ba kpa kg; fba kpa k ; not suit aseg;fadventurous; not sung; fsun; not adventurousggX = fsuit asegIn+1 = fsuit asegIn+1 =WP (In + 1) [ In+1 = fsuit ase; not ba kba kgCompute-Stable(fsuit ase; not ba kba kg = In)CP (In) = ffadventurous; not sung; fsun; not adventurousggX = fadventurous; not sungIn+1 = fsuit ase; not ba kba k ; adventurous; not sungIn+1 =WP (In+1) = fba kpa k ; suit ase; not ba kba k ;adventurous; not sung =2 IPX = fsun; not adventurousgIn+1 = fsuit ase; not ba kba k ; sun; not adventurousgIn+1 =WP (In+1)

Compute-Stable(In+1)CP (In) = ;outputfsuit ase; not ba kba k ; sun; not adventurousgX = fsuit ase; not ba kpa kgIn+1 = fsuit ase; not ba kpa kgIn+1 =WP (In + 1)

Compute-Stable(fsuit ase; not ba kba kg = In)CP (In) = ffadventurous; not sung; fsun; not adventurousgg

Page 216: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

202 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMINGX = fadventurous; not sungIn+1 = fsuit ase; not ba kba k ; adventurous; not sungIn+1 =WP (In+1) = fba kpa k ; suit ase; not ba kba k ;adventurous; not sung =2 IPX = fsun; not adventurousgIn+1 = fsuit ase; not ba kba k ; sun; not adventurousgIn+1 =WP (In+1)Compute-Stable(In+1)CP (In) = ;

outputfsuit ase; not ba kba k ; sun; not adventurousgX = fadventurous; not sungIn+1 = fadventurous; not sungIn+1 =WP (In+1) [ In+1 = fba kpa k ; not sun;adventurousgIn+1 =WP (In+1) [ In+1 = fnot suit ase; ba kpa k ; not sun;adventurousgCompute-Stable(In+1)CP (In) = ;

outputfnot suit ase; ba kpa k ; adventurous; not sungX = fsun; not adventurousgIn+1 = fsun; not adventurousgIn+1 =WP (In+1) [ In+1 = fsuit ase; sun; not adventurousgIn+1 =WP (In+1) [ In+1 = fnot ba kpa k ; suit ase; sun;not adventurousgCompute-Stable(In+1)CP (In) = ;

outputfnot ba kpa k ; suit ase; sun; not adventurousg .

When we look back at our example we see that some stable modelsare constructedmore than once. The same applies to wrong choices. One of the reasons for thisis the appearance of two choice sets that contain the same atom. An other reasonis that applying choice sets in a different order may result in the same outcome.Therefore, a real implementation should use a sort of caching mechanism to avoidthis.

Another aspect of this algorithm is the cost to compute the greatest unfoundedset every time a choice set is added to the current interpretation until a fixpointis reached. One way of reducing this cost is to cache the greatest unfounded setfrom previous runs. SinceGUSP is a monotonic operator one can be sure that

Page 217: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 203

previous unfounded atoms are still unfounded. Another possible way is to onlyuse theTP -operator like we did for choice logic programs. But this, asarguedin Chapter 5, increases the recursion-depth and introducesmore contradictions.Perhaps the best alternative for theWP -operator is its reduced versionWP whichmaintains the linear part. For unfounded sets this comes down to the first twoconditions. This way we do not need an iterative fixpoint anymore. Only now, weneed to add the negation of the positive complement in order to obtain all falseatoms and to verify whether the result is unfounded-free or not.

In this subsection we have introduced unfounded sets as a tool to detect stablemodels. Furthermore we used them to define the procedural aspect of the stablemodel semantics. At the end we demonstrated that they are also very useful forour bottom-up algorithm.

The stable model semantics is skeptical: when two alternatives are equally pre-ferred it remains indecisive. In some situations it might becrucial to make adecision anyway. In the next section we will investigate this more credulous ap-proach.

6.4 Skeptical vs. Credulous

In the previous section we defined the stable model semantics. Whenever thereare two alternatives, either equally preferred or unrelated with each other, thissemantics makes no choice amongst them. For a large number ofsituations thisis a reasonable thing to do, since there are no compelling reasons to take onealternative and to leave the other. However, for a vast number of situations thisis not acceptable. Take for example a doctor who has to treat apatient. Whenshe has two cures which are equally effective, she has to makea “random” choicebetween them. Leaving the patient sick is simply not an option.

Example6.4.1 People can become ill wherever they are, but it is rather unpleas-ant to be sick on vacation. Imagine somebody who has become seriously ill inKenya and has been admitted to an hospital in Nairobi. After some time the pa-tient’s condition has improved so that the doctor has to chose to transfer herpatient to a hospital in her home country or to leave her in Nairobi for furthertreatment. Considering that the patient would love to go home and the negativeeffects that such a journey might have, both decisions are equally justified. Thissituation is represented by the OCLP in Figure 6.16. This situation has no stable

Page 218: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

204 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P2P1 home nairobi home � nairobi Figure 6.16: Holiday sickness (Example 6.4.1)

models which is practically saying that the patient does notneed any further care.Preferably one would like to have two solutions: the patientstays in Nairobi or isbeing repatriated.

6.4.1 The Answer Set Semantics

In this subsection we will introduce an alternative for the stable model semantics,called the answer set semantics. We use this term to express that whenever the sta-ble model semantics is indecisive about two alternatives, the answer set semanticswill make a decision and come up with an answer.

In order to do so we have to change the notion of defeating suchthat it can accom-modate these decisions. First of all, we have to make sure that rules in the sameor in an unrelated component can also be considered as defeaters. To justify analternative, we demand that the defeaters are applied. The semantics should notgive in to threats of applicable but non-applied rules.

Definition 6.4.1 Let I be an interpretation for an OCLPP . A rule r 2 P � isc-defeatedw.r.t. I iff8a 2 Hr � 9r0 2 P � � (r) 6� (r0) ^ r0 is applied w.r.t.I ^ Hr0 � I (r)(a) :The ruler0 is called ac-defeaterw.r.t. I.

It is easy to see that c-defeating is a generalization of defeating: whenever (r0) � (r), we have that c-defeating implies defeating.

Example6.4.2 Consider the Egyptian OCLP depicted in Figure 6.17. LetI bethe interpretation I = fsinai desertg :

Page 219: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 205

P3P2P1 giza � nile ruise nile ruise sinai desert � nile ruise sinai desert Figure 6.17: The Egyptian OCLP of Example 6.4.2

The rulenile ruise is defeated and c-defeated w.r.t.I by the applied rulesinai desert . The ruler : giza � nile ruise is defeated w.r.t.I. One ofits defeaters is the applicable ruled : nile ruise . The ruler is not c-defeatedw.r.t. I, sinced is not applied. From a credulous point of view this is a reasonablething to conclude. The rulegiza � nile ruise tells you to make a choice. Fornile ruise you know that this cannot be true. The atomgiza does not have anyother alternatives, so there is no reason whygiza should not be considered.

However, beside the (c-)defeater being applicable or applied, there is another im-portant difference: c-defeating is not monotonic, which isdemonstrated by thefollowing example.

Example6.4.3 A conference is being held in Siena, Italy. Since you have to goto Italy anyway, this seems like a good opportunity to also visit another city. Youhave two places in mind: Firenze and Rome. They are famous andthey have adirect connection. Suddenly, you start doubting. Siena andFirenze are both inTuscany, so perhaps variation is more appropriate. The distance between Romeand Siena has to be covered either by train or bus, which takessome time. Per-haps a city closer to Siena is more convenient. But then, you remember that yourpromised to visit a friend in l’Aquila. To combine this with avisit to Siena, it isbetter that you fly to Rome. This situation is represented by the OCLP in Fig-ure 6.18.Consider the interpretations:I = fromeg andJ = frome; �renzeg :

Page 220: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

206 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P3P2P1

siena l 0aquilal 0aquila �renze � siena rome l 0aquilarome � siena �renze � rome siena

Figure 6.18: The Siena OCLP of Example 6.4.3

and the ruler : siena . The ruler is defeated w.r.t.I by the applied ruler0 : rome � �renze , which is no longer so when we extendI to J . The ruler0is no longer applied.

The definition for a credulous model is the same as Definition 6.2.5, only this timewe use c-defeating instead of defeating.

Definition 6.4.2 LetP be an OCLP and letM be an interpretation forP . M is ac-modelfor P iff every rule inP � is either not applicable, applied or c-defeatedw.r.t.M . A c-model isminimal when there is no c-modelN such thatN+ �M+.

Example6.4.4 The OCLP of Example 6.4.1 has two (minimal) c-models:M1 = fhome; not nairobig andM2 = fnairobi ; not homeg :The OCLP of Example 6.4.3 has a single (minimal) c-model:M = fl 0Aquila; siena; rome; not �renzeg :The Egyptian OCLP of Example 6.4.2 has one (minimal) c-model:M = fgiza; sinai desert ; not nile ruiseg :The following theorem demonstrates that, in a c-model, an alternative is chosenfor every forced decision.

Page 221: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 207

P3P2P1 touring diving touring � hiking diving � hiking hiking

Figure 6.19: The Australian OCLP of Example 6.4.5

Theorem 6.4.1 Let P be an OCLP and letM be a credulous model forP . Forevery applicable ruler 2 P �:8a 2 Hr � a 2M _ (9b 2 M (r)(a) � b 2M) :Proof: Let r be an applicable rule inP �. BecauseM is a c-model, we must havethat jHr \M j = 1 or r is c-defeated w.r.t.M . In the former case, we either havethata 2 M or jHrj > 1. In case ofjHrj > 1, we have that(Hr n fag) � M (r)(a).This implies thatM (r)(a)\M 6= ;. Whenr is c-defeated w.r.t.M , we must have,according to Definition 6.4.1, that:9r0 2 P � � r0 is applied w.r.t.M ^ Hr0 � I (r)(a) :The ruler0 being applied meansHr0 \M 6= ;. SinceHr0 � I (r)(a), we obtainthatI (r)(a) \M 6= ;. 2For the skeptical semantics this is not true, as demonstrated by the following ex-ample.

Example6.4.5 Australia is a land of many tourist pleasures. First of all you havethe great barrier reef, which is excellent for diving. Also,on land, the differentlandscapes make it a perfect place for touring and hiking. The OCLP in Fig-ure 6.19 suggest a possible vacation in the land of the kangaroos.This program has one stable model:M = fdiving; not hiking; not touringg :

Page 222: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

208 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

The ruletouring is applicable, defeated and not applied. Furthermore, wehaveMP1(touring) = fhikingg \M = ;. A skeptical reasoner would say whychoose for touring if hiking is more preferred. On the other hand, why go forhiking if diving is more appreciated. A more credulous reasoner is more inclinedto go diving which rules out the possibility to go for a hike. Since hiking is outof the question, nobody can stop her to go touring around. This results in theminimal model: N = fdiving; touring; not hikingg :This immediately explains why we requested that defeaters are applied. In casethat only applicability is required, we end up with the stable modelM .

For the skeptical or cautious semantics we argued that the minimal model seman-tics is not always the most intuitive one. We used Examples 6.3.1 and 6.3.2 onpages 165 and 166 to demonstrate this. When we apply the minimal c-modelsemantics to these examples, we obtain exactly the same results. Therefore, weneed a semantics that filters out these unintuitive minimal models. To make adistinction between this semantics and the stable model semantics and because amodel returns an alternative for every forced decision, we call this more credulousversion the answer set semantics. Just like answer sets for extended disjunctivelogic programs (Section 3.5 on page 43), we reduce our program according to theinterpretation at hand.

Definition 6.4.3 Let P be an OCLP and letI be an interpretation for it. ThereductofP w.r.t. I, denotedP I , is the choice logic program obtained fromP � bydeleting every c-defeated rule w.r.tI.

An answer set is then nothing more than a stable model of the correspondingchoice logic program.

Definition 6.4.4 LetP be an OCLP and letM be a total interpretation.M is ananswer setfor P iff M is a stable model forPM .

Example6.4.6 Reconsider the OCLPP of Example 6.4.3. The minimal c-modelM = fsiena; roma; l 0aquila; not �renzeg

Page 223: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 209

is indeed an answer set forP . The reduct w.r.t.M is the choice logic programPM : �renze � siena l 0aquila siena l 0aquilaroma l 0aquilawithM as its single stable model.

The Holiday-illness OCLP of Example 6.4.1 has two answer sets:M1 = fhome; not nairobig andfnairobi ; not homeg ;which corresponds exactly with our intuition.

The last example demonstrates that a random choice between two equally valuedalternatives introduces a new source of non-determinism into our semantics.

Of course, we must have that answer sets are also c-models.

Theorem 6.4.2 LetM be an answer set for an OCLPP . Then,M is c-model forP .

Proof: In order to show this, we need to prove that every rule inP � is either non-applicable, applied or defeated w.r.t.M . Let us begin with the constraints. Sincethey do not contain head atoms, they cannot be c-defeated, implying that theyare automatically included inPM . SinceM is a stable model forPM and thus amodel, we have that every constraint is non-applicable inPM , which immediatelyimplies that they are also satisfied forP .Let us now consider the rules with head atoms. Letr be such a rule. Assume thatr is applicable and not c-defeated w.r.t.M . If one of these conditions is not met,we have thatr is satisfied w.r.t.M . Sincer is not c-defeated w.r.t.M , r must bein PM . SinceM is model andr is applicable,r has to be applied inPM , whichimpliesjHr \M j = 1, makingr applied inP .Since all rules inP � are satisfied, we obtain thatM is a c-model forP . 2For extended disjunctive logic programs we have seen that the answer set seman-tics is not a minimal semantics (Example 3.5.5 on page 3.5.5). The same appliesto answer sets of ordered choice logic programs.

Page 224: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

210 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P2P1 hina � tibet thailand thailand � hina thailand � tibet Figure 6.20: The Asian OCLP of Example 6.4.7

Example6.4.7 Consider the Asian OCLP depicted in Figure 6.4.7. LetM1 = fthailand ; not hina; not tibetg andM2 = fthailand ; hina; not tibetgbe two total interpretations for this programP . ClearlyM+1 � M+2 , while bothinterpretations are answer sets forP . ForM1, we have thatPM1 equals:thailand thailand � hina thailand � tibet It is clear thatM1 is indeed a stable model of this program.The programPM2 looks like: hina � tibet thailand � tibet and has two stable models:ftibet ; not thailand ; not hinag andfthailand ; hina; not tibetg. The reason whyM2 is also an answer set is because the c-defeater has become the c-defeated. The justification for c-defeating hina �tibet has disappeared.

In the beginning of this subsection, we argued that c-defeating is both a genera-lization and a specialization of defeating. The former because c-defeaters maynot be more general instead of being more specific. The latterbecause we requirec-defeaters to be applied instead of just applicable. The next lemma demonstratesthat, for a certain type of ordered choice logic programs, a defeated rule is eitherc-defeated or applied.

Lemma 6.4.1 LetP be an OCLP such that every atom appears at most once in achoice rule, letM be a model forP and letr be an applicable rule inP �. If r isdefeated w.r.t.M thenr is c-defeated w.r.t.M or r is applied.

Page 225: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 211

Proof: It is easy to see that the construction ofP forces defeaters to be ruleswith a single head atom. Furthermore,8b 2 MC (a), we have thatMC (b) =(MC (a) n fbg) [ fag. According to Definition 6.2.4,r being defeated implies:8a 2 Hr � 9r0 2 P � � (r0) � (r) ^ Br0 �M ^ Hr0 2 M (r)(a) :When this ruler0 is applied, we know, with Definition 6.4.1, thatr0 is a c-defeaterfor r. Whenr0 is not applied, we have thatr0 should be defeated itself. The headof this rule is eithera or one of its alternatives. Since defeating always takes usto a more preferred component, we must eventually end up witha rule that canno longer be defeated. SinceM is model, this rule must be applied. Followingthis path of defeating, it is easy to see that eithera is true or we found ourselves ac-defeater.So in caser is a rule with a single head atom, we have proven our claim. When ris a choice rule, we must at least have thatjHr \M j � 1. WhenjHr \M j = 1,the ruler is applied. Otherwise,r is defeated. The defeaters ofr can be found ina more preferred component and, thus, out of the scope of the choice rule. Thismakes these defeaters indefeasible. SinceM is a model ofP , they should beapplied. The defeaterr0 used fora must have thatHr � M (r)(a). This makes thatM (r)(a) \M 6= ;, asr0 is applied. 2When atoms appear more than once in a choice rule, the above lemma is no longertrue.

Example6.4.8 Let P be the Egyptian OCLP from Example 6.4.2. Notice thatthe atomnile ruise appears in every choice rule of the program.P has onemodel, namelyM = fsinai desert ; not nile ruise; not gizag. The ruler :giza � nile ruise is defeated w.r.tM butr is not applied nor c-defeated w.r.t.M .

The next theorem shows that, for this same type of programs, models are alsoc-models.

Theorem 6.4.3 LetP be an OCLP such that every atom appears at most once ina choice rule. IfM is a model forP thenM is also a c-model ofP .

Proof: The only rules that might cause problems are the defeated applicablerules. From Lemma 6.4.1, we can derive that such rules will either be c-defeated

Page 226: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

212 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

or applied. This makes them satisfied w.r.t.M . So, we may conclude thatM isindeed a c-model ofP . 2When every atom appears at most once in a choice rule, we do notonly have thatmodels are c-models but also that stable models can be seen asanswer sets.

Theorem 6.4.4 LetP be an OCLP such that every atom appears at most once ina choice rule. Then, every stable model forP is also an answer set forP .

Proof: Let M be a stable model forP . In order to demonstrate thatM is ananswer set, we need to prove, according to Definition 6.4.4, thatM is a stablemodel forPM . With Theorem 5.2.1, this implies proving thatM is a minimalmodel ofPM .� M is a model ofPM . We need to demonstrate that every rule inPM is

satisfied. The constraints inPM are immediately satisfied as they appearalso inPM andM is model for this program. So letr be a rule inPM withnon-empty head such thatBr � M . We need to demonstrate thatr is alsoapplied. Becauser is PM , we know thatr is not c-defeated w.r.t.M . Nowthere are two possibilities: eitherr is defeated w.r.tM or r is not defeatedw.r.t. M . The former case, implies with Lemma 6.4.1, thatr is applied,since c-defeated would yield a contradiction. The latter case yields thatr isalso applied becauseM is a model forP . So, we may conclude thatM isindeed a model forPM .� M is minimal. We will demonstrate that no total interpretationZ withZ+ �M+ can be considered a model forPM . Let S = M+ n Z+ with S 6= ;.BecauseM is a stable model forP , we know, with Theorem 6.3.10, thatMis unfounded-free. Theorem 6.3.7 tells us thatS cannot be an unfoundedset forP w.r.t.M . With Definition 6.3.3, this yields that a ruler 2 P � withHr \ S 6= ; exists such that, amongst other things:

1. r is not defeated w.r.t.M ; and

2. Br \ notM = ; ; and

3. Br \ S = ; ; and

4. (Hr n S) \M = ; .

Page 227: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 213

The combination of conditions (2), (3), the totality ofM andZ+ = M+ nSyieldsBr � Z. Condition 4) implies thatHr \ Z = ;. In caser is a choicerule, we know, with the structure ofP and jHr \ M j = 1, that r is notc-defeated. Ifr is a rule with a single head atom, we know, withr beingnot defeated, that all more specific rules with an alternative of Hr in thehead cannot be applicable. There are three possibilities depending on thepositioning ofr with respect to the choice rule containingHr.

– r less specific. The choice rule cannot be defeated w.r.t.M either,since there is no defeater for the atom inHr. This gives us thatM (r)(Hr)\M = ;, from which we derive thatr cannot be c-defeatedw.r.t.M .

– r more specific. The construction ofP assures thatM (r)(Hr) = ;,implying thatr cannot be c-defeated w.r.t.M .

– otherwise. We can use the same reasoning as whenr is less specific.

We can conclude thatr will not be c-defeated either. This implies thatr isa rule inPM . Above, we showed thatBr � Z, whileHr \ Z = ;. Thisyields thatM cannot be a model forPM . So, we may conclude thatM is aminimal model forPM .

Thus,M is an answer set forP . 2For general ordered choice logic programs, a correlation between the stable mo-dels and the answer sets not necessarily exist , as illustrated by the followingexamples.

Example6.4.9 The Illness OCLP of Example 6.4.1 has two answer sets, as men-tioned in Example 6.4.6, but has no stable models.

Example6.4.10 Reconsider the OCLP from Example 6.4.2. Suppose that one ofyour friends suggests that in case Giza is considered, the group should either gofor a camel safari in the Sinai desert or take a beach vacationin Cyprus. Thisfriend of yours adds that she is inclined to choose the beach vacation anyway.The extended version of the Egyptian OCLP is depicted in Figure 6.4.10.This program has one stable model:M = f yprus; sinai desert ; not giza; not nile ruiseg ;

Page 228: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

214 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P3P2P1 giza � nile ruise nile ruise yprus P4 sinai dessert � yprus gizasinai desert � nile ruise sinai desert

Figure 6.21: The Egypt-Extension OCLP of Example 6.4.10

but no answer sets. Every interpretation contains either alternatives that are de-feated without any justification or alternatives that are assumed to be true withoutany reason.

The above examples demonstrate that the answer set semantics is credulous whenpossible c-defeaters are concerned but reacts skepticallywhen it comes down toc-defeating itself. A compromise, if possible, between these two extremes yieldsan answer set.

In this subsection, we introduced the answer set semantics as an alternative forthe stable model semantics of Section 6.3. When possible, wedemonstrated therelationship between these two semantics. For the stable model semantics, wedefined, in Subsection 6.3.2, a fixpoint characterization. In the following part, wewill introduce a similar one for the answer set semantics.

6.4.2 A Credulous Fixpoint Characterization

In subsection 6.3.2, we defined a fixpoint characterization for our stable modelsemantics as an extension of the fixpoint semantics for choice logic programs.Unfounded sets, exploiting the hidden presence of negationin a program, form thebasis of the procedural definition of stable models. For our answer set semantics

Page 229: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 215

P2P1 kenya � tanzania zanzibar tanzania zanzibarkenya zanzibarFigure 6.22: The Zanzibar OCLP of Example 6.4.11

we can create a similar fixpoint semantics8.

6.4.2.1 Assumption sets

For the answer set semantics we formalize the implicit negation that is presentin the program by means of assumption sets, which are a generalization of theunfounded sets for choice logic programs. Just as for unfounded sets of orderedchoice logic programs, it is not sufficient to simply add a condition of defeating.An applied rule can become c-defeated when atoms are added tothe interpretation.Then, it does no longer matter that more than one head atom is considered to betrue. It would be wrong to assume that these atoms should be false simply becauseof this single rule. Therefore, alternatives of a forced decision should only beconsidered false when the rule can never be c-defeated. In this case we say thatthe rule is c-indefeasible.

Definition 6.4.5 LetP be an OCLP. A ruler fromP is said to bec-indefeasiblew.r.t. an interpretationI 2 IP iff r is not c-defeated w.r.t. any interpretationJsuch thatI � J .

Example6.4.11 As a Belgian citizen you need a visa for Tanzania in order to visitZanzibar. Your plan is to go on safari either in Kenya or Tanzania before relaxingon the spice island. Reaching Zanzibar implies flying to Kenya. This implies thatyou will need a visa for Kenya as well. The OCLP of Figure 6.22 tells you which

8Because of the similarity between the two fixpoint semantics, we will omit similar proofs inthis section. The interested reader can obtain the proofs byreplacing model, stable model, indefea-sible, defeated, unfounded sets and the various operators with their respective credulous variantsc-model, answer set, c-indefeasible, c-defeated/overruled, assumption set and the credulous ver-sions of the operators likeTP .

Page 230: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

216 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

visa you need to obtain.Consider now the interpretationI = ftanzaniag. The rulekenya � tanzania is not c-indefeasible w.r.t.I. The answer setM = fkenya; tanzania; zanzibargis responsible for this.

C-indefeasibility is a monotonic operator despite the presence of non-monotonicc-defeating.

Theorem 6.4.5 LetP be an OCLP and letI andJ be two interpretations forPsuch thatI � J . If a rule r is c-indefeasible w.r.t.I thenr is c-indefeasible w.r.t.J .

The next corollary follows immediately from Definition 6.4.5.

Corollary 6.4.1 Let I be a total interpretation for an OCLPP and letr be a rulein P �. Then,r is not c-defeated w.r.t.I iff r is c-indefeasible w.r.t.I.

When we defined c-defeating, we argued that this operator wasnot monotonic.The reason for this is the demand for applied c-defeaters. When an interpretationis extended, it is quite possible that a c-defeater is no longer applied. Given this,it would be wrong to assume all head atoms of the c-defeated rule to be false. Inorder to decide whether or not these head atoms may indeed be considered false,we need a more stricter version of c-defeating, called overruling. A rule is said tobe overruled when its c-defeaters will remain so in every extension of the currentinterpretation.

Definition 6.4.6 Let I be an interpretation for an OCLPP . A ruler 2 P � is saidto beoverruledw.r.t. I when, for alla 2 Hr, a c-defeaterr0 of r exists such that(Hr0 n I) � I� .

Example6.4.12 Reconsider the Asian OCLP of Example 6.4.7 and consider theinterpretationI = fthailand ; not tibetg. The rule hina � tibet is c-defeatedw.r.t. I but not overruled. The c-defeaterr : thailand � hina is applied but(HrnI) =2 I�. It is not very wise to conclude, starting from this interpretation, that hina should be considered false. Adding this atom either positively or negativelyresults in an answer set ofP .

Page 231: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 217

Whereas c-defeating is not monotonic, overruling is.

Theorem 6.4.6 Let I andJ be two interpretations for an OCLPP such thatI �J . If a rule r 2 P � is overruled w.r.tI thenr is also overruled w.r.t.J .

Proof: Let r 2 P � be overruled w.r.t.I. According to Definitions 6.4.6 and 6.4.1,this implies, for alla 2 Hr, a ruler0 2 P � exists such that: (r) 6� (r0) ^ jHr \ Ij = 1 ^ (Hr n I) � I� ^ Hr0 � I (r)(a) :BecauseI � J , we obtain(Hr n I) � (Hr n J) � J� and jHr \ J j > 1.BecauseJ is an interpretation, and thus consistent, the latter becomesHr\J j = 1.Theorem 6.2.1 allows to say thatI (r)(a) � J (r)(a). Combining this, we obtain,with Definition 6.4.6, thatr is also overruled w.r.t.J . 2When total interpretations are concerned, we have that c-defeating and overrulingcoincide.

Theorem 6.4.7 Let I be a total interpretation for an OCLPP . A rule r is c-defeated w.r.t.I iff r is overruled w.r.t.I.

Proof: According to Definition 6.4.6,r being overruled implies a c-defeaterr0exists such that(Hr nM) �M�. This proves the “if”-part.r0 being a c-defeater implies thatr0 is applied. BecauseM is total this yieldsjHr \M j = 1 and(Hr nM) � M�. With Definition 6.4.6, this implies thatr isoverruled byr0 w.r.t. I. 2Combining all this information, we are now ready to extend the unfounded sets ofchoice logic programming. To avoid confusing with the unfounded sets defined inSubsection 6.3.2.1, we call the sets of atoms that may be assumed false, accordingto the more credulous point of view, assumption sets.

Definition 6.4.7 Let I be an interpretation for an OCLPP . A setX � BP iscalled anassumption setw.r.t. I iff for eacha 2 X one of the following conditionsis satisfied:

1. 9r � (a� A B) 2 P � �B � I ^ A \ I 6= ; ^ r is c-indefeasiblew.r.t. I ; or

2. 9 B; a 2 P � �B � I ; or

Page 232: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

218 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

3. 8r 2 P � wherea 2 Hr, one of the following conditions holds:

(a) Br \ not I 6= ; ; or

(b) Br \X 6= ; ; or

(c) r is overruled w.r.t.I ; or

(d) (Hr n fag) \ I 6= ; ; or

(e) Hr \ Br 6= ; .

The set of all assumption sets forP w.r.t. I is denotedAP (I). The greatestassumption setfor P w.r.t. I, denotedGASP (I), is the union of all assumptionsets forP w.r.t. I. I is said to beassumption-freeiff I \ GASP (I) = ;.The definition of an assumption set is very similar to the definition of an unfoun-ded set, we only use c-indefeasible instead of indefeasibleand overruling insteadof defeating.

Example6.4.13 Reconsider the Egyptian OCLP of Example 6.4.10. We demon-strated that this program has a stable modelM = f yprus; sinai desert ; not giza; not nile ruiseg :For M we haveGUSP (M) = M� whileGASP (M) = fnile ruiseg.The greatest assumption set is, as its name already indicates, an assumption set.

Theorem 6.4.8 Let I be an interpretation for an OCLPP . Then,GASP (I) 2AP (I).TheGASP -operator is a monotonic operator.

Theorem 6.4.9 Let I andJ be interpretations for an OCLPP such thatI � J .Then,GASP (I) � GASP (J).Theorem 6.4.10Let P be a OCLP andI be a total interpretation forP . I isassumption-free, i.e.I \ GASP (I) = ;, iff no non-empty subset ofI+ is anassumption set forP w.r.t. I.

Page 233: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 219

6.4.2.2 Assumption Sets for Answer Set Detection

Previously we have seen that an assumption set contains atoms that can be as-sumed to be false in any c-model extension of the current interpretation. When,this interpretation is already a c-model, we should have that all the negative literalscan indeed be considered to be false.

Theorem 6.4.11LetM be a c-model for an OCLPP . Then,M� is an assump-tion set forP w.r.t. M , i.e.M� 2 AP (M).Proof: We proceed by contraposition. So assume thatM� is not an assumptionset w.r.t.M . With Definition 6.4.7, this implies that there exists an elementa ofM� such that none of the conditions of an assumption set holds. Among others,we have that9r 2 P � with a 2 Hr for which holds:Br \ notM = ; ^ (Hr n fag) \M = ; ^ r is not overruled w.r.t.M :SinceM is total,Br \ not M = ; yieldsBr � M . Becausea =2 M , we obtainHr \M = ;, which makes thatr is applicable but not applied. BecauseM istotal, we have, with Theorem 6.4.7, thatr is not defeated either. This allows us toconclude thatM is not a c-model forP . 2Just as for models, the reverse is not true. The counter example for models, Exam-ple 6.3.11 on page 179, remains a counter example when c-models and assumptionsets are used.

For the model semantics, we demonstrated that in case a modelwas unfounded-free it was also minimal (Theorem 6.3.9). For c-models and assumption-freenessthis is no longer true.

Example6.4.14 Reconsider the OCLP from Example 6.4.7. This program hastwo answer setsM1 = fthailand ; not hina; not tibetg andM2 = fthailand ; hina; not tibetg :with GASP (M1) = fnot hina; not tibetg andGASP (M2) = fnot tibetg. Sothey are both assumption-free. Yet, onlyM1 is minimal.

In the end this is not a bad thing: it allows us to use assumption-freeness for thedetection of answer sets which are not necessarily minimal.

Page 234: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

220 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P2P1 osta ri a � belize belize osta ri a belize mayasFigure 6.23: South American Nature OCLP of Example 6.4.15

Theorem 6.4.12LetM be a c-model for an OCLPP . Then,M is an answer setofP iff M is assumption-free forP , i.e.M \ GASP (M) = ;.The combination of the Theorems 6.4.11 and 6.4.12 gives us a characterization ofstable models based on assumption sets.

Corollary 6.4.2 LetP be an OCLP and letM be a c-model for it.M is an answerset ofP iff M� = GASP (M).The greatest assumption set alone is not sufficient for determining whether aninterpretation is an answer set or not. We also need to verifyif this interpretationis a c-model.

Example6.4.15 Two countries in South America are famous for their naturalheritage: Costa Rica and Belize. Costa Rica with its cloud forest is probablythe most exceptional. However, Belize has some wonderful remains of the Mayanempire. This information is represented by the OCLP depicted in Figure 6.23.Consider the interpretationI = fbelize; not mayas; not osta ri ag. This inter-pretation is assumption-free, i.e.GASP (I) = I�, while it is not even a c-model.

Next, we will see that answer sets can play an important role in the fixpoint char-acterization of answer sets.

6.4.2.3 Answer Sets as Fixpoints

Most semantics are equipped, besides a declarative definition, with a proceduralsemantics. Often this is done with some fixpoint operator. For the stable modelsemantics we used an extension of theWP -operator for choice logic program.

Page 235: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 221

Answer sets can be obtained in the same way, as long as we use assumption setsinstead of unfounded sets and c-defeated instead of defeated.

Above we have seen that assumption sets gather all those atoms that are not neededin any c-model extension of an interpretation. They give no information whatso-ever about atoms that are absolutely needed in such a c-modelextension. Thenext operator, the credulous immediate consequence operator, takes care of thoseatoms which should belong in any c-model extension of the current interpretation.

Definition 6.4.8 LetP be an OCLP. Thecredulous immediate consequence op-erator, denotedT P , is defined as follows:T P : 2BP [ not BP ! 2BPI 7! fa 2 BP � j 9A� a B 2 P � �A � not I ^B � I ^ r is c-indefeasible w.r.t.Ig :TheT P -operator is clearly monotonic.

The combination ofT P andGASP gives us an indication on how to change aninterpretation in order to extend it to a model.

Definition 6.4.9 LetP be an OCLP. Define theZP -operator as follows:ZP : IP ! 2BP [ not BPI 7! T P (I) [ not GASP (I) :TheZP -operator is monotonic and skeptical: it does not make any guesses thatcould be invalidated later on. It is the credulous variant oftheWP -operator.

Answer sets can be characterized as fixpoints of theZP -operator.

Theorem 6.4.13LetP be an OCLP. A total interpretationM 2 IP is an answerset ofP iff M is a fixpoint ofZP .

As said before,ZP is monotonic. Given a fixpoint of this operator (either totalornot), every interpretation that is included in this fixpointis in the domain ofZP .

Theorem 6.4.14Let I be an interpretation for an OCLPP and letM be a fix-point of theZP -operator. IfI �M , then

Page 236: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

222 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMINGP1P2 warm; oldwarm � old kalahari warm kalahari old kalahariFigure 6.24: The Kalahari OCLP of Example 6.4.16

1. I belongs to the domain of theZP -operator , and

2. ZP (I) �M .

Just as for the more skepticalWP -operator there is no guarantee that theZP -operator has a least fixpoint.

Definition 6.4.10 LetP be a finite OCLP. LetfZ0 : : : Zk : : : Zng be the finite se-quence whose k-th term is the k-fold application of theZP -operator on the emptyset (i.eZ0 = ;, Zk = ZP (Zk�1)) such that eitherZn =2 IP or Zn = ZP (Zn). Inthe latter case we denoteZn asZ!P and we say thatP is well-c-founded.

The following example demonstrates that not every program is well-c-founded.

Example6.4.16 Preparing a safari in the Namibian desert, the Kalahari, re-quires a lot of preparations. For most vacations you only need clothing for eitherwarm or cold weather. Going to the desert requires to take clothes for the boilingdays and icy nights. Packing them both in separate bags is asking for troubles. Itwould not be the first bag to get lost at the airport. One way of representing thisproblem is by the OCLP in Figure 6.24. This OCLP is not well-c-founded:Z0 = ;Z1 = fkalaharigZ2 = fkalahari ;warm; oldgZ3 = fkalahari ;warm; old ; not warm; not oldg =2 IP :The least fixpointZ!P of ZP , if it exists, can be regarded as the ”kernel” of anyanswer. (e.gZ!P is a subset of every answer set). In case the least fixpoint doesnot exist, we know that the program does not have any answer set.

Page 237: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 223

Theorem 6.4.15LetP be a finite OCLP.

1. If P is well-c-founded then for each answer setM of P ,Z!P � M .

2. If P is not well-c-founded, then there exists no answer set ofP at all.

WhenZ!P is total, it must be the answer set.

Corollary 6.4.3 LetP be a finite well-c-founded OCLP. IfZ!P is a total interpre-tation, then it is the unique answer set ofP .

From the above theorem and corollary we can conclude thatZ!P would be a verygood starting point for an algorithm which computes the answer sets for an or-dered choice logic program.

To make our procedural declaration of answer sets complete we still need a fix-point approach for the greatest assumption set.

6.4.2.4 Procedural Declaration

In order to obtain the greatest assumption set of an interpretation, we possiblyneed to verify the Herbrand base and all its subsets. Would itnot be nice to obtainthis greatest assumption set as the fixpoint of some operator? This would alsoenable us to have a full procedural definition of the answer set semantics.

For unfounded sets we used theRP -operator to check the unfounded-freenessproperty of (partial) interpretations and to compute the greatest unfounded set.For the credulous approach we have a similar operator to verify the assumption-freeness property of an interpretation and to retrieve the greatest assumption set.

Definition 6.4.11 Let I be an interpretation for an OCLPP . The operatorDP;I :2BP� ! 2BP� is defined by:

DP;I(X) = 8>>>>>>>>><>>>>>>>>>:a 2 X j9r : A� a B 2 P � � A \ I 6= ; ^ B � I ^r is c-indefeasible w.r.t.I ; or9 B; a 2 P � �B � I ; or8r : A� a B 2 P � � B \ (not I [X) 6= ; ; orr is overruled w.r.t.I ; orA \ I 6= ; ; or

or(A [ fag) \ B 6= ;g :9>>>>>>>>>=>>>>>>>>>;

Page 238: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

224 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Just asRP;I(J) gathers all the atoms that are contained in bothJ and some un-founded set w.r.t.I, DP;I(J) collects all the atoms that are both inJ and someassumption set w.r.t.I. AlthoughDP;I resembles the definition of an assumptionset, there is no guarantee that the output should be an assumption set. One sim-ply filters out the atoms that cannot belong to any assumptionset which might becontained in the input.

It is easy to see that theDP -operator can be used for the verification of assumptionsets.

Theorem 6.4.16Let P be an OCLP and letI be an interpretation for it. Then,DP;I(X) = X iff X 2 AP (I).DP;I is a monotonic operator. Given a setX � BP , it is obvious that the sequenceD0 = X, Dn = DP;I(Dn�1) decreases monotonically and converges to a limit,denoted byD!P;I(X).TheD!P;I(J)-operator gathers all atoms contained both inJ and in an assumptionset forP w.r.t. I.

Lemma 6.4.2 Let I be an interpretation for an OCLPP and letJ � BP . Then,every assumption set forP w.r.t I which is contained inJ , is also a subset ofD!P;I(J).For total interpretations, an easier way of checking the assumption-free propertyexists. Since a total interpretation can be considered assumption-free when nonon-empty subset of atoms fulfills the assumption set requirements, we can usetheD!P;I-operator to check this property by using the positive part as input.

Theorem 6.4.17Let I be a total interpretation for an OCLPP . If D!P;I(I+) = ;thenI is assumption-free.

The next lemma shows that the output ofD!P;I(X) is always an assumption setcontained inX.

Lemma 6.4.3 LetP be an OCLP, letI be an interpretation forP and letX � BP .Then,D!P;I(X) 2 AP (I).

Page 239: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 225D!P;I(I+) being the empty set is a sufficient and necessary condition for the as-sumption-freeness of a total interpretation.

Theorem 6.4.18LetI be a total interpretation for an OCLPP . Then,D!P;I(I+) =; iff I is assumption-free.D!P;I is not only the perfect tool for checking the assumption-freeness of a total in-terpretation, it supplies us with a mechanism for obtainingthe greatest assumptionset of any interpretation.

Theorem 6.4.19Let I be an interpretation for an OCLPP . Then,D!P;I(BP ) =GASP (I).Since assumption-freeness is defined using the greatest assumption set, we canuseD!P;I(BP ) to verify if an interpretation is assumption-free or not.

Corollary 6.4.4 LetI be an interpretation for an OCLPP . Then,I is assumption-free iffD!P;I(BP ) \ I = ;.By obtaining the greatest unfounded set as a fixpoint of theD!P;I-operator, we havea complete procedural definition of the answer set semantics.

Theorem 6.4.20LetM be a total interpretation for an OCLPP . Then,M is ananswer set ofP iff Z 0P (M) = M withZ 0P (I) = T P (I)[notD!P;I(BP ), for everyinterpretationI 2 IP .

Now we have the procedural tools to verify whether or not a total interpretation isan answer set. To obtain all answer sets of a program, this gives little information.It is a “bit” inefficient to check all the total interpretations of a program. Insteadwe need a more intelligent algorithm. We discuss such an algorithm in the nextpart.

6.4.2.5 The Credulous Algorithm

Verifying whether a total interpretation is an answer set ornot is one thing, com-puting all answer sets bottom-up is another. The fixpoint semantics showed itself

Page 240: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

226 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

to be useful for detecting answer sets, but it gives very little information for analgorithm, except that the least fixpoint ofWP is contained in every answer setwhenever it exists (Theorem 6.4.15). This supplies us with astarting point for ouralgorithm. When the program is not well-c-founded we can conclude that thereare no answer sets. Otherwise, we know thatZ!P is included in every possibleanswer set. In case this least fixpoint is total, we found ourselves the unique an-swer set (Theorem 6.4.3). But what next? How should we move fromZ!P towardsany of the answer sets? The deterministic nature of bothT P andGASP is thereason whyZ!P fails to do so.T P andGASP draw no conclusion that might beinvalidated by any extension of the current interpretation. So we need an operatorthat is willing to make a motivated guess. Note that from now until the end of thissection, we assume that our programs are finite.

Definition 6.4.12 Let I be an interpretation for an OCLPP . A c-choice setofP w.r.t. I is a set of literals of the formfa; not b1; : : : ; not bng with n � 0, suchthat there exists a ruler : a� b1 � : : :� bn B 2 P � for which holds thatfa; b1; : : : ; bng \ I = ;, B � I and r is not overruled w.r.t.I. The set of allc-choice sets ofP w.r.t. I is denoted byC P (I).A c-choice set is a set of literals, which added to the currentinterpretation, makessure that an extra rule is satisfied. The reason why we use overruling instead ofc-defeating is because we want c-choice sets to operate witha long term vision.The rule may have be not overruled but it is still possible that the rule is c-defeatedfor the moment. C-choice sets take into account the chance that the rule will nolonger be c-defeated when the current interpretation is extended.

The next theorem demonstrates that every interpretation included in an answer setcan be extended by means of a c-choice set in the direction of this answer set.

Theorem 6.4.21Let P be an OCLP, letI be an interpretation forP and letMbe an answer set ofP such thatI � M and I+ � M+. Then, a c-choice setX 2 C P (I) exists such thatI [X �M .

Of course, this is also true forZ!P which is included in every answer set.

Corollary 6.4.5 Let P be a well-c-founded OCLP. IfW!P is not an answer setfor P , then, for each answer setM , a c-choice setX 2 C P (Z!P ) exists such thatZ!P [X �M .

Page 241: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 227

To keep guessing to an absolute minimum, we will add literalsas much as possibleby means of theZP -operator. Only when this operator cannot supply any newliterals a choice set will be added. This mechanism is calleda c-computation.

Definition 6.4.13 LetP be a well-c-founded OCLP. A sequence of interpretationsfV ngn2N is a c-computationofP iff the following hold:� V 0 = Z!P , and� If ZP (V n ) n V n 6= ; thenV n+1 = ZP (V n ) [ V n , otherwise

– V n+1 = Vn [ not Vn; or

– If C P (V n ) 6= ; thenV n+1 = X [ V n , for someX 2 C P (V n )– elseV n+1 = V n .

To make sure that computations do not forget the minimal answer sets, we addedthe possibility ofV n+1 = Vn [ not Vn.

Since we work with a finite Herbrand base, we know that each c-computationfV ngn2N is a monotonic sequence (w.r.t.�) and converges to a limitV n , suchthatV n+1 = V n ; n 2 N . We useV ! to denote this limit.

The next theorem demonstrates that every limit of a computation is total.

Theorem 6.4.22Let fV ngn2N be a c-computation for a well-c-founded OCLPP . Then,V ! is a total assumption-free interpretation such thatCP (V ! ) = ;.Proof: According to Definition 6.3.9, we have forV ! thatZP (V ! )nV ! = ; andV ! = V ! [ not V ! or C P (V ! ) = ;. From this we can immediately conclude thatV ! is assumption-free.

WhenV ! = V ! [ not V ! , we know thatV ! must be total. Suppose now thatC P (V ! ) 6= ;. With Definition 6.4.12 this yields:9r 2 P � �Hr \ V ! = ;; Br � V ! ; r is not overruled w.r.t.V ! :SinceV ! is total, we haveHr � not V ! andr is indefeasible w.r.t.V ! . Thisimplies withHr � T P (V ! ). This results in a contradiction sinceT P (V ! ) � V ! andHr � not V ! . Thus,C P (V ! ) = ;.

Page 242: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

228 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Now it only remains to be shown thatV ! is total wheneverC P (V ! ) = ;. SupposethatV ! is not total. This implies that there exists aa 2 BP such thata; not a =2V ! . SinceZP (V ! ) � V ! , we have thata =2 GASP (V ! ). With Definition 6.4.7this implies, among other things, that:9r 2 P � � a 2 Hr; Br � V ! ; (Hr \ fag) \ V ! = ;; r not overruled w.r.t.V ! :Sincea =2 V ! , this impliesHr \ V ! = ;. According to Definition 6.4.12, thisimplies thatfag[not (Hrnfag) is a c-choice set, which contradictsC P (V ! ) = ;.Thus,V ! has to be total. 2C-computations can indeed be used for the bottom-up computation of answer sets,as demonstrated by the next theorem.

Theorem 6.4.23Let fV ngn2N be a c-computation for a well-c-founded OCLPP . Then,V ! is an answer set forP .

Proof: Before we continue with the actual proof, we first prove a small lemma.

Lemma 6.4.4 Let I be a total assumption-free interpretation for an OCLPP . IfC P (I) = ; thenI is a c-model.

Proof: Let CP (I) = ;. By Definition 6.4.12, this implies:8r 2 P � � jHr \ Ij 6= 0 orBr * I or r is overruled w.r.t.I :In order to prove thatI is a c-model, we need to demonstrate thatjHr \ Ij = 1whenB � I andr is not c-defeated w.r.t.I. We already know that in this casejHr \ Ij � 1. SinceI is total, we know thatr is c-indefeasible w.r.t.I (e.gCorollary 6.4.1). Suppose now thatHr \ I = S with jSj > 1. This implies,because of the first condition of Definition 6.4.7, thatS is an assumption set w.r.t.I. SinceS � I, we have a contradiction withI being assumption-free. Thus,jHr \ Ij = 1. SoI is a c-model ofP . 2BecauseV ! is a fixpoint offV ngn2N , we have thatC P (V ! ) = ;. With Theo-rem 6.4.22, we now have thatV ! is total and assumption-free. Combining thiswith Lemma 6.4.4, we obtain thatV ! is a c-model ofP . Theorem 6.4.12 thenimplies thatV ! is an answer set ofP . 2Every answer set of an ordered choice logic program corresponds to the limit ofsome c-computation.

Page 243: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.4. SKEPTICAL VS. CREDULOUS 229

Theorem 6.4.24Let M be an answer set for an OCLPP . Then,M = V ! forsome c-computationfVngn2N ofP .

Proof: We will construct a c-computationfVngn2N whose elements are containedin M . Because an answer set ofP exists, we know, by Theorem 6.3.14, thatW!Pexists andW!P � M . Let fV ngn2N be the sequence of sets of literals such thatV 0 =W!P and, forn � 0, V n+1 it is as follows:

1. IfWP (V n ) n V n+ 6= ;, thenV n+1 =WP (V n ) [ V n ; otherwise

2. If V n [ not V n = M thenV n+1 = M ; otherwise

3. If CP (V n ) 6= ;, thenV n+1 = V n [X, whereX 2 CP (V n ) andX �M4. elseV n+1 = V n .

We will prove by induction thatV n �M for eachn 2 N .

(Base of induction)V 0 =W!P �M is guaranteed by Theorem 6.4.15.

(Induction step) Assume thatV n �M . BecauseM is an answer set andV n �M ,we have, with Theorem 6.4.13 and becauseZP is monotonic, that(ZP (V n ) [V n ) � (ZP (M) [ V n ) � M . Thus, if V n+1 is constructed using (1), we haveV n+1 � M . WhenV n+1 is obtained from (2), we trivially have thatV n+1 � MIn caseV n+1 is constructed with (3), we must have thatV ;+n � M+. Then,Theorem 6.3.22 ensures the existence of a c-choice setX 2 C P (V n ) such thatX � M . So, V n+1 = V n [ X � M . If V n+1 = V n then, by the inductionhypothesis,V n+1 � M . BecauseM is an answer set, it is consistent. Thus,V n isconsistent for eachn 2 N . This makesfV ngn2N a c-computation forP such thatV ! �M . By Theorem 6.3.23,V ! is total. This implies thatV ! = M . 2The above two theorems assure us that we can use c-computation to obtain everyanswer set of an ordered choice logic program. So a bottom-upalgorithm willtry to construct every possible c-computation. Since it is not possible to predictwhich c-choice sets are needed for a certain c-computation and which would onlylead to a contradiction, it is important that every c-choiceset is tried.

Example6.4.17 Reconsider the Asian OCLP of Example 6.4.7. This program hasfive answer sets of which three are minimal. The total interpretationM = ftibet ; not hina; thailandg

Page 244: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

230 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

is one of them. The sequencef;; ftibet ; not hinag; fnot thailand ; not hina;tibetggg is a computation which constructs the answer setM . We started withZ!P after which we added a c-choice set. Finally, we negatively added its posi-tive complement. In case we had preferred to add a new c-choice set instead ofthe negative positive complement, we might have ended up with the non-minimalanswer set: M = ftibet ; thailand ; not hinag :Figure 6.36 on page 263 shows the algorithm for the computation of all answersets of a finite ordered choice logic program which may contain constraints, basedon the results presented in this section.First, the least fixpointZ!P is computed by therepeat-until statement in themain program. This computation uses, according to Theorem 6.4.19, the fixpointD!P;I(BP ) to obtain the greatest assumption set. If, during this fixpoint compu-tation, inconsistencies appear, we know (Theorem 6.4.15) that the program doesnot have any answer sets, so we end the program. If everythingproceeds normallyandZ!P is obtained, we check its totality to verify whetherZ!P is the unique sta-ble model ofP (Corollary 6.4.3). If so,Z!P is given as output and the programterminates. Otherwise, the procedureCompute-Answeris invoked to generate allc-computations ofP . The procedure uses recursion to simulate the backtrackingtechnique on which the computation is based (e.g. you try every c-choice set untilyou find the right one to continue).

Theorem 6.4.25Given a finite OCLPP , the algorithm of Figure 6.36 on page 263terminates in a finite amount of time and returns the answer sets ofP .

This concludes our section about the answer set semantics. We introduced thissemantics as an alternative for the more skeptical stable model semantics. Wedemonstrated that this answer set semantics is not necessarily based on minimalmodels. For a certain class of ordered choice logic programswe have that thestable model semantics is subsumed by the answer set semantics. But in general,the two semantics are unrelated. Besides its declarative definition we provideda procedural semantics for answer sets based on assumption sets. We ended thissection with an efficient algorithm for the computation of answer sets. In the follo-wing section we investigate the relationship between logicprograms and orderedchoice logic programs with respect to their stable model semantics.

Page 245: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.5. LOGIC PROGRAMMING IN OCLP 231

6.5 Logic Programming in OCLP

In Section 5.3 on page 95, it was shown that choice logic programs can representsemi-negative logic programs. However, the mapping between the stable modelsof both formalisms is not a total one. An extra condition for the stable model of achoice logic program, namely rationality, is required. A full mapping exists onlyfor the class of positive-acyclic logic programs. Generalizing to OCLP, we can ob-tain a full one-to-one correspondence, as far as their stable models are concerned,between semi-negative logic programs and their corresponding OCLPs. We cantake it even a step further, namely to extended semi-negative logic programs andtheir answer set semantics.

Definition 6.5.1 Let P be a semi-negative logic program without classical ne-gation. The corresponding OCLPPL is defined byhfC;R;Ng; C � R � Niwith N = fnota j a 2 BP g ;R = fa B; notC 2 R j r : a B; not C 2 Pg [fnota B; notC 2 R j r : not a B; not Cg [f B; notC 2 R j r : B; not Cg ;C = fa� nota a j a 2 BPg ;where, fora 2 BP , nota is a fresh atom representingnot a9.

Intuitively, the choice rules inC force a choice betweena andnot a while therules inN encode “negation by default”.

Example6.5.1 Going on vacation to Senegal requires some preparations. Itisvery important to ask a doctor whether or not malaria profylaxis is necessary.When you decide to stay in Dakar, then there is no need. On the other hand, whenyou plan to go inland, you better should take profylaxis tablets. Since malariaviruses are getting resistant to the traditional drugs, youneed more powerful an-tibiotics. For the moment, the best drug is Lariam. It is the same drug doctors useto cure malaria. The following extended logic programP puts all this information

9For a setX 2 BP , notX = fnota j a 2 Xg.

Page 246: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

232 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P3P2P1 notlariam notinland notdakar notmalaria lariam malarianotmalaria dakarmalaria inlandinland notdakardakar notinlandlariam � notlariam lariaminland � notinland inlanddakar � notdakar dakarmalaria � notmalaria malariaFigure 6.25: The Senegal OCLP of Example 6.5.1

together. lariam malarianot malaria dakarmalaria lariamdakar not dakarinland not dakarThe corresponding OCLPPL is depicted in Figure 6.25.The programP has two answer sets:A1 = fdakarg andA2 = finland ;malaria; lariamg :They correspond to the two stable modelsM1 andM2 with:M+1 = fdakar ; notinland ; notlariam ; notmalariag andM+2 = finland ;malaria; lariam; notdakarg :The following theorem demonstrates that the correspondence between answer setsof the logic program in the above example and the stable models of its correspon-ding ordered choice logic program is not a coincidence.

Theorem 6.5.1 LetP be an extended logic program without classical negation10.Then,M � BP is an answer set ofP iff S is a stable model forPL with S+ =M+ [ not(BP nM).

10This is not a real restriction: Theorem 3.5.2 on page 48 demonstrates that classical negationcan be replaced very easily using a simple preprocessor.

Page 247: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.5. LOGIC PROGRAMMING IN OCLP 233

To make the proof more readable, we introduce, for an interpretationI of PL, IpandIn as respectivelyfa 2 BP j a 2 Ig andfa 2 BP j nota 2 Ig. Thus,I+ = Ip [ notIn .

Proof: Let us start with the “only-if”-part. So letM be an answer set ofP . Weneed to show thatS is a stable model forPL. With Definition 6.3.1, this impliesthatS has to be a minimal model ofP SL .� S is a model ofP SL . Let us consider the rules in the various components.

– r : a � nota a 2 P SL . Assume thata 2 S. This implies thata 2M . BecauseM is an interpretation,a =2 M�. With the constructionof S, we obtainnota =2 S. Thus,jHr \ Sj = 1, which makes the rulesatisfied. Ifa =2 S, we immediately have thatr is satisfied.

– r : l B; notC 2 P SL with l = a or l = nota. This implies thatr0 :l B; not C 2 P . BecauseM is deductively closed (Theorem 3.5.1on page 47) forP , we have forr0 that one of the following:� B * M . BecauseB � BP andM+ = S+ \ BP , we obtainB * S.� C\M 6= ;. SinceC � BP andM+ = Sp, this yieldsC\Sp 6= ;.

BecauseSp \ Sn = ;, we haveBr * S.� a 2M if l = a with a 2 BP . This impliesa 2 S.� a =2M if l = not a with a 2 BP . With the construction ofS, thisyieldsnota 2 S.

Thus, the ruler is satisfied byS.

– r : B; notC 2 R. This means that the constraint B; notC 2 P .BecauseM is an answer set forP , we have thatM is deductivelyclosed. This implies that eitherB * M or C \M 6= ;. In terms ofS, this yieldsB * S or notC * S. This immediately implies thatr isnot applicable, and thus satisfied.

– r : nota 2 P SL . Suppose thatnota =2 S. The construction ofS from M , impliesa =2 M�. BecauseM is total, we havea 2 M+and alsoa 2 S. With the rulea � nota a 2 C, we obtain thatSN(nota) = fag. BecauseM is an answer setP , we must have thatM is minimally closed forPM . This implies:9r0 2 P � a 2 Hr0; B+r0 �M+; B�r0 �M� :

Page 248: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

234 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

The construction ofPL andS supply us, in this case, with a ruler00 forwhicha = Hr00, Br00 � S holds. Thus, by Definition 6.2.4,r00 defeatsthe ruler, as (r00) = R � (r) = N , which is in contradiction withr 2 P SL .So we have to conclude thatnota has to be inS, which makesr satis-fied.

So we can conclude that every rule inP SL is satisfied w.r.t.S.� S is minimal. We will demonstrate that no total interpretationZ with Z+ �S+ can be considered to be a model forP SL . Suppose that there exists anota such thatnota 2 S while nota =2 Z. If nota 2 S, we must have thata =2 S. Otherwise, the rulea � nota a would not be satisfied, which isimpossible asS is a model ofP SL . This makes thatSN (nota) = ;. Thisimplies that the rulenota 2 N cannot be defeated w.r.t.S. Thus,nota 2 P SL . So,Z cannot be a model ofP SL , asnota =2 Z.So we must have thatSn = Zn. Thus,S+ n Z+ = D with D � BP .SinceD � S+, we have thatD � M . BecauseM is an answer set forP ,we know thatM is minimally closed underPM . This implies that, sinceD � M , there is an atoma 2 D such that a ruler 2 PM exists for which,amongst other things, thatBr � M andBr \ D = ; holds. This impliesBr � (M+ nD). This rule could only be inPM when for its correspondingrule r0 holdsB�r0 \M = ;. SinceSn = Zn, we obtain with respect toZ,B = B+r0 � Z andnotC = notB�r0 � Z. Due to the construction ofPL, there

is an indefeasible ruler00 : a B; notC 2 PL. Sincer0 is not defeated itis also a rule inP SL . This makes thatZ is not a model, asa =2 Z whileBr00 � Z.So we may conclude that,S is a minimal model forP SL .S being a minimal model for the choice logic programP SL yields, with Theo-

rem 5.2.1 on page 93, thatS is a stable model ofP SL . Definition 5.2.6 tells us thatS is indeed a stable model ofPL.

For the “if”-part, letS be a stable model forPL. Let M = Sp. According toDefinitions 3.5.6 and 3.5.4 on respectively page 46 and 46, weneed to demonstratethat M is minimally closed forMM . Before doing this, we demonstrate thatSp [ Sn = BP . BecauseS is a stable model forPL, it is also a model forPL(e.g. Theorem 6.3.2). This implies that all the rules in the componentC need tobe satisfied. In casea 2 S, we have that the rulea�nota is applicable and not

Page 249: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.5. LOGIC PROGRAMMING IN OCLP 235

defeated w.r.t.S. SinceS is a model we must have thatnota =2 S. In casea =2 Sp,we have thatSN (nota) = ;. This implies that the rulenota cannot be defeatedw.r.t. S. Thus, sinceS is a model forPL, nota 2 S. This yieldsSp \ Sn = ; andSp [ Sn = BP .� M is closed forPM . We need to prove that for every ruler 2 PM holds

thatHr 2 M wheneverBr � M . There are two types of rules: constraintsand rules with a single head atom. Let us first start with the constraints.According to the definition of the reduct, we have that a ruler0 exists fromwhichr is originated. Forr0 holds thatA = H�r0 �M andC = B�r0 \M =;. This yieldsA \ Sn = ; andC � Sn. The construction ofPl implies theexistence of a rulenotA Br; notC . BecauseS is a stable model ofPLand, by Theorem 6.3.2 a model ofPL, we must have thatBr * S. SinceBr � BP , this implies thatBr * M , which makesr satisfied. Let us nowproceed with the rules without empty-head and letr be such a rule. AssumethatBr � M . Sincer 2 PM , we have a ruler0 : a Br; not C 2 Psuch thatBr � M andC \M = ;. With the creation ofM , this impliesBr � Sp while C � Sn. Thus,B [ notC � S. The construction ofPLturns the ruler0 into a ruler00 : a Br; notC 2 R with Br00 � S. Sucha rule can never be defeated and sinceS is a model forPL, we must havea 2 Sp. This yields,a 2 M . Thus,r is satisfied w.r.t.M . We showed thatevery rule inPM is satisfied, so we may conclude thatM is indeed closed.� M is minimally closed forPM . We will prove that a set of atomsZ for PMwith Z � M can never be closed underPM . BecauseS is a stable modelof PL, we have, with Theorem 6.3.10 thatS is unfounded-free. Accordingto Theorem 6.3.7, this implies that no non-empty subset ofS+ can be anunfounded set forPL w.r.t. S. SinceSp = M+, we have thatD = (M+ nZ+) � S+ with D 6= ;. This means thatD cannot be an unfounded setw.r.t. S. According to Definition 6.3.3, this implies, amongst otherthings,that:9a 2 D � 9r : A B; notC 2 P �L � a 2 Hr; Br � S;Br \D = ; :The last condition implies thatr must be a rule in the componentR. Theconstruction ofPL implies that a ruler0 : a B; not C 2 P exists suchthatB � (M+ nD) = Z+ andC \M = ;. This yieldsr00 : a B 2 PMsuch thata =2 Z andB � Z. Thus,Z cannot be a model forPM , whichmakesM minimal.

Page 250: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

236 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P3P2P1 notva ation va ation � notva ation va ation va ation

Figure 6.26: The vacation OCLP of Example 6.5.2

We have demonstrated thatM is indeed a minimal closed set underPM . There-fore, we can conclude thatM is an answer set ofP . 2The proof of this theorem relies on the choice rules to be of the forma�nota ato obtain the one-to-one mapping between answer sets and stable models. Thenext example demonstrates that this is indeed essential.

Example6.5.2 Consider the very simple logic programP :va ation va ationObviously, we obtain; as the only answer set of this program. When we apply

the transformation of Definition 6.5.1, we obtain a OCLPPL with a single stablemodelM with M+ = fnotva ationg. Suppose we would use choice rules withempty body as in the OCLP of Figure 6.26. Then the programPL would producetwo stable models:M andN with N+ = fva ationg. Certainly,N does notcorrespond to any answer set ofP .

For the theorem we used extended logic programs without classical negation.However, it is not so difficult to adapt Definition 6.5.1 to also take classical ne-gation into account. First of all, we treat:a as any other atom in our programby introducing the rule:a � not:a to C andnot:a to the componentN .To make sure thata and:a do not appear together in a model, we also add theconstraint a; not:a toR.

When we restrict to logic programs, we can also obtain the answer sets (stablemodels) of the logic program as the answer sets of the corresponding ordered

Page 251: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.6. OCLP AND GAME THEORY 237

choice logic programs. As soon as negation as failure appears in the head of rules,this is no longer true. The reason for this are the rules in thecomponentR whichare, in general, no longer c-indefeasible.

In this section we established a relationship between the answer sets of an ex-tended logic program and the stable models of the corresponding ordered choicelogic program. This implies that in all the application domains of extended logicprogramming we can use ordered choice logic programs instead. Because theseare more expressive, we can make the applications more powerful. In the nextsection we investigate game theory as an application domainof ordered choicelogic programs.

6.6 OCLP and Game Theory

In this section we will look into one of the application areasof ordered choicelogic programming, namely game theory. In Section 5.5 on page 142, we haveseen that strategic games can be elegantly modeled by choicelogic programs suchthat the Nash equilibria of a game correspond to the stable models of the program.Since ordered choice logic programs are an extension of choice logic programs,we can also model strategic games in this formalism. Note that in this case youneed, because of Theorem 6.3.1, to use the stable model semantics and not theanswer set semantics. For the rest of this section we will have a look at therelationship between the more advanced extensive games with perfect informa-tion and ordered choice logic programs. In the next subsection we introduce twotransformations of such a game to an OCLP such that either theNash or subgameperfect equilibria can be retrieved as the answer sets of thecorresponding OCLP.These equilibria are not player-deterministic, in the sense that a single player canrationally decide to leave the equilibrium state. To filter out this extra source ofnon-determinism, we define cautious Nash and subgame perfect equilibria as thestable models of the corresponding OCLPs.

6.6.1 Modeling Extensive Games with Perfect Information

In Section 4.3 on page 69 we introduced extensive games with perfect informationto model the sequential structure underlying the decision problems encountered byagents in a strategic situation. The model supplies us with aframework to study

Page 252: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

238 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMINGb����� HHHHH1Rajasthan Kashmirr r(0; 0)r����� HHHHH2Jaisalmer Jaipurr r(2; 1)r���� HHHH1Summer Winterr(1; 1) r(3; 3)Figure 6.27: Destination India

solutions that allow each player to reconsider her plan of action not only at thebeginning of the game but also at any point in time at which shehas to make adecision. In this subsection we search for ways to obtain these solutions by meansof an ordered choice logic program. For our mappings, we assume that an actioncan only appear once11. This is not really a restriction, since one can simply usedifferent names for these actions since they are not related. This will just have aneffect on syntax of the game and not on the semantics.

Example6.6.1 Two best friends want to spend their holiday traveling throughIndia. They agree that the first will choose the state: eitherRajasthan or Kashmir.The second will, in case Rajasthan is picked, decide which town to visit. There aretwo options: Jaisalmer, the golden city in the Tar desert, orJaipur, the pink city ofthe golden triangle. When Jaisalmer is the final destination, the first person willdecide when they go on vacation. The game modeling the two friends’ individualpreferences is depicted in Figure 6.27. This game has two Nash equilibria:ffrajasthan;winterg; fjaisalmergg andffrajasthan; summerg; fjaipurgg :The following transformation will be used to retrieve the Nash equilibria from thegame as the answer sets of the corresponding OCLP.

Definition 6.6.1 Let hN;H; P; (<i)i2Ni be a finite extensive game with perfectinformation. The corresponding OCLPPn can be constructed in the followingway:� C = fCtg [ fCu j 9i 2 N; h 2 Z � u = Ui(h)g ;� Ct � Cu for all Cu 2 C ;

11More mathematically:h1; h2 2 H : A(h1) \ A(h2) = ;.

Page 253: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.6. OCLP AND GAME THEORY 239� 8Cu; Cw 2 C � Cu � Cw iff u > w ;� 8h 2 (H n Z) � (A(h) ) 2 Ct ;� 8h = h1ah2 2 Z � a B 2 Cu withB = fb 2 [h℄12 j h = h3bh4; P (h3) 6=P (h1)g andu = UP (h1)(h) .

The set of components consists of a component containing allthe decisions thatneed to be considered and a component for each payoff. The order amongst thecomponents follows the expected payoff (higher payoffs correspond to more spe-cific components) with the decision component at the bottom of the hierarchy (themost specific component). Since Nash equilibria do not take into account the se-quential structure of the game, players have to decide upon their strategy beforestarting the game, leaving them, for each decision, to reason about both past andfuture. This is reflected in the rules: each rule in a payoff component is made outof a terminal history (path from top to bottom in the tree) where the head repre-sents the action taken when considering the past and future created by the otherplayers according to this history. The component of the rulecorresponds to thepayoff the deciding player would receive in case the historywas actually followed.

Example6.6.2 When we apply Definition 6.6.1 to the extensive game with perfectinformation of Example 6.6.1, we obtain the OCLP in Figure 6.28. This programhas two answer sets:M = frajasthan; jaisalmer ;winter ; not kashmir ; not jaipur ; not summerg ;N = frajasthan; jaipur ; summer ; not kashmir ; not jaisalmer ; not winterg ;which happen to coincide with the Nash equilibria of the game.

The next theorem demonstrates that the Nash equilibria of anextensive game withperfect information can indeed be retrieved as the answer sets of the correspondingordered choice logic program.

Theorem 6.6.1 LetG = hN;H; P; (<i)i2Ni be a finite extensive game with per-fect information and letPn be its corresponding OCLP. Then,s� is a Nash equili-brium13 for G iff s� is a answer set forPn.

12We use[h℄ to denote the set of actions appearing in a sequenceh.13Since no action can appear twice, we can write a strategy profile as a set of actions.

Page 254: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

240 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMINGkashmir rajasthan jaisalmersummer jaisalmerjaisalmer rajasthan; summerjaipur rajasthanrajasthan jaipurrajasthan jaisalmerwinter jaisalmerjaisalmer rajasthan;winterrajasthan � kashmir jaisalmer � jaipur summer � winter

C0C1C2C3CtFigure 6.28: The India OCLPPn of Example 6.6.2

Proof: Before we start the actual proof, we first demonstrate that every c-modelfor Pn is also an answer set for it and that a c-model forPn is a strategy profile forG.

Lemma 6.6.1 LetG = hN;H; P; (<i)i2N i be a finite extensive game with perfectinformation and letGn be its corresponding OCLP according to Definition 6.6.1.Then,M is an answer set forGn iff M is a c-model forGn.

Proof: The “only-if”-part follows immediately from Theorem 6.4.2.For the “if”-part, letM be a c-model forGn. We need to demonstrate thatM isa minimal model forGMn . We first demonstrate thatM is a model forGMn . Weneed to show that every rule and every constraint inGMn is satisfied byM (i.e.Definition 5.2.4 on page 88). The choice logic programGMn is obtained fromG�n(i.e. Definition 6.4.3) by deleting all c-defeated rules w.r.t. M . SinceM is amodel ofGMn , we know that for the remaining rules must hold that eitherB *Mor jHr \M j = 1. According to Definition 5.2.3 on page 87, this implies that therule is satisfied. So,M is deductively closed and, thus, a model ofGMn . So itremains to be shown thatM is also minimal. The construction ofGn assures, byplacing the choice rules in the most specific component and byforcing that every

Page 255: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.6. OCLP AND GAME THEORY 241

atom appears exactly once in such a choice rule, that these rules can never be c-defeated w.r.t.M . From Definition 6.4.3, we know that all these choice rules arealso inGMn . Thus, for everya 2M , we have a rulea�A 2 GMn . SinceM isa model forGMn , we know thatA\M = ;. Removinga fromM , would result inan unsatisfied rule. This makes that every total interpretationN with N+ � M+cannot be a model forGMn . So,M is a minimal model forGMn , which makesMan answer set forGn. 2Lemma 6.6.2 LetG = hN;H; P; (<i)i2Ni be a finite extensive game with perfectinformation, letGn be the corresponding OCLP and letM be a c-model forGn.Then,M is a strategy profile forG.

Proof: This follows immediately from the construction ofGn. The heads of thechoice rules in the componentCt correspond exactly with all the setsA(h), withh a non-terminal history. BecauseCt is the most specific component and sinceevery atom appears exactly once in the head of such a choice rule, we know that achoice ruler cannot be c-defeated inCt w.r.t.M . SinceM is a c-model, we knowthatjHr \M j = 1. So, for every non-terminal historyh, we haveA(h)\M = 1.This makes thatM is a strategy profile forG. 2Now that we have proven the above lemmas, we can proceed with demonstratingthe equivalence between answer sets and Nash equilibria.

For the “if”-part, letM be a Nash equilibrium forG. With Lemma 6.6.1, we needto prove thatM is a c-model forGn in order to conclude thatM is an answerset ofGn. We have two types of rules in our program: choice rules (e.g.ruleswith more than one head atom) and rules with a single head atom. Let us proceedwith the former. The head of such a choice rule corresponds toA(h) for somenon-terminal historyh. Since Nash equilibria are also strategy profiles, we havethat jA(h) \M j = 1. This implies that all our choice rules are applied and thussatisfied w.r.t.M .

Now consider the rules with a single head atom. Letr be such rule withBr �MandHr = a =2 M . SinceM is a Nash equilibrium, we must have that the player,playeri, who has to make a decision took an actionb which would lead him toan outcome that gives a payoff at least as good as the outcome which involves theactiona. The construction ofPn guarantees thata is a head atom of a choice ruler0 with b 2 Hr0. This rule is trivially applicable, thusb 2 M (r)(a). BecauseM isa strategy profile, the other players will have actions in their strategy to deal withthe possibility that playeri might have chosenb instead ofa. These actions are all

Page 256: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

242 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

contained inM . Filling in actions for playeri, includingb, this yields a terminalhistoryh0. According to the creation ofPn, this results in a ruler00 : b [h00℄ withh00 those actions fromh0 which are not chosen by playeri. This ruler00 is appliedand sinceh0 results in a payoff at least as good as the one ofh, we can user00 toc-defeatr. Thus,r is satisfied w.r.t.M . So we can conclude thatM is a c-modelfor Pn and thus, with Lemma 6.6.1, an answer set ofPn .

For the “only-if”-part, letM be an answer set ofPn. From Lemma 6.6.2, we al-ready know thatM is a strategy profile forG. So it remains to be shown thatM isa Nash equilibrium. This means that a playeri cannot, given the other players’ ac-tions, leave the equilibrium to obtain a better payoff. Or that all terminal historiescontaining for the other players actions fromM and possibly different actions fori should not produce a better outcome for playeri. For all actionsa 2 M chosenby playeri, we have that all the alternativesb of a cannot be inM . This implies,for all rulesr with b 2 Hr, thatr is not applicable or c-defeated. Whenr is notapplicable, we know that none of the terminal histories containing b andBr canbe in the way for concluding thatM is a Nash equilibrium. Whenr is c-defeated,we know that there exists an applied ruler0 with a 2 Hr0 such that (r) 6� (r0).This means that there is a terminal history containinga which guarantees a payoffat least as good as the payoff you might get for usingb. This means that there isno rational reason to replacea with b. Since this is true for every action ofa, wemay conclude thatM is indeed a Nash equilibrium. 2The necessity for using the answer set semantics is demonstrated by the followingexample.

Example6.6.3 Reconsider the India game of Example 6.6.1 and its correspon-ding OCLP described in Figure 6.28. In case we would have usedthe stablemodel semantics instead of the answer set semantics we wouldnot have obtainedall Nash equilibria of the game. The Nash equilibriumN = frajasthan; jaipur ; summer ; not kashmir ; not jaisalmer ; not wintergis not a stable model of the program.

Although Nash equilibria for an extensive game with perfectinformation are in-tuitive, they have, in some situations, undesirable properties due to not exploitingthe sequential structure of the game. These undesirable properties are illustratedby the next example.

Page 257: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.6. OCLP AND GAME THEORY 243b����� HHHHHDavyQuebec Floridar r2; 0r����� HHHHHJohan

Winter Summerr2; 2 r0; 1Figure 6.29: The nature extensive game of Example 6.6.4

Example6.6.4 Two friends, Davy and Johan, want to go on holiday togetherDavy suggest to go either to Quebec or Florida. Especially during winter time,Quebec is supposed to be great. A day trip with a slay pulled byhuskeys throughthe woods must be magnificent. The Everglades in Florida are nice all year round.The extensive game in Figure 6.23 displays the personal preferences of our twofriends. This game has three Nash equilibria:ffQuebe g; fWintergg; ffF loridag; fWintergg; ffFloridag; fSummergg :The Nash equilibriumffFloridag; fSummergg is not really the solution we ex-pect for this problem. Davy decides to takeFlorida because he is afraid thatJohan might chooseSummer when he takesQuebe . However, Johan has noreason to commit to this choice. Thus, this Nash equilibriumis only based onparanoia and not on rationality.

In Section 4.3.3 on page 75 subgame perfect equilibria were introduced to over-come this problem. These equilibria require that the strategy is optimal after everyhistory.

Example6.6.5 The extensive game with perfect information of Example 6.6.4 hastwo subgame perfect equilibria:ffQuebe g; fWintergg; ffF loridag; fWintergg ;which correspond to the threat-less Nash equilibria.

Just like for Nash equilibria, there exists a transformation from a game to an OCLPsuch that the subgame perfect equilibria can be obtained as the answer sets of thecorresponding program.

Page 258: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

244 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Ct winter � summer quebe � orida C4C3C2C1 quebe summer orida quebe wintersummer winter Figure 6.30: The Quebec-Florida OCLPPs of Example 6.6.6

Definition 6.6.2 Let hN;H; P; (<i)i2Ni be a finite extensive game with perfectinformation. The corresponding OCLPPs can be constructed as follows:� C = fCtg [ fCu j 9i 2 N; h 2 Z � u = Ui(h)g ;� Ct � Cu for all Cu 2 C ;� 8Cu; Cw 2 C � Cu � Cw iff u > w ;� 8h 2 (H n Z) � (fa j ha 2 Hg ) 2 Ct ;� 8h = h1ah2 2 Z�(a B) 2 Cu withB = fb 2 [h2℄ j h = h3bh4; P (h3) 6=P (h1)g andu = UP (h1)(h) .

This transformation is quite similar to the one for obtaining the Nash equilibria.The only difference between the two is the creation of history-dependent rules:since subgame perfect equilibria take the sequential structure into account, playersno longer need to reason about what happened before they haveto make theirdecision. They can focus solely on the future.

Example6.6.6 When we apply Definition 6.6.2 to the extensive game with perfectinformation of Example 6.6.4, we obtain the OCLPPs displayed in Figure 6.30.

Page 259: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.6. OCLP AND GAME THEORY 245

This program has two answer sets:M1 = fquebe ;winter ; not orida; not summerg andM2 = f orida;winter ; not quebe ; not summerg ;which correspond exactly with the subgame perfect equilibria of the game (Exam-ple 6.6.5).

The following theorem demonstrates that it is not a coincidence that the subgameperfect equilibria of an extensive game with perfect information match with theanswer sets of the corresponding OCLPPs.Theorem 6.6.2 LetG = hN;H; P; (<i)i2Ni be a finite extensive game with per-fect information and letPs be its corresponding OCLP. Then,s� is a subgameperfect equilibrium ofG iff s� is an answer set forP .

Proof: Before we start the actual proof, we first demonstrate that every c-modelfor Ps is also an answer set for it and that a c-model forPs is a strategy profile forG.

Lemma 6.6.3 LetG = hN;H; P; (<i)i2Ni be a finite extensive game with perfectinformation andGs be its corresponding OCLP according to Definition 6.6.2.Then,M is an answer set forGs iff M is a c-model forGs.Proof: The “only-if”-part follows immediately from Theorem 6.4.2.For the “if”-part, letM be a c-model forGs. We need to demonstrate thatMis a minimal model forGMs . We first demonstrate thatM is a model forGMs .We need to show that every rule and every constraint inGMs is satisfied byM(i.e. Definition 5.2.4 on page 88). The choice logic programGMs is obtainedfrom G�s (i.e. Definition 6.4.3) by deleting all c-defeated rules w.r.t. M . SinceM is a c-model ofGs, we know that for the remaining rules eitherB * M orjHr \M j = 1 holds. According to Definition 5.2.3 on page 87, this impliesthatthe rule is satisfied inGM . So,M is deductively closed and, thus, a model ofGMs . So it remains to be shown thatM is also minimal. The construction ofGsassures, by placing the choice rules in the most specific component and by forcingthat every atom appears exactly once in such a choice rule, that these rules cannever be c-defeated w.r.t.M . With Definition 6.4.3, we have that all these choice

Page 260: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

246 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

rules are also inGMs . Thus, for everya 2 M , we have a rulea � A 2 GMs .SinceM is a model forGMs , we know thatA \M = ;. Removinga from M ,would result in an unsatisfied rule. This makes that every total interpretationNwith N+ � M+ cannot be a model forGMs . So,M is a minimal model forGMswhich makesM an answer set forGs. 2Lemma 6.6.4 LetG = hN;H; P; (<i)i2N i be a finite extensive game with perfectinformation ,Gs be the corresponding OCLP and letM be a c-model forGn.Then,M is a strategy profile forG.

Proof: This immediately follows from the construction ofGn. The heads of thechoice rules in the componentCt correspond exactly with all the setsA(h), withh a non-terminal history. BecauseCt is the most specific component and sinceevery atom appears exactly once in the head of such choice rule, we know that achoice ruler cannot be c-defeated inCt wrt M . SinceM is a c-model, we knowthatjHr \M j = 1. So, for every non-terminal historyh, we haveA(h)\M = 1.This makes thatM is a strategy profile forG. 2Now that we proved the above lemmas, we can proceed with demonstrating theequivalence between answer sets and subgame perfect equilibria.

To prove the “if”-part, letM be a subgame perfect equilibrium ofG. WithLemma 6.6.3, it suffices to demonstrate thatM is a c-model ofPs. BecauseM isa strategy profile, we know thatjA(h) \M j = 1 for every non-terminal historyh 2 H. Exactly thoseA(h) are responsible for the creation of the choice rulesin Ct. This immediately implies that these rules are applied and,thus, satisfied.Now it remains to be shown that rules with a single head atom are also satisfied.Let r be a rule such thatBr � M andHr =2 Br. Let a 2 Hr. The construction ofPs guarantees thata 2 A(h) for someh 2 H. M being a subgame perfect equi-librium states thata is not part of the outcome of the subgameGjh. This impliesthe existence of a terminal historyh0 of this subgame yielding a better or equalpayoff for the playerP (h) = i. The construction ofPs makes sure that a ruler00 : b B exists withB � M , containing all the actions ofh0 except the onesmade byi. Clearly,b 2 M andb 2 M (r)(a). Since the payoff fori is at least asgood as whenh is played, we have that (r0) 4 (r). This means thatr0 can beused as a c-defeater ofr, which makesr satisfied. So we may conclude thatM isindeed a c-model ofPs. With Lemma 6.6.3, we obtain thatM is also an answerset ofPs.

Page 261: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.6. OCLP AND GAME THEORY 247

For the “only-if”-part, letM be an answer set ofPs. Lemma 6.6.4 already tells usthatM is a strategy profile forG. When we look at the construction ofPs, we seesubgames are imitated. The smallest subgames are represented by facts, since theactions that ought to be chosen are directly connected to theleafs. Rules belongingto the same subgame can possibly c-defeat each other. Since answer sets are c-models, for facts belonging to the same subgame, the fact which is preferred themost is made true. In case there are several, a random choice is justified. Clearlythe chosen action corresponds to a Nash equilibrium of the subgame. The sameapplies for larger subgames. They are represented in the program in a similar way,only the number of body elements grows. Rules that become applicable containonly actions belonging to a Nash equilibrium of the lower subgames. For eachlarger subgame an action is chosen which yields the best or similar payoff to thedeciding player. Clearly, in this way we have obtained a Nashequilibrium for thecurrent subgame. When we reach the root of the original gameG in this way, weknow that the collection of actionsM indeed contains a Nash equilibrium of eachsubgame inG. This makes thatM indeed is a subgame perfect equilibrium forG.2Just like for Nash equilibria, it is important to use the answer set semantics insteadof the stable model semantics.

Example6.6.7 Reconsider the Quebec-Florida game of Example 6.6.4 and itscorresponding OCLP of Example 6.6.6. This program has no stable models at all.

In Section 4.3 of Chapter 4 on page 69 we discussed two generalizations of ex-tensive games with perfect information. One of these are extensive games with si-multaneous moves. This type of games can also be representedin ordered choicelogic programming. For Nash equilibria of such games we can use exactly thesame mapping as the one described in Definition 6.6.1 using the flattened14 ver-sion of a terminal history. To retrieve the subgame perfect equilibria, we onlyneed a small modification of Definition 6.6.2. Instead of putting the future actionsin the body of a rule, we also add those actions that are taken simultaneously.

We have shown that ordered choice logic programs can be used as a tool to repre-sent extensive games with perfect information such that thetraditional equilibriaof a game can be retrieved as the answer sets of the corresponding program. In

14A history for these games is a sequence of sets. The flattened version simply ignores the setsand uses the elements.

Page 262: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

248 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

the next subsection we will demonstrate that ordered choicelogic programs canalso be used to define a new kind of equilibria.

6.6.2 Cautious Equilibria

When rational players engage in a game they will always choose strategies thatbelong to a Nash equilibrium. A deterministic game would be agame for whichthe outcome was already known from the start. An example of such a game is thePrisoner’s Dilemma. Real determinism can only exist when there is a single Nashequilibrium. Demanding that every game should have only onelogical outcomewould be unrealistic. However, we feel that having multipleoutcomes should bea strategic decision of many players and not the decision of just a single player. Inother words, it should not be possible for a single player, given the other players’actions, to deviate rationally from the envisioned outcome. We call thisplayer-determinism.

Example6.6.8 Reconsider the Indian game discussed in Example 6.6.1. TheNash equilibriumffrajasthan; summerg; fjaipurggmakes the game not player-deterministic. Given the actions of the first player, e.g.frajasthan; summerg,the second player can still rationally decide between the strategiesfjaipurg andfjaisalmerg. Both strategies would yield her a payoff of 1 and are part of aNashequilibrium. So, the first player cannot be certain that she will receive the payoffthat corresponds to the Nash equilibrium.

To characterize such situations, we introduce the notion ofa cautious Nash equi-librium.

Definition 6.6.3 LetG = hN;H; P; (<i)i2Ni be a finite extensive game with per-fect information and letPn be its corresponding OCLP. A strategy profiles� is acautious Nash equilibriumiff s� is a stable model forPn.

Example6.6.9 The Indian game of Example 6.6.1 has one cautious Nash equili-brium s� = ffrajasthan;winterg; fjaisalmergg :Clearly,s� is a stable model of the corresponding programPn, displayed in Fig-ure 6.28.

Page 263: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.6. OCLP AND GAME THEORY 249

The next theorem shows that the name cautious Nash equilibrium was well cho-sen.

Theorem 6.6.3 Let hN;H; P; (<i)i2Ni be a finite extensive game with perfect in-formation. Then, every cautious Nash equilibrium is also a Nash equilibrium.

Proof: Let s� be a cautious Nash equilibrium. From Definition 6.6.3, we knowthats� is a stable model forPn. Theorem 6.4.4 tells us thats� is an answer set forPn. From Theorem 6.6.1, we can derive thats� is a Nash equilibrium. 2Cautious Nash equilibria have some interesting propertiesthat distinguish themfrom normal Nash equilibria. Two cautious Nash equilibria cannot have the samestrategies for all but one player unless the same outcome is reached.

Theorem 6.6.4 Let hN;H; P; (<i)i2Ni be a finite extensive game with perfect in-formation and lets� be a cautious Nash equilibrium. Then,r� can only be acautious Nash equilibrium with a different outcome if the strategies of at least twoplayers are different.

Proof: We proceed by contradiction. Suppose that only one player has a differentstrategy in the two equilibria. From Definition 6.6.3 we knowthat boths� andr�should be stable models ofPn. We need to focus on those rules that have anaction of the changing player in the head. Since the other players have the sameactions, we know that all rules that were applicable remain applicable. Since bothstrategy profiles have a different outcome, we know that their actions influence theoutcome. So there are indeed applicable rules with their actions in the head. Sinces� is a cautious Nash equilibrium, we know that the applicable rules containingan action which is not part ofs� must be less specific then the rules containingan action fors�. This implies thatr� leaves an applicable rule unapplied withoutbeing able to defeat it. This yields thatr� cannot be a model forPn and certainlynot a stable model. This yields a contradiction withr� being a stable model. 2Example6.6.10 Reconsider the extensive game with perfect information of Ex-ample 6.6.4. This game has two subgame perfect equilibria:M = ffquebe g; fwinterg andN = ff oridag; fwintergg :This means that Johan will always choose the strategyfwinterg. However, givenany of the two subgame perfect equilibria, Davy has always a rational explanationto leave the equilibrium, because both strategies will yield him the same payoff.

Page 264: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

250 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

The above example demonstrates the need for also introducing cautious subgameperfect equilibria. The presence of such equilibria provides player-deterministicoutcomes. When absent, we know that a single player, given the actions of theothers, can still make the outcome uncertain.

Just like for cautious Nash equilibria, we define the cautious subgame perfectequilibria as the stable models of the corresponding OCLPPS.

Definition 6.6.4 LetG = hN;H; P; (<i)i2Ni be a finite extensive game with per-fect information and letPs be its corresponding OCLP. A strategy profiles� is acautious subgame perfect equilibriumiff s� is a stable model forPs.Example6.6.11 The Quebec-Florida game of Example 6.6.4 has no cautioussubgame perfect equilibria.

It can be shown that cautious subgame perfect equilibria areindeed subgame per-fect equilibria.

Theorem 6.6.5 Let hN;H; P; (<i)i2Ni be a finite extensive game with perfect in-formation. Then, every cautious subgame perfect equilibrium is also a subgameperfect equilibrium.

Proof: Let s� be a cautious subgame perfect equilibrium. From Definition 6.6.4,we know thats� is a stable model forPs. Theorem 6.4.4 tells us thats� is an an-swer set forPs. From Theorem 6.6.2 we can derive thats� is a Nash equilibrium.2Theorem 6.6.6 Let hN;H; P; (<i)i2Ni be a finite extensive game with perfect in-formation and lets� be a cautious subgame perfect equilibrium. Then,r� canonly be a cautious subgame perfect equilibrium with a different outcome if thestrategies of at least two players are different.

Proof: We can use the same technique as we did for proving Theorem 6.6.4. 2In this subsection we introduced two player-deterministicequilibria for extensivegames with perfect information, called cautious Nash equilibrium and cautioussubgame perfect equilibrium. They were introduced to prevent a single player di-verting from an equilibrium by taking another strategy which belongs to an other

Page 265: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.7. RELATIONSHIP WITH OTHER APPROACHES 251

equilibrium. To make this happen, they were defined as the stable models of thecorresponding ordered choice logic programs. This concludes our section con-cerning the link with game theory. In the next section we lookinto the relationshipwith other approaches.

6.7 Relationship with Other Approaches

Previously, we already looked into the relationship between extended logic pro-grams and ordered choice logic programs. In addition, we demonstrated that ex-tensive games with perfect information can be elegantly represented by orderedchoice logic programs such that the equilibria of a game correspond to the answersets of the program. In this section we investigate the relationship with some otherformalisms.

6.7.1 Ordered Logic Programming

In the introduction we mentioned that ordered choice logic programs borrowedsome ideas from ordered logic programming [GLV91, LV00]. Defining a skep-tical and credulous approach is one of them. Despite the manysimilarities thereare also some important differences. First of all, [GLV91] allows a partial orderamongst components. We, on the other hand, restrict to a strict pointed partialorder. For the skeptical semantics of [GLV91], it is possible for a rule to have adefeater in the same or unrelated component. For the stable model semantics ofordered choice logic programs this is not possible. To obtain a mapping betweenthe skeptical semantics and the stable model semantics, we need to restrict theform of the ordered logic programs. For ordered choice logicprograms wherethese differences cannot occur, such a mapping does exists.

Definition 6.7.1 Let P = hC;�i be an ordered logic program. The correspon-ding ordered choice logic programPo = hC [ fDg;�0i with:� 8C1; C2 2 C � C1 � C2 ) C1 �0 C2 ; and� 8C1 2 C �D �0 C1 ; and� 8a 2 BP � a� : a a 2 D anda� : a : a 2 D .

Page 266: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

252 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

When we rule out the possibility of two rules from an equal or unrelated com-ponent defeating each other, we can obtain the assumption-free models of theordered logic program as the stable models of correspondingordered choice logicprogram.

Theorem 6.7.1 LetP be an OLP such that8r1; r2 2 P � : Hr1 = : Hr2 � (r1) � (r2) or (r2) � (r1) and such that� is a strictly pointed partial order in thecomponentC. Let Po be the corresponding OCLP ofP , according to Defini-tion 6.7.1. Then,M is an assumption-free model inC iff N is a stable model ofPo withN+ = M .

Proof: Before we start our proof, let us discuss the relationship between defeatedin P w.r.t. M and defeated inP0 w.r.t. N considering the special structure ofP .

Lemma 6.7.1 LetM be an interpretation forP and letM be an interpretation ofPo such thatN+ = M . Then, a defeated rule inPo w.r.t. N is defeated inP w.r.t.M . WhenM is a model ofP , we have that every defeated rule inP w.r.t. M iseither applied inPo w.r.t. N or defeated inPo w.r.t. N .

Proof: Clearly, when a rule is defeated inPo w.r.t. N , we know that this rule ispresent and defeated inP w.r.t. M , since the choice rules cannot be defeated norused as a defeater. Whenr is defeated inP w.r.t. N , the situation is somewhatdifferent. Only whenN is a model ofP , we can say something useful. Letr0 bethe defeater ofr. SinceN is a model, we know thatr is either applied or defeatedw.r.t. N . In the former case, we have thatHr and: Hr are alternatives inPo,which makesr defeated inPo w.r.t. N . In the latter case, we will look for thedefeater of the defeater. We continue this process till we find an applied defeater.Such a defeaterr00must always exist since we keep on moving towards the specificcomponentC. This means that at a certain point we must have a defeater whichcan no longer be defeated. SinceM is a model, this defeater has to be applied.For r00 must hold thatHr00 = Hr orHr00 = : Hr. The former case yields thatr isapplied. The latter tells us that with the ruleHr�:Hr :Hr 2 D thatHr and: Hr are indeed alternatives and thatr is defeated byr00 in Po w.r.t. N . 2Let us now proceed with the “only-if” part. LetM be an assumption-free modelof P in C, according to the definitions of [Lae90]. We will demonstrate thatNis a stable model ofPo. SinceM is a model ofP , we know thatM is consistent.This means thatM \ : N = ;. BecauseN+ = M , this yields that the rules

Page 267: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.7. RELATIONSHIP WITH OTHER APPROACHES 253

P2 mammal platypuseggs platypusplatypus :eggs mammalP1Figure 6.31: The platypus OLP of Example 6.7.1

in the componentD of Po are either applied or not applicable. BecauseM is amodel ofP , we know that8a =2 M and for every ruler with a 2 Hr holds thatr is not applicable or defeated inP w.r.t. M . With Lemma 6.7.1 this impliesthat r is defeated inPo w.r.t. N . Appliedness is not an option sincea 2 N�.With Definition 6.3.3, this implies thatN� � GUSPo(N). The modelN of Pis also assumption-free. This implies that for alla 2 M holds that there existsan applicable ruler which is not defeated inP w.r.t. M . This implies that thereexists a ruler 2 P �o which is applied and not defeated w.r.t.N . BecauseN istotal, we have thatr is indefeasible w.r.t.N . With Definition 6.3.4, this makes thata 2 TPo(N). So,N+ 2 TP (N). The construction ofPo and the consistency ofMallows us to say thatTPo(N) \ GUSP (N) = ;. This makes thatN = WP (N).Thanks to Theorem 6.3.12, we can conclude thatN is a stable model ofPo.To prove the “if”-part, letN be a stable model ofPo. Theorem 6.3.2 tells us thatN is a model ofPo. This implies that every ruler 2 C� is not applicable, appliedor defeated inPo w.r.t. N . Clearly,r is also satisfied inP w.r.t. M . ThusM isa model ofP . N being a stable model implies, with Theorem 6.3.10, thatN isunfounded-free inPo. This yields8X �M �X =2 UPo(N). This means, amongstother things, that there existsr 2 P � such thatHr \ X 6= ;, Br \ X = ;, rapplicable andr not defeated inPo w.r.t. N . The combination ofHr \ X 6= ;,Br \ X = ; andr being applicable rules out the possibility ofr 2 D. Thus,r 2 C�, which makesM an assumption-free model ofP in C. 2Example6.7.1 Australia is a strange land in more than one way. Take the platy-pus for example, the only mammal that produces eggs to reproduce. The orderedlogic programsP modeling this situation is depicted in Figure 6.31. Its correspon-ding OCLPPo can be found in Figure 6.32. The programP has one assumption-free model: M = f: eggs;mammal ; platypusg ;

Page 268: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

254 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P2 mammal platypuseggs platypusplatypus :eggs mammalP1eggs � :eggs eggsmammal � :mammal mammaleggs � :eggs :eggsmammal � :mammal :mammalplatypus � :platypus :platipusplatypus � :platypus platypusD

Figure 6.32: The platipus OCLP of Example 6.7.1

which corresponds to the stable model ofP0:N = f: eggs;mammal ; platypus; not eggs; not : mammal ; not : platypusg :To retrieve the credulous semantics of ordered logic programs, we can use exactlythe same mapping. Only this time we look for the answer sets ofthe correspondingordered choice logic program. Since both definitions of c-defeating allow rules tobe in an equal or unrelated component, we do not need a restriction on orderedlogic program anymore, except for the strict pointed partial order.

Theorem 6.7.2 Let P = hC;�i be an OLP with� a strictly pointed partial or-der in the componentC. LetPo be the corresponding OCLP ofP , according toDefinition 6.7.1. Then,M is a c-total c-assumption-free c-partial model inC iffN is an answer set ofPo withN+ = M .

Proof: Before we can proceed with the proof, we need to establish therelation-ship between c-defeating and c-defeasible inP w.r.t.M and c-defeated inPo w.r.t.N .

Lemma 6.7.2 LetN be an interpretation ofP inC and letM be an interpretationof Po such thatN+ = M . Then, a ruler 2 C� is c-defeated w.r.t.M in P iff r isc-defeated w.r.t.N in Po.Proof: Let r 2 C� be a c-defeated rule w.r.t.M in P . According to the definitionof [Lae90] this implies that:9r0 2 C� � (r0) 6� (r) ^ Hr = : Hr0 ^ r0 is applied w.r.t.M :

Page 269: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.7. RELATIONSHIP WITH OTHER APPROACHES 255

The ruleHr � : Hr : Hr 2 Po is therefore applicable w.r.t.M . This makesthat M (r)(Hr) = : Hr = Hr0. BecauseN+ = M andHr0 [ Br0 � M , wehave thatr0 is applied inPo w.r.t. N . With Definition 6.4.1, this yields thatr isc-defeated byr0 in Po w.r.t.N .

Whenr is c-defeated inPo w.r.t. N , we know with Definition 6.4.1, that9r0 2 P � � (r0) 6� (r) ^ Hr0 2 N (r)(Hr) ^ r0 is applied w.r.t.N :The construction ofPo guarantees us thatr0 2 C�, since the choice rules cannotbe c-defeated w.r.t. any interpretation. Furthermore, thesame construction ofPotells us thatHr0 = : Hr. Because the rules inP � are free of negation as failure,we have thatr0 is also applied w.r.t.M . This yields thatr is c-defeated byr0 in Pw.r.t. M . 2Lemma 6.7.3 Let M be a c-total interpretation ofP in C. A rule which is c-defeated w.r.t.M is also c-defeasible.

Proof: Let r be a c-defeasible rule w.r.t.M . According to the definition thisyields: 9r0 2 ompP jC(r) � (Br0 [Hr0) \ U P jC(M) = ; :BecauseM is c-total, we haveM � U P jC(M). So,(Br0 [ Hr0) \M = ;. Thismakes thatBr0 [Hr0 �M . Thus,r0 is applied and, thus, a c-defeater ofr. 2Lemma 6.7.4 Let M be a c-total c-assumption-free interpretation ofP in C.Then, a ruler 2 C� is c-defeasible w.r.t.M iff r is c-defeated w.r.t.M .

Proof: The “only-if”-part follows immediately from Lemma 6.7.3. Now, letr bec-defeated w.r.t.M . This implies that the existence of a ruler0 2 ompP jC(r) suchthatBr0 [ Hr0 � M . BecauseM is c-assumption-free, we haveA P jC(M) = ;.Lemma 8.2 of [Lae90] tells us thatU P jC(M) \ M � A P jC(M). So, we haveU P jC(M) \ M = ;. Combining this withM being c-total, we obtainM =U P jC(M). This makes that(Br0 \ Hr0) \ U P jC(M) = ; which yields thatr isc-defeasible. 2Combining these lemmas, we obtain the following corollary.

Page 270: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

256 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Corollary 6.7.1 Let N be a c-total c-assumption-free interpretation ofP in Cand letM be an interpretation ofPo such thatN+ = M andr 2 C�. Then,r isc-defeasible inP w.r.t. M iff r is c-defeated inP w.r.t. M iff r is c-defeated inPow.r.t. N .

To proof the “only-if”-part, letM be a c-total c-assumption-free c-partial model.BecauseM is a c-partial model, we know that every ruler 2 C� is either notapplicable, applied or c-defeasible inP w.r.t. M . With Corollary 6.7.1, this im-plies thatr is also satisfied inPo w.r.t. N . The choice rules are automaticallysatisfied, thanks to the consistencyM . This makes thatN is a c-model forPo.In order to demonstrate thatN is an answer set ofPo, it suffices, with Theo-rem 6.4.12, to show thatN is assumption-free. BecauseN is a total interpretationand Theorem 6.4.10, it is sufficient to have that no non-emptysubset ofN can beconsidered an assumption set ofPo w.r.t. N . LetX � N+ = M . Clearly, condi-tion (1) cannot be used. The choice rules are always c-indefeasible, but they areeither not-applicable or applied. This makes them useless to say that an elementof a 2 N+ should be considered false. Condition (2) is also out of the question,since there are no constraints permitted in an ordered logicprogram. So onlycondition (3) remains. BecauseM is c-assumption-free, we must have forX:9r 2 C� �Hr 2 X; r applicable; r not c-defeasible; Br \X = ; :With Corollary 6.7.1, it is easy to see that also condition (3) for an assumptionset is not fulfilled. This means thatX cannot be an assumption set ofPo w.r.t.N , which yields thatN is assumption-free forPo. With N being a c-model andTheorem 6.4.12, we can conclude thatN is an answer set ofPo.In order to prove the “if”-part, letN be an answer set forPo. Now we need toshow thatN+ = M is a c-total c-assumption-free c-partial model inC. M isclearly an interpretation forP , because of the indefeasible choice rules inPo. Wewill start with the c-total part. For alla =2M , we know, with Theorem 6.4.13, thata =2 N+ = TPo(N). This implies, according to Definition 6.4.8, that:8r 2 P �o : a 2 Hr � r not c-indefeasible w.r.t.N _ Br * N _ (Hr n fag) 6= ; :BecauseN is total, we have, with Corollary 6.4.1, thatr is c-defeated w.r.t.N inPo. Corollary 6.7.1 yields thatr is also c-defeated in w.r.t.M in P whenr 2 C�.The conditionBr * N implies, becauseN+ = M , thatBr\M 6= ;. This enablesus to conclude thatM � U P jC(M), which is exactly what we needed to conclude

Page 271: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.7. RELATIONSHIP WITH OTHER APPROACHES 257

P2P1 female male :femalewit h :female Figure 6.33: The Witch ordered logic program of Example 6.7.2

thatM is c-total. Let us now proceed with proving thatM is c-assumption-freefor P . BecauseN is an answer set ofPo, we know thatN is assumption-free(Theorem 6.4.12). This implies that for allX � N+ = M thatX =2 APo(N).With Definition 6.4.7, this implies:9a 2 X �9r 2 P �o : a 2 Hr�Br � N;Br\X = ;; r not c-defeated w.r.t.N in Po :The combination of the first and last condition tells us thatr 2 C�. Lemma 6.7.2yields thatr is not c-defeated inP w.r.t. M . BecauseM is c-total, the contra-position of Lemma 6.7.3 implies thatr is not c-defeasible w.r.t.M in P . Thistogether with the possibility thatr is not applicable yields thatX cannot be an c-assumption set ofP w.r.t.M . This makesM c-assumption-free inP . Now it onlyremains to be shown thatM is a c-partial model. BecauseN is an answer set ofPo, we have thatN is also a c-model ofPo (Theorem 6.4.2). With Definition 6.4.2,this yields that for every ruler 2 C� holds thatr is either not applicable, appliedor c-defeated w.r.t.N in Po. The latter implies, with Corollary 6.7.1, that in caser is c-defeated w.r.t.N in Po, r is also c-defeated inP w.r.t. M . This makes thatM is a c-partial model inC. Thus, we may conclude thatM is indeed a c-totalc-assumption-free c-partial model ofP in C. 2To end this subsection about ordered logic programming, letus demonstrate theabove theorem by means of an example.

Example6.7.2 Stonehenge is probably one of England’s most famous monuments.Legends describe Stonehenge as a Druid temple. The Druids worship(ed) theMother goddess. Priestesses of this religion are often referred to as witches. How-ever, the term witches is also used for practitioners of Wica. In this sense, a witchcan refer to both males as females. This is shown by the ordered logic programPin Figure 6.33. Its corresponding OCLP is displayed in Figure 6.34. The programP has two c-total c-assumption-free c-partial models:M1 = fwit h; femaleg andM2 = fwit h;male;: femaleg ;

Page 272: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

258 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

P2P1 female :female D wit h male :femalewit h � :wit h :wit hmale � :male :malefemale � :female :femalewit h � :wit h wit hmale � :male malefemale � :female female

Figure 6.34: The Witch OCLP of Example 6.7.2

which correspond to the two answer sets ofPo:N1 = fwit h; female; not : wit h; notmale;: male; not : femaleg andN2 = fwit h;male;: female; not : wit h; not : male; not femaleg :This example also explains the extra restriction on orderedlogic programs whenthe skeptical semantics is concerned. The programP has one assumption-freemodel; whilePo does not have any stable models.

6.7.2 OCLP and Game Theory

In Section 6.6 we introduced a way to represent strategic games and extensivegames with perfect information in order to retrieve the equilibria of these gamesas the answer sets of the program. The same transformations were used to definea new type of equilibria, the cautious Nash and subgame perfect equilibria, asthe stable models of the program. This shows that ordered choice logic programscan be used to extend game theory. Besides defining new equilibria, OCLPs arecapable to represent more complex games. One of the reasons for this are the vari-ables that OCLPs may contain. Depending of the unification ofthese variables,different choices or decisions need to be made. Furthermore, there is the possi-bility to add external information which may influence the outcome of the game.Perhaps even more important is the ability for a player to take more than one ac-tion as demonstrated by the Travel OCLP of the introduction (Examples 6.1.1 and

Page 273: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.7. RELATIONSHIP WITH OTHER APPROACHES 259

6.2.1). If we just consider the first three components (P1, P2 andP3), we see therepresentation of a very simple strategic or extensive gamewith a single player(the person who wants to go on vacation). In this case the equilibrium would befspaing which corresponds to the situation with a smaller budget. When you winthe lottery, your budget will be considerably larger and youwill be able to affordtwo vacations instead of one. In game theory this is simply not possible. Everyplayer is forced to take a single action. Perhaps the most important advantage ofusing (ordered) logic programming for game theory is its ability not only to be atest lab for game theory but also a procedural tool to obtain the equilibria of game.

6.7.3 Preferences/Order

Over the years various logic (programming) formalisms havebeen introduced todeal with the notions of preference, order and updates.

Dynamic preference in extended logic programs was introduced in [Bre96] inorder to obtain a better suited well-founded semantics. Although preferences arecalled dynamic they are not dynamic in our sense. Instead of defining a preferencerelation on subsets of rules, preferences are incorporatedas rules in the program.Moreover, a stability criterion may come into play to overrule preference infor-mation. Another important difference with our approach arethe alternatives. Theones of [Bre96] are statically defined.

A totally different approach is proposed in [SI96]. Here thepreferences are de-fined amongst atoms. Given these preferences, one can combine them to obtainpreferences for sets of atoms. Defining models in the usual way, the preferencesare then used to filter out the less preferred models. That way, this system isnot convenient for decision making as the preferences cannot easily be made todepend on the situation.

[BLR98] proposes disjunctive ordered logic programs. It israther similar to or-dered logic programs [LV00]. Only this time disjunctive rules are permitted. In[BFL99], preference in extended disjunctive logic programming is considered. Asfar as overriding is concerned the technique corresponds rather well with our skep-tical defeating, but alternatives are fixed as an atom and its(classical) negation.

To reason about updates of generalized logic programs, extended logic programswithout classical negation, [AAP+98] introduces dynamic logic programs. A sta-ble model of such a dynamic logic program is a stable model of the generalized

Page 274: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

260 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

program obtained by removing the rejected rules. The definition of a rejected rulecorresponds to our definition of a defeated rule whena andnot a are consideredalternatives. It was shown by [AAP+98], that the stable model semantics and theanswer set semantics coincide for generalized logic programs. In Theorem 6.5.1we have demonstrated that extended logic programs without classical negationcan be represented as an ordered choice logic program such that the answer setsemantics of the extended logic program can be obtained as the stable model se-mantics of the OCLP. Because rejecting rules corresponds todefeating rules, itis not hard to see that Definition 6.5.1 with some minor changes can used to re-trieve the stable models of the dynamic logic program as the stable models of thecorresponding OCLP. The only thing we need to do is to replacethe componentR by thePis of the dynamic logic program

LfPi : i 2 Sg and to replace ev-ery occurrence ofnot a by nota. [AP00] added a system of preference to thesedynamic logic programs of [AAP+98]. This preference is used to select the mostpreferred stable models. The same mechanism is also used by [BE99] to obtainpreferred answer sets. Just like [SI96], preferences are only used to filter out un-wanted models. They are not used during model creation like it is the case in ourformalism.

Outside the context of logic programming, [Bre94] proposesto add priorities tothe object language of default logic. Extensions are then required to be compatiblewith this information. OCLP and [Bre94] support different intuitions on the notionof priority, as shown by the following example15:

Example6.7.3 P1 : northern lights P2 : :sweden P3 : sweden northern lightsP4 : sweden � :sweden with P4 � P3 � P2 � P1. The interpretationfnorthern lights; swedeng is the(stable) model of this program. [Bre94] returnsfnorthen lights;:swedeng asthe extension for the default theory. [Bre94] considersnorthern lights comingfrom a more general rule insufficient (the rule fromP1) to favor the rule fromP3 over the one fromP2. We , and also [PS96], prefer to say that there is nocounter evidence fornorthern light so we should exploit this knowledge as muchas possible.

15For the ease of notation we simply denote the program in our formalism.

Page 275: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.8. CONCLUSIONS 261

6.8 Conclusions

In this chapter we introduced a framework to represent decision making with cir-cumstance-dependent preferences and decisions. This formalism, called OrderedChoice Logic Programming, allows for decisions that comprise more than twoalternatives, which become only available when a choice between them is actu-ally forced. For this type of programs we introduce two semantics: the skepticalstable model semantics and the more credulous answer set semantics. The maindifference between these two interpretations is the way they deal with two forcedalternatives which are equally preferred or unrelated. Thestable model prefers toremain indecisive while the answer set will try to make a motivated choice. Forboth semantics we provided a fixpoint characterization and an efficient bottom-upalgorithm. We demonstrated that the stable model semanticsnaturally extends thestable model semantics for choice logic programs. For choice logic programs, wewere unable to establish a one-to-one mapping between the stable models of thelogic program and the stable models of its corresponding choice logic program.Using ordered choice logic programs instead, we do obtain a full correspondence.In addition, for extended logic programs we can obtain the answer sets as the sta-ble models of the corresponding ordered choice logic program. Our formalismcan be used in a wide range of domains. As to game theory, we have seen thatOCLPs are an elegant tool to represent and to reason about extensive games withperfect information. The Nash and subgame perfect equilibria of such games canbe easily recovered as the answer sets of the corresponding program. We arguedthat these game are not player-deterministic, i.e. a singleplayer can rationallyleave the equilibrium state. To avoid this extra source of non-determinism, we in-troduced cautious equilibria as the stable models of the corresponding programs.

In the next chapter we use the ideas behind OCLP to develop a formalism whichis capable of dealing with uncertainty. We will show that this formalism is alsouseful for the representation of games where players allowed to make probabilisticdecisions.

Page 276: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

262 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Input: An OCLPP .Output: The stable models ofP .

ProcedureCompute-Stable(In:SetOfLiterals); /*In always consistent */var X, I 0n, In+1 : SetOfLiterals;begin

if CP (In) = ; /* no choices available */then output ”In is a stable model ofP ”;else foreachX 2 CP (In) do /* branch over all choice sets */In+1 := In [X; /* Assume the truth of a choice set */

repeat /* add literals by means of theWP -operator */I 0n := In+1;In+1 :=WP (In+1) [ In+1; /* by means ofR!P;Vn(BP ) */until In+1 = I 0n or In+1 \ not In+1 6= ;;if In+1 \ not In+1 = ; /* In+1 is consistent */then Compute-Stable(In+1);end-if;

end-for;end-if;

end-procedure;

var I,J : SetOfLiterals;G : SetOfAtoms;begin /*Main */I := ;;

repeat /* Computation ofW!P if it exists */J := I;G := GUSP (J); /* by means ofR!P;J(BP ) */if G \ J 6= ; /* J not unfounded-free */then exitend-if;I := TP (J) [ not G; /* =WP (J) */

until I = J ;if I+ [ I� = BPthen output ”I is the unique stable model ofP ”;elseCompute-Stable(I)end-if;

end.

Figure 6.35: The Algorithm for the computation of stable models

Page 277: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

6.8. CONCLUSIONS 263

Input: An OCLPP .Output: The answer sets ofP .

ProcedureCompute-Answer(In:SetOfLiterals); /*In always consistent */var X, I 0n: SetOfLiterals;begin

repeat /* add literals by means of theZP -operator */I 0n := In;In := ZP (In) [ In;/* by means ofD!P;In(BP ) */

until In = I 0n or In \ not In 6= ;;if In \ not In = ; /* In is consistent */then Compute-Answer(In [ not In)

if C P (In) = ; /* no choices available */then output ”In is an answer set ofP ”;else foreachX 2 C P (In) do /* branch over all c-choice sets */

Compute-Answer(In [X);/* Assume the truth of a c-choice set */

end-for;end-if;

end-if;end-procedure;

var I,J : SetOfLiterals;G : SetOfAtoms;begin /*Main */I := ;;

repeat /* Computation ofZ!P if it exists */J := I;G := GASP (J); /* by means ofD!P;J(BP ) */if G \ J 6= ; /* J not assumption-free */then exitend-if;I := T P (J) [ not G; /* = ZP (J) */

until I = J ;if I+ [ I� = BPthen output ”I is the unique answer set ofP ”;elseCompute-Answer(I)end-if;

end.

Figure 6.36: The Algorithm for the computation of answer sets

Page 278: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

264 CHAPTER 6. ORDERED CHOICE LOGIC PROGRAMMING

Page 279: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Chapter 7

Dynamically Ordered ProbabilisticChoice Logic Programming

In this chapter we introduce a logic programming formalism for reasoning underuncertainty.

7.1 Introduction

Reasoning with priorities and reasoning under uncertaintyplay an important rolein human behavior and knowledge representation. Recent research has focused oneither priorities, [SI96, GLV91, DVV00a]1 to name a few, or uncertainty, [Ngo96,NS91, Poo92, Bac90] and many others.

In this chapter we present a framework for decision making under uncertaintywhere the priorities of the alternatives may depend on the different (probabilis-tic) situations. This way we obtain a semantics which reflects all possible situa-tions where the most rational (probabilistic) decisions are made, given the circum-stances. The basic idea for the framework, a logic programming language called“Dynamically Ordered Probabilistic Choice Logic Programming” or DOP-CLPfor short [DVV00a], extends up to a certain point the intuition behind both or-dered choice logic programs (Chapter 6 on page 157) and choice logic programs(Chapter 5 on page 83). The former models the ability of humans to reason withdefaults in a logic programming context, using a static ordering of the rules in the

1[GLV91] uses the word order instead of priority.

265

Page 280: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

266 CHAPTER 7. DOP-CLP

program. This works well, as long as probabilities stay out of the picture, but oncethey are present something extra is needed to express order and preference. Takefor instance the famous “Tweety example”: if you are sure that Tweety is indeeda penguin, you should derive that she is unable to fly. Now suppose that you onlybelieve for 30% that the bird you are holding is indeed a penguin. Given this, is itsensible to derive that she is a non-flying bird?By also taking into account the probabilities of the antecedents of the rules, in ad-dition to their static order, we can overcome this problem. This leads to adynamicorderingof rules, where the priority of a rule depends on the actual situation.

We aim for a decision making framework that allows decisionsto have possiblymore than two alternatives. To accomplish this, we turn to a variant of ChoiceLogic Programs (Chapter 5), in which the possible alternatives for the decisionsare described by choice rules. This approach has two nice side effects. First of all,there is not necessarily a partition of the Herbrand base: atoms can belong to morethan one decision or to no decision at all. In the former case,there is a probabilitydistribution over the various alternatives. In the latter case, an atom is either trueor false, as in classical logic programming. The second advantage of our approachis that we allow a “lazy” evaluation of the alternatives which become only activewhen they are present in the head of an applicable choice rule. Let us demonstratethis with an example.

Example7.1.1 A young geisha in Kyoto’s Gion district is dressing herself fortonight’s parties. She has two options: western attire or the traditional regalia ofthe Kyoto geisha. In case of the traditional attire, she has to be very careful whichher obi, the long colorful piece of fabric tied around the waist, that she will wearon her silk kimono. She knows that the procent of her audiencewould prefer ared and gold obi while the other are more in favor of a sky blue one with brocadeclouds.

Given these facts, our geisha knows that whenever she decides to wear traditionalclothing, she has to choose the sky blue obi to go with her kimono. This way shewill only disappoint ten percent of the spectators. Turningher back on the wishesof more than half of her clientele would be a very bad career move, unless one manfrom the spectators is her danna, the person who takes care ofher. But tonight thisis not the case, so the choice is totally up to her, since no preference concerningwestern or traditional attire are given. So, she can make a random probabilitydistribution over these two options. Only, when there is even the slightest chancethat she will wear the traditional regalia, she has to pick anobi.

Page 281: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.1. INTRODUCTION 267

With the given information, we have an infinite number of rational solutions tothe problem. Suppose that information is added to the program. Say for examplethat one of tonight’s parties will be attended by some foreign ministers that wouldlike to see a traditional tea ceremony. In this case, our geisha will have no otheroption than to prepare herself in the traditional way, with the necessary whitemake-up and kimono with long sleeves and an obi that practically reaches theground. Given the preferences of the audience, she will go for the sky blue obi.

DOP-CLPs are designed to allow the user to specify a static priority of each ruleand to declare, dynamically, all the alternatives for the decisions that have to bemade. Ordered choice logic programs, see Chapter 6, use defeating to select themost preferred alternative for each decision. For DOP-CLP,we use a similartechnique. As argued by the above example, it is no longer sufficient to select thebest alternative on a rule basis. One should take into account all the (probabilistic)situations that force a certain alternative. Doing this oneshould not forget theimportance, described by the static priority, of each situation. The combination ofthese two gives us the dynamic priority of an alternative. The alternative that hasthe highest dynamic priority should be chosen, the others are considered blocked.When several alternatives have the same dynamic priority, they are consideredto be competitors of each other. In this case, one can rationally distribute theprobability over these alternatives. Our model theory, which is a generalizationof classical logic-programming model theory, captures uncertainty at the levelof total Herbrand interpretations. A probabilistic model makes sure that everyrule is either not applicable, i.e. the body has a zero probability, or is applied,i.e. no two head atoms can be true at the same time and at least one has a non-zero probability. A last possibility allows a rule to be satisfied when all the headatoms have a competitor with a non-zero probability. The stable model semanticsmakes sure that no alternative is given more probability than it deserves, that theprobabilities of the alternatives belonging to the same decisions are independent ofeach other and add up to one. By doing this, the stable model semantics reflects allpossible situations in which the decision makers take the most rational, possiblyprobabilistic, decisions.

In Chapter 5, we have seen that choice logic programming is anelegant tool forrepresenting strategic games such that the stable models ofthe program coincidewith the Nash equilibria of the game. For a general Nash equilibria it is difficult tomake a prediction on the existence of a Nash equilibrium. When we allow playersto generate a probability distribution on their set of available actions, we always

Page 282: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

268 CHAPTER 7. DOP-CLP

obtain a rational solution to the game. Such a solution is called a mixed strategyNash equilibrium. By extending choice logic program to DOP-CLP, we obtainthese mixed strategy Nash equilibria of a strategic game as the stable models ofthe corresponding program.

This chapter is organized in the following way. In Section 7.2 we introduce ourformalism for decision-making under uncertainty, called dynamically ordered pro-babilistic choice logic programming (DOP-CLP). The stablemodel semantics forthis type of programs is a natural extension of the stable model semantics forchoice logic programs (i.e. Theorem 7.2.5). When positive logic programs areconcerned, we demonstrate that the stable model semantics for both formalismcoincide. In Section 7.3, we illustrate that DOP-CLPs are anelegant and simpletool for representing strategic games such that the mixed strategy Nash equilibriaof the game can be retrieved as the stable models of the programs (i.e. Theo-rem 7.3.1). We end this chapter with a section on the relationships with otherapproaches (i.e. Section 7.4) and a concluding section (i.e. Section 7.5).

7.2 Dynamically Ordered Probabilistic Choice LogicPrograms

In this section we introduce the basic notions concerning dynamically orderedprobabilistic choice logic programming.

The language used by dynamically ordered probabilistic choice logic programs isidentical to the one used by choice and semi-negative logic programming (Defini-tions 3.2.1 and 3.3.1).

A dynamically ordered probabilistic choice logic program is a collection of rulescontaining only positive information. Each rule is given a static priority repre-senting the preference of each of the conclusions with respect to their possiblealternatives when the conditions are certainly fulfilled.

Definition 7.2.1 A Dynamically Ordered Probabilistic Choice Logic Program,or DOP-CLP for short, is a countable2 set of rules of the form:A p B

2In this chapter we will assume that all programs are already grounded, i.e. free of variables.The possible presence of function symbols sustains the assumption of an infinite number of rules;a programmer can only write programs with a finite number of rules.

Page 283: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.2. DOP-CLP 269

whereA andB are (possibly empty) sets of atoms andp 2 R+ . For a ruler 2 P ,the setA is called thehead, denotedHr, while the setB is called thebodyofthe ruler, denotedBr. Thep 2 R+ denotes thepriority of r. We will denote thepriority of rule r as�(r). TheHerbrand baseof P , denotedBP , is the set of allatoms appearing inP .

A ruleH B can be read as:

”The occurrence of the events inB forces aprobabilistic decision between the elementsh 2 H and supports eachh with a priorityp.”

This means that rules with more than one head atom express no preference amongthe different alternatives they create.

The priority of a ruler, �(r), indicates the maximal impact of the situation, de-scribed by the events of the body, on the preference of the head atom over theother alternatives. The dynamic priority of a rule, which wewill define later, ad-justs this impact according to the probability of the situation described in the body.By combining all the dynamic priorities of rules sharing a common head atom, weobtain an evaluation of the total impact on that atom which can then be used forcomparison with other alternatives.

Example7.2.1 The Geisha problem given in the introduction (Example 7.1.1) canbe represented as follows:western � traditional 0red � blue 0 obiobi 0 traditionalred 10 obiblue 90 obiExample7.2.2 (Jakuza) A young member of the Jakuza, the Japanese Mafia, isfaced with his first serious job. It will be his duty to controla new victim. Since itis his first job, he goes to his oyabun, head of his clan and mentor, for advice. Hetells him that the Jakuza has three methods for controlling its victims: blackmail,intimidation and bribing. The victim can either give in immediately or can put up

Page 284: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

270 CHAPTER 7. DOP-CLP

a stand. In the latter case, she does this by just ignoring thethreats of the orga-nization or she can threaten to go to the police. The oyabun isonly able to givesome information about previous encounters, which still needs to be interpretedin the current situation. So he starts telling about his previous successes. “Everytime when I knew that the victim was willing to give in, I resorted to intimidationas this is the easiest technique and each time it worked perfectly. In case we wouldknow that the victim was planning to stand up to us, we looked in to the possibilityof bribing. Nine out of ten times, we were successful when we just offered enoughmoney. If you are sure that the victim will run to the police from the momentthat you approach him, you have to try to bribe her. Unfortunately this techniqueworked only 4 times out of 10. When your victim tries to ignoreyou, you shouldfind something to blackmail her with. However, finding something interesting isnot that easy so this approach often fails, 3 out of 10 times tobe precise.So now it is up to you to make a good estimation of the victim’s reaction in orderto succeed with your assignment.”

All this information can easily be represented as the next DOP-CLP:jakuza 0bla kmail � intimidate � bribe 0 jakuzastand up � give in 0ignore � poli e 0 stand upintimidate 10 give inbribe 4 poli ebla kmail 3 ignoreenough �more 0 stand upbribe 9 enoughA probabilistic interpretation assigns a probability distribution over every state ofaffairs3. We say that a probabilistic interpretation is crisp when only one state ofaffairs is given a non-zero probability.

Definition 7.2.2 LetP be a DOP-CLP. Aprobabilistic interpretation4 is a proba-bility distribution: I : 2BP ! [0::1℄ :

3Each state corresponds to a total interpretation of the choice logic program obtained fromPby omitting the priorities. Because we are only working withtotal interpretations, it suffices tomention the positive part of the interpretation.

4When clear from the context, probability interpretations will simply be called interpretations.

Page 285: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.2. DOP-CLP 271

An interpretationI is crisp iff:9!A � BP � I(A) > 1 :Clearly, this is a generalization of the definition for a total interpretation for achoice logic program (Definition 5.2.2). In case of a choice logic program, aninterpretation is a crisp probabilistic distribution.

In our examples, we will only mention those states and their probabilities whenthese probabilities are different from zero.

Example7.2.3 Recall the Jakuza program of Example 7.2.2. The following func-tionsI, J andK are probabilistic interpretations for this program5:I(fjakuza; bribe; stand up; ignore; enoughg) = 14I(fjakuza; bribe; stand up; ignore;moreg) = 512I(fjakuza; bribe; stand up; ignoreg) = 16I(fjakuza; bribe; stand up; poli eg) = 124I(fjakuza; bribe; stand up;moreg) = 18J(fjakuza; intimidate; poli e; enough; stand upg) = 320J(fjakuza; intimidate; poli e;more; gg) = 710J(fjakuza; intimidate; poli e;more; stand upg) = 220J(fjakuza; bribe; poli e;more; stand upg) = 120K(fjakuza; bla kmail; stand up; ignore; enoughg) = 30441K(fjakuza; bla kmail; g; ignore; enoughg) = 5441K(fjakuza; bla kmail; stand up; ignore;moreg) = 240441K(fjakuza; bla kmail; g; ignore;moreg) = 40441K(fjakuza; bla kmail; stand up; poli e; enoughg) = 12441K(fjakuza; bla kmail; g; poli e; enoughg) = 2441K(fjakuza; bla kmail; stand up; poli e;moreg) = 96441K(fjakuza; bla kmail; g; poli e;moreg) = 16441

5For brevity, the names of the atoms are abbreviated.

Page 286: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

272 CHAPTER 7. DOP-CLP

Given an interpretation, we can compute the probability of aset of atoms, asthe sum of the probabilities assigned to those situations which contain this set ofatoms.

Definition 7.2.3 Let I be a probabilistic interpretation for a DOP-CLPP . Theprobability of setA � BP , denoted#I(A)6, is:#I(A) = XA�Y�BP I(Y ) :In choice logic programs, the basis of DOP-CLP, a rule is applicable when thebody is true, and is applied when both the body and a single head atom are true(i.e. Definition 5.2.3 on page 87). This situation becomes more tricky when prob-abilities come into play. Applicability is achieved when the body has a non-zeroprobability. In order for a rule to be applied it must be applicable. In addition, wedemand that at least one head element has a chance of happening and that no twoof them can happen simultaneously.

Definition 7.2.4 Let I be a probabilistic interpretation for a DOP-CLPP .

1. A ruler 2 P is calledapplicableiff #I(Br) > 0 .

2. An applicable ruler 2 P is appliediff 9a 2 Hr � #I(a) > 0 and8S 2 2Hrwith jSj > 1 : #I(S) = 0 .

When a total interpretation for a choice logic program is viewed as a probabilitydistribution assigning all its probability to just one state of affairs, we see thatthe definitions of applicability and appliedness correspond to the ones defined forchoice logic programs (i.e. Definition 5.2.3 on page 5.2.3).

Notice that our definition does not prescribe that the probability of the head shouldbe at least as high as the probability of the body. We have two reasons for this.First, probabilities are guided by the dynamic priorities of the atoms. Therefore,it seems unreasonable for the probability of an atom to depend both on the combi-nation of all situations in which it appears and on each such situation separately.The other reason is illustrated as follows: suppose there isa rule that states that ifa patient needs surgery then there is a chance that she dies (during this operation).

6When the setA contains just one elementa, we omit the brackets and write#I(a).

Page 287: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.2. DOP-CLP 273

It would be wrong to conclude that the chance of surgery increases the probabilityof death.

We have been referring to alternatives of decisions withoutactually defining them.Two atoms are alternatives if they appear together in the head of an applicablechoice rule. Thus, alternatives are thus dynamic, since theapplicability of therules depends on the interpretation.

Definition 7.2.5 Let I be a probabilistic interpretation for a DOP-CLPP .� Two atomsa; b 2 BP with a 6= b arealternativesw.r.t. I iff9 applicabler 2 P � fa; bg � Hr :� The set of all alternatives of an atoma 2 BP w.r.t. I is denotedI(a).� A setD � BP is a maximal alternative setw.r.t. I iff8a 2 D � 9r 2 P � #I(Br) > 0 ; and8a; b 2 D : a 6= b � a andb are alternatives ; and8 =2 D � 9a 2 D � a and are not alternatives:� �I is the set of all maximal alternative sets w.r.t.I.� An atoma 2 BP is calledsingle iff fag 2 �I .

Notice the difference with the definition of alternatives used for ordered choicelogic programs (i.e. Definition 6.2.3 on page 6.2.3). For DOP-CLP we do notinsist that the applicable choice rule should have a higher priority. The reasonfor this is that we no longer use, as we see later on, the priority of the rules ona rule basis. All the priorities are adjusted to the probability of the situation thatproduces them and accumulated to support a certain alternative. Of course thismakes it difficult to overrule a decision by choosing more than one alternativewith higher static priorities than the choice rule. However, it is still possible that adecision is ignored when there exists, for each alternative, an alternative from another decision which is more preferred. To this extent, we introduce the notion ofa maximal alternative set. As the name already indicates, such a set contains themaximal number of atoms such that all the atoms are each others alternative.

Page 288: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

274 CHAPTER 7. DOP-CLP

Example7.2.4 Reconsider the Geisha DOP-CLP of Example 7.2.1 and letI andJ be two probabilistic interpretations:#I(fwesterng) = 1#J(ftraditional ; obi ; redg) = 0:75#J(fwestern; red ; blue; obig) = 0:25The interpretationI makes every applicable rule applied, which is not true forinterpretationJ. For the ruler : red � blue 0 obi holds thatr is applicablew.r.t. J, as#J(Br) = 1, while#J(fred ; blueg) = 0:25 6= 0.The interpretationI has one maximal alternative set:�I = fftraditional ;westerngg ;while interpretationJ only has three:�J = fftraditional ;westerng; fred ; blueg; fobigg :A naive approach to defining a meaningful probability distribution is to insist thatthe sum of probabilities of the multiple elements in the headof a choice rulemust be one. At first sight this seems reasonable since these atoms represent thepossible alternatives of a decision. However, this approach fails in situations ofthe following kind.

Example7.2.5 In Medieval Japan there were several casts of warriors. The mostprivileged but the least in number were the daimyo or land lords. The second castwere the normal samurai which served the daimyo. In the dark side of society athird type of warriors resided, the ninja. Warriors to be would of course prefer tobecome daimyo one day.daimyo � samurai � ninja 0samurai � ninja 4daimyo 10In this situation, the atomdiamyo would not stand a chance of obtaining a positiveprobability, although this is the most favorable alternative.To overcome this problem, we introduce maximum alternativesets. They groupall the atoms that are alternatives of each other. It are those sets that will beused for a reasonable probability distribution. In the nextdefinition we call aninterpretation total if it defines a probability distribution in which the probabilitiesof the elements of any maximal alternative set add up to one.

Page 289: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.2. DOP-CLP 275

Definition 7.2.6 A probabilistic interpretationI for a DOP-CLPP is calledtotaliff 8D 2 �I �Xa2D #I(a) = 1 :Example7.2.6 Reconsider the Jakuza program of Example 7.2.2 and the inter-pretations of Example 7.2.3. The interpretationI is not total. Indeed, considerthe maximal alternative setfignore; poli eg. Here we have that#I(ignore) +#I(poli e) = 5=6 + 1=12 6= 1. The interpretationsJ andK are total.

As we mentioned earlier, the dynamic priority of a rule adjusts the (static) prior-ity/preference of the rule to the probability that this situation might actually occur.The dynamic priority gives an indication of the importance of this rule in select-ing an alternative for the decisions to which the head atoms belong. The dynamicpriority of an atom is obtained by taking into account every real contribution ofany situation that provides a choice for this atom.

Definition 7.2.7 Let I be an interpretation for a DOP-CLPP . Thedynamicpriority of a ruler 2 P , denoted%II (r), is:%II (r) = �(r) � #I(Br) :Thedynamic priorityof an atoma 2 BP , denoted%II (a), is:%II (a) = Xr2P :a2Hr %II (r) :Example7.2.7 Reconsider our Geisha DOP-CLP from Example 7.2.1 and its in-terpretationJmentioned in Example 7.2.4. The dynamic priority of the atomblueequals: %IJ (blue) = 0 � #J(obi) + 90 � #J(obi) = 90 � 0:75 = 67:5 ;while the dynamic priority forred equals:%IJ (red) = 0 � #J(obi) + 10 � #J(obi) = 10 � 0:75 = 7:5 :In the introduction we argued (Example 7.1.1) that whenevera choice betweenthe red and blue obi was required, we should decide on the sky blue one. ForinterpretationJ, we have thatfblue; redg 2 �J. Soblue and red are indeedalternatives of each other. When we look at the dynamic priorities of both atoms,we see that the atom which is mostly preferred has the highestdynamic priority.

Page 290: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

276 CHAPTER 7. DOP-CLP

The above example demonstrates that the dynamic priority can be used to de-termine the most eligible candidates amongst the alternatives of a decision. Forordered choice logic programs we defined the notion of defeating (Definition 6.4.1on page 6.4.1), which allowed us to say that a rule can be satisfied even when it isapplicable but not applied. For DOP-CLP, we have a similar notion called block-ing. Instead of using the static priority of rules, we say that a rule is blocked whenfor each atom in the head there exists an alternative with a higher dynamic prior-ity. An atom is a competitor for one of its alternatives when it is not blocked bythis atom. This means that the dynamic priority of the competitor is at least ashigh as that of the alternative.

Definition 7.2.8 Let I be an interpretation for a DOP-CLPP .� An atoma 2 BP is blockedby I iff there exists an alternativeb for a, i.e.b 2 I(a), such that%II (b) > %II (a) .� An atoma 2 BP is calledpreferredin I iff9D 2 �I � a 2 D ; and8b 2 I(a) � %II (a) > %II (b) :� The atoma is acompetitorof the atomb 2 I(a) if b does not blocka.

Clearly, when an atom is blocked then it also has a competitor.

Example7.2.8 Once more consider the Geisha DOP-CLP of Example 7.2.1 andthe interpretationJ of Example 7.2.4. The atomred is blocked by the atomblue,since, as seen in Example 7.2.7,%IJ (red) = 7:5 < %IJ (blue) = 67:5. This makesblue preferred.The atomstraditional andwestern are competitors:%IJ (traditional) = %IJ (western) = 0 :In standard logic programming an interpretation is a model when every rule iseither not applicable or applied. In some cases, this strategy dismisses reasonablesolutions when priorities are provided. To overcome this, we allow, in addition,that a model assigns a zero-probability to atoms which have amore favorablealternative with a non-zero probability.

Page 291: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.2. DOP-CLP 277

Definition 7.2.9 LetP be DOP-CLP. An interpretationI for P is a modelfor Piff 8r 2 P :� #I(Br) = 0, i.e. r is not applicable, or� r is applied, or� 8a 2 Hr � 9b competitor ofa � #I(b) > 0 .

Example7.2.9 Consider again the Jakuza program of Example 7.2.2 and its in-terpretations of Example 7.2.3. The interpretationI is not a model, since the rulebla kmail 10 ignore does not satisfy any of the above conditions. This rule isapplicable, because#I(ignore) = 5=6; it is not applied, as#I(bla kmail) = 0;nor does it have any competitors since%II (bla kmail) = 5=2, while for its alter-natives we have%II (intimidate) = 0 and%II (bribe) = 29=12. The interpreta-tionsJ andK are both models.

The next theorem demonstrates that DOP-CLPs are indeed an extension of posi-tive logic programs.

Theorem 7.2.1 Let P be a positive logic program and letPp be the DOP-CLPcorresponding toP by simply adding a zero priority to every rule.M is a modelfor P iff M is a total model forPp withM(M) = 1.

Proof: Let us start with the “only-if”-part and letM be a model forP . Thisimplies that every ruler in P is either not applicable or applied. In the formercase, we immediately have that#M(Br) = 0. The latter case implies thatr isapplicable and thatHr � M . SincejHrj = 1, we obtain, with Definition 7.2.4,thatr is applied. The totality follows immediately from the creation ofM andMbeing a model forP .

For the “if”-part, letM � BP such thatM is a total model forPp such thatM(M) = 1. The lack of choice rules ensures that no atom has a competitor. WithDefinition 7.2.9, we know thatM makes every applicable rule applied. Con-straints will never be applicable. Letr be a constraint inP . SinceM is a model,we must have#M(Br) = 0. This implies thatBr * M . Thusr is not applicablein P either. Now letr be an applicable rule with non-empty head. This makesthatHr 2 �M. SinceM is total, we must have that#M(Hr) = 1 which yieldsHr 2M . So,r is applied. 2

Page 292: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

278 CHAPTER 7. DOP-CLP

The following theorem demonstrates that every preferred atom originates from anapplied rule.

Theorem 7.2.2 LetP be a DOP-CLP and letI be a model for it. Then, ifa 2 BPis a preferred atom then:9r 2 P : a 2 Hr � r is applied :Proof: According to Definition 7.2.8,a is preferred implies:9D 2 �I � a 2 D ; and8b 2 I(a) � %II (a) > %II (b) :Now there are two possibilities: eithera is single or not. In the former case weknow that there exists an applicable ruler 2 P such thatHr = fag and thatfag 2 �I. This implies that no competitor fora exists. Thus, sinceI is a model,we must have thatr is applicable.

Whena is not single, we obtain that%II (a) > 0 and thata does not have anycompetitors w.r.t.I. Following Definition 7.2.7 stating that the dynamic priorityof a equals: %II (a) = Xr2P :a2Hr %II (r) ;%II (a) 6= 0 gives rise to:9r 2 P � a 2 Hr ^ #I(Br) > 0 :SinceI is a model forP , this implies immediately, according to Definition 7.2.9,that r is applied, as there is no competitor fora and#I(Br) > 0. 2The following example demonstrates thata being preferred is an essential condi-tion which cannot be replaced bya not being blocked.

Example7.2.10 In Japan two religions are very popular: Shinto and Buddhism.The following simple program demonstrates the choice between them:shinto � buddhism 0Consider the probabilistic interpretationI with:#I(fshinto; buddhismg) = 0:5#I(fshintog) = 0:5

Page 293: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.2. DOP-CLP 279

This interpretation is a model, because bothshinto andbuddhism have a non-zeroprobability (resp. 1 and 0.5) and they have the same dynamic priority, namely 0.Thus, they are competitors of each other. This makes the single rule in our pro-gram satisfied. However, this rule is not applied, since#I(fshinto; buddhismg) =0:5 6= 0.

In some cases, atoms receive a probability which they actually do not deserve.This happens for example when there is some better qualified alternative (i.e. analternative that has a higher dynamic priority). In this case it is the latter alternativethat should receive this probability. Such atoms are calledassumptions, since theywere just ”assumed” to have a chance of happening.

Definition 7.2.10 Let I be an interpretation for a DOP-CLPP . A set of atomsA 2 BP with #I(A) > 0 is anassumption setw.r.t. I when8a 2 A:� a is blocked w.r.t.I ; or� 8r 2 P with a 2 Hr– Br \ A 6= ; ; or

– #I(Br) = 0 .I is assumption-freeiff it contains no assumptions.

Intuitively, assumption-freeness reduces uncertainty asmuch as possible. Onlywhen alternatives are equally preferred, a probabilistic choice between them ispermitted.

Example7.2.11 Consider once more the Jakuza program of Example 7.2.2 andits interpretation in Example 7.2.3. The interpretationJ is not assumption-free.Indeed,#J(intimidate) > 0 and the alternativebribe blocksintimidate, because%II (bribe) = 4 + 27=20 while %II (intimidate) = 3:5. The interpretationK ishowever assumption-free.

Notice that the second condition for an assumption set corresponds to the defini-tion of an unfounded set for a logic program (Definition 3.3.9on page 28). How-ever, for assumption sets we only use atoms that receive a non-zero probability.For positive logic programs, this comes down to atoms that belong belong to theinterpretation.

Page 294: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

280 CHAPTER 7. DOP-CLP

Theorem 7.2.3 LetP be a positive logic program and letPp be its correspondingDOP-CLP by simply adding a zero priority to every rule. The interpretationM isa stable model forP iff M withM(M) = 1 is a total assumption-free model forPp.Proof: For the “only-if”-part, letM be a stable model forP and letM bethe crisp probabilistic interpretation such thatM(M) = 1. Theorem 5.4.10 onpage 124 tells us thatM is unfounded-free. This implies:8S � BP � 9a 2 S � 9r 2 P : a 2 Hr �Br \ S = ; ^ Br � M :Certainly this holds for allS 0 2 BP such that#M(S) > 0. With the constructionofM, we obtain:8S 0 2 BP : #M(S) > 0�9a 2 S 0 �9r 2 Pd : a 2 Hr �Br\S = ; ^ #M(Br) > 0 :With Definition 7.2.10, this implies thatM is assumption-free, since the first con-dition can never be satisfied, due to the absence of choice rules. With Theo-rem 7.2.1, we already know thatM is a total model forPp.For the “if”-part, letM be total interpretation forP such thatM, withM(M) = 1,is a total assumption-free model forPp. Thanks to Theorem 7.2.1, we immediatelyhave thatM is a model forP . So, it remains to be shown thatM is unfounded-free. This way, Theorem 5.4.10 on page 124 allows us to conclude thatM isindeed a stable model forP . With Definition 7.2.10, we have:8S 0 2 BP : #M(S) > 0�9a 2 S 0 �9r 2 Pd : a 2 Hr �Br\S = ; ^ #M(Br) > 0 :The first condition for an assumption set can never be fulfilled because the pro-gram does not contain any choice rules. With construction ofM , this yields:8S �M � 9a 2 S � 9r 2 P : a 2 Hr �Br \ S = ; ^ Br �M :With Theorem 5.4.4 on page 118 and the totality ofM , this implies thatM isunfounded-free. Thus, we can conclude thatM is indeed a stable model forP . 2Theorem 7.2.2 demonstrates that a preferred atom is always forced by an appliedrule, but it does not tell anything about the probability such an atom should have.In the following theorem we show that this becomes possible when the model istotal and assumption-free.

Page 295: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.2. DOP-CLP 281

Theorem 7.2.4 LetP be a DOP-CLP and letI be a total assumption-free modelfor P . If a 2 BP is a preferred atom then:9r 2 P : a 2 Hr � r is applied and#I(a) = 1 :Proof: From Theorem 7.2.2, we already know that:9r 2 P : a 2 Hr � r is applied :Now there are two possibilities: eithera is single ora is not. Whena is single, weimmediately have that#I(a) = 1, sinceI is total.

In casea is not single, we know, becausea is preferred, that:8b 2 I(a) � %II (a) > %II (b) :The assumption-freeness ofI yields, with Definition 7.2.10, that#I(b) = 0 : (7.1)

As I is total, this implies, with Definition 7.2.6, that:8D 2 �I : a 2 D �X 2D #I( ) = 1 : (7.2)

Combining Equations 7.1 and 7.2 with(D n fag) � I(a) implies:#I(a) = 1 : 2Note that the preference condition is essential for the above theorem, as demon-strated by the following example.

Example7.2.12 Reconsider the Japanese religion program of Example 7.2.10.LetJ be the following probabilistic interpretation for this program:#J(fshinto; buddhismg) = 0:10#J(fshintog) = 0:40#J(buddhismg) = 0:40#J(;) = 0:1Clearly, this interpretation is a total assumption-free model. However, the singlerule in the program is not applied nor is the probability of any of the atoms equalto 1.

Page 296: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

282 CHAPTER 7. DOP-CLP

When we look at the above example and its total assumption-free modelJ, wemust say thatJ is not exactly what we had in mind for a semantics for this pro-gram. First of all, the interpretation assigns a non-zero probability to situationswhere more than one alternative for a decision is chosen. Furthermore, each alter-native does not contribute equally to each situation it is in.

More formally,interpretations evaluate the likelihood ofevery possible outcome,by assigning a probability distribution to every situation. These probabilities areinfluenced by the atoms which are present in each situation. In order to quantifythis influence one must know whether the events which occur inany such interpre-tation are independent of each other. An interpretation which assumes that thereis no inter-dependency between atoms, is said to be “independent”, as follows:

Definition 7.2.11 Let I be an interpretation for a DOP-CLPP . We say thatI isindependentiff 8A � BP :� If 8D 2 �I � jD \ Aj � 1 then#I(A) =Qa2A #I(a)� else#I(A) = 0 .

Given the probabilities the an indepent interpretation generates for each atom, wecan reconstruct the interpretation. It most cases this is exactly the information weneed to solve the represented decision problem.

Example7.2.13 Consider the interpretationsJ andK of example 7.2.3. The in-terpretationJ is not independent as#J(fy; in; p; e; sg) = 3=20 6= #J(y)�#J(in)�#J(p) � #J(e) � #J(s) = 1 � 19=20 � 1 � 3=20 � 8=20. The interpretationK is in-dependent.

Definition 7.2.12 Let P be a DOP-CLP. A total independent assumption-freemodel is said to bestable.

Example7.2.14 For the last time we return to the Jakuza example and its threeinterpretationsI,J andK from Example 7.2.3. Combining the results from ex-amples 7.2.6, 7.2.9, 7.2.11 and 7.2.13, we can conclude thatK is the only stablemodel of the three.

All the stable models for this program can be constructed from the probabilitiesin Fig. 7.1. For every stable modelM we have that#M(fjakuzag) = 1. We also

Page 297: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.2. DOP-CLP 283

blackmail intimidation bribe give in ignore enough(12+27enough)70 (4+9enough)7 � 130 3ignore10 � 47 � (7ignore�4)90 � 3ignore10 (4+9enough)7 � 130 (4poli e+9enough)10 � 10g3 < (10�4poli e)91 0 0 � 3ignore10 � 47 � (7ignore�4)90 1 0 1 0(police= 0) 0(more= 0)0 1 0 � (4poli e+9enough)10 � 10give in3 < (10�4poli e)9< 10 0 1 � (4poli e+9enough)10 � (7ignore�4)9Figure 7.1: Shorthand notion for the stable models of the Jakuza program of Ex-ample 7.2.2.

have thatfbribe; bla kmail; intimidationg andfstand up; give ing are maximalalternative sets. Whenever#M(stand up) > 0 we also have thatfignore; poli egandfmore; enoughg are maximal alternative sets. Otherwise, there probabilitiesshould be zero. For each alternative set, we know that the sumof the element’sprobabilities should add up to zero. This means that the probability of an elementcan be derived from the probabilities of the others. Since stable models are inde-pendent we can construct the interpretation from the probabilities of the atoms.When no number is given, the probability can be chosen freelyas long as thetotality of the interpretation is respected.

In case we would compute all stable models for our Jakuza example we wouldobtain all possible situations in which the young Jakuza makes the right assertionconsidering his estimations on the reactions of his victim.In general, stable models reveal all possible situations inwhich the decisions aremade rationally, considering the likelihood of the events that would force suchdecisions. However, this may lead to an infinite number of stable models, as isthe case for the Jakuza example. This is only natural since hecan make an infinitenumber of assumptions when analyzing his victim. A more practical approachwould be to incorporate estimates of the situation at hand into the program. Thiscan be achieved by introducing a “conditional query” mechanism where the con-dition represents constraints on the model distribution. E.g. the Jakuza apprentice

Page 298: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

284 CHAPTER 7. DOP-CLP

could query the program for models that are consistent with his estimate of 90 %probability that the victim will give in. If she would not give in, he is sure (100 %)that she will ignore further threats. The apprentice also estimates that there is anequal chance that she will be willing to except the bribe he proposes. This wouldreduce the set of acceptable models to the singleton stable model I that assignsthe following probabilities7:jakuza bla kmail intimdation bribe stand up

1 0 1 0 0.1give in ignore poli e enough more0.9 1 0 0.5 0.5

Example7.2.15 The Geisha example of the introduction has also an infinite num-ber of stable models:

western traditional obi red blue1 0 0 0 0x 6= 1 1� x 1 0 1

In Theorem 7.2.3 we have seen that for positive logic programs the stable modelscorrespond with the crisp total assumption-free models. Inthe next theorem, wedemonstrate that they also correspond with the crisp stablemodels.

Theorem 7.2.5 LetP be a logic program and letPp be its corresponding DOP-CLP by simply adding a zero priority to every rule. A total interpretationM is astable model forP iff M withM(M) = 1 is a stable model forPp. Furthermore,there is at most one stable model and this it is crisp.

Proof: With Theorem 7.2.3, we immediately have the “if”-part. For the “only-if”part, it only remains to be shown that for a stable modelM , M is independent.BecauseM is crisp, it assigns the probability 1 to every atom inM and 0 to allthe others. Every subset ofM will obtain the probability of 1 which is exactlythe product of the probabilities of its elements. The same applies for every othersubset which is given a zero probability. Since it contains an element from outsideof M , we have that the product of the probability of the elements is also zero.Therefore,M is independent and, thus, a stable model.

7To fit into one table we abbreviated the atoms.

Page 299: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.2. DOP-CLP 285

Theorem 7.2.4 tell us that every preferred atom has a probability of 1. SincePp does not contain any choice rules, we know that all the maximal alternativessets contain just one element which is immediately preferred. Atoms that arenot in it are only present in non-applicable rules. With Definition 7.2.10, weknow that such atoms are assumptions. Because stable model are assumption-free, they should obtain a zero probability. This means thatevery atom has eithera probability of zero or 1. Since stable models are also independent, we know thatthis stable model should be crisp. Above, we have shown that acrisp stable modelcorresponds with a stable model of the programP . Positive logic program haveat most one stable model, thus,Pd can only admit one stable model. 2For choice logic programs, we have that their stable models coincided with thecrisp stable models of the corresponding DOP-CLPs.

Theorem 7.2.6 LetP be a choice logic program and letP be the correspondingDOP-CLP by assigning a zero priority to every rule inP . Then, for each stablemodelM of P there exists a crisp stable modelM ofP such thatM(M) = 1.

Proof: The probabilistic interpretationM is crisp by construction. In order toprove thatM is a stable model, we need to demonstrate thatM is a total indepen-dent assumption-free model ofP (i.e. Definition 7.2.12).� M is a model forPd. BecauseM is a stable model ofP , we know, with

Theorem 5.2.1 on page 93, thatM is a model forP . This implies (Defini-tion 5.2.4 on page 88) that every rule inP is either not applicable or applied.The construction ofM guarantees that every non-applicable rule inP is alsonot applicable inP . A rule r is applied w.r.t.M in P whenever isr appli-cable w.r.t.M andjHr \M j = 1. Again the construction ofM allows usto conclude thatM is applicable and that an atoma 2 Hr exists such that#M(a) > 0. BecauseHr \M = fag, we know that, for everyS � BP withjSj = 1, #M(S) = 0. This means thatr is also applied inP w.r.t.M.� M is total. Every maximal alternative setD 2 �PINTM comes from anumber of applicable choice rules (Definition 7.2.5). SinceM is a model ofP , we know that these rules are also applied. This immediatelyimplies thatD \M � 1. With the construction ofM this yields:S =Xa2D #M(a) � 1 :

Page 300: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

286 CHAPTER 7. DOP-CLP

Suppose thatS > 1, which implies thatjI = D\M j > 1. Leta; b 2 I � D.BecauseD is a maximal alternative set, this makes that:9r 2 P �Br � M ^ a; b 2 Hr :This is in contradiction withM being a model. Thus,jD \M j = 1 whichimplies thatS = 1. This allows us to conclude thatM is total.� M is independent. According to Definition 7.2.11 this means that we haveto prove

– If 8D 2 �I � jD \ Aj � 1 then#I(A) =Qa2A #I(a)– else#I(A) = 0 .

Let A 2 BP . Suppose that9D 2 �I � jD \ Aj > 1. Above, we havedemonstrated thatjD\M j = 1. This implies thatA *M . The constructionofM guarantees in this case that#M(A) = 0. Two possibilities exists when8D 2 �I � jD \Aj � 1: eitherA �M orA *M . BecauseM is crisp, wehave thata 2 M implies that#M(a) = 1 while a =2 M gives#M(a) = 0.In caseA � M , we have that#M(A) = 1. WhenA * M , we obtain#M(A) = 0. In both cases, this corresponds exactly with

Qa2A #M(A).Thus,M is indeed independent.� M is assumption-free. We proceed by contradiction. Therefore, letA 2 BPbe an assumption set forP w.r.t. M. Since every rule has a static priorityof zero, we know that no atom can be blocked since they all havea dynamicpriority equal to zero. This makes that the first condition for an assumptionset can never be satisfied, which means, by Definition 7.2.10,that for everyatoma 2 A, each ruler 2 P with a 2 Hr must satisfy one of the followingconditions:

– Br \ A 6= ; ; or

– #M(Br) = 0 .

The last condition implies thatBr *M . With Definition 5.4.1 on page 113,we obtain thatA is an unfounded set ofP w.r.t. M . Because we assumedthatA is an assumption set w.r.tM, we have, thanks to Definition 7.2.10,that#M(A) > 0. With the construction ofM, this implies thatA � M .This is in contradiction with Theorem 5.4.10 on page 124, stating thatstable models are unfounded-free. Thus, we have to concludethatM isassumption-free.

Page 301: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.3. AN APPLICATION OF DOP-CLPS: GAME THEORY 287

Combining the above results, we may conclude thatM is indeed a crisp stablemodel forP . 2For positive logic programs we had a complete mapping between the stable mo-dels of the positive logic program and the stable models for the correspondingDOP-CLP. For choice logic programs, this is no longer true. There is even nolonger a one-to-one mapping between the stable models of thechoice logic pro-gram and the crisp stable models of the corresponding DOP-CLP, as the followingexample will demonstrate.

Example7.2.16 Consider the following program discussing some weapons usedby ninja: the dai-katana, i.e. the long samurai sword, the sais, i.e. two trident-shaped knives and the shuriken, i.e. star-shaped throwableblades.dai katana shurikenshuriken sais sais � dai katana When you consider the above program as a choice logic program, you will obtainno stable models. In case you consider the above program as a DOP-CLP withthe zero static priority for every rule, one has two crisp stable models:I(fshuriken; saisg) = 1 andJ(fshuriken; dai katanag) = 1 :This is exactly what one would get if the program was considered to be an orderedchoice logic program.

In this section we presented a new formalism, called dynamically ordered pro-babilistic choice logic programming, for reasoning under uncertainty. For theseDOP-CLPs, we introduced the stable model semantics to obtain all the rationalsolutions to the represented decision problem. We demonstrated that DOP-CLPextend from choice logic programming. For positive logic programs, we were ableto show that the program produces at most one crisp stable model correspondingto the least Herbrand model.

7.3 An Application of DOP-CLPs: Game theory

In Section 5.5 on page 142, we have seen that choice logic programs are an ele-gant tool for representing strategic games (Section 4.2 on page 60) such that Nash

Page 302: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

288 CHAPTER 7. DOP-CLP2; 10; 0 0; 01; 2SeppukuB RoninBSeppukuARoninAFigure 7.2: A samurai’s way of life

equilibria of the game can be obtained as the stable models ofthe correspondingchoice logic programs. Since DOP-CLP are an extension of CLP, we can use thesame transformation (Definition 5.5.1 on page 143) giving each rule a zero prior-ity to obtain the Nash equilibria as the crisp stable models of the correspondingDOP-CLP. The special structure of the DOP-CLPs guarantees aone-to-one map-ping between the two. Because not every game admits a Nash equilibrium andto allow players to make a probabilistic decision, mixed strategy Nash equilibriawere introduced for strategic games (Subsection 4.2.3 on page 4.2.3). These equi-libria are no longer independent from the numerical value ofthe payoff assignedto the outcomes of the game. Therefore, we cannot use Definition 5.5.1. Thepayoffs should be hard-coded into the program.

Example7.3.1 In Medieval Japan, it was customary that whenever the daimyodied his samurai would either commit suicide (seppuku) or continue their lives asronin, warrior without a master. Two good friends since childhood are facing thisdifficult situation. Because of there friendship, they would like that they both tookthe same decision. One of the two friends is more inclined to commit seppuku,since this is for a warrior a very honorable way to leave this world. The otherwould like continue as a ronin, following bushido, the way ofthe warrior. Thissituation can be represented as the strategic game depictedin Figure 7.2.

This game has two Nash equilibria or crisp mixed strategy Nash equilibria:(seppukuA; seppukuB) and (roninA; roninB) ;and one non-degenerated mixed strategy Nash equilibrium ofthe game:ffseppukuA : 2=3; roninA : 1=3g ; fseppukuB : 1=3; roninB : 2=3gg :Suppose that we would use a payoff of 3 instead of 2. In this case, we obtain thesame crisp mixed strategy Nash equilibria but the non-degenerated mixed strategyNash equilibrium would be:ffseppukuA : 3=4; roninA : 1=4g ; fseppukuB : 1=4; roninB : 3=4gg : :

Page 303: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.3. AN APPLICATION OF DOP-CLPS: GAME THEORY 289

The following transformation can be used to retrieve the mixed strategy Nashequilibria of a strategic game as the stable models of the corresponding game.

Definition 7.3.1 Let hN; (Ai); (ui)i be a strategic game. The correspondingDOP-CLPPm can be constructed as follows:Pm = fAi 0j 8i 2 Ng [ fai ui(a) a�i j a 2 A; 8i 2 NgThe corresponding DOP-CLP contains two types of rules. First, there are the realchoice rules which represent, for each player, the actions she can choose from.The zero priority assures that the choice itself does not contribute to the decisionmaking process. Rules of the second type represent all the decisions a player canmake (the heads) according to the situations that the other players can create (thebodies). A rule’s priority corresponds with the payoff thatthe deciding playerwould receive for the pure strategy profile corresponding tothe head and body ofthe rule.

Example7.3.2 The Samurai game of Example 7.3.1 can be mapped to the DOP-CLPPm: r1 : seppukuA � roninA 0r2 : seppukuA 2 seppukuBr3 : seppukuA 0 roninBr4 : roninA 0 seppukuBr5 : roninA 1 roninBr6 : seppukuB � roninB 0r7 : seppukuB 1 seppukuAr8 : seppukuB 0 roninAr9 : roninB 0 seppukuAr10 : roninB 2 roninAThis program has three stable models:I1(seppukuA; seppukuB) = 2=9I1(seppukuA; roninB) = 4=9I1(roninA; seppukuB) = 1=9I1(roninA; roninB) = 2=9 I2(seppukuA; seppukuB) = 1I2(seppukuA; roninB) = 0I2(roninA; seppukuB) = 0I2(roninA; roninB) = 0I3(seppukuA; seppukuB) = 0I3(seppukuA; roninB) = 0I3(roninA; seppukuB) = 0I3(roninA; roninB) = 1

Page 304: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

290 CHAPTER 7. DOP-CLP

In this example, the probabilities of the actions correspond with the ones given formixed strategy Nash equilibria. The following theorem demonstrates that this istrue in general.

Theorem 7.3.1 LetG = hN; (Ai); (ui)i be a strategic game and letPm be its cor-responding DOP-CLP according to Definition 7.3.1. Then there is a one-to-onecorrespondence between the stable models of the program andthe mixed strategyNash equilibria of the game.

The main idea of the proof is the equality between the dynamicpriority of anaction and its expected payoff. Intuitively, this correspondence is rather simpleto show. The expected payoff to an action expresses its player’s payoff given theprobability distribution among the situations that the other players would gener-ate, and the certainty that she is picking this action. The dynamic priority of anaction expresses the priority that an atom would receive, taken into account thesituations created by the body elements of rules in which this atom appears as ahead atom. Looking at the transformation it is easy to see that the bodies of theserules correspond exactly with all the situations that the other players of the gamecan create. Since the static priority of each rule corresponds exactly with the pay-off the player would receive in that situation, the similarity of the two conceptsbecomes clear.

Proof: We will prove this in several steps. First, we demonstrate that, given atotal probabilistic interpretationI, a mixed strategy profile�� exists such that:8a 2 A � 8i 2 N � �i(ai) = #I(ai) :Second, we show, given a mixed strategy profile��, that we can construct a totalindependent interpretationI such that:8a 2 A � 8i 2 N � �i(ai) = #I(ai) :Afterwards, we illustrate that for a corresponding mixed strategy profile and a totalindependent interpretation, the notions of expected payoff to and dynamic priorityfor an action coincide. Furthermore, we will demonstrate that a total independentassumption-free interpretationI makes sure that the corresponding�� is a mixedstrategy Nash equilibrium. We continue illustrating that the corresponding in-terpretationI of a mixed strategy Nash equilibrium is assumption-free. Weendthe proof by showing that the corresponding interpretationI of a mixed strategy

Page 305: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.3. AN APPLICATION OF DOP-CLPS: GAME THEORY 291

Nash equilibrium is also a model forP . The combination of a total independentassumption-free model yields thatI is a stable model forPm.

As mentioned before we will start with proving that there exists a mapping fromtotal interpretations to mixed strategy profiles.

Lemma 7.3.1 LethN; (Ai); (ui)i be a strategic game, letPm be its correspondingDOP-CLP and letI be a total interpretation forPm. Then, a mixed strategy profile� exists forhN; (Ai); (ui)i such that:8a 2 A � 8i 2 N � �i(ai) = #I(ai) :Proof of Lemma 7.3.1:Let us construct� such that:8a 2 A � 8i 2 N � �i(ai) = #I(ai)is satisfied. This is made possible as, by Definition 7.3.1, the Herbrand base ofPcorresponds exactly to all the actions available to the players of the game.Now it remains to be shown that� is a mixed strategy profile. This is accom-plished when we can demonstrate that:8Ai : i 2 N �Xa2Ai �i(a) = 1 : (7.3)

With the definition for the transformation of strategic games to DOP-CLPs (Defi-nition 7.3.1) and the definition of alternatives (Definition7.2.5), we can deducethat �I = fAi j i 2 Ng : (7.4)

Because we are working with a total interpretation, we obtain, with Definition 7.2.6,that: 8D 2 �I �Xa2D #I(a) : (7.5)

Combining Equations 7.4 and 7.5 results in Equation 7.3, which implies that� isindeed mixed strategy profile. 2The following lemma demonstrates that there is a transformation from mixed stra-tegy profiles to total independent interpretations.

Page 306: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

292 CHAPTER 7. DOP-CLP

Lemma 7.3.2 Let hN; (Ai); (ui)i be a strategic game, letPm be its correspon-ding DOP-CLP and let� be a mixed strategy profile. Then, a total independentinterpretationI exists such that:8a 2 A � 8i 2 N � �i(ai) = #I(ai) :Proof of Lemma 7.3.2: Using the mapping of strategic games to DOP-CLPsgiven by Definition 7.3.1, it is easy to verify that:BP = fAi j i 2 Ng :Now, we can construct an interpretationI for P in the following way:8S � BP � #I(S) = � Qs2S �i(s) with s 2 Ai 8Ai : i 2 N � jS \ Aij = 10 otherwise

(7.6)Because� is mixed strategy profile we know that:8Ai : i 2 N �Xa2Ai �i(a) = 1 : (7.7)

From Equation 7.7) and the creation ofI (see Equation 7.6), it is rather easy toverify thatI is indeed a probabilistic interpretation forPm and that8a 2 A � 8i 2 N � �i(a) = #I(ai) : (7.8)

Now, it remains to be demonstrated thatI is total and independent. The formerfollows from the construction ofPm (Definition 7.3.1) which ensures that the setof the maximal alternative sets (Definition 7.2.5) equals:�I = fAi j i 2 Ng : (7.9)

Together with Equations 7.7 and 7.8), this implies exactly the totality ofI (Defi-nition 7.2.6).I being independent (Definition 7.2.11), follows immediately fromEquation 7.6. All together we have shown thatI is a total independent interpreta-tion such that: 8a 2 A � 8i 2 N � �i(ai) = #I(ai) : 2Given the above lemmas we can demonstrate that in some cases the expectedpayoff and the dynamic priority coincide.

Page 307: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.3. AN APPLICATION OF DOP-CLPS: GAME THEORY 293

Lemma 7.3.3 Let hN; (Ai); (ui)i be a strategic game, letP be its correspondingDOP-CLP and let� andI be respectively corresponding8 mixed strategy profilefor hN; (Ai); (ui)i and total independent interpretation forP . Then, the expectedpayoff to an actionai 2 Ai equals the dynamic priority ofai 2 BP .

Proof of Lemma 7.3.3:This proof, starting from the definition of expected pay-off (Definition 4.2.6 on page 68), moves, by adding the necessary bits of infor-mation, towards the definition of dynamic priority (Definition 7.2.7). This proofis reversible, so we left out showing that starting from the dynamic priority oneobtains the expected payoff.

The expected payoff to an actionai 2 Ai equals, by Definition 4.2.6,Ui(��i; e(ai)),wheree(ai) assigns probability 1 toai and 0 to any other action available to playeri. Ui(��i; e(ai)) equals, by definition ofUi,Ui(��i; e(ai)) = Xa2A:ai2a ( Yj2N :j 6=i�j(aj))ui(a) : (7.10)

From the construction ofPm (Definition 7.3.1) we know that:8r 2 Pm � 8Aj : j 2 N � jBr \ Ajj � 1 : (7.11)

The same construction and the definition for maximum alternative set (Defini-tion 7.2.5) assure that: �I = fAj j j 2 Ng : (7.12)

The combination of Equation 7.11 and 7.12, andI being independent yields, withDefinition 7.2.11, that: 8r 2 P � #I(Br) = Yb2Br #I(b) : (7.13)

Due to Lemmas 7.3.1 and 7.3.2, Equation 7.13) can be rewritten as:8r 2 Pm � #I(Br) = Yb2Br �(b) : (7.14)

The construction ofPm (see Definition 7.3.1) makes sure that, for alld 2 A,N non-choice rulesrd exists such that every action is once in the head of such8Such a correspondence exists thanks to Lemmas 7.3.1 and 7.3.2.

Page 308: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

294 CHAPTER 7. DOP-CLP

a rule and that all others form the body. This combined with Equation 7.14 andzero priority of the choice rules (see Definition 7.3.1) yields that for every actionprofile a 2 A with ai 2 A and the corresponding rulerai with ai in the headraiholds: Yj2N :j 6=i�j(a) = #I(Brai ) : (7.15)

By construction ofrai (see Definition 7.3.1) and the definition ofui we have that:ui(a) = �(rai) : (7.16)

Definition 7.2.7 tells us that the dynamic priority of an atom 2 BP always yields:%II ( ) = Xr2P : =Hr �(r) � #I(Br) : (7.17)

If we combine the results from Equations 7.15, 7.16 and 7.17 for everyrai , weobtain: Ui(��i; e(ai)) = %II (ai) :This proofs that the expected payoff to an actionai and its dynamic priority areequivalent notions for corresponding mixed strategy profiles and total independentinterpretations. 2Now we have all the ingredients necessary to show that total independent assump-tion-free interpretations induce a mixed strategy Nash equilibria.

Lemma 7.3.4 Let hN; (Ai); (ui)i be a strategic game, letPm be its correspon-ding DOP-CLP and let� andI respectively be the corresponding9 mixed strategyprofile for hN; (Ai); (ui)i and a total independent interpretation ofPm. Then,�is a mixed strategy Nash equilibrium ifI is assumption-free.

Proof of Lemma 7.3.4: Let I be a total assumption-free independent interpreta-tion. According to Theorem 4.2.3 on page 68, we now have to prove that for everyplayeri:

1. the expected payoff to every action to which�i assigns positive probabilityis the same, given��i, and

9Such a correspondence exists due to Lemmas 7.3.1 and 7.3.2.

Page 309: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.3. AN APPLICATION OF DOP-CLPS: GAME THEORY 295

2. the expected payoff to every action to which�i assigns probability 0 is atmost the expected payoff to any action in the support of�i, given��i.

We proceed by contradiction. Starting with the reverse of the first claim, we ob-tain, with Definition 4.2.6 on page 68, that:9a 2 Ai : i 2 N ��i(a) > 0^ 9b 2 Ai��i(b) > 0^Ui(��i; e(a)) > Ui(��i; e(b)) :

(7.18)Due to the construction ofPm (Definition 7.3.1) and the definition of alternatives(Definition 7.2.5), we have: b 2 I(a) : (7.19)

Following to Lemma 7.3.3, we can substitute the expected payoff to an action byits dynamic priority. So Equation 7.18, together with Equation 7.19 yields:9a 2 BP � #I(a) > 0 ^ 9b 2 I(a) � #I(b) > 0 : %II (a) > %II (b) : (7.20)

Equation 7.20 is in contradiction with the assumption-freeness ofI (Definition7.2.10): the atomb with #I(b) > 0 has is blocked bya. Thus, the expected payoffto all actions of playeri to which�i assigns positive probability must be equal,given��i.For the second requirement we work according the same process. Thus, the con-tradiction of the second statement yields:9a 2 Ai : i 2 N ��i(a) = 0^9b 2 Ai��i(b) > 0^Ui(��i; e(a)) > Ui(��i; e(b)) :

(7.21)In this situation, Equation 7.19 remains valid for the same reasons. Equation 7.21can be rewritten, with Lemma 7.3.3 and Equation 7.19, as:9a 2 BP � #I(a) = 0 ^ 9b 2 I(a) � #I(b) > 0 ^ %II (a) > %II (b) : (7.22)

Again, Equation 7.22 contradicts the assumption-freenessof I (Definition 7.2.10):the atomb with #I(b) > 0 is blocked bya. Therefore, the expected payoff to everyaction of playeri with a zero probability must be at most as high the expectedpayoff to every action in the support of�i.Thanks to Theorem 4.2.3 on page 68, we can conclude that� has to be a mixedstrategy Nash equilibrium. 2Next, we demonstrate that mixed strategy Nash equilibria induce total indepen-dent assumption-free interpretations.

Page 310: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

296 CHAPTER 7. DOP-CLP

Lemma 7.3.5 Let G = hN; (Ai); (ui)i be a strategic game, letPm be its cor-responding DOP-CLP and let� andI respectively be the corresponding10 mixedstrategy profile forhN; (Ai); (ui)i and a total independent interpretation forPm.Then,I is assumption-free if� is a mixed strategy Nash equilibrium.

Proof of Lemma 7.3.5: Let � be a mixed strategy Nash equilibrium forG. Ac-cording to Theorem4.2.3, this implies:

1. the expected payoff to every action to which�i assigns positive probabilityis the same, given��i, and

2. the expected payoff to every action to which�i assigns probability 0 is atmost the expected payoff to any action in the support of�i, given��i.

We proceed by contradiction. Suppose thatI is not assumption-free. This impliesthat a setS � BP exists such that#I(S) > 0 satisfying the conditions for anassumption w.r.t.I. BecauseI is independent, we know, with Definition 7.2.11,that8a 2 S � #I(a) > 0. The construction ofPm immediately guarantees that thesecond condition for an assumption set can never be satisfied. The atoma belongsto a choice ruler 2 Pm for which holdsBr = ;. Therefore,#I(Br) = 1 andBr \ S = ;. This means thatS can only be an assumption set when the firstcondition is satisfied. This implies:9b 2 I(a) � (%II (a) < %II (b)) : (7.23)

Combining the construction ofPm (Definition 7.3.1) and the definition of alterna-tives (Definition 7.2.5) yields:I(a) = Ai n fag with a 2 Ai andi 2 N : (7.24)

Because of Equation 7.24 and equivalence of dynamic priority and expected pay-off, we can rewrite Equation 7.23 as:9b 2 Ai � Ui(��i; e(a)) < Ui(��i; e(b)) : (7.25)

Now there are two possibilities:� �i(b) > 0 , or10Such a correspondence exists due to Lemmas 7.3.1 and 7.3.2.

Page 311: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.3. AN APPLICATION OF DOP-CLPS: GAME THEORY 297� �i(b) = 0 .

Because�i(a) > 0, the former is in contradiction with the first requirement oftheorem 4.2.3, while the latter contradicts the second requirement. 2The only thing which is still missing in our comparison is thenotion of models.This can simply be overcome by showing that all total independent assumption-free interpretations induce models.

Lemma 7.3.6 Let hN; (Ai); (ui)i be a strategic game and letPm be its corres-ponding DOP-CLP. Then, a total independent assumption-free interpretation forPm is also a model forPm.

Proof of Lemma 7.3.6:To demonstrate thatI is a model forP , we need to prove,according to Definition 7.2.9, that for all rulesr 2 P :� #I(Br) = 0 , or� r is applied, or� 8a 2 Hr � 9b competitor ofa � #I(b) > 0 .

BecauseI is a total interpretation, we have, following definition 7.2.6, that:8D 2 �I � 9a 2 D � #I(a) > 0 : (7.26)

Combining Equation 7.26 with the assumption-freeness ofI which states, accord-ing to Definition 7.2.10, that every blocked atom has probability zero, we obtain:6 9b 2 I(a) � %II (b) > %II (a) : (7.27)

Equation 7.27 together with Definition 7.2.8 yields:8b 2 I(a) � a is a competitor ofb : (7.28)

BecausePm is created from a strategic game, we know from Definition 7.3.1 thatthere are two types of rules:� Ai 0, for everyi 2 N ;

Page 312: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

298 CHAPTER 7. DOP-CLP� n B, for every(B; ) 2 A with n = ui((B; )) and 2 Ai .

Let us first take a look at the first type and letr be such a rule . This type of rulesis always applicable, as a result of an empty body. We will illustrate thatr is alsoapplied. The construction ofPm (Definition 7.3.1) and the definition of maximumalternative set (Definition 7.2.5), supply us with:Hr 2 �I :From Equation 7.26, we obtain:9a 2 Hr � #I(a) > 0 : (7.29)

BecauseI is independent, we have, with Definition 7.2.11 for every subsetS � Hrwith jSj > 1: #I(S) = 0 : (7.30)

With combination of Equations 7.29 and 7.30, we obtain, withDefinition 7.2.4,thatr is applied.

The rules of type two are easier, because no problem arises when they are notapplicable. In case they are applicable but not applied, there can only be onecause, namely that the probability of the head is zero. The second requirement forapplicability can only be falsified in the presence of at least two head atoms. Nowassume that the probability of the head atomb is zero. According to (7.26), (7.27)and (7.28), a competitora of b exists such that#I(a) > 0. Therefore, this type ofrules is satisfied.Thus, we can conclude that every rule inPm is satisfied which implies thatI is amodel forPm. 2Combining the results of Lemmas 7.3.6, 7.3.5 and 7.3.6, we immediately obtain,with Definition 7.2.12, the one-to-one correspondence between the stable modelsof Pm and the mixed strategy Nash equilibria ofG. 2Corollary 7.3.1 LetG = hN; (Ai); (ui)i be a strategic game and letPm be thecorresponding DOP-CLP according to Definition 7.3.1. Then Nash equilibria ofG coincide with the crisp stable models ofPm.

Page 313: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.4. RELATIONSHIPS TO OTHER APPROACHES 299

Proof: Follows immediately from Theorem 7.3.1 and Theorem 4.2.1 onpage 67.2With this long proof and corollary we conclude the section onthe game theoreticapplications of DOP-CLP. We have demonstrated that DOP-CLPare an eleganttool for the representation of strategic game such that the stable models correspondto the mixed strategy Nash equilibria of the game.

7.4 Relationships to Other Approaches

7.4.1 Logic Programming

Theorem 7.2.5 demonstrates that DOP-CLP extends positive logic programming:the stable model of the positive logic program can be obtained as the stable modelof the corresponding DOP-CLP. With the current semantics itis impossible toobtain a full one-to-one mapping between the stable models of a choice logic pro-gram ([DVV98b]) and the crisp stable models of the corresponding DOP-CLP.Indeed, our system is more credulous, since it allows a pure choice (probability1) when two alternatives are equally preferred. However, wehave that every sta-ble model of a CLP is also a crisp stable model of the corresponding DOP-CLP(i.e. Theorem 7.2.6). In Section 6.5 on page 231, we presented a transformationfrom semi-negative logic programs to ordered choice logic programs such that thestable model semantics is maintained. Working with DOP-CLPs, we use practi-cally the same transformation. Instead of working with componentsC;R;N weuse respectively the static priorities 1,2,0. This way we obtain the stable modelsof a semi-negative logic program as the crisp stable models of the correspondingDOP-CLP.

7.4.2 Priorities

The logic programming language using priorities that corresponds best to our ap-proach is ordered choice logic programming (OCLP) introduced in Chapter 6 onpage 157. Although OCLP does not work with probabilities, these two systemshave a common approach to and a similar notion of alternatives, in the sense thatalternatives appear in the head of an applicable choice rule. OCLP also requiresthat this choice rule has a higher priority than the rule for which one computes

Page 314: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

300 CHAPTER 7. DOP-CLP

the head atoms’ alternatives. So, the main difference with our approach is theway that OCLP uses priority to create alternatives. Anotherimportant differencebetween the two systems is the defeating/competitor definition. For the orderedchoice logic program, the applied rules in the highest component are the onlyones that matter. For DOP-CLP, all rules are responsible forthe dynamic priorityof a rule. This makes it quite possible that two rules are equally preferred in anordered choice logic program but not in a corresponding DOP-CLP. This is alsothe reason why ordered logic programs [LV00] cannot be fullyrepresented in oursystem. Perhaps, in a number of situations, this is perhaps exactly what we want.When several alternatives are equally preferred, it is maybe for the best to takethat alternative which is also forced in other components.

Example7.4.1 For good investments it is important that your portfolio hasa widegeographical spreading. A few months ago you bought shares registered on thestock-market of Tokyo. They have been doing so well that you are considering toeither buy some more or to sell them to get the profit. Your bankrecommends tobuy some more. On the other hand, Japanese economy is experiencing difficulttimes. Another stock exchange expert advises you to sell them. All these sourcesare equally reliable, resulting in the following program:sell 1 e onomysell 1 expertexpert 0e onomy 0buy 0buy � sell 2When we consider this program to be an ordered choice logic program where thenumber represents the component to which the rule belongs, we have two stablemodels11:I = fexpert ; e onomy; sellg andJ = fexpert ; e onomy; buyg :As a DOP-CLP we obtain only a single crisp stable modelK:K(I) = 1 :Given the situation, the stable modelI is probably the best solution to the pro-blem: two out of three equally trusted sources advise you to sell your stocks.

11We just mention the positive part.

Page 315: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

7.4. RELATIONSHIPS TO OTHER APPROACHES 301

In subsection 6.7.3 on page 6.7.3 we discussed the relationship between OCLPand other systems using priorities or preferences. Since DOP-CLP uses the sameideas, most the relationships we mentioned in subsection 6.7.3 are also applicablefor the relationship with DOP-CLP. Only the transformationthat we described forDynamic Logic Programs ([AAP+98]) is no longer valid for the same reasons thatDOP-CLP cannot represent the OCLPs.

7.4.3 Uncertainty

A lot of researchers [Bac90, Ngo96, NS91, Poo92, Poo97] havetackled the pro-blem of bringing probabilities into logic programming. Theprobabilities used canbe divided into two categories depending on the type of knowledge symbolized:statistical or belief. [Bac90] concentrates on the first type while [Ngo96, Poo92,Poo97] are more interested in the latter. [NS91] is one of thefew that is able tohandle both types. Our formalism focuses mainly on knowledge of belief althoughit is possible to use statistical knowledge for defining the static priorities.

Another difference between the various systems is the way they introduce proba-bilities and handle conjunctions. For example, [NS91] works with probability in-tervals and then uses the rules of probability to compute theprobability of formu-lae. In this respect, we adopt the possible world/model theory of [Ngo96, Poo92].However, we introduce probabilities at the level of interpretations, while theyhard-code the alternatives by means of disjoint declarations together with prob-abilities, and the other atoms are computed by means of the minimal models ofthe logic program.

7.4.4 Games

In the previous chapters we already discussed extensively the relation betweenlogic programming and game theory in literature. Concerning mixed strategyNash equilibria of strategic games, the approach which is the most related to oursis the Independent Choice Logic of [Poo97]. [Poo97] uses (acyclic) logic pro-grams to deterministically model theconsequencesof choices made by agents.Since choices are external to the logic program, [Poo97] restricts the programsfurther, not only to be deterministic (i.e. each choice leads to a unique stablemodel) but also to be independent, in the sense that literalsrepresenting alterna-tives may not influence each other, e.g. they may not appear inthe head of rules.

Page 316: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

302 CHAPTER 7. DOP-CLP

ICL is further extended to reconstruct much of classical game theory and otherrelated fields. The main difference with our approach is thatwe do not go outsideof the realm of logic programming to recover the notion of equilibrium. The basisof this formalism does not contain probabilities but works with selector functionsover the hypotheses and then works with the (unique) stable model that comesfrom the program itself. This way one creates a possible world semantics. Ourtransformation makes sure that every atom is an alternativeof a choice/decisionfor which a probability can be computed.

7.5 Conclusions

In this chapter we introduced a new formalism for reasoning under uncertainty.We called our approach Dynamically Ordered Probabilistic Choice Logic Pro-gramming. As a generalization of choice logic programming it allows for cir-cumstance-dependent decision-making. Decisions need only to be made whena choice among them is forced by the situation at hand. Therefore it is possi-ble that two atoms are each other’s alternative in one interpretation and not inanother. In other words, they are defined dynamically. Our system is ordered be-cause each rule is given a static priority which represents the appreciation of theconsequence whenever the condition is fully satisfied. DOP-CLP allow a proba-bility distribution over the set of available alternatives. Doing this, it captures theuncertainty on the level of interpretations. The stable model semantics definedfor these programs represents all, possible infinite, rational solutions to the repre-sented decision-problem. Our formalism can be used in various domains wheredecisions under uncertainty are required. As an example, wedemonstrated thatDOP-CLP is an elegant and simple tool for the representationof strategic gamessuch that mixed strategy Nash equilibria can be obtained as the stable models ofthe corresponding program.

So far we were only interested in obtaining the solution of a represented decision-problem. Little interest was given to the interaction between the various decision-makers in order to come to a solution. In the next chapter, we introduce a frame-work for logic programming agents. This will allow us to monitor and to reasonabout the interaction between the participants in the decision-making process.

Page 317: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Chapter 8

Logic Programming Agents

In this chapter we are no longer satisfied with simply obtaining the solutions ofa represented decision-problem. Instead, we want to see howdecision-makersinteract with others and how they manage information in order to come to a con-clusion.

8.1 Introduction

In a time of internet and remote communications, software agents have becomeincreasingly popular. Each of these agents travels the web meeting other agentsfor the exchange knowledge necessary to solve the problem they were send outwith. These agents communicate with each other using a common language, butnone of them needs to know how the others handle the information they receiveand how they store their private knowledge and beliefs.

In previous chapters we were mainly interested in the representation of the decision-problem such that its solutions could be retrieved as the stable model or the answerset semantics. The decisions-makers themselves were of less importance. Oncethe program is written, it is almost impossible to distinguish the various decision-makers, let alone their personal information. All knowledge is public and readyto be used by all the participants. In this chapter, we present a framework forlogic programming agents [DVV01c, DVV01a] to monitor the interactions be-tween various decision-makers in order to come to a solution.

Each framework of logic programming agents consists of a number of agents con-

303

Page 318: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

304 CHAPTER 8. LOGIC PROGRAMMING AGENTS

nected by means of uni-directional communication channels. Each agent containsan ordered choice logic program representing her personal information and reaso-ning skills. One of the agents is considered to be the input agent, the agent whostarts the communication. This agent produces a stable model or answer set andputs it on her outgoing communication channel(s). All otheragents take infor-mation from their incoming channels and remove contradictive information. Thisinformation, together with the private information of the agent, will be used to cre-ate a new stable model or answer set which is then put on the outgoing channels.Communication ends when the output agent produces her stable model or answerset. This model is then considered to be the result of the interaction between theagents in the framework. Only when agents are connected in a loop, the situationis a bit different. Information should only leave the circlewhen all participatingagents have reached a consensus.

In previous chapters we always used game theory as a case study for the effec-tiveness of our formalisms. This chapter will not be different. We show that ex-tensive games with perfect information have a natural formulation as multi-agentsystems with a particularly simple information-flow structure between the agents.The answer set semantics of such a system is shown to coincidewith the game’sequilibria (Nash or subgame perfect, depending on the transformation used to con-struct the agents). Moreover, the fixpoint computation of a model closely mirrorsthe actual reasoning of a player in reaching her conclusion corresponding to anequilibrium.

The rest of this chapter is organized in the following way. InSection 8.2 weintroduce our frameworks for logic programming agents. Forthese frameworks,we define a stable model semantics and answer set semantics. In Section 8.3, wedemonstrate that extensive games can easily be representedas frameworks of logicprograms. This will be done in three phases, each phase making the player aspectmore explicit. In addition, we argue that the fixpoint computation of informationreflects the way players reason about each other.

8.2 Agents

In this section we introduce the basic notions concerning frameworks of logicprogramming agents.

The language used by our frameworks is identical to the one used by choice and

Page 319: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

8.2. AGENTS 305

semi-negative logic programming (Definitions 3.2.1 and 3.3.1).

The framework for logic programming agents which we are about to define givesa description of the communication structure of a population of agents. To modelthe reasoning skills of an agent, we use an ordered choice logic program (Chap-ter 6 on page 157). The agents are connected by means of uni-directional chan-nels. Therefore, an outgoing channel of one agent will be theincoming channelof another connected agent. So in a sense, a framework for logic programmingagents can be seen as a directed graph. To start the interaction between the agents,we assign one agent the role of input agent. This agent will bethe only agent al-lowed to have no incoming communication-channels. For communications to theoutside world, we need an output agent. As soon as all the agents stopped theirinteractions with each other, this output agent will returnthe result. Because of itsspecial role, this agent is allowed to have no outgoing communication channels.

Summarizing, a framework for logic programming agents is four-tuple contain-ing a set of participating agents, an input agent, an output agent and a relationspecifying the communication-lines.

Definition 8.2.1 A framework for logic programming agents, or FLPA, is a tuplehA; I; O; Ci with:� A: A set of agents represented by finite OCLPs:A = fhCA;�Aig;� I: The input agent, withI 2 A;� O: The output agent, withO 2 A;� C: The communication channels represented by an anti-reflexive relationC : A! 2A such that:

– 8A 2 (A n I) � 9B 2 A � A 2 C(B) ; and

– 8A 2 (A nO) � 9C � A; C 6= ; � C 2 C(A) .

We will use a more convenient graph-like notation in our examples.

Example8.2.1 Imagine the following situation. Two witnesses discover a bodylying in the park. The first witness tells the local police that she shaw hair nearthe victim and she did not see any blood. The second witness testifies that she

Page 320: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

306 CHAPTER 8. LOGIC PROGRAMMING AGENTS

blood bite marks FBI lassi�ed werewolfX �le hair ; bite markswerewolf X �le; hair ; bite marks

murder

X ellhair bloodwitness1 witness2

sheri�

Figure 8.1: The werewolf-killing of Example 8.2.1

shaw blood and that the victim had strange bite marks. The sheriff states that thissituation is a clear case of murder and passes the case to the FBI. Because of thestrange appearance of bite-marks and hair, the FBI passes the case to the specialX-cell. In addition, the FBI states that, if the X-cell reports that this is a case of awerewolf, the case should be classified. Given the evidence,the X-file team has nochoice then to decide that the killing was indeed done by a werewolf. This fantasyis represented by the FLPA depicted in Figure 8.1. The sheriff-agent will be usedas the input agent while the FBI is considered to be the outputagent.

The Herbrand base of a FLPA is the union of all the Herbrand bases of the orderedchoice logic programs used by the agents.

Definition 8.2.2 Let F be an FLPAhA; I; O; Ci. TheHerbrand baseof F , de-notedBF , equals: BF = [A2ABA :

Page 321: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

8.2. AGENTS 307

The interaction between the agents can be monitored by meansof the informa-tion each agent sends to her connecting agents. This can be seen as giving theframework a basic semantics, like an interpretation for a logic program.

Definition 8.2.3 LetF be a FLPAhA; I; O; Ci. An interaction profilefor F is afunctionS : A! BF [ not BF .

The setS(A) can be seen as the information agentA sends on its outgoing chan-nels to its connecting agents.

Definition 8.2.4 LetF be a FLPAhA; I; O; Ci, letA be an agents ofF and letSbe an interaction profile forP . TheoutputA, denotedOutS(A) equals:OutS(A) = S(A) :Theinput ofA, denotedInAS , equals:InAS = [B2A:A2C(B) S(B) :Example8.2.2 Consider the Werewolf FLPA of Example 8.2.1. LetS1 andS2 betwo functions such that:S1(sheri� ) = fmurdergS1(witness1) = fhair ; not bloodgS1(witness2) = fblood ; not bite marksgS1(FBI ) = fhair ; bite marksgS1(X ell) = fwerewolf gS2(sheri� ) = fmurdergS2(witness1) = fmurder ; hair ; not bloodgS2(witness2) = fmathitmurder; blood ; not bite marksgS2(FBI ) = fmurder ; hair ; bite marks;werewolf :X �le; lassi�edgS2(X ell) = fmurder ; hair ; bite marks;werewolf ;X �le; lassi�edgThe two functionsS1 andS2 are two interaction profiles for the Werewolf FLPA.The input of agentFBI w.r.t. S1 equals:InFBIS1 = fhair ; not blood ; blood ; not bite marksg :The output produced by theX ell -agent w.r.t.S2 equals:OutS2(X ell) = fmurder ; hair ; bite marks;werewolf :X �le; lassi�edg :

Page 322: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

308 CHAPTER 8. LOGIC PROGRAMMING AGENTS

In this phase, little has done with the information an agent receives on its inputchannels. To respond correctly to the given information, anagent should firstremove any inconsistent information that she receives fromother agents. Then,the positive information can be used in combination with herown knowledge.

Definition 8.2.5 LetF be a FLPAhA; I; O; Ci, letA be an agent ofF and letSbe an interaction profile. Thefiltered input of agentA equals:InfS(A) = InA;+S n (InA;+S \ InA;�S ) :As soon as the information is filtered, she can use it togetherwith her own pri-vate knowledge and reasoning skills to generate new information that can be dis-tributed. Of course an agent should consider the information she can derive tobe more accurate than the information she receives from others - the “everythingis better if you do it yourself”-principle. Since agents areordered choice logicprograms this is not very difficult to do. One simply adds an extra componentcontaining the positive conflict-free information the agent gathers from the oth-ers. This component should be considered to be the least specific component inthe newly created OCLP. This will enable agents to overrule or defeat the giveninformation when necessary.

Definition 8.2.6 LetA = hCA;�Ai be an agent of a FLPAF = hA; I; O; Ci andlet S be an interaction profile. Theupdated versionof A w.r.t. a set of atomsU � BF denotedAU , is the OCLPhCA [ fPg;�AU i with:� 8a 2 U � a 2 P ; and� 8C 2 CA � P �AU C; and� 8C1; C2 2 CA � C1 �A C2 ) C1 �AU C2 .

This updated version can then be used to produce relevant information for theother agents.

Example8.2.3 Reconsider the Werewolf FLPA of Example 8.2.1 and its inter-action profileS1 defined in Example 8.2.1. The filtered input of theFBI -agentequals: InfS1(FBI ) = fhairg :With this information we obtain the updated version of agentFBI , which is de-

noted asFBI InfS1(FBI ), as displayed in Figure 8.2.

Page 323: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

8.2. AGENTS 309

FBI InfS1(FBI ) X �le hair ; bite marks lassi�ed werewolfhair Figure 8.2: The updated version of theFBI from the Example 8.2.3

When all agents follow the same strategy, the interaction profiles will be moremeaningful and correct.

Definition 8.2.7 LetF be a FLPAhA; I; O; Ci. An interaction profileI is calledmodel profilewhen:8A 2 A �OutA( )is a stable model ofAInfS(A) :I is called ac-model profileiff:8A 2 A �OutA( )is an answer set ofAInfS(A) :A setM 2 BF [ not BF is a (c)-modelof F iff a (c-)model profileI exists suchthatM = Out I(O).Example8.2.4 Reconsider the Werewolf FLPA of Example 8.2.1 and its interac-tion profilesS1 andS2 of Example 8.2.2. Given the updated version of agentFBIw.r.t. InfS1(FBI ) given in Example 8.2.3, it is easy to see thatS1 is not a modelnor c-model profile. The setS1(FBA) = fhair ; not bite marksg is not even atotal interpretation let alone a stable model or answer set.The interaction profileS2 on the other hand, is both a model and c-model profile.This makes thatOutS2(FBI ) = fmurder ; hair ; bite marks;werewolf ;X �le; lassi�edg is a (c-)model of the framework.

Notice, in the above example, that a model for a framework of logic programmingagents does not necessary assign a truth value to every atom in the Herbrand base.This is reasonable since a model should reflect a consensus reached by all agents.Atoms which are neither true or false indicate the bits of information on whichagents do not agree.

Page 324: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

310 CHAPTER 8. LOGIC PROGRAMMING AGENTS

zombi � vampire dead ;walking hild2 dead zombiwalking zombiwalking vampiredead vampire hild1

Figure 8.3: The imagination FLPA of Example 8.2.5

For frameworks without cycles the model semantics will generate the rational so-lutions to the represented decision-problems. The next example demonstrates thatprograms which do have cycles sustain models that contain too much information.Assumptions made by one agent may become justified by anotheragent.

Example8.2.5 Two children have been listening to a scary bed-time story aboutvampires and zombies. Suddenly they think something moved in their room andthey start fantasizing about the story they just heard. The first child tells that,in order to have a real zombie or vampire, the creature shouldbe dead and bewalking around. She also claims that creatures which are both a vampire anda zombie do not exist. The second child agrees that vampires and zombies aredeath but are still able to walk around. This situation is represented by the FLPAin Figure 8.3 with the hild1 -agent as the output agent. This FLPA has three(c-)models:

1. M1 = fnot vampire; not zombi ; not walking; not deadg, and

2. M2 = fzombi ;walking; dead ; not vampireg ; and

3. M3 = fvampire;walking; dead ; not zombig .

The last two (c-)models are not realistic, since the children are just fantasizing.

To overcome this we introduce the notion of a sub-framework.A set of agents thatall belong to the same cycle are cut from the framework. Each agent is updated

Page 325: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

8.2. AGENTS 311dead zombiwalking zombiwalking vampiredead vampirezombi � vampire dead ;walking

hild2 hild1

Figure 8.4: A sub-framework for the FLPA of Example 8.2.5

with information coming from outside the cycle. Information from within thecycle will only be used to remove inconsistencies. Afterwards, the cycle is broken.

Definition 8.2.8 Let S be an interaction profile for a FLPAF = hA; I; O; Ci.LetD � A be a set of agents connected by means of a cycle. Thesub-frameworkof F w.r.t. S andD is the FLPAhD0; I 0; O0; C 0i with:� 8D 2 D �DM 2 D0 withM = InfS(D) nSD02DOutS(D0) ; and� I 0 2 D0 ; and� O0 2 D0 such thatI 0 2 C(O0); and� C 0 is the functionC reduced toD except thatC(O0) = (C(O0) \D) n I 0 .

Notice that a sub-framework chooses a random input agent from the set of avai-lable agents. The output agent is set to be the agent in the cycle that is connectedto this input agent by means of an output channel. The links connecting the agentsin the cycle are maintained except for the link between the new input and outputagent.

Example8.2.6 A sub-framework for the imagination FLPA of Example 8.2.5 isdepicted in Figure 8.2.6. The hild2 agents is the input agent while hild1 is theoutput agent.

Page 326: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

312 CHAPTER 8. LOGIC PROGRAMMING AGENTS

For such sub-framework we can compute a model or c-model. Using this resultto update the input agents for the following computation, weobtain, after a finiteamount of time1 either a fixpoint or a previous model or c-model.

Definition 8.2.9 Let F = hA; I; O; Ci be a sub-framework of a FLPAP w.r.t.an interaction profileS and a set of agentsD � A. A interaction profileS! isa (c)-cycle fixpointof F iff a sequencefS1; : : : ; Sng of (c-)model profiles for thesequencefF1; : : : ; Fng withFi = hAi; Ii; Oi; Ci exists such that:� F1 = F ,� Ai+1 = (Ai n I) [ IOutSi(Oi)i ,� Ii+1 = IOutSi(Oi)i ,� Fn�1 = Fn , and� S! = Sn .

We say thatS inducesa (c-)cycle fixpointS! w.r.t. D iff 8D 2 D holds thatS(D) = S!(D0) withD0 the corresponding agent in the sub-framework.

Such a fixpoint strategy corresponds to the way decision-makers try to get a feel-ing about the other participants. The process of reaching a cycle fixpoint is tryingto get an answer to the question “if I do this and how would the others react to it”and try to establish a compromise.

Example8.2.7 Consider the Werewolf FLPA of Example 8.2.1 and the interactionprofileS2 described in Example 8.2.2. The interaction profileS!:S!(FBI 3) = fmurder ;X � �le; lassi�ed; hair ; bite marks;werewolf gS!(X ell3) = fmurder ;X � �le; lassi�ed; hair ; bite marks;werewolf gis a (c-)cycle fixpoint of the sub-frameworkF1 displayed in Figure 8.5 withFBI 1the input agent andX ell the output agent. The sequencefS1; S2; S3; S!g of

1We work with finite OCLP to represent our agents

Page 327: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

8.2. AGENTS 313

werewolf X �le; hair ; bite marksX ell2werewolf X �le; hair ; bite marksX ell3

hair werewolf X �le; hair ; bite marksX ell1 X �le hair ; bite marks lassi�ed werewolfmurder blood FBI 1 blood X �le hair ; bite marks lassi�ed werewolfFBI 2 hair murder X � �le werewolf

blood X �le hair ; bite marks lassi�ed werewolfhair X � �le werewolf murder lassi�ed FBI3

F1 F2F3

Figure 8.5: Sub-framework sequence of Example 8.2.7

(c-)models with:S1(FBI 1) = fmurder ;X � �le; hair ; bite marksgS1(X ell1) = fmurder ;X � �le; hair ; bite marks;werewolf gS2(FBI 2) = fmurder ;X � �le; hair ; bite marks;werewolf ; lassi�edgS2(X ell2) = fmurder ;X � �le; hair ; bite marks; lassi�ed ;werewolf gS3 = S!:is generated by the sequence of FLPA’s:fF1; F2; F3; F3g :Thus, we can say thatS2 induces a (c-)cycle fixpointS! w.r.t. fFBI ;X � ellgThe vampire-zombie FLPA of Example 8.2.5 has only one (c-)cycle fixpointS!w.r.t. f hild1; hild2g, no matter which interaction profile is used, namely:S!( hild1) = fnot zombie; not vampire; not walking; not deadgS!( hild2) = fnot zombie; not vampire; not walking; not deadg :

Page 328: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

314 CHAPTER 8. LOGIC PROGRAMMING AGENTSharpy �minotaur her ulesmortal harpy minotaur

Figure 8.6: The Hercules FLPA of Example 8.2.9

When we demand that a (c-)model induces a (c)-cycle fixpoint for every cyclein the framework, we obtain exactly the rational solutions to the represented pro-blem. Depending on the reasoning strategies that the agentsuse, we obtain thestable models or answer sets of the framework.

Definition 8.2.10 LetF = hA; I; O; Ci be a FLPA.A model profileS is calledstablewhenS induces a cycle fixpoint on every cyclein the framework.An c-model profileS is calledanswer profileiff S induces a c-cycle fixpoint onevery cycle in the framework.A setM � BF [ not BF is a stable modelof F iff a stable profileS exists suchthatM = OutS(O).An answer setof F is a setM � BF [ not BF such that an answer profileSexists withM = OutS(O).Example8.2.8 When we look back at the Werewolf Example 8.2.1, we see thatthe interaction profileS2 of Example 8.2.2 is the only stable profile of the FLPA.It is also an answer profile. This makes that:M = fmurder ;X � �le; hair ; bite marks; lassi�ed ;werewolf gis the single stable model and answer set of the FLPA.

The Vampire-Zombie FLPA has also a single stable model and answer set:N = fnot zombie; not vampire; not walking; not deadg :

Page 329: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

8.2. AGENTS 315A1A2ghost poltergheist � demon ghost � poltergheist ghost � demon

Figure 8.7: The ghost FLPA of Example 8.2.10

The following example demonstrates that not every framework admits a stablemodel. In addition the choice of the output agents has an effect on the semanticseven when the agents are connected in a cycle. In other words,agents in a cyclecan agree to disagree.

Example8.2.9 Consider the FLPA of Figure 8.6 describing the difference be-tween Hercules and a normal mortal. This framework does not admit a stablemodel. Both agents differ too much to reach a compromise: themortal can-not make a choice between both evils while Hercules can easily beat the bothof them. This framework admits different answers sets depending on the out-put agent. Whenher ules is the output agent, we havefminotaur ; harpyg isthe answer while, whenmortal is set to be the output agents, we have that bothfminotaur ; not harpyg andfnotminotaur ; harpyg are answer sets.

The next example explains why we defined (c-)cycle fixpoints instead of demand-ing that the output of the framework ought to be minimal.

Example8.2.10 The FLPA depicted in Figure 8.7 models the interaction betweentwo exorcists. This framework has a number of answer sets, among them are:M1 = fghost; not poltergheist ; not demong ; andM2 = fghost; poltergheist ; not demong :Clearly,M2 is not minimal.

Page 330: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

316 CHAPTER 8. LOGIC PROGRAMMING AGENTSA1 oskorei oskorei � fossegrim fossegrim A2 oskorei � fossegrim fossegrim Figure 8.8: The Norwegian mythology FLPA of Example 8.2.11

At first it may seem that ordered choice logic programs can been seen as a frame-work for logic programming agents where each component is treated as an agent.However, this is not true, as the following example demonstrates.

Example8.2.11 The Norwegian mythology and legends are crowed by strangeand fearless creatures. One group of them are called the Oskorei. It is a bunch ofteasers lead by a female. They ride through the air on wild horses and are noto-rious for stealing beer and kidnapping people that are neverseen again. A morecheerful spirit is the Fossegrim who teaches people to play the violin in return ofpayment. When he plays everyone is forced to dance. The OCLP depicted on theleft hand side of Figure 8.8 represents a situation in which one you have to choosewhich of the two creatures you like the most. This OCLP has onestable set whichis also an answer set, namely:M = ffossegrim; not oskoreig :On the right side of Figure 8.8, an FLPA is shown with each agent representinga component of the OCLP. Whether or not you connect them usinga cycle, weobtain a single outcome (stable model and answer set):N = ffossegrim; oskoreig :This certainly does not match the intuition behind the situation.

The reason for this failure is privacy of knowledge and reasoning capabilities ofthe various agents: an agent does not need to know which atomsare consideredalternatives by an other agent.

Of course, OCLPs can be represented as a framework containing a single agent.In this sense, FLPA are indeed an extension of OCLP.

Page 331: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

8.3. PLAYING GAMES 317

8.3 Playing Games

In this section we demonstrate that extensive games with perfect information havea natural formulation as multi-agent systems with a particularly simple information-flow structure between the agents.

8.3.1 Phase 1: OCLPs Representing Games

In Chapter 6 Section 6.6.1 on page 237, we demonstrated2 that a finite extensivegame with perfect information can easily be transformed into an OCLP in such away that either the Nash equilibria or the subgame perfect equilibria of the gamecorrespond with the answer sets of the program.

The main idea behind the transformationsPn andPs, Definition 6.6.1 and Defi-nition 6.6.2 on pages 238 and pages 244, is the set of components consisting of acomponent responsible for all the decisions that need to be considered and a com-ponent for each payoff appearing in the game. The order amongthe components isestablished according to the payoff they represent (i.e higher payoffs correspondto more specific components) with the decision component at the bottom of the hi-erarchy (i.e. the most specific component). The rules in the payoff component areconstructed by decomposing the terminal histories. The rule is placed in the com-ponent corresponding to the payoff the agent to which the head actions belongswould receive for the decomposed terminal history. Since Nash equilibria do nottake into account the sequential structure of the game, players have to decide upontheir strategy before starting the game, leaving them to reason about both past andfuture. This is reflected in the rules: all actions taken by the other players in orderto reach this the represented terminal history have to be mentioned in the body. Inorder to obtain the Nash equilibria, it suffices to mention only those actions thatstill need to be considered when the agent from the head atom has announced herdecision.

Example8.3.1 Roman mythology is filled with stories about scary monsters.Medusa,a cruel female creature with snakes coming out of her head instead of hair, Cer-berus, the fierce dog-like guard of the underworld, cyclopses, one-eyed giants withan appetite for humans and titans, the giant-like enemies ofthe Olympic gods, arejust some examples. Although you certainly do not want to meet during a dark

2Theorems 6.6.1 and 6.6.2 on page 239 and 245.

Page 332: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

318 CHAPTER 8. LOGIC PROGRAMMING AGENTSb����� HHHHH1male medusar r(4; 2)r����� HHHHH2humanoid erberusr r(4; 3)r���� HHHH1 y lops titanr(3; 3) r(2; 2)Figure 8.9: The Roman Mythology game of Example 8.3.1

night, or in broad day light for that matter, you can feel somekind of sympathy forthem. The extensive game with perfect information shown in Figure 8.9 modelsa situation in which two people try to choose a Roman myth. This game has sixNash equilibria:ffmedusa; y lopsg; fhumanoidgg; ffmedusa; titang; fhumanoidgg;ffmedusa; y lopsg; f erberusgg; ffmedusa; titang; f erberusgg;ffmale; y lopsg; f erberusgg; ffmale; titang; f erberusgg :Three of these Nash equilibria are also subgame perfect equilibria:ffmedusa; y lopsg; fhumanoidgg; ffmedusa; y lopsg; f erberusgg;ffmale; y lopsg; f erberusgg :Figure 8.10 displays the corresponding OCLPsPn of Ps. It is easy to see thatPnhas six answer sets which coincide with the Nash equilibria of the game. The setof subgame perfect equilibria corresponds to the set of answer sets ofPs.Examining at Figure 8.10 one notices that all information concerning players istotally lost during the transformation process. The structure of the game is brokenapart but is still, with lots of effort, retrievable from theprograms. In the next twosubsections we will focus on bringing the players into the program structure, firstin a single OCLP and afterwards in a framework where each agent represents aplayer of the game.

8.3.2 Phase 2: Player Based OCLPs

It is fairly simple to adaptPn andPs to take into account the player structure.Instead of having a payoff component for every payoff in the game, we introduce

Page 333: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

8.3. PLAYING GAMES 319

male erberus y lops humanoid erberus malemale humanoidhumanoid male ; y lopstitan humanoidmale humanoidhumanoid male ; titanmale �medusa humanoid � erberus y lops � titan medusa PnCtC4C3C2

CtC4C3C2Ps medusa male erberusmale �medusa humanoid � erberus y lops � titan

male humanoidhumanoid titantitan erberus malemale humanoidhumanoid y lops y lops Figure 8.10: The Roman Mythology OCLPs of Example 8.3.1

payoff components corresponding to the distinct payoffs ofeach player (e.g. iftwo playersi andj have a payoff 0 then we now have two componentsCi0 andCj0instead of the single componentC0). Rules made out of a terminal history are nowput in the component corresponding to the player taking the associated decisionand her perceived payoff. The decision component is no longer necessary as weput the decision rule(s) of a player in the component with thehighest payoff cor-responding to this player. The order among the components isestablished, firstamong components of the same player, according to their payoff (lower payoffis more general) and, secondly, according to the structure of the game (the firstdeciding player is less specific). The transformation for obtaining the Nash equi-libria is denoted asP pn , whileP ps is used to obtain the subgame perfect equilibria.

Definition 8.3.1 Let hN;H; P; (<i)i2Ni be a finite extensive game with perfectinformation. The corresponding OCLPP pn can be constructed in the followingway:� C = fCiu j 9h 2 Z � u = Ui(h)g ;� 8Ciu; Cjw 2 C � Ciu � Cjw iff i > j ;� 8Ciu; Ciw 2 C � Ciu � Ciw iff u > w ;� 8h 2 (H n Z) � (A(h) ) 2 Ciw; P (h) = i; 8Cin; n 6= w � Ciw � Cin ;

Page 334: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

320 CHAPTER 8. LOGIC PROGRAMMING AGENTS

erberus malehumanoid male ; y lopshumanoid � erberus humanoid male ; titanmale erberusmedusa male �medusa y lops � titan titan humanoidmale humanoidmale humanoid y lops humanoidC12C13C14C22C23 P pn

male humanoidtitan y lops male humanoidmale erberusmedusa male �medusa y lops � titan erberus malehumanoid � erberus humanoid titanhumanoid y lops

C12C13C14C22C23 P psFigure 8.11: The Roman Mythology OCLPs of Example 8.3.2� 8h = h1ah2 2 Z � a B 2 Ciu with P (h1) = i;B = fb 2 [h℄ j h = h3bh4; P (h3) 6= ig and u = UP (h1)(h) .

The corresponding OCLPP ps can be constructed as follows:� C = fCiu j 9h 2 Z � u = Ui(h)g ;� 8Ciu; Cjw 2 C � Ciu � Cjw iff i > j ;� 8Ciu; Ciw 2 C � Ciu � Ciw iff u > w ;� 8h 2 (H n Z) � (A(h) ) 2 Ciw; i = P (i); 8Cin; n 6= w � Ciw � Cin ;� 8h = h1ah2 2 Z � (a B) 2 Ciu with P (h1) = i;B = fb 2 [h2℄ j h = h3bh4; P (h3) 6= ig andu = UP (h1)(h) .

The next example illustrates the proposed transformations.

Example8.3.2 Reconsider the Roman mythology extensive game with perfectin-formation. Its corresponding OCLPP pn andP ps , according to Definition 8.3.1,are depicted in Figure 8.11. Notice that the answer sets ofP pn match the Nashequilibria of the game, while the answer sets ofP ps supply us with the subgameperfect equilibria.

Page 335: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

8.3. PLAYING GAMES 321

Theorem 8.3.1 Let hN;H; P; (<i)i2Ni be a finite extensive game with perfect in-formation and letP pn andP ps be its corresponding OCLPs. Then,s� is a Nashequilibrium (resp. subgame perfect equilibrium) forhN;H; P; (<i)i2N i iff s� is astable model forP pn (resp.P ps ).

Proof: The programsP pn andP pn are constructed in such a way that the relativeorder between the components of two rules with in their headsalternatives is thesame as inPp andPs. The only difference that we need to look into is the presenceof choice rules in the most specific component of each player.With the construc-tion of the programsP pn andP ps and the c-defeating strategy, we know that sucha choice rule can only be c-defeated when more than one alternative is forcedand decided on in the same component as the choice rule. When we compute thereduct in this case, we obtain that every rule containing an alternative generated bythe choice rule has been deleted, including the choice rule itself. This means thata stable model of this reduct can never contain any of these alternatives, whichmakes that the interpretation at hand can never be considered an answer set. Thisimplies that every answer set contains exactly one action for each decision someagents has to make. Thus, answer sets ofP pn andP ps are strategy profiles. Withthis in mind, we have that our proof is the same as the proofs for demonstratingthat answer sets ofPn andPs coincide with respectively the Nash equilibria andsubgame perfect equilibria of the represented game. (Theorems 6.6.1 and 6.6.2 onpage 239 and 245). 28.3.3 Phase 3: Multi-agent Systems

In the previous subsection, we have demonstrated that extensive games with per-fect information can be represented using OCLPs such that relevant player in-formation is maintained. For each agent, all information concerning her deci-sions was stored in components used exclusively for this player. These groups ofcomponents were related with each other according to the structure of the game.When we consider that each of these groups of components is anagents, we ob-tain a framework for logic programming agents. The communication between theagents is cycle-based. The player which makes the first decision in the game willbe used as both input and output agent.

Definition 8.3.2 Let hN;H; P; (<i)i2Ni be a finite extensive game with perfectinformation. The corresponding FLPASn = hfAig; A1; A1; Ci with i 2 N : can

Page 336: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

322 CHAPTER 8. LOGIC PROGRAMMING AGENTS

be constructed in the following way:� CAi = fCiu j 9h 2 Z � u = Ui(h)g ;� 8Ciu; Ciw 2 CAi � Ciu � Ciw iff u > w ;� 8h 2 (H n Z); P (h) = i � (A(h) ) 2 Ciw; 8Cin; n 6= w � Ciw � Cin ;� 8h = h1ah2 2 Z; P (h1) = i � a B 2 Ciu withB = fb 2 [h℄ j h = h3bh4; P (h3) 6= ig and u = UP (h1)(h) ,� C(Ai) = fAi+1g for i 2 N; i < maxN ,� C(AmaxN) = fA1g .

The corresponding FLPASs = hfAig; A1; A1; Ci with i 2 N :� CAi = fCiu j 9h 2 Z � u = Ui(h)g ;� 8Ciu; Ciw 2 CAi � Ciu � Ciw iff u > w ;� 8h 2 (H n Z); P (h) = i � (A(h) ) 2 Ciw; 8Cin; n 6= w � Ciw � Cin ;� 8h = h1ah2 2 Z; P (h1) = 1 � (a B) 2 Ciu withB = fb 2 [h2℄ j h = h3bh4; P (h3) 6= ig andu = UP (h1)(h) ,� C(Ai) = fAi+1g for i 2 N; i < maxN ,� C(AmaxN) = fA1g .

Example8.3.3 Consider once more the Roman mythology game from Example 8.3.1.The corresponding FLPAsSn andSs are displayed in Figure 8.12. Notice that theanswer sets forSn match exactly the Nash equilibria of the game, while the sub-game perfect equilibria can be retrieved using the answer sets ofSs.In the next theorem we demonstrate that the correspondence between the equilib-ria and answer sets in the previous example is not coincidence.

Page 337: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

8.3. PLAYING GAMES 323

male humanoidtitan y lops male humanoidmale erberusmedusa male �medusa y lops � titan C12C13C14

erberus malehumanoid � erberus humanoid titanhumanoid y lopsC22C23A2A1

Ssmale erberusmedusa male �medusa y lops � titan titan humanoidmale humanoidmale humanoid y lops humanoidC12C13C14 erberus malehumanoid male; y lopshumanoid � erberus humanoid male; titanC22C23

A1A2

SnFigure 8.12: The Roman Mythology FLPAs of Example 8.3.3

Theorem 8.3.2 Let hN;H; P; (<i)i2Ni be a finite extensive game with perfect in-formation and letSn andSs be the corresponding FLPAs, according to Defini-tion 8.3.2. Then,s� is a Nash equilibrium (resp. subgame perfect equilibrium) forhN;H; P; (<i)i2N i iff s� is an answer set forSn (resp.Ss).Proof: The construction of framework makes sure that a decision made by oneagent is accepted by all the others. The reason for this is that atoms are consideredto be alternatives by one agent only appear in the head of a rule of just this agent.With this in mind it is easy to see every agent has the same output in c-modelprofile and that the c-models of(Sn) (resp.Ss) coincide with the answer sets ofP pn (resp.P ns ). In theorem 8.3.1, we demonstrated that the set of answer sets ofP pn (resp.P ps ) equals the set of Nash equilibria (resp. subgame perfect equilibria)of the represented game. Now, it remains to shown that every c-model profile withc-modelM of Sn (resp.Ss) induces a c-cycle fixpoint w.r.t. the set of agents. LetF1 be the sub-framework withA1 the input agent andAmaxN the output agent.

Page 338: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

324 CHAPTER 8. LOGIC PROGRAMMING AGENTS

Let fP1; P2; P2g be a sequence of interaction profiles3 with:P1(A1) = M \ A1 ;P1(Ai) = P1(Ai�1) [ (M \ Ai�1) with i 2 N; i > 1 ;P2(Ai) = M with i 2 N ;It is not hard to verify, thatfP1; P2; P2g can be used to create a sequence of FLPAsfF1; F2; F2g such thatP2 is a c-cycle fixpoint. So, we may conclude that every an-swer set ofSn (resp.Ss) is a Nash equilibrium (resp. subgame perfect equilibriumand vice versa. 2For the proof of the above theorem, we demonstrated that every c-cycle fixpointcan be constructed in two iterations. Of course, this only happens when playersor agents know which actions will lead to an equilibrium state. In practice, itmight take more iterations in order to find a c-cycle fixpoint.For Ss we need atmost a number of iterations equal to the height of the tree representing the game.For Nash equilibria this depends on the number of actions theplayers can choosefrom. Such a fixpoint computation can easily be seen as the input player trying toobtain actions belonging to an equilibrium state. At first, she picks an action andsees how the other players respond to this. With this information she can updateher actions. This process is carried on until a equilibrium is reached.

8.4 Relationship with Other Approaches

Some research has already been done in the area of agents and games, althoughwith different viewpoints. For example, [RZ94] investigates methods to preventagents exploiting game theoretic properties of negotiations. The topic of [Bir99] isthe evolution of cooperation in N-player iterated prisoner’s dilemma and how thisprocess can be speeded up. [Poo97] incorporates the playersof the game directlyinto its logic programming formalism for strategic games inorder to obtain mixedstrategy Nash equilibria. We, on the other hand, are interested in multi-agentsystems that are able to represent, in an intuitive way, games such that agentscorrespond with players and models with the equilibria.

3We useAi to denote the set of all possible actions playeri can choose from.Ai�faj9h 2 H �a 2 A(h)g.

Page 339: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

8.5. CONCLUSIONS 325

8.5 Conclusions

In this chapter we proposed a framework of logic programmingagents whichallows us to monitor the communication between the decision-makers in orderto come to a conclusion. The (c-)model semantics of the framework is definedas the output generated by the output agent when all the agents in the systemcommunicate with each other using either stable models or answer sets. We ar-gued that this semantics is only sufficient when the framework does not have anycommunication-loops. When cycles do appear, it is important that informationleaving the cycle can be constructed using a communication fixpoint: informationfrom the output agent of the sub-framework constructed frombreaking the cycle isgiven as extra information to the input agent in a next iteration until the output nolonger changes. The stable model semantics and answer semantics for such sys-tems are those (c-)models that induce a fixpoint for every loop in the framework.Furthermore, we demonstrated that extensive games with perfect information havean elegant and natural formalization as a framework of logicprogramming agents.The Nash equilibria and subgame perfect equilibria can be obtained as the answersets of the corresponding framework. In addition, the fixpoint computation reflectsthe way players reason in order to make a decision belonging to an equilibriumstate.

Page 340: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

326 CHAPTER 8. LOGIC PROGRAMMING AGENTS

Page 341: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Chapter 9

Conclusions and Directions forFuture Research

9.1 General Conclusions

This dissertation has successfully demonstrated that logic programming is an ele-gant paradigm for modeling decision-problems in such a way that the semantics ofthe program corresponds to the solutions of the representedproblem (Figure 1.1)

To demonstrate the effectiveness of our formalisms, we usedgame theory as atest-case, showing that e.g. strategic games and extensivegames with perfectinformation can be effectively represented. Moreover, ourformalisms can be usedto represent more complex games where, e.g. players are allowed to take morethan one action or no action at all.

9.2 Further Research

Although logic programming has shown itself to be a convenient representationallanguage for decision-problems, we only covered a number ofthe aspects of thedecision-making process.

The extensions that we proposed were all based on the assumption of rationalityand the fairness of the decision-makers. None of the decision-makers had a hiddenagenda or would deliberately deceive the other agents. To model such aspects of

327

Page 342: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

328 CHAPTER 9. CONCLUSIONS AND FUTURE RESEARCH

decision-making, we need to add some epistemic primitives to the formalism suchthat agents can reason about the other decision-makers in more detail.

An extension along the same line is information hiding by agents. The frameworkfor logic programming agents assumes that every agent is willing to share all herinformation, in the form of a model, with the connected agents, meaning thatonly the reasoning capabilities are hidden. There are situations in which this isnot the best way to go. For example, conclusions from classified information mayperhaps be made public while the information itself should remain hidden. Addingsuch capabilities to the existing framework should not posetoo many difficulties.A possibility would be to extend the function for defining thecommunicationchannels between the agents with an extra argument, which could work as a kindof filter. Another aspect of decision-making that still needs to be considered iscooperation between several decision-makers.

With respect to game theory, we looked into a number of different games and equi-libria, still, there are interesting games and equilibria left that need to be looked at.We believe that some of these games and equilibria can be represented or retrievedusing the formalisms and the semantics presented in this dissertation. Extensivegames with perfect information and chance moves, and extensive games with im-perfect information are two examples which we should able tosupport.

The main theme of this dissertation was to model decision-making, and morespecific game theory, in a logic programming environment. Therefore, interestingquestions concerning the ability of logic programming to derive convenient gametheoretic notions are left unanswered. We feel confident, supported by the notionof cautious equilibria, that there may indeed appear a positive influence of logicprogramming on game theory.

For choice logic programming and ordered choice logic programming, we pro-posed an algorithm to compute the semantics of these programs. The same al-gorithms can be used to retrieve equilibria of the represented games. However,the computation was designed to be general purpose while theprograms obtainedfrom a game have a special format. This format should be used to our advantagein order to improve the efficiency of equilibria retrieval.

The results presented in this dissertation are mainly theoretical. Future plans in-volve putting this theory into practice. We consider using the expertise obtainedfrom answer sets solvers, like dlv [ELM+98] and smodels [NS97]. The currentidea is to build a layer on top of one of these systems, containing the specific rea-soning capabilities needed for our formalisms. For the moment, smodels seems

Page 343: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

9.2. FURTHER RESEARCH 329

to be the best candidate since the system already contains primitives to expresspriority and exclusive choice.

Page 344: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

330 CHAPTER 9. CONCLUSIONS AND FUTURE RESEARCH

Page 345: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Bibliography

[AAP+98] Jose Julio Alferes, Leite J. A., Luıs Moniz Pereira, Halina Przymusin-ska, and Teodor C. Przymusinski. Dynamic logic programming. InCohn et al. [CSS98], pages 98–111.

[Abr92] Samson Abramsky. Games and full completeness for multiplicativelinear logic (extended abstract).Lecture Notes in Computer Science,652:291–??, 1992.

[AO93] Samson Abramsky and C.-H. L. Ong. Full abstraction inthe lazylambda calculus. Information and Computation, 105(2):159–276,1993.

[AP00] Jose Julio Alferes and Luıs Moniz Pereira. Updates plus preferences.In JELIA 2000 [JEL00], pages 345–360.

[Axe84] Robert Axelrod.The Evolution of Co-operation. Basic Books, Inc,1984.

[Bac90] Fahiem Bacchus.LP, a Logic for Representing and Reasoning withStatistical Knowledge.Computational Intelligence, 6:209–231, 1990.

[BB] Pierpaolo Battigalli and Giacomo Bonanno. Recent results on belief,knowledge and the epistemic foundations of game theory. workingpaper.

[BE99] Gerhard Brewka and Thomas Eiter. Preferred answer sets for ex-tended logic programs.Artificial Intelligence, 109(1-2):297–356,April 1999.

[BFL99] Francesco Buccafurri, Wolfgang Faber, and Nicola Leone. Disjunc-tive Logic Programs with Inheritance. In Danny De Schreye, editor,

331

Page 346: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

332 BIBLIOGRAPHY

International Conference on Logic Programming (ICLP), pages 79–93, Las Cruces, New Mexico, USA, 1999. The MIT Press.

[Bir99] Andreas Birk. Trust in an N-Player Iterated Prisoner’s Dilemma. InAgents’99 WC on trust, 1999.

[Bla92] Andreas Blass. A Game Semantics for Linear Logic.Annals of Pureand Applied Logic, 56(1–3):183–220, April 1992.

[BLR98] Francesco Buccafurri, Nicola Leone, and Pasquale Rullo. Disjunctiveordered logic: Semantics and expressiveness. In Cohn et al.[CSS98],pages 418–431.

[Bon92] Giacomo Bonanno. The Logical Representation of Extensive Games.International Journal of Game Theory, 22:153–169, 1992.

[Bon98] Giacomo Bonanno. Braching time logic, perfect information gamesand backward induction. In LOFT3 [LOF98].

[Bre94] Gerhardt Brewka. Reasoning about priorities in default logic. InBarbara Hayes-Roth and Richard Korf, editors,Proceedings of theTwelfth National Conference on Artificial Intelligence, pages 940–945, Menlo Park, California, 1994. American Association for Arti-ficial Intelligence, AAAI Press.

[Bre96] Gerhard Brewka. Well-Founded Semantics for Extended Logic Pro-grams with Dynamic Preferences.Journal of Articficial IntelligenceResearch, 4:19–36, 1996.

[Cha93] E. P. F. Chan. A possible world semantics for disjunctive databases.IEEE Transactions on Knowledge and Data Engineering, 5(2):282–292, April 1993.

[Cla78] Keith L. Clark. Negation as failure. In H. Gallaire and J. Minker,editors,Logic and Data Bases, pages 293–322, New York, 1978. Ple-mum Press.

[CSS98] Anthony G. Cohn, Lenhard K. Schubert, and Stuart C. Shapiro, ed-itors. Proceedings of the Sixth International Conference on Princi-ples of Knowledge Representation and Reasoning, Trento, June 1998.Morgan Kaufmann.

Page 347: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

BIBLIOGRAPHY 333

[Dun95] Phan Minh Dung. On the acceptability of arguments and its funda-mental role in nonmonotonic reasoning, logic programming and n-person games.Artificial Intelligence, 77(2):321–358, 1995.

[DVV98a] Marina De Vos and Dirk Vermeir. Forcing in disjunctive logic pro-grams. In Kamal Karlapalem, Amin Y. Noaman, and Ken Barker, ed-itors,Proceedings of the Ninth International Conference on Informa-tion and Computation, pages 167–174, Winnipeg, Manitoba, Canada,June 1998.

[DVV98b] Marina De Vos and Dirk Vermeir. Forcing in Disjunctive Logic Pro-grams.Journal of Computing and Information, 3(1):ICCI/1/7:139:1–8, 1998.

[DVV99a] Marina De Vos and Dirk Vermeir. Choice Logic Programs and NashEquilibria in Strategic Games. In Jorg Flum and Mario Rodr´ıguez-Artalejo, editors,Computer Science Logic (CSL’99), volume 1683 ofLecture Notes in Computer Science, pages 266–276, Madrid, Spain,1999. Springer Verslag.

[DVV99b] Marina De Vos and Dirk Vermeir. On the Role of Negation in ChoiceLogic Programs. In Michael Gelfond, Nicola Leone, and GeraldPfeifer, editors,Logic Programming and Non-Monotonic ReasoningConference (LPNMR’99), volume 1730 ofLecture Notes in ArtificialIntelligence, pages 236–246, El Paso, Texas, USA, 1999. SpringerVerslag.

[DVV00a] Marina De Vos and Dirk Vermeir. Dynamically Ordered Probabilis-tic Choice Logic Programming. InProceedings of Foundations ofSoftware Technology and Theoretical Computer Science Conference(FST TCS 2000), number 1974 in Lecture Notes in Computer Science,pages 227–239, New Delhi, India, December 2000. Springer Verslag.

[DVV00b] Marina De Vos and Dirk Vermeir. A Logic for Modelling DecisionMaking with Dynamic Preferences. InProceedings of the Logic inArtificial Intelligence (Jelia2000) workshop, number 1999 in LectureNotes in Artificial Intelligence, pages 391–406, Malaga, Spain, 2000.Springer Verslag.

[DVV01a] Marina De Vos and Dirk Vermeir. Decisions, agents and games. pages219–232, Siena, Italy, July 2001. Morgan Kaufmann.

Page 348: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

334 BIBLIOGRAPHY

[DVV01b] Marina De Vos and Dirk Vermeir. Forcing in Disjunctive Logic Pro-grams. Journal of Computational Intelligence 17(4) 2001. To appear,2001.

[DVV01c] Marina De Vos and Dirk Vermeir. Logic Programming Agents andGame Theory. InAnswer Set Programming: Towards Efficient andScalable Knowledge Representation and Reasoning, pages 27–33,Stanford (Palo Alto), California, US, March 2001. AmericanAsso-ciation for Artificial Intelligence Press.

[DVV01d] Marina De Vos and Dirk Vermeir. Modeling decision-making usingchoice logic programs. Submitted, 2001.

[ELM+98] Thomas Eiter, Nicola Leone, Cristinel Mateis, Gerald Pfeifer, andFrancesco Scarcello. The KR systemdlv: Progress report, com-parisons and benchmarks. In Anthony G. Cohn, Lenhart Schubert,and Stuart C. Shapiro, editors,KR’98: Principles of Knowledge Rep-resentation and Reasoning, pages 406–417. Morgan Kaufmann, SanFrancisco, California, 1998.

[GL88] M. Gelfond and V. Lifschitz. The stable model semantics for logicprogramming. InProc. of fifth logic programming symposium, pages1070–1080. MIT PRESS, 1988.

[GL91] Michael Gelfond and Vladimir Lifschitz. Classical negation in logicprograms and disjunctive databases.New Generation Computing,9(3-4):365–386, 1991.

[GLV91] D. Gabbay, E. Laenens, and D. Vermeir. Credulous vs.ScepticalSemantics for Ordered Logic Programs. In J. Allen, R. Fikes,andE. Sandewall, editors,Proceedings of the 2nd International Con-ference on Principles of Knowledge Representation and Reasoning,pages 208–217, Cambridge, Mass, 1991. Morgan Kaufmann.

[GRS88a] A. Van Gelder, K. Ross, and J. S. Schlipf. Unfoundedsets and well-founded semantics for general logic programs. InProceedings of theSeventh ACM Symposium on Principles of Database Systems, pages221–230, Austin, Texas, 1988. Association for Computing Machin-ery.

Page 349: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

BIBLIOGRAPHY 335

[GRS88b] A. Van Gelder, K. A. Ross, and J. S. Schlipf. The well-founded se-mantics for general logic programs. InProc. 7th ACM Symp. on Prin-ciples of Database Systems, 1988. to appear inJournal of the ACM.

[GRS91] Allen Van Gelder, Kenneth A. Ross, and John S. Schlipf. The well-founded semantics for general logic programs.Journal of ACM,38(3):620–650, July 1991.

[HDB98] Alain Hubert, Dixie Dansercoer, and Michel Brent.In the Teeth ofthe Wind. South Trough the Pool. 1998.

[HS97] Jaakko Hintikka and Gabriel Sandu. Game-Theoretical Semantics. InJohan van Benthem, editor,Handbook of Logic and Language, pages361–410. Elsevier Amsterdam, 1997.

[JEL00] Logic in Artificial Intelligence, volume 1919 ofLecture Notes in Arti-ficial Intelligence, Malaga, Spain, September–October 2000. SpringerVerslag.

[KS90] Robert A. Kowalski and Fariba Sadri. Logic programs with excep-tions. In David H. D. Warren and Peter Szeredi, editors,Proceed-ings of the Seventh International Conference on Logic Programming,pages 598–613, Jerusalem, 1990. The MIT Press.

[Lae90] Els Laenens. Ordered Logic. Ph.d. thesis, University of Antwerp,UIA, 1990.

[Lif00] Vladimir Lifschitz. Answer set programming and plan generation.Journal of Artificial Intelligence, page to appear, 2000.

[Llo84] John Lloyd. Foundations of Logic Programming. Springer-Verlag,1984.

[LOF98] Proceedings of the Third Conference on Logic and the Foundationsof Game and Decision Theory, Villa Gualino - Viale Settimo Severo,63 - 10133 Torino, Italy, December 1998. International Center forEconomic Research (ICER).

[LRS97] Nicola Leone, Pasquale Rullo, and Francesco Scarello. Disjunctivestable models: Unfounded sets, fixpoint semantics, and computation.Journal of Information and Computation, 135(2):69–112, June 1997.

Page 350: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

336 BIBLIOGRAPHY

[LV00] Els Laenens and Dirk Vermeir. A Universal Fixpoint Semantics forOrdered Logic.Computers and Artificial Intelligence, 19(3), 2000.

[Nas50] J. F. Nash. Equilibrium Points in N-Person Games.Proceedings ofthe National Academy of Science, 36:48–49, 1950.

[NBG+01] M. Nogueira, M. Balduccini, M. Gelfond, R. Watson, and M.Barry. AA-Prolog Decision Support System for the Space Shuttle. InAnswerSet Programming: Towards Efficient and Scalable Knowledge Repre-senation and Reasoning. American Association for Artificial Intelli-gence Press, Stanford (Palo Alto), California, US, March 2001.

[Ngo96] Liem Ngo. Probabilistic Disjunctive Logic Programming. In EricHorvitz and Finn Jensen, editors,Proceedings of the 12th Conferenceon Uncertainty in Artificial Intelligence (AI-96), pages 387–404, SanFrancisco, aug 1996. Morgan Kaufmann Publishers.

[NS91] Raymond Ng and V.S. Subrahmanian. A semantical framework forsupporting subjective and conditional probabilities in deductive data-bases. In Koichi Furukawa, editor,Proceedings of the 8th Interna-tional Conference on Logic Programming, pages 565–580. MIT, June1991.

[NS97] I. Niemela and P. Simons. Smodels: An implementation of the stablemodel and well-founded semantics for normal LP. In Jurgen Dix, Ul-rich Furbach, and Anil Nerode, editors,Proceedings of the 4th Inter-national Conference on Logic Programing and Nonmonotonic Reaso-ning, volume 1265 ofLNAI, pages 420–429, Berlin, July 28–31 1997.Springer.

[Ola96] Sverrir Olafsson. Resource Allocation as an Evolving Strategy.Evo-lutionary Computation, 4(1):32–54, 1996.

[OR96] Martin J. Osborne and Ariel Rubinstein.A Course in Game Theory.The MIT Press, Cambridge, Massachusets, London, Engeland,thirdedition, 1996.

[Par85] Rohit Parikh. The Logic of Games and its Applications. Annals ofDiscrete Mathematics, 24:111–140, 85.

Page 351: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

BIBLIOGRAPHY 337

[Poo92] David Poole. Logic programming, abduction and probability. In Insti-tute for New Generation Computer Technology (ICOT), editor, Pro-ceedings for the International Conference on Fifth Generation Com-puter Systems, pages 530–538. IOS Press, 1992.

[Poo97] David Poole. The independent choice logic for modelling multipleagents under uncertainty.Artificial Intelligence, 94(1–2):7–56, 1997.

[PPW78] L. M. Pereira, F Pereira, and D.H.D. Warren. User’s guide todecsystem-10 prolog. Technical report, University of Edinburgh: De-partement of Artificial Intelligence, 1978.

[Prz89] T. Przymusinski. Extended stable semantics for normal and disjunc-tive programs. Technical report, University of Texas at El Paso, 1989.

[Prz91] Theodor C. Przymusinski. Stable semantics for disjunctive pro-grams. InNew Generation Computing, volume 9, pages 401–424.OHMSHA, LTD. and Springer-Verslag, 1991.

[PS96] Henry Prakken and Giovanni Sartor. A system for defeasible ar-gumentation, with defeasible priorities. In Dov M. Gabbay andHans Jurgen Ohlbach, editors,Proceedings of the International Con-ference on Formal and Applied Practical Reasoning (FAPR-96), vol-ume 1085 ofLNAI, pages 510–524, Berlin, June 3–7 1996. Springer.

[Rei78] Raymond Reiter. On closed world data bases. In H. Gallaire andJ. Minker, editors,Logic and Data Bases, pages 55–76. Plenum, NewYork / London, 1978.

[RM95] C. Ruiz and J. Minker. Computing stable and partial stable modelsof extended disjunctive logic programs.Lecture Notes in ComputerScience, 927:205–??, 1995.

[Ros89] Kenneth A. Ross. The well-founded semantics for disjuncted logicprograms. In W. Kim, J.N. Nicolas, and S. Nishio, editors,Proc. of thefirst Intl. Conf. on Deductive and Object Oriented Databases, pages337–351, Kyoto,Japan, December 1989. Elsevier Science PublishersB.V. (North-Holland).

Page 352: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

338 BIBLIOGRAPHY

[RZ94] Jeffrey S. Rosenschein and Gilad Zlotkin.Rules of Encounter. De-signing Conventions for Automated Negotiation among Computers.The MIT Press, 1994.

[Sac97] D. Sacca. Deterministic and non-deterministic stable models.Logicand Computation, 5:555–579, 1997.

[Sak89] C. Sakama. Possible model semantics for disjunctive databases (pre-liminary report). InProc. First Int’l. Conf. on Deductive and Object-Oriented Databases, Kyoto, Japan, December 4-6 1989.

[SI94] Chiaki Sakama and Katsumi Inoue. An alternative approach to the se-mantics of disjunctive logic programs and deductive databases.Jour-nal of Automated Reasoning, 13:145–172, 1994.

[SI96] Chiaki Sakama and Katsumi Inoue. Representing Priorities in LogicPrograms. In Michael Maher, editor,Proceedings of the 1996 JointInternational Conference and Symposium on Logic Programming,pages 82–96, Cambridge, September2–6 1996. MIT Press.

[SN98] Timo Soininen and Ilkka Niemela. Formalizing ConfigurationKnowledge Using Rules with Choices. Inthe Seventh InternationalWorkshop on Nonmonotonic Reasoning (NM’98), special workshopon Formal Aspects and Applications of Nonmonotonic Reasoning,Trento, Italy, May – June 1998.

[SN99] Timo Soininen and Ilkka Niemela. Developing a Declarative RuleLanguage for Applications in Product Configurarion. InProceedingsof the First International Workshop on Practical Aspects ofDeclara-tive Languages (PADL’99), Lecture Notes in Computer Science, SanAntonio, Texas, US, January 1999. Springer-Verslag.

[SS97] Jonathan Scott and Angela Scott.Jonathan Scott’s Safari Guide toEast African Animals. Kensta, Kenya, P.O. Box 46309, Nairobi, 1997.

[SZ90] D. Sacca and C. Zaniolo. Stable models and non-determinism in logicprograms with negation. InProc. of the 9th ACM PODS, pages 205–217, 1990.

[Tar55] A. Tarski. A lattice-theoretical fixpoint theorem and its applications.Pacific Journal of Mathematics, 5:285–309, 1955.

Page 353: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

BIBLIOGRAPHY 339

[vB] Johan van Benthem. Logic and games. Online course notesof1999, Stanford University. Available at http://turing.wins.uva.nl/ jo-han/Phil.298.html.

[vB88] Johan van Benthem. Games in Logic.Representation and Reasoning,15(3):165–168, 1988.

[vEK76] M. H. van Emden and R. A. Kowalski. The semantics of predicatelogic as a programming language.Journal of the ACM, 23(4):733–742, 1976.

[VN01] Davy Van Nieuwenborgh. Order in Logic Programming. Graduatingthesis, Vrije Universiteit Brussel, DINF/TINF, 2001.

[VNM44] J Van Neuman and O Morgenstern.Theory of Games and EconomicBehavior. John Wiley and Sons, New York, US, 1944.

[VP00] Gerhard A.W. Vreeswijjk and Henry Prakken. Credulous and Scep-tical Argument Games for Preferred Semantics. In JELIA 2000[JEL00], pages 239–253.

Page 354: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

Index

abbreviationsCLP, 86CRL, 150CSP, 151DCSP, 151DOP-CLP, 268FLPA, 305OCLP, 160

action profile, 61actions, 61alternatives, 162, 273answer profile, 314answer set, 46, 208anti-symmetric, 7applicable, 19, 24, 87, 162applied, 19, 87, 162arity, 10assumption set, 217, 279assumption unfounded set, 218assumption-free, 218, 279atom, 44

best response, 64blocked, 276body, 17, 23, 32, 45, 86, 269bottom element, 9

c-choice set, 226c-computation, 227c-defeated, 204c-defeater, 204

c-indefeasible, 215c-literal, 44c-model, 206, 309c-model profile, 309cautious Nash equilibrium, 248cautious subgame perfect equilibrium,

250choice logic program, 86choice rules, 162choice set, 132, 193closed, 45competitor, 276complement, 23, 44, 86complete join-semilattice, 9complete lattice, 9complete meet-semilattice, 9components, 160computation, 136, 197consistent, 23, 45, 86constant, 16constraint, 17, 86credulous immediate consequence op-

erator, 221crisp, 271cycle fixpoint, 312

datalog, 17deductive database, 17deductive program, 17deductively closed, 19, 47, 87defeated, 163

340

Page 355: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

INDEX 341

directed, 9disjunctive logic program, 32domain, 10dynamic priority, 275dynamically ordered probabilistic choice

logic program, 268

extended disjunctive logic program,45

extensive game with perfect informa-tion, 71

fact, 17filtered input, 308fixpoint, 11framework for logic programming agents,

305function, 9function symbol, 16

Gelfond-Lifschitz transformation, 26,34, 88, 166

general logic program, 23greatest fixpoint, 11greatest lower bound, 8greatest unfounded set, 29, 114, 172ground, 17ground version, 18

head, 17, 23, 32, 45, 86, 269Herbrand base, 17, 87, 161, 269Herbrand universe, 17history, 71

image, 10immediate consequence operator, 29,

37, 127, 184indefeasible, 171input, 307

interaction profile, 307interpretation, 19, 87, 162

total, 87

least fixpoint, 11least Herbrand model, 20least upper bound, 8literal, 23, 45, 86lotteries, 66lower bound, 8

mapping, 9maximal alternative set, 273minimal model, 20, 25, 88, 206mixed extension, 67mixed strategy, 66mixed strategy Nash equilibrium, 67model, 19, 24, 33, 88, 164, 277, 309model profile, 309monotonic, 10

Nash equilibriumextensive game, 74strategic game, 64

negation as failure, 23notationsglb(X), 8(�j)j2N , 66(a�i; ai), 61(h; a), 71AU , 308A�i, 61Bi, 64Br, 17, 23, 32, 45, 86Hr, 17, 23, 32, 45, 86I+, 87I�, 87Io, 87O(s), 73

Page 356: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

342 INDEXP �, 161P I, 26, 34, 88P I , 208PM , 166P P , 147PX , 46P a�, 102P pn , 319P ps , 320PG, 143PL, 231Pd, 48Pm, 289Pn, 238Po, 251Ps, 244Pnot, 108P�, 95S!, 312Sn, 321Ss, 322UP , 17X+, 23, 45X�, 23, 45AP (I), 218fVngn2N , 136, 197fV ngn2N , 227I, 87�(Ai), 66�I, 273hN;H; P; (<i)i2Ni, 71hN; (Ai)i2N ; (<i)i2Ni, 61GASP (I), 218GUSP (I), 29, 36, 114, 172�(h), 76BP , 17, 87, 161, 269, 306IP , 19, 24, 87, 162IuP , 36, 114

#I(A), 272I, 271C P (I), 226CP (I), 132, 193GUSP , 142DP;I, 223D!P;I(X), 224R!P;I(X), 121, 191RP;I , 120, 190WP , 203T P , 221TP , 29, 37, 127, 184UP (I), 36, 114, 172V !, 137, 198V ! , 227Z!P , 222W!P , 29, 30, 38, 130, 187ZP , 221WP , 29, 127, 184hA; I; O; Ci, 305IC(a), 162?, 9: X, 45: a, 44C, 160Æ(x), 66InAS , 307Lit P , 45a, 61lpf (T ), 11lub(X), 8not X, 86not a, 86not , 23not X, 23hC;�i, 160�, 86OutS(A), 307

Page 357: Logisch Programmeren, Beslissingen en Spelenmdv/pubs/phd.pdfVRIJE UNIVERSITEIT BRUSSEL FACULTEIT WETENSCHAPPEN VAKGROEP INFORMATICA V E RS N I U ITEIT J E I R V B R U S S E L INCE

INDEX 343I(a), 273%II (a), 275�(r), 269>, 9 (r), 161f!(x), 11ui, 62hN; (�(Ai)); (Ui)i, 67A(h), 71

operator, 9ordered choice logic program, 160outcome, 73output, 307overruled, 216

partial interpretation, 24partial order, 7partially ordered set, 7payoff, 62player function, 71player-determinism, 248players, 61pointed partial order, 8positive complement, 87positive-acyclic, 102possible model, 41preference relation, 61preferred, 276priority, 269probabilistic interpretation, 270probability, 272propositional program, 17pure strategy, 66

rational, 96reduced unfounded sets, 142reduct, 46, 208reflexive, 7

rule, 17

satisfied, 19satisfies, 33semi-negative logic program, 23single atom, 273split clauses, 40split program, 40stable model, 26, 34, 88, 314stable profile, 314strategic game, 61strategy, 73strategy profile, 73strict partial order, 7sub-framework, 311subgame, 76subgame perfect equilibrium, 77support, 66

terminal history, 71terms, 16top element, 9total, 275total interpretation, 24total order, 8transitive, 7

unfounded set, 35, 113, 172unfounded-free, 36, 114, 172updated version, 308upper bound, 8utility function, 62

variable, 16

well-c-founded, 222well-founded, 130, 187