Semi-infinite programming: Conditions of optimality and applications