Sha256: 7f1c9fc022c404a3093e2bb8e72ff961f3ed6ed405f3e4f8552eec4c1489e77c
Contents?: true
Size: 1.41 KB
Versions: 1
Compression:
Stored size: 1.41 KB
Contents
module Veritas class Optimizer module Logic class Predicate # Abstract base class representing Inclusion optimizations class Inclusion < self include Enumerable # Optimize when the right operand is empty class EmptyRightOperand < self include Enumerable::EmptyRightOperand # An Inclusion with an empty right operand matches nothing # # @return [False] # # @api private def optimize Veritas::Logic::Proposition::False.instance end end # class EmptyRightOperand # Optimize when the right operand has one entry class OneRightOperand < self include Enumerable::OneRightOperand # An Inclusion with a single right operand is equivalent to an Equality # # @return [Equality] # # @api private def optimize Veritas::Logic::Predicate::Equality.new(left, right.first) end end # class OneRightOperand Veritas::Logic::Predicate::Inclusion.optimizer = chain( ConstantOperands, EmptyRightOperand, OneRightOperand, UnoptimizedOperand ) end # class Inclusion end # class Predicate end # module Logic end # class Optimizer end # module Veritas
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
veritas-0.0.1 | lib/veritas/optimizer/logic/predicate/inclusion.rb |