  We introduce an extended mathematical programming framework for specifying
equilibrium problems and their variational representations, such as generalized
Nash equilibrium, multiple optimization problems with equilibrium constraints,
and (quasi-) variational inequalities, and computing solutions of them from
modeling languages. We define a new set of constructs with which users annotate
variables and equations of the model to describe equilibrium and variational
problems. Our constructs enable a natural translation of the model from one
formulation to another more computationally tractable form without requiring
the modeler to supply derivatives. In the context of many independent agents in
the equilibrium, we facilitate expression of sophisticated structures such as
shared constraints and additional constraints on their solutions. We define a
new concept, shared variables, and demonstrate its uses for sparse
reformulation, equilibrium problems with equilibrium constraints, mixed pricing
behavior of agents, and so on. We give some equilibrium and variational
examples from the literature and describe how to formulate them using our
framework. Experimental results comparing performance of various
complementarity formulations for shared variables are given. Our framework has
been implemented and is available within GAMS/EMP.
