Class: DpllSolver::Formulas::Variable
- Inherits:
-
Object
- Object
- DpllSolver::Formulas::Variable
- Includes:
- AtomicFormula
- Defined in:
- lib/dpll_solver/formulas/variable.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
(also: #to_s)
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#initialize(name) ⇒ Variable
constructor
A new instance of Variable.
- #variable? ⇒ Boolean
- #verum? ⇒ Boolean (also: #falsum?)
Methods included from AtomicFormula
#atomic_formula?, #not?, #simplify
Constructor Details
#initialize(name) ⇒ Variable
Returns a new instance of Variable.
7 8 9 |
# File 'lib/dpll_solver/formulas/variable.rb', line 7 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object Also known as: to_s
Returns the value of attribute name.
5 6 7 |
# File 'lib/dpll_solver/formulas/variable.rb', line 5 def name @name end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
11 12 13 |
# File 'lib/dpll_solver/formulas/variable.rb', line 11 def ==(other) other.class == self.class && other.to_s == self.to_s end |
#variable? ⇒ Boolean
16 17 18 |
# File 'lib/dpll_solver/formulas/variable.rb', line 16 def variable? true end |
#verum? ⇒ Boolean Also known as: falsum?
19 20 21 |
# File 'lib/dpll_solver/formulas/variable.rb', line 19 def verum? false end |