  The stacking problem is approached by computational mechanics, using an Ising
next nearest neighbor model. Computational mechanics allows to treat the
stacking arrangement as an information processing system in the light of a
symbol generating process. A general method for solving the stochastic matrix
of the random Gibbs field is presented, and then applied to the problem at
hand. The corresponding phase diagram is then discussed in terms of the
underlying $\epsilon$-machine, or optimal finite state machine, describing
statistically the system. The occurrence of higher order polytypes at the
borders of the phase diagram is also analyzed. Discussion of the applicability
of the model to real system such as ZnS and Cobalt is done. The method derived
is directly generalizable to any one dimensional model with finite range
interaction.
