Foundations of Constrained Optimization