1. by writing down a logic program the answer sets of which correspond to the solutions of the problem and 2. by computing the answer sets of the program using a special purpose search engine that has been designed for this task.

A modelling philosophy of this kind suggests to treat programs as integral entities.

The answer set semantics—originally defined for entire programs only (Gelfond and Lifschitz 1988; Gelfond and Lifschitz 1990)—reflects also this fact. Such indivisibility of programs is creating an increasing problem as program instances tend to grow along the demands of new application areas of ASP. It is to be expected that prospective application areas such as semantic web, bioinformatics, and logical cryptanalysis will provide us with huge program instances to create, to solve, and to maintain.

Modern programming languages provide means to exploit modularity in a number of ways to govern the complexity of programs and their development process.

Indeed, the use of program modules or objects of some kind can be viewed as an embodiment of the classical divide-and-conquer principle in the art of programming. The benefits of modular program development are numerous. A software system is much easier to design as a set of interacting components rather than a monolithic system with unclear internal structure. A modular design lends itself better for implementation as programming tasks are then easier to delegate amongst the team of programmers. It also enables the re-use of code organized as module libraries, for instance. To achieve similar advantages in ASP, one of the central goals of our research is to foster modularity in the context of ASP.

Although modularity has been studied extensively in the context of conventional logic programs, see Bugliesi et al. (1994) for a survey, relatively little attention has been paid to modularity in ASP. Many of the approaches proposed ssessed to the control of the control of the control of the control of the control of the control. instance, by enforcing stratification of some kind, or by prohibiting recursion altogether (Eiter et al. 1997; Tari et al. 2005; Eiter et al. 1997). On the other hand, approaches based on splitting-sets (Lifschitz and Turner 1994; Eiter et al. 1997; Faber et al. 2005) are satisfactory from the point of view of compositional semantics : the answer sets of an entire program are obtained as specific combinations of the answer sets of its components. A limitation of splitting-sets is that they divide logic programs in two parts, the top and the bottom , which is rather restrictive and conceptually very close to stratification. On the other hand, the compositionality of answer set semantics is neglected altogether in syntactic approaches (Ianni et al. 2004; Tari et al. 2005) and this aspect of models remains completely at the programmer's responsibility.

To address the deficiencies described above, we accommodate a module architecture proposed by Gaifman-Shapiro (1989) to answer set programming, and in particular, in the context of the SMODELS system (Simons et al. 2002). 1 There are two main criteria for the design. First of all, it is essential to establish the full compositionality of answer set semantics with respect to the module system. This is to 2