We present derivation proof procedures for extended stable model semantics. Given program II and goal G, G belongs to the well founded model of El iff there is a WFM-derivation for G in I I . Likewise, given program II and goal G, G belongs to some extended stable model of II iff there is a XSM-der i va t ion for G in I I . Correctness (completeness and soundness) of these procedures is discussed. Example derivations are exhibited, as well as a simple Prolog implementation that directly mirrors the procedures. 1 I n t r o d u c t i o n Well Founded Semantics (WFS) [Van Gelder et a/., 1990] adequately captures various forms of hypothetical reasoning [Pereira et a/., 1991c, Pereira et a/., 1991d, Pereira ct a/., 1991b, Pereira et al., 1991a] if we interpret the well-founded model (WFM) of a program II as a (possibly incomplete) core view of the world, the extended stable models (XSMs) specifying alternative complementary consistent views of the world, all of each containing the core WFM. The paper is organized as follows: in section 2 we review well founded semantics. In section 3 we define WFM-der ivat ions, discuss their correctness, and give examples. Next, in section 4, we define XSMderivations and discuss their correctness. Finally, in sect ion 5, a Prolog implementat ion is produced, directly reflecting the derivation procedures mentioned. More details can be found in an extended version of this paper [Pereira et al., 1990]. By a logic program II we mean a finite set of universally closed rules of the form: where H is an atom and the Li's are literals. When n = 0, we also wri te where t stands for an atom satisfied in all models. Negative literals are expressed as 4 where A is an atom. We denote by L i t ( I I ) the set of literals in ground( I I ) , the Herbrand instantiation of program I I . We denote the well founded model of a program I I by W F M ( I I ) , and an extended stable model (which may be the well founded one) by XSM(II). 2 T h e E x t e n d e d Stable M o d e l Semantics In this section we characterize the Well Founded and Extended Stable Models of a program, based on [Przymusinska and Przymusinski, 1990]. Alternative definitions of the Well Founded Semantics can be found in [Van Gelder ct a/., 1990] or in [Przymusinski, 1989]. Because the semantics is 3-valued, we begin by defining 3-valued interpretations. D e f i n i t i o n 2.1 A 3-valued Herbrand interpretation I of a first-order language L is any pair (T ; F ) , where T and F are disjoint subsets of the Herbrand base H. T contains all ground atoms true in 7, F contains all ground atoms false in /, and the t ru th value of the remaining atoms, those in is undefined (or unknown). An alternative way to represent an interpretation / = P r o p o s i t i o n 2.1 Any interpretat ion can be equivalently viewed as a function where , defined by: D e f i n i t i o n 2.2 The function can be recursively extended to the truth valuation function i : Lit(II) -----> V defined on the set L i t ( I I ) of all literals of the language as follows, where A is a ground atom: D e f i n i t i o n 2.3 A non-negative program is a program whose premises are either positive atoms or the special proposition u. Every interpretat ion I satisfies 1/2, and so u denotes the undefined (or unknown) value. T h e o r e m 2.1 (Generalization of [Van Emden and Kowalski, 1976]) Every non negative logic-program has a unique least 3-valued model. Pereira, Aparicio, and Alferes 863 Next we define the program transformation U/M ( I I modulo M), which is a 3-valued extension to the 2-valued transformation in [Gelfond and Lifschitz, 1988]. D e f i n i t i o n 2.4 Let II be a logic program and let I be a 3-valued interpretat ion. By the extended GLtransformation of II modulo I we mean a new (nonnegative) program 11/I obtained from II by performing the following three operations: • Removing from II all rules which contain a negative premise L =~A such that i(L) = 0. • Replacing in all remaining rules those negative premises L = ~ A which satisfy i(L) = 1/2 by u. • Removing from all the remaining rules those negative L =~A which satisfy i(L) = 1. Since the resulting program 11/7 is non-negative, by theorem 2.5, it has a unique least 3 valued model. We define T*(I) (a generalization of the T operator [Gelfond and Lifschitz, 1988]) to be the 3-valued least model of I I / I . D e f i n i t i o n 2.5 A 3-valued interpretat ion I of a logic program II is called an Extended Stable Model XSM of II iff T* (/) = / . In order to check if I is an XSM of a program we give a constructive definit ion of T* operator. For this purpose we define , a generalization of the Van EmdenKowalski operator D e f i n i t i o n 2.6 Let II be a non-negative program, I an interpretation of II and A is a ground atom. Then is an interpretat ion defined as follows: 864 Logic Programming 3 De r i va t i on P rocedure for the W e l l Founded M o d e l Now we present a derivation procedure such that given a program II and a goal G the derivation succeeds iff G is in WFM(II). The procedure is defined over the ground instance of I I , the set of all ground instances of the rules in II w i th respect to its Herbrand Universe. Without loss of generality we can assume that II has been already instantiated and thus consists of a (possibly infinite) set of proposit ional rules. D e f i n i t i o n 3.1 A positive (resp. negative) interpretation / is a set of positive (resp. negative) literals from Lit(H).
[1]
José Júlio Alferes,et al.
Nonmonotonic Reasoning with Well Founded Semantics.
,
1991
.
[2]
Robert A. Kowalski,et al.
The Semantics of Predicate Logic as a Programming Language
,
1976,
JACM.
[3]
Melvin Fitting,et al.
A Kripke-Kleene Semantics for Logic Programs
,
1985,
J. Log. Program..
[4]
Teodor C. Przymusinski,et al.
Semantic Issues in Deductive Databases and Logic Programs
,
1990
.
[5]
José Júlio Alferes,et al.
Contradiction Removal within Well Founded Semantics
,
1991,
LPNMR.
[6]
José Júlio Alferes,et al.
Counterfactual Reasoning Based on Revising Assumptions
,
1991,
ISLP.
[7]
José Júlio Alferes,et al.
Hypothetical Reasoning with Well Founded Semantics
,
1991,
SCAI.
[8]
Kenneth A. Ross,et al.
The well-founded semantics for general logic programs
,
1991,
JACM.
[9]
Teodor C. Przymusinski.
Every logic program has a natural stratification and an iterated least fixed point model
,
1989,
PODS.
[10]
J. Meigs,et al.
WHO Technical Report
,
1954,
The Yale Journal of Biology and Medicine.
[11]
Teodor C. Przymusinski.
Extended Stable Semantics for Normal and Disjunctive Programs
,
1990,
ICLP.