Class: Ravensat::VarNode
Instance Attribute Summary collapse
-
#dimacs_name ⇒ Object
Returns the value of attribute dimacs_name.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
- #cnf? ⇒ Boolean
- #eval ⇒ Object
-
#initialize ⇒ VarNode
constructor
A new instance of VarNode.
- #result ⇒ Object
- #to_dimacs ⇒ Object
- #~@ ⇒ Object
Methods inherited from Node
#&, #clauses_size, #each, #each_by_descriptive, #to_s, #vars, #vars_size, #|
Constructor Details
#initialize ⇒ VarNode
Returns a new instance of VarNode.
4 5 6 7 8 |
# File 'lib/ravensat/ast/var_node.rb', line 4 def initialize @value @children = [] @dimacs_name end |
Instance Attribute Details
#dimacs_name ⇒ Object
Returns the value of attribute dimacs_name.
3 4 5 |
# File 'lib/ravensat/ast/var_node.rb', line 3 def dimacs_name @dimacs_name end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/ravensat/ast/var_node.rb', line 3 def value @value end |
Instance Method Details
#cnf? ⇒ Boolean
14 15 16 |
# File 'lib/ravensat/ast/var_node.rb', line 14 def cnf? true end |
#eval ⇒ Object
26 27 28 |
# File 'lib/ravensat/ast/var_node.rb', line 26 def eval @value end |
#result ⇒ Object
18 19 20 |
# File 'lib/ravensat/ast/var_node.rb', line 18 def result @value end |
#to_dimacs ⇒ Object
22 23 24 |
# File 'lib/ravensat/ast/var_node.rb', line 22 def to_dimacs @dimacs_name end |