The Algebra of Ice