gecoder-with-gecode 0.8.3 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (337) hide show
  1. data/CHANGES +15 -0
  2. data/README +6 -2
  3. data/example/equation_system.rb +15 -0
  4. data/example/magic_sequence.rb +7 -7
  5. data/example/money.rb +36 -0
  6. data/example/queens.rb +7 -8
  7. data/example/send_most_money.rb +1 -1
  8. data/example/square_tiling.rb +2 -2
  9. data/example/sudoku-set.rb +11 -12
  10. data/example/sudoku.rb +40 -45
  11. data/ext/extconf.rb +0 -0
  12. data/ext/gecode-2.1.1/LICENSE +0 -0
  13. data/ext/gecode-2.1.1/configure +0 -0
  14. data/ext/gecode-2.1.1/contribs/qecode/SDFVariableHeuristic.cc +0 -0
  15. data/ext/gecode-2.1.1/contribs/qecode/SDFVariableHeuristic.hh +0 -0
  16. data/ext/gecode-2.1.1/contribs/qecode/configure +0 -0
  17. data/ext/gecode-2.1.1/contribs/qecode/extensivecomparator.cc +0 -0
  18. data/ext/gecode-2.1.1/contribs/qecode/extensivecomparator.hh +0 -0
  19. data/ext/gecode-2.1.1/contribs/qecode/heap.cc +0 -0
  20. data/ext/gecode-2.1.1/contribs/qecode/implicative.cc +0 -0
  21. data/ext/gecode-2.1.1/contribs/qecode/implicative.hh +0 -0
  22. data/ext/gecode-2.1.1/contribs/qecode/myspace.cc +0 -0
  23. data/ext/gecode-2.1.1/contribs/qecode/myspace.hh +0 -0
  24. data/ext/gecode-2.1.1/contribs/qecode/qecore.cc +0 -0
  25. data/ext/gecode-2.1.1/contribs/qecode/qecore.hh +0 -0
  26. data/ext/gecode-2.1.1/contribs/qecode/warner.cc +0 -0
  27. data/ext/gecode-2.1.1/contribs/qecode/warner.hh +0 -0
  28. data/ext/gecode-2.1.1/gecode/cpltset/var-imp/cpltset.vis +0 -0
  29. data/ext/gecode-2.1.1/gecode/int/arithmetic/abs.icc +0 -0
  30. data/ext/gecode-2.1.1/gecode/int/arithmetic/max.icc +0 -0
  31. data/ext/gecode-2.1.1/gecode/int/arithmetic/mult.icc +0 -0
  32. data/ext/gecode-2.1.1/gecode/int/arithmetic/sqr.icc +0 -0
  33. data/ext/gecode-2.1.1/gecode/int/arithmetic/sqrt.icc +0 -0
  34. data/ext/gecode-2.1.1/gecode/int/array.cc +0 -0
  35. data/ext/gecode-2.1.1/gecode/int/array.icc +0 -0
  36. data/ext/gecode-2.1.1/gecode/int/bool/base.icc +0 -0
  37. data/ext/gecode-2.1.1/gecode/int/bool/eq.icc +0 -0
  38. data/ext/gecode-2.1.1/gecode/int/bool/eqv.icc +0 -0
  39. data/ext/gecode-2.1.1/gecode/int/bool/lq.icc +0 -0
  40. data/ext/gecode-2.1.1/gecode/int/bool/or.icc +0 -0
  41. data/ext/gecode-2.1.1/gecode/int/branch/select-val.icc +0 -0
  42. data/ext/gecode-2.1.1/gecode/int/branch/select-view.icc +0 -0
  43. data/ext/gecode-2.1.1/gecode/int/branch.cc +0 -0
  44. data/ext/gecode-2.1.1/gecode/int/branch.hh +0 -0
  45. data/ext/gecode-2.1.1/gecode/int/channel/base.icc +0 -0
  46. data/ext/gecode-2.1.1/gecode/int/channel/dom.icc +0 -0
  47. data/ext/gecode-2.1.1/gecode/int/channel/link-multi.cc +0 -0
  48. data/ext/gecode-2.1.1/gecode/int/channel/link-multi.icc +0 -0
  49. data/ext/gecode-2.1.1/gecode/int/channel/link-single.cc +0 -0
  50. data/ext/gecode-2.1.1/gecode/int/channel/link-single.icc +0 -0
  51. data/ext/gecode-2.1.1/gecode/int/channel/val.icc +0 -0
  52. data/ext/gecode-2.1.1/gecode/int/channel.cc +0 -0
  53. data/ext/gecode-2.1.1/gecode/int/channel.hh +0 -0
  54. data/ext/gecode-2.1.1/gecode/int/circuit/base.icc +0 -0
  55. data/ext/gecode-2.1.1/gecode/int/circuit/dom.icc +0 -0
  56. data/ext/gecode-2.1.1/gecode/int/circuit/val.icc +0 -0
  57. data/ext/gecode-2.1.1/gecode/int/circuit.cc +0 -0
  58. data/ext/gecode-2.1.1/gecode/int/circuit.hh +0 -0
  59. data/ext/gecode-2.1.1/gecode/int/count/int.icc +0 -0
  60. data/ext/gecode-2.1.1/gecode/int/count/rel.icc +0 -0
  61. data/ext/gecode-2.1.1/gecode/int/count/view.icc +0 -0
  62. data/ext/gecode-2.1.1/gecode/int/distinct/bilink.icc +0 -0
  63. data/ext/gecode-2.1.1/gecode/int/distinct/bnd.icc +0 -0
  64. data/ext/gecode-2.1.1/gecode/int/distinct/combptr.icc +0 -0
  65. data/ext/gecode-2.1.1/gecode/int/distinct/dom.icc +0 -0
  66. data/ext/gecode-2.1.1/gecode/int/distinct/edge.icc +0 -0
  67. data/ext/gecode-2.1.1/gecode/int/distinct/node.icc +0 -0
  68. data/ext/gecode-2.1.1/gecode/int/distinct/ter-dom.icc +0 -0
  69. data/ext/gecode-2.1.1/gecode/int/distinct/val.icc +0 -0
  70. data/ext/gecode-2.1.1/gecode/int/dom/range.icc +0 -0
  71. data/ext/gecode-2.1.1/gecode/int/dom/spec.icc +0 -0
  72. data/ext/gecode-2.1.1/gecode/int/dom.cc +0 -0
  73. data/ext/gecode-2.1.1/gecode/int/dom.hh +0 -0
  74. data/ext/gecode-2.1.1/gecode/int/element/int.icc +0 -0
  75. data/ext/gecode-2.1.1/gecode/int/element/view.icc +0 -0
  76. data/ext/gecode-2.1.1/gecode/int/element.cc +0 -0
  77. data/ext/gecode-2.1.1/gecode/int/element.hh +0 -0
  78. data/ext/gecode-2.1.1/gecode/int/exception.icc +0 -0
  79. data/ext/gecode-2.1.1/gecode/int/extensional/dfa.cc +0 -0
  80. data/ext/gecode-2.1.1/gecode/int/extensional/dfa.icc +0 -0
  81. data/ext/gecode-2.1.1/gecode/int/extensional/layered-graph.icc +0 -0
  82. data/ext/gecode-2.1.1/gecode/int/gcc/dom.icc +0 -0
  83. data/ext/gecode-2.1.1/gecode/int/gcc/gccbndsup.icc +0 -0
  84. data/ext/gecode-2.1.1/gecode/int/gcc/lbc.icc +0 -0
  85. data/ext/gecode-2.1.1/gecode/int/gcc/ubc.icc +0 -0
  86. data/ext/gecode-2.1.1/gecode/int/gcc.cc +0 -0
  87. data/ext/gecode-2.1.1/gecode/int/gcc.hh +0 -0
  88. data/ext/gecode-2.1.1/gecode/int/int-set.cc +0 -0
  89. data/ext/gecode-2.1.1/gecode/int/int-set.icc +0 -0
  90. data/ext/gecode-2.1.1/gecode/int/linear/bool-int.icc +0 -0
  91. data/ext/gecode-2.1.1/gecode/int/linear/bool-post.cc +0 -0
  92. data/ext/gecode-2.1.1/gecode/int/linear/bool-scale.icc +0 -0
  93. data/ext/gecode-2.1.1/gecode/int/linear/bool-view.icc +0 -0
  94. data/ext/gecode-2.1.1/gecode/int/linear/int-bin.icc +0 -0
  95. data/ext/gecode-2.1.1/gecode/int/linear/int-dom.icc +0 -0
  96. data/ext/gecode-2.1.1/gecode/int/linear/int-nary.icc +0 -0
  97. data/ext/gecode-2.1.1/gecode/int/linear/int-post.cc +0 -0
  98. data/ext/gecode-2.1.1/gecode/int/linear/int-ter.icc +0 -0
  99. data/ext/gecode-2.1.1/gecode/int/linear/post.icc +0 -0
  100. data/ext/gecode-2.1.1/gecode/int/propagator.icc +0 -0
  101. data/ext/gecode-2.1.1/gecode/int/rel/eq.icc +0 -0
  102. data/ext/gecode-2.1.1/gecode/int/rel/lex.icc +0 -0
  103. data/ext/gecode-2.1.1/gecode/int/rel/lq-le.icc +0 -0
  104. data/ext/gecode-2.1.1/gecode/int/rel/nq.icc +0 -0
  105. data/ext/gecode-2.1.1/gecode/int/unshare.cc +0 -0
  106. data/ext/gecode-2.1.1/gecode/int/var/bool.cc +0 -0
  107. data/ext/gecode-2.1.1/gecode/int/var-imp/bool.cc +0 -0
  108. data/ext/gecode-2.1.1/gecode/int/var-imp/bool.icc +0 -0
  109. data/ext/gecode-2.1.1/gecode/int/var-imp/bool.vis +0 -0
  110. data/ext/gecode-2.1.1/gecode/int/var-imp/delta.icc +0 -0
  111. data/ext/gecode-2.1.1/gecode/int/var-imp/int.icc +0 -0
  112. data/ext/gecode-2.1.1/gecode/int/var-imp/int.vis +0 -0
  113. data/ext/gecode-2.1.1/gecode/int/view/bool.icc +0 -0
  114. data/ext/gecode-2.1.1/gecode/int/view/constint.icc +0 -0
  115. data/ext/gecode-2.1.1/gecode/int/view/int.icc +0 -0
  116. data/ext/gecode-2.1.1/gecode/int/view/iter.icc +0 -0
  117. data/ext/gecode-2.1.1/gecode/int/view/minus.icc +0 -0
  118. data/ext/gecode-2.1.1/gecode/int/view/offset.icc +0 -0
  119. data/ext/gecode-2.1.1/gecode/int/view/print.cc +0 -0
  120. data/ext/gecode-2.1.1/gecode/int/view/rtest.icc +0 -0
  121. data/ext/gecode-2.1.1/gecode/int/view/scale.icc +0 -0
  122. data/ext/gecode-2.1.1/gecode/int/view/zero.icc +0 -0
  123. data/ext/gecode-2.1.1/gecode/int/view.icc +0 -0
  124. data/ext/gecode-2.1.1/gecode/iter/ranges-add.icc +0 -0
  125. data/ext/gecode-2.1.1/gecode/iter/ranges-append.icc +0 -0
  126. data/ext/gecode-2.1.1/gecode/iter/ranges-array.icc +0 -0
  127. data/ext/gecode-2.1.1/gecode/iter/ranges-cache.icc +0 -0
  128. data/ext/gecode-2.1.1/gecode/iter/ranges-compl.icc +0 -0
  129. data/ext/gecode-2.1.1/gecode/iter/ranges-diff.icc +0 -0
  130. data/ext/gecode-2.1.1/gecode/iter/ranges-empty.icc +0 -0
  131. data/ext/gecode-2.1.1/gecode/iter/ranges-inter.icc +0 -0
  132. data/ext/gecode-2.1.1/gecode/iter/ranges-minmax.icc +0 -0
  133. data/ext/gecode-2.1.1/gecode/iter/ranges-minus.icc +0 -0
  134. data/ext/gecode-2.1.1/gecode/iter/ranges-offset.icc +0 -0
  135. data/ext/gecode-2.1.1/gecode/iter/ranges-operations.icc +0 -0
  136. data/ext/gecode-2.1.1/gecode/iter/ranges-scale.icc +0 -0
  137. data/ext/gecode-2.1.1/gecode/iter/ranges-singleton-append.icc +0 -0
  138. data/ext/gecode-2.1.1/gecode/iter/ranges-singleton.icc +0 -0
  139. data/ext/gecode-2.1.1/gecode/iter/ranges-union.icc +0 -0
  140. data/ext/gecode-2.1.1/gecode/iter/ranges-values.icc +0 -0
  141. data/ext/gecode-2.1.1/gecode/iter/values-array.icc +0 -0
  142. data/ext/gecode-2.1.1/gecode/iter/values-minus.icc +0 -0
  143. data/ext/gecode-2.1.1/gecode/iter/values-offset.icc +0 -0
  144. data/ext/gecode-2.1.1/gecode/iter/values-ranges.icc +0 -0
  145. data/ext/gecode-2.1.1/gecode/iter/values-singleton.icc +0 -0
  146. data/ext/gecode-2.1.1/gecode/iter/values-unique.icc +0 -0
  147. data/ext/gecode-2.1.1/gecode/iter.hh +0 -0
  148. data/ext/gecode-2.1.1/gecode/kernel/advisor.icc +0 -0
  149. data/ext/gecode-2.1.1/gecode/kernel/array.icc +0 -0
  150. data/ext/gecode-2.1.1/gecode/kernel/branching.icc +0 -0
  151. data/ext/gecode-2.1.1/gecode/kernel/exception.icc +0 -0
  152. data/ext/gecode-2.1.1/gecode/kernel/macros.icc +0 -0
  153. data/ext/gecode-2.1.1/gecode/kernel/memory-manager.icc +0 -0
  154. data/ext/gecode-2.1.1/gecode/kernel/modevent.icc +0 -0
  155. data/ext/gecode-2.1.1/gecode/kernel/propagator.icc +0 -0
  156. data/ext/gecode-2.1.1/gecode/kernel/shared-array.icc +0 -0
  157. data/ext/gecode-2.1.1/gecode/kernel/var-traits.icc +0 -0
  158. data/ext/gecode-2.1.1/gecode/kernel/var.icc +0 -0
  159. data/ext/gecode-2.1.1/gecode/kernel/view.icc +0 -0
  160. data/ext/gecode-2.1.1/gecode/kernel.hh +0 -0
  161. data/ext/gecode-2.1.1/gecode/minimodel/arithmetic.cc +0 -0
  162. data/ext/gecode-2.1.1/gecode/minimodel/bool-expr.cc +0 -0
  163. data/ext/gecode-2.1.1/gecode/minimodel/bool-expr.icc +0 -0
  164. data/ext/gecode-2.1.1/gecode/minimodel/bool-rel.icc +0 -0
  165. data/ext/gecode-2.1.1/gecode/minimodel/lin-expr.icc +0 -0
  166. data/ext/gecode-2.1.1/gecode/minimodel/lin-rel.icc +0 -0
  167. data/ext/gecode-2.1.1/gecode/minimodel/reg.cc +0 -0
  168. data/ext/gecode-2.1.1/gecode/minimodel.hh +0 -0
  169. data/ext/gecode-2.1.1/gecode/search/bab.cc +0 -0
  170. data/ext/gecode-2.1.1/gecode/search/bab.icc +0 -0
  171. data/ext/gecode-2.1.1/gecode/search/dfs.cc +0 -0
  172. data/ext/gecode-2.1.1/gecode/search/dfs.icc +0 -0
  173. data/ext/gecode-2.1.1/gecode/search/engine-ctrl.icc +0 -0
  174. data/ext/gecode-2.1.1/gecode/search/lds.cc +0 -0
  175. data/ext/gecode-2.1.1/gecode/search/lds.icc +0 -0
  176. data/ext/gecode-2.1.1/gecode/search/options.cc +0 -0
  177. data/ext/gecode-2.1.1/gecode/search/options.icc +0 -0
  178. data/ext/gecode-2.1.1/gecode/search/reco-stack.icc +0 -0
  179. data/ext/gecode-2.1.1/gecode/search/restart.icc +0 -0
  180. data/ext/gecode-2.1.1/gecode/search/statistics.icc +0 -0
  181. data/ext/gecode-2.1.1/gecode/search/stop.cc +0 -0
  182. data/ext/gecode-2.1.1/gecode/search/stop.icc +0 -0
  183. data/ext/gecode-2.1.1/gecode/set/var-imp/set.vis +0 -0
  184. data/ext/gecode-2.1.1/gecode/support/block-allocator.icc +0 -0
  185. data/ext/gecode-2.1.1/gecode/support/cast.icc +0 -0
  186. data/ext/gecode-2.1.1/gecode/support/exception.cc +0 -0
  187. data/ext/gecode-2.1.1/gecode/support/exception.icc +0 -0
  188. data/ext/gecode-2.1.1/gecode/support/macros.icc +0 -0
  189. data/ext/gecode-2.1.1/gecode/support/marked-pointer.icc +0 -0
  190. data/ext/gecode-2.1.1/gecode/support/memory.icc +0 -0
  191. data/ext/gecode-2.1.1/gecode/support/sentinel-stack.icc +0 -0
  192. data/ext/gecode-2.1.1/gecode/support/static-stack.icc +0 -0
  193. data/ext/gecode-2.1.1/gecode/support/symbol.cc +0 -0
  194. data/ext/gecode-2.1.1/gecode/support.hh +0 -0
  195. data/ext/gecode-2.1.1/install-sh +0 -0
  196. data/ext/gecode-2.1.1/misc/debian/rules +0 -0
  197. data/ext/gecode-2.1.1/misc/doxygen/back.png +0 -0
  198. data/ext/gecode-2.1.1/misc/doxygen/gecode-logo-100.png +0 -0
  199. data/ext/gecode-2.1.1/misc/genchangelog.perl +0 -0
  200. data/ext/gecode-2.1.1/misc/genlicense.perl +0 -0
  201. data/ext/gecode-2.1.1/misc/genstatistics.perl +0 -0
  202. data/ext/gecode-2.1.1/misc/genvariables.perl +0 -0
  203. data/ext/gecode-2.1.1/misc/getrevision.perl +0 -0
  204. data/ext/gecode-2.1.1/misc/makedepend.perl +0 -0
  205. data/ext/gecode-2.1.1/misc/svn-ignore.txt +0 -0
  206. data/ext/gecode-2.1.1/variables.vsl +0 -0
  207. data/lib/gecoder/bindings/bindings.rb +16 -0
  208. data/lib/gecoder/bindings.rb +42 -0
  209. data/lib/gecoder/interface/branch.rb +16 -9
  210. data/lib/gecoder/interface/constraints/bool/boolean.rb +205 -213
  211. data/lib/gecoder/interface/constraints/bool/channel.rb +4 -5
  212. data/lib/gecoder/interface/constraints/bool/linear.rb +192 -21
  213. data/lib/gecoder/interface/constraints/bool_enum/channel.rb +43 -39
  214. data/lib/gecoder/interface/constraints/bool_enum/extensional.rb +43 -49
  215. data/lib/gecoder/interface/constraints/bool_enum/relation.rb +38 -71
  216. data/lib/gecoder/interface/constraints/bool_enum_constraints.rb +73 -22
  217. data/lib/gecoder/interface/constraints/bool_var_constraints.rb +140 -61
  218. data/lib/gecoder/interface/constraints/extensional_regexp.rb +4 -4
  219. data/lib/gecoder/interface/constraints/fixnum_enum/element.rb +63 -0
  220. data/lib/gecoder/interface/constraints/fixnum_enum/operation.rb +65 -0
  221. data/lib/gecoder/interface/constraints/fixnum_enum_constraints.rb +42 -0
  222. data/lib/gecoder/interface/constraints/int/arithmetic.rb +131 -130
  223. data/lib/gecoder/interface/constraints/int/channel.rb +21 -31
  224. data/lib/gecoder/interface/constraints/int/domain.rb +45 -42
  225. data/lib/gecoder/interface/constraints/int/linear.rb +85 -239
  226. data/lib/gecoder/interface/constraints/int/relation.rb +141 -0
  227. data/lib/gecoder/interface/constraints/int_enum/arithmetic.rb +55 -64
  228. data/lib/gecoder/interface/constraints/int_enum/channel.rb +35 -37
  229. data/lib/gecoder/interface/constraints/int_enum/count.rb +53 -78
  230. data/lib/gecoder/interface/constraints/int_enum/distinct.rb +36 -46
  231. data/lib/gecoder/interface/constraints/int_enum/element.rb +39 -57
  232. data/lib/gecoder/interface/constraints/int_enum/equality.rb +15 -19
  233. data/lib/gecoder/interface/constraints/int_enum/extensional.rb +65 -72
  234. data/lib/gecoder/interface/constraints/int_enum/sort.rb +42 -45
  235. data/lib/gecoder/interface/constraints/int_enum_constraints.rb +79 -22
  236. data/lib/gecoder/interface/constraints/int_var_constraints.rb +215 -44
  237. data/lib/gecoder/interface/constraints/reifiable_constraints.rb +14 -14
  238. data/lib/gecoder/interface/constraints/selected_set/select.rb +120 -0
  239. data/lib/gecoder/interface/constraints/selected_set_constraints.rb +75 -0
  240. data/lib/gecoder/interface/constraints/set/cardinality.rb +43 -53
  241. data/lib/gecoder/interface/constraints/set/channel.rb +26 -29
  242. data/lib/gecoder/interface/constraints/set/connection.rb +89 -152
  243. data/lib/gecoder/interface/constraints/set/domain.rb +112 -65
  244. data/lib/gecoder/interface/constraints/set/include.rb +36 -0
  245. data/lib/gecoder/interface/constraints/set/operation.rb +96 -110
  246. data/lib/gecoder/interface/constraints/set/relation.rb +114 -137
  247. data/lib/gecoder/interface/constraints/set_elements/relation.rb +116 -0
  248. data/lib/gecoder/interface/constraints/set_elements_constraints.rb +97 -0
  249. data/lib/gecoder/interface/constraints/set_enum/channel.rb +23 -27
  250. data/lib/gecoder/interface/constraints/set_enum/distinct.rb +18 -19
  251. data/lib/gecoder/interface/constraints/set_enum/operation.rb +62 -53
  252. data/lib/gecoder/interface/constraints/set_enum/select.rb +79 -0
  253. data/lib/gecoder/interface/constraints/set_enum_constraints.rb +73 -23
  254. data/lib/gecoder/interface/constraints/set_var_constraints.rb +222 -57
  255. data/lib/gecoder/interface/constraints.rb +410 -451
  256. data/lib/gecoder/interface/enum_matrix.rb +4 -4
  257. data/lib/gecoder/interface/enum_wrapper.rb +71 -22
  258. data/lib/gecoder/interface/model.rb +167 -12
  259. data/lib/gecoder/interface/model_sugar.rb +84 -0
  260. data/lib/gecoder/interface/search.rb +30 -18
  261. data/lib/gecoder/interface/variables.rb +103 -33
  262. data/lib/gecoder/interface.rb +2 -1
  263. data/lib/gecoder/version.rb +2 -2
  264. data/specs/bool_var.rb +19 -12
  265. data/specs/constraints/{boolean.rb → bool/boolean.rb} +103 -28
  266. data/specs/constraints/bool/boolean_properties.rb +51 -0
  267. data/specs/constraints/bool/linear.rb +213 -0
  268. data/specs/constraints/bool_enum/bool_enum_relation.rb +117 -0
  269. data/specs/constraints/bool_enum/channel.rb +102 -0
  270. data/specs/constraints/{extensional.rb → bool_enum/extensional.rb} +32 -101
  271. data/specs/constraints/constraint_helper.rb +149 -179
  272. data/specs/constraints/constraint_receivers.rb +103 -0
  273. data/specs/constraints/constraints.rb +6 -63
  274. data/specs/constraints/fixnum_enum/element.rb +58 -0
  275. data/specs/constraints/fixnum_enum/operation.rb +67 -0
  276. data/specs/constraints/int/arithmetic.rb +149 -0
  277. data/specs/constraints/int/channel.rb +101 -0
  278. data/specs/constraints/int/domain.rb +106 -0
  279. data/specs/constraints/int/linear.rb +183 -0
  280. data/specs/constraints/int/linear_properties.rb +97 -0
  281. data/specs/constraints/int/relation.rb +84 -0
  282. data/specs/constraints/int_enum/arithmetic.rb +72 -0
  283. data/specs/constraints/int_enum/channel.rb +57 -0
  284. data/specs/constraints/int_enum/count.rb +72 -0
  285. data/specs/constraints/int_enum/distinct.rb +80 -0
  286. data/specs/constraints/int_enum/element.rb +61 -0
  287. data/specs/constraints/int_enum/equality.rb +29 -0
  288. data/specs/constraints/int_enum/extensional.rb +224 -0
  289. data/specs/constraints/int_enum/sort.rb +167 -0
  290. data/specs/constraints/operands.rb +264 -0
  291. data/specs/constraints/property_helper.rb +443 -0
  292. data/specs/constraints/reification_sugar.rb +4 -5
  293. data/specs/constraints/selected_set/select.rb +56 -0
  294. data/specs/constraints/selected_set/select_properties.rb +157 -0
  295. data/specs/constraints/set/cardinality.rb +58 -0
  296. data/specs/constraints/set/cardinality_properties.rb +46 -0
  297. data/specs/constraints/set/channel.rb +77 -0
  298. data/specs/constraints/set/connection.rb +176 -0
  299. data/specs/constraints/set/domain.rb +197 -0
  300. data/specs/constraints/set/include.rb +36 -0
  301. data/specs/constraints/set/operation.rb +132 -0
  302. data/specs/constraints/set/relation.rb +117 -0
  303. data/specs/constraints/set_elements/relation.rb +84 -0
  304. data/specs/constraints/set_enum/channel.rb +80 -0
  305. data/specs/constraints/set_enum/distinct.rb +59 -0
  306. data/specs/constraints/set_enum/operation.rb +111 -0
  307. data/specs/constraints/set_enum/select.rb +73 -0
  308. data/specs/enum_wrapper.rb +53 -3
  309. data/specs/int_var.rb +44 -25
  310. data/specs/model.rb +58 -1
  311. data/specs/model_sugar.rb +30 -0
  312. data/specs/search.rb +24 -5
  313. data/specs/selected_set.rb +39 -0
  314. data/specs/set_elements.rb +34 -0
  315. data/specs/set_var.rb +22 -8
  316. data/specs/spec_helper.rb +206 -6
  317. data/tasks/distribution.rake +22 -7
  318. data/tasks/svn.rake +3 -1
  319. metadata +219 -135
  320. data/lib/gecoder/interface/constraints/set_enum/selection.rb +0 -217
  321. data/specs/constraints/arithmetic.rb +0 -351
  322. data/specs/constraints/bool_enum_relation.rb +0 -160
  323. data/specs/constraints/cardinality.rb +0 -157
  324. data/specs/constraints/channel.rb +0 -454
  325. data/specs/constraints/connection.rb +0 -369
  326. data/specs/constraints/count.rb +0 -146
  327. data/specs/constraints/distinct.rb +0 -164
  328. data/specs/constraints/element.rb +0 -108
  329. data/specs/constraints/equality.rb +0 -31
  330. data/specs/constraints/int_domain.rb +0 -70
  331. data/specs/constraints/int_relation.rb +0 -82
  332. data/specs/constraints/linear.rb +0 -340
  333. data/specs/constraints/selection.rb +0 -292
  334. data/specs/constraints/set_domain.rb +0 -185
  335. data/specs/constraints/set_operation.rb +0 -285
  336. data/specs/constraints/set_relation.rb +0 -197
  337. data/specs/constraints/sort.rb +0 -179
metadata CHANGED
@@ -1,33 +1,88 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: gecoder-with-gecode
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.8.3
7
- date: 2008-07-28 00:00:00 +02:00
8
- summary: Ruby interface to Gecode, an environment for constraint programming.
9
- require_paths:
10
- - lib
11
- email: gecoder-users@rubyforge.org
12
- homepage: http://gecoder.rubyforge.org
13
- rubyforge_project: gecoder
14
- description: Gecode/R is a Ruby interface to the Gecode constraint programming library. Gecode/R is intended for people with no previous experience of constraint programming, aiming to be easy to pick up and use.
15
- autorequire: gecoder
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.9.0
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
- - - Gecode/R Development Team
7
+ - Gecode/R Development Team
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-08-18 00:00:00 +02:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Gecode/R is a Ruby interface to the Gecode constraint programming library. Gecode/R is intended for people with no previous experience of constraint programming, aiming to be easy to pick up and use.
17
+ email: gecoder-users@rubyforge.org
18
+ executables: []
19
+
20
+ extensions:
21
+ - ext/gecode-2.1.1/configure
22
+ - ext/extconf.rb
23
+ extra_rdoc_files:
24
+ - README
25
+ - CHANGES
26
+ - LGPL-LICENSE
27
+ - lib/gecoder.rb
28
+ - lib/gecoder/bindings.rb
29
+ - lib/gecoder/interface/branch.rb
30
+ - lib/gecoder/interface/enum_matrix.rb
31
+ - lib/gecoder/interface/model_sugar.rb
32
+ - lib/gecoder/interface/search.rb
33
+ - lib/gecoder/interface/constraints.rb
34
+ - lib/gecoder/interface/variables.rb
35
+ - lib/gecoder/interface/enum_wrapper.rb
36
+ - lib/gecoder/interface/model.rb
37
+ - lib/gecoder/interface/constraints/set_var_constraints.rb
38
+ - lib/gecoder/interface/constraints/extensional_regexp.rb
39
+ - lib/gecoder/interface/constraints/selected_set_constraints.rb
40
+ - lib/gecoder/interface/constraints/int_enum_constraints.rb
41
+ - lib/gecoder/interface/constraints/set/channel.rb
42
+ - lib/gecoder/interface/constraints/set/cardinality.rb
43
+ - lib/gecoder/interface/constraints/set/include.rb
44
+ - lib/gecoder/interface/constraints/set/operation.rb
45
+ - lib/gecoder/interface/constraints/set/connection.rb
46
+ - lib/gecoder/interface/constraints/set/domain.rb
47
+ - lib/gecoder/interface/constraints/set/relation.rb
48
+ - lib/gecoder/interface/constraints/set_elements/relation.rb
49
+ - lib/gecoder/interface/constraints/fixnum_enum_constraints.rb
50
+ - lib/gecoder/interface/constraints/int/channel.rb
51
+ - lib/gecoder/interface/constraints/int/arithmetic.rb
52
+ - lib/gecoder/interface/constraints/int/linear.rb
53
+ - lib/gecoder/interface/constraints/int/domain.rb
54
+ - lib/gecoder/interface/constraints/int/relation.rb
55
+ - lib/gecoder/interface/constraints/set_enum_constraints.rb
56
+ - lib/gecoder/interface/constraints/bool/channel.rb
57
+ - lib/gecoder/interface/constraints/bool/boolean.rb
58
+ - lib/gecoder/interface/constraints/bool/linear.rb
59
+ - lib/gecoder/interface/constraints/int_enum/channel.rb
60
+ - lib/gecoder/interface/constraints/int_enum/distinct.rb
61
+ - lib/gecoder/interface/constraints/int_enum/element.rb
62
+ - lib/gecoder/interface/constraints/int_enum/arithmetic.rb
63
+ - lib/gecoder/interface/constraints/int_enum/count.rb
64
+ - lib/gecoder/interface/constraints/int_enum/extensional.rb
65
+ - lib/gecoder/interface/constraints/int_enum/equality.rb
66
+ - lib/gecoder/interface/constraints/int_enum/sort.rb
67
+ - lib/gecoder/interface/constraints/set_elements_constraints.rb
68
+ - lib/gecoder/interface/constraints/bool_var_constraints.rb
69
+ - lib/gecoder/interface/constraints/bool_enum_constraints.rb
70
+ - lib/gecoder/interface/constraints/selected_set/select.rb
71
+ - lib/gecoder/interface/constraints/fixnum_enum/element.rb
72
+ - lib/gecoder/interface/constraints/fixnum_enum/operation.rb
73
+ - lib/gecoder/interface/constraints/bool_enum/channel.rb
74
+ - lib/gecoder/interface/constraints/bool_enum/extensional.rb
75
+ - lib/gecoder/interface/constraints/bool_enum/relation.rb
76
+ - lib/gecoder/interface/constraints/int_var_constraints.rb
77
+ - lib/gecoder/interface/constraints/reifiable_constraints.rb
78
+ - lib/gecoder/interface/constraints/set_enum/channel.rb
79
+ - lib/gecoder/interface/constraints/set_enum/select.rb
80
+ - lib/gecoder/interface/constraints/set_enum/distinct.rb
81
+ - lib/gecoder/interface/constraints/set_enum/operation.rb
82
+ - lib/gecoder/interface/binding_changes.rb
83
+ - lib/gecoder/version.rb
84
+ - lib/gecoder/interface.rb
85
+ - lib/gecoder/bindings/bindings.rb
31
86
  files:
32
87
  - README
33
88
  - LGPL-LICENSE
@@ -38,6 +93,7 @@ files:
38
93
  - lib/gecoder/bindings.rb
39
94
  - lib/gecoder/interface/branch.rb
40
95
  - lib/gecoder/interface/enum_matrix.rb
96
+ - lib/gecoder/interface/model_sugar.rb
41
97
  - lib/gecoder/interface/search.rb
42
98
  - lib/gecoder/interface/constraints.rb
43
99
  - lib/gecoder/interface/variables.rb
@@ -45,17 +101,22 @@ files:
45
101
  - lib/gecoder/interface/model.rb
46
102
  - lib/gecoder/interface/constraints/set_var_constraints.rb
47
103
  - lib/gecoder/interface/constraints/extensional_regexp.rb
104
+ - lib/gecoder/interface/constraints/selected_set_constraints.rb
48
105
  - lib/gecoder/interface/constraints/int_enum_constraints.rb
49
106
  - lib/gecoder/interface/constraints/set/channel.rb
50
107
  - lib/gecoder/interface/constraints/set/cardinality.rb
108
+ - lib/gecoder/interface/constraints/set/include.rb
51
109
  - lib/gecoder/interface/constraints/set/operation.rb
52
110
  - lib/gecoder/interface/constraints/set/connection.rb
53
111
  - lib/gecoder/interface/constraints/set/domain.rb
54
112
  - lib/gecoder/interface/constraints/set/relation.rb
113
+ - lib/gecoder/interface/constraints/set_elements/relation.rb
114
+ - lib/gecoder/interface/constraints/fixnum_enum_constraints.rb
55
115
  - lib/gecoder/interface/constraints/int/channel.rb
56
116
  - lib/gecoder/interface/constraints/int/arithmetic.rb
57
117
  - lib/gecoder/interface/constraints/int/linear.rb
58
118
  - lib/gecoder/interface/constraints/int/domain.rb
119
+ - lib/gecoder/interface/constraints/int/relation.rb
59
120
  - lib/gecoder/interface/constraints/set_enum_constraints.rb
60
121
  - lib/gecoder/interface/constraints/bool/channel.rb
61
122
  - lib/gecoder/interface/constraints/bool/boolean.rb
@@ -68,22 +129,27 @@ files:
68
129
  - lib/gecoder/interface/constraints/int_enum/extensional.rb
69
130
  - lib/gecoder/interface/constraints/int_enum/equality.rb
70
131
  - lib/gecoder/interface/constraints/int_enum/sort.rb
132
+ - lib/gecoder/interface/constraints/set_elements_constraints.rb
71
133
  - lib/gecoder/interface/constraints/bool_var_constraints.rb
72
134
  - lib/gecoder/interface/constraints/bool_enum_constraints.rb
135
+ - lib/gecoder/interface/constraints/selected_set/select.rb
136
+ - lib/gecoder/interface/constraints/fixnum_enum/element.rb
137
+ - lib/gecoder/interface/constraints/fixnum_enum/operation.rb
73
138
  - lib/gecoder/interface/constraints/bool_enum/channel.rb
74
139
  - lib/gecoder/interface/constraints/bool_enum/extensional.rb
75
140
  - lib/gecoder/interface/constraints/bool_enum/relation.rb
76
141
  - lib/gecoder/interface/constraints/int_var_constraints.rb
77
142
  - lib/gecoder/interface/constraints/reifiable_constraints.rb
78
143
  - lib/gecoder/interface/constraints/set_enum/channel.rb
144
+ - lib/gecoder/interface/constraints/set_enum/select.rb
79
145
  - lib/gecoder/interface/constraints/set_enum/distinct.rb
80
146
  - lib/gecoder/interface/constraints/set_enum/operation.rb
81
- - lib/gecoder/interface/constraints/set_enum/selection.rb
82
147
  - lib/gecoder/interface/binding_changes.rb
83
148
  - lib/gecoder/version.rb
84
149
  - lib/gecoder/interface.rb
85
150
  - lib/gecoder/bindings/bindings.rb
86
151
  - example/queens.rb
152
+ - example/equation_system.rb
87
153
  - example/send_most_money.rb
88
154
  - example/magic_sequence.rb
89
155
  - example/send_more_money.rb
@@ -91,6 +157,7 @@ files:
91
157
  - example/sudoku.rb
92
158
  - example/square_tiling.rb
93
159
  - example/example_helper.rb
160
+ - example/money.rb
94
161
  - vendor/rust/bin
95
162
  - vendor/rust/bin/cxxgenerator.rb
96
163
  - vendor/rust/README
@@ -163,37 +230,70 @@ files:
163
230
  - specs/logging.rb
164
231
  - specs/branch.rb
165
232
  - specs/enum_matrix.rb
233
+ - specs/model_sugar.rb
166
234
  - specs/search.rb
167
235
  - specs/bool_var.rb
236
+ - specs/set_elements.rb
168
237
  - specs/distribution.rb
169
238
  - specs/spec_helper.rb
170
239
  - specs/int_var.rb
171
240
  - specs/enum_wrapper.rb
172
241
  - specs/model.rb
173
242
  - specs/set_var.rb
243
+ - specs/selected_set.rb
174
244
  - specs/constraints
175
- - specs/constraints/channel.rb
176
- - specs/constraints/bool_enum_relation.rb
177
- - specs/constraints/distinct.rb
178
- - specs/constraints/set_operation.rb
179
- - specs/constraints/element.rb
180
- - specs/constraints/set_domain.rb
181
- - specs/constraints/arithmetic.rb
245
+ - specs/constraints/property_helper.rb
246
+ - specs/constraints/set
247
+ - specs/constraints/set/channel.rb
248
+ - specs/constraints/set/cardinality_properties.rb
249
+ - specs/constraints/set/cardinality.rb
250
+ - specs/constraints/set/include.rb
251
+ - specs/constraints/set/operation.rb
252
+ - specs/constraints/set/connection.rb
253
+ - specs/constraints/set/domain.rb
254
+ - specs/constraints/set/relation.rb
255
+ - specs/constraints/set_elements
256
+ - specs/constraints/set_elements/relation.rb
257
+ - specs/constraints/int
258
+ - specs/constraints/int/channel.rb
259
+ - specs/constraints/int/arithmetic.rb
260
+ - specs/constraints/int/linear_properties.rb
261
+ - specs/constraints/int/linear.rb
262
+ - specs/constraints/int/domain.rb
263
+ - specs/constraints/int/relation.rb
182
264
  - specs/constraints/constraints.rb
183
- - specs/constraints/count.rb
184
- - specs/constraints/cardinality.rb
185
- - specs/constraints/set_relation.rb
186
- - specs/constraints/extensional.rb
187
- - specs/constraints/equality.rb
188
- - specs/constraints/boolean.rb
189
- - specs/constraints/int_relation.rb
190
- - specs/constraints/sort.rb
265
+ - specs/constraints/bool
266
+ - specs/constraints/bool/boolean_properties.rb
267
+ - specs/constraints/bool/boolean.rb
268
+ - specs/constraints/bool/linear.rb
269
+ - specs/constraints/int_enum
270
+ - specs/constraints/int_enum/channel.rb
271
+ - specs/constraints/int_enum/distinct.rb
272
+ - specs/constraints/int_enum/element.rb
273
+ - specs/constraints/int_enum/arithmetic.rb
274
+ - specs/constraints/int_enum/count.rb
275
+ - specs/constraints/int_enum/extensional.rb
276
+ - specs/constraints/int_enum/equality.rb
277
+ - specs/constraints/int_enum/sort.rb
191
278
  - specs/constraints/constraint_helper.rb
192
- - specs/constraints/int_domain.rb
193
279
  - specs/constraints/reification_sugar.rb
194
- - specs/constraints/selection.rb
195
- - specs/constraints/connection.rb
196
- - specs/constraints/linear.rb
280
+ - specs/constraints/selected_set
281
+ - specs/constraints/selected_set/select.rb
282
+ - specs/constraints/selected_set/select_properties.rb
283
+ - specs/constraints/constraint_receivers.rb
284
+ - specs/constraints/fixnum_enum
285
+ - specs/constraints/fixnum_enum/element.rb
286
+ - specs/constraints/fixnum_enum/operation.rb
287
+ - specs/constraints/bool_enum
288
+ - specs/constraints/bool_enum/channel.rb
289
+ - specs/constraints/bool_enum/bool_enum_relation.rb
290
+ - specs/constraints/bool_enum/extensional.rb
291
+ - specs/constraints/operands.rb
292
+ - specs/constraints/set_enum
293
+ - specs/constraints/set_enum/channel.rb
294
+ - specs/constraints/set_enum/select.rb
295
+ - specs/constraints/set_enum/distinct.rb
296
+ - specs/constraints/set_enum/operation.rb
197
297
  - specs/examples.rb
198
298
  - ext/gecoder.cpp
199
299
  - ext/vararray.cpp
@@ -790,109 +890,93 @@ files:
790
890
  - ext/gecode-2.1.1/configure.ac.in
791
891
  - ext/gecode-2.1.1/configure.ac
792
892
  - ext/gecode-2.1.1/changelog.in
893
+ has_rdoc: true
894
+ homepage: http://gecoder.rubyforge.org
895
+ post_install_message:
896
+ rdoc_options:
897
+ - --line-numbers
898
+ - --inline-source
899
+ - --accessor
900
+ - delegate
901
+ - --main
902
+ - README
903
+ require_paths:
904
+ - lib
905
+ required_ruby_version: !ruby/object:Gem::Requirement
906
+ requirements:
907
+ - - ">="
908
+ - !ruby/object:Gem::Version
909
+ version: "0"
910
+ version:
911
+ required_rubygems_version: !ruby/object:Gem::Requirement
912
+ requirements:
913
+ - - ">="
914
+ - !ruby/object:Gem::Version
915
+ version: "0"
916
+ version:
917
+ requirements: []
918
+
919
+ rubyforge_project: gecoder
920
+ rubygems_version: 1.2.0
921
+ signing_key:
922
+ specification_version: 2
923
+ summary: Ruby interface to Gecode, an environment for constraint programming.
793
924
  test_files:
794
925
  - specs/logging.rb
795
926
  - specs/branch.rb
796
927
  - specs/enum_matrix.rb
928
+ - specs/model_sugar.rb
797
929
  - specs/search.rb
798
930
  - specs/bool_var.rb
931
+ - specs/set_elements.rb
799
932
  - specs/distribution.rb
800
933
  - specs/spec_helper.rb
801
934
  - specs/int_var.rb
802
935
  - specs/enum_wrapper.rb
803
936
  - specs/model.rb
804
937
  - specs/set_var.rb
805
- - specs/constraints/channel.rb
806
- - specs/constraints/bool_enum_relation.rb
807
- - specs/constraints/distinct.rb
808
- - specs/constraints/set_operation.rb
809
- - specs/constraints/element.rb
810
- - specs/constraints/set_domain.rb
811
- - specs/constraints/arithmetic.rb
938
+ - specs/selected_set.rb
939
+ - specs/constraints/property_helper.rb
940
+ - specs/constraints/set/channel.rb
941
+ - specs/constraints/set/cardinality_properties.rb
942
+ - specs/constraints/set/cardinality.rb
943
+ - specs/constraints/set/include.rb
944
+ - specs/constraints/set/operation.rb
945
+ - specs/constraints/set/connection.rb
946
+ - specs/constraints/set/domain.rb
947
+ - specs/constraints/set/relation.rb
948
+ - specs/constraints/set_elements/relation.rb
949
+ - specs/constraints/int/channel.rb
950
+ - specs/constraints/int/arithmetic.rb
951
+ - specs/constraints/int/linear_properties.rb
952
+ - specs/constraints/int/linear.rb
953
+ - specs/constraints/int/domain.rb
954
+ - specs/constraints/int/relation.rb
812
955
  - specs/constraints/constraints.rb
813
- - specs/constraints/count.rb
814
- - specs/constraints/cardinality.rb
815
- - specs/constraints/set_relation.rb
816
- - specs/constraints/extensional.rb
817
- - specs/constraints/equality.rb
818
- - specs/constraints/boolean.rb
819
- - specs/constraints/int_relation.rb
820
- - specs/constraints/sort.rb
956
+ - specs/constraints/bool/boolean_properties.rb
957
+ - specs/constraints/bool/boolean.rb
958
+ - specs/constraints/bool/linear.rb
959
+ - specs/constraints/int_enum/channel.rb
960
+ - specs/constraints/int_enum/distinct.rb
961
+ - specs/constraints/int_enum/element.rb
962
+ - specs/constraints/int_enum/arithmetic.rb
963
+ - specs/constraints/int_enum/count.rb
964
+ - specs/constraints/int_enum/extensional.rb
965
+ - specs/constraints/int_enum/equality.rb
966
+ - specs/constraints/int_enum/sort.rb
821
967
  - specs/constraints/constraint_helper.rb
822
- - specs/constraints/int_domain.rb
823
968
  - specs/constraints/reification_sugar.rb
824
- - specs/constraints/selection.rb
825
- - specs/constraints/connection.rb
826
- - specs/constraints/linear.rb
969
+ - specs/constraints/selected_set/select.rb
970
+ - specs/constraints/selected_set/select_properties.rb
971
+ - specs/constraints/constraint_receivers.rb
972
+ - specs/constraints/fixnum_enum/element.rb
973
+ - specs/constraints/fixnum_enum/operation.rb
974
+ - specs/constraints/bool_enum/channel.rb
975
+ - specs/constraints/bool_enum/bool_enum_relation.rb
976
+ - specs/constraints/bool_enum/extensional.rb
977
+ - specs/constraints/operands.rb
978
+ - specs/constraints/set_enum/channel.rb
979
+ - specs/constraints/set_enum/select.rb
980
+ - specs/constraints/set_enum/distinct.rb
981
+ - specs/constraints/set_enum/operation.rb
827
982
  - specs/examples.rb
828
- rdoc_options:
829
- - --title
830
- - Gecode/R
831
- - --line-numbers
832
- - --inline-source
833
- - --accessor
834
- - delegate
835
- - --main
836
- - README
837
- extra_rdoc_files:
838
- - README
839
- - CHANGES
840
- - LGPL-LICENSE
841
- - lib/gecoder.rb
842
- - lib/gecoder/bindings.rb
843
- - lib/gecoder/interface/branch.rb
844
- - lib/gecoder/interface/enum_matrix.rb
845
- - lib/gecoder/interface/search.rb
846
- - lib/gecoder/interface/constraints.rb
847
- - lib/gecoder/interface/variables.rb
848
- - lib/gecoder/interface/enum_wrapper.rb
849
- - lib/gecoder/interface/model.rb
850
- - lib/gecoder/interface/constraints/set_var_constraints.rb
851
- - lib/gecoder/interface/constraints/extensional_regexp.rb
852
- - lib/gecoder/interface/constraints/int_enum_constraints.rb
853
- - lib/gecoder/interface/constraints/set/channel.rb
854
- - lib/gecoder/interface/constraints/set/cardinality.rb
855
- - lib/gecoder/interface/constraints/set/operation.rb
856
- - lib/gecoder/interface/constraints/set/connection.rb
857
- - lib/gecoder/interface/constraints/set/domain.rb
858
- - lib/gecoder/interface/constraints/set/relation.rb
859
- - lib/gecoder/interface/constraints/int/channel.rb
860
- - lib/gecoder/interface/constraints/int/arithmetic.rb
861
- - lib/gecoder/interface/constraints/int/linear.rb
862
- - lib/gecoder/interface/constraints/int/domain.rb
863
- - lib/gecoder/interface/constraints/set_enum_constraints.rb
864
- - lib/gecoder/interface/constraints/bool/channel.rb
865
- - lib/gecoder/interface/constraints/bool/boolean.rb
866
- - lib/gecoder/interface/constraints/bool/linear.rb
867
- - lib/gecoder/interface/constraints/int_enum/channel.rb
868
- - lib/gecoder/interface/constraints/int_enum/distinct.rb
869
- - lib/gecoder/interface/constraints/int_enum/element.rb
870
- - lib/gecoder/interface/constraints/int_enum/arithmetic.rb
871
- - lib/gecoder/interface/constraints/int_enum/count.rb
872
- - lib/gecoder/interface/constraints/int_enum/extensional.rb
873
- - lib/gecoder/interface/constraints/int_enum/equality.rb
874
- - lib/gecoder/interface/constraints/int_enum/sort.rb
875
- - lib/gecoder/interface/constraints/bool_var_constraints.rb
876
- - lib/gecoder/interface/constraints/bool_enum_constraints.rb
877
- - lib/gecoder/interface/constraints/bool_enum/channel.rb
878
- - lib/gecoder/interface/constraints/bool_enum/extensional.rb
879
- - lib/gecoder/interface/constraints/bool_enum/relation.rb
880
- - lib/gecoder/interface/constraints/int_var_constraints.rb
881
- - lib/gecoder/interface/constraints/reifiable_constraints.rb
882
- - lib/gecoder/interface/constraints/set_enum/channel.rb
883
- - lib/gecoder/interface/constraints/set_enum/distinct.rb
884
- - lib/gecoder/interface/constraints/set_enum/operation.rb
885
- - lib/gecoder/interface/constraints/set_enum/selection.rb
886
- - lib/gecoder/interface/binding_changes.rb
887
- - lib/gecoder/version.rb
888
- - lib/gecoder/interface.rb
889
- - lib/gecoder/bindings/bindings.rb
890
- executables: []
891
-
892
- extensions:
893
- - ext/gecode-2.1.1/configure
894
- - ext/extconf.rb
895
- requirements: []
896
-
897
- dependencies: []
898
-
@@ -1,217 +0,0 @@
1
- module Gecode::SetEnumMethods
2
- # This adds the adder for the methods in the modules including it. The
3
- # reason for doing it so indirect is that the first #[] won't be defined
4
- # before the module that this is mixed into is mixed into an enum.
5
- def self.included(mod) #:nodoc:
6
- mod.module_eval do
7
- # Now we enter the module that the module possibly defining #[]
8
- # is mixed into.
9
- if instance_methods.include?('[]') and
10
- not instance_methods.include?('pre_selection_access')
11
- alias_method :pre_selection_access, :[]
12
- end
13
-
14
- def [](*vars)
15
- # Hook in an element constraint if a variable is used for array
16
- # access.
17
- if vars.first.kind_of? Gecode::FreeIntVar
18
- params = {:lhs => self, :index => vars.first}
19
- Gecode::Constraints::SetEnum::Selection::SelectExpressionStub.new(
20
- @model, params)
21
- elsif vars.first.kind_of? Gecode::FreeSetVar
22
- params = {:lhs => self, :indices => vars.first}
23
- Gecode::Constraints::SetEnum::Selection::SetAccessStub.new(
24
- @model, params)
25
- else
26
- pre_selection_access(*vars) if respond_to? :pre_selection_access
27
- end
28
- end
29
- end
30
- end
31
- end
32
-
33
- # A module that gathers the classes and modules used by selection constraints.
34
- module Gecode::Constraints::SetEnum::Selection #:nodoc:
35
- # Describes an expression stub started with a set var enum followed with an
36
- # array access using a set variable.
37
- class SetAccessStub < Gecode::Constraints::ExpressionStub #:nodoc:
38
- include Gecode::Constraints::LeftHandSideMethods
39
-
40
- # Starts a union selection constraint on the selected sets.
41
- def union
42
- UnionExpressionStub.new(@model, @params)
43
- end
44
-
45
- # Starts a intersection selection constraint on the selected sets. The
46
- # option :with may optionally be specified, in which case the value should
47
- # be an enumeration of the elements in the universe.
48
- def intersection(options = {})
49
- unless options.empty?
50
- unless options.size == 1 and options.has_key?(:with)
51
- raise ArgumentError, "Expected option key :with, got #{options.keys}."
52
- else
53
- universe = options[:with]
54
- unless universe.kind_of?(Enumerable) and
55
- universe.all?{ |element| element.kind_of? Fixnum }
56
- raise TypeError, "Expected the universe to be specified as " +
57
- "an enumeration of fixnum, got #{universe.class}."
58
- end
59
- @params.update(:universe => universe)
60
- end
61
- end
62
-
63
- IntersectionExpressionStub.new(@model, @params)
64
- end
65
-
66
- private
67
-
68
- # Produces an expression with position for the lhs module.
69
- def expression(params)
70
- SetAccessExpression.new(@model, @params.update(params))
71
- end
72
- end
73
-
74
- # Describes an expression that starts with an set variable enum followed with
75
- # an array access using a set variable followed by some form of must.
76
- class SetAccessExpression < Gecode::Constraints::Set::Expression #:nodoc:
77
- # Constrains the selected sets to be disjoint.
78
- def disjoint
79
- if @params[:negate]
80
- raise Gecode::MissingConstraintError, 'A negated set selection ' +
81
- 'disjoint is not implemented.'
82
- end
83
-
84
- @model.add_constraint DisjointConstraint.new(@model, @params)
85
- end
86
- end
87
-
88
- # Describes a CompositeStub for the set select constraint, which constrains
89
- # the set in a position specified by an integer variable in an enumeration of
90
- # set variable.
91
- #
92
- # == Examples
93
- #
94
- # # The set at the position described by the integer variable
95
- # # +singleton_zero_position+ in the enumeration +sets+ of set variables
96
- # # must equal [0].
97
- # sets[singleton_zero_position].must == 0
98
- #
99
- # # The set at the position described by the integer variable +position+ in
100
- # # the enumeration +sets+ of set variables must be a subset of +set+.
101
- # sets[position].must_be.subset_of set
102
- #
103
- # # The same as above, but reified with the boolean variable +bool+.
104
- # sets[position].must_be.subset_of(set, :reify => bool)
105
- class SelectExpressionStub < Gecode::Constraints::Set::CompositeStub
106
- def constrain_equal(variable, params, constrain)
107
- enum, index = @params.values_at(:lhs, :index)
108
- if constrain
109
- variable.must_be.subset_of enum.upper_bound_range
110
- end
111
-
112
- Gecode::Raw::selectSet(@model.active_space, enum.to_set_var_array,
113
- index.bind, variable.bind)
114
- end
115
- end
116
-
117
- # Describes a CompositeStub for the set union selection constraint,
118
- # which constrains the union of sets located at the positions
119
- # specified by a set variable in an enumeration of set variables.
120
- #
121
- # == Examples
122
- #
123
- # # The sets in the enumeration set variable +sets+ located at the positions
124
- # # described by the set variable +selected_sets+ must have a union that's
125
- # # a superset of [0,4,17].
126
- # sets[selected_sets].union.must_be.superset_of [0,4,17]
127
- #
128
- # # The sets in the enumeration set variable +sets+ located at the positions
129
- # # described by the set variable +selected_sets+ must have a union that's
130
- # # disjoint with the set variable +set+.
131
- # sets[selected_sets].union.must_be.disjoint_with set
132
- #
133
- # # The same as above but reified with the boolean variable
134
- # # +union_is_disjoint+.
135
- # sets[selected_sets].union.must_be.disjoint_with(set,
136
- # :reify => union_is_disjoin)
137
- class UnionExpressionStub < Gecode::Constraints::Set::CompositeStub
138
- def constrain_equal(variable, params, constrain)
139
- enum, indices = @params.values_at(:lhs, :indices)
140
- if constrain
141
- variable.must_be.subset_of enum.upper_bound_range
142
- end
143
-
144
- Gecode::Raw::selectUnion(@model.active_space, enum.to_set_var_array,
145
- indices.bind, variable.bind)
146
- end
147
- end
148
-
149
- # Describes a CompositeStub for the set intersection selection constraint,
150
- # which constrains the intersection of sets located at the positions
151
- # specified by a set variable in an enumeration of set variables.
152
- #
153
- # Optionally a universe may also be specified.
154
- #
155
- # == Examples
156
- #
157
- # # The sets in the enumeration set variable +sets+ located at the positions
158
- # # described by the set variable +selected_sets+ must have an intersection
159
- # # that's a superset of [0,4,17].
160
- # sets[selected_sets].intersection.must_be.superset_of [0,4,17]
161
- #
162
- # # The sets in the enumeration set variable +sets+ located at the positions
163
- # # described by the set variable +selected_sets+ must have an intersection
164
- # # that's disjoint with the set variable +set+.
165
- # sets[selected_sets].intersection.must_be.disjoint_with set
166
- #
167
- # # The sets in the enumeration set variable +sets+ located at the positions
168
- # # described by the set variable +selected_sets+ must have an intersection
169
- # # that's disjoint with the set variable +set+ inside the universe 0..17.
170
- # sets[selected_sets].intersection(:with => 0..17).must_be.disjoint_with set
171
- #
172
- # # The sets in the enumeration set variable +sets+ located at the positions
173
- # # described by the set variable +selected_sets+ must have an intersection
174
- # # that's disjoint with the set variable +set+ inside the universe
175
- # # described by the set variable +universe+.
176
- # sets[selected_sets].intersection(:with => universe).must_be.disjoint_with set
177
- #
178
- #
179
- # # The same as above but reified with the boolean variable
180
- # # +intersection_is_disjoint+.
181
- # sets[selected_sets].intersection(:with => universe).must_be.disjoint_with(
182
- # set, :reifty => intersection_is_disjoin)
183
- class IntersectionExpressionStub < Gecode::Constraints::Set::CompositeStub
184
- def constrain_equal(variable, params, constrain)
185
- enum, indices, universe = @params.values_at(:lhs, :indices, :universe)
186
- # We can't do any useful constraining here since the empty intersection
187
- # is the universe.
188
-
189
- if universe.nil?
190
- Gecode::Raw::selectInter(@model.active_space, enum.to_set_var_array,
191
- indices.bind, variable.bind)
192
- else
193
- Gecode::Raw::selectInterIn(@model.active_space, enum.to_set_var_array,
194
- indices.bind, variable.bind,
195
- Gecode::Constraints::Util.constant_set_to_int_set(universe))
196
- end
197
- end
198
- end
199
-
200
- # Describes a disjoint constraint, which constrains all set variable is an
201
- # enumeration, at the position specified by a set variable, to be disjoint.
202
- #
203
- # Does not support negation nor reification.
204
- #
205
- # == Examples
206
- #
207
- # # The set variable located in the enumeration +sets+ at positions
208
- # # described by +disjoint_set_positions+ must be disjoint.
209
- # sets[disjoint_set_positions].must_be.disjoint
210
- class DisjointConstraint < Gecode::Constraints::Constraint
211
- def post
212
- enum, indices = @params.values_at(:lhs, :indices)
213
- Gecode::Raw.selectDisjoint(@model.active_space, enum.to_set_var_array,
214
- indices.bind)
215
- end
216
- end
217
- end