Class: Longjing::PDDL::Not
Constant Summary
collapse
- @@insts =
{}
Instance Attribute Summary collapse
Attributes inherited from Literal
#ff_goal, #ff_layer, #ff_neg_goal
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Literal
#to_a
Constructor Details
#initialize(literal) ⇒ Not
Returns a new instance of Not.
111
112
113
114
|
# File 'lib/longjing/pddl/literal.rb', line 111
def initialize(literal)
@literal = literal
@hash = literal.hash
end
|
Instance Attribute Details
#hash ⇒ Object
Returns the value of attribute hash.
109
110
111
|
# File 'lib/longjing/pddl/literal.rb', line 109
def hash
@hash
end
|
#literal ⇒ Object
Returns the value of attribute literal.
109
110
111
|
# File 'lib/longjing/pddl/literal.rb', line 109
def literal
@literal
end
|
Class Method Details
.[](lit) ⇒ Object
104
105
106
|
# File 'lib/longjing/pddl/literal.rb', line 104
def [](lit)
@@insts[lit] ||= new(lit)
end
|
Instance Method Details
#applicable?(set) ⇒ Boolean
116
117
118
|
# File 'lib/longjing/pddl/literal.rb', line 116
def applicable?(set)
!set.include?(@literal)
end
|
#apply(set) ⇒ Object
120
121
122
|
# File 'lib/longjing/pddl/literal.rb', line 120
def apply(set)
set.delete(@literal)
end
|
#inspect ⇒ Object
139
140
141
|
# File 'lib/longjing/pddl/literal.rb', line 139
def inspect
"(not #{@literal.inspect})"
end
|
#substitute(variables) ⇒ Object
124
125
126
127
128
129
130
131
132
133
|
# File 'lib/longjing/pddl/literal.rb', line 124
def substitute(variables)
ret = @literal.substitute(variables)
if ret.nil?
EMPTY
elsif ret == EMPTY
nil
else
Not[ret]
end
end
|
#to_s ⇒ Object
135
136
137
|
# File 'lib/longjing/pddl/literal.rb', line 135
def to_s
"(not #{@literal})"
end
|