Declarative Logic Programming. Michael Kifer
Чтение книги онлайн.

Читать онлайн книгу Declarative Logic Programming - Michael Kifer страница 42

Название: Declarative Logic Programming

Автор: Michael Kifer

Издательство: Ingram

Жанр: Компьютеры: прочее

Серия: ACM Books

isbn: 9781970001983

isbn:

СКАЧАТЬ http://flora.sourceforge.net/tr-interpreter-suite.tar.gz

      18. Syntactically, G subsumes F if F can be derived from G by substituting 0 or more variables with constants or other variables. So, for example, influenced(X, Y) subsumes influenced(dm, Y), influenced(X, X), influenced(X, Y), and influenced(dm, tjg).

      19. Prolog pedagogues, when teaching data recursion, wisely choose graphs, for example, the advises relation, that can have no cycles.

      20. http://docs.microsoft.com/en-us/sql/odbc/microsoft-open-database-connectivity-odbc

      21. Another was WebLog [Lakshmanan et al. 1996], which deals with semi-structured data using a language very similar to F-logic.

      22. http://www.w3.org/TR/2008/WD-owl2-profiles-20081008/#OWL_2_RL

      23. http://ontotext.com/products/graphdb/

      24. http://franz.com/agraph/allegrograph/

      25. http://jena.apache.org/documentation/inference/

       2

       An Introduction to the Stable and Well-Founded Semantics of Logic Programs

       Miroslaw Truszczynski

      This chapter provides a brief introduction to two main semantics of logic programs with negation, the stable-model semantics of Gelfond and Lifschitz, and the well-founded semantics of Van Gelder, Ross, and Schlipf. We present definitions, introduce basic results, and relate the two semantics to each other. We restrict attention to the syntax of normal logic programs and focus on classical results. However, throughout the chapter and in concluding remarks we briefly discuss generalizations of the syntax and extensions of the semantics, and mention several recent developments.

       2.1 Introduction

      The roots of logic programming can be traced back to efforts to build resolutionbased automated theorem provers in the mid-1960s [Robinson 1965]. A realization that resolution can turn Horn theories into programs came about in the early 1970s and rested on the foundational work of Kowalski and Kuehner [1971] and Kowalski [1974], as well as the implementation effort of Colmerauer and his research group, in which the Prolog programming language was developed [Colmerauer et al. 1973].

      Negation was present in Prolog from the very beginning. Its meaning was specified operationally through its implementation. However, for almost two decades, finding a satisfactory declarative account of negation was elusive. The first significant progress was obtained by Clark, who proposed reading programs as definitions and formalized that reading by means of the program completion [Clark 1978]. A different plan of attack was developed a few years later by Apt, Blair, and Walker [1988] and, independently, by Przymusinski [1988a, 1988b]. They introduced a large and natural class of programs with negation, called stratified programs, and showed that the meaning of a stratified program is captured by a certain well-motivated Herbrand model. Przymusinski [1988a] called this model perfect. Soon thereafter, Gelfond and Lifschitz [1988] proposed the stable-model semantics and Van Gelder et al. [1988, 1991] the well-founded semantics. The stable-model semantics was strongly influenced by research in knowledge representation concerned with the notion of nonmonotonic reasoning, and built on the semantics of default logic by Reiter [1980] and autoepistemic logic by Moore [1985]. The well-founded semantics followed the query-evaluation paradigm of Prolog but framed it in a three-valued setting. Both semantics were heavily influenced by the perfect-model semantics and can be regarded as its generalizations to the class of all programs. Moreover, despite some fundamental differences, they also show strong and interesting connections to the completion semantics by Clark.

      The stable-model and the well-founded semantics have had major implications on the fields of logic programming and knowledge representation. Since their inception, they fueled research in these two fields and gave rise to fascinating theoretical results, implementations of declarative programming languages, and successful applications. In particular, the answer-set programming paradigm [Marek and Truszczyński 1999, Niemel¨a 1999, Brewka et al. 2011] and its modern implementations trace their roots to the stable-model semantics [Gebser et al. 2012], while some closely related declarative programming systems grew out of generalizations of the well-founded semantics [Denecker 2009]. The latter underlies also a successful Prolog descendant, the XSB system [Sagonas et al. 1994], and several other systems we mention later on.

      In this tutorial presentation, we introduce the two semantics and show that, despite their differences, they are closely related. Our goal is to present basic properties of the stable-model and the well-founded semantics, focusing on the most significant lines of research. After introducing the terminology and the most essential preliminaries, we start our presentation with the case of Horn programs (Section 2.3). In Section 2.4 we discuss several examples that point out problems that arise for programs with negation, and informally suggest ways in which these problems could be addressed. We follow up with a formal discussion of the stablemodel semantics as an extension of the least-model semantics of Horn programs to the case of programs with negation (Section 2.5). The key topics we discuss are stratification and program splitting, supported models, completion, tight programs, loops and the Loop Theorem, and strong equivalence of programs. We then change gears and move into the realm of four-valued Herbrand interpretations. While there, we define partial stable and partial supported models, and the most distinguished representatives of the two classes of “partial” models: the well-founded and the Kripke-Kleene models, respectively (Section 2.6). We conclude with brief closing comments.

       2.2 Terminology, Notation, and Other Preliminaries

       Logic Programming

      The language of logic programming is determined by a countable vocabulary σ consisting of function and predicate symbols, each assigned a non-negative arity. Function symbols of arity 0 are called constant symbols. We assume that σ contains at least one constant symbol. Expressions of the language may also contain variable symbols. They come from a fixed infinite countable set Var that does not depend on σ. In other words, the same set of variables is used with every vocabulary.

      The terms of the language are defined in the same way as in the first-order logic: all constant and variable symbols are terms and, if t1, …, tk are terms and fσ is a k-ary function symbol, then f(t1, …, tk) is also a term.

      An atom is an expression p(t1, …, tk), where pσ is a k-ary predicate symbol and t1, …, tk are terms. Thus, atoms in logic programming are of the same form as atomic formulas in the language of first-order logic.

      Terms and atoms that have no occurrences of variable symbols are ground. The Herbrand universe comprises all ground terms of the language and the Herbrand base comprises all ground atoms. One of the connectives in the language of logic programming is the negation connective not. Negation is applied only to atoms. Atoms СКАЧАТЬ