Class: DpllSolver::Formulas::Variable

Inherits:
Object
  • Object
show all
Includes:
AtomicFormula
Defined in:
lib/dpll_solver/formulas/variable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject 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

Returns:

  • (Boolean)


16
17
18
# File 'lib/dpll_solver/formulas/variable.rb', line 16

def variable?
  true
end

#verum?Boolean Also known as: falsum?

Returns:

  • (Boolean)


19
20
21
# File 'lib/dpll_solver/formulas/variable.rb', line 19

def verum?
  false
end