Sha256: 37febd297094683c9bb9fde2587cd23097b2fcda2e26a3e6b945eb9cfc848ebf

Contents?: true

Size: 440 Bytes

Versions: 4

Compression:

Stored size: 440 Bytes

Contents

class Predicate
  module And
    include NadicBool

    def operator_symbol
      :'&&'
    end

    def and_split(attr_list)
      sexpr_body.inject([tautology, tautology]) do |(top,down),term|
        pair = term.and_split(attr_list)
        [top & pair.first, down & pair.last]
      end
    end

    def constant_variables
      sexpr_body.inject([]) do |cvars,expr|
        cvars | expr.constant_variables
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
predicate-1.1.2 lib/predicate/nodes/and.rb
predicate-1.1.1 lib/predicate/nodes/and.rb
predicate-1.1.0 lib/predicate/nodes/and.rb
predicate-1.0.0 lib/predicate/nodes/and.rb