Content uploaded by Marc Denecker

Author content

All content in this area was uploaded by Marc Denecker on Nov 26, 2014

Content may be subject to copyright.

Ultimate Well-founded and Stable Semantics for

Logic Programs with Aggregates

Marc Denecker

a

Nikolay Pelov

b

Maurice Bruynooghe

b

a

Universit´e Libre de Bruxe lles, Bld du Triomphe CP 212, 1050 Brussels, Belgium

b

K.U.Leuven, Celestijnenlaan 200A, 3001 Heverlee, Belgium

In [3] we investigate the problem of deﬁning a well-founded and stable s e -

mantics for programs with aggregates. Our work is based on Approximation The-

ory [1] which is a general algebraic framework for approximating non-monotone

operators on a complete lattice L by approximating operators o n the bi-lattice L

2

.

The theory identiﬁes basic properties of the approximating operators and gives

a method to construct a stable ope rator and their associated ﬁxpoints - Kripke-

Kleene (KK), well-founded (WF), and set of stable ﬁxpoints. The authors then

show that the diﬀerent ﬁxpoints enjoy similar properties and relationships a s the

corresponding semantics in standard logic programming. For example the WF

ﬁxpoint is mo re precise than the KK ﬁxpoint and a lso approximates every stable

ﬁxpoint. Moreover, stable ﬁxpoints are always minimal ﬁxpoints.

In a mo re recent paper [2] the authors study the concept of precision of an

approximating oper ator. They show that more precise approximating operators

have mo re precise KK and WF ﬁxpoints and a larger number of stable ﬁxpoints.

Moreover, there exists a most-precise approximating operator which they call the

ultimate approximation. In contrast with other approximating op e rators which

have to be deﬁned explicitly, the construction of the ultimate approximating oper-

ator is entirely algebraic and depends only on the original non-monotone oper ator.

This makes it particularly well-suited for our purposes be cause deﬁning a T

P

oper-

ator for programs with aggregates is relatively straightforward. Another advantage

of the ultimate approximation is that in cases where T

P

is monotone the ultimate

well-founded model will be 2-valued and will coincide with the least ﬁxpoint of

T

P

. This is not the case for the standard well-founded semantics. For example in

the standard well-founded model of the pr ogram:

p ← ¬p.

p ← p.

p is undeﬁned while the associated T

P

operator is monotone and p is true in the

ultimate well-founded model.

One disadvantage of using the ultimate semantics is that it has a higher com-

putational cost even for programs without aggregates. The complexity goes one

level higher in the polynomial hierarchy to ∆

p

2

for the well-founded model and to

Σ

p

2

for a stable model which is also complete for this cla ss [2]. Fortunately, by

adding aggregates the complexity does not increase further.

To g ive an example of a logic program with aggregates we consider the problem

of computing the length of the shortest path between two nodes in a directed graph.

The graph is represented with a set of edge(X, Y, W ) facts meaning that there is

an edge between X and Y with weight W . The program consists of a single rule:

sp(X, Y, L) ← min({C | edge(X, Y, C)∨

∃Z, C

1

, C

2

. (sp(X, Z, C

1

) ∧ edge(Z, Y, C

2

)∧

C = C

1

+ C

2

)}, L).

This program shows the syntax which we use. First of all, we allow arbitrary

ﬁrst-order fo rmulas in the bodies of rules and in the conditions of set expressions.

Unlike most o f the previous work o n aggregates, we use an explicit notation for set

expressions {X | ϕ[X]} denoting the set of all elements d for which the condition

ϕ[d] is true. Aggregate functions are written in a form of atoms like f(s, t) where

F is an aggregate function, s is a set expression, and t is a term. It will evaluate

to true if the aggregate function f applied to the set denoted by s is equal to the

interpretation of the term t.

Having deﬁned a 2-valued semantics fo r formulas containing aggregate atoms

it is easy to extend the deﬁnition of the 2-valued van Emden-Kowalski immediate

consequence operator T

P

for programs with a ggregates. Constructing the ultimate

approximating operator of T

P

we obtain an ultimate well-founded and ultimate

stable semantics for pro grams with aggregates. The two semantics have all the

properties which we discussed earlier. In addition for aggregate stratiﬁed programs

the ultimate well-founded model will be 2-valued and will coincide with the unique

ultimate stable model.

Our current research is focused on deﬁning a less precise a pproximating oper-

ator for programs with aggregates which extends the s tandard well-founded and

stable semantics for programs without aggregates. Although the complexity of

this operator will still be the same as the the complexity of the ultimate approx-

imation, if we limit our language to some speciﬁc aggregate functions we can stay

in the complexity classes o f the standard semantics - P for the well-founded model

and NP for the stable models.

References

[1] M. Denecker, V. Marek, and M. Truszczy´nski. Approximating operators, stable

operators, well-founded ﬁxpoints and applications in non-monotonic reasoning.

In J . Minker, editor, Logic-based Artiﬁcial Intelligence, pages 127–144. Kluwer

Academic P ublishers, 2000.

[2] M. Denecker, V. Marek, and M. Truszczy´nsky. Ultimate approximations in

nonmonotonic knowledge representation systems. In, KR’02, pages 17 7–188.

Morgan Ka ufmann, 2002.

[3] M. Denecker, N. Pelov, and M. Br uy nooghe. Well-founded and stable model

semantics for logic programs with aggregates. In P. Codognet, editor, ICLP’01,

volume 2237 of LNCS, pages 212–226. Springer-Verlag, 2001.