Text this: Dynamic programming, generalized states, and switching systems /