su h a omponent. Obviously, ea h weight rule in R goes into exa
tly one of the submodules. One should noti e that for a hoi e rule r ∈ R it 
an happen that Head(r) ∩ Di 6= ∅ and **Head(**r) ∩ Dj 6= ∅ for i 6= j . This is not a problem, sin
e it is always possible to split a hoi e rule by pro je ting the head, that is, by repla ing a hoi e rule of the form {A} ← B, ∼C with 
hoi
e rules {A ∩ Di} ← B, ∼C for ea
h SCC Di su
h that A ∩ Di 6= ∅.

5 Based on the dis ussion above, we dene the set of rules dening a set of atoms for an smodels program module.

Denition 5.1 Given an smodels program module P = h**R, I, O, H**i and a set of atoms D ⊆ At(P) \ I , the set of rules dening D, denoted by R[D], 
ontains the fol lowing rules:

- a 
hoi
e rule {A ∩ D} ← B, ∼C if and only if there is a 
hoi
e rule {A} ← B, ∼C
in R su
h that A ∩ D 6= ∅; and
- a weight rule a ← w ≤ {B = WB, ∼C = WC } if and only if there is a weight rule a ← w ≤ {B = WB, ∼C = WC } in R su
h that a ∈ D.

We ontinue by dening a submodule of P = h**R, I, O, H**i indu
ed by a set of atoms D ⊆ At(P) \ I . We use Denition 5.1 for the set of rules, and 
hoose D ∩ O
to be the output signature and the rest of the visible atoms appearing in R[D] to be the input signature.

Denition 5.2 Given an smodels program module P = h**R, I, O, H**i and a set of atoms D ⊆ At(P) \ I , a submodule indu
ed by D is

## P[D] = (R[D],(At(R[D]) \ D) ∩ (I ∪ O), D ∩ **O, D** ∩ H).

Let D1**, . . . D**m be the strongly 
onne
ted 
omponents of Dep+(P) su
h that Di ∩
I = ∅. Now we 
an dene Pi = P[Di] for ea
h 1 ≤ i ≤ m. Sin
e the strongly onne ted omponents of Dep+(P) are used as a basis, it is guaranteed that there is no positive re ursion between any of the submodules Pi
. Also, it is lear that the output signatures of the submodules are pairwise disjoint. Unfortunately this onstru tion does not yet guarantee that hidden atoms stay lo al, and therefore the omposition P1 **⊕ · · · ⊕** Pm might not be dened be
ause 
ertain Pi
's might not respe t ea h others hidden atoms.

A solution is to ombine Di
's in a way that modules will be losed with respe t to dependen ies aused by the hidden atoms, that is, if a hidden atom h belongs to a omponent Di
, then also all the atoms in the heads of rules in whi h h or ∼h appears, have to belong to Di
, too. This an be a hieved by nding the strongly onne ted omponents, denoted by E1**, . . . , E**k , for Deph(P, {D1**, . . . , D**m}), where