Class: Veritas::Optimizer::Function::Connective::Conjunction::LeftOperandTautology

Inherits:
Veritas::Optimizer::Function::Connective::Conjunction show all
Defined in:
lib/veritas/optimizer/function/connective/conjunction.rb

Overview

Optimize when the left operand is a tautology

Constant Summary

Constants inherited from Veritas::Optimizer

Noop, VERSION

Instance Attribute Summary

Attributes included from Binary

#left, #right

Attributes inherited from Veritas::Optimizer

#operation

Instance Method Summary collapse

Methods included from Binary

#initialize

Methods inherited from Veritas::Optimizer

chain, #initialize

Instance Method Details

#optimizable?Boolean

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 left operand is a tautology

Returns:

  • (Boolean)


19
20
21
# File 'lib/veritas/optimizer/function/connective/conjunction.rb', line 19

def optimizable?
  left_tautology?
end

#optimizeFunction

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.

A Conjunction with a tautology left operand is equivalent to the right

Returns:



28
29
30
# File 'lib/veritas/optimizer/function/connective/conjunction.rb', line 28

def optimize
  right
end