```
> using JuMP, Gurobi
> model = Model(with_optimizer(Gurobi.Optimizer));
> @variable(model, x[1:3], Bin);
> @constraint(model, sum(all_variables(model)) <= 2);
> @objective(model, Max, sum(model[:x] .* [10, 5, 2]));
> optimize!(model);
> value.(x)
3-element Array{Float64,1}:
1.0
1.0
0.0
> is_valid.(model, x)
3-element BitArray{1}:
true
true
true
> delete(model, x[2]);
> is_valid.(model, x)
3-element BitArray{1}:
true
false
true
> value(x[1])
1.0
> value(x[3])
1.0
```

In other words, if I delete a variable from an already solved model (x[2] in this case), I change the value of another (x[3] from zero to one).

If I use GLPK as the solver then the behaviour is the one I expected, this is, the variables I did not delete keep their values unchanged.

I do not know if querying the values of variables from a solved-and-then-modified model is undefined behaviour, or one of the implementations (GLPK layer or Gurobi layer) is correct and the other is not. So I cannot be sure if this is a bug.

If someone could point me to some official statement on which should happen in such cases, or a developer confirm this is a bug, I would be thankful. I can work around the problem, but makes the code a little uglier and harder to maintain (I cannot use GLPK for my real use case). If it is a bug I would prefer to contribute to fixing it in the source if possible.

I am using:

[4076af6c] JuMP v0.20.0

[2e9cd046] Gurobi v0.7.2

If you need any more info just ask.