Method: Gecode::Bool::BoolConstraintReceiver#==

Defined in:
lib/gecoder/interface/constraints/bool/boolean.rb

#==(bool_op, options = {}) ⇒ Object

Constrains the boolean operand to be equal to bool_op. Any of ==, equal and equal_to may be used for equality.

Examples

# +b1+ and +b2+ must equal +b1+ or +b2+.
(b1 & b2).must == (b1 | b2)

# +b1+ and +b2+ must not equal +b3+. We reify it with +bool+ and select 
# the strength +domain+.
(b1 & b2).must_not.equal(b3, :reify => bool, :select => :domain)


72
73
74
75
76
77
78
79
# File 'lib/gecoder/interface/constraints/bool/boolean.rb', line 72

def ==(bool_op, options = {})
  unless bool_op.respond_to? :to_minimodel_bool_expr
    bool_op = ExpressionNode.new(bool_op, @model)
  end
  @params.update Gecode::Util.decode_options(options)
  @params.update(:lhs => @params[:lhs], :rhs => bool_op)
  @model.add_constraint BooleanConstraint.new(@model, @params)
end