/* Denny's Menu problem in Picat. From http://mindyourdecisions.com/blog/2011/12/01/dennys-math-commercial """ So there’s the question: how many different price combinations will total $10 when menu items priced at $2, $4, $6, and $8? """ Answer: There are 6 different combinations: [5, 0, 0, 0] [3, 1, 0, 0] [1, 2, 0, 0] [2, 0, 1, 0] [0, 1, 1, 0] [1, 0, 0, 1] This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import cp. main => go. go ?=> N = 4, Y = [2,4,6,8], X = new_list(N), X :: 0..10, scalar_product(Y,X,#=,10), solve(X), println(X), fail, nl. go => true.