class Syllogism::WffChecker

Constants

WELL_FORMED_FORMULAS

Attributes

statement[R]

Public Class Methods

new(statement) click to toggle source
# File lib/syllogism/wff_checker.rb, line 3
def initialize(statement)
  @statement = statement
end

Public Instance Methods

any?() click to toggle source
# File lib/syllogism/wff_checker.rb, line 7
def any?
  formula && !formula.empty?
end
formula() click to toggle source
# File lib/syllogism/wff_checker.rb, line 11
def formula
  @formula ||= WELL_FORMED_FORMULAS.find do |formula_type|
    atom_types == formula_type
  end.to_s
end

Private Instance Methods

atom_types() click to toggle source
# File lib/syllogism/wff_checker.rb, line 36
def atom_types
  @atom_types ||= atoms.map { |atom| atom.class }
end
atoms() click to toggle source
# File lib/syllogism/wff_checker.rb, line 32
def atoms
  statement.atoms
end