A generalization of Bellman's equation with application to path planning, obstacle avoidance and invariant set estimation. (May 2021)