Elements of a computational theory for glaciers