Class: Tensai::Logic::Formulas::Atom

Inherits:
Object
  • Object
show all
Defined in:
lib/tensai/logic/formulas/atom.rb

Overview

Atomic formula

Instance Method Summary collapse

Instance Method Details

#after_initializeObject

Raises:

  • (ArgumentError)


20
21
22
# File 'lib/tensai/logic/formulas/atom.rb', line 20

def after_initialize
  raise ArgumentError, "Invalid values #{values} for predicate #{predicate}" unless predicate.accepts? values
end

#inspectObject



24
25
26
# File 'lib/tensai/logic/formulas/atom.rb', line 24

def inspect
  "(#{predicate.name} #{values.map { |name, value| "#{name}: #{value.inspect}" }.join(', ')})"
end