Hello,
I wonder if it's possible to solve a nested mathematical programs? For example, a minization problem within which one parameter is by itself a maximization problem? this may rise while forming a lagrangean relaxation: while you seek to minmize the penalized objective function, the lagrangean multiplier is by itself an inner maximization problem. Or in solving a dual problem.
Depending upon the way you have structured your equations, then it might be possible to do so by returning the result of the maximization as a function (eg, f(x):=maximize(....))
Stuart