Module: Predicate::And
- Includes:
- NadicBool
- Defined in:
- lib/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, #to_sequel, #|
Methods included from Factory
#and, #between, #comp, #contradiction, #from_hash, #identifier, #in, #literal, #native, #not, #or, #qualified_identifier, #tautology
Instance Method Details
#and_split(attr_list) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/predicate/nodes/and.rb', line 9
def and_split(attr_list)
sexpr_body.inject([tautology, tautology]) do |(top,down),term|
p1, p2 = term.and_split(attr_list)
[top & p1, down & p2]
end
end
|
#constant_variables ⇒ Object
21
22
23
24
25
|
# File 'lib/predicate/nodes/and.rb', line 21
def constant_variables
sexpr_body.inject([]) do |cvars,expr|
cvars | expr.constant_variables
end
end
|
#operator_symbol ⇒ Object
5
6
7
|
# File 'lib/predicate/nodes/and.rb', line 5
def operator_symbol
:'&&'
end
|