  Let Q be a finite quiver without oriented cycles, and let $\Lambda$ be the
associated preprojective algebra. To each terminal representation M of Q (these
are certain preinjective representations), we attach a natural subcategory
$C_M$ of $mod(\Lambda)$. We show that $C_M$ is a Frobenius category,and that
its stable category is a Calabi-Yau category of dimension 2. Then we develop a
theory of mutations of maximal rigid objects of $C_M$, analogous to the
mutations of clusters in Fomin and Zelevinsky's theory of cluster algebras. We
show that $C_M$ yields a categorification of a cluster algebra $A(C_M)$, which
is not acyclic in general. We give a realization of $A(C_M)$ as a subalgebra of
the graded dual of the enveloping algebra $U(\n)$, where $\n$ is a maximal
nilpotent subalgebra of the symmetric Kac-Moody Lie algebra $\g$ associated to
the quiver Q. Let $S^*$ be the dual of Lusztig's semicanonical basis $S$ of
$U(\n)$. We show that all cluster monomials of $A(C_M)$ belong to $S^*$, and
that $S^* \cap A(C_M)$ is a basis of $A(C_M)$. Next, we prove that $A(C_M)$ is
naturally isomorphic to the coordinate ring of the finite-dimensional unipotent
subgroup $N(w)$ of the Kac-Moody group $G$ attached to $\g$. Here w = w(M) is
the adaptable element of the Weyl group of $\g$ which we associate to each
terminal representation M of Q. Moreover, we show that the cluster algebra
obtained from $A(C_M)$ by formally inverting the generators of the coefficient
ring is isomorphic to the coordinate ring of the unipotent cell $N^w := N \cap
(B_-wB_-)$ of G. We obtain a corresponding dual semicanonical basis of this
coorindate ring.
