Theory of optimal control using bisimulations