class PropLogic::ThenTerm

Public Class Methods

new(term1, term2) click to toggle source
# File lib/prop_logic/then_term.rb, line 3
def initialize(term1, term2)
  @terms = [term1, term2].freeze
end

Public Instance Methods

nnf?() click to toggle source
# File lib/prop_logic/then_term.rb, line 12
def nnf?
  false
end
reduce() click to toggle source
# File lib/prop_logic/then_term.rb, line 20
def reduce
  to_nnf.reduce
end
to_nnf() click to toggle source
# File lib/prop_logic/then_term.rb, line 16
def to_nnf
  (~@terms[0]).to_nnf | @terms[1].to_nnf
end
to_s(in_term = false) click to toggle source
# File lib/prop_logic/then_term.rb, line 7
def to_s(in_term = false)
  str = "#{@terms[0].to_s(true)} => #{@terms[1].to_s(true)}"
  in_term ? "( #{str} )" : str
end