This paper provides an underlying mathematical framework for the cluster variation method and develops programmable algorithms for treating any CVM description of a multi-component material with complex unit cell. After setting up the symmetry group of the structure as a permutation group over ordering sublattices, a Boolean lattice formalism generated by crystal motifs is introduced to carry out the combinatorics required for the cluster variation method. Two approaches are presented: one is a matrix based algebraic formulation employing the Ma:bius function of the. Boolean lattice and the second gives a detailed analysis including the simplifications afforded by the ordering symmetry group to give a final form permitting arbitrary choice of motif coverings. The Boolean lattice formulation is also used to determine the number of independent variables needed to describe the.CVM distribution function in the presence of symmetry. It is shown that, even under the constraint of a given ordering symmetry group, a set of independent variables associated to Notation