AMPL does not make a distinction between subscripts and superscripts. Judging from the way your constraint is written, it appears that there are supposed to be a different D parameter and X variable for each combination of i, m, n, and k. I cannot tell what the ranges for i, m, n, and k are supposed to be, but for illustration I will suppose that they are members of four different indexing sets, which can be defined in AMPL as
set I;
set M;
set N;
set K;
Then the parameters and variables could be defined as, for example,
param D {I, M, N, K};
var X {I, M, N, K} >= 0;
var Y {I} >= 0;
(I have chosen to write I, M, N, K, but any other ordering of the sets could be used.) The constraint could then be written as
subject to constr {i in I}:
sum {m in M, n in N} sum {k in K} X[i,m,n,k] * D[i,m,n,k] <= Y[i];
Note that in AMPL you have to define a summation index (like k) and a corresponding set (like K) that the index runs over. In mathematical notation you often see a simple "sum over k" but that is not specific enough for a computer language.
--
Robert Fourer
am...@googlegroups.com