/* Linear programming in Picat. From the AMPL book, page 5 This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import mip. main => go. go ?=> XB :: 0.0..6000.0, XC :: 0.0..4000.0, Obj #= 25.0 * XB + 30.0 * XC, % Note: the MIP solver cannot handle % divisions in a constraint expression T1 = (1.0/200.00), T2 = (1.0/140.0), T1 * XB + T2 * XC #<= 40.0, solve($[max(Obj)],[XB,XC]), println([obj=Obj,xb=XB,xc=XC]), nl. go => true.