I have a model with two constraints. The first constraint is a big M constraint, which I am trying to reformulate as an indictor constraint. I have tried to follow the syntax given in the documentation, but I don’t get a correct answer when I use indicator constraints. How can I write this using indicator constraints?

```
model = Model()
@variable(model,x[b=1:4]>=0)
@variable(model,y[b=1:4],Bin)
@variable(model,a >= 0.0)
M = 1000
@constraint(model,constraint1[j in 1:4], M*y[j]-sum(l[j,i]*x[i] for i in 1:4) + a >= 0) # l is a matrix containing data
@constraint(model,constraint2, sum(y[j] for j in 1:4) <= 2)
```

```
# Attempt 1. Use variable y as indicator constraint in constraint1. No changes to constraint2
@constraint(model,constraint1[j in 1:4], y[j] => {- sum(l[j,i]*x[i] for i in 1:4) + a >= 0})
@constraint(model,constraint2, sum(y[j] for j in 1:4) <= 2)
# Attempt 2 Define another variable z for indicator. No changes to constraint2
@variable(model,z[b=1:4],Bin)
@constraint(model,constraint1[j in 1:4], z[j] => {y[j] - sum(l[j,i]*x[i] for i in 1:4) + a >= 0})
@constraint(model,constraint2, sum(y[j] for j in 1:4) <= 2)
```