Pay close attention to the form of a two-dimensional AMPL data table, as shown for instance in
Figure 1-6b of the
AMPL book. As an example, the first line of the table for your parameter D should be
param D: 1 2 3 4 :=(When you write "param D := 1 2 3 4" instead, AMPL interprets it as a one-dimensional table, resulting in many error messages.)