Page 1

TECHNICAL

R E P O R T

Institut f¨ ur Informationssysteme

Abteilung Datenbanken und

Artificial Intelligence

Technische Universit¨ at Wien

Favoritenstr. 9

A-1040 Vienna, Austria

Tel:

+43-1-58801-18403

Fax:

+43-1-58801-18492

sekret@dbai.tuwien.ac.at

www.dbai.tuwien.ac.at

INSTITUT F¨ UR INFORMATIONSSYSTEME

ABTEILUNG DATENBANKEN UND ARTIFICIAL INTELLIGENCE

Hyperequivalence of Logic Programs

with Respect to Supported Models

DBAI-TR-2008-58

Mirosław Truszczy´ nskiStefan Woltran

DBAI TECHNICAL REPORT

2008

Page 2

DBAI TECHNICAL REPORT

DBAI TECHNICAL REPORT DBAI-TR-2008-58, 2008

Hyperequivalence of Logic Programs with Respect to

Supported Models

Mirosław Truszczy´ nski1

Stefan Woltran2

Abstract. Recent research in nonmonotonic logic programming has focused on program

equivalence relevant for program optimization and modular programming. So far, most re-

sults concern the stable-model semantics. However, other semantics for logic programs are

also of interest, especially the semantics of supported models which, when properly gener-

alized, is closely related to the autoepistemic logic of Moore. In this paper, we consider a

framework of equivalence notions for logic programs under the supported (minimal) model-

semantics and provide characterizations for this framework in model-theoretic terms. We

use these characterizations to derive complexity results concerning testing hyperequiva-

lence of logic programs with respect to supported (minimal) models.

1Department of Computer Science, University of Kentucky, Lexington, KY 40506-0046, USA. E-mail:

mirek@cs.uky.edu

2Institute for Information Systems 184/2, Technische Universit¨ at Wien, Favoritenstrasse 9-11, 1040 Vi-

enna, Austria. E-mail: woltran@dbai.tuwien.ac.at

Acknowledgements: The authors acknowledge partial support by the NSF grant IIS-0325063, the

KSEF grant KSEF-1036-RDE-008, and by the Austrian Science Fund (FWF) under grant P18019.

This is an extended version of a paper published in the Proceedings of the Twenty-Third AAAI

Conference on Artificial Intelligence (AAAI-08).

Copyright c ? 2008 by the authors

Page 3

1 Introduction

The problem of the equivalence of logic programs with respect to the stable-model semantics has

received substantial attention in the answer-set programming research community in the past sev-

eral years [19, 21, 29, 5, 14, 9, 11, 7, 25, 22, 24, 31, 32, 12]. The problem can be stated as follows.

Given a class C of logic programs (we will refer to them as contexts), we say that programs P and

Q are equivalent relative to C if for every program R ∈ C, P ∪ R and Q ∪ R have the same stable

models. Clearly, for every class C, the equivalence relative to C implies the standard nonmonotonic

equivalence of programs, where two programs P and Q are nonmonotonically equivalent if they

have the same stable models. Therefore, we will refer to these stronger versions of equivalence

collectively as hyperequivalence.

Understanding hyperequivalence is fundamental for the development of modular answer-set

programs and knowledge bases. The problem is non-trivial due to the nonmonotonic nature of the

stable-model semantics. If S is a module within a larger program T, replacing S with S′results in

the program T′= (T \S)∪S′, which must have the same meaning (the same stable models) as T.

The nonmonotonic equivalence of S and S′does not guarantee it. The hyperequivalence of S and

S′relative to the class of all programs does. However, the latter may be a too restrictive approach

in certain application scenarios, in particular if properties of possible realizations for T are known

in advance.

Thus, several interesting notions of hyperequivalence, imposing restrictions on the context

class C, have been studied. If C is unrestricted, that is, any program is a possible context, we obtain

strongequivalence[19]. If C is the collection ofall sets of facts, we obtain uniformequivalence[7].

Another direction is to restrict the alphabet over which contexts are given. The resulting notions of

hyperequivalenceare called relativized (with respect to the context alphabet), and can be combined

with strong and uniform equivalence [7]. Even more generally, we can specify different alphabets

for bodies and heads of rules in contexts. This gives rise to a common view on strong and uniform

equivalence [31]. A yet different approach to hyperequivalence is to compare only some dedicated

projected output atoms rather than entire stable models [9, 25, 24].

All those results concern the stable-model semantics1. In this paper, we address the problem

of the hyperequivalence of programs with respect to the other major semantics, that of supported

models [4]. We define several concepts of hyperequivalence, depending on the class of programs

allowed as contexts. We obtain characterizations of hyperequivalence with respect to supported

models in terms of semantic objects, similar to SE-models [29] or UE-models [7], that one can

attribute to programs.

Since the minimality property is fundamental from the perspective of knowledge representa-

tion, we also consider in the paper the semantics of supported models that are minimal (as models).

Whileit seems to have received littleattention in thearea oflogicprogramming, it has been studied

extensively in a more general setting of modal nonmonotonic logics, first under the name of the

semantics of moderately grounded expansions for autoepistemic logic [16, 17] and then, under the

name of ground S-expansions, for an arbitrary nonmonotonic modal logic S [15, 27]. The com-

plexity of reasoning with moderately grounded expansion was established in [8] to be complete for

1There is little work on other semantics, with [3] being a notable exception.

2

Page 4

classes at the third level of the polynomial hierarchy.

Here, we study this semantics in the form tailored to logic programming. By refining tech-

niques we develop for the case of supported models, we characterize the concept of hyperequiva-

lence with respect to supported minimal models relative to several classes of contexts.

The characterizations allow us to derive results on the complexity of problems to decide

whether two programs are hyperequivalent with respect to supported (minimal) models. They

are especially useful in establishing upper bounds which, typically, are easy to derive but in the

context of hyperequivalence are not obvious. Our results paint a detailed picture of the complexity

landscape for relativized hyperequivalence with respect to supported (minimal) models.

2 Preliminaries

We fix a countable set At of atoms (possibly infinite). All programs we consider here consist of

rules of the form

a1|...|ak← b1,...,bm,not c1,...,not cn,

where ai, biand ciare atoms in At, ‘|’ stands for the disjunction, ‘,’ stands for the conjunction, and

not is the default negation. If k = 0, the rule is a constraint. If k ≤ 1, the rule is normal.

For a rule r of the form given above, we call the set {a1,...,ak} the head of r and denote

it by hd(r). Similarly, we call the conjunction b1,...,bm,not c1,...,not cnthe body of r and

denote it by bd(r). We will also use bd+(r) = {b1,...,bm,} and bd−(r) = {c1,...,cn}, as well

as bd±(r) = bd+(r) ∪ bd−(r) to denote the set of all atoms occurring in the body of r. Moreover,

for a program P, let hd(P) =?

An interpretation M ⊆ At is a model of a rule r, written M |= r, if whenever M satisfies every

literal in bd(r), written M |= bd(r), we have that hd(r) ∩ M ?= ∅, written M |= hd(r).

An interpretation M ⊆ At is a model of a program P, written M |= P, if M |= r for every

r ∈ P. If, in addition, M is a minimal hitting set of {hd(r) | r ∈ P and M |= bd(r)}, then M is

a supported model of P [2, 13].

For a rule r = a1|...|ak← bd, where k ≥ 1, a shift of r is a normal program rule of the form

r∈Phd(r), and bd±(P) =?

r∈Pbd±(r).

ai← bd,not a1,...,not ai−1,not ai+1,...,not ak,

where i = 1,...,k. If r is a constraint, the only shift of r is r itself. A program consisting of all

shifts of rules in a program P is the shift of P. We denote it by sh(P). It is evident that a set Y

of atoms is a (minimal) model of P if and only if Y is a (minimal) model of sh(P). It is easy to

check that Y is a supported model of P if and only if it is a supported model of sh(P).

Supported models of a normal logic program P have a useful characterization in terms of the

(partial) one-step provability operator TP [30], defined as follows. For M ⊆ At, if there is a

constraint r ∈ P such that M |= bd(r) (that is, M ?|= r), then TP(M) is undefined. Otherwise,

TP(M) = {hd(r) | r ∈ P and M |= bd(r)}.

3

Page 5

Whenever we use TP(M) in a relation such as (proper) inclusion, equality or inequality, we always

implicitly assume that TP(M) is defined.

It is well known that M is a model of P if and only if TP(M) ⊆ M (that is, TPis defined for

M and satisfies TP(M) ⊆ M). Similarly, M is a supported model of P if TP(M) = M (that is,

TPis defined for M and satisfies TP(M) = M) [1].

It follows that M is a model of a disjunctive program P if and only if Tsh(P)(M) ⊆ M.

Moreover, M is a supported model of P if and only if Tsh(P)(M) = M.

3 Hyperequivalence with respect to supported models

Disjunctive programs P and Q are supp-equivalent relative to a class C of disjunctive programs if

for every R ∈ C, P ∪ R and Q ∪ R have the same supported models.

Supp-equivalence is a non-trivial concept, different than equivalence with respect to models,

stable models, and hyperequivalence with respect to stable models.

Example 3.1 Let P1= {a ← a} and Q1= ∅. Clearly, P1and Q1have the same models and the

same stable models. Moreover, for every program R, P1∪ R and Q1∪ R have the same stable

models, that is, P1and Q1are strongly (and so, also uniformly) equivalent with respect to stable

models. However, P1and Q1have different supported models. Thus, they are not supp-equivalent

relative to any class of programs.

Next, let P2= {a ← a;a ← not a} and Q2= {a}. One can check that for every program R,

P2∪R and Q2∪R have the same supportedmodels, that is, P2and Q2are supp-equivalentrelative

to any class of programs. They are also equivalent with respect to classical models. However, P2

and Q2do not have the same stable models and so, they are not equivalent with respect to stable

models nor hyperequivalent with respect to stable models relative to any class of programs.

Finally, let P3= {← b}∪P2and Q3= Q2. Then, P3and Q3are neither hyperequivalent with

respect to stable models relative to any class of programs nor equivalent with respect to classical

models. Still P3and Q3have the same supported models, and for any program R, such that b does

not appear in rule heads of R, P3∪ R and Q3∪ R have the same supported models, that is, P3

and Q3are supp-equivalent with respect to this class of programs (we will verify this claim later).

As we will see, supp-equivalence with respect to all programs implies equivalence with respect to

models and so, it is not a coincidence that in the last example we used a restricted class of contexts.

To see that P3and Q3are not supp-equivalence with respect to the class of all programs, one can

consider R = {b}. Then, {a,b} is a supported model of Q3∪ R, but not of P3∪ R.

We observe that supp-equivalence relative to C implies supp-equivalence relative to any C′,

such that C′⊆ C (in particular, for C′= {∅}, this implies standard equivalence with respect to

supported models), but the converse is not true in general as illustrated by programs P3and Q3.

In thissectionwecharacterize supp-equivalencerelativetoclassesofprogramsdefined interms

of atoms that can appear in the heads and in the bodies of rules. Let A,B ⊆ At. By HBd(A,B)

we denote the class of all disjunctiveprograms P such that hd(P) ⊆ A (atoms in the heads of rules

in P must be from A) and bd±(P) ⊆ B (atoms in the bodies of rules in P must be from B). We

4