logic knowledge bases with two default rules

29
Annals of Mathematics and Artificial Intelligence 22 (1998) 333–361 333 Logic knowledge bases with two default rules * Carolina Ruiz a and Jack Minker b a Department of Computer Science, Worcester Polytechnic Institute, Worcester, MA 01609, USA E-mail: [email protected] b Department of Computer Science and Institute for Advanced Computer Studies, University of Maryland, College Park, MD 20742, USA E-mail: [email protected] Logic knowledge based systems (LKBS) containing at most one form of default nega- tion and explicit (or “classical”) negation have been studied in the literature. In this paper we describe a class of LKBS containing multiple forms of default negation in addition to explicit negation. We define a semantics for these systems in terms of the well-founded semantics defined by Van Gelder et al. (1988) and the stable semantics introduced by Gel- fond and Lifschitz (1988) and later extended to the 3-valued case by Przymusinski (1991). We investigate properties of the new combined semantics and calculate the computational complexity of three main reasoning tasks for this semantics, namely existence of models, skeptical and credulous reasoning. An effective procedure to construct the collection of models characterizing the semantics of such a system is given. Applications to knowledge representation and knowledge base merging are presented. 1. Introduction In everyday reasoning, we are accustomed to infer negated information from pos- itive information. Logic programming and non-monotonic reasoning have developed several theories for interpreting negated information and for deducing it from positive data (see, e.g., [4,14] in knowledge based systems whose representation language is the language of mathematical logic. We term this systems Logic Knowledge Based Systems (LKBS). Two of the most widely used semantics for negation by default in LKBS are the Well-Founded Semantics (WFS) defined by Van Gelder et al. [26] and the stable semantics introduced by Gelfond and Lifschitz [10] and later extended to the 3-valued case by Przymusinski [18]. These notions of negation have been used as separate ways to interpret and to deduce negated information. That is, each system has chosen one of these notions of negation and has applied it to every piece of data in the domain of the system. However, in everyday reasoning we know that it is not natural to uniformly use a single rule for negation. Therefore, expressive power is gained by allowing the interaction of different theories for negation in the same system. In this way different pieces of * Support for this paper was provided by the National Science Foundation under grant number IRI 9300691. J.C. Baltzer AG, Science Publishers

Upload: carolina-ruiz

Post on 03-Aug-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Logic knowledge bases with two default rules

Annals of Mathematics and Artificial Intelligence 22 (1998) 333–361 333

Logic knowledge bases with two default rules ∗

Carolina Ruiz a and Jack Minker b

a Department of Computer Science, Worcester Polytechnic Institute, Worcester, MA 01609, USAE-mail: [email protected]

b Department of Computer Science and Institute for Advanced Computer Studies,University of Maryland, College Park, MD 20742, USA

E-mail: [email protected]

Logic knowledge based systems (LKBS) containing at most one form of default nega-tion and explicit (or “classical”) negation have been studied in the literature. In this paperwe describe a class of LKBS containing multiple forms of default negation in addition toexplicit negation. We define a semantics for these systems in terms of the well-foundedsemantics defined by Van Gelder et al. (1988) and the stable semantics introduced by Gel-fond and Lifschitz (1988) and later extended to the 3-valued case by Przymusinski (1991).We investigate properties of the new combined semantics and calculate the computationalcomplexity of three main reasoning tasks for this semantics, namely existence of models,skeptical and credulous reasoning. An effective procedure to construct the collection ofmodels characterizing the semantics of such a system is given. Applications to knowledgerepresentation and knowledge base merging are presented.

1. Introduction

In everyday reasoning, we are accustomed to infer negated information from pos-itive information. Logic programming and non-monotonic reasoning have developedseveral theories for interpreting negated information and for deducing it from positivedata (see, e.g., [4,14] in knowledge based systems whose representation language isthe language of mathematical logic. We term this systems Logic Knowledge BasedSystems (LKBS). Two of the most widely used semantics for negation by default inLKBS are the Well-Founded Semantics (WFS) defined by Van Gelder et al. [26] andthe stable semantics introduced by Gelfond and Lifschitz [10] and later extended tothe 3-valued case by Przymusinski [18].

These notions of negation have been used as separate ways to interpret and todeduce negated information. That is, each system has chosen one of these notions ofnegation and has applied it to every piece of data in the domain of the system. However,in everyday reasoning we know that it is not natural to uniformly use a single rulefor negation. Therefore, expressive power is gained by allowing the interaction ofdifferent theories for negation in the same system. In this way different pieces of

∗ Support for this paper was provided by the National Science Foundation under grant number IRI9300691.

J.C. Baltzer AG, Science Publishers

Page 2: Logic knowledge bases with two default rules

334 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

information in the domain may be treated appropriately. The study of the interactionbetween explicit negation and negation by default (see [1,11,15–17]) constitutes thefirst step to achieve this goal.

In this paper we undertake a further step by studying LKBS that contain sev-eral types of default negation in addition to explicit negation. We describe this classof LKBS and study its semantics. Such a study will provide a new approach in theunderstanding and use of negation in logic programming and non-monotonic reasoning.

This paper is organized as follows. Section 2 contains the definitions of the WFS,the partial (3-valued) stable semantics (3-STB) and other basic notions. Section 3 in-troduces a new class of very expressive LKBS containing multiple default rules ofnegation. Section 4 defines a semantics for a particular subclass in which two defaultnegations, the WFS and the partial stable negations, appear. We call this new semanticsthe WF3STB semantics. Section 5 discusses several properties of this semantics. Weshow that it interpolates between the partial stable semantics and the WFS. This in-terpolation result implies, among other things, that the WF3STB semantics preservesmany structural and semantical properties of both the WFS and the 3-STB seman-tics. In particular, we show that the WF3STB semantics satisfies the properties ofelimination of tautologies, the generalized principle of partial evaluation, positive andnegative reductions, elimination of non-minimal rules, consistency, and independence.Section 6 contains a complexity analysis of the WF3STB semantics. We prove thatthe problems of existence of models, skeptical reasoning and credulous reasoning un-der the WF3STB semantics have the same computational complexity as those of the3-STB semantics on the class of LKBS cointaining just one default negation. Hence,for the propositional case, the existence of models under the WF3STB semantics isguaranteed and skeptical and credulous reasoning are respectively quadratic and NP-complete in the length of a LKBS. Section 7 provides examples and applications ofthe WF3STB semantics to knowledge representation and knowledge base merging.Section 8 describes a procedure to effectively compute the WF3STB semantics. Thisprocedure uses as a subroutine a procedure that computes the partial stable models,which we have introduced in [22]. In order to make this section self-contained, weprovide the necessary details of the definition of this partial stable procedure as theyappear in [22]. Section 9 describes possible generalizations. Semantics for LKBSwhich combine the partial stable negation and a negation other than the well-foundedare outlined. Section 10 provides related work and conclusions.

2. Background

In this section, we briefly survey the definitions and relevant properties of theWFS and the partial stable semantics. Both are three-valued semantics, i.e., the truthvalue of each sentence under these semantics is either true, false or unknown.

First, we make precise what is meant by a logic knowledge based system anddefine the notions of a 3-valued interpretation and a 3-valued model of a LKBS. Wedescribe alternative orderings on the three truth values and study the orderings among

Page 3: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 335

3-valued interpretations that they induce. Finally, the well-founded model and the setof 3-valued stable models of a LKBS are defined.

A logic knowledge based system consists of two parts: A knowledge base con-taining statements about the world being represented written in the language of firstorder mathematical logic (augmented with the operators for default negation not andexplicit negation ∼), and an inference system in charge of the extraction and deriva-tion of information from the knowledge base. In the logic programming communitythese knowledge bases are usually called logic programs. Depending upon the expres-siveness of the statements that are allowed to occur in them, logic programs receivedifferent qualifications accordingly to the following definition.

Definition 1 (Logic programs). Let L denote a first order language. A logic programP is a collection of rules (also called clauses) of the following general form:

k∨i=0

ai ←l∧i=1

bi,m∧i=1

not ci,

where the a, b, c’s are atomic formulas.

1. If k is permitted to be greater than 0 (i.e., the heads of the rules in P may benon-trivial disjunctions), P is called disjunctive. If k is restricted to be equal to 0,then P is called definite.

2. If m is allowed to be greater than 0 (i.e., the operator for default negation notmay occur in P ), P is called normal.

3. If the operator for explicit negation ∼ may occur in P (i.e., some of the atomicformulas may be explicitly negated), P is called extended.

In what follows, we denote by LP0 the class of definite logic programs, byLP∨0 the class of disjunctive logic programs, by LP∨1 the class of normal disjunctivelogic programs, and by LP∨,∼

0 the class of extended disjunctive logic programs. Ingeneral, the superscripts ∨ and ∼, when they appear, denote respectively the factsthat the heads of the rules may be disjunctions of formulas, and that formulas may beexplicitly negated. The subscript 1 or 0 respectively denotes whether or not the defaultnegation operator not may occur in the body of the clauses. This notation is takenfrom [21]. We sometimes also abbreviate an extended clause of the form

∨ki=0 ai ←∧l

i=1 bi,∧mi=1 not ci as H ← B where H =

∨ki=0 ai and B =

∧li=1 bi,

∧mi=1 not ci.

H and B are respectively called the head and the body of the clause.Since a logic program is equivalent to the set of all its ground instances, we

consider here only (possibly infinite) propositional programs, and so the language Lis just a set of propositional symbols. We require that L contain special propositionst, f and u, that are intended to denote true, false and unknown, respectively.

Minker and Ruiz [15,16] give techniques to obtain the semantics of an extendednormal disjunctive logic program (LP∨,∼

1 program) in term of the semantics of a

Page 4: Logic knowledge bases with two default rules

336 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

corresponding LP∨1 program free of explicit negation. Therefore, without loss ofgenerality, we disregard in the sequel the presence of explicit negation.

Definition 2 (Ordering among truth values). Consider the following orderings amongtruth values:

1. Truth ordering (<t): false <t unknown <t true.

2. Knowledge ordering (<k): unknown <k false and unknown <k true.

Graphically,

.

@@

��

unknown

false true

-.

6

<k

<t

Given a propositional language L, a 3-valued interpretation is a 3-valued truthassignment to the propositions in L. It is commonly represented as a partial function(hence the name of partial interpretation) I :L → {true, false} in which the truthvalue of a proposition that does not belong to the domain of I is taken to be unknown.A concise way of writing such a partial function is as a pair 〈I+; I−〉, where I+ andI− consist of the propositions in L that are mapped to true and to false, respectively.(All the remaining propositions are mapped to unknown.)

Definition 3 (3-valued interpretations). Let P be an LP∨,∼1 program written in a

propositional language L.

1. A 3-valued interpretation I of P is a pair 〈I+; I−〉 where I+ and I− are disjointsubsets of L and such that t ∈ I+, f ∈ I− and u /∈ I+ ∪ I−.

2. A proposition a ∈ L is true in I if a ∈ I+; a is false in I if a ∈ I−; and a isunknown in I otherwise. The truth values of more complex sentences with respectto I are computed using the Kleene truth tables (in which we have abbreviatedtrue, false and unknown as t, f and u, respectively):

∧ t u f

t t u fu u u ff f f f

∨ t u f

t t t tu t u uf t u f

a t u f

not a f u t

3. The truth value of a sentence ϕ with respect to an interpretation I is denoted byVI (ϕ).

Page 5: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 337

4. An interpretation I is called total if I+ ∪ I− ∪ {u} = L.

5. Iu denotes L− (I+ ∪ I−), i.e., the set of propositions that are unknown in I .

Note that the truth tables for the operators ∧ and ∨ are fully determined by themeet and join operators in the truth ordering <t lattice given in definition 2. Basedon the orderings on truth values, the 3-valued interpretations can be ordered in thefollowing ways.

Definition 4 (Orderings among 3-valued interpretations). Let P be an LP∨,∼1 program.

Given two 3-valued interpretations I = 〈I+; I−〉 and J = 〈J+;J−〉, the following aretwo possible ways of ordering I and J :

1. Truth ordering (�t): I �t J iff VI(a) 6t VJ (a) for all a ∈ L.

2. Knowledge ordering (�k): I �k J iff VI (a) 6k VJ (a) for all a ∈ L.

Equivalent definitions of these orderings that appear frequently in the literature(see, e.g., [18]) are I �t J iff I+ ⊆ J+ and I− ⊇ J−; and I �k J iff I+ ⊆ J+ andI− ⊆ J−.

As usual, a model of an LP∨,∼1 program is an interpretation that satisfies all the

clauses of the program.

Definition 5 (3-valued (minimal) models). Let P be an LP∨,∼1 program.

1. A 3-valued interpretation M is a 3-valued model of P if for every clause H ← Bin P , VM (H) >t VM (B).

2. M is said to be a ≺t-minimal (respectively ≺k-minimal) 3-valued model of P ifthere is no 3-valued model N of P such that N 6= M and N ≺t M (respectivelyN ≺k M ).

3. MM≺t(P ) (respectively MM≺k(P )) denotes the collection of ≺t-minimal (re-spectively ≺k-minimal) 3-valued models of P .

A semantics of an LP∨,∼1 program is characterized by a subcollection of its set

of models. In particular, the WFS of a (non-disjunctive) LP∼1 program is captured bya unique model while the 3-valued stable model semantics of an LP∨,∼

1 program isgiven by the set of its 3-valued stable models as defined below.

Definition 6 (WFS [27]). Let P be an LP1 program, let J denote the set {〈J+;J−〉 |J+,J− ⊆ L}, and let J ∈ J .

1. We say that A ⊆ L is an unfounded set of P with respect to J if for eachpropositional symbol p ∈ A and each clause p ← B in P (at least) one of thefollowing conditions holds:

Page 6: Logic knowledge bases with two default rules

338 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

(a) Some (positive or negative) subgoal in B is false in J .

(b) Some positive subgoal in B occurs in A.

2. The greatest unfounded set (of P with respect to J) is the union of all sets thatare unfounded with respect to J .

3. The transformations TP ,UP :J → 2L and WP :J → J are defined as follows:

(a) TP (J) = {p | there is a clause p← B in P such that VJ (B) = true}.

(b) UP (J) is the greatest unfounded set of P with respect to J .

(c) WP (J) = 〈TP (J);UP (J)〉.4. The well-founded model of P , denoted by WFS(P ) is the least fixpoint of the

operator WP .

Van Gelder et al. [27] showed that for any LP1 program P , the least fixpointI∞ =

⋃αW

αP (I0) of WP always exists, where I0 denotes the ≺k-least interpretion

〈t; f〉. Furthermore, they showed that the ordinal powers of the operator WP appliedto I0 are interpretations of P . That is, for any ordinal α,[

WαP (I0)

]+ ∩ [WαP (I0)

]−= ∅.

Theorem 7 [27]. The data complexity of the WFS for function-free logic programsis polynomial time.

Indeed, the well-founded model of a finite propositional LP1 program P can beconstructed in O(|A| |P |) time, where |A| denotes the number of distinct propositionalsymbols in P and |P | denotes the total length of the program, defined as the number(including repetitions) of all symbols occurring in P (see [24]). Since |A| 6 |P |, thisimplies that the well-founded model of P can be computed in at most quadratic timein the length of P . For an extension of the WFS to the class LP∼1 with the samecomputational complexity, see [16].

Definition 8 (3-valued (or partial) stable model [18]). Let P be an LP∨,∼1 program

and let M be any 3-valued model of P .

1. The Gelfond–Lifschitz transformation PM of P with respect to M is the LP∨,∼0

program free of negation-by-default obtained by replacing in every clause of Pall negated-by-default premises l = not c which are true (respectively unknown;respectively false) in M by the proposition t (respectively u; respectively f).

2. M is a 3-valued (or partial) stable model of P if M is a ≺t-minimal model ofPM .

Given an LP∨,∼1 program P , Przymusinski proved the following relationships

among the collection 3-STB(P ) of partial stable models of P , the collection 2-STB(P )of stable models [10] of P , and the well-founded model WFS(P ) of P .

Page 7: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 339

Theorem 9 [18]. Let P be in LP∨,∼1 .

1. 3-STB(P ) ⊆MM≺t(P ).

2. 2-STB(P ) = {M ∈ 3-STB(P ) |M is total}.

3. If P is in LP1, WFS(P ) ∈ 3-STB(P ). In addition, WFS(P ) is ≺k-least amongthe partial stable models of P , i.e., for all N ∈ 3-STB(P ), WFS(P ) �k N .

3. Logic programs with multiple default negations

In this section we introduce a class of more expressive disjunctive logic programsin which several forms of default negation may occur.

Definition 10 (LP∼m and LP∨,∼m ).

1. A multiple negation disjunctive logic program (LP∨,∼m program) is a (possibly

infinite) set of clauses of the form

k∨i=0

ai ←l∧i=1

bi,n1∧i=1

not1c1i , . . . ,

nm∧i=1

notmcmi , (1)

where the a’s, b’s and c’s are literals, m > 0, and not1, . . . ,notm are distinctdefault negation operators.

2. A multiple negation logic program (LP∼m program) is an LP∨,∼m program for

which k = 0 in each of its clauses.

Example 1. {a ← not1b,not2c; b ← not2c; c ← not1b,not2d; d ← a} is an LP∨,∼m

program for m = 2.

An LP∨,∼m program P can be mapped into one in LP∨,∼

1 , denoted by Pnot, byreplacing the m operators not1, . . . ,notm with a unique generic operator not.

Definition 11 ((·)not transformation). Let P be in LP∨,∼m . The Pnot transformation

of P is the LP∨,∼1 program defined as follows:

Pnot =

{k∨i=0

ai ←l∧i=1

bi,m∧j=1

nj∧i=1

not cji

∣∣∣∣k∨i=0

ai ←l∧i=1

bi,n1∧i=1

not1c1i , . . . ,

nm∧i=1

notmcmi belongs to P

}.

We define the collections of interpretations and models of P in terms of those ofPnot.

Page 8: Logic knowledge bases with two default rules

340 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

Definition 12 (Interpretations and models of LP∨,∼m programs). We say I is an in-

terpretation (respectively a model) of an LP∨,∼m program P if and only if I is an

interpretation (respectively a model) of Pnot.

In the remainder of the section we study the semantics of LP∼m programs ofthe form (1) when m = 2. The semantics of these programs will be obtained byinterpreting the default operators not1 and not2 using respectively the stable and thewell-founded semantics. Hence, not1 will be denoted by notSTB and not2 by notWFS.We call this new combined semantics the WF3STB semantics. Since the WFS is 3-valued, the 3-valued stable semantics will be used to interpret notSTB. In the sequelwe consider only LP∼m since the WFS is defined only for definite programs. For astudy of the semantics of LP∨,∼

m programs containing disjuctions and more than twodefaul negations, see [23]. See [21] for a comprehensive study of logic programs withseveral forms of negation.

4. The well-founded partial stable semantics

To characterize the semantics of an LP∼2 program P we introduce a set ofcanonical models, called WF3STB models, of P as follows: We define an extension ofthe Gelfond–Lifschitz transformation that, given a 3-valued model M of P , constructsa new program, PM/notSTB , by replacing each literal of the form notSTB c appearingin P by (the proposional symbol corresponding to) its truth value with respect to M .Since PM/notSTB contains only notWFS, i.e. it is free of notSTB, its well-founded modelcan be computed. If this well-founded model coincides with M then we say that Mis a WF3STB model of P .

Definition 13 (Well-founded partial stable models). Let P be an LP∼2 program andlet M be any 3-valued model of P .

1. The Gelfond–Lifschitz transformation PM/notSTB of P with respect to M is theLP∼1 program free of notSTB obtained by replacing in every clause of P all defaultnegated premises l = notSTBc which are true (respectively unknown; respectivelyfalse) in M by the proposition t (respectively u; respectively f).

2. M is a WF3STB model of P if M = WFS(PM/notSTB ).

Example 2. Consider the LP∼2 program P introduced in example 1. The WF3STBsemantics of P is given by1

WF3STB(P ) ={M1 = 〈{b}; {a, c, d}〉, M2 = 〈∅; ∅〉

}.

Checking that M1 = WFS(PM1/notSTB) and M2 = WFS(PM2/notSTB) is straight-forward. Example 10 shows that no other models belong to WF3STB(P ). It

1 Definition 3 requieres any interpretation I to satisfy that t ∈ I+, f ∈ I− and u /∈ I+ ∪ I−. To simplifythe notation, we do not list t in I+ nor f in I−.

Page 9: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 341

is worth noticing that 3-STB(Pnot) = {〈{b}; {a, c, d}〉, 〈∅; ∅〉, 〈{c}; {a, b, d}〉} andWFS(Pnot) = {〈∅; ∅〉}.

5. Properties of the WF3STB semantics

The following theorem states that the WF3STB semantics interpolates betweenthe WFS and the partial stable semantics, as was illustrated in example 2.

Theorem 14 (Interpolation). Let P be in LP∼2 . Then

WFS(Pnot

)∈WF3STB(P ) ⊆ 3-STB

(Pnot

).

Proof. We prove this statement in two steps.(1) WFS(Pnot) ∈WF3STB(P ).The WFS satisfies the property that for any LP∼1 program Q and any N �k

WFS(Q), WFS(Q) = WFS(QN ) (see [7]). Hence, if M = WFS(Pnot) then M =WFS(PM/notSTB ) and so M ∈WF3STB(P ).

(2) WF3STB(P ) ⊆ 3-STB(Pnot).

If M ∈WF3STB(P )

⇒M = WFS(PM/notSTB

)by definition 13

⇒M ∈ 3-STB((PM/notSTB

)not)by proposition 9

⇒M ∈ MM≺t((PM/notSTB

)not)by proposition 9

⇒M ∈ MM≺t(((

PM/notSTB)not)M)

=MM≺t((Pnot

)M)⇒M ∈ 3-STB

(Pnot

)by definition 8. �

Corollary 15. Let P be in LP∼2 . Then, WF3STB(P ) ⊆MM≺t(P ).

Proof. From theorems 14 and 9 it follows that WF3STB(P ) ⊆ MM≺t(Pnot), andby definition 12, MM≺t(P ) =MM≺t(Pnot). �

Theorem 14 implies that the WF3STB semantics preserves many structural andsemantical properties of both the WFS and the 3-STB semantics. In particular, it sat-isfies the properties of elimination of tautologies, the generalized principle of partialevaluation, positive and negative reductions, elimination of non-minimal rules, con-sistency, and independence. These properties provide criteria for an user to determinewhich semantics is more appropriate for his needs. They have been studied extensivelyin [5,6,8,12]. We refer the reader to [8] for a discussion on the importance of theseproperties.

Below, we extend the definitions of these properties to logic programs containingseveral forms of default negation. Some of the properties are defined in terms oftransformations that preserve the meaning of a program. Given an arbitrary semantics

Page 10: Logic knowledge bases with two default rules

342 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

SEM, we say that a transformation TR (which transforms an LP∨,∼m program P into

another LP∨,∼m program P TR) is SEM-equivalent if SEM(P ) = SEM(P TR). In what

follows we abbreviate a clausek∨i=0

ai ←l∧i=1

bi,n1∧i=1

not1c1i , . . . ,

nm∧i=1

notmcmi

by A ← B,not1C1, . . . ,notmCm, where A = {a0, . . . , ak} B = {b1, . . . , bl} andCi = {ci1, . . . , cini}, for 1 6 i 6 m.

Definition 16 (Adapted from [5]). Let SEM be a semantics defined on the class LP∨,∼m .

The following are some properties that the semantics SEM may satisfy.

1. Elimination of tautologies.If a rule A ← B,not1C1, . . . ,notmCm with A ∩ B 6= ∅ is eliminated from aprogram P , then the resulting program is SEM-equivalent to P .

2. Generalized Principle of Partial Evaluation (GPPE).If a rule A ← B,not1C1, . . . ,notmCm, where B contains an atom B, is replacedin a program P by the n rules

A ∪(Ai − {B}

)←((B − {B}

)∪ Bi

),not1

(C1 ∪ Ci1

), . . . ,notm

(Cm ∪ Cim

)where Ai ← Bi,not1Ci1, . . . ,notmCim (i = 1, . . . ,n) are all rules for which B ∈Ai, then the resulting program is SEM-equivalent to P .

3. Positive/negative reduction.If (i) a rule A ← B,not1C1, . . . ,notmCm is replaced in a program P byA ← B,not1(C1 −C), . . . ,notm(Cm −C), where C appears in no rule head, and(ii) a rule A ← B,not1C1, . . . , notmCm is deleted from P if there is a fact A′ ←in P such that A′ ⊆

⋃mi=1 Ci, then the resulting program is SEM-equivalent to P .

4. Elimination of non-minimal rules.If a rule A ← B,not1C1, . . . ,notmCm is deleted from a program P if there isanother rule A′ ← B′,not1C′1, . . . ,notmC′m such that A′ ⊆ A, B′ ⊆ B, andC′i ⊆ Ci for all i = 1, . . . ,m where at least one ⊆ is proper, then the resultingprogram is SEM-equivalent to P .

5. Consistency.If SEM(P ) 6= ∅ for every LP∨,∼

m program P .

6. Independence.If for every literal l, l is true in every model M ∈ SEM(P ) iff l is true in everymodel M ∈ SEM(P ∪ P ′) provided that the language of P and P ′ are disjointand l belongs to the language of P .

Lemma 17 [5]. The WFS satisfies all the properties of definition 16 for the classLP1.

Page 11: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 343

Theorem 18 (Semantic properties of WF3STB). The WF3STB semantics satisfies allthe properties of definition 16 for the class LP∼2 .

Proof. (1) Let TR denote the transformation characterizing any of the followingproperties: elimination of tautologies, the generalized principle of partial evalua-tion, positive/negative reductions, elimination of non-minimal rules. We show thatWF3STB(P ) = WF3STB(P TR).

M ∈WF3STB(P )⇔ M = WFS

(PM/notSTB

)by definition 13

⇔ M = WFS((PM/notSTB

)TR)by lemma 17

⇔ M = WFS((P TR

)M/notSTB)

by definition 16⇔ M ∈WF3STB

(P TR

)by definition 13.

(2) The WF3STB satisfies consistency as proven in part 1 of theorem 20.(3) The WF3STB satisfies independence as will follow from proposition 21. �

6. Computational complexity of the WF3STB semantics

Besides preserving many structural and semantical properties of both the WFS andthe 3-STB semantics, the WF3STB semantics preserves the computational complexityof the 3-STB semantics. Theorem 14 guarantees the existence of WF3STB modelsfor any LP∼2 program P , namely the well-founded model of Pnot. Since this well-founded model is ≺k-least among the WF3STB models of P , then skeptical reasoningin the WF3STB semantics (i.e., determining if a literal is true in every WF3STB modelof the program) is equivalent to determining if the literal is true in the WFS(Pnot).Credulous reasoning in the WF3STB semantics (i.e., determining if a literal is true insome WF3STB model of the program) is as complex as credulous reasoning in thenon-disjunctive 3-STB semantics. Theorem 20 summarizes these observations for thepropositional case.

From this point on, given an arbitrary semantics SEM, CRSEM denotes the prob-lem of credulous reasoning under SEM. Marek and Truszczynski [13] proved thatcredulous reasoning for finite propositional LP1 programs under the (total) stable se-mantics is NP-complete. In the following lemma we prove that their result extends tothe three valued stable semantics.

Lemma 19. Credulous reasoning for finite propositional non-disjunctive LP∼1 pro-grams under the partial stable semantics is NP-complete.

Proof. Let P be an arbitrary finite LP∼1 program and let l ∈ L.CR3-STB is in NP. The following procedure shows membership to NP: Guess a

3-valued interpretation M of P and check that (1) M is a model of P ; (2) M is the

Page 12: Logic knowledge bases with two default rules

344 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

≺t-minimal model of PM (since PM is negation and disjunction-free, it has a unique≺t-minimal model); and (3) l is true in M . Each of these three checking steps can beperformed in polynomial time in the length of P .

CR3-STB is NP-hard. We give a polynomial reduction from CR2-STB which hasbeen proven to be NP-complete (see [13]). Let P be the following LP∼1 program:

P = P ∪{⊥ ← p,not p | p ∈ L appears in P

}∪{l← l,not ⊥

},

where ⊥ and l are new propositional symbols not appearing in P . P can be constructedin polynomial time in the length of P . Note that ⊥ is false in a partial stable modelM of P iff M is total. This, together with theorem 9, implies that CR2-STB(P , l) isequivalent to CR3-STB(P , l) and our claim follows. �

Theorem 20 (Complexity of reasoning under WF3STB).

(1) The existence of WF3STB models for any LP∼2 program P is guaranteed.

(2) The complexity of skeptical reasoning for LP∼2 programs under the WF3STBsemantics is at most quadratic in the length of the program.

(3) Credulous reasoning for finite LP∼2 programs under the WF3STB semantics isNP-complete.

Proof. (1) Follows from the fact that WFS(Pnot) ∈WF3STB(P ).(2) By theorems 9 and 14, WFS(Pnot) ≺k M for all M ∈WF3STB(P ). Hence,

a literal l is true in every M ∈ WF3STB(P ) if and only if l is true in WFS(Pnot).Since WFS(Pnot) can be computed in quadratic time in the length of P (see [24]),then skeptical reasoning with respect to the WF3STB semantics is at most quadraticin the length of the program.

(3) Let P be an arbitrary finite LP∼2 program and let l ∈ L.CRWF3STB is in NP. The following procedure shows membership to NP: Guess

a 3-valued interpretation M of P and check that (1) M is a model of P ; (2) M =WFS(PM/notSTB); and (3) l is true in M . Each of these three checking steps can beperformed in polynomial time in the length of P .

CRWF3STB is NP-hard. Note that every LP∼1 program Q containing only partialstable negation is also an LP∼2 program and that 3-STB(Q) = WF3STB(Q). Hence,CRWF3STB(Q, l) is equivalent to CR3-STB(Q, l). Our claim follows from lemma 19. �

7. Applications and examples

7.1. Combining knowledge bases

One important application of the WF3STB semantics is in combining differentknowledge bases. Say we have two LP∼1 programs P and Q whose meanings are givenby the 3-STB semantics and the WFS respectively. The meaning of the combination

Page 13: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 345

of P and Q is naturally obtained by applying the WF3STB semantics to (P ∪Q). Thefollowing example illustrates this.

Example 3. Consider the following LP∼1 programs P and Q:

P =

{a←notSTB bb←notSTB a

}Q =

p←notWFS qq←notWFS pr←notWFS s

3-STB(P ) = {〈{a}; {b}〉, 〈{b}; {a}〉, 〈∅; ∅〉} WFS(Q) = {〈{r}; {s}〉}

WF3STB(P ∪Q) = {〈{a, r}; {b, s}〉, 〈{b, r}; {a, s}〉, 〈{r}; {s}〉}

Note that in this example the WF3STB of (P ∪Q) coincides with the Cartesianproduct of the 3-STB semantics of P and the WFS of Q, as defined below.

Indeed, when P and Q are written in disjoint languages, it is always the case thatthe WF3STB models of (P ∪Q) can be easily obtained from the 3-STB models of Pand the well-founded model of Q. This is expressed in our next proposition whichuses the following notation: Given LP∼1 programs P and Q, and two arbitrary LP∼1semantics Sem1 and Sem2, Sem1(P )× Sem2(Q) denotes the Cartesian product{⟨

M+ ∪N+;M− ∪N−⟩ ∣∣M ∈ Sem1(P ) and N ∈ Sem2(Q)

}.

Proposition 21. Let P and Q be LP∼1 programs written in disjoint languages LP andLQ and such that their meanings are given by the partial stable and the well-foundedsemantics, respectively. Then,

WF3STB(P ∪Q) = 3-STB(P )×WFS(Q).

Proof.

M ∈WF3STB(P ∪Q)⇔ M = WFS

((P ∪Q)M/notSTB

)by definition 13

⇔ M = WFS(PM/notSTB ∪Q

)since Q is notSTB-free

⇔ M = WFS(PM/notSTB

)×WFS(Q) since WFS satisfies Independence

and LP ∩ LQ = ∅⇔ M =MM≺t

(PM/notSTB

)×WFS(Q) since PM/notSTB is notWFS-free

⇔ M ∈ 3-STB(P )×WFS(Q) by definition 8. �

When P and Q are written in a common language, it seems that there is noautomatic way to combine 3-STB(P ) and WFS(Q) to obtain WF3STB(P ∪Q), and so

Page 14: Logic knowledge bases with two default rules

346 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

the definition of the WF3STB semantics must be used directly to obtain the meaningof (P ∪Q). The following example illustrates this situation.

Example 4. Let P and Q be the following LP∼1 programs:

P = {p←notSTB a} Q = {a← }

3-STB(P ) = {〈{p}; {a}〉} WFS(Q) = {〈{a}; ∅〉}

WF3STB(P ∪Q) = {〈{a}; {p}〉}

7.2. Using different criteria to jump to conclusions

The presence of multiple kinds of default negation in the same logic programempowers us to represent different pieces of information in the domain of an applicationusing alternative criteria to jump to conclusions, instead of being restricted to employthe same criterion uniformly over the whole domain as is the case when only one formof negation is available. The presence of notSTB and notWFS enables us to choosewhether the default negation of a literal l should be interpreted as partial stability (inthe case of notSTB l) or as unfoundedness (in the case of notWFS l).

Example 5. Let P1 and P2 be the following LP∼2 programs and let P = Pnot1 = Pnot2 .

P1 =

a←notSTB bb←notSTB ap←notWFS pp←notWFS b

P2 =

a←notWFS bb←notWFS ap←notSTB pp←notSTB b

WF3STB(P1) = {〈{a, p}; {b}〉, 〈{b}; {a}〉, 〈∅; ∅〉} WF3STB(P2) = {〈∅; ∅〉}

Note that in P , a and b depend negatively on each other. In P1, the dependencyis interpreted using the 3-STB semantics so three cases are considered: (1) a is trueand b is false; (2) a is false and b is true; and (3) a and b are both unknown. In P2,the dependency is interpreted using the WFS semantics so only the third case is takeninto account.

Example 6 (A queueing problem). Consider the situation depicted in Fig. 1.A queue served by two agents a and b splits the work as follows: agent a services

a request if and only if agent b does not service the request. After either has processedthe request, the result is sent to a black box. This black box contains two new agents cand d who split the remaining work as a and b do, namely agent c services the requestif and only if agent d does not.

Page 15: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 347

black box

@@@@

@@@@R

�����

@@@@R

�����

..����

a

b

c

d

Figure 1.

Notice that, in the presence of a request, there are three possible scenarios tobe considered: (1) it is known that a services the initial request; (2) it is known thatb services the initial request; or (3) it is unknown which of them services the initialrequest. Since c and d are inside a black box, there is no way to tell from the outsidewhich of them services the second stage of the request, hence we conclude in eachpossible scenario that the identity of the second stage server is unknown. This situationcan be modeled by the program P2 below as given by the following reasoning. Sincewe do not know what is happening in the black box, we want to be skeptical aboutour reasoning and hence, we model the relationship between servers c and d by thewell-founded semantics. On the other hand, we are willing to be more credulous with

P1 =

a←notSTB bb←notSTB ac←notSTB dd←notSTB c

P2 =

a←notSTB bb←notSTB ac←notWFS dd←notWFS c

P3 =

a←notWFS bb←notWFS ac←notWFS dd←notWFS c

WF3STB(P1)= 3-STB(P1)= {M1 = 〈{a, c}; {b, d}〉,

M2 = 〈{a}; {b}〉,M3 = 〈{a, d}; {b, c}〉,M4 = 〈{c}; {d}〉,M5 = 〈∅; ∅〉,M6 = 〈{d}; {c}〉,M7 = 〈{b, c}; {a, d}〉,M8 = 〈{b}; {a}〉,M9 = 〈{b, d}; {a, c}〉}

WF3STB(P2)= {M2,M5,M8}

WF3STB(P3)= WFS(P3)= {M5 = 〈∅; ∅〉}

Page 16: Logic knowledge bases with two default rules

348 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

our reasoning about a and b, since they are visible to us and hence we use the partialstable semantics to model the relationship between a and b. As desired,

WF3STB(P2) ={〈{a}; {b}〉, 〈{b}; {a}〉, 〈∅; ∅〉

}.

The program P1 considers the case where the negation is exclusively modeled by thepartial stable semantics and P3 by the well-founded semantics. In accordance withtheorem 14, the semantics of P2 lies between that of P1 and P3.

8. Computing the WF3STB semantics

The definition of the WF3STB semantics given in section 4 is non-constructive.It provides a test to determine whether or not a given model is a WF3STB model ofa program. In this section we give an effective procedure to construct the collectionof WF3STB models of an LP∼2 program.

Due to theorem 14, the WF3STB semantics of an LP∼2 program P can becharacterized as follows:

WF3STB(P ) ={M ∈ 3-STB

(Pnot

)|M = WFS

(PM/notSTB

)}.

Given that the WFS can be effectively computed (as stated in theorem 7), the existenceof a procedure that computes the partial stable semantics implies that of a procedureto compute the WF3STB semantics, namely the one given in figure 2.

Instruction 1 of the procedure in figure 2 is in fact computable as we have intro-duced procedures to construct the partial stable semantics in [22,25]. The procedureintroduced in [25] is based on annotating the atoms in the program by the truth valuestrue and unknown in such a way that the partial stable models of the program can beobtained from the (total) stable models of the annotated program in a straightforwardmanner. The procedure introduced in [22] is based on a transformation that we call the3S-transformation. In what follows, we outline the definition of the 3S-transformation(complete details including statements and proofs of the properties of the transforma-tion may be found in [22]). Near the end of this section we provide an example ofhow to use this transformation together with the procedure in figure 2 to compute theWF3STB models of a given LP∼2 program.

It is worth noticing that the 3S-transformation applies to disjunctive logic pro-grams containing at most one form of default negation which is interpreted using the

1. S := 3-STB(Pnot)2. J := ∅3. for each M ∈ S do4. if M = WFS(PM/notSTB) then5. J := J ∪ {M}6. WF3STB(P ) := J

Figure 2. Procedure to compute the WF3STB semantics.

Page 17: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 349

3-STB semantics. Also, the characterization of the partial stable semantics in terms ofwell-supported models described below applies only to programs in which disjunctionis interpreted in the exclusive sense, that is a∨ b implies that either a or b is true, butnot both. To make this explicit, we denote those programs by LP∨,∼

1 . This restrictiondoes not affect the computation of WF3STB models since the WF3STB semantics isdefined for non-disjunctive programs only.

When applied to an LP∨,∼1 program P , the transformation produces a constraint

logic program (free of default negation), called P 3S , whose minimal consistent modelscorrespond to the 3-valued stable models of the original program P . P 3S is writtenin a language L, which is richer than the language L, obtained by adding to L newpropositional symbols ua and na for each propositional symbol a ∈ L. Intuitively, awill be understood as a is true, ua as a is unknown and na as a is false. Since one ofthese cases must hold, the clause a∨ua∨na belongs to P 3S . However, it may be thecase that, say, a and ua are both true in an interpretation of P 3S . Since this is clearlyundesirable, we impose a set of denial rules on the models of P 3S to eliminate suchpossibilities.

Furthermore, constraints are added to the clauses of P 3S to guarantee that itsmodels are well-supported, i.e., supported with loop-free finite justifications. A set ofconstraints {a > bi: 1 6 i 6 m} with respect to a clause C = a ∨ H ← b1, . . . ,bm,not c1, . . . ,not cn can be understood as requiring that if the clause C is usedto prove that a is either true or unknown, then the proofs that the b’s are true orunknown do not rely on the proof for a. Then we say that the union of some sets ofconstraints is satisfied when > is a partial order (i.e., a > b and b > a are not requiredsimultaneously).

The well-supported models of P 3S are in a one-to-one correspondence with thepartial stable models of P due to the following characterization of the partial stablesemantics proven in [22].

Definition 22 (Well-supported 3-valued interpretations [22]). A Herbrand 3-valued in-terpretation I is a well-supported 3-valued interpretation of an LP∨,∼

1 program P iffthere exists a strict well-founded partial ordering < on I+ ∪ Iu such that for anya ∈ I+ ∪ Iu there is a ground instance of a clause

C = a ∨ a1 ∨ · · · ∨ ak︸ ︷︷ ︸H

← b1, . . . , bm,not c1, . . . ,not cn︸ ︷︷ ︸B

in P satisfying the following conditions:

1. a > bi for all i ∈ {1, . . . ,m} and

2. Case 1: If a ∈ I+, then VI (B) = true and VI (H) <t true, or

Case 2: If a ∈ Iu, then VI (B) = unknown and VI (H) = false.

(These two cases can be summarized as VI(H) <t VI(B) = VI(a).)

Page 18: Logic knowledge bases with two default rules

350 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

Theorem 23 (Well-supportedness ≡ partial stability [22]). Let P be an LP∨,∼1 pro-

gram and let M be a 3-valued interpretation of P . Then, M is a 3-valued stable modelof P iff M is a well-supported 3-valued model of P .

Given an LP∨,∼1 program P , the 3S-transformation constructs all potential justi-

fications or supports for a proposition to be true, false or unknown. Those justificationsare written as constraint clauses and collected to form a constraint LP∨,∼

0 program(free of default negation) called P 3S . The constraints ensure that the justifications areloop-free.

Definition 24 (Extended language L [22]). Let L be a propositional language. L isextended to the propositional language

L = {a,ua,na | a ∈ L}.

We introduce operators T , F and U which, applied to a sentence in the languageL, produce sets of all possible justifications in the expanded language L under whichthe given sentence is true, false or unknown, respectively. In other words, a sentenceϕ is true (respectively false, respectively unknown) if and only if at least one of thesupporting sentences in T (ϕ) (respectively F(ϕ), respectively U(ϕ)) holds. In whatfollows we inductively define these operators.

Definition 25 (Operators T ,F and U on normal literals [22]). Let a ∈ L. The oper-ators T , F and U are defined on a and on not a as follows:

T (a) = {a}, T (not a) = {na},U(a) = {ua}, U(not a) = {ua},F(a) = {na}, F(not a) = {a}.

A disjunction of propositions H = a1 ∨ · · · ∨ ak, is true when at least one ofthe propositions a1, . . . , ak is true; false when all these propositions are false; andunknown when at least one of these propositions is unknown and the remaining onesare either unknown or false. We codify all possibilities under which H is unknown byusing k-tuples of 0’s and 1’s that contain at least one 1. Such a tuple 〈λ1, . . . ,λk〉 canbe seen as stating that ai is false if λi = 0 and unknown if λi = 1. If at least one λjis 1, then H is unknown. We express this formally in the language L in the followingdefinition.

Definition 26 (Operators T , F and U on disjunctions [22]). Let H = a1 ∨ · · · ∨ ak,k > 0, be an arbitrary disjunction of propositions. The operators T ,F and U aredefined on H as follows:

T (H) = {a1 | . . . | ak},2

2 We use the symbol “|” to separate elements in a set.

Page 19: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 351

F(H) = {na1 ∧ · · · ∧ nak},

U(H) ={

(F/U)λ1 (a1) ∧ · · · ∧ (F/U)λk (ak): 〈λ1, . . . ,λk〉 ∈ Bk}

,

where

Bk ={〈λ1, . . . ,λk〉: λ1, . . . ,λk ∈ {0, 1} and ∃j ∈ {1, . . . , k}, λj = 1

},

(F/U)λ(a) =

{F(a), if λ = 0,

U(a), if λ = 1.

Notice that when H is an empty disjunction (i.e., when k = 0) the previousdefinition makes T (H) = U(H) = { } ≡ {f} and F(H) = {t}.

We follow a similar process to define the truth value of a conjunction of normalliterals B = b1, . . . , bm,not c1, . . . ,not cn. B is true if all b’s are true and all c’sare false; it is false if at least one of the b’s is false or one of the c’s is true; andit is unknown if the truth values of the b’s and (not c)’s are greater than or equalto unknown (i.e., unknown or true) and at least one of them is unknown. Again, wecodify all possibilities under which B is unknown by using (m+ n)-tuples of 0’s and1’s that contain at least one 1. Such a tuple 〈λ1, . . . ,λm+n〉 can be seen as stating thatthe b’s and the (not c)’s are true if the corresponding entries in the tuple equal 0 orare unknown if they are equal to 1. Since at least one entry is 1, then B is unknown.The following definition formalizes this in the language L.

Definition 27 (Operators T , F and U on conjunctions [22]). Let B = b1, . . . , bm,not c1, . . . ,not cn, where m,n > 0. The operators T , F and U are defined on B asfollows:

T (B) = {b1 ∧ · · · ∧ bm ∧ nc1 ∧ · · · ∧ ncn},

F(B) ={nb1 | . . . | nbm | c1 | . . . | cn

},

U(B) ={

(T /U)λ1 (b1) ∧ · · · ∧ (T /U)λm (bm)

∧ (T /U)λm+1 (not c1) ∧ · · · ∧ (T /U)λm+n(not cn):

〈λ1, . . . ,λm+n〉 ∈ Bm+n}

,

where

(T /U)λ(ϕ) =

{T (ϕ), if λ = 0,

U(ϕ), if λ = 1.

When B is an empty conjunction (i.e., when m,n = 0), T (B) = {t} and F(B) =U(B) = {} ≡ {f}, according to the previous definition.

We concentrate now on determining when a clause is a support for a propositionwith respect to a model M of the clause. Assume that there is a well-founded partialorder < on M+ ∪ Mu. Let a be an arbitrary but fixed proposition and let C =

Page 20: Logic knowledge bases with two default rules

352 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

a ∨ H ← B, where B = b1, . . . , bm,not c1, . . . ,not cn. C is a support for a withrespect to M if one of the following cases holds.

1. If VM (a) is true then VM (H) <t VM (B) = true and a > bi for all i ∈ {1, . . . ,m}.

2. If VM (a) is unknown then VM (H) <t VM (B) = unknown and a > bi for alli ∈ {1, . . . ,m}.

3. If VM (a) is false then VM (H) >t VM (B) (this happens when VM (H) is true,when VM (B) is false or when both values are unknown).

These three cases are explicitly coded in the operators Ta, Ua and Fa in thefollowing definition. As stated before, a set of constraints {a > bi: 1 6 i 6 m} withrespect to a clause C = a ∨H ← b1, . . . , bm,not c1, . . . ,not cn can be understood asrequiring that if the clause C is used to support that a is either true or unknown, thenthe proofs that the b’s are true or unknown should not rely on the proof for a. Then wesay that a set of constraints is satisfied when < is a partial order (i.e., a > b and b > aare not required simultaneously). Since the definition of well-supportedness calls onlyfor the existence of a partial order in the set of true and unknown propositions of amodel, we do not have to add constraints to clauses supporting a to be false.

Definition 28 (Operators Ta, Fa and Ua [22]). Let a ∈ L and let

C = a ∨H ← b1, . . . , bm,notc1, . . . ,notcn︸ ︷︷ ︸B

be a clause in P . Let Ca(B) be the following set of constraints:

Ca(B) = {a > bi: 1 6 i 6 m}.

The operators Ta, Fa and Ua on the clause C are defined as follows:

Ta(H ,B) = T (B),[F(H) | U(H)

]under constraints Ca(B).

Fa(H ,B) =F(B) | T (H) |(U(B),U(H)

)under no constraints.

Ua(H ,B) =(U(B),F(H)

)under constraints Ca(B).

The operators “,” and “|” between sets stand for the usual operators “×” (Cartesianproduct) and “∪” (union), respectively. (We use here “,” and “|” to preserve the flavorof logic programming syntax.)

Example 7. Let C = a← b,not c. Then, all possible supports for the three possibletruth values of a are listed below:

Ta(( ), (b,not c)

)= {b ∧ nc} under Ca(B) = {a > b},

Fa(( ), (b,not c)

)= {nb | c} under no constraints,

Ua(( ), (b,not c)

)={

(ub ∧ nc) | (b ∧ uc) | (ub ∧ uc)}

under Ca(B) = {a > b},

Page 21: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 353

which state that the only justification for a to be true is that b be true and c be falsesimultaneously. There are two supports for a to be false, namely b is false or c is true.All the remaining possibilities support a to be unknown.

We construct now all possible justifications of a proposition a with respect to aprogram P . Consider the set of all clauses defining a in P (i.e., the set of clausescontaining a in their heads). With respect to a well-supported 3-valued model of P , ais true when at least one of these clauses supports a to be true, a is false if all clausesin its definition support a to be false, and a is unknown when none of these clausessupports a to be true but at least one of them supports a to be unknown. Since one ofthese cases must hold, the clause a ∨ ua ∨ na must be satisfied in the well-supportedmodel.

It is worth noticing that if a proposition a is not defined in P (it does not appearin the head of any clause in P ) then there is no support for it to be true or unknownand therefore it is taken to be false.

Definition 29 (3S-transformation [22]). Let P be in LP∨,∼1 .

1. Let a ∈ L. Let the definition of a in P consists of the following set of clauses:

a ∨H1←B1...

a ∨Hr←Br

where r > 0. The 3S-transformation of the definition of a, denoted by a3S , isgiven by the following set of clauses:

• If r = 0:

na←• If r > 0:

a←{Ta(H1,B1) | . . . | Ta(Hr,Br)

}ua←

{(Fa/Ua

)λ1 (H1,B1), . . . ,(Fa/Ua

)λr(Hr,Br):

〈λ1, . . . ,λr〉 ∈ Br}

na←Fa(H1,B1), . . . , Fa(Hr,Br)

a ∨ ua ∨ na←where ϕ← {ψ1 | . . . | ψn} is a shorthand for the set of clauses

ϕ ← ψ1

...

ϕ ← ψn

Page 22: Logic knowledge bases with two default rules

354 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

and (Fa/Ua

)λ(H ,B) =

{Fa(H ,B), if λ = 0,

Ua(H ,B), if λ = 1.

2. The 3S-transformation P 3S of P is obtained by applying the 3S-transformation toeach proposition in the language of P .

The number of clauses in P 3S is, in general, exponential on the number ofclauses in P since all possible supports for each truth value of a proposition in L areconsidered.

As noted before, the 3S-transformation requires that each proposition a assumesa truth value. However, it may be the case that, say, a and ua are both true in aninterpretation of P 3S . Since this is clearly undesirable, we impose a set of denial ruleson the models of P 3S to eliminate such possibilities.

Definition 30 (Denial rules ICP [22]). Let P be a disjunctive logic program and letICP denote the following set of denial rules:

ICP ={⇐ a,ua;⇐ a,na;⇐ ua,na: a ∈ L − {t, u, f}

}.

In what follows, we restrict interpretations of P 3S to be subsets of L satisfying thedenial rules ICP . Given an interpretation I of P 3S , I+, I− and Iu denote respectivelythe positive, the negative and the uncertain parts of I , i.e., I+ = {a ∈ L: a ∈ I},I− = {a ∈ L: na ∈ I} and Iu = {a ∈ L: ua ∈ I}. I3 denotes the 3-valuedinterpretation 〈I+; I−〉.

Associated with each a ∈ I+ ∪ Iu there is a collection CIa that contains all thesets of constraints that appear in clauses supporting a (or ua) with respect to I (for anillustration see example 9 below), i.e.,

CIa ={Ca(B): there is either a clause a← B or a clause ua← B under

constraints Ca(B) in P 3S such that VI (B) = true}

.

Let CI = {CIa: a ∈ I+ ∪ Iu}. We say that I satisfies the constraints in CI if andonly if for every a ∈ I+∪Iu there is some Ca(Ba) ∈ CIa such that [

⋃(a∈I+∪Iu) Ca(Ba)]

defines a partial order in I+ ∪ Iu.We make precise now the notion of (minimal) 2-valued models of P 3S .

Definition 31 (2-valued models of P 3S [22]).

1. A 2-valued model of P 3S is any interpretation of P 3S which satisfies all clausesin P 3S and the constraints in CM .

2. Let M and N be 2-valued models of P 3S . We say that M 6 N iff M+ ⊆ N+

and N− ⊆M−.

Page 23: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 355

A 3-valued interpretation J of P can be transformed into a 2-valued interpretationJ2 of P 3S by defining

J2 = J+ ∪{ua: a ∈ Ju} ∪ {na: a ∈ J−

}.

The set of 6-minimal 2-valued models of P 3S (denoted by MICPP 3S ) is related

closely to the set of 3-valued stable models of P , as the following examples show.

Example 8. Let

P = {b ∨ c; a← not b; a← not c},

P 3S ={

b ← (uc | nc) Cb = ∅nb ← c

c ← (ub | nb) Cc = ∅nc ← b

a ← nb | nc Ca = ∅na ← b, c

ua ← (ub, c) | (b,uc) | (ub,uc) Ca = ∅a ∨ ua ∨ na ←b ∨ ub ∨ nb ←c ∨ uc ∨ nc ←

},

ICP ={⇐ x,ux;⇐ x,nx;⇐ ux,nx: x ∈ {a, b, c}

}.

The minimal 2-valued models of P 3S are

MICPP 3S =

{M1 = {a, b,nc},M2 = {a,nb, c}

}.

Here,

CM1 ={CM1a = {∅}, CM1

b = {∅}}

and

CM2 ={CM2a = {∅}, CM2

c = {∅}}.

Clearly, M1 and M2 respectively satisfy the constraints in CM1 and CM2 since an emptyset of constraints defines a partial order on any set. M1 and M2 correspond to thepartial stable models of P :

3-STABLE(P ) ={⟨

{a, b}{c}⟩,⟨{a, c}{b}

⟩}.

Example 9. Let

P = {a← b; b← a; c← not a},

Page 24: Logic knowledge bases with two default rules

356 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

P 3S ={

a ← b Ca = {a > b}

ua ← ub Ca = {a > b}

na ← nb

b ← a Cb = {b > a}

ub ← ua Cb = {b > a}

nb ← na

c ← na Cc = ∅uc ← ua Cc = ∅nc ← a

a ∨ ua ∨ na ←b ∨ ub ∨ nb ←c ∨ uc ∨ nc ←

},

ICP ={⇐ x,ux;⇐ x,nx;⇐ ux,nx: x ∈ {a, b, c}

}.

There are three minimal models of P 3S :

M1 = {a, b,nc} with CM1 ={Ca = {a > b}, Cb = {b > a}

},

M2 = {ua,ub,uc} with CM2 ={Ca = {a > b}, Cb = {b > a}, Cc = {∅}

},

M3 = {na,nb, c} with CM3 ={Cc = {∅}

}.

Notice, however that the sets of constraints on M1 and on M2 are unsatisfiable since{a > b, b > a} is not a partial order. Therefore, MICP

P 3S = {{na,nb, c}} which corre-sponds to the unique 3-valued stable (and hence well-founded) model of P , namely{〈{c}; {a, b}〉}.

Indeed, there is a one-to-one correspondence between the minimal models ofthe constraint logic program P 3S and the 3-valued well-supported (and hence partialstable) models P as proven in [22].

Theorem 32 (Well-supportedness ≡ MICPP 3S [22]). Let P be an LP∨,∼

1 program andlet M be a 3-valued interpretation of P . Then M is a 3-valued well-supported modelof P iff M2 ∈MICP

P 3S .

Corollary 33 (Partial stability ≡ MICPP 3S [22]). Let P be an LP∨,∼

1 program and letM be a 3-valued interpretation of P . Then M is a 3-valued stable model of P iffM2 ∈MICP

P 3S .

We refer the reader to [22] for further details on the translation of the programP to the constraint logic program P 3S , and the construction of the minimal consistent

Page 25: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 357

models of the resulting program. The following example shows how to use the 3S-transformation to compute the WF3STB semantics of an LP∼2 program.

Example 10. Let P be the LP∼2 program of examples 1 and 2:(Pnot

)3S={

a ← nb,ncua ← (ub,nc) | (ub,uc) | (nb,uc)na ← b | cb ← ncub ← ucnb ← cc ← nb,nduc ← (ub,nd) | (ub,ud) | (nb,ud)nc ← b | dd ← a, {d > a}ud ← ua, {d > a}nd ← na

a ∨ ua ∨ na ←b ∨ ub ∨ nb ←c ∨ uc ∨ nc ←d ∨ ud ∨ nd ←

}with set of denial rules

ICP ={⇐ x,ux;⇐ x,nx;⇐ ux,nx: x ∈ {a, b, c, d}

}.

The set of minimal 2-valued consistent models of (Pnot)3S is{{na, b,nc,nd}, {ua,ub,uc,ud}, {na,nb, c,nd}

}which corresponds to

3-STB(Pnot

)={M1 = 〈{b}; {a, c, d}〉,M2 = 〈∅; ∅〉,M3 = 〈{c}; {a, b, d}〉

}.

Only M1 and M2 satisfy the condition of being the well-founded models of the pro-grams PM1/notSTB and PM2/notSTB , respectively, so WF3STB(P ) = {M1,M2}.

It is worth noticing that even for the propositional case, the problem of con-structing the collection of partial stable models of an LP∨,∼

1 program is not tractable.3

This is a consequence of the observation that one can solve the problem of credulousreasoning under the 3-STB semantics by constructing all the partial stable models ofa program. Hence, by lemma 19, this construction cannot be performed in polyno-mial time. This implies that the procedure given in figure 2 to compute the WF3STBsemantics is also non-polynomial in the length of the program.

3 Assuming that P 6= NP.

Page 26: Logic knowledge bases with two default rules

358 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

9. Extensions of the WFSTABLE semantics

In the same way in which the WF3STB semantics was defined, one can definea semantics for LP∨,∼

m programs combining two forms of default negation, one beingthe stable semantics (with default operator notSTB) and the other one being any LP∨,∼

1semantics SEM (with default operator denoted by notSEM).

Given such a logic program P , the Gelfond–Lifschitz transformation can be usedto eliminate the occurrences of the stable negation notSTB with respect to a model4

of P . The resulting program contains only notSEM so its semantics under SEM iswell-defined. Hence, the combined semantics of P can be taken to be the collectionof models of Pnot satisfying the fixpoint equation M ∈ SEM(PM/notSTB). That is,

SEM-STB(P ) :={M is a model of P |M ∈ SEM

(PM/notSTB

)}.

In particular, the WF3STB semantics can be defined for the class of LP∨,∼1 programs

by using an extension of the WFS for the class of disjunctive logic programs. Al-ternative such extensions of the WFS to the disjunctive case can be found in [3,20].Computational issues as to whether there is an effective procedure to construct thiscollection of models, and the complexities of reasoning tasks must be studied on acase-by-case basis.

10. Conclusions

To the best of our knowledge, three other logic programming frameworks allowthe occurrence of more than one default/modal operator: L3 [2], Epistemic Specifica-tions [9], and the Autoepistemic Logic of Minimal Beliefs [19].

L3 is a logic programming language that allows logic programs to contain up tothree default negations [2]. These default negations are interpreted using the gener-alized closed world assumption, the weak generalized closed world assumption, andthe stable semantics, respectively. An alternative definition of the semantics of logicprograms combining these three forms of default negation and explicit negation canbe found in [23].

The language of epistemic specifications contains two modal operators: K (knowl-edge) and M (possible belief). These operators are meta-operators that have the abilityto refer to the collection of answer sets (see [11]) of a program in the following sense:If ϕ is a formula, K(ϕ) is true if ϕ is true in every answer set of the program andM(ϕ) is true if ϕ is true in some answer set of the program.

In the framework of autoepistemic logic of minimal beliefs there are also twooperators: L (provability) and B (belief). In contrast with the previous case, thesemeta-operators are independent of each other. The intended meaning of L(ϕ) is “ϕ istrue in every stable autoepistemic expansion of the program” and the intended meaning

4 Depending on whether SEM is 2-valued or 3-valued, total or partial models should be considered here,that is, the (total) stable semantics or the partial stable semantics should be used to interpret notSTB.

Page 27: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 359

of B(ϕ) is “ϕ is true in every minimal model of the program”. As stated in [19],these operators may be adapted to capture the well-founded and the stable negations.Whether or not the semantics of autoepistemic logic of minimal beliefs coincides withthe WF3STB semantics on the class of LP∼2 programs is an open question.

In this paper, we have described a class of definite logic programs that containtwo types of default negation in addition to explicit negation, and proposed a semantics,called WF3STB, for these programs. This semantics interpolates between the partialstable semantics and the WFS. In addition, we have provided an effective procedureto construct the collection of WF3STB models of a program.

We showed that, for the propositional case, the existence of models under thissemantics is guaranteed and that skeptical and credulous reasoning are respectivelyquadratic and NP-complete in the length of a program. Hence, these reasoning tasksunder the WF3STB semantics have the same computational complexity as underthe 3-STB semantics for non-disjunctive LP∼1 programs. We also showed that theWF3STB semantics preserves many structural and semantical properties of both theWFS and the 3-STB semantics, namely the properties of elimination of tautologies,the generalized principle of partial evaluation, positive and negative reductions, elim-ination of non-minimal rules, consistency, and independence.

An advantage of the definition of the WF3STB semantics is that it is easily ex-tensible to larger classes of programs as, for instance, the class of extended disjunctivelogic programs. Also, semantics for logic programs which combine the stable nega-tion and a negation other than the well-founded can be obtained by mimicking thedefinition of the WF3STB semantics.

Applications of the WF3STB semantics to knowledge representation and knowl-edge base merging were presented. More applications in which this semantics isrelevant are needed. Also, criteria to determine under which circumstances each typeof negation is appropriate should be developed.

Acknowledgements

We want to thank the referee of this paper for providing very helpful comments.Also, we would like to thank Dietmar Seipel for his comments concerning the paper.

References

[1] J.J. Alferes and L.M. Pereira, On logic program semantics with two kinds of negation, in: Pro-ceedings of the Joint International Conference and Symposium on Logic Programming, Washington,DC, November 1992, ed. K. Apt (MIT Press, Cambridge, MA, 1992) pp. 574–588.

[2] C. Baral, L3: A logic programming language with multiple default negations, in: Proceedings ofthe Fifth International Symposium on AI (December 1992).

[3] C. Baral, J. Lobo and J. Minker, Generalized disjunctive well-founded semantics: Declarativesemantics, in: Proceedings of the Fifth International Symposium on Methodologies for IntelligentSystems, Knoxville, TN (1990) pp. 465–473.

Page 28: Logic knowledge bases with two default rules

360 C. Ruiz, J. Minker / Logic knowledge bases with two default rules

[4] N. Bidoit, Negation in rule-based data languages: A survey, Theoretical Computer Science 78(1991).

[5] J. Dix, A classification theory of semantics of normal logic programs: I. Strong properties, Funda-menta Informaticae 22(3) (1995) 227–255.

[6] J Dix, A classification theory of semantics of normal logic programs: II. Weak properties, Funda-menta Informaticae 22(3) (1995) 257–288.

[7] J. Dix, Disjunctive deductive databases: theoretical foundations and operational semantics, Ha-bilitation thesis, Institut fur Informationssysteme Abteilung Wissensbasierte Systeme, TechnischeUniversitat Wien (1995).

[8] J. Dix, Semantics of logic programs: Their intuitions and formal properties, An overview, in:Logic, Action and Information – Essays on Logic in Philosophy and Artificial Intelligence, eds.A. Fuhrmann and H. Rott (DeGruyter, 1995) pp. 241–327.

[9] M. Gelfond, Logic programming and reasoning with incomplete information, Annals of Mathematicsand Artificial Intelligence 12(1,2) (1994) 89–116.

[10] M. Gelfond and V. Lifschitz, The stable model semantics for logic programming, in: Proceedingsof the Fifth International Conference and Symposium on Logic Programming, Seattle, WA, August1988, eds. R. Kowalski and K. Bowen (MIT Press, Cambridge, MA, 1988) pp. 1070–1080.

[11] M. Gelfond and V. Lifschitz, Classical negation in logic programs and disjunctive databases, NewGeneration Computing 9 (1991) 365–385.

[12] S. Kraus, D. Lehmann and M. Magidor, Nonmonotonic reasoning, preferential models and cumu-lative logics, Artificial Intelligence 44(1) (1990) 167–207.

[13] V.W. Marek and Truszczynski, Autoepistemic logic, Journal of the ACM 38(3) (1991) 588–619.[14] J. Minker, An overview of nonmonotonic reasoning and logic programming, Journal of Logic

Programming 17(2–4) (1993) 95–126.[15] J. Minker and C. Ruiz, On extended disjunctive logic programs, in: Proceedings of the Seventh

International Symposium on Methodologies for Intelligent Systems, ISMIS ’93, eds. J. Komorowskiand Z.W. Ras, Lecture Notes in Artifical Intelligence (Springer, 1993) pp. 1–18.

[16] J. Minker and C. Ruiz, Semantics for disjunctive logic programs with explicit and default negation,Fundamenta Informaticae 20(3/4) (1994) 145–192.

[17] P. Pearce and G. Wagner, Logic programming with strong negation, in: Proceedings of theInternational Workshop on Extensions of Logic Programming, Tubingen, Germany, December 1989,ed. P. Schroeder-Heister, Lecture Notes in Artificial Intelligence (Springer, 1989) pp. 311–326.

[18] T.C. Przymusinski, Stable semantics for disjunctive programs, New Generation Computing 9 (1991)401–424.

[19] T.C. Przymusinski, A knowledge representation framework based on autoepistemic logic of minimalbeliefs, in: Proceedings of AAAI ’94 (1994).

[20] K.A. Ross, Well-founded semantics for disjunctive logic programs, in: Proceedings of the First In-ternational Conference on Deductive and Object Oriented Databases, Kyoto, Japan (1989) pp. 352–369.

[21] C. Ruiz, Semantics of Knowledge Based Systems with Multiple Forms of Negation, Ph.D. thesis,Department of Computer Science, University of Maryland, College Park, MD (1996).

[22] C. Ruiz and J. Minker, Computing stable and partial stable models of extended disjunctive logicprograms, in: Nonmonotonic Extensions of Logic Programming, eds. J. Dix, L.M. Pereira andT.C. Przymusinski, Lecture Notes in Computer Science 927 (Springer, 1995) pp. 205–22.

[23] C. Ruiz and J. Minker, Combining closed world assumptions with stable negation, FundamentaInformaticae 32(2) (1997) 163–181.

[24] J.S. Schlipf, A survey of complexity and undecidability results in logic programming, in: InformalProceedings of the Worshop on Structural Complexity and Recursion-Theoretic Methods in LogicProgramming, eds. H. Blair, V.W. Marek, A. Nerode and J. Remmel, Washington, DC (November1992) pp. 143–164.

Page 29: Logic knowledge bases with two default rules

C. Ruiz, J. Minker / Logic knowledge bases with two default rules 361

[25] D. Seipel, J. Minker and C. Ruiz, A characterization of the partial stable models for disjunctivedatabases, in: Proceedings of the Fourteenth International Logic Programming Symposium (ILPS’97), ed. J. Maluszynski (MIT Press, Cambridge, MA, 1997) pp. 245–259.

[26] A. Van Gelder, K.A. Ross and J.S. Schlipf, Unfounded sets and well-founded semantics for generallogic programs, in: Proceedings of the Seventh ACM Symposium on Principles of Database Systems(1988) pp. 221–230.

[27] A. Van Gelder, K.A. Ross and J.S. Schlipf, The well-founded semantics for general logic programs,Journal of the ACM 38(3) (1991) 620–650.