ampl / mp

An open-source library for mathematical programming
https://mp.ampl.com
Other
229 stars 42 forks source link

Fault when using logical constraints #198

Closed 4er4er4er closed 1 year ago

4er4er4er commented 1 year ago

I get a fault when trying to solve the following model with option solver gurobi:

param N = 17;
param k = 5;

var x {0..N} binary;

subj to contiguity1 {i in 0..N-k}:
   x[i] = 0 and x[i+1] = 1 ==>
      forall {j in 0..i-1} x[j] = 0;

subj to contiguity2 {i in 0..N-k}:
   x[i] = 0 and x[i+1] = 1 ==>
      forall {j in i+2..i+5} x[j] = 1;

subj to contiguity3 {i in 0..N-k}:
   x[i] = 0 and x[i+1] = 1 ==>
      forall {j in i+6..N} x[j] = 0;

subj to fix0: x[0] = 0;

There is no fault when contiguity1 is dropped, or when fix0 is dropped.

glebbelov commented 1 year ago

Moved to ampl/escrow/issues/101.