In this paper, a Gaifman–Shapiro-style module architecture is tailoredto the case of smodels programs under the stable model semantics. Thecomposition of smodels program modules is suitably limited by moduleconditions which ensure the compatibility of the module system with stablemodels. Hence the semantics of an entire smodels program dependsdirectly on stable models assigned to its modules. This result is formalized asa module theorem which truly strengthens V. Lifschitz and H.Turner's splitting-set theorem (June 1994, Splitting a logic program. InLogic Programming: Proceedings of the Eleventh InternationalConference on Logic Programming, Santa Margherita Ligure, Italy, P.V. Hentenryck, Ed. MIT Press, 23–37) for the class of smodelsprograms. To streamline generalizations in the future, the module theorem isfirst proved for normal programs and then extended to cover smodelsprograms using a translation from the latter class of programs to the formerclass. Moreover, the respective notion of module-level equivalence, namelymodular equivalence, is shown to be a proper congruencerelation: it is preserved under substitutions of modules that are modularlyequivalent. Principles for program decomposition are also addressed. Thestrongly connected components of the respective dependency graph can beexploited in order to extract a module structure when there is no explicita priori knowledge about the modules of a program. Thepaper includes a practical demonstration of tools that have been developed forautomated (de)composition of smodels programs.