REFINING THE SEMANTICS FOR EPISTEMIC LOGIC PROGRAMS

by Patrick Thor Kahl, M.S.

A Dissertation in

Submitted to the Graduate Faculty of Texas Tech University in Partial Fulfillment of the Requirements for the Degree of DOCTOR OF PHILOSOPHY

Approved

Richard Watson Chair of Committee

Michael Gelfond

Yuanlin Zhang

Mark Sheridan Dean of the Graduate School

May 2014 Copyright © 2014 by Patrick Thor Kahl To my family

“Exploit symmetry whenever possible. Do not destroy it lightly.” —Edsger Dijkstra (1930-2002) Texas Tech University, Patrick Thor Kahl, May 2014

ACKNOWLEDGMENTS

My sincere thanks to the members of my committee who were all instrumental in the success of my research goal. My advisor, Dr. Richard Watson, who kindly agreed to take me in as his doctoral student, was a pleasure to work with on this topic. I appreciate all the hours he spent guiding me, sharing the ups and downs of one after another failure, yet maintaining the fervent belief that we were ever closer to our goal. In short, he was able to make this task an exciting endeavor, sharing with me in the adventure of scientific research. It was Dr. Michael Gelfond who introduced Epistemic Specifications to the world in the early 1990s, and he has continued to lead in its development, particularly in recent years with the increase in interest. His keen insight concerning the various different modal reducts proposed and whether they reflected how a rational agent should pick from among different models kept me from abandoning what eventually became the definition presented herein. The new definition led to a new intuition concerning the world views of various programs, one that I now believe is correct and also beautiful. Dr. Gelfond has continued to be my mentor since my undergraduate years at the University of Texas at El Paso. Anyone who has worked with him has indeed been blessed. Dr. Yuanlin Zhang continued to support me in my ever-changing directions, pa- tiently listening to my ideas and helping guide me toward realistic goals. He was the only one who was able to come up with a methodology that successfully addressed the problem of circular support through modal operator M as originally perceived. Although what I eventually chose to propose in this dissertation does not use his methodology, he addressed the objective I had at the time, and his idea remains a promising approach for future research. He has been both a teacher and a friend, giving me that most precious commodity, his time. I also wish to express my appreciation to the past and present members of the Knowledge Representation Lab at Texas Tech for their support, suggestions, encour-

ii Texas Tech University, Patrick Thor Kahl, May 2014 agement, and friendship. Everything from KR seminars to ping-pong was made more enjoyable and edifying due to their participation. I humbly follow in the footsteps of greats—Marcello, Veena, Sandeep, Ricardo, Yana, Weijun, Daniela, Justin—whose accomplishments have been an inspiration. I am especially grateful to my most recent lab mates—Evgenii, Edward, and Qianji—for their assistance and unending patience with me. My best wishes to them in their research endeavors. (And, yes, I’ll miss the basement dwellers. You know who you are.) My thanks also goes out to Dr. Nelson Rushton who further enlightened me con- cerning the language of mathematics and mathematical rigor in the field of computer science. His teachings have helped me improve the clarity of my communications, though I realize that I still have much to learn. Further thanks is extended to the faculty, staff, and fellow students of the Depart- ment of Computer Science who taught, assisted, laughed, struggled, worked with, and shared in my many experiences here at Texas Tech. Finally, to my dear family, I thank you with all my heart. The support I received from my mother, my siblings, and my extended family—Lara, Michael, and Greg— enabled me to feel good about pursuing this goal so late in my life. My wife Yulia and my children Alexandra and Jonathan all persevered through the years of my return to school. Their never-ending love, encouragement, support, and patience during this time have made it all possible.

Patrick Thor Kahl

March 12, 2014 Department of Computer Science Texas Tech University Lubbock, TX, USA

iii Texas Tech University, Patrick Thor Kahl, May 2014

TABLE OF CONTENTS

ACKNOWLEDGMENTS ...... ii ABSTRACT ...... vi I INTRODUCTION ...... 1 1.1 Motivation for a New Definition ...... 3 1.2 Finding the New Definition ...... 5 II BACKGROUND ...... 7 2.1 ASP ...... 7 2.2 Epistemic Specifications ...... 9 2.3 Language Development Timeline ...... 10 III SYNTAX AND SEMANTICS OF EPISTEMIC SPECIFICATIONS 13 3.1 Syntax ...... 13 3.2 Semantics ...... 15 IV AN ALGORITHM FOR FINDING WORLD VIEWS ...... 21 V SIMPLIFYING AN EPISTEMIC LOGIC PROGRAM ...... 24 VI COMPARISON WITH OLD VERSIONS OF THE LANGUAGE . . 25 6.1 Semantic Differences between Old and New Language ...... 25 6.2 Expressibility ...... 26 VII APPLICATIONS ...... 28 VIII RELATED WORK ...... 32 IX CONCLUSIONS AND FUTURE WORK ...... 35 9.1 Conclusion ...... 35 9.2 Future Work ...... 35 BIBLIOGRAPHY ...... 41 APPENDIX A: PROOFS ...... A-1 APPENDIX B: FAILED ATTEMPTS TO FIND CORRECT SEMANTICS B-1 B.1 Failed Attempt 1 ...... B-2 B.2 Failed Attempt 2 ...... B-2

iv Texas Tech University, Patrick Thor Kahl, May 2014

B.3 Failed Attempt 3 ...... B-3 B.4 Failed Attempt 4 ...... B-4 B.5 Failed Attempt 5 ...... B-5 B.6 Failed Attempt 6 ...... B-6 B.7 Failed Attempt 7 ...... B-6 APPENDIX C: EPISTEMIC LOGIC PROGRAMS WITH SORTS . . . . . C-1 C.1 Introduction ...... C-1 C.2 Syntax and Semantics ...... C-2 C.2.1 A New Meaning for Rules with Variables ...... C-2 C.2.2 Syntax of an ELPS ...... C-3 C.2.3 Semantics ...... C-4 C.3 Algorithm ...... C-4 APPENDIX D: EXAMPLE PROGRAMS ...... D-1

v Texas Tech University, Patrick Thor Kahl, May 2014

ABSTRACT

The primary goal of this dissertation is to present a new semantics for the lan- guage of Epistemic Specifications that accurately defines those models of associated programs that are to be considered as world views from the standpoint of a rational agent. Epistemic Specifications is a language that is an ex- tension of (ASP) through the addition of modal operators K and M. Programs written in this language are called epistemic logic programs. Previously proposed semantics did not satisfy our intuition for certain programs. In order to achieve the stated goal, the semantics should reflect the principles of a rational agent, as well as our intuition regarding the notion of support for a literal. Toward that goal, the focus here is on the following items. First, a new definition is proposed for the modal reduct of a program with respect to a collection of sets of literals. This is used to define models of a program that are accepted as its world views. Among other things, the new definition adds insight into a preference held by a rational agent when deciding between models that are based on different forms of extended literals. Second, an algorithm is proposed for finding the world views of an epistemic logic program under the proposed semantics. The algorithm was designed to take advantage of current state-of-the-art ASP solvers. A proof-of- concept implementation demonstrates its effectiveness. Finally, a framework for a conformant planner written in the language of Epistemic Specifications is introduced. Combined, these show real promise for the practical use of epistemic logic programs. Included in this dissertation is a history of Epistemic Specifications and an account of many failed attempts to “fix” the semantics. Also included is a list of example programs and their associated world views. These programs represent some of the more challenging problems and are believed useful in verifying the correctness of any proposed semantics as well as algorithms and their implementations. Many of these example programs come as a result of experience gained from failed attempts to find a solution to the so-called “unintended world views” problem.

vi Texas Tech University, Patrick Thor Kahl, May 2014

CHAPTER I INTRODUCTION

We define a new semantics for the language of Epistemic Specifications, an ex- tension of the language of answer set programming (ASP) that was introduced in the early 1990s by Michael Gelfond [Gelfond, 1991, Gelfond, 1994]. The language of Epistemic Specifications allows for introspective reasoning through the use of modal operators K and M. A literal preceded by a modal operator is called a subjective literal. Subjective literal K p can be understood to mean ”p is known.” M p can be understood to mean “p may be believed.” We believe the semantics proposed herein better addresses the principles that a rational agent should uphold when deciding which models of a program should be accepted and which should be rejected. Among the principles that we wish to address is the belief that a rational agent should only believe what he is forced to believe based on the rules of the program. What is meant by “based on the rules of the program” is that one or more rules combined should provide the justification—a clear argument of support—for literals being present in a belief set among the collection of belief sets in a world view of the program. The primary difficulty has been to formalize this notion of support as it applies to a literal in a program, particularly when it is caught up in a dependency cycle due to recursive rules involving subjective literals. It is hoped that the definitions presented here will provide a satisfactory semantics for the language, a quarry that has evaded us for two decades. This dissertation covers the latest results of this effort as pursued by the author and fellow researchers at Texas Tech University. The research has been greatly influenced by the related work of Michael Gelfond, particularly his recent proposal [Gelfond, 2011] for a new semantics, along with a follow-up suggestion to use support trees in order to determine which models of a program should be considered supported. This suggestion came after several unsuc- cessful attempts to find a satisfactory definition of the modal reduct that would re- sult in eliminating all models intuitively considered unsupported while keeping those

1 Texas Tech University, Patrick Thor Kahl, May 2014 deemed supported. Support trees were proposed as a possible way to provide a usable definition for the intuitive notion of support that a program provides for literals in a collection of belief sets. This notion of support could be described as that which is held by a rational agent modeling potential views of the world when taking the facts, constraints, and all the other rules of the program into account. Certain principles are assumed to be maintained, among them, the so-called rationality principle (described previously without naming it) which states that a rational agent should only believe what he is forced to believe. Others are that all the rules of the program must be satisfied, and that contradictions should not be believed. If no consistent view of the world maintaining these principles can be wrought from a program, then the program itself is to be viewed as inconsistent—an invalid theory in that it does not describe a consistent world. We had high hopes that support trees would lead us to a fully satisfactory defini- tion of a world view for a program—one that did not impose restrictions on otherwise syntactically-correct programs for the semantics to be defined, and one that matched our intuition with respect to intended/supported and unintended/unsupported mod- els when considering which should be world views. Such a definition should maintain that any program that does not contain modal operators corresponds to an ASP pro- gram, and that the world view (if one exists) of such a program corresponds to the collection of answer sets of the corresponding ASP program. A support tree could therefore also be used to provide a more general, formal notion of support for the literals in an answer set of an ASP program, something that has been missing for disjunctive ASP programs with head-elementary loops (i.e., programs that are not head-cycle-free in a strict sense). Unfortunately, none of the efforts to define support trees has been found to be correct thus far. Although there remains hope for such an approach, we have shifted focus away from support trees for the time being. Among the alternative approaches is a method devised by Yuanlin Zhang involving a new concept he termed the M-reduct. A version of that method was (until very recently) under consideration for being part of the semantics proposed in this dissertation. Un-

2 Texas Tech University, Patrick Thor Kahl, May 2014 fortunately, as with support trees, no fully satisfactory version of that method has yet to be developed. As none of the various methods described had thus far yielded a semantics deemed fully satisfactory, it was deemed appropriate to at least find a semantics that was felt to be an improvement over the previously proposed semantics. This put focus on specific classes of programs where the existing semantics gave unintuitive results. Surprisingly, those efforts led to discoveries challenging the intuition held at the time. In the end, a new modal reduct was developed though the exploitation of symmetry and included reverting back to a syntax used in the original version of the language. A semantics based on that modal reduct is presented here as a key research result. Additionally, the development of an algorithm for finding the world views of a finite program under the proposed semantics—one that has been implemented here at Texas Tech—gives the promise of more practical uses for and the hope of increased interest in the language of Epistemic Specifications.

1.1 Motivation for a New Definition

The language of Epistemic Specifications was introduced by Gelfond after observ- ing the need for a more powerful form of introspective reasoning than that offered by ASP alone. The semantics was given in terms of a world view—a collection of sets of literals (called belief sets) analogous to the answer sets of an ASP program. Unfortunately, the original semantics allowed certain clearly unintended world views for some programs. For example, under the original semantics, the one-line program

p K p. has two← world views: and p . The latter, p , is clearly self-supported, and the informal rendering{{}} of K p{{as}} “p is known” does{{ }} not warrant its justification. This led Gelfond to propose a change to the semantics in 2011 in an attempt to avoid unintended world views. Although this effort effectively and elegantly elimi-

3 Texas Tech University, Patrick Thor Kahl, May 2014 nated unsupported world views associated with recursion through K, it was unable to avoid certain unintended world views for programs with recursion through M. For example, under the original and 2011 semantics, the one-line program

p M p. has two← world views: and p . In spite of the English rendering of M p as “p may be believed,” support{{}} for {{p }}is clearly circular. At the very least, we believe a rational agent should not accept{{ }} both of these models as world views. Many attempts were made to redefine the semantics of Epistemic Specifications in order to avoid what are believed to be unintended/unsupported world views still remaining after the acceptance of the 2011 semantics. Most attempts focused on changing the definition of the reduct, but (until recently) none was found to be acceptable because example programs were eventually found for which the proposed definition resulted in either rejecting models that we felt should be accepted as world views, or accepting as world views some that we believed should be rejected. For example, at one point an iterative definition of the reduct was proposed that seemed likely to be the fix that had evaded us for so long, with certain example programs seeming to indicate the requirement for an iterative approach. As fate would have it, those same programs led us to our current belief that no similar iterative approach for defining the reduct of a program Π with respect to a potential world view W will be acceptable if intermediate steps depend on transformation to an ASP program whose answer sets are expected to be belief sets that form a subset of W whenever W is a world view of Π. We believe a program can always be devised that has a model that should be accepted as a world view but for which any reasonably simple iteration-based reduct method will reject. For example, imagine an epistemic logic program Π that requires n 1 iterations to reach a fixpoint. If a constraint is added to Π that can only be satisfied> in the nth iteration, the resulting (intermediate) ASP program of the first iteration will be inconsistent; hence, no further iterations will be made and the world view will not be found.

4 Texas Tech University, Patrick Thor Kahl, May 2014

1.2 Finding the New Definition

Although unsuccessful at eliminating unintended world views, one proposed modal reduct challenged us to re-evaluate our intuition concerning world views. From the standpoint of a rational agent, it is clear that certain subjective literals should be easier to accept than others based on their defined satisfiability requirements. With that thought in mind, we found we could predict the world views of certain programs under the proposed semantics that had at first seemed unintuitive. As new intuition developed and settled into our minds, the beauty of the symmetry suggested by this new modal reduct became apparent. Even though this was held as an important breakthrough in the development of the language semantics, the problem of unintended world views due to recursion through M remained. Concurrent with modal reduct efforts, Yuanlin Zhang had proposed an approach that was based on what he called the M-reduct of a program with respect to a particular belief set of a potential world view. His approach was the only one that had thus far been able to correctly “weed out” unwanted models due to recursion through M from those we felt at the time should be considered world views. This suggested a hybrid method—similar to that proposed by Gelfond with his support tree idea—where a candidate model is verified using the modal reduct, and then validated using a form of Zhang’s M-reduct approach in order to be considered a world view. Although such a definition is not as elegant and simple to understand as one based on a modal reduct alone, it held the promise of addressing formally the notion of support that we so desire. Unfortunately, none of the recent attempts at developing a general semantics based on this hybrid method were deemed satisfactory. Finally, we looked at a slightly different modal reduct that was—from a syntactic perspective—even more symmetric than the one previously mentioned. It surprised us in that it eliminated the multiple world view problem with the program p M p.

More surprising was that the world view it eliminated was rather than ← p . This was difficult to accept at first, but further investigation{{}} and another change{{ }} in intuition led to its acceptance as being appropriate with respect to the reasoning of

5 Texas Tech University, Patrick Thor Kahl, May 2014 a rational agent. The semantics proposed in this dissertation is thus strictly reduct-based, main- taining the simplicity and elegance of the previous reduct-based semantics originally introduced (and later revised) by Gelfond. We believe the new language definition to be significantly better than the old, and should be sufficiently clear to allow for accurate modeling of intelligent systems and the development of intelligent agents. As we become more familiar with the ramifications of the semantics proposed, it is hoped that we will discover that what we have found is just what we needed though without being exactly what we thought we were looking for. Time will then tell if it is actually the most appropriate definition for Epistemic Specifications that could be found and that the quest is indeed over.

6 Texas Tech University, Patrick Thor Kahl, May 2014

CHAPTER II BACKGROUND

2.1 ASP As stated in the introduction, the language of Epistemic Specifications is an ex- tension of the language of answer set programming (ASP). The language of ASP has been referred to as A-, Answer Set Prolog, AnsProlog, and the language of Ex- tended Disjunctive (EDLP) under the . It can also be understood as a version of that supports functional terms and disjunction in the head of rules. Regardless of the various names that have histori- cally been associated with the language, ASP has now become the most commonly accepted term for both answer set programming and the language of answer set pro- gramming, and is the term we will use throughout this dissertation, with appropriate meaning determined by context. ASP is a declarative logic programming language. Programs written in ASP are comprised of sets of logical statements known as rules. The history of ASP goes back to the beginning of logic programming, emerging as a result of research in knowledge representation and non-monotonic reasoning. Its syntax and semantics were greatly influenced by Prolog, Datalog, and Moore’s autoepistemic logic. For all practical purposes, what we call ASP today was introduced in 1991 by Gelfond and Lifschitz [Gelfond & Lifschitz, 1991] as a follow up to their 1988 landmark paper on stable model semantics [Gelfond & Lifschitz, 1988]. Today’s version of the language differs little from that proposed by Gelfond and Lifschitz with the primary change being that the set of all literals is no longer considered the answer set of a program containing contradictory rules. Such a program is now said to have no answer set. Extensions (choice rules, aggregates, etc.) have been added over time, but the semantics given in 1991 remains essentially the same for today’s so-called pure ASP programs. For a good introduction, see any of [Baral, 2003, van Harmelen et al., 2008, Gebser et al., 2012, Gelfond & Kahl, 2014, ASP Standardization Working Group, 2013].

7 Texas Tech University, Patrick Thor Kahl, May 2014

Although ASP was demonstrated to be very well suited for representing defaults and commonsense reasoning, its ability to correctly model reasoning in the presence of incomplete information was observed to be limited. In [Gelfond, 1991], Gelfond illustrated the need for an extension of ASP through the following example.

Example A. [Scholarship Eligibility Problem] Consider the following three ASP rules (with rule labels added for later reference):

R1: eligible X highGP A X .

R2: eligible(X) ← minority (X ), fairGP A X . R3: eligible( X) ← fairGP( A)X , highGP( ) A X . used by a¬ certain college( ) ← to¬ determine( eligibility) ¬ of students( ) for scholarships, where the variable X ranges over a given set of students. A fourth rule—given here in plain text—is that a student should be interviewed by the scholarship committee if his/her eligibility cannot be determined using the prior three rules. A reasonable attempt to express this fourth rule in ASP is as follows:

R4: interview X not eligible X , not eligible X .

When used with a database( ) ← containing( incomplete) ¬ information,( ) however, the result- ing program may be unable to correctly determine if a student is supposed to be interviewed. This is illustrated by considering the following disjunctive rule

R5: fairGP A mike or highGP A mike . representing information( from) a database( that) Mike’s GPA is known to be either fair or high. Note that his minority status is not given and is therefore unknown.

Together, rules R1–R5 comprise a program having the following two answer sets:

A1 highGP A mike , eligible mike , and

A2 = {fairGP A(mike), interview( mike)} . Although= { the program( correctly) represents( Mike’s)} eligibility for a scholarship as in- determinate, it fails to entail that Mike should be interviewed. This is because ASP rule R4 is too weak to represent the intended rule as stated by the college.

8 Texas Tech University, Patrick Thor Kahl, May 2014

2.2 Epistemic Specifications Gelfond’s remedy to this problem was to extend ASP by allowing modal operators in the body of a rule, providing for more powerful introspective reasoning with respect to all answer sets (the K modal operator) or some answer set (the M modal operator). The semantics of a program written in the language of Epistemic Specifications was given via the notion of a world view—a collection of simple theories about the world (called belief sets) that can be determined by a rational reasoner using the rules of the program. The world view of a program without modal operators coincides with the collection of its answer sets if taken as an ASP program. If a program has modal operators, a world view W satisfies subjective literal K ` if literal ` belongs to all the belief sets in W, and subjective literal M ` if ` belongs to at least one belief set in W. The following shows that the language of Epistemic Specifications provides a nat- ural way to deal with the problem outlined in Example A.

Example B. [Scholarship Eligibility Problem Revisited] The fourth rule can be expressed in the language of Epistemic Specifications as

R6: interview X not K eligible X , not K eligible X .

The epistemic logic program( ) ← consisting of( rule) R6 together¬ with( rules) R1–R3 and R5 from Example A has the world view W A1,A2 where

A1 highGP A mike , eligible mike= { , interview} mike , and

A2 = {fairGP A(mike), interview( mike) . ( )} Notice that= { interview( mike) is in every( belief)} set of the world view of this program; thus, we now have a program( ) that correctly entails that Mike should be interviewed. In spite of its apparent usefulness and the fact that it requires such a small change to the syntax of ASP, since its introduction, Epistemic Specifications has evolved very slowly and its acceptance in the broader logic programming community has been so limited that its impact thus far can be reasonably deemed as insignificant. The question then is, ”Why?”

9 Texas Tech University, Patrick Thor Kahl, May 2014

2.3 Language Development Timeline To address the question of why Epistemic Specifications has made so little im- pact compared to, say, ASP, we need to review what has happened in the world of Epistemic Specifications since its conception. The following tables and timeline provide a quick synopsis of the history of the language of Epistemic Specifications. The version labels (v1–v4) assigned here were created simply as a way to easily distinguish between the different language definitions described in known publications extant at the time of this writing. The new version described herein is also included, as well as a proof-of-concept solver based on it (with sorted signature) written by Evgenii Balai here at Texas Tech.

Epistemic Specifications Language Versions Epistemic Logic Program Inference Engines/Solvers

∗ 1991 v1 Gelfond 1994 ELMOv2.1 Watson 1994 v2 Gelfond 2007 Wviewsv2.1 Kelly „ v2.1 Baral/Gelfond 2013 ESparser/ESmodelsv3 Cui/Z.Zhang/Zhao 2005 v2.2 Wang/Yan Zhang 2014 ELPSv4 (with sorted signature) Balai

2011 v1.1 (M,ST,SP) Truszczy´nski ∗ „ limited to programs stratified w.r.t. subjective literals v3 Gelfond NOTE: Superscript indicates the language version supported. 2014 v4„ Kahl „limited to epistemic logic programs M – model (propositional) semantics ST – stable model semantics SP – supported model semantics

Classical Negation in Logic Programs and Disjunctive Databases The Stable Model Semantics for Logic Programs Nested Epistemic Logic Programs Revisiting Epistemic Specifications Logic Programming and Knowledge Representation Logic Programming and Reasoning with Incomplete Information Strong Introspection New Semantics for Epistemic Specifications Refining the Semantics for Epistemic Logic Programs

Gelfond/Lifschitz:Gelfond: Truszczy´nski: { { { -- Gelfond/Lifschitz:-- Gelfond: -- Baral/Gelfond: -- Wang/Yan Zhang: -- Gelfond: -- Kahl: 1990 1995 2000 2005 2010 ⌞Logic Programs under Stable Model Semantics/ASPÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ→ ⌞Epistemic SpecificationsÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ→ ⌞Epistemic Logic ProgramsÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ→ Timeline for Development of the Language of Epistemic Specifications

10 Texas Tech University, Patrick Thor Kahl, May 2014

It is telling that as of this writing, there are only about two dozen scientific publications in total that are concerned with the topic of Epistemic Specifications (as an extension of ASP), some of these merely including Epistemic Specifications in a survey without adding anything new to it. By contrast, the number of scientific publications that are concerned with the topic of ASP that were published in just the first few months of 2014 greatly exceeds this number. Perhaps one of biggest reasons for ASP’s popularity when compared to Epistemic Specifications is the availability of efficient, reliable solvers. Although the table on the preceding page shows four epistemic logic program inference engines/solvers, only three are still extant, and none was more than a proof-of-concept research project developed by mostly graduate students who—for the most part—have moved on to other endeavors. It is hoped that the latest efforts by Cui, Z. Zhang, and Zhao [Cui et al., 2012, Zhang et al., 2013] will be continued so that a robust and efficient solver will be developed. Perhaps their work and the continued work at Texas Tech will promote more interest. Possible arguments against the continued development of Epistemic Specifications include the following. 1. The computational complexity of finding the world views of a program is so high that it may be impossible to implement an effective solver; thus, the language might never have practical application. 2. The semantics that have been proposed are still not fully satisfactory after more than two decades of research. 3. The added power that the language offers over ASP has not been shown to be necessary for the vast majority of applications as demonstrated by the lack of interest in the language for solving “real-world” problems. We believe these arguments are not sound reasons for abandoning research in Epistemic Specifications. A similar argument to the first was made against ASP until Tommi Syrj¨anen and Patrik Simons—working with Ilkka Niemel¨aand others at the Helsinki University of Technology Laboratory for Theoretical Computer

11 Texas Tech University, Patrick Thor Kahl, May 2014

Science—showed the world that the combination of Lparse and Smodels [Helsinki University of Technology, 2010] resulted in a system that could reliably and efficiently solve a huge number of practical problems by finding the answer sets of ASP programs in a reasonable time. Their work continues at the University of Potsdam by a group led by Torsten Schaub (including Martin Gebser, Roland Kaminski, Benjamin Kaufmann, and others) in the development of a collection of answer set solving tools (clingo, clasp, claspD, gringo, etc.) [Potassco, 2014]. Concurrent with this work is the development of DLV [DLVSYSTEM s.r.l., 2012] by Nicola Leone, Gerald Pfeifer, Wolfgang Faber, Thomas Eiter, Georg Gottlob, Francesco Calimeri, and others at the University of Calabria, the Technical University of Vienna, and the University of Oxford. Even though the computational complexity of finding the answer sets of an ASP program is (in general) very high, these people and many others like them believe ASP to be a practical language for solving problems. The same may happen for Epistemic Specifications. The second argument may have concerned researchers, but as the primary concern has been with programs that involved recursion through modal operators (successfully addressed for recursion through K by Gelfond in 2011), from a practical perspective, the semantics given were clear, and any issues stemming from recursion through M could simply be avoided by not coding such rules. Further, other than anecdotal, the only known research that addressed any perceived problem with the semantics was done by Gelfond with his updates to the semantics in 1994 and 2011, and by Mircea Preda with his proposal [Preda, 1997] for a different language—one that only approximated Epistemic Specifications. It is hoped that with the new semantics offered in this dissertation, this second argument will be considered moot. The third argument is weak at best. Nonetheless, to address it properly would be to suggest applications for the language for which ASP is not powerful enough on its own and for which Epistemic Specifications holds real promise. The existence of a reliable solver would allow for experimentation and the development of systems that could use Epistemic Specifications to solve “real-world” problems. Time will tell.

12 Texas Tech University, Patrick Thor Kahl, May 2014

CHAPTER III SYNTAX AND SEMANTICS OF EPISTEMIC SPECIFICATIONS

In general, the syntax and semantics of the language of Epistemic Specifications follow that of ASP (and may include various ASP extensions not described in this work) with the notable addition of subjective literals, plus the new notions of belief sets (analogous to answer sets) and a world view (a collection of belief sets, analogous to the set of all answer sets of a program). The following definitions assume familiarity with ASP.

3.1 Syntax Definition 1. [Objective Literal] An objective literal (or simply a literal) is either an atom or a classically-negated atom. An atom is defined in the usual way. A classically-negated atom (sometimes called a strongly-negated atom) is an atom immediately preceded by .

Definition 2. [Subjective Literal, Modal Operator, K-literal, M-literal]¬ A subjective literal is a literal immediately preceded by K or M. The symbols K and M as used in this context are referred to as modal operators. A subjective literal formed with modal operator K is called a K-literal whereas one formed with M is called an M-literal.

Definition 3. [Default-Negated Literal, Extended Literal] A default-negated objective/subjective literal is an objective/subjective literal im- mediately preceded by not.1 An extended objective/subjective literal is an objec- tive/subjective or default-negated objective/subjective literal. An extended literal is a literal of any of the forms described, i.e., an extended objective or extended subjec- tive literal. When clear from the context, we may simply use the term literal to refer to an objective literal, an extended objective literal, or an extended literal. Similarly,

1An alternative syntax uses ¬K and ¬M for not K and not M, respectively. We consider these alternative forms to be semantically equivalent, but prefer the syntax using not.

13 Texas Tech University, Patrick Thor Kahl, May 2014 the term subjective literal may be used to refer to a subjective literal or an extended subjective literal.

Definition 4. [Positive/Negative Literal] A positive literal is an objective literal or a subjective literal of the form K ` that is not preceded by default negation (not). A negative literal is a default-negated objective/subjective literal or a subjective literal of the form M `.

Definition 5. [Ground Literal] A ground literal is a literal whose terms (if any) are ground. Ground terms exclude variables (e.g., X), arithmetic operations (e.g., 1 2), and functions containing vari- ables and/or arithmetic operations (e.g., f X 1+). Definition 6. [Program, Rule, Head, Body,( Constraint,+ ) Fact] A program—referred to as either an epistemic logic program or an epistemic specifi- cation—is simply a set of rules. A rule denotes a logical statement and is of the form

head body.

The head←of a rule is a (finite) disjunction of literals of the form

`1 or `2 or ... or `k where k 0. A headless rule (k 0) is called a constraint. If R denotes a rule, then by head ≥R we denote the set of= literals in the head of R. The body( of) a rule is a (finite) conjunction of extended literals of the form

e1, ..., en where n 0. A bodyless rule (n 0) is called a fact. The is optional for facts. By

+ − body R ≥ we denote the set of positive= literals in the body← of rule R. By body R we denote( ) the set of negative literals in the body of R. By body R we denote( the) set of all extended literals in the body of R. ( ) Definition 7. [Ground Program] A ground program consists of rules with only ground literals. A rule with variables is viewed as a shorthand for all its ground instantiations.

14 Texas Tech University, Patrick Thor Kahl, May 2014

Definition 8. [Safe Rule, Safe Program] A rule is said to be safe if for each variable that occurs in the rule there is at least one occurrence of the variable in a positive literal of the body. A program is said to be safe if every rule in it is safe.

3.2 Semantics Note: In the following definitions, ` is used to denote a ground objective literal.

Definition 9. [When an Objective Literal Is Satisfied] Let A be a consistent set of ground literals.

ˆ ` is satisfied by/true in A iff ` A.

ˆ not ` is satisfied by/true in A iff ` ∈ A.

∉ If A satisfies an extended objective literal `ext, it can denoted as A `ext.

Definition 10. [When a Subjective Literal Is Satisfied] ⊧ Let W be a non-empty collection of consistent sets of ground literals.

ˆ K ` is satisfied by/true in W iff A W ` A.

ˆ not K ` is satisfied by/true in W iff ∀A ∈ W ∶ ` ∈ A.

ˆ M` is satisfied by/true in W iff ∃A ∈ W ∶ ` ∉ A.

ˆ not M` is satisfied by/true in W iff ∃A∈ W ∶ `∈ A.

∀ ∈ ∶ ∉ If W satisfies an extended subjective literal sext, it can denoted as W sext.

Definition 11. [When a Rule Is Satisfied, Model of a Program] ⊧ Let Π be a ground epistemic logic program and W be a non-empty collection of consistent sets of ground literals. Rule R in Π is satisfied by the pair A, W where

A W if a literal in the head of R is satisfied by A, or if an (extended)⟨ objective⟩ or subjective∈ literal in the body of R is not satisfied by A or W , respectively. W is a model of Π iff R Π, A W R is satisfied by A, W .

∀ ∈ ∀ ∈ ∶ ⟨ ⟩ 15 Texas Tech University, Patrick Thor Kahl, May 2014

Definition 12. [Modal Reduct] Let Π be a ground epistemic logic program and W be a non-empty collection of consistent sets of ground literals in the language of Π. We denote by ΠW —called the modal reduct of Π with respect to W—the ASP program with nested expressions2 obtained from Π by replacing/removing subjective literals and deleting rules according to the following table.

subjective literal if satisfied by W if not satisfied by W

K ` replace K ` with ` delete the rule not K ` remove not K ` replace not K ` with not ` M ` remove M ` replace M ` with not not ` not M ` replace not M ` with not ` delete the rule comment: It is perhaps easier to understand the intuition behind parts of this table if M ` is under- stood to be a shorthand for not K not ` as proposed in [Gelfond, 2011]. With that understanding, we need only define the reduct for subjective literals of the form K `ext and not K `ext, provided we allow a default-negated literal to follow modal operator K. We prefer the syntax described herein.

Definition 13. [World View/Inconsistent Program] W is a world view of Π iff W AS ΠW where AS ΠW denotes the set of all answer

W sets of Π . If no such W exists= (Π( has) no world view),( ) Π is said to be inconsistent. Definition 14. [Entailment, Consequence] An epistemic logic program Π is said to entail objective literal ` (denoted as Π `) if ` is a member of every belief set of every world view of Π. If Π ` then ` is said⊧ to be a consequence of Π. ⊧ Definition 15. [Monotonic/Non-monotonic Program] A program Π is said to be monotonic iff, for any program Π′, the set of consequences of program Π Π′ is a superset (not necessarily proper) of the set of consequences of Π.

A program is∪ said to be non-monotonic if it is not monotonic. Conclusions based on 2By nested expressions we mean expressions of the form not not ` in the body of a rule as defined in [Lifschitz et al., 1999]. For ease of presentation, henceforth we will simply use ASP to mean ASP with nested expressions whenever the context requires allowing such nested expressions.

16 Texas Tech University, Patrick Thor Kahl, May 2014 the consequences of a monotonic program Π will not be withdrawn with the addition of new information (i.e., the addition of new rules/facts/constraints), whereas with a non-monotonic program, conclusions may be withdrawn if new information is added.

Conjecture 1. [A Positive Program Is Monotonic] An epistemic logic program that contains only positive literals—called a positive pro- gram—is monotonic.

Definition 16. [Monotonic/Non-monotonic Literal] A positive literal may be referred to as a monotonic literal in the sense that a program containing only positive literals is monotonic. A negative literal may be referred to as a non-monotonic literal in the sense that the presence of a negative literal in a program may cause the program to be non-monotonic.

World views based on the modal reduct given here suggest a preference held by a rational agent for determining whether or not to believe different forms of extended literals within a program. The preference relation is a partial order as shown below.

hardest to accept/ highest conviction Examples Illustrating the Preference Order for Default-negated Literals K ` ↑ not M` Example A: Example B: Example C: S ← ← ← ` S not ` p not M q. p not M q. p not q. M ` ↓ not K ` q ← not p. q ← not K p. q ← not K p. {{ }} {{ }} {{ }} easiest to accept/ World view: q World view: q World view: q lowest conviction

We will not give an order for any preference relation between individual literals on the left (K `, `, and M `) and their default-negated counterparts on the right. Nonetheless, a rational agent will accept a default-negated literal by default over a positive literal. Default-negated literals are thus sometimes referred to simply as default literals.

The notion of positive and negative literals plays a practical role when writing programs with variables if the program’s signature is implied and the domains of pa- rameter terms are universal for all predicates and functions. This is certainly the case

17 Texas Tech University, Patrick Thor Kahl, May 2014 when writing an ASP program for one of the currently popular ASP ground/solver systems such as clingo [Potassco, 2014] or DLV [DLVSYSTEM s.r.l., 2012]. Unless otherwise stated, an implied signature is assumed for the epistemic logic programs discussed in this dissertation, although an explicitly provided sorted signature could be used instead. See Appendix C for information about epistemic logic programs with sorted signatures.

Definition 17. [Equivalent Programs] Epistemic logic programs are said to be equivalent if they have the same world views.

Definition 18. [Strongly Equivalent Programs]

Two epistemic logic programs Π1 and Π2 are said to be strongly equivalent if, for any

3 epistemic logic program Π, the programs Π1 Π and Π2 Π are equivalent.

The preference order of literals mentioned∪ earlier is also∪ evident when considering the subsumption of literals in the body of a rule. A strongly equivalent program can be obtained from an epistemic logic program by removing from the body of a rule R any literal that is subsumed by a subsumer in the body of R per the following table.4

subsumer subsumed subsumer subsumed subsumer subsumed subsumer subsumed K ` ` K ` not ` ` not ` not M ` not ` K ` M ` K ` not K ` ` not K ` not M ` not K ` K ` not M ` ` M ` M ` not K ` not ` not K `

Note that K ` subsumes both ` and M `, and ` subsumes M `. Additionally, not M ` subsumes both not ` and not K `, and not ` subsumes not K `. This follows the preference order given previously for positive and negative literals, respectively. Per- haps less intuitive is that not M `, not `, and not K ` are all three subsumed by K `; not ` and not K ` are both subsumed by `; and not K ` is subsumed by M `. This may be seen as suggestive of an extended ordering.

3The notions equivalent and strongly equivalent were introduced in [Lifschitz et al., 2001]). 4We use ` to denote the logical complement of `. For example, if ` = ¬p then ` = p.

18 Texas Tech University, Patrick Thor Kahl, May 2014

The following definitions are provided here primarily because they were found to be useful during the research efforts that led to the final result given in this dissertation.

Definition 19. [Modal Support Graph] Given a ground epistemic logic program Π, a modal support graph (or MS graph for short) of Π is a directed graph where:

for each rule in Π, there is a node—referred to as a rule node—with a corre-

● sponding label (e.g., R1) denoting the rule; for each distinct objective literal ` in the language of Π, there is a node—referred

● to as a literal node—labeled by `; for each objective literal ` in the head of rule R, there is an unlabeled edge from

● rule node R to literal node `; and literal label comment ˆ for each extended literal in the body of rule R, ` unlabeled there is an edge—labeled according to the form of not ` − minus sign K ` K the extended literal as listed in the table on the not K ` −K M ` M right—going from literal node ` to rule node R. not M ` −M

Figure 3.1: Example of a Modal Support Graph

p _ R1 M R3 s R4 –K R2 r q

Figure 3.1 shows the MS graph for the following epistemic logic program (with rule labels added):

R1: p or q.

R2: r not p, not K q.

R3: s ← r.

R4: r ← M s, p. ← 19 Texas Tech University, Patrick Thor Kahl, May 2014

Definition 20. [M-Cycle] A cycle in the MS graph of a ground epistemic logic program is called an M-cycle if an edge within the cycle is labeled by M.

Note that the MS graph shown in Figure 3.1 has an M-cycle passing through nodes r, R3, s, and R4 with the edge from literal node s to rule node R4 labeled by M.

Definition 21. [Externally-Supported M-Cycle] An M-cycle in the MS graph of a ground epistemic logic program is said to be externally-supported if the M-cycle includes a literal node with an edge coming into it from a rule node that is external to the M-cycle.

Note that the MS graph shown in Figure 3.1 has an externally-supported M-cycle with an edge coming into the M-cycle at literal node r from rule node R2 which is external to the M-cycle.

For simplicity, we say that an epistemic logic program contains an M-cycle if its MS graph contains an M-cycle—likewise for an externally-supported M-cycle.

An alternative way to understand what is meant by an M-cycle is to use the notion of stratification. Stratification is a well-known concept in logic programming and was defined for epistemic logic programs in [Watson, 2000]. We say that a program contains an M-cycle if it is not locally stratified with respect to a subjective literal of the form M ` appearing in the ground program. Conversely, we say that a program does not contain an M-cycle (i.e., the program is M-cycle-free) if it is locally stratified with respect to all subjective literals of the form M ` appearing in the ground program.

20 Texas Tech University, Patrick Thor Kahl, May 2014

CHAPTER IV AN ALGORITHM FOR FINDING WORLD VIEWS

Outline of Algorithm for Finding World Views of an Epistemic Logic Program

input: epistemic logic program ↓ conversion: ASP program created from input ↓ computation: answer sets of converted program computed using ASP grounder-solver ↓ analysis: answer sets grouped by atoms representing subjective literal values ↓ verification: each group checked to see that subjective literals are satisfied ↓ output: world views

For ease of presentation, k `, k0 `, k1 `, m `, m0 `, m1 `, or d ` will be used to denote the fresh atom obtained from literal ` by prefixing it with k , k0 , k1 , m , m0 , m1 , or d (respectively),1 and with substitution of 0 for within the fresh atom implicitly understood if ` is a classically-negated atom. For example,¬ if ` p X then k0 ` k0 p X , but if ` p X then k0 ` k0 0p X . An atom of the form= (k `), k0 `, or k1= ` will( be) referred= to¬ ( as a) k-atom, whereas= ( an) atom of the form m `, m0 `, or m1 ` will be referred to as an m-atom. By a k-/m-literal we mean a k-/m-atom or its negation. If W is a collection of sets of literals, we denote by W∖KM the collection of sets from W with all k-/m-literals removed. An atom of the form d ` is used strictly as a device to achieve proper grounding of rules associated with a subjective literal of the form K`, ensuring rule safety when ` contains a variable. After grounding, atoms of the form d ` are removed. Likewise, rbody+ R —denoting the comma-delimited list of relevant positive literals from the body of( rule) R when R contains a subjective literal containing a variable—is used to achieve proper grounding and safety of added rules.

1We assume the prefixes used here do not occur in Π. Other prefixes may be used to avoid conflicts with existing literals.

21 Texas Tech University, Patrick Thor Kahl, May 2014

Algorithm 1. [ELPsolver: Finds the World Views of an Epistemic Logic Program]

Input ←ÐÐ an epistemic logic program Π with only safe rules and an equivalent finite ground representation Output Ð→ the world views (if any) of Π

1. Create ASP program Π′ from the rules of Π. Rules without subjective literals are left unchanged. For each rule R containing a subjective literal, replace the subjective literal and add new rules per the following table.

subjective replace add note: Items in brackets are added literal with rules only if ` contains a variable. d ` `. k1 ` not k0 ` , rbody+ R , d ` . k[ 0 `← not] k1 ` , rbody+ R , d ` . k0 ` ← k1 `. [ ( ) ] K ` not k `, ` k0 ` ← m1 `. [ ( ) ] ← ¬ k0 ` m0 `. k ` ← k0 `. k ` ← k1 `, not `. k¬1 ` ← not k0 ` , rbody+ R . k¬0 ` ← not k1 ` , rbody+ R . k0 ` ← k1 `. [ ( )] not K ` k ` k0 ` ← m1 `. [ ( )] k0 ` ← m0 `. ¬ k ` ← k0 `. k ` ← k1 `, not `. m¬ 1 ` ← not m0 ` , rbody+ R . m¬ 0 ` ← not m1 ` , rbody+ R . m1 ` ← k1 `. [ ( )] M ` m ` m0 ` ← k1 `. [ ( )] m ` ←m1 `. m ` ←m0 `, not not `. m1 `← not m0 ` , rbody+ R . m0 `← not m1 ` , rbody+ R . m1 ` ← k1 `. [ ( )] not M ` not m ` m0 ` ← k1 `. [ ( )] m ` ←m1 `. m ` ←m0 `, `. ← ′ ′ 2. Compute Πground (the ground version← of Π ) with an appropriate ASP grounder, ′′ ′ then create Πground from Πground by removing each rule with an atom of the form

22 Texas Tech University, Patrick Thor Kahl, May 2014

d ` in its head along with every occurrence of d ` from the rest of the program,

′′ and then compute the answer sets of Πground with an appropriate ASP solver.

′′ NOTE: If there are no answer sets (i.e., Πground is inconsistent), then Π has no ′′ world view. If Π has no subjective literals and Πground is consistent, then the ′′ collection of answer sets of Πground is the only world view of Π. In either case, the algorithm is finished and no further steps are to be performed.

′′ 3. Group the answer sets of Πground by common k-/m-atoms of the form k0 `, k1 `, m0 `, and m1 `. Each group W of answer sets is said to represent (i.e., if its k-/m-literals are removed) a candidate world view of Π.

4. For each W representing a candidate world view of Π, check that the following conditions are met for all its k-/m-atoms:

(a) if k1 ` is in the sets of W , then ` is in every set of W ;

(b) if k0 ` is in the sets of W then ` is missing from at least one set of W ;

(c) if m1 ` is in the sets of W then ` is in at least one set of W ; and

(d) if m0 ` is in the sets of W then ` is missing from every set of W.

W∖KM is a world view of Π if all the conditions above are met.

Theorem 1. [The Algorithm Is Sound]2 Let Π be an epistemic logic program with only safe rules and having an equivalent finite ground representation. Given Π as input, if W is output by Algorithm 1 then W is a world view of Π.

Theorem 2. [The Algorithm Is Complete] Let Π be an epistemic logic program with only safe rules and having an equivalent finite ground representation. Given Π as input, if W is a world view of Π then W is output by Algorithm 1.

2The proofs for soundness and completeness of the algorithm are given in Appendix A.

23 Texas Tech University, Patrick Thor Kahl, May 2014

CHAPTER V SIMPLIFYING AN EPISTEMIC LOGIC PROGRAM

It may at times be desirable to transform an epistemic logic program into an equivalent program via various reduction steps. In this section, we provide syntactic transformations that can be applied to the rules of an epistemic logic program that will maintain the semantic meaning of the program with respect to its world views.1

Definition 22. [Simplified Epistemic Logic Program]

Note: In the following, ` denotes an objective literal and ` denotes its logical complement. Given an epistemic logic program Π, a strongly equivalent simplified program can be derived from Π as follows.2 1. Remove a rule if its body contains any of the following contradictory pairs: (a) ` and not `, (f)K ` and K `, (b) ` and `, (g)K ` and M `, (c) ` and not M `, (h)K ` and not K `, (d) ` and K `, (i)K ` and not M `, or (e)K ` and not `, (j)M ` and not M `. 2. Remove a rule if its head contains ` and its body contains either ` or K `. 3. Remove ` from the head of a rule if its body contains any of the following: (a) not `, (b) `, (c) not M `, or (d) K `.

4. Within the body of a rule, remove any extended literal that is subsumed by an extended literal that is a subsumer per the following table.

subsumer subsumed subsumer subsumed subsumer subsumed subsumer subsumed K ` ` K ` not ` ` not ` not M ` not ` K ` M ` K ` not K ` ` not K ` not M ` not K ` K ` not M ` ` M ` M ` not K ` not ` not K `

5. Remove any duplicates in the head and any duplicates in the body of each rule.

6. Remove duplicate (i.e., semantically equivalent) rules.

1Simplifications that apply to ASP (e.g., see [Eiter et al., 2004]) apply to Epistemic Specifications. 2The signature/Herbrand universe is assumed to remain fixed to that of the original.

24 Texas Tech University, Patrick Thor Kahl, May 2014

CHAPTER VI COMPARISON WITH OLD VERSIONS OF THE LANGUAGE

6.1 Semantic Differences between Old and New Language Gelfond’s 1994 definition [Gelfond, 1994] for the modal reduct simply removed all satisfied subjective literals from the bodies of rules and removed any rules containing unsatisfied subjective literals. It also allowed the empty world view and a world view containing an inconsistent belief set. The table below shows the world views of various example programs under the 1994 semantics and the new semantics.

Π W ΠW [1994] ΠW [new] Comment p ← not p, K p. {} p ← not p. [n/a] empty world view World view? YES NO {{}} World view? YES YES p. {{p, ¬p}} p. [n/a] inconsistent belief set ¬p. ¬p. World view? YES NO p ← K p. {{}} World view? YES YES {{p}} p. p ← p. self-supported World view? YES NO p ← K p. {{}} ¬p ← K ¬p. World view? YES YES {{p}} p. p ← p. self-supported World view? YES NO {{¬p}} ¬p. ¬p ← ¬p. self-supported World view? YES NO {{p, ¬p}} p. [n/a] inconsistent belief set ¬p. World view? YES NO p or q. {{p}, {q}} p or q. p or q. ¬p ← not M p. World view? YES YES —or, using 1994 syntax— {{¬p, q}} p or q. p or q. p or q. ¬p. ¬p ← not p. indirectly self-supported ¬p ← ¬M p. World view? YES NO p ← M p. {{}} p ← not not p. World view? YES NO {{p}} p. p. circularly supported World view? YES YES p or q. {{p, q}, {p, r}} p or q. p or q. q or r. q or r. q or r. p ← M p. p. p. externally supported World view? YES YES

25 Texas Tech University, Patrick Thor Kahl, May 2014

6.2 Expressibility When Gelfond introduced the language of Epistemic Specifications in 1991 [Gelfond, 1991], he allowed modal operators M and K to be prefaced not only by default negation (not) but also by classical negation ( ). To express the meaning of

K ` and M ` from the original language, we now use¬ M ` and K `, respectively. ¬While not¬ strictly equivalent, the table below shows how different subjective literal forms in the original language can best be expressed under the new semantics.

Original New

K ` K ` not K ` not K ` ¬K ` M ` M ` M ` not M ` not M ` ¬M ` K `

Shortly after its introduction, Gelfond revised the syntax and semantics of the language [Gelfond, 1994] and began using a modal reduct to define a world view. The primary syntactic change was that default negation (not) was no longer allowed to precede a modal operator. Subjective literals of the form not K ` and not M ` under 1991 semantics are represented by K ` and M ` (respectively) under 1994 semantics. (Note that we restore the syntax¬ to default-negated¬ subjective literals in this dissertation.) The table below shows syntactic forms with comparative semantics for the original (1991), 1994, and new versions of the language.

Original 1994 New

K ` K ` K ` not K ` ¬K ` not K ` ¬K ` M ` M ` M ` M ` M ` not M ` ¬M ` not M ` ¬M ` K ` K `

26 Texas Tech University, Patrick Thor Kahl, May 2014

Due to a renewed interest in the language and a desire to eliminate unintended world views, Gelfond proposed a different syntax and semantics for the language in 2011 [Gelfond, 2011]. The revised syntax allowed default negation (not) after a modal operator. Additionally, subjective literals using modal operator M were defined in terms of K as follows:

M ` def K not ` and = ¬

M ` def K not `.

Thus,¬ M became= simply syntactic sugar, making it unnecessary to have more than one modal operator. The following table shows syntactic forms with comparative semantics for the original (1991), 1994, 2011, and new versions of the language.

Original 1994 2011 New

K ` K ` K ` K ` not K ` ¬K ` ¬K ` not K ` ¬K ` M ` ¬K not ` M ` M ` M ` ¬K not ` M ` not M ` ¬M ` K not ` not M ` ¬M ` K ` K ` K `

The new language definition uses default-negated subjective literals instead of classically-negated subjective literals while maintaining the use of modal operator M and disallowing default-negated literals after a modal operator. Nonetheless, it is still closer to the 2011 semantics than earlier versions in spite of the syntactic differences. An additional difference between the new semantics and the other semantics is that a world view is now required to be non-empty and composed of consistent sets of literals. The fact that the definition of a world view makes it dependent on ASP semantics implies that the consistency requirement for sets in a world view came indirectly as a result of the evolution of ASP semantics. (The non-empty world view requirement was first proposed by Truszczy´nski[Truszczy´nski,2011].)

27 Texas Tech University, Patrick Thor Kahl, May 2014

CHAPTER VII APPLICATIONS

With the added power granted by the addition of modal operators, the language of Epistemic Specifications is better suited for reasoning in the absence of complete information than ASP. Gelfond specifically designed the language to provide for more powerful introspective reasoning—the ability of a program to reason about its own reasoning—when he found that ASP was not powerful enough to solve certain prob- lems posed shortly after ASP’s conception. The example given in Chapter II demon- strated how the language might find application in data analysis, particularly in the area of automated or assisted decision-making. Potential applications for the language of Epistemic Specifications include the following:

ˆ conformant planning;

ˆ autonomous robot control;

ˆ assisting legal professionals (e.g., logical analysis of criminal evidence); and

ˆ any application for which ASP is currently used but where the additional power of Epistemic Specifications might be needed due to incomplete information.

We will only briefly touch on one of these possible applications, that of conformant planning. Conformant planning [Smith & Weld, 1998] is the problem of finding a plan (i.e., a sequence of actions) that is guaranteed to achieve a goal in spite of incomplete knowledge about the initial state. For simplicity, we assume the effect of an action is deterministic. Much research on the use of ASP for the development of a conformant planner has been done in the past decade by Gelfond, Morales, Son, Tu [Tu et al., 2011]), and others. We outline here an alternative approach that uses the language of Epistemic Specifications. Familiarity with the topic is assumed. Special handling of executability conditions for actions and the prohibition of contradictory effects of an action will be required for soundness of this approach.

28 Texas Tech University, Patrick Thor Kahl, May 2014

The following pseudocode is a simple framework for a conformant planner written in the language of Epistemic Specifications to show its potential use. World views correspond to conformant plans in that every belief set in a world view will contain literals representing the same sequence of actions. The ASP extension known as a choice rule as well as built-in binary-relation operator are accepted extensions here.

% — conformant planning module ——————————————————————————< occurs A, S M occurs A, S , action A , step S ,S n. % n is the horizon occurs A ,S , occurs A ,S ,A A , action A , action A , step S . ( 1) ← ( 2 ) 1 (2 ) ( 1) < 2 success goal n , not executable. ← ( ) ( ) ≠ ( ) ( ) ( ) success, not K success. ← ( ) ¬ not M success. ← ←% — domain independent module —————————————————————————– timestep definition and the inertia & awareness axiom rules

⟨% — domain dependent module ——————————————————————————⟩ rules defining actions & fluents dynamic domain description: state transition & executability condition rules ⟨ ⟩ %⟨ — problem instance module ——————————————————————————–⟩ maximum number of steps defined and rules defining the initial & goal states

We⟨ assume a high-level such as [Gelfond & Lifschitz, 1993],⟩ [Turner, 1997], [Baral & Gelfond, 2000, GelfondA & Kahl, 2014], or AC[Gelfond & Inclezan,AL 2009, Inclezan, 2012], is used to model the dynamicALM domain—defining the transition from one state to the next as a result of an action occurring at any particular step—with associated translation to logic programming rules defined appropriately, but with special translation for executability conditions as described later. For simplicity, concurrent and exogenous actions are disallowed, and all fluents are assumed inertial. To illustrate, consider the following dynamic system description (given in action language ) about a turkey hunter that enjoys shooting a gun: shoot causes dead if loaded. AL shoot causes happy. impossible shoot if loaded.

¬ 29 Texas Tech University, Patrick Thor Kahl, May 2014

The first statement states that action shoot causes fluent dead to be true if precon- dition loaded (another fluent) is true. The second statement states that shoot causes fluent happy to be true without precondition. The third statement is an executability condition on shoot stating that it is not possible for shoot to occur if loaded is false. A reasonable translation of this dynamic system description to logic programming rules might be the following:

% timestep declaration

step 0..n . % n is the horizon, i.e., a numeric constant limiting the step count

% inertia( &) awareness axioms holds F,S 1 holds F,S , not holds F,S 1 , fluent F , step S ,S n.

holds( F,S+ )1← holds( F,S) , not¬ holds( F,S+ )1 , fluent( F) , step( S) ,S< n. ¬holds F,( 0 +or) ←holds¬ F,(0 )fluent F . ( + ) ( ) ( ) < % action( &) fluent¬ declarations( ) ← ( ) action shoot .

fluent( dead ). fluent loaded . fluent happy . % dynamic( domain) description( rules) ( ) holds dead, S 1 occurs shoot, S , holds loaded, S , step S ,S n.

holds(happy, S+ )1← occurs( shoot, S) , step(S ,S n.) ( ) < executable( occurs+ ) ← shoot,( S , holds) loaded,( ) S <, step S . Note that the translation of the executability condition (last line above) is different ¬ ← ( ) ¬ ( ) ( ) from the traditional translation as given in [Gelfond & Kahl, 2014]. This is the special translation mentioned earlier. In general, an executability condition of the form

impossible a if f1, ..., fm. will be translated as

∗ ∗ execuatable occurs a, S , h f1,S , ..., h fm,S , step S .

∗ where¬h f, S denotes← holds( f, S) if (f is atomic) and( holds) α,( S) if f α. This translation( is) necessary for use( of) the proposed conformant¬ planning( ) module.= ¬ Note also that on the previous page, literal executable appears in the third line of the conformant planning module and is not¬ part of the dynamic system description.

30 Texas Tech University, Patrick Thor Kahl, May 2014

Consider the result if we have the following information about the initial and goal states:

% initial state (with incomplete information concerning fluent loaded) holds dead, 0 .

¬holds(happy,)0 . ¬% goal states( (goal) achieved if either fluent dead or happy is true) goal S holds dead, S , step S .

goal(S) ← holds(happy, S) , step( S) . With this( scenario,) ← no( goal state) is not( able) to be reached if fluent loaded is initially false since there is no action in the dynamic system description for loading the gun; hence, there is no conformant plan for this domain and initial state. Used with the proposed framework (and horizon constant n set to any positive integer), there is no world view, corresponding correctly to the fact that there is no conformant plan.

Now let’s modify the dynamic system description by adding the following causal law: load causes loaded.

Translation adds the following logic programming rules: action load .

holds (loaded,) S 1 occurs load, S , step S ,S n. With the same( initial+ and) ← goal states( as before) and( used) with< the proposed framework (and horizon constant n set to 2), there is one world view with both of its two belief sets containing the literals occurs load, 0 and occurs shoot, 1 , corresponding to the conformant plan of first loading( and then) shooting the( gun. )

31 Texas Tech University, Patrick Thor Kahl, May 2014

CHAPTER VIII RELATED WORK

In [Lobo et al., 2001], Lobo, Mendez, and Taylor describe action language Ak as a tool for modeling dynamic systems, providing a translation from statements in

Ak to epistemic logic programming rules. The translation assumes Gelfond’s 1994 version of Epistemic Specifications. Domain descriptions in Ak allow concurrent and nondeterministic actions, as well as sensing actions. At the time this paper was written, there was no extant epistemic logic program solver, and the computational properties of epistemic logic programs were unknown. It may prove useful to revisit the formalisms presented in this paper to see how they are affected by the new version of the language as proposed in this dissertation. In [Zhang, 2006], Yan Zhang investigated the computational properties of epis- temic logic programs, which also led him to develop an algorithm for computing world views. This effort culminated in the development of a solver known as Wviews [University of Western Sydney AI Research Group, 2007] developed by Kelly as part of his Honours Thesis work [Kelly, 2007]. Wviews is based on the 1994 semantics and relies on the ASP grounder-solver DLV [DLVSYSTEM s.r.l., 2012]. In [Preda, 1997, Preda, 2007], Preda offers an alternative to Epistemic Specifi- cations through the use of multiple levels of not that allows avoidance of certain unintended results. In [Preda, 2007], he defines a language with up to two levels of not called LP2N. An automatic process for translating an epistemic logic program to an LP2N counterpart is also described. Although Preda praises the language of Epistemic Specifications as being clear and friendly, he argues that the “complexity of the reasoning” is too high and offers instead what he calls a “polynomial approxima- tion” that is able to represent epistemic information. The “answer set” of an LP2N is analogous to the intersection of all answer sets of an atomic ASP program without constraints but with the added notion of two levels of not per his definition. In [Truszczy´nski,2011], Truszczy´nski offered alternative semantics to Gelfond’s

32 Texas Tech University, Patrick Thor Kahl, May 2014 original [Gelfond, 1991] by using Kleene’s three-valued logic [Kleene, 1952]. It was not Truszczy´nski’sgoal to address the issue of unintended world views; nonethe- less, his added requirement that a world view be non-empty eliminated one form of unintended world view, whereas his additional requirement that belief sets of a world view be consistent put the language more in sync with modern ASP seman- tics, eliminating the world view containing the set of all literals. Later in the paper, a two-valued logic was used to provide a semantic framework in which three differ- ent languages based on Epistemic Specifications were defined. Truszczy´nskiwent on to derive complexity results for Epistemic Specifications that suggest the language is strictly more expressive than ASP. Finally, he elaborated on the use of the lan- guage for modeling various problems that require meta-reasoning, referring to recent works by Faber and Woltran [Faber & Woltran, 2009, Faber & Woltran, 2011] that deal with so-called manifold programs and their applications. In [Faber & Woltran, 2011], Faber and Woltran presented a framework for com- bining ASP programs in a manner that allows consequences of programs to be used as input to other programs. They also presented a technique for compiling such a frame- work into a single ASP program using the concept of manifold programs. A manifold program is an expanded encoding of an ASP program that allows for reasoning about the consequences of its answer sets from within the encoding, thus providing a limited capacity for introspective reasoning similar to that provided by modal operators in the language of Epistemic Specifications. Their approach relies on the ASP extension known as weak constraints [Buccafurri et al., 2000]. For certain epistemic logic pro- grams, the methods described by Faber and Woltran may provide an efficient method for finding world views. Gelfond’s 2011 paper [Gelfond, 2011] was the latest publication proposing an up- date to the semantics of Epistemic Specifications, with a stated goal of eliminating unintended world views. His new reduct solved the problem of unintended world views associated with K and M; however, the problem of unintended world views associated with recursion through¬ M remained. This dissertation can be considered

33 Texas Tech University, Patrick Thor Kahl, May 2014 a continuation of that work. Cui, Z. Zhang, and Zhao [Cui et al., 2012] investigated the problem of grounding an epistemic logic program. That work culminated in the development of a grounder known as ESParser. Their more recent efforts [Zhang et al., 2013] include the de- velopment of an associated solver called ESmodels that relies on ASP solver claspD [Potassco, 2014]. ESmodels is based on Gelfond’s 2011 version of Epistemic Specifica- tions [Gelfond, 2011]. The algorithm given for ESmodels uses an approach that is (at its core) much like the one used in the algorithm presented in this dissertation. They also include an algorithm optimization referred to as “EFFICIENT ESMODELS.”

34 Texas Tech University, Patrick Thor Kahl, May 2014

CHAPTER IX CONCLUSIONS AND FUTURE WORK

9.1 Conclusion The version of Epistemic Specifications defined herein hopefully lays to rest the problem of unintended world views that had remained unresolved for the past two decades. The new semantics eliminates unintended world views stemming from recur- sion through modal operators, while the requirement that world views be non-empty and contain only consistent sets eliminates still other sources of unintended world views and puts Epistemic Specifications in sync with current ASP semantics. We believe these changes represent a significant improvement to the language, making it arguably closer to the intuitive meaning, and thus better suited for knowledge representation and reasoning, and the design of intelligent agents. The program simplification methods and algorithm will hopefully lead to an effi- cient implementation of an epistemic logic program solver that will allow the language to be of more practical use. Applications such as the conformant planner show the potential of Epistemic Specifications for modeling complex tasks. Such applications also show that programs with multiple world views can be useful in problem solving. Finally, as a suggestion for improving the ability of a programmer to correctly model problems and domains using the language of Epistemic Specification, we propose the following as new informal renderings of subjective literals.

K ` ≈ “` is concluded” M ` ≈ “` is derivable”

9.2 Future Work Future work includes implementing the algorithm presented herein to create an epistemic logic program grounder-solver. A proof-of-concept is in development that is a loosely-coupled system using the Potassco [Potassco, 2014] tools gringo and clasp.

35 Texas Tech University, Patrick Thor Kahl, May 2014

If successful, it is hoped that a more tightly-coupled system will be developed that is incorporated directly into a state-of-the-art ASP system. It has also been noted that the algorithm requires all rules to be safe. If the signature of a program—including the sorts (domain) for terms of predicates and functions—is explicitly provided, rule safety can be guaranteed which would allow a somewhat simpler algorithm to be used. One way to accomplish this is to extend SPARC [Balai et al., 2013a, Balai et al., 2013b], a version of ASP with sorted sig- natures. Such an extension is described in [Balai & Kahl, 2014], with a condensed version included in Appendix C. A proof-of-concept solver [Balai, 2014a] for epistemic logic programs with sorts (ELPS) has recently been developed by Balai. That effort demonstrates that finding the world views of certain epistemic logic programs can be done effectively, though it is known that the space requirements grow exponentially with the number of distinct ground subjective literals with current implementation. There are several ideas for improving the efficiency of the algorithm. Certainly the approach proposed in [Zhang et al., 2013] should be considered. Splitting the program (using the splitting set theorem for Epistemic Specifications [Watson, 2000]) also has potential for reducing computational cost when subjective literals are inde- pendent. The key seems to be in finding an efficient way to identify the independence of subjective literals. Another potential option for reducing computational costs may be to extend the language by providing a syntactic construct that provides the pro- grammer with a way to explicitly specify the independence of subjective literals based on their ground arguments—something along the lines of choice rules in ASP, where the underlying implementation might be as simple as a nested loop. Once a reliable and reasonably efficient implementation exists, research to find practical applications and methodologies for solving problems for which the language of Epistemic Specifications seems ideally suited will be warranted. The proposed framework for conformant planning is one such application. Although this application shows real promise, it would also be a nice addition if it offered constructive feedback whenever a conformant plan does not exists. For instance, in

36 Texas Tech University, Patrick Thor Kahl, May 2014 the turkey hunter example, there is an obvious deficiency in that no provision was given in the original dynamic system description for loading the gun. If the hunter were to go hunting with no means for loading the gun, it would indicate an undue lack of preparedness. A conformant planning system that provides some sort of feedback—perhaps a minimal set of conditions—indicating what could be changed in order to have a conformant plan when none exists might significantly improve its usefulness. The following might suffice for the turkey hunter example: 1. ¬loaded is possible initially 2. loaded is required for success 3. no action causes loaded This suggests some form of automated diagnostics involving meta-reasoning. Although limited research [Balduccini & Gelfond, 2003a] on diagnosis using ASP has been done, and the addition of weak constraints [Buccafurri et al., 2000] and/or consistency restoring (CR) rules [Balduccini & Gelfond, 2003b] to ASP are helpful in this regard, we believe Epistemic Specifications—with its more powerful ability to do introspective reasoning—may be better suited for diagnostic reasoning problems. The following are properties we conjecture should apply to an epistemic logic program with respect to its world views.

1. If both W1 and W2 are world views of an epistemic logic program and W1 W2,

then there is no bijection f W1 W2 where A W1 f A B A ≠B . n 2. A finite ground epistemic logic∶ program→ Π has∀ at most∈ ∶ (n ( )world= ) ∧ views( ⊆ where) 2 n is the number of distinct subjective literals occurring in Π. ⌊ ⌋ We believe it may be useful to determine if these properties‰ holdŽ under the semantics proposed, perhaps relating the set of world views of a program to a Sperner family. Finally, we would like to see how the new definition and associated algorithm are accepted by the logic programming community. If we are able to demonstrate that epistemic logic programs can be used for a large number of practical purposes, we believe interest in Epistemic Specifications will grow, resulting in improvements to solver efficiency and the discovery of even more areas for its use in problem solving.

37 Texas Tech University, Patrick Thor Kahl, May 2014

BIBLIOGRAPHY

[ASP Standardization Working Group, 2013] ASP Standardization Working Group (2013). ASP-Core-2 input language format, version 2.01c. Available at https://www.mat.unical.it/aspcomp2013/ASPStandardization/.

[Balai, 2014a] Balai, E. (2014a). ELPS. Texas Tech University. Software & documen- tation available for download at https://github.com/iensen/elps/wiki/.

[Balai, 2014b] Balai, E. (2014b). SPARC. Texas Tech University. Software & docu- mentation available for download at https://github.com/iensen/sparc/wiki/. [Balai et al., 2013a] Balai, E., Gelfond, M., & Zhang, Y. (2013a). SPARC–Sorted ASP with consistency restoring rules. CoRR, abs/1301.1386.

[Balai et al., 2013b] Balai, E., Gelfond, M., & Zhang, Y. (2013b). Towards answer set programming with sorts. In P. Cabalar & T. C. Son (Eds.), LPNMR 2013, volume 8148 of Lecture Notes in Artificial Intelligence: Springer-Verlag.

[Balai & Kahl, 2014] Balai, E. & Kahl, P. (2014). Epistemic logic programs with sorts. In M. Maratea & D. Inclezan (Eds.), ASPOCP 2014: Springer-Verlag. Sub- mitted for consideration.

[Balduccini, 2007] Balduccini, M. (2007). CR-MODELS: An inference engine for CR-Prolog. In C. Baral, G. Brewka, & J. Schlipf (Eds.), Proceedings of the 9th International Conference on Logic Programming and Non-Monotonic Reasoning (LPNMR’07), volume 3662 of Lecture Notes in Artificial Intelligence (pp. 18–30).: Springer.

[Balduccini & Gelfond, 2003a] Balduccini, M. & Gelfond, M. (2003a). Diagnostic reasoning with A-Prolog. CoRR, cs.AI/0312040.

[Balduccini & Gelfond, 2003b] Balduccini, M. & Gelfond, M. (2003b). Logic pro- grams with consistency-restoring rules. In International Symposium on Logical Formalization of Commonsense Reasoning, AAAI 2003 Spring Symposium Series (pp. 9–18).

[Balduccini & Son, 2011] Balduccini, M. & Son, T. C., Eds. (2011). Logic Program- ming, Knowledge Representation, and Nonmonotonic Reasoning—Essays Dedi- cated to Michael Gelfond on the Occasion of His 65th Birthday, volume 6565 of Lecture Notes in Computer Science. Springer.

[Baral, 2003] Baral, C. (2003). Knowledge Representation, Reasoning, and Declara- tive Problem Solving. Cambridge University Press.

[Baral & Gelfond, 2000] Baral, C. & Gelfond, M. (2000). Reasoning Agents in Dy- namic Domains, (pp. 257–279). Kluwer Academic Publishers: Norwell, MA.

38 Texas Tech University, Patrick Thor Kahl, May 2014

[Buccafurri et al., 2000] Buccafurri, F., Leone, N., & Rullo, P. (2000). Enhancing disjunctive datalog by constraints. IEEE Transactions on Knowledge and Data Engineering, 12(5), 845–860. [Cui et al., 2012] Cui, R., Zhang, Z., & Zhao, K. (2012). ESParser: An epistemic specification grounder. In J. P. Delgrande & W. Faber (Eds.), CSSS-12 (pp. 1823– 1827).: IEEE Computer Society CPS. [DLVSYSTEM s.r.l., 2012] DLVSYSTEM s.r.l. (2012). DLV. DLVSYSTEM s.r.l. (spin-off of University of Calabria), Rende, Italy. Software and documentation available for download at http://www.dlvsystem.com/. [Eiter et al., 2004] Eiter, T., Fink, M., Tompits, H., & Woltran, S. (2004). Simpli- fying logic programs under uniform and strong equivalence. In V. Lifschitz & I. Niemel¨a(Eds.), LPNMR-04, volume 2923 of Lecture Notes in Computer Science (pp. 87–99).: Springer. [Faber & Woltran, 2009] Faber, W. & Woltran, S. (2009). A framework for program- ming with module consequences. In [Vos & Schaub, 2009], (pp. 34–48). [Faber & Woltran, 2011] Faber, W. & Woltran, S. (2011). Manifold answer-set pro- grams and their applications. In [Balduccini & Son, 2011], (pp. 44–63). [Gebser et al., 2012] Gebser, M., Kaminski, R., Kaufmann, B., & Schaub, T. (2012). Answer Set Solving in Practice. Synthesis Lectures on Artificial Intelligence and Machine Learning. Morgan & Claypool Publishers. [Gelfond, 1991] Gelfond, M. (1991). Strong introspection. In T. L. Dean & K. McK- eown (Eds.), AAAI-91, volume 1 (pp. 386–391).: AAAI Press / The MIT Press. [Gelfond, 1994] Gelfond, M. (1994). Logic programming and reasoning with incom- plete information. Annals of Mathematics and Artificial Intelligence, 12(1–2), 89– 116. [Gelfond, 2011] Gelfond, M. (2011). New definition of epistemic specifications. In J. P. Delgrande & W. Faber (Eds.), LPNMR-11, volume 6645 of Lecture Notes in Computer Science (pp. 260–265).: Springer. [Gelfond & Inclezan, 2009] Gelfond, M. & Inclezan, D. (2009). Yet another modular action language. In [Vos & Schaub, 2009], (pp. 64–78). [Gelfond & Kahl, 2014] Gelfond, M. & Kahl, Y. (2014). Knowledge Representation, Reasoning, and the Design of Intelligent Agents: The Answer-Set Programming Approach. Cambridge University Press. [Gelfond & Lifschitz, 1988] Gelfond, M. & Lifschitz, V. (1988). The stable model semantics for logic programming. In R. A. Kowalski & K. A. Bowen (Eds.), ICLP/SLP-88 (pp. 1070–1080).: The MIT Press.

39 Texas Tech University, Patrick Thor Kahl, May 2014

[Gelfond & Lifschitz, 1991] Gelfond, M. & Lifschitz, V. (1991). Classical negation in logic programs and disjunctive databases. New Generation Computing, 9(3/4), 365–385.

[Gelfond & Lifschitz, 1993] Gelfond, M. & Lifschitz, V. (1993). Representing action and change by logic programs. Journal of Logic Programming, 17(2–4), 301–321. Special Issue: Non-Monotonic Reasoning and Logic Programming.

[Helsinki University of Technology, 2010] Helsinki University of Technology (2010). Lparse, Smodels. Aalto University, Helsinki. Software and documentation avail- able for download at http://www.tcs.hut.fi/Software/smodels/.

[Inclezan, 2012] Inclezan, D. (2012). Modular Action Language for Dynamic Domain Representation. Phd dissertation, Texas Tech University. ALM [Kelly, 2007] Kelly, M. (2007). Wviews: A worldview solver for epistemic logic pro- grams. Honours thesis, University of Western Sydney.

[Kleene, 1952] Kleene, S. C. (1952). Introduction to Metamathematics. University Series in Higher Mathematics. Princeton, NJ: D. Van Nostrand.

[Lifschitz et al., 2001] Lifschitz, V., Pearce, D., & Valverde, A. (2001). Strongly equivalent logic programs. ACM Transactions on Computational Logic, 2(4), 526– 541.

[Lifschitz et al., 1999] Lifschitz, V., Tang, L. R., & Turner, H. (1999). Nested ex- pressions in logic programs. Annals of Mathematics and Artificial Intelligence, 25, 369–389.

[Lobo et al., 2001] Lobo, J., Mendez, G., & Taylor, S. R. (2001). Knowledge and the action description language A . Theory and Practice of Logic Programming, 1, 129–184.

[Potassco, 2014] Potassco (2014). clasp, claspD, clingo, gringo. Univer- sity of Potsdam. Software and documentation available for download at http://potassco.sourceforge.net/.

[Preda, 2007] Preda, M. (2007). Modeling epistemic knowledge about users. In R. Revetria, A. Cecchi, M. Schenone, V. M. Mladenov, & A. Zemliak (Eds.), ACS’07 (pp. 69–74). Stevens Point, WI: World Scientific and Engineering Academy and Society (WSEAS).

[Preda, 1997] Preda, M. C. (1997). Reasoning with epistemic information. Annals of the University of Craiova, 24, 166–186.

40 Texas Tech University, Patrick Thor Kahl, May 2014

[Smith & Weld, 1998] Smith, D. E. & Weld, D. S. (1998). Conformant graphplan. In Proceedings of the 15th National Conference on Artificial Intelligence/10th Confer- ence on Innovative Applications of Artificial Intelligence, AAAI-98/IAAI-98 (pp. 889–896).: AAAI.

[Truszczy´nski,2011] Truszczy´nski,M. (2011). Revisiting epistemic specifications. In [Balduccini & Son, 2011], (pp. 315–333).

[Tu et al., 2011] Tu, P. H., Son, T. C., Gelfond, M., & Morales, A. R. (2011). Approx- imation of action theories and its application to conformant planning. Artificial Intelligence, 175(1), 79–119.

[Turner, 1997] Turner, H. (1997). Representing actions in logic programs and default theories: A approach. Journal of Logic Programming, 31(1–3), 245–298.

[University of Western Sydney AI Research Group, 2007] University of Western Sydney AI Research Group (2007). Wviews. UWS AI Research Group (Intelligent Systems Laboratory). Software and documentation available for download at http://staff.scm.uws.edu.au/%7eyan/Wviews.html.

[van Harmelen et al., 2008] van Harmelen, F., Lifschitz, V., & Porter, B., Eds. (2008). Handbook of Knowledge Representation. Foundations of Artificial Intel- ligence. Elsevier.

[Vos & Schaub, 2009] Vos, M. D. & Schaub, T., Eds. (2009). Proceedings of the 2nd International Workshop on Software Engineering for Answer Set Programming (SEA 2009).

[Watson, 2000] Watson, R. (2000). A splitting set theorem for epistemic specifica- tions. In C. Baral & M. Truszczy´nski(Eds.), NMR-00: CoRR.

[Zhang, 2006] Zhang, Y. (2006). Computational properties of epistemic logic pro- grams. In P. Doherty, J. Mylopoulos, & C. A. Welty (Eds.), KR-06 (pp. 308–317).: AAAI Press.

[Zhang et al., 2013] Zhang, Z., Zhao, K., & Cui, R. (2013). ESmodels: An inference engine of epistemic specifications. In J. Luo (Ed.), ICTAI 2013 (pp. 769–774).: IEEE.

41 Texas Tech University, Patrick Thor Kahl, May 2014

APPENDIX A PROOFS

A.1 Soundness and Completeness of the Algorithm

To begin, we make note of the fact that if a non-ground input program Π having only safe rules and an equivalent finite ground representation is given as input to the algorithm, one of the results of performing step 2 of the algorithm is the ground

′′ ′′ ASP program Πground. We claim that Πground represents a generic modal reduct of an equivalent finite ground representation of Π with respect to any one of a collection of hypothetical W ’s where each W is a member of a different set WSatKM(Π) of non-empty collections of consistent sets of literals in the language of Π for which the members of WSatKM(Π) all satisfy the elements of SatKM Π where SatKM Π is a subset of the set of all distinct ground subjective literals occurring( ) in the ground( ) version of Π. We will use this later in the proofs. It is clear that, given a non-ground epistemic logic program Π as input to the algo- rithm, the result of step 1 is an ASP program Π′ such that any (extended) subjective literal with non-ground terms in Π is represented in Π′ by a fresh (extended) ASP lit- eral with the same non-ground terms. Although it may seem clear that ASP program Π′ has the same grounding of terms (for corresponding literals) as the original epis- temic logic program Π, in practice, so-called smart grounders may ground otherwise. In fact, an implementation of the algorithm may take advantage of smart grounding in order to allow certain infinite programs to be represented by an equivalent finite ground program. In the following proofs, the initial assumption that the input program is a finite ground epistemic logic program will be made for simplicity. Appropriate grounding will be assumed if this assumption were to be removed. Notational conventions given at the beginning of Chapter IV will be used here as well.

A-1 Texas Tech University, Patrick Thor Kahl, May 2014

Proof. [Proof of Theorem 1: Soundness of the Algorithm] Theorem 1. [The Algorithm Is Sound] Let Π be an epistemic logic program with only safe rules and having an equivalent finite ground representation. Given Π as input, if W is output by Algorithm 1 then W is a world view of Π.

Proof Preliminaries. We begin by stating the conditions used later in the proof of Theorem 1, and include a simple example to help provide intuition with respect to later arguments.

1. Let Π be a finite ground epistemic logic program that is input to the algorithm.

2. The replacement of subjective literals of the form K ` with not k `, ` and

the replacement of subjective literals of the form not K ` with ¬ k ` along with the associated added rules, emulate a part of the modal reduct¬ of Π with respect to a non-specific W. The case where W satisfies K ` is covered by ` being added to the rule body and the added rule k ` k1 `, not `. The case

where W does not satisfy K ` is covered by the added¬ ← rule k ` k0 `. Note here that the intended meaning of k1 ` is “K ` is satisfied by¬ W ”← whereas the intended meaning of k0 ` is “K ` is not satisfied by W.” The other associated added rules provide for separate generation of k1 ` and k0 ` in sync with other k-/m-atoms.

3. The replacement of subjective literals of the form M ` with m ` and the replacement of subjective literals of the form not M ` with not m ` along with the associated added rules, emulate a part of the modal reduct of Π with respect to a non-specific W. The case where W satisfies M ` is covered by the added rule m ` m1 `. The case where W does not satisfy M ` is covered

by the added rule← m ` m0 `, `. Note here that the intended meaning of m1 ` is “M ` is satisfied by← W ” whereas the intended meaning of m0 ` is “M ` is not satisfied by W.” The other associated added rules provide for separate generation of m1 ` and m0 ` in sync with other k-/m-atoms.

A-2 Texas Tech University, Patrick Thor Kahl, May 2014

4. From 2 and 3 it is fairly easy to see that the modal reduct of Π with respect to a particular W is emulated by appropriate k-/m-atoms corresponding to the particular subjective literals in Π that are either true or false in W.

For example, let’s consider the following program Π0:

p or q. r K p.

′′ Step 2← of the algorithm results in Π0ground as follows: p or q. r not k p, p. k1 p not k0 p. ← ¬ k0 p not k1 p. ← k0 p k1 0p. ← k0 p m1 0p. ← k0 p m0 p. ← k p k0 p. ← k p k1 p, not p. ¬ ← whose¬ answer← sets are

k0 p, k p, p , k0 p, k p, q , { ¬ } k1 p, p, r , and { ¬ } k1 p, k p, q . { }

Let’s{ consider¬ W0a} p, r and see how this program emulates the modal reduct of Π with respect to W . From Definition 12, ΠW0a is as follows: 0 = {{ }}0a 0 p or q.

r p. % K p is satisfied by W0a

whose answer← sets are

p, r and q .

{ } { } A-3 Texas Tech University, Patrick Thor Kahl, May 2014

Since K p is satisfied by W0a, we need to consider the case where k1 p is true,

′′ i.e., k1 p is in an answer set A, when we look at Π0ground. For this case, the following will also be true:

ˆ k0 p will not be in A;

ˆ if p is in A, then k p will not be in A; hence, not k p will be satisfied

and—where it was¬ used in the replacement of K p—it will¬ (per the Gelfond- Lifschitz reduct) be removed from the rule, leaving p as the only remaining part of the replacement of K p (as dictated by the modal reduct since K p is satisfied); and

ˆ if p is not in A, then since K p was replaced by not kp, p, the result is

same as per the reduct (K p being replaced by p) since p¬is not satisfied and W0a (hence) the body of the corresponding rule in Π0 wouldn’t be satisfied. Thus, if we focus only on the case where k1 p is satisfied, the program emulates

W0a ′′ Π0 . The answer sets of Π0ground that contain k1 p are as follows: k1 p, p, r and k1 p, k p, q .

W0a which—modulo{ } the k-literals—are{ ¬ the} same as those for Π0 .

Now let’s consider W0b p , q and see how the program emulates the modal reduct of Π with respect to W . From Definition 12, ΠW0b is as follows: 0 = {{ } {0b }} 0

p or q. % second rule deleted as K p is not satisfied by W1b whose answer sets are

p and q .

Since{K}p is not{ } satisfied by W0b, we need to consider the case where k0 p is ′′ satisfied (i.e., k0 p is in an answer set A) when we look at Π0ground. For this case, the following will also be true:

ˆ k1 p will not be in A; and ˆ k p will be in A so not k p will not be satisfied, and—where it was

¬used in the replacement of ¬K p—it will (per the Gelfond-Lifschitz reduct)

A-4 Texas Tech University, Patrick Thor Kahl, May 2014

result in the rule being deleted from the program, which is the same as that dictated by the modal reduct.

Thus, if we focus only on the case where k0 p is satisfied, the program emulates

W0b ′′ Π0 . The answer sets of Π0ground that contain k0 p are as follows: k0 p, k p, p and k0 p, k p, q .

W0b which—modulo{ ¬ the} k-literals—are{ ¬ the} same as those for Π0 .

Proof of Theorem 1. We observe the fact that the added rules given in step 1 of the algorithm have fresh literals in their heads (in other words, the literals in the heads of the added rules are guaranteed not to occur in any of the original rules of the program). We also note that the added rules cannot in of themselves cause the program to be inconsistent as the set of all literals from the heads of these rules does not contain any pair of contradictory literals.

We wish to show that the expressions that replaced the subjective literals of Π correctly emulate the associated modal reduct of Π with respect to a hypothet- ical set W of sets of literals for which a particular truth value assignment for each distinct subjective literal of Π would be in accordance with Definition 12.

We will look at each case separately. Recall that we began with the assumption

′ ′′ that Π was a ground finite epistemic logic program; thus, Π Πground in the ′ algorithm. Hence, for notational ease, we use Π in this part of= the proof. Case 1: K ` Satisfied This is the case where k1 ` (interpreted as “K ` is considered true”) is true.

(a) If a subjective literal of the form K ` occurs in a rule R Π, then the

′ ′ corresponding rule R Π has not k `, ` in its place per∈ step 1 of the algorithm. Likewise, if∈ a subjective¬ literal of the form not K ` occurs in R, then R′ has k ` in its place.

¬

A-5 Texas Tech University, Patrick Thor Kahl, May 2014

(b) Assume k1 ` is true. Note that the rules added in step 1 of the algorithm do not support k0 ` being true at the same time; thus, not k0 ` is true. (c) Since k1 ` is true and not k0 ` is true, the added rule k ` k0 `. is worthless, and the added rule ¬ ← k ` k1 `, not `. means that k ` is true if not ` is true, and—since there are no other ¬ ← applicable rules—¬ not k `, ` is true only if ` is true. (d) From (c) we know that¬not k `, ` is only true if ` is true. Also, if ` is in the body of a rule, the rule cannot¬ provide support for `. It is therefore clear that the replacement of K ` in Π with not k `, ` in Π′ and the addition of

associated rules from step 1 of the algorithm¬ correctly emulates the part of the modal reduct where K ` is replaced by ` when K ` is satisfied by an appropriate W (i.e., a W where ` is in every belief set of W ). (e) Likewise, it is also clear from (c) that the replacement of not K ` in Π with k ` in Π′ and the addition of associated rules from step 1 of the

algorithm¬ correctly emulates the part of the modal reduct where not K ` is replaced by not ` when not K ` is not satisfied by an appropriate W (i.e., a W where ` is in every belief set of W ).

Case 2: K ` Not Satisfied This is the case where k0 ` (interpreted as “K ` is considered false”) is true.

(a) If a subjective literal of the form K ` occurs in a rule R Π, then the

′ ′ corresponding rule R Π has not k `, ` in its place per∈ step 1 of the algorithm. Likewise, if∈ a subjective¬ literal of the form not K ` occurs in R, then R′ has k ` in its place.

(b) Assume k0 ` is¬ true. (c) Since k0 ` is true the added rule k ` k0 `.

¬ ← A-6 Texas Tech University, Patrick Thor Kahl, May 2014

means that k ` is also true.

(d) From (c) we¬ know that not k ` cannot be true, and, thus—per the ′ Gelfond-Lifschitz reduct—any¬ rule in Π with not k ` in its body will be deleted. It is therefore clear that the replacement¬ of K ` in Π with not k `, ` in Π′ and the addition of associated rules from step 1 of the

algorithm¬ correctly emulates the part of the modal reduct where a rule containing K ` is deleted when K ` is not satisfied by an appropriate W (i.e., a W where ` is missing from at least one belief set of W ).

(e) Likewise, it is also clear from (c) that the replacement of not K ` in Π with k ` in Π′ and the addition of associated rules from step 1 of the

algorithm¬ correctly emulates the part of the modal reduct where not K ` is removed when not K ` is satisfied by an appropriate W (i.e., a W where ` is missing from at least one belief set of W ).

Case 3: M ` Satisfied This is the case where m1 ` (interpreted as “M ` is considered true”) is true.

(a) If a subjective literal of the form M ` occurs in a rule R Π, then the

′ ′ corresponding rule R Π has m ` in its place per step 1 of the∈ algorithm. ′ Likewise, if a subjective∈ literal of the form not M ` occurs in R, then R has not m ` in its place. (b) Assume m1 ` is true. (c) Since m1 ` is true the added rule m ` m1 `. means that m ` is also true. ← (d) From (c) it is clear that the replacement of M ` in Π with m ` in Π′ and the addition of associated rules from step 1 of the algorithm correctly emulates the part of the modal reduct where M ` is removed when M ` is satisfied by an appropriate W (i.e., a W where ` is in at least one belief set of W ).

A-7 Texas Tech University, Patrick Thor Kahl, May 2014

(e) Likewise, it is clear from (c) that not m ` cannot be true, and, thus— per the Gelfond-Lifschitz reduct—any rule in Π′ with not m ` in its body will be deleted. It is therefore clear that the replacement of not M ` in Π with not m ` in Π′ and the addition of associated rules from step 1 of the algorithm correctly emulates the part of the modal reduct where a rule containing not M ` is deleted when not M ` is not satisfied by an appropriate W (i.e., a W where ` is in at least one belief set of W ).

Case 4: M ` Not Satisfied This is the case where m0 ` (interpreted as “M ` is considered false”) is true.

(a) If a subjective literal of the form M ` occurs in a rule R Π, then the

′ ′ corresponding rule R Π has m ` in its place per step 1 of the∈ algorithm. ′ Likewise, if a subjective∈ literal of the form not M ` occurs in R, then R has not m ` in its place. (b) Assume m0 ` is true. Note that the rules added in step 1 of the algorithm do not support m1 ` being true at the same time; thus, not m1 ` is true. (c) Since m0 ` is true and not m1 ` is true, the added rule m ` m1 `. is worthless, and the added rule ← m ` m0 `, not not `. means that m ` is true if not not ` is true, and—since there are no other ← applicable rules—not m ` is true only if not ` is true.1 (d) From (c) we know that m ` is only true if not not ` is true. It is therefore clear that the replacement of M ` in Π with m ` in Π′ and the addition of associated rules from step 1 of the algorithm correctly emulates the part of the modal reduct where M ` is replaced by not not ` when M ` is not satisfied by an appropriate W (i.e., a W where ` is missing from every belief set of W ).

1Per Proposition 4(v) of [Lifschitz et al., 1999], not not not ` ⇔ not `.

A-8 Texas Tech University, Patrick Thor Kahl, May 2014

(e) Likewise, it is also clear from (c) that the replacement of not M ` in Π with not m ` in Π′ and the addition of associated rules from step 1 of the algorithm correctly emulates the part of the modal reduct where not M ` is replaced by not ` when not M ` is satisfied by an appropriate W (i.e., a W where ` is missing from every belief set of W ).

5. After computing the answer sets in step 2 of the algorithm, each group of answer sets from step 3 will represent the answer sets of a particular modal reduct of Π with respect to a hypothetical W for which the k-/m-atoms of the form k0 `, k1 `, m0 `, and m1 ` in the answer sets of the group represent whether it is intended that W satisfies/does not satisfy the respective corresponding subjective literals in Π.

This is illustrated with example program Π0 by organizing the answer sets of

′′ Π0ground into two groups, i.e, those containing k1 p: k1 p, p, r and k1 p, k p, q ;

and those{ containing} {k0 p: ¬ }

k0 p, k p, p and k0 p, k p, q .

As demonstrated{ ¬ previously,} { it¬ is clear} that each of these groups represents a candidate world view of Π corresponding to the answer sets of a different modal reduct of Π with respect to a different W . Each W is a representative member of a distinct set of the possible sets of non-empty collections of consistent sets of literals for which all members satisfy the same subjective literals of Π.

For Π0, there are only two such possible sets: one where the members all satisfy

K p, and the other where none of the members satisfy K p. W0a is a member of

the first, and W0b is a member of the second.

6. Step 4 of the algorithm enforces the intended meaning of k-/m-atoms of the form k0 `, k1 `, m0 `, and m1 `, and is analogous to checking if, for each group representing a candidate world view of Π, there exists a W for which

A-9 Texas Tech University, Patrick Thor Kahl, May 2014

W AS ΠW where W satisfies/does not satisfy the respective corresponding

subjective= ( literals) in Π according to Definition 12. This determines if a candidate world view of Π is a world view of Π. Step 4(a) verifies that every subjective literal of the form K ` (complementarily, not K `) in the candidate world view that was considered to be true (false) in W is satisfied (not satisfied) by W (i.e., W is thrown out if k1 ` is in the sets of W and ` is not in every set of W ). Step 4(b) verifies that every subjective literal of the form K ` (complementarily, not K `) in the candidate world view that was considered to be false (true) in W is not satisfied (satisfied) by W . Step 4(c) verifies that every subjective literal of the form M ` (complementarily, not M `) in the candidate world view that was considered to be true (false) in W is satisfied (not satisfied) by W . Step 4(d) verifies that every subjective literal of the form M ` (complementarily, not M `) in the candidate world view that was considered to be false (true) in W is not satisfied (satisfied) by W.

Of the two candidate world views for Π0, k0 p, k p, p , k0 p, k p, q is the

only one that represents a world view of Π{{because¬ k1}p,{ p, r , ¬k1 p, }}k p, q contains a belief set that does not contain p, failing{{ step 4(a)} of{ the algorithm.¬ }}

7. Arguments 5 and 6 of the proof ensure that the choices of k-/m-atoms are consistent with W. Cases 1–4 proved that, for given k-/m-atoms, the behavior of rules corresponds to the modal reduct of an associated W ; hence, the theorem is proven.

Proof. [Proof of Theorem 2: Completeness of the Algorithm] Theorem 2. [The Algorithm Is Complete] Let Π be an epistemic logic program with only safe rules and having an equivalent finite ground representation. Given Π as input, if W is a world view of Π then W is output by Algorithm 1.

A-10 Texas Tech University, Patrick Thor Kahl, May 2014

Proof of Theorem 2. In order to prove the theorem, we will need the following definitions and two lemmas.

1. Let Π be a finite ground epistemic logic program that is input to the algorithm.

2. Let Lit Π denote the set of all extended literals occurring in Π with modal

operators( and) default negation removed. 3. Let Con 2Lit(Π denote the set of all consistent sets of literals in the power set

of Lit Π(. (This) is the set of all possible belief sets of Π.) 4. Let KM-( lit) Π denote the set of all extended subjective literals occurring in Π

with default( negation) removed. 5. Let SatKM Π denote a subset of KM-lit Π for which the subjective literals

in SatKM Π( )are to be considered satisfied( ) (or true). (This can be seen as corresponding( ) to truth value assignments to distinct subjective literals.)

6. Let WSatKM(Π) denote the set of all non-empty sets W of consistent sets of liter- als in the language of Π for which every subjective literal s (possibly preceded by

not) occurring in Π is true in W iff s SatKM Π ; i.e., WSatKM(Π) W W Lit(Π) W Con 2 s KM-lit∈ Π W( )s iff s SatKM Π= { . S( ≠

∅) ∧ ( ∈ ( )) ∧ (∀ ∈ W1 ( W)2∶ ⊧ ∈ ( ))} Lemma 1. W1,W2 WSatKM(Π) Π Π .

Proof of Lemma∀ 1. ∈ ∶ =

Since W1 and W2 are both elements of WSatKM(Π), every subjective literal in Π

that is satisfied by W1 is also satisfied by W2, and every subjective literal not

W W satisfied by W1 is also not satisfied by W2; hence, Π 1 Π 2 by Definition 12.

= Lemma 2. At most one set in WSatKM(Π) is a world view of Π. Proof of Lemma 2.

If there is no set W WSatKM(Π) for which W is a world view of Π, then

Lemma 2 holds (trivially).∈ Let us now suppose that there exists a set W WSatKM(Π) for which W is a world view of Π. By Definition 13, since W is a∈

A-11 Texas Tech University, Patrick Thor Kahl, May 2014

world view of Π, W AS ΠW . Now suppose there also exists W ′ W such that

′ ′ W ′ W W ′ W WSatKM(Π) and= W ( AS) Π . By Lemma 1, Π Π and≠ therefore, W W ′ ′ AS ∈Π AS Π , which= would( mean) that W W in= contradiction to our previous( ) supposition;= ( ) hence, if there exists a set W= WSatKM(Π) for which W is a world view of Π, then W is the only set in WSatKM∈ (Π) for which this is true, and Lemma 2 holds.

7. From Lemmas 1 and 2 it is clear that for each distinct subset SatKM Π of

KM-lit Π such that WSatKM(Π) there is an associated unique modal( reduct) of Π with( ) respect to any W W≠Sat∅KM(Π) for which either

ˆ ′ ′ W there is no set W WSat∈ KM(Π) such that W AS Π , or ˆ there exists one and only one W ′ such that W ′ AS ΠW . ∈ WSatKM(Π)= ( ) 8. Since every valid combination of truth∈ values for the subjective= literals( of) Π is covered in step 1 of the algorithm by adding the rules with k0 ` (interpret as “K ` is considered to be false”), k1 ` (interpret as “K ` is considered to be true”), m0 ` (interpret as “M ` is considered to be false”), and m1 ` (interpret as “M ` is considered to be true”) in their heads, all world views of Π are guaranteed to be generated as groups of answer sets (modulo all k-/m-literals)

′′ of Πground (steps 2 and 3 of the algorithm).

9. A world view of Π must meet the conditions of Definition 13 for it to be consid- ered a world view. Step 4 of the algorithm ensures those conditions are met for each group representing a candidate world view, eliminating only those candi- date world views not meeting the required conditions. The proof of Theorem 1 guarantees that the output of the algorithm is world view of the input program. Thus, all candidate world views of Π that are world views of Π will be output by the algorithm.

A-12 Texas Tech University, Patrick Thor Kahl, May 2014

APPENDIX B FAILED ATTEMPTS TO FIND CORRECT SEMANTICS

For the benefit of those endeavoring to find a different semantics than the one proposed in this dissertation, we present a summary of various failed attempts at redefining the semantics along with example programs showing their faults. This can be viewed as a record of negative results, something we feel is important for promoting good research. We accept that some of the views concerning intuition may not be shared by all. In fact, it was not uncommon for there to be a lack of consensus among the researchers in our group with respect to what the world views of certain programs should be. When we disagreed we would typically try to justify our position with the others, sometimes swaying the group, sometimes not. At all times it was important to keep an open mind in order to make scientific progress. At the crux of these failed attempts were different views concerning which models of a program a rational agent should consider as world views. These views were often based on intuition that changed over time, often as a result of a change in perspective following an unexpected result from one of the failed attempts. Most of these failed attempts were proposals for a new modal reduct that was hoped would fix the perceived problem of unintended world views due to circular support through modal operator M. In the end, the modal reduct proposed in this dissertation as the solution to this problem was not the solution originally sought. For example, our original belief was that the only world view of the one-line program p M p. should have been p . This intuition was summed up as the belief that circular← support through modal{{ }} operator M should not be deemed sufficient for a rational agent to accept. This belief remained with us throughout our quest, through failure after failure in our attempts to define some sort of reasonably simple semantics that matched our intuition, only to be shown time and time again that we were searching in vain. We were going against nature, it seemed, and it took great effort to abandon this intuition in order to discover, in the end, a “surprise ending” to our quest.

B-1 Texas Tech University, Patrick Thor Kahl, May 2014

B.1 Failed Attempt 1 An early attempt by Gelfond was to give a new definition for modal operator M in terms of K as follows:

M ` def K `

This was= a different¬ definition from the one he proposed in his 2011 paper. The following program illustrates why this proposal was abandoned:

p M q. p K q.

translates to ←q. ←q.¬ ¬ ÐÐÐÐÐÐ→ The expected world view← is , but p is the world← view if the proposed definition is adopted, which is clearly{{}} unintuitive.{{ }}

B.2 Failed Attempt 2 In late 2012, after considering the p M p. example for a few minutes, Edward

Wertz suggested redefining the modal reduct← as follows. Definition. [Modal Reduct B.2] Let Π be a ground epistemic logic program and W be a non-empty collection of consistent sets of ground literals. ΠW denotes the ASP program obtained from Π by 1. removing all rules with subjective literals not true in W ; then 2. for remaining rules (a) replacing K ` with `, (b) replacing M ` with ` if K ` is true in W , and then (c) removing any remaining subjective literals.

Although this works for the p M p. program (and a surprisingly large number of other programs), it doesn’t work← as desired for the program p or q M p. since the resulting semantics defines two world views, namely and p ,←q , the latter being considered (at the time) unsupported. At the very{{}} least, we{{ do} { not}} believe this program should have two world views.

B-2 Texas Tech University, Patrick Thor Kahl, May 2014

B.3 Failed Attempt 3 We were at the point of removing modal operator M from the language when inspiration hit. The following was another try at redefining the modal reduct that seemed very promising at the time.

Definition. [Modal Reduct B.3] Let Π be a ground epistemic logic program and W be a non-empty collection of consistent sets of ground literals. ΠW denotes the ASP program obtained from Π by 1. removing all rules with subjective literals not true in W ; then 2. for remaining rules (a) removing any negated subjective literals, (b) replacing K ` with `, and (c) for each remaining rule R containing M ` i. replacing M ` with `, and ii. in a new copy of R, replacing M ` with not `.

This worked as desired for all our “problem” programs and seemed to be the long-awaited fix — until Richard Watson found the following counter-example:

p or q. q or r. p M p.

Using the← proposed definition the world view defined for this program is p, r , but what we want is p, q , p, r . The problem with this definition is that{{ it works}} too well. It effectively{{ eliminates} { }} all M-cycles, regardless of any external support. This at least helped us to classify different sorts of M-cycles: those that are externally supported (as is the case in the counter-example program), and those that are not. We called the first type externally-supported M-cycles and spent a fair amount of time trying to find new definitions that would keep world views that were based on externally-supported M-cycles but eliminate those based on M-cycles that were not externally supported (i.e., those that relied on circular-support through M).

B-3 Texas Tech University, Patrick Thor Kahl, May 2014

B.4 Failed Attempt 4 Gelfond next suggested a hybrid approach where the 2011 modal reduct is used as a first check, and—if W AS ΠW —then a support tree is used to check if W is supported; if so, W is a world= view.( ) The idea of a support tree is an attempt at formalizing of the intuitive notion of support that rules provide for the literals in the belief sets of a particular world view. For example, consider the following program Π (with rule labels added):

R1: p or q.

R2: r q.

R3: s ← M r. and the set W← p, s , q, r, s . It is clear that W AS ΠW . A possible support tree for Π with= respect{{ } to{ W might}} look like Figure B.1.= ( )

Figure B.1: Possible Support Tree for Π w.r.t. W

p Mr R3 s

R1

q R2 r Mr R3 s

Unfortunately, individual attempts to define a support tree by Gelfond, Watson, and Kahl have yet to be satisfactory, even for programs without modal operators. Although we believe significant progress has been made, we also feel it unlikely that an adequate definition will be developed in the very near future.

B-4 Texas Tech University, Patrick Thor Kahl, May 2014

B.5 Failed Attempt 5 At the end of the summer of 2013, another try at redefining the modal reduct was proposed that, although more complicated than any of the previous proposals, seemed to address all the known problems at that time.

Definition. [Modal Reduct B.5] Let Π be a ground epistemic logic program and W be a non-empty collection of consistent sets of ground literals. ΠW denotes the ASP program obtained from Π by doing the following: 1. Remove all rules with subjective literals not satisfied by W . 2. For remaining rules containing subjective literals: (a) remove each K `, (b) replace each K ` with `, ¬ (c) replace each M ` with not `, (d) and for each M do the following: ¬ i. replace M ` with a fresh atom new `, ii. add the rule “new ` `.”, and iii. if ` is not in every set of W , add the rule “new ` not `.” ← 3. If step 2(d) was applicable, repeat the following until no ←new ` remains or a fixpoint is reached: (a) find the answer sets of the ASP program created thus far, and (b) if any answer set contains both new ` and `, remove new ` from the rule body along with the associated rules added in step 2(d).

Eventually a counter-example was found suggesting that no such iterative ap- proach will ever be fully satisfactory. This was disappointing as many of the previous ideas were used in building this modal reduct and it appeared that our definitions were getting much more complicated and harder to understand.

B-5 Texas Tech University, Patrick Thor Kahl, May 2014

B.6 Failed Attempt 6 In the fall of 2013, a new idea was adopted for the modal reduct. If a subjective literal of the form not K ` or M ` was not satisfied by W , it was replaced by not ` or `, respectively, instead of simply deleting the associated rule. This was symmetric with replacement of K ` with ` or not M ` with not ` when the respective subjective literal was satisfied. This changed our whole perspective about how a rational agent should pick world views. Unfortunately, it didn’t eliminate unintended world views.

Definition. [Modal Reduct B.6] Let Π be a ground epistemic logic program and W be a non-empty collection of consistent sets of ground literals. ΠW denotes the ASP program obtained from Π by eliminating modal operators per the following table.

subjective literal if satisfied by W if not satisfied by W

K ` replace with ` delete the rule not K ` remove replace with not ` M ` remove replace with ` not M ` replace with not ` delete the rule

Comparing this to the modal reduct proposed in the dissertation, if M ` is not satisfied, it is replaced with ` instead of not not `. That difference turned out to be critical.

B.7 Failed Attempt 7 Toward the end of 2013, it was suggested that a different hybrid approach be tried that was similar to the one Gelfond had suggested, one that used modal reduct B.6 and—instead of support trees—a method devised by Yuanlin Zhang. Zhang’s approach involved using two novel tools that he termed the disjunctive reduct and the M-reduct. By early 2014, a hybrid method based on Zhang’s approach was developed, but it too was found to be unsatisfactory for certain programs. Although the problems with that attempt may have been resolved with more effort, further work was put off in lieu of the discovery of the definition eventually proposed herein.

B-6 Texas Tech University, Patrick Thor Kahl, May 2014

APPENDIX C EPISTEMIC LOGIC PROGRAMS WITH SORTS

The following is a shortened version of the paper Epistemic Logic Programs with Sorts by Balai and Kahl [Balai & Kahl, 2014]. It is included to provide some insight into how a sorted signature can be added to the language of Epistemic Specifications.

C.1 Introduction In 2007, Balduccini introduced a light-weight extension to ASP with the goal of making it easier for a programmer to specify the domain of predicate parameters, thereby providing for better design. He called the extension RSig [Balduccini, 2007]. RSig was one of the first attempts at providing a usable framework for explicitly specifying the signature of an ASP program. Balai, Gelfond, and Yuanlin Zhang expanded on this early work by providing a more comprehensive framework for specifying the signature of a program in their definition of an ASP extension that they called SPARC [Balai et al., 2013a, Balai et al., 2013b]. SPARC provides the means of specifying sorts for the parameters of predicates and functional terms, thereby promoting better program design while helping to eliminate certain common errors (e.g., misspellings) while also encouraging development of rules specific to a particular domain without the concern for so-called rule safety that has been associated with variable terms by popular ASP solvers (e.g., clingo [Potassco, 2014], DLV [DLVSYSTEM s.r.l., 2012]). Following their lead, we combine these efforts by providing within the language of Epistemic Specifications a framework for specifying predicate and functional pa- rameter domains. We call a program written in this new language an epistemic logic program with sorts (ELPS). In addition to the benefits a sorted signature provides to the programmer, it also allows for a slightly more straightforward algorithm for computing the world views than that for epistemic logic programs without sorts.

C-1 Texas Tech University, Patrick Thor Kahl, May 2014

C.2 Syntax and Semantics The syntax and semantics of rules follow that of the language of Epistemic Spec- ifications as described earlier in this dissertation. The primary syntactic difference is the addition of a preface to the rules of the program where the signature is defined. The preface consists of two sections: sort definitions and predicate declarations. The primary difference in the semantics is that the domain of predicate and functional term variables is no longer universal and implicitly defined.

C.2.1 A New Meaning for Rules with Variables Under the original semantics of both ASP and Epistemic Specifications, a rule containing variables is considered a shorthand for all its ground instantiations. Also, the signature of a program is typically implied by the symbols that occur, with universal domain for all predicate parameters. Thus, for the following program

p a .

p(b). q(c). r(X) p X . the last( ) rule← ( is simply) a shorthand for the rules r a p a .

r(b) ← p(b ). r(c) ← p(c). Now( consider) ← ( ) the same initial program, but with a sorted signature explicitly given specifying the domain for each predicate parameter per the following table:

predicate parameter symbol domain p a, b q c r {a, c} { } Note that the domains{ for} the parameters of p and r are different. One might ask

C-2 Texas Tech University, Patrick Thor Kahl, May 2014 whether the last rule is still valid, and if so, what the ground instantiations should be. We use the same convention as that described in [Balai et al., 2013b] where the ground instantiations of a rule with variables are only those where each variable instantiation maintains all predicate parameter values within their declared domains. Thus, the last rule is now a shorthand for only one rule

r a p a . since( any) ← other( ) instantiation for the variable X would not result in values for the parameters of p and r that would be in both of their respective domains.

C.2.2 Syntax of an ELPS A sort is a (typically non-empty) set of ground terms intended for use in defin- ing the domain of predicate parameters. Various means for defining sorts have been proposed. In the definition presented here, we use the framework defined in [Balai et al., 2013b] which uses a preface before the program rules to define sorts and provide predicate declarations. Thus—as as stated before—the syntactic difference between an epistemic logic program and an ELPS is that the latter includes explicit sort definitions and predicate declarations in addition to the program rules.

The first section of the framework begins with the keyword sorts followed by sort definitions of the form

sort name sort expression. where sort name= begins with the symbol # followed by a unique identifier starting with a lower-case letter, and sort expression is of one of the following forms

ˆ `1, ..., `n ˆ {f sort name} 1, ..., sort namen ˆ sort( name1 sort namen) where n 0, ` is a⊗ literal, ⋯ ⊗ f is a function symbol, and denotes a binary set operator

(union, intersection,> or difference). ⊗

C-3 Texas Tech University, Patrick Thor Kahl, May 2014

The next section begins with the keyword predicates followed by predicate dec- larations of the form

predicate name sort name1, ..., sort namen . where n 0. Every( predicate in the program must) be declared uniquely in this section before being≥ used in a program rule. In addition to explicitly providing the domain for each parameter of a predicate, this allows for static type-checking of rules to discover misspellings and arity mismatches.

The final section begins with the keyword rules followed by the rules of the program. Each rule is of the form

`1 or ... or `k g1, ..., gm, not gm+1, ..., not gn. where k 0, m ←0, n m, each ` is a literal, and each g is either a literal or a subjective≥ literal ≥(i.e., a literal≥ immediately preceded by K or M).

C.2.3 Semantics For a program to be considered valid, every occurrence of a ground atom in a program rule must match its predicate declaration with respect to predicate name, arity, and parameter values within the sort domain. Rules with variables are instan- tiated as previously described. In short, for a valid ELPS, the net effect of the sorted signature is to restrict the grounding of its rules. The grounding of an ELPS results in a set of ground rules; hence, in the following definitions, a ground ELPS can be viewed simply as a ground epistemic logic program. The semantics of a ground ELPS are the same as those defined for a ground epistemic logic program as given in Chapter III.

C.3 Algorithm Just as solving an ASP program has been equated with finding its answer sets, solving an ELPS is equated with finding its world views. We therefore propose an algorithm that takes an ELPS as its input and outputs the world views (if any) of the program.

C-4 Texas Tech University, Patrick Thor Kahl, May 2014

The algorithm follows a generate and test approach. First, we generate candi- date solutions. This is done by creating an ASP program based on the input ELPS that emulates the possible modal reducts with respect to every combination of truth assignments to the distinct ground subjective literals of the ELPS. The answer sets of the ASP program are then computed and grouped into candidate world views based on associated subjective literal truth assignments. Finally, the candidates are checked by verifying that the associated subjective literals are all satisfied. Validated candidates are world views of the ELPS.

Outline of Algorithm for Finding the World Views of an ELPS input: ELPS ↓ conversion: ASP program created from input ↓ computation: answer sets of converted program computed using ASP solver ↓ analysis: answer sets grouped by atoms representing subjective literal values ↓ verification: each group checked to see that subjective literals are satisfied ↓ output: world views

This algorithm was designed to take advantage of existing state-of-the-art ASP solvers. Details concerning the algorithm from which this is based are given in Chapter IV. The first (conversion) part is a combination of that described in Chapter IV and that used by the SPARC translator [Balai, 2014b]. Pseudocode for the first step of the algorithm—conversion from an ELPS to an ASP program—appears on the following page. (Type-checking should be done before or concurrently.) The basic idea is to add the appropriate sort atoms to the bodies of rules containing variables to ensure safety and proper grounding, and to replace subjective literals with fresh ASP atoms while adding rules that define the fresh atoms. For simplicity, we assume that no predicate in the input ELPS starts with prefix k , k0 , k1 , m , m0 , or m1 . It is also assumed that the ASP solver accepts rules with not not ` in the body as defined in [Lifschitz et al., 1999].

C-5 Texas Tech University, Patrick Thor Kahl, May 2014

Algorithm 1: ELPS Version–Step 1 [Create ASP Program from ELPS] Input: ELPS program Π Output: ASP program ΠASP

1 ΠASP . 2 for each distinct sort name s in the sort definitions of Π do 3 Π∶ASP= ∅ ΠASP s t . t is an element of the sort s as defined in Π}.

4 for each rule R in Π do ∶= ∪ { ( ) S 5 SR si ti 1 i n, si is a sort name occurring in a predicate declaration p s1, ..., sn of Π, and ti is a variable term (or term containing a variable)∶= { ( appearing)S ≤ ≤ as a predicate parameter of a [possibly negated] atom p t1, ..., tn appearing( ) in R}. 6 Let sort atoms R denote the comma-delimited list of elements in SR. 7 Let( R′ be) the rule resulting from adding sort atoms R to the body of R. 8 Let `′ denote the( string) obtained from literal ` by replacing with 0. (In the case where is not present, strings ` and `′ are identical.)( ) ′ ¬ 9 Let ` denote the string obtained from `—the logical complement of literal ¬ ′ `—by replacing with 0. (For example, if ` p then ` 0p.) 10 for each subjective literal of the form K ` or not K ` in R′ do 11 Replace not¬K ` with k `′ in R′. = = 12 Replace K ` with not k `′, ` in R′. 13 Add the following rules¬ to ΠASP: 14 k1 `′ not k0 `′, sort¬ atoms R . 15 k0 `′ not k1 `′, sort atoms R . ← ′ ( ) 16 k0 `′ k1 ` . ← ′ ( ) 17 k0 `′ m1 ` . ← 18 k0 `′ m0 `′. 19 k `′ ← k0 `′. 20 k `′ ← k1 `′, not `. ¬ ← 21 for each subjective literal of the form M ` or not M ` in R′ do ¬ ← 22 Replace not M ` with not m `′ in R′. 23 Replace M ` with m `′ in R′. 24 Add the following rules to ΠASP: 25 m1 `′ not m0 `′, sort atoms R . 26 m0 `′ not m1 `′, sort atoms R . 27 m1 `′ ← k1 `′. ( ) ← ′ ( ) 28 m0 `′ k1 ` . ← 29 m `′ m1 `′. 30 m `′ ←m0 `′, not not `. ← 31 Add R′ to Π . ←ASP 32 return ΠASP.

C-6 Texas Tech University, Patrick Thor Kahl, May 2014

Due to the use of a sorted signature, step 2 of the ELPS version of the algorithm is made simpler since there is no need to ground first just to remove any fresh atoms of the form d ` added in step 1 as required in Algorithm 1 of Chapter IV. The remainder of the algorithm is essentially the same as that given in Chapter IV, except that ΠASP is

′′ substituted for Πground in the text, and (in addition to k-/m-literals) sort atoms also need to be removed from the output. Remaining steps of the algorithm follow.

2. Compute the answer sets of ΠASP with an appropriate ASP solver.

′ ′ 3. Group the answer sets of ΠASP by common k-/m-atoms of the form k0 ` , k1 ` , m0 `′, and m1 `′. Each group W of answer sets is said to represent (i.e., if its k-/m-literals and sort atoms are removed) a candidate world view of Π.

4. For each W representing a candidate world view of Π, check that the following conditions are met for all its k-/m-atoms:

(a) if k1 `′ is in the sets of W , then ` is in every set of W ; (b) if k0 `′ is in the sets of W , then ` is missing from at least one set of W ; (c) if m1 `′ is in the sets of W , then ` is in at least one set of W ; and (d) if m0 `′ is in the sets of W , then ` is missing from every set of W .

W∖KM∖sorts (W with k-/m-literals and sort atoms removed) is a world view of Π if conditions (a)–(d) are met.

At the time of this writing, an unoptimized implementation of this algorithm has been developed (see [Balai, 2014a]) as a proof-of-concept with the hope that it will be useful as a teaching tool, as well as a possible prototype for a more optimized system. It is believed that the ability to explicitly specify the signature of a program—such as is now being made available with languages like SPARC and ELPS—is an important step forward in the general development of logic programming.

C-7 Texas Tech University, Patrick Thor Kahl, May 2014

APPENDIX D EXAMPLE PROGRAMS

The first section of example programs deals primarily with M-cycles. In many cases, the expected world views for these programs changed with different intuition.

Example 1. [One-Line Program with M-Cycle]

Let Π1 be the following program: p M p.

This← program has one world view: W1 p .

Example 2. [Program with M-Cycle and={{ Constraint]}}

Let Π2 be the following program: p M p.

←p. This← program has one world view: W2 .

Example 3. [Two-Line Program with= M-Cycle]{{}}

Let Π3 be the following program: p q.

q ← M p. This← program has one world view: W3 p, q .

Example 4. [Program with Chain of= Externally-Supported{{ }} M-Cycles]

Let Π4 be the following program: p or q. q or r. p M p.

s ← p, q. s ← M s. This← program has one world view: W4 p, q, s , p, r, s . ={{ } { }} D-1 Texas Tech University, Patrick Thor Kahl, May 2014

Example 5. [Program with Chain of Externally-Supported M-Cycles and Constraint]

Let Π5 be the following program: p or q. q or r. p M p.

s ← p, q. s ← M s. ←p, not s. This← program has one world view: W5 p, q, s , p, r, s .

Example 6. [Program with M-Cycle Involving={{ } Multiple{ }} M-Literals]

Let Π6 be the following program: p M q.

q ← M p. This← program has one world view: W6 p, q .

Example 7. [Program with Head Cycle={{ and M-Cycle}} Involving Multiple M-Literals]

Let Π7 be the following program: p or q. p M p.

q ← M q. This← program has one world view: W7 p, q .

Example 8. [Disjunctive Program with={{ M-Cycle}} and Fact]

Let Π8 be the following program: p or q. q M q.

p.←

This program has one world view: W8 p, q .

={{ }}

D-2 Texas Tech University, Patrick Thor Kahl, May 2014

The next section of example programs are essentially ASP programs that were found to be challenging for the development of support tree definitions.

Example 9. [Disjunctive Program with Cycle]

Let Π9 be the following program: p or q. p q.

This← program has one world view: W9 p .

Example 10. [Disjunctive Program with={{ Cycle}} and Default Negation]

Let Π10 be the following program: p or q. p q.

r ← not q. This← program has one world view: W10 p, r .

Example 11. [Disjunctive Program with={{ Cycle}} and Constraint]

Let Π11 be the following program: p or q. p q.

←p, not q. This← program has no world view.

Example 12. [Disjunctive Program with Head Cycle]

Let Π12 be the following program: p or q. p q.

q ← p. This← program has one world view: W12 p, q . ={{ }}

D-3 Texas Tech University, Patrick Thor Kahl, May 2014

Example 13. [Disjunctive Program with Multiple Cycles]

Let Π13 be the following program: p or q or r or s or t. p q.

p ← r. p ← s. p ← t. q ←or r p. s p,← q, t. s ← p, r, t. t ← p, q, s. t ← p, r, s. This← program has one world view: W13 p, q , p, r .

Example 14. [Disjunctive Program with={{ Multiple} { Cycles}} and Constraints]

Let Π14 be the following program: p or q or r or s or t. p q.

p ← r. p ← s. p ← t. q ←or r p. s p,← q, t. s ← p, r, t. t ← p, q, s. t ← p, r, s. ←p, q, not s. ← p, r, not s. This← program has no world view.

D-4 Texas Tech University, Patrick Thor Kahl, May 2014

The remainder of the example programs were found to be interesting for one reason or another. Examples involving each of the subjective literal forms are represented.

Example 15. [Disjunctive Program with Multiple Cycles and M-Cycle]

Let Π15 be the following program: p or q or r or s or t. p q.

p ← r. p ← s. p ← t. q ←or r p. s p,← q, t. s ← p, r, t. t ← p, q, s. t ← p, r, s. s ← M t. This← program has one world view: W15 p, q, s, t , p, r, s, t .

Example 16. [Disjunctive Program with={{not M] } { }}

Let Π16 be the following program: p or q. r not M p.

This← program has one world view: W16 p , q .

Example 17. [Disjunctive Program with={{ M} and{ }}not M]

Let Π17 be the following program: p or q. r not M p.

p← M r, not q. This¬ program← has two world views: W17a p , q and W17b q, r . ={{ } { }} ={{ }}

D-5 Texas Tech University, Patrick Thor Kahl, May 2014

Example 18. [Program with K-Cycle]

Let Π18 be the following program: p K p.

This← program has one world view: W18 .

Example 19. [Program with Multiple =not{{}}M]

Let Π19 be the following program: p or q. p or r. s not M q.

t ← not M r. u← not s. v ← not t. This← program has one world view: W19 p, u, v , q, r, u, v .

Example 20. [Program with Two World={{ Views} Due{ to Multiple}} not M]

Let Π20 be the following program: p not M q.

q ← not M p. r ←or s p. This program← has two world views: W20a p, r , p, s and W20b q .

Example 21. [Simple Program with One={{ World} View]{ }} ={{ }}

Let Π21 be the following program: p not q.

q ← not K p. This← program has one world view: W21 q . ={{ }}

D-6 Texas Tech University, Patrick Thor Kahl, May 2014

Example 22. [Program with K and not K]

Let Π22 be the following program: p not q.

r ← K p. q ←or r not K p. This program← has one world view: W22 p, r , q .

Example 23. [Another Program with= K{{ and }not{ }}K]

Let Π23 be the following program: p not q.

r ←or s K p. q or r ← not K p. This program← has one world view: W23 p, r , q .

Example 24. [Simple Program with M={{ and Constraint]} { }}

Let Π24 be the following program: q M p.

←p. This← program has one world view: W24 .

Example 25. [Two-Line Disjunctive Program={{}} with K]

Let Π25 be the following program: p or q K r.

r not←q. This← program has one world view: W25 p, r . ={{ }} Example 26. [One-Line Disjunctive Program with not M]

Let Π26 be the following program: p or q not M q.

This program← has one world view: W26 p . ={{ }}

D-7 Texas Tech University, Patrick Thor Kahl, May 2014

Example 27. [Apparent Tautology: K and not K]

Let Π27 be the following program: p K p.

p ← not K p. This← program has no world view.

Example 28. [Apparent Tautology: M and not M]

Let Π28 be the following program: p M p.

p ← not M p. This← program has one world view: W28 p .

Example 29. [Mutual Dependency with={{ M-Cycle]}}

Let Π29 be the following program: p M q, not q.

q ← M p, not p. This← program has two world views: W29a and W29b p , q .

Example 30. [Another Mutual Dependency={{}} with M-Cycle]={{ } { }}

Let Π30 be the following program: p M q, not q.

q ← M p, not p. r ←or s or t not p, not q. This program has← two world views: W30a r , s , t and W30b p , q .

Example 31. [Supported M-Literals] ={{ } { } { }} ={{ } { }}

Let Π31 be the following program: p or p.

q M¬ p. q ← M p. This← program¬ has one world view: W31 p, q , p, q . ={{ } {¬ }} D-8 Texas Tech University, Patrick Thor Kahl, May 2014

Example 32. [Motivating Example for New Modal Reduct]

Let Π32 be the following program: p or q. M q.

This← program has one world view: W32 p .

Example 33. [Another Motivating Example={{ }} for New Modal Reduct]

Let Π33 be the following program: p or q. p M q.

This← program has one world view: W33 p .

Example 34. [Supported M-Literal] ={{ }}

Let Π34 be the following program: p or q. r M q.

This← program has one world view: W34 p, r , q, r .

Example 35. [Program Demonstrating={{ New Modal} { }} Reduct]

Let Π35 be the following program: p or q. M p, M q.

This← program has two world views: W35a p and W35b q .

Example 36. [Another Program Demonstrating={{ }} New Modal={{ Reduct]}}

Let Π36 be the following program: p or q or r. M p, M q, M r.

This← program has three world views: W36a p , q , W36b p , r and W36c q , r . = {{ } { }} = {{ } { }} = {{ } { }}

D-9 Texas Tech University, Patrick Thor Kahl, May 2014

Example 37. [A Third Program Demonstrating New Modal Reduct]

Let Π37 be the following program: p or q or r. M p, M q.

← M p, M r. ← M q, M r. This← program has three world views: W37a p , W37b q and W37c r . Example 38. [A Fourth Program Demonstrating={{ }} New Modal={{ }} Reduct] ={{ }}

Let Π38 be the following program: p or q or r. M p, M q.

← M p, M r. This← program has two world views: W38a p and W38b q , r . Example 39. [Program with not M] ={{ }} ={{ } { }}

Let Π39 be the following program: p or q. p not M p, not q.

This¬ program← has one world view: W39 p , q . Example 40. [Another Program with =not{{ M]} { }}

Let Π40 be the following program: p not M q.

q ← not p. This← program has one world view: W40 q . Example 41. [Program with not K] ={{ }}

Let Π41 be the following program: p not q.

p ←or q not K p. This program← has one world view: W41 p , q . ={{ } { }} D-10 Texas Tech University, Patrick Thor Kahl, May 2014

Example 42. [Program with not M and not K]

Let Π42 be the following program: p not M q.

p ←or q not K p. This program← has one world view: W42 p , q .

Example 43. [Program with Default Negation={{ } { and}} M]

Let Π43 be the following program: p not q.

p ←or q M q. This program← has one world view: W43 p , q .

Example 44. [Program with not M and={{ M]} { }}

Let Π44 be the following program: p not M q.

p ←or q M q. This program← has one world view: W44 p , q .

Example 45. [Another Program with= Default{{ } { Negation}} and M]

Let Π45 be the following program: p not q.

p ←or q M p. This program← has one world view: W45 p , q .

Example 46. [Another Program with =not{{ M} { and}} M]

Let Π46 be the following program: p not M q.

p ←or q M p. This program← has one world view: W46 p , q . ={{ } { }}

D-11 Texas Tech University, Patrick Thor Kahl, May 2014

Example 47. [Another Program with Multiple not M]

Let Π47 be the following program: p or q. p not M q.

q ← not M p. This← program has one world view: W47 p , q .

Example 48. [Program with M and not={{M]} { }}

Let Π48 be the following program: p or q M p.

p not←M p. This← program has one world view: W48 p , q .

Example 49. [Disjunctive Program with={{not} {M]}}

Let Π49 be the following program: p or q not M p.

This program← has one world view: W49 q .

Example 50. [Program with Rule Acting={{ as}} Constraint]

Let Π50 be the following program: p or q. p M p, M q.

This← program has one world view: W50 p .

Example 51. [Program with Externally-Supported={{ }} M-Cycle]

Let Π51 be the following program: p or p.

p M¬ p. This← program has one world view: W51 p . ={{ }}

D-12 Texas Tech University, Patrick Thor Kahl, May 2014

Example 52. [Program with Multiple M-Cycles]

Let Π52 be the following program: p M p.

q ← M q. r ← p, q. p ← M r. q ← M r. This← program has one world views: W52 p, q, r .

Example 53. [Disjunctive Program with={{ M-Cycle]}}

Let Π53 be the following program: p or q. p or r M p.

This program← has one world view: W53 p , q, r .

Example 54. [Disjunctive Program with={{ Multiple} { }} M-Literals]

Let Π54 be the following program: p or q. r or s M p, M q.

t M r,← M s. This← program has one world view: W54 p, r, t , p, s, t , q, r, t , q, s, t .

Example 55. [Disjunctive Program with={{ Multiple} { M-Literals} { and} { Constraint]}}

Let Π55 be the following program: p or q. r or s M p, M q.

t M r,← M s. ←not t. This← program has one world view: W55 p, r, t , p, s, t , q, r, t , q, s, t . ={{ } { } { } { }}

D-13 Texas Tech University, Patrick Thor Kahl, May 2014

Example 56. [Disjunctive Program with Multiple M-Cycles]

Let Π56 be the following program: p or q t.

r or s ← M p, M q. t M r,← M s. This← program has two world views: W56a p, r, t , p, s, t , q, r, t , q, s, t and W56b . = {{ } { } { } { }}

Example={{}} 57. [Another Disjunctive Program with Multiple M-Literals]

Let Π57 be the following program: p or q or r. s M p, M q.

This← program has one world view: W57 p, s , q, s , r, s .

Example 58. [Program with Multiple= Disjunctive{{ } { Rules} { and}} Multiple M-Literals]

Let Π58 be the following program: p or q. p or r. p M p.

q ← M q. This← program has one world view: W58 p, q .

Example 59. [Program with Multiple= K{{ and}} M Constraint]

Let Π59 be the following program: p or q. r K p.

s ← K q. ←M p, M q. This← program has two world views: W59a p, r and W59b q, s . ={{ }} ={{ }}

D-14 Texas Tech University, Patrick Thor Kahl, May 2014

Example 60. [Another Program with M and not M]

Let Π60 be the following program: p M p.

p ←or q not M p. This program← has one world view: W60 p .

Example 61. [Program with Disjunction={{ and}} M-Cycle]

Let Π61 be the following program: p or p.

p M¬ p. This← program has one world view: W61 p .

Example 62. [Program with Disjunction,={{ M-Cycle,}} and not M]

Let Π62 be the following program: p or p.

p M¬ p. p← not M p. This¬ program← has one world view: W62 p . ={{ }}

D-15