Sha256: aa09c8e4c1ee35ce5ebaf6a70a511ed38ec2a51ca24152f17e5b5b8980ed4723
Contents?: true
Size: 1.52 KB
Versions: 2
Compression:
Stored size: 1.52 KB
Contents
module Veritas class Optimizer module Logic class Predicate # Abstract base class representing LessThanOrEqualTo optimizations class LessThanOrEqualTo < self include Comparable # Optimize when the operands are always false class AlwaysFalse < self include Comparable::NeverComparable include Predicate::AlwaysFalse # Test if the operands are always false # # @return [Boolean] # # @api private def optimizable? super || GreaterThan::AlwaysTrue.new(operation.inverse).optimizable? end end # class AlwaysFalse # Optimize when the operands are always true class AlwaysTrue < self include Predicate::AlwaysTrue # Test if the operands are always true # # @return [Boolean] # # @api private def optimizable? operation = self.operation LessThan::AlwaysTrue.new(operation).optimizable? || Equality::AlwaysTrue.new(operation).optimizable? end end # class AlwaysTrue Veritas::Logic::Predicate::LessThanOrEqualTo.optimizer = chain( ConstantOperands, AlwaysFalse, AlwaysTrue, NormalizableOperands ) end # class LessThanOrEqualTo end # class Predicate end # module Logic end # class Optimizer end # module Veritas
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
veritas-0.0.2 | lib/veritas/optimizer/logic/predicate/less_than_or_equal_to.rb |
veritas-0.0.1 | lib/veritas/optimizer/logic/predicate/less_than_or_equal_to.rb |