gecoder-with-gecode 0.8.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +15 -0
- data/README +6 -2
- data/example/equation_system.rb +15 -0
- data/example/magic_sequence.rb +7 -7
- data/example/money.rb +36 -0
- data/example/queens.rb +7 -8
- data/example/send_most_money.rb +1 -1
- data/example/square_tiling.rb +2 -2
- data/example/sudoku-set.rb +11 -12
- data/example/sudoku.rb +40 -45
- data/ext/extconf.rb +0 -0
- data/ext/gecode-2.1.1/LICENSE +0 -0
- data/ext/gecode-2.1.1/configure +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/SDFVariableHeuristic.cc +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/SDFVariableHeuristic.hh +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/configure +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/extensivecomparator.cc +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/extensivecomparator.hh +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/heap.cc +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/implicative.cc +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/implicative.hh +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/myspace.cc +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/myspace.hh +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/qecore.cc +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/qecore.hh +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/warner.cc +0 -0
- data/ext/gecode-2.1.1/contribs/qecode/warner.hh +0 -0
- data/ext/gecode-2.1.1/gecode/cpltset/var-imp/cpltset.vis +0 -0
- data/ext/gecode-2.1.1/gecode/int/arithmetic/abs.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/arithmetic/max.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/arithmetic/mult.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/arithmetic/sqr.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/arithmetic/sqrt.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/array.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/array.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/bool/base.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/bool/eq.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/bool/eqv.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/bool/lq.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/bool/or.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/branch/select-val.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/branch/select-view.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/branch.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/branch.hh +0 -0
- data/ext/gecode-2.1.1/gecode/int/channel/base.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/channel/dom.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/channel/link-multi.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/channel/link-multi.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/channel/link-single.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/channel/link-single.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/channel/val.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/channel.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/channel.hh +0 -0
- data/ext/gecode-2.1.1/gecode/int/circuit/base.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/circuit/dom.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/circuit/val.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/circuit.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/circuit.hh +0 -0
- data/ext/gecode-2.1.1/gecode/int/count/int.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/count/rel.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/count/view.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/distinct/bilink.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/distinct/bnd.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/distinct/combptr.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/distinct/dom.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/distinct/edge.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/distinct/node.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/distinct/ter-dom.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/distinct/val.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/dom/range.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/dom/spec.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/dom.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/dom.hh +0 -0
- data/ext/gecode-2.1.1/gecode/int/element/int.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/element/view.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/element.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/element.hh +0 -0
- data/ext/gecode-2.1.1/gecode/int/exception.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/extensional/dfa.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/extensional/dfa.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/extensional/layered-graph.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/gcc/dom.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/gcc/gccbndsup.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/gcc/lbc.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/gcc/ubc.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/gcc.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/gcc.hh +0 -0
- data/ext/gecode-2.1.1/gecode/int/int-set.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/int-set.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/linear/bool-int.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/linear/bool-post.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/linear/bool-scale.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/linear/bool-view.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/linear/int-bin.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/linear/int-dom.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/linear/int-nary.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/linear/int-post.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/linear/int-ter.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/linear/post.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/propagator.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/rel/eq.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/rel/lex.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/rel/lq-le.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/rel/nq.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/unshare.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/var/bool.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/var-imp/bool.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/var-imp/bool.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/var-imp/bool.vis +0 -0
- data/ext/gecode-2.1.1/gecode/int/var-imp/delta.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/var-imp/int.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/var-imp/int.vis +0 -0
- data/ext/gecode-2.1.1/gecode/int/view/bool.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/view/constint.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/view/int.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/view/iter.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/view/minus.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/view/offset.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/view/print.cc +0 -0
- data/ext/gecode-2.1.1/gecode/int/view/rtest.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/view/scale.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/view/zero.icc +0 -0
- data/ext/gecode-2.1.1/gecode/int/view.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-add.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-append.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-array.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-cache.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-compl.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-diff.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-empty.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-inter.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-minmax.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-minus.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-offset.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-operations.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-scale.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-singleton-append.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-singleton.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-union.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/ranges-values.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/values-array.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/values-minus.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/values-offset.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/values-ranges.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/values-singleton.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter/values-unique.icc +0 -0
- data/ext/gecode-2.1.1/gecode/iter.hh +0 -0
- data/ext/gecode-2.1.1/gecode/kernel/advisor.icc +0 -0
- data/ext/gecode-2.1.1/gecode/kernel/array.icc +0 -0
- data/ext/gecode-2.1.1/gecode/kernel/branching.icc +0 -0
- data/ext/gecode-2.1.1/gecode/kernel/exception.icc +0 -0
- data/ext/gecode-2.1.1/gecode/kernel/macros.icc +0 -0
- data/ext/gecode-2.1.1/gecode/kernel/memory-manager.icc +0 -0
- data/ext/gecode-2.1.1/gecode/kernel/modevent.icc +0 -0
- data/ext/gecode-2.1.1/gecode/kernel/propagator.icc +0 -0
- data/ext/gecode-2.1.1/gecode/kernel/shared-array.icc +0 -0
- data/ext/gecode-2.1.1/gecode/kernel/var-traits.icc +0 -0
- data/ext/gecode-2.1.1/gecode/kernel/var.icc +0 -0
- data/ext/gecode-2.1.1/gecode/kernel/view.icc +0 -0
- data/ext/gecode-2.1.1/gecode/kernel.hh +0 -0
- data/ext/gecode-2.1.1/gecode/minimodel/arithmetic.cc +0 -0
- data/ext/gecode-2.1.1/gecode/minimodel/bool-expr.cc +0 -0
- data/ext/gecode-2.1.1/gecode/minimodel/bool-expr.icc +0 -0
- data/ext/gecode-2.1.1/gecode/minimodel/bool-rel.icc +0 -0
- data/ext/gecode-2.1.1/gecode/minimodel/lin-expr.icc +0 -0
- data/ext/gecode-2.1.1/gecode/minimodel/lin-rel.icc +0 -0
- data/ext/gecode-2.1.1/gecode/minimodel/reg.cc +0 -0
- data/ext/gecode-2.1.1/gecode/minimodel.hh +0 -0
- data/ext/gecode-2.1.1/gecode/search/bab.cc +0 -0
- data/ext/gecode-2.1.1/gecode/search/bab.icc +0 -0
- data/ext/gecode-2.1.1/gecode/search/dfs.cc +0 -0
- data/ext/gecode-2.1.1/gecode/search/dfs.icc +0 -0
- data/ext/gecode-2.1.1/gecode/search/engine-ctrl.icc +0 -0
- data/ext/gecode-2.1.1/gecode/search/lds.cc +0 -0
- data/ext/gecode-2.1.1/gecode/search/lds.icc +0 -0
- data/ext/gecode-2.1.1/gecode/search/options.cc +0 -0
- data/ext/gecode-2.1.1/gecode/search/options.icc +0 -0
- data/ext/gecode-2.1.1/gecode/search/reco-stack.icc +0 -0
- data/ext/gecode-2.1.1/gecode/search/restart.icc +0 -0
- data/ext/gecode-2.1.1/gecode/search/statistics.icc +0 -0
- data/ext/gecode-2.1.1/gecode/search/stop.cc +0 -0
- data/ext/gecode-2.1.1/gecode/search/stop.icc +0 -0
- data/ext/gecode-2.1.1/gecode/set/var-imp/set.vis +0 -0
- data/ext/gecode-2.1.1/gecode/support/block-allocator.icc +0 -0
- data/ext/gecode-2.1.1/gecode/support/cast.icc +0 -0
- data/ext/gecode-2.1.1/gecode/support/exception.cc +0 -0
- data/ext/gecode-2.1.1/gecode/support/exception.icc +0 -0
- data/ext/gecode-2.1.1/gecode/support/macros.icc +0 -0
- data/ext/gecode-2.1.1/gecode/support/marked-pointer.icc +0 -0
- data/ext/gecode-2.1.1/gecode/support/memory.icc +0 -0
- data/ext/gecode-2.1.1/gecode/support/sentinel-stack.icc +0 -0
- data/ext/gecode-2.1.1/gecode/support/static-stack.icc +0 -0
- data/ext/gecode-2.1.1/gecode/support/symbol.cc +0 -0
- data/ext/gecode-2.1.1/gecode/support.hh +0 -0
- data/ext/gecode-2.1.1/install-sh +0 -0
- data/ext/gecode-2.1.1/misc/debian/rules +0 -0
- data/ext/gecode-2.1.1/misc/doxygen/back.png +0 -0
- data/ext/gecode-2.1.1/misc/doxygen/gecode-logo-100.png +0 -0
- data/ext/gecode-2.1.1/misc/genchangelog.perl +0 -0
- data/ext/gecode-2.1.1/misc/genlicense.perl +0 -0
- data/ext/gecode-2.1.1/misc/genstatistics.perl +0 -0
- data/ext/gecode-2.1.1/misc/genvariables.perl +0 -0
- data/ext/gecode-2.1.1/misc/getrevision.perl +0 -0
- data/ext/gecode-2.1.1/misc/makedepend.perl +0 -0
- data/ext/gecode-2.1.1/misc/svn-ignore.txt +0 -0
- data/ext/gecode-2.1.1/variables.vsl +0 -0
- data/lib/gecoder/bindings/bindings.rb +16 -0
- data/lib/gecoder/bindings.rb +42 -0
- data/lib/gecoder/interface/branch.rb +16 -9
- data/lib/gecoder/interface/constraints/bool/boolean.rb +205 -213
- data/lib/gecoder/interface/constraints/bool/channel.rb +4 -5
- data/lib/gecoder/interface/constraints/bool/linear.rb +192 -21
- data/lib/gecoder/interface/constraints/bool_enum/channel.rb +43 -39
- data/lib/gecoder/interface/constraints/bool_enum/extensional.rb +43 -49
- data/lib/gecoder/interface/constraints/bool_enum/relation.rb +38 -71
- data/lib/gecoder/interface/constraints/bool_enum_constraints.rb +73 -22
- data/lib/gecoder/interface/constraints/bool_var_constraints.rb +140 -61
- data/lib/gecoder/interface/constraints/extensional_regexp.rb +4 -4
- data/lib/gecoder/interface/constraints/fixnum_enum/element.rb +63 -0
- data/lib/gecoder/interface/constraints/fixnum_enum/operation.rb +65 -0
- data/lib/gecoder/interface/constraints/fixnum_enum_constraints.rb +42 -0
- data/lib/gecoder/interface/constraints/int/arithmetic.rb +131 -130
- data/lib/gecoder/interface/constraints/int/channel.rb +21 -31
- data/lib/gecoder/interface/constraints/int/domain.rb +45 -42
- data/lib/gecoder/interface/constraints/int/linear.rb +85 -239
- data/lib/gecoder/interface/constraints/int/relation.rb +141 -0
- data/lib/gecoder/interface/constraints/int_enum/arithmetic.rb +55 -64
- data/lib/gecoder/interface/constraints/int_enum/channel.rb +35 -37
- data/lib/gecoder/interface/constraints/int_enum/count.rb +53 -78
- data/lib/gecoder/interface/constraints/int_enum/distinct.rb +36 -46
- data/lib/gecoder/interface/constraints/int_enum/element.rb +39 -57
- data/lib/gecoder/interface/constraints/int_enum/equality.rb +15 -19
- data/lib/gecoder/interface/constraints/int_enum/extensional.rb +65 -72
- data/lib/gecoder/interface/constraints/int_enum/sort.rb +42 -45
- data/lib/gecoder/interface/constraints/int_enum_constraints.rb +79 -22
- data/lib/gecoder/interface/constraints/int_var_constraints.rb +215 -44
- data/lib/gecoder/interface/constraints/reifiable_constraints.rb +14 -14
- data/lib/gecoder/interface/constraints/selected_set/select.rb +120 -0
- data/lib/gecoder/interface/constraints/selected_set_constraints.rb +75 -0
- data/lib/gecoder/interface/constraints/set/cardinality.rb +43 -53
- data/lib/gecoder/interface/constraints/set/channel.rb +26 -29
- data/lib/gecoder/interface/constraints/set/connection.rb +89 -152
- data/lib/gecoder/interface/constraints/set/domain.rb +112 -65
- data/lib/gecoder/interface/constraints/set/include.rb +36 -0
- data/lib/gecoder/interface/constraints/set/operation.rb +96 -110
- data/lib/gecoder/interface/constraints/set/relation.rb +114 -137
- data/lib/gecoder/interface/constraints/set_elements/relation.rb +116 -0
- data/lib/gecoder/interface/constraints/set_elements_constraints.rb +97 -0
- data/lib/gecoder/interface/constraints/set_enum/channel.rb +23 -27
- data/lib/gecoder/interface/constraints/set_enum/distinct.rb +18 -19
- data/lib/gecoder/interface/constraints/set_enum/operation.rb +62 -53
- data/lib/gecoder/interface/constraints/set_enum/select.rb +79 -0
- data/lib/gecoder/interface/constraints/set_enum_constraints.rb +73 -23
- data/lib/gecoder/interface/constraints/set_var_constraints.rb +222 -57
- data/lib/gecoder/interface/constraints.rb +410 -451
- data/lib/gecoder/interface/enum_matrix.rb +4 -4
- data/lib/gecoder/interface/enum_wrapper.rb +71 -22
- data/lib/gecoder/interface/model.rb +167 -12
- data/lib/gecoder/interface/model_sugar.rb +84 -0
- data/lib/gecoder/interface/search.rb +30 -18
- data/lib/gecoder/interface/variables.rb +103 -33
- data/lib/gecoder/interface.rb +2 -1
- data/lib/gecoder/version.rb +2 -2
- data/specs/bool_var.rb +19 -12
- data/specs/constraints/{boolean.rb → bool/boolean.rb} +103 -28
- data/specs/constraints/bool/boolean_properties.rb +51 -0
- data/specs/constraints/bool/linear.rb +213 -0
- data/specs/constraints/bool_enum/bool_enum_relation.rb +117 -0
- data/specs/constraints/bool_enum/channel.rb +102 -0
- data/specs/constraints/{extensional.rb → bool_enum/extensional.rb} +32 -101
- data/specs/constraints/constraint_helper.rb +149 -179
- data/specs/constraints/constraint_receivers.rb +103 -0
- data/specs/constraints/constraints.rb +6 -63
- data/specs/constraints/fixnum_enum/element.rb +58 -0
- data/specs/constraints/fixnum_enum/operation.rb +67 -0
- data/specs/constraints/int/arithmetic.rb +149 -0
- data/specs/constraints/int/channel.rb +101 -0
- data/specs/constraints/int/domain.rb +106 -0
- data/specs/constraints/int/linear.rb +183 -0
- data/specs/constraints/int/linear_properties.rb +97 -0
- data/specs/constraints/int/relation.rb +84 -0
- data/specs/constraints/int_enum/arithmetic.rb +72 -0
- data/specs/constraints/int_enum/channel.rb +57 -0
- data/specs/constraints/int_enum/count.rb +72 -0
- data/specs/constraints/int_enum/distinct.rb +80 -0
- data/specs/constraints/int_enum/element.rb +61 -0
- data/specs/constraints/int_enum/equality.rb +29 -0
- data/specs/constraints/int_enum/extensional.rb +224 -0
- data/specs/constraints/int_enum/sort.rb +167 -0
- data/specs/constraints/operands.rb +264 -0
- data/specs/constraints/property_helper.rb +443 -0
- data/specs/constraints/reification_sugar.rb +4 -5
- data/specs/constraints/selected_set/select.rb +56 -0
- data/specs/constraints/selected_set/select_properties.rb +157 -0
- data/specs/constraints/set/cardinality.rb +58 -0
- data/specs/constraints/set/cardinality_properties.rb +46 -0
- data/specs/constraints/set/channel.rb +77 -0
- data/specs/constraints/set/connection.rb +176 -0
- data/specs/constraints/set/domain.rb +197 -0
- data/specs/constraints/set/include.rb +36 -0
- data/specs/constraints/set/operation.rb +132 -0
- data/specs/constraints/set/relation.rb +117 -0
- data/specs/constraints/set_elements/relation.rb +84 -0
- data/specs/constraints/set_enum/channel.rb +80 -0
- data/specs/constraints/set_enum/distinct.rb +59 -0
- data/specs/constraints/set_enum/operation.rb +111 -0
- data/specs/constraints/set_enum/select.rb +73 -0
- data/specs/enum_wrapper.rb +53 -3
- data/specs/int_var.rb +44 -25
- data/specs/model.rb +58 -1
- data/specs/model_sugar.rb +30 -0
- data/specs/search.rb +24 -5
- data/specs/selected_set.rb +39 -0
- data/specs/set_elements.rb +34 -0
- data/specs/set_var.rb +22 -8
- data/specs/spec_helper.rb +206 -6
- data/tasks/distribution.rake +22 -7
- data/tasks/svn.rake +3 -1
- metadata +219 -135
- data/lib/gecoder/interface/constraints/set_enum/selection.rb +0 -217
- data/specs/constraints/arithmetic.rb +0 -351
- data/specs/constraints/bool_enum_relation.rb +0 -160
- data/specs/constraints/cardinality.rb +0 -157
- data/specs/constraints/channel.rb +0 -454
- data/specs/constraints/connection.rb +0 -369
- data/specs/constraints/count.rb +0 -146
- data/specs/constraints/distinct.rb +0 -164
- data/specs/constraints/element.rb +0 -108
- data/specs/constraints/equality.rb +0 -31
- data/specs/constraints/int_domain.rb +0 -70
- data/specs/constraints/int_relation.rb +0 -82
- data/specs/constraints/linear.rb +0 -340
- data/specs/constraints/selection.rb +0 -292
- data/specs/constraints/set_domain.rb +0 -185
- data/specs/constraints/set_operation.rb +0 -285
- data/specs/constraints/set_relation.rb +0 -197
- data/specs/constraints/sort.rb +0 -179
data/specs/spec_helper.rb
CHANGED
|
@@ -5,16 +5,25 @@ require File.dirname(__FILE__) + '/../lib/gecoder'
|
|
|
5
5
|
module CustomVarMatchers
|
|
6
6
|
class HaveDomain
|
|
7
7
|
def initialize(expected)
|
|
8
|
-
@expected = expected
|
|
8
|
+
@expected = expected
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def matches?(target)
|
|
12
12
|
@target = target
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
if @expected.kind_of? Range
|
|
14
|
+
last = @expected.end
|
|
15
|
+
last -= 1 if @expected.exclude_end?
|
|
16
|
+
return @target.range? && @expected.begin == @target.min &&
|
|
17
|
+
last == @target.max
|
|
18
|
+
else
|
|
19
|
+
@expected = @expected.to_a
|
|
20
|
+
return false unless @target.size == @expected.size
|
|
21
|
+
@expected.each do |element|
|
|
22
|
+
return false unless @target.include? element
|
|
23
|
+
end
|
|
24
|
+
return true
|
|
16
25
|
end
|
|
17
|
-
return
|
|
26
|
+
return false
|
|
18
27
|
end
|
|
19
28
|
|
|
20
29
|
def failure_message
|
|
@@ -39,7 +48,9 @@ module CustomVarMatchers
|
|
|
39
48
|
|
|
40
49
|
def matches?(target)
|
|
41
50
|
@target = target
|
|
42
|
-
return @target.lower_bound.
|
|
51
|
+
return @target.lower_bound.size == @expected_glb.size &&
|
|
52
|
+
@target.upper_bound.size == @expected_lub.size &&
|
|
53
|
+
@target.lower_bound.to_a == @expected_glb &&
|
|
43
54
|
@target.upper_bound.to_a == @expected_lub
|
|
44
55
|
end
|
|
45
56
|
|
|
@@ -63,3 +74,192 @@ end
|
|
|
63
74
|
Spec::Runner.configure do |config|
|
|
64
75
|
config.include(CustomVarMatchers)
|
|
65
76
|
end
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
# Help methods for the GecodeR specs.
|
|
80
|
+
module GecodeR::Specs
|
|
81
|
+
module SetHelper
|
|
82
|
+
module_function
|
|
83
|
+
|
|
84
|
+
# Returns the arguments that should be used in a partial mock to expect the
|
|
85
|
+
# specified constant set (possibly an array of arguments).
|
|
86
|
+
def expect_constant_set(constant_set)
|
|
87
|
+
if constant_set.kind_of? Range
|
|
88
|
+
return constant_set.first, constant_set.last
|
|
89
|
+
elsif constant_set.kind_of? Fixnum
|
|
90
|
+
constant_set
|
|
91
|
+
else
|
|
92
|
+
an_instance_of(Gecode::Raw::IntSet)
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
module GeneralHelper
|
|
98
|
+
module_function
|
|
99
|
+
|
|
100
|
+
# Produces a base operand that can be used to mock specific types of
|
|
101
|
+
# operands.
|
|
102
|
+
def general_operand_base(model)
|
|
103
|
+
mock_op_class = Class.new
|
|
104
|
+
mock_op_class.class_eval do
|
|
105
|
+
attr :model
|
|
106
|
+
|
|
107
|
+
def bind
|
|
108
|
+
raise 'Bind should not be called directly for an operand.'
|
|
109
|
+
end
|
|
110
|
+
alias_method :bind_array, :bind
|
|
111
|
+
end
|
|
112
|
+
op = mock_op_class.new
|
|
113
|
+
op.instance_eval do
|
|
114
|
+
@model = model
|
|
115
|
+
end
|
|
116
|
+
return op
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Produces a general int operand. The method returns two objects:
|
|
120
|
+
# the operand itself and the variable it returns when #to_int_var
|
|
121
|
+
# is called.
|
|
122
|
+
def general_int_operand(model)
|
|
123
|
+
op = general_operand_base(model)
|
|
124
|
+
|
|
125
|
+
int_var = model.int_var
|
|
126
|
+
class <<op
|
|
127
|
+
include Gecode::Int::IntOperand
|
|
128
|
+
attr :model
|
|
129
|
+
end
|
|
130
|
+
op.stub!(:to_int_var).and_return int_var
|
|
131
|
+
|
|
132
|
+
return op, int_var
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Produces a general bool operand. The method returns two objects:
|
|
136
|
+
# the operand itself and the variable it returns when #to_bool_var
|
|
137
|
+
# is called.
|
|
138
|
+
def general_bool_operand(model)
|
|
139
|
+
op = general_operand_base(model)
|
|
140
|
+
|
|
141
|
+
bool_var = model.bool_var
|
|
142
|
+
class <<op
|
|
143
|
+
include Gecode::Bool::BoolOperand
|
|
144
|
+
attr :model
|
|
145
|
+
end
|
|
146
|
+
op.stub!(:to_bool_var).and_return bool_var
|
|
147
|
+
|
|
148
|
+
return op, bool_var
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Produces a general set operand. The method returns two objects:
|
|
152
|
+
# the operand itself and the variable it returns when #to_set_var
|
|
153
|
+
# is called.
|
|
154
|
+
def general_set_operand(model)
|
|
155
|
+
op = general_operand_base(model)
|
|
156
|
+
|
|
157
|
+
set_var = model.set_var
|
|
158
|
+
class <<op
|
|
159
|
+
include Gecode::Set::SetOperand
|
|
160
|
+
attr :model
|
|
161
|
+
end
|
|
162
|
+
op.stub!(:to_set_var).and_return set_var
|
|
163
|
+
|
|
164
|
+
return op, set_var
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Produces a general int enum operand. The method returns two objects:
|
|
168
|
+
# the operand itself and the variable it returns when #to_int_enum
|
|
169
|
+
# is called.
|
|
170
|
+
def general_int_enum_operand(model)
|
|
171
|
+
op = general_operand_base(model)
|
|
172
|
+
|
|
173
|
+
int_enum = model.int_var_array(5)
|
|
174
|
+
class <<op
|
|
175
|
+
include Gecode::IntEnum::IntEnumOperand
|
|
176
|
+
attr :model
|
|
177
|
+
end
|
|
178
|
+
op.stub!(:to_int_enum).and_return int_enum
|
|
179
|
+
|
|
180
|
+
return op, int_enum
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Produces a general bool enum operand. The method returns two objects:
|
|
184
|
+
# the operand itself and the variable it returns when #to_bool_enum
|
|
185
|
+
# is called.
|
|
186
|
+
def general_bool_enum_operand(model)
|
|
187
|
+
op = general_operand_base(model)
|
|
188
|
+
|
|
189
|
+
bool_enum = model.bool_var_array(5)
|
|
190
|
+
class <<op
|
|
191
|
+
include Gecode::BoolEnum::BoolEnumOperand
|
|
192
|
+
attr :model
|
|
193
|
+
end
|
|
194
|
+
op.stub!(:to_bool_enum).and_return bool_enum
|
|
195
|
+
|
|
196
|
+
return op, bool_enum
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Produces a general set enum operand. The method returns two objects:
|
|
200
|
+
# the operand itself and the variable it returns when #to_set_enum
|
|
201
|
+
# is called.
|
|
202
|
+
def general_set_enum_operand(model)
|
|
203
|
+
op = general_operand_base(model)
|
|
204
|
+
|
|
205
|
+
set_enum = model.set_var_array(5)
|
|
206
|
+
class <<op
|
|
207
|
+
include Gecode::SetEnum::SetEnumOperand
|
|
208
|
+
attr :model
|
|
209
|
+
end
|
|
210
|
+
op.stub!(:to_set_enum).and_return set_enum
|
|
211
|
+
|
|
212
|
+
return op, set_enum
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Produces a general selected set operand. The method returns two objects:
|
|
216
|
+
# the operand itself and the array of variables corresponding to the
|
|
217
|
+
# operands it returns when # #to_selected_set is called.
|
|
218
|
+
def general_selected_set_operand(model)
|
|
219
|
+
set_enum, set_enum_var = general_set_enum_operand(model)
|
|
220
|
+
set, set_var = general_set_operand(model)
|
|
221
|
+
op = Gecode::SelectedSet::SelectedSetOperand.new(
|
|
222
|
+
set_enum, set)
|
|
223
|
+
return op, [set_enum_var, set_var]
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Produces a general set elements operand. The method returns two
|
|
227
|
+
# objects: the operand itself and the set var corresponding to the
|
|
228
|
+
# operands it returns when # #to_selected_set is called.
|
|
229
|
+
def general_set_elements_operand(model)
|
|
230
|
+
set, set_var = general_set_operand(model)
|
|
231
|
+
op = Gecode::SetElements::SetElementsOperand.new(set)
|
|
232
|
+
return op, set_var
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Produces a general fixnum enum operand. The method returns two objects:
|
|
236
|
+
# the operand itself and the variable it returns when #to_fixnum_enum
|
|
237
|
+
# is called.
|
|
238
|
+
def general_fixnum_enum_operand(model)
|
|
239
|
+
op = general_operand_base(model)
|
|
240
|
+
|
|
241
|
+
fixnum_enum = model.wrap_enum([1, -4, 9, 4, 0])
|
|
242
|
+
class <<op
|
|
243
|
+
include Gecode::FixnumEnum::FixnumEnumOperand
|
|
244
|
+
attr :model
|
|
245
|
+
end
|
|
246
|
+
op.stub!(:to_fixnum_enum).and_return fixnum_enum
|
|
247
|
+
|
|
248
|
+
return op, fixnum_enum
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Produces an array of general operands of the specified types.
|
|
252
|
+
# Returns an array of operands and an array of their variables.
|
|
253
|
+
def produce_general_arguments(property_types)
|
|
254
|
+
operands = []
|
|
255
|
+
variables = []
|
|
256
|
+
property_types.each do |type|
|
|
257
|
+
op, var = eval "general_#{type}_operand(@model)"
|
|
258
|
+
operands << op
|
|
259
|
+
variables << var
|
|
260
|
+
end
|
|
261
|
+
return operands, variables
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
end
|
|
265
|
+
include GecodeR::Specs::GeneralHelper
|
data/tasks/distribution.rake
CHANGED
|
@@ -12,8 +12,10 @@ EXT_DIR = 'ext'
|
|
|
12
12
|
desc 'Generate RDoc'
|
|
13
13
|
rd = Rake::RDocTask.new do |rdoc|
|
|
14
14
|
rdoc.rdoc_dir = 'doc/output/rdoc'
|
|
15
|
-
rdoc.
|
|
16
|
-
|
|
15
|
+
rdoc.title = 'Gecode/R'
|
|
16
|
+
rdoc.template = 'doc/rdoc/jamis.rb'
|
|
17
|
+
rdoc.options << '--line-numbers' << '--inline-source' <<
|
|
18
|
+
'--accessor' << 'delegate' << '--main' << 'README'
|
|
17
19
|
rdoc.rdoc_files.include('README', 'CHANGES', 'LGPL-LICENSE', 'lib/**/*.rb')
|
|
18
20
|
end
|
|
19
21
|
|
|
@@ -32,7 +34,7 @@ task :prepare_rdoc_dev do
|
|
|
32
34
|
# Copy the rdoc and remove all #:nodoc: .
|
|
33
35
|
Dir['lib/**/*.rb'].each do |source_name|
|
|
34
36
|
destination_name = source_name.sub('lib', TMP_DIR)
|
|
35
|
-
|
|
37
|
+
FileUtils.makedirs File.dirname(destination_name)
|
|
36
38
|
destination = File.open(destination_name, 'w')
|
|
37
39
|
File.open(source_name) do |source|
|
|
38
40
|
source.each{ |line| destination << line.gsub('#:nodoc:', '' ) }
|
|
@@ -72,11 +74,24 @@ spec = Gem::Specification.new do |s|
|
|
|
72
74
|
s.extra_rdoc_files = rd.rdoc_files
|
|
73
75
|
s.test_files = FileList['specs/**/*.rb']
|
|
74
76
|
|
|
75
|
-
s.
|
|
76
|
-
s.author = ["Gecode/R Development Team"]
|
|
77
|
+
s.authors = ["Gecode/R Development Team"]
|
|
77
78
|
s.email = "gecoder-users@rubyforge.org"
|
|
78
79
|
s.homepage = "http://gecoder.rubyforge.org"
|
|
79
80
|
s.rubyforge_project = "gecoder"
|
|
81
|
+
|
|
82
|
+
=begin
|
|
83
|
+
# Development dependencies.
|
|
84
|
+
# Not listed: rubygems >= 1.2
|
|
85
|
+
[['rake'],
|
|
86
|
+
['webgen', '= 0.4.7'],
|
|
87
|
+
['coderay'],
|
|
88
|
+
['rspec', '>= 1.0'],
|
|
89
|
+
['rcov'],
|
|
90
|
+
['meta_project'],
|
|
91
|
+
['rubyforge']].each do |dependency|
|
|
92
|
+
s.add_development_dependency(*dependency)
|
|
93
|
+
end
|
|
94
|
+
=end
|
|
80
95
|
end
|
|
81
96
|
|
|
82
97
|
# Create a clone of the gem spec with the precompiled binaries for Windows.
|
|
@@ -88,7 +103,7 @@ spec_windows_binary_with_gecode.requirements = []
|
|
|
88
103
|
spec_windows_binary_with_gecode.files = spec.files.dup -
|
|
89
104
|
FileList['ext/**/*'].to_a +
|
|
90
105
|
FileList['vendor/gecode/win32/lib/*'].to_a << 'lib/gecode.dll'
|
|
91
|
-
spec_windows_binary_with_gecode.platform = Gem::Platform::WIN32
|
|
106
|
+
spec_windows_binary_with_gecode.platform = 'mswin32' #Gem::Platform::WIN32
|
|
92
107
|
|
|
93
108
|
# Create a clone of the gem spec that includes Gecode.
|
|
94
109
|
spec_with_gecode = spec.dup
|
|
@@ -162,7 +177,7 @@ gecode_release_files = [
|
|
|
162
177
|
"pkg/#{PKG_FILE_NAME_WITH_GECODE}.gem",
|
|
163
178
|
#"pkg/#{PKG_FILE_NAME_WITH_GECODE}.tgz",
|
|
164
179
|
#"pkg/#{PKG_FILE_NAME_WITH_GECODE}.zip",
|
|
165
|
-
"pkg/#{PKG_FILE_NAME_WITH_GECODE}-mswin32.gem"
|
|
180
|
+
"pkg/#{PKG_FILE_NAME_WITH_GECODE}-x86-mswin32.gem"
|
|
166
181
|
]
|
|
167
182
|
desc 'Publish Gecode/R with Gecode packages on RubyForge'
|
|
168
183
|
task :publish_gecoder_with_gecode_packages =>
|
data/tasks/svn.rake
CHANGED
|
@@ -3,7 +3,9 @@ require 'lib/gecoder/version'
|
|
|
3
3
|
desc "Tag the release in svn"
|
|
4
4
|
task :tag do
|
|
5
5
|
base_url = `svn info`.match(/Repository Root: (.*)/n)[1]
|
|
6
|
-
base_url.
|
|
6
|
+
unless base_url.include? ENV['RUBYFORGE_USER']
|
|
7
|
+
base_url.gsub!('rubyforge', "#{ENV['RUBYFORGE_USER']}@rubyforge")
|
|
8
|
+
end
|
|
7
9
|
from = base_url + '/trunk'
|
|
8
10
|
to = base_url + "/tags/gecoder-#{GecodeR::VERSION}"
|
|
9
11
|
options = "-m \"Tag release Gecode/R #{GecodeR::VERSION}\""
|