In view of the importance of the ice rule imposed on the proton configurations in hydrogen-bonded crystals, a cluster theory is developed and applied to the phase transitions in the mixed crystals of ferroelectrics and antiferroelectrics Rb1-x (NH4) xH2PO4. At low temperatures, protons rearrange themselves to fulfill the ice rule condition, and produce the glass structure resulting from the competition between two kinds of proton ordering. It is shown that the correlation among hydrogen bonds under the ice rule constraint leads the system to the new ordered state.