Module: Veritas::Optimizer::Function::Predicate::Comparable::NeverEquivalent

Included in:
Equality::Contradiction, Inequality::Tautology
Defined in:
lib/veritas/optimizer/function/predicate/comparable.rb

Overview

Optimize when the operands will never be equivalent

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) optimizable?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test if the operands will never be equivalent

Returns:

  • (Boolean)


43
44
45
46
47
48
49
50
51
# File 'lib/veritas/optimizer/function/predicate/comparable.rb', line 43

def optimizable?
  util = Util
  if    nil_operand?          then true
  elsif util.constant?(left)  then left_invalid_constant?
  elsif util.constant?(right) then right_invalid_constant?
  else
    ! joinable?
  end
end