/* Spreadsheet in Picat. From Krzysztof Apt "Principles of Constraint Programming" page 16ff. Spreadsheet. Cf Winston "Artificial Intelligence", 3rd edition, page 235 (not the same values though) 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 => X = [B1,B4,B5,C4,C5,D4,D5,E7,E8], X :: 0.0..1000.0, B1 #= 0.17, B4 #= 3.5, B5 #= 1.7, C4 #= 1.5, C5 #= 4.5, D4 #= B4 * C4, D5 #= B5 * C5, E7 #= D4 + D5, E8 #= E7 * (1.0 + B1), solve(X), println(X), nl.