Optimality conditions and duality in continuous programming I. Convex programs and a theorem of the alternative