Text this: On the dynamic programming treatment of discrete-time variational problems /