class DpllSolver::Formulas::Literal

Attributes

phase[RW]
var[RW]

Public Class Methods

new(var, phase) click to toggle source
# File lib/dpll_solver/formulas/literal.rb, line 5
def initialize(var, phase)
  @var   = var
  @phase = phase
end

Public Instance Methods

==(other) click to toggle source
# File lib/dpll_solver/formulas/literal.rb, line 18
def ==(other)
  other.class == self.class && other.var == @var && other.phase == @phase
end
Also aliased as: eql?
eql?(other)
Alias for: ==
negate() click to toggle source
# File lib/dpll_solver/formulas/literal.rb, line 10
def negate
  self.class.new(@var, !@phase)
end
to_s() click to toggle source
# File lib/dpll_solver/formulas/literal.rb, line 14
def to_s
  phase ? @var.to_s : "-#{@var.to_s}"
end