Sha256: 2ce3f653701e5d157fa3232eff8e03bd8a0e7947dc2da30f55e333bbf82ac61b
Contents?: true
Size: 1.53 KB
Versions: 3
Compression:
Stored size: 1.53 KB
Contents
# encoding: utf-8 module Axiom class Optimizer module Function class Predicate # Abstract base class representing GreaterThanOrEqualTo optimizations class GreaterThanOrEqualTo < self include Comparable # Optimize when the operands are a contradiction class Contradiction < self include Comparable::NeverComparable, Predicate::Contradiction # Test if the operands are a contradiction # # @return [Boolean] # # @api private def optimizable? super || LessThan::Tautology.new(operation.inverse).optimizable? end end # class Contradiction # Optimize when the operands are a tautology class Tautology < self include Predicate::Tautology # Test if the operands are a tautology # # @return [Boolean] # # @api private def optimizable? GreaterThan::Tautology.new(operation).optimizable? || Equality::Tautology.new(operation).optimizable? end end # class Tautology Axiom::Function::Predicate::GreaterThanOrEqualTo.optimizer = chain( ConstantOperands, Contradiction, Tautology, NormalizableOperands, UnoptimizedOperands ) end # class GreaterThanOrEqualTo end # class Predicate end # module Function end # class Optimizer end # module Axiom
Version data entries
3 entries across 3 versions & 1 rubygems