Text this: An algebraic formulation of ercodic problems