Module: Predicate::Intersect
- Includes:
- Expr
- Defined in:
- lib/predicate/nodes/intersect.rb
Constant Summary
Constants included
from Expr
Expr::OP_NEGATIONS
Instance Method Summary
collapse
Methods included from Expr
#!, #&, #and_split, #attr_split, #constants, #contradiction?, #dyadic_priority, #identifier?, #literal?, #opaque?, #qualify, #rename, #sexpr, #tautology?, #to_s, #to_sequel, #|
Methods included from Factory
#and, #between, #comp, #contradiction, #from_hash, #in, #intersect, #literal, #match, #native, #not, #opaque, #or, #qualified_identifier, #tautology
Instance Method Details
#constant_variables ⇒ Object
21
22
23
|
# File 'lib/predicate/nodes/intersect.rb', line 21
def constant_variables
values.size == 1 ? free_variables : []
end
|
#evaluate(tuple) ⇒ Object
25
26
27
28
|
# File 'lib/predicate/nodes/intersect.rb', line 25
def evaluate(tuple)
t_x = identifier.evaluate(tuple)
t_x && !(t_x & values).empty?
end
|
#free_variables ⇒ Object
17
18
19
|
# File 'lib/predicate/nodes/intersect.rb', line 17
def free_variables
@free_variables ||= identifier.free_variables
end
|
#identifier ⇒ Object
9
10
11
|
# File 'lib/predicate/nodes/intersect.rb', line 9
def identifier
self[1]
end
|
#priority ⇒ Object
5
6
7
|
# File 'lib/predicate/nodes/intersect.rb', line 5
def priority
80
end
|
#values ⇒ Object
13
14
15
|
# File 'lib/predicate/nodes/intersect.rb', line 13
def values
self[2]
end
|