class Satre::Not

Attributes

literal[R]

Public Class Methods

new(literal) click to toggle source
# File lib/satre/formula/propositional_logic/not.rb, line 7
def initialize(literal)
  fail(ArgumentError, 'Argument must be a Formula') unless literal.is_a?(Formula)
  @literal = literal.dup.freeze
end

Public Instance Methods

atoms() click to toggle source
# File lib/satre/formula/propositional_logic/not.rb, line 29
def atoms
  literal.atoms || []
end
eval(valudation) click to toggle source
# File lib/satre/formula/propositional_logic/not.rb, line 25
def eval(valudation)
  ! literal.eval(valudation)
end
holds?(domain, func, pred, valudation) click to toggle source
# File lib/satre/formula/propositional_logic/not.rb, line 16
def holds?(domain, func, pred, valudation)
  ! literal.holds?(domain, func, pred, valudation)
end
to_s() click to toggle source
# File lib/satre/formula/propositional_logic/not.rb, line 12
def to_s
  "(¬#{literal})"
end
wellformed?(sig) click to toggle source

~p is well-formed if p is well-formed

# File lib/satre/formula/propositional_logic/not.rb, line 21
def wellformed?(sig)
  literal.wellformed?(sig)
end