Module: Alf::Predicate::And

Includes:
NadicBool
Defined in:
lib/alf/predicate/nodes/and.rb

Constant Summary

Constants included from Expr

Expr::OP_NEGATIONS

Instance Method Summary collapse

Methods included from NadicBool

#free_variables, #priority

Methods included from Expr

#!, #&, #contradiction?, #qualify, #rename, #sexpr, #tautology?, #to_proc, #to_ruby_code, #|

Methods included from Factory

#_factor_predicate, #and, #between, #comp, #contradiction, #identifier, #in, #literal, #native, #not, #or, #qualified_identifier, #relation, #sexpr, #tautology

Instance Method Details

#and_split(attr_list) ⇒ Object


10
11
12
13
14
15
# File 'lib/alf/predicate/nodes/and.rb', line 10

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

#constant_variablesObject


17
18
19
20
21
# File 'lib/alf/predicate/nodes/and.rb', line 17

def constant_variables
  sexpr_body.inject(AttrList::EMPTY) do |cvars,expr|
    cvars | expr.constant_variables
  end
end

#operator_symbolObject


6
7
8
# File 'lib/alf/predicate/nodes/and.rb', line 6

def operator_symbol
  :'&&'
end