gecoder-with-gecode 0.9.0-x86-mswin32-60 → 0.9.1-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. data/CHANGES +6 -0
  2. data/README +1 -1
  3. data/THANKS +18 -0
  4. data/example/equation_system.rb +3 -1
  5. data/example/magic_sequence.rb +3 -1
  6. data/example/queens.rb +3 -1
  7. data/example/send_more_money.rb +24 -30
  8. data/example/send_most_money.rb +15 -26
  9. data/example/square_tiling.rb +3 -1
  10. data/example/sudoku-set.rb +3 -1
  11. data/lib/gecode.dll +0 -0
  12. data/lib/gecoder/bindings.rb +7 -5
  13. data/lib/gecoder/bindings/bindings.rb +8 -8
  14. data/lib/gecoder/interface.rb +4 -2
  15. data/lib/gecoder/interface/binding_changes.rb +1 -1
  16. data/lib/gecoder/interface/branch.rb +1 -1
  17. data/lib/gecoder/interface/constraints/bool_enum_constraints.rb +4 -4
  18. data/lib/gecoder/interface/constraints/bool_var_constraints.rb +2 -2
  19. data/lib/gecoder/interface/constraints/extensional_regexp.rb +1 -1
  20. data/lib/gecoder/interface/constraints/fixnum_enum_constraints.rb +2 -2
  21. data/lib/gecoder/interface/constraints/int_enum/extensional.rb +5 -5
  22. data/lib/gecoder/interface/constraints/int_enum_constraints.rb +4 -4
  23. data/lib/gecoder/interface/constraints/int_var_constraints.rb +2 -2
  24. data/lib/gecoder/interface/constraints/selected_set/select.rb +8 -8
  25. data/lib/gecoder/interface/constraints/set_enum/{select.rb → element.rb} +10 -10
  26. data/lib/gecoder/interface/constraints/set_enum_constraints.rb +5 -5
  27. data/lib/gecoder/interface/constraints/set_var_constraints.rb +2 -2
  28. data/lib/gecoder/interface/{model_sugar.rb → convenience.rb} +19 -4
  29. data/lib/gecoder/interface/enum_wrapper.rb +1 -1
  30. data/lib/gecoder/interface/{model.rb → mixin.rb} +93 -60
  31. data/lib/gecoder/interface/search.rb +23 -22
  32. data/lib/gecoder/version.rb +1 -1
  33. data/specs/branch.rb +5 -3
  34. data/specs/constraints/bool/boolean.rb +3 -1
  35. data/specs/constraints/bool/linear.rb +3 -1
  36. data/specs/constraints/bool_enum/bool_enum_relation.rb +3 -1
  37. data/specs/constraints/bool_enum/channel.rb +3 -1
  38. data/specs/constraints/fixnum_enum/element.rb +3 -1
  39. data/specs/constraints/int/arithmetic.rb +3 -1
  40. data/specs/constraints/int/channel.rb +3 -1
  41. data/specs/constraints/int/linear.rb +3 -1
  42. data/specs/constraints/int/linear_properties.rb +3 -1
  43. data/specs/constraints/int_enum/arithmetic.rb +3 -1
  44. data/specs/constraints/int_enum/channel.rb +3 -1
  45. data/specs/constraints/int_enum/count.rb +3 -1
  46. data/specs/constraints/int_enum/distinct.rb +3 -1
  47. data/specs/constraints/int_enum/element.rb +3 -1
  48. data/specs/constraints/int_enum/sort.rb +3 -1
  49. data/specs/constraints/property_helper.rb +10 -10
  50. data/specs/constraints/reification_sugar.rb +3 -1
  51. data/specs/constraints/selected_set/select.rb +6 -5
  52. data/specs/constraints/selected_set/select_properties.rb +12 -10
  53. data/specs/constraints/set/channel.rb +3 -1
  54. data/specs/constraints/set/domain.rb +4 -4
  55. data/specs/constraints/set/relation.rb +4 -4
  56. data/specs/constraints/set_enum/channel.rb +3 -1
  57. data/specs/constraints/set_enum/distinct.rb +3 -1
  58. data/specs/constraints/set_enum/{select.rb → element.rb} +13 -9
  59. data/specs/enum_wrapper.rb +1 -1
  60. data/specs/mixin.rb +78 -0
  61. data/specs/model.rb +5 -5
  62. data/specs/search.rb +20 -14
  63. data/specs/selected_set.rb +3 -3
  64. data/specs/set_elements.rb +2 -2
  65. data/tasks/distribution.rake +25 -4
  66. data/vendor/gecode/win32/lib/{libgecodeint.dll → libWindowsgecodeintWindows.dll} +0 -0
  67. data/vendor/gecode/win32/lib/{libgecodekernel.dll → libWindowsgecodekernelWindows.dll} +0 -0
  68. data/vendor/gecode/win32/lib/{libgecodeminimodel.dll → libWindowsgecodeminimodelWindows.dll} +0 -0
  69. data/vendor/gecode/win32/lib/{libgecodesearch.dll → libWindowsgecodesearchWindows.dll} +0 -0
  70. data/vendor/gecode/win32/lib/{libgecodeset.dll → libWindowsgecodesetWindows.dll} +0 -0
  71. data/vendor/gecode/win32/lib/{libgecodesupport.dll → libWindowsgecodesupportWindows.dll} +0 -0
  72. metadata +20 -17
  73. data/example/money.rb +0 -36
@@ -7,14 +7,14 @@ module Gecode
7
7
  end
8
8
  end
9
9
 
10
- class Model
10
+ module Mixin
11
11
  # Finds the first solution to the modelled problem and updates the variables
12
12
  # to that solution. The found solution is also returned. Raises
13
13
  # Gecode::NoSolutionError if no solution can be found.
14
14
  def solve!
15
15
  dfs = dfs_engine
16
16
  space = dfs.next
17
- @statistics = dfs.statistics
17
+ @gecoder_mixin_statistics = dfs.statistics
18
18
  raise Gecode::NoSolutionError if space.nil?
19
19
  self.active_space = space
20
20
  return self
@@ -24,7 +24,7 @@ module Gecode
24
24
  # propagation might have been performed). Returns the reset model.
25
25
  def reset!
26
26
  self.active_space = base_space
27
- @statistics = nil
27
+ @gecoder_mixin_statistics = nil
28
28
  return self
29
29
  end
30
30
 
@@ -48,7 +48,7 @@ module Gecode
48
48
  next_solution = nil
49
49
  while not (next_solution = dfs.next).nil?
50
50
  self.active_space = next_solution
51
- @statistics = dfs.statistics
51
+ @gecoder_mixin_statistics = dfs.statistics
52
52
  yield self
53
53
  end
54
54
  self.reset!
@@ -64,26 +64,27 @@ module Gecode
64
64
  # [:commits] The number of commit operations performed.
65
65
  # [:memory] The peak memory allocated to Gecode.
66
66
  def search_stats
67
- return nil if @statistics.nil?
67
+ return nil if @gecoder_mixin_statistics.nil?
68
68
 
69
69
  return {
70
- :propagations => @statistics.propagate,
71
- :failures => @statistics.fail,
72
- :clones => @statistics.clone,
73
- :commits => @statistics.commit,
74
- :memory => @statistics.memory
70
+ :propagations => @gecoder_mixin_statistics.propagate,
71
+ :failures => @gecoder_mixin_statistics.fail,
72
+ :clones => @gecoder_mixin_statistics.clone,
73
+ :commits => @gecoder_mixin_statistics.commit,
74
+ :memory => @gecoder_mixin_statistics.memory
75
75
  }
76
76
  end
77
77
 
78
- # Finds the optimal solution. Optimality is defined by the provided block
79
- # which is given one parameter, a solution to the problem. The block should
80
- # constrain the solution so that that only "better" solutions can be new
81
- # solutions. For instance if one wants to optimize a variable named price
82
- # (accessible from the model) to be as low as possible then one should write
83
- # the following.
78
+ # Finds the optimal solution. Optimality is defined by the provided
79
+ # block which is given two parameters, the model and the best
80
+ # solution found so far to the problem. The block should constrain
81
+ # the model so that that only "better" solutions can be new
82
+ # solutions. For instance if one wants to optimize a variable named
83
+ # price (accessible from the model) to be as low as possible then
84
+ # one should write the following.
84
85
  #
85
86
  # model.optimize! do |model, best_so_far|
86
- # model.price.must < best_so_far.price.val
87
+ # model.price.must < best_so_far.price.value
87
88
  # end
88
89
  #
89
90
  # Raises Gecode::NoSolutionError if no solution can be found.
@@ -92,12 +93,12 @@ module Gecode
92
93
  perform_queued_gecode_interactions
93
94
 
94
95
  # Set the method used for constrain calls by the BAB-search.
95
- Model.constrain_proc = lambda do |home_space, best_space|
96
+ Mixin.constrain_proc = lambda do |home_space, best_space|
96
97
  self.active_space = best_space
97
- @variable_creation_space = home_space
98
+ @gecoder_mixin_variable_creation_space = home_space
98
99
  yield(self, self)
99
100
  self.active_space = home_space
100
- @variable_creation_space = nil
101
+ @gecoder_mixin_variable_creation_space = nil
101
102
 
102
103
  perform_queued_gecode_interactions
103
104
  end
@@ -114,10 +115,10 @@ module Gecode
114
115
  until (previous_solution = bab.next).nil?
115
116
  result = previous_solution
116
117
  end
117
- @statistics = bab.statistics
118
+ @gecoder_mixin_statistics = bab.statistics
118
119
 
119
120
  # Reset the method used constrain calls and return the result.
120
- Model.constrain_proc = nil
121
+ Mixin.constrain_proc = nil
121
122
  raise Gecode::NoSolutionError if result.nil?
122
123
 
123
124
  # Switch to the result.
@@ -1,4 +1,4 @@
1
1
  module GecodeR #:nodoc:
2
2
  # A string representation of the Gecode/R version.
3
- VERSION = '0.9.0'
3
+ VERSION = '0.9.1'
4
4
  end
data/specs/branch.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/spec_helper'
2
2
 
3
- class BranchSampleProblem < Gecode::Model
3
+ class BranchSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :vars
5
7
  attr :bools
6
8
  attr :sets
@@ -12,7 +14,7 @@ class BranchSampleProblem < Gecode::Model
12
14
  end
13
15
  end
14
16
 
15
- describe Gecode::Model, ' (integer branch)' do
17
+ describe Gecode::Mixin, ' (integer branch)' do
16
18
  before do
17
19
  @model = BranchSampleProblem.new
18
20
  @vars = @model.vars
@@ -112,7 +114,7 @@ describe Gecode::Model, ' (integer branch)' do
112
114
  end
113
115
  end
114
116
 
115
- describe Gecode::Model, ' (set branch)' do
117
+ describe Gecode::Mixin, ' (set branch)' do
116
118
  before do
117
119
  @model = BranchSampleProblem.new
118
120
  @sets = @model.sets
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../constraint_helper'
2
2
 
3
- class BoolSampleProblem < Gecode::Model
3
+ class BoolSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :b1
5
7
  attr :b2
6
8
  attr :b3
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../constraint_helper'
2
2
 
3
- class BoolLinearSampleProblem < Gecode::Model
3
+ class BoolLinearSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :x
5
7
  attr :y
6
8
  attr :z
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../property_helper'
2
2
 
3
- class BoolEnumSampleProblem < Gecode::Model
3
+ class BoolEnumSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :bools
5
7
  attr :b1
6
8
  attr :b2
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../constraint_helper'
2
2
 
3
- class BoolChannelSampleProblem < Gecode::Model
3
+ class BoolChannelSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :bool_enum
5
7
  attr :bool
6
8
  attr :int
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../property_helper'
2
2
 
3
- class FixnumElementSampleProblem < Gecode::Model
3
+ class FixnumElementSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :prices
5
7
  attr :store
6
8
  attr :price
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../property_helper'
2
2
 
3
- class ArithmeticSampleProblem < Gecode::Model
3
+ class ArithmeticSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :var
5
7
  attr :var2
6
8
 
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../constraint_helper'
2
2
 
3
- class BoolChannelSampleProblem < Gecode::Model
3
+ class BoolChannelSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :bool_enum
5
7
  attr :bool
6
8
  attr :int
@@ -3,7 +3,9 @@ require File.dirname(__FILE__) + '/../constraint_helper'
3
3
  # This is neither an operand or a constraint spec. It is mostly a sanity
4
4
  # check.
5
5
 
6
- class LinearSampleProblem < Gecode::Model
6
+ class LinearSampleProblem
7
+ include Gecode::Mixin
8
+
7
9
  attr :x
8
10
  attr :y
9
11
  attr :z
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../property_helper'
2
2
 
3
- class LinearPropertySampleProblem < Gecode::Model
3
+ class LinearPropertySampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :x
5
7
  attr :y
6
8
  attr :z
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../property_helper'
2
2
 
3
- class IntEnumArithmeticSampleProblem < Gecode::Model
3
+ class IntEnumArithmeticSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :numbers
5
7
  attr :var
6
8
 
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../constraint_helper'
2
2
 
3
- class ChannelSampleProblem < Gecode::Model
3
+ class ChannelSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :elements
5
7
  attr :positions
6
8
  attr :sets
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../property_helper'
2
2
 
3
- class CountSampleProblem < Gecode::Model
3
+ class CountSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :list
5
7
  attr :element
6
8
  attr :target
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../constraint_helper'
2
2
 
3
- class DistinctSampleProblem < Gecode::Model
3
+ class DistinctSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  def initialize
5
7
  vars_is_an int_var_array(2, 0..1)
6
8
  branch_on vars
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../property_helper'
2
2
 
3
- class ElementSampleProblem < Gecode::Model
3
+ class ElementSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :prices
5
7
  attr :store
6
8
  attr :price
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../constraint_helper'
2
2
 
3
- class SortSampleProblem < Gecode::Model
3
+ class SortSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :vars
5
7
  attr :sorted
6
8
  attr :indices
@@ -30,14 +30,14 @@ require File.dirname(__FILE__) + '/../spec_helper'
30
30
  # Requires @operand and @model.
31
31
  describe 'int var operand', :shared => true do
32
32
  it 'should implement #model' do
33
- @operand.model.should be_kind_of(Gecode::Model)
33
+ @operand.model.should be_kind_of(Gecode::Mixin)
34
34
  end
35
35
 
36
36
  it 'should implement #to_int_var' do
37
37
  int_var = @operand.to_int_var
38
38
  int_var.should be_kind_of(Gecode::IntVar)
39
39
  @model.solve!
40
- (int_var.min..int_var.max).should_not equal(Gecode::Model::LARGEST_INT_DOMAIN)
40
+ (int_var.min..int_var.max).should_not equal(Gecode::Mixin::LARGEST_INT_DOMAIN)
41
41
  end
42
42
 
43
43
  it 'should implement #must' do
@@ -50,7 +50,7 @@ end
50
50
  # Requires @operand and @model.
51
51
  describe 'bool var operand', :shared => true do
52
52
  it 'should implement #model' do
53
- @operand.model.should be_kind_of(Gecode::Model)
53
+ @operand.model.should be_kind_of(Gecode::Mixin)
54
54
  end
55
55
 
56
56
  it 'should implement #to_bool_var' do
@@ -68,7 +68,7 @@ end
68
68
  # Requires @operand and @model.
69
69
  describe 'set var operand', :shared => true do
70
70
  it 'should implement #model' do
71
- @operand.model.should be_kind_of(Gecode::Model)
71
+ @operand.model.should be_kind_of(Gecode::Mixin)
72
72
  end
73
73
 
74
74
  it 'should implement #to_set_var' do
@@ -76,7 +76,7 @@ describe 'set var operand', :shared => true do
76
76
  set_var.should be_kind_of(Gecode::SetVar)
77
77
  @model.solve!
78
78
  ((set_var.lower_bound == []) &&
79
- (set_var.upper_bound == Gecode::Model::LARGEST_SET_BOUND)).should_not(
79
+ (set_var.upper_bound == Gecode::Mixin::LARGEST_SET_BOUND)).should_not(
80
80
  be_true)
81
81
  end
82
82
 
@@ -108,7 +108,7 @@ describe 'property that produces int operand', :shared => true do
108
108
  operand = @select_property.call(*operands)
109
109
 
110
110
  # Test the same invariants as in the test for int var operands.
111
- operand.model.should be_kind_of(Gecode::Model)
111
+ operand.model.should be_kind_of(Gecode::Mixin)
112
112
 
113
113
  int_var = operand.to_int_var
114
114
  int_var.should be_kind_of(Gecode::IntVar)
@@ -128,7 +128,7 @@ describe 'property that produces bool operand', :shared => true do
128
128
  operand = @select_property.call(*operands)
129
129
 
130
130
  # Test the same invariants as in the test for bool var operands.
131
- operand.model.should be_kind_of(Gecode::Model)
131
+ operand.model.should be_kind_of(Gecode::Mixin)
132
132
 
133
133
  bool_var = operand.to_bool_var
134
134
  bool_var.should be_kind_of(Gecode::BoolVar)
@@ -148,7 +148,7 @@ describe 'property that produces set operand', :shared => true do
148
148
  operand = @select_property.call(*operands)
149
149
 
150
150
  # Test the same invariants as in the test for int var operands.
151
- operand.model.should be_kind_of(Gecode::Model)
151
+ operand.model.should be_kind_of(Gecode::Mixin)
152
152
 
153
153
  set_var = operand.to_set_var
154
154
  set_var.should be_kind_of(Gecode::SetVar)
@@ -178,7 +178,7 @@ describe 'property that produces int operand by short circuiting equality', :sha
178
178
  @selected_property.must == indirect_int_op
179
179
  @model.solve!
180
180
 
181
- direct_int_var.should_not have_domain(Gecode::Model::LARGEST_INT_DOMAIN)
181
+ direct_int_var.should_not have_domain(Gecode::Mixin::LARGEST_INT_DOMAIN)
182
182
  direct_int_var.should have_domain(indirect_int_op.domain)
183
183
  end
184
184
 
@@ -282,7 +282,7 @@ describe 'property that produces int operand by short circuiting relations', :sh
282
282
  @selected_property.must.method(relation).call indirect_int_var
283
283
  @model.solve!
284
284
 
285
- direct_int_var.should_not have_domain(Gecode::Model::LARGEST_INT_DOMAIN)
285
+ direct_int_var.should_not have_domain(Gecode::Mixin::LARGEST_INT_DOMAIN)
286
286
  direct_int_var.should have_domain(indirect_int_var.domain)
287
287
  end
288
288
 
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
- class ReifSugarSampleProblem < Gecode::Model
3
+ class ReifSugarSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :x
5
7
  attr :y
6
8
  attr :z
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../constraint_helper'
2
2
 
3
- class SelectionSampleProblem < Gecode::Model
3
+ class DisjointSelectSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :sets
5
7
  attr :set
6
8
  attr :target
@@ -16,11 +18,11 @@ class SelectionSampleProblem < Gecode::Model
16
18
  end
17
19
  end
18
20
 
19
- describe Gecode::SetEnum::Select, ' (disjoint)' do
21
+ describe Gecode::SetEnum::Element, ' (disjoint)' do
20
22
  include GecodeR::Specs::SetHelper
21
23
 
22
24
  before do
23
- @model = SelectionSampleProblem.new
25
+ @model = DisjointSelectSampleProblem.new
24
26
  @sets = @model.sets
25
27
  @set = @model.set
26
28
  @target = @model.target
@@ -33,7 +35,7 @@ describe Gecode::SetEnum::Select, ' (disjoint)' do
33
35
  end
34
36
  @expect = lambda do |var, opts, reif_var|
35
37
  set_enum, set = var
36
- Gecode::Raw.should_receive(:selectDisjoint).once.with(
38
+ Gecode::Raw.should_receive(:elementDisjoint).once.with(
37
39
  an_instance_of(Gecode::Raw::Space),
38
40
  set_enum, set)
39
41
  end
@@ -53,4 +55,3 @@ describe Gecode::SetEnum::Select, ' (disjoint)' do
53
55
  it_should_behave_like 'non-reifiable set constraint'
54
56
  it_should_behave_like 'non-negatable constraint'
55
57
  end
56
-
@@ -1,6 +1,8 @@
1
1
  require File.dirname(__FILE__) + '/../property_helper'
2
2
 
3
- class SelectionSampleProblem < Gecode::Model
3
+ class SelectionSampleProblem
4
+ include Gecode::Mixin
5
+
4
6
  attr :sets
5
7
  attr :set
6
8
  attr :target
@@ -16,7 +18,7 @@ class SelectionSampleProblem < Gecode::Model
16
18
  end
17
19
  end
18
20
 
19
- describe Gecode::SelectedSet::Select, ' (union)' do
21
+ describe Gecode::SelectedSet::Element, ' (union)' do
20
22
  include GecodeR::Specs::SetHelper
21
23
 
22
24
  before do
@@ -44,8 +46,8 @@ describe Gecode::SelectedSet::Select, ' (union)' do
44
46
  (union - [5,7,9]).should be_empty
45
47
  end
46
48
 
47
- it 'should translate into a select union constraint' do
48
- Gecode::Raw.should_receive(:selectUnion)
49
+ it 'should translate into a elements union constraint' do
50
+ Gecode::Raw.should_receive(:elementsUnion)
49
51
  @sets[@set].union.must_be.subset_of([5,7,9])
50
52
  @model.solve!
51
53
  end
@@ -54,7 +56,7 @@ describe Gecode::SelectedSet::Select, ' (union)' do
54
56
  'property that produces set operand by short circuiting equality')
55
57
  end
56
58
 
57
- describe Gecode::SetEnum::Select, ' (intersection)' do
59
+ describe Gecode::SetEnum::Element, ' (intersection)' do
58
60
  include GecodeR::Specs::SetHelper
59
61
 
60
62
  before do
@@ -84,8 +86,8 @@ describe Gecode::SetEnum::Select, ' (intersection)' do
84
86
  (intersection - [5,7,9]).should be_empty
85
87
  end
86
88
 
87
- it 'should translate into a select intersection constraint' do
88
- Gecode::Raw.should_receive(:selectInter)
89
+ it 'should translate into a elements intersection constraint' do
90
+ Gecode::Raw.should_receive(:elementsInter)
89
91
  @sets[@set].intersection.must_be.subset_of([5,7,9])
90
92
  @model.solve!
91
93
  end
@@ -94,7 +96,7 @@ describe Gecode::SetEnum::Select, ' (intersection)' do
94
96
  'property that produces set operand by short circuiting equality')
95
97
  end
96
98
 
97
- describe Gecode::SelectedSet::Select, ' (intersection with universe)' do
99
+ describe Gecode::SelectedSet::Element, ' (intersection with universe)' do
98
100
  include GecodeR::Specs::SetHelper
99
101
 
100
102
  before do
@@ -132,8 +134,8 @@ describe Gecode::SelectedSet::Select, ' (intersection with universe)' do
132
134
  (intersection - [1,2]).should be_empty
133
135
  end
134
136
 
135
- it 'should translate into a select intersection constraint' do
136
- Gecode::Raw.should_receive(:selectInterIn)
137
+ it 'should translate into a elements intersection constraint' do
138
+ Gecode::Raw.should_receive(:elementsInter)
137
139
  @sets[@set].intersection(:with => 1..2).must_be.subset_of([5,7,9])
138
140
  @model.solve!
139
141
  end