Class: Veritas::Optimizer::Function::Connective::Negation::InvertibleOperand
- Inherits:
-
Veritas::Optimizer::Function::Connective::Negation
- Object
- Veritas::Optimizer
- Veritas::Optimizer::Function::Connective::Negation
- Veritas::Optimizer::Function::Connective::Negation::InvertibleOperand
- Defined in:
- lib/veritas/optimizer/function/connective/negation.rb
Overview
Optimize when the operand can be inverted
Constant Summary
Constants inherited from Veritas::Optimizer
Instance Attribute Summary
Attributes included from Unary
Attributes inherited from Veritas::Optimizer
Instance Method Summary collapse
-
#optimizable? ⇒ Boolean
private
Test if the operand can be inverted.
-
#optimize ⇒ Function
private
A Negation of an Function is equivalent to the inverted Function.
Methods included from Unary
Methods inherited from Veritas::Optimizer
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 operand can be inverted
20 21 22 |
# File 'lib/veritas/optimizer/function/connective/negation.rb', line 20 def optimizable? operand.respond_to?(:inverse) end |
#optimize ⇒ Function
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 Negation of an Function is equivalent to the inverted Function
29 30 31 |
# File 'lib/veritas/optimizer/function/connective/negation.rb', line 29 def optimize operand.inverse end |