  In this paper we describe an elimination process which is a deterministic
rewriting procedure that on each elementary step transforms one system of
equations over free groups into a finitely many new ones. Infinite branches of
this process correspond to cyclic splittings of the coordinate group of the
initial system of equations. This allows us to construct algorithmically
Grushko's decompositions of finitely generated fully residually free groups and
cyclic [abelian] JSJ decompositions of freely indecomposable finitely generated
fully residually free groups. We apply these results to obtain an effective
description of the set of homomorphisms from a given finitely presented group
into a free group, or, more generally, into an NTQ group.
