disjunctive logic programs , that is, disjunctive logic programs with two kinds of negation. A component structure induced by a splitting sequence, that is, iterated splittings of a program, allows a bottom-up computation of answer sets. The restriction implied by this construction is that the dependency graph of the component chain needs to be acyclic Eiter, Gottlob, and Mannila (1997) consider disjunctive logic programs as a query language for relational databases. A query program π is instantiated with respect to an input database D confined by an input schema R . The semantics of π determines, for example, the answer sets of π [ D ] which are projected with respect to an output schema S . Their module architecture is based on both positive and negative dependencies and no recursion between modules is tolerated. These constraints enable a straightforward generalization of the splitting-set theorem for the architecture.

Faber et al. (2005) apply the magic set method in the evaluation of Datalog programs with negation, that is, effectively normal logic programs. This involves the concept of an independent set S of a program P which is a specialization of a splitting set. Due to a close relationship with splitting sets, the flexibility of independent sets for parceling programs is limited in the same way.

The approach based on lp-functions (Gelfond and Gabaldon 1999; Baral 2003) is another programming-in-the-large approach. An lp-function has an interface based on input and output signatures. Several operations, for instance incremental extension, interpolation, input opening, and input extension, are introduced for composing and refining lp-functions. The composition of lp-functions, however, only allows incremental extension, and thus similarly to the splitting-set theorem there can be no recursion between lp-functions.

## 3 Preliminaries: Smodels Programs

To keep the presentation of our module architecture compatible with an actual implementation, we cover the input language of the smodels system—excluding optimization statements. In this section we introduce the syntax and semantics for SMODELS programs, and, in addition, point out a number of useful properties of logic programs under stable model semantics. We end this section with a review of equivalence relations that have been proposed for logic programs.

## 3.1 Syntax And Semantics

Basic constraint rules (Simons et al. 2002) are cither weight rules of the form a ← w ≤ {b 1 = w b 1 , . . . ,b n = w b n , ~ c 1 = w c 1 , . . . , ~ c m = w c m }

$$(1)$$
$$=w_{c_{m}}\}$$

or choice rules of the form

$$\{a_{1},\ldots,a_{h}\}\gets b_{1},\ldots,b_{n},\sim\!c_{1},\ldots,\sim\!c_{m}$$

(2)
where a, a i 's, b j 's, and c k 's are atoms, h > 0, n ≥ 0, m ≥ 0, and ~ denotes negation as failure or de fault negation . In addition, a weight rule (1) involves a weight limit 6