I found one solution. I would appreciate critic.

Thanks,

Alex

declare Problem
fun {Problem Package}
   Buttons ButtonDomain
in
   Buttons = [3#7 1#11 3#13 1#16 2#19 1#21 1#23 1#27 1#37 1#41 2#56 1#61
1#73 1#77 1#97]
   ButtonDomain = {List.map Buttons fun {$ _#D} D end}
   proc {$ Root}
      A B C D E
   in
      Root = solution(a:A b:B c:C d:D e:E)
      Root ::: ButtonDomain
      {ForAll Buttons proc {$ B} {FD.atMost B.1 Root B.2} end}
      A*B+C-D+E =: Package
      B =<: A
      E =<: C
      {FD.distribute ff Root}
   end
end

{Browse {List.filter {List.map
        [94 134 233 426 496 915 917 1072 1431 1553 1569 1580 1622 1673 1886
1922 2094 2139 2249 2437 2491 2569 2714 2812]
        fun {$ Package} Package#{SearchOne {Problem Package}} end}
  fun {$ Each} Each.2 == nil end}}

> I am using a simple problem to learn Constraint Programming in Oz (after
> reading the manual, believe it or not).
>


_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to