The commands var I and s.t. I are not working due to "I is already defined"

Hello together.
So basically we have to solve a task with AMPL and the task has the var I and the s.t. I.

When I type in both and want to load my mod, it tells me that the term I is already defined but I need the term I as a var and as s.t.

To give you a quick overview. Here is my Mod:

set T:= 1..4; #Anzahl der Perioden

param d; #Nachfrage in Periode
param I0; #Anfangslagerbestand
param s; #Rüstkostensatz
param h; #Lagerhaltungskostensatz
param M; #Eine hinreichend große Zahl

var q {t in T} >= 0;
var x {t in T} binary;
var I {t in T} >= 0;

minimize Kosten: sum{t in T} (s*x[t]+h*I[t]);

s.t. I[t-1]+q[t]-d[t]=I[t];
s.t. q[t]<=M*x[t];
s.t. q[t]>=0;
s.t. I[t]>=0;
s.t. x[t] binary;

Also another question: All commands are purple besides the last 4 . How come (what does it mean)?

Thanks in advance.
Anwar

You are not writing the constraints properly. After s.t. you have to give a name for the constraint; and if there is a dummy index like t in the constraint expression, you need to give an indexing expression to say what values the index takes. So for example, you could write

s.t. Balance {t in T}:
   I[t-1] + q[t] - d[t] = I[t];

You will still have the problem that, when t equals 1, the constraint refers to I[0], which is not defined. If I[0] is supposed to be zero, you can fix this by writing

s.t. Balance {t in T}:
   (if t > 1 then I[t-1]) + q[t] - d[t] = I[t];

You will need to also fix the second constraint by adding a name and indexing. You should delete the last three constraints in your model, as they are already specified in the definitions of the variables.