Module: Hilbert::World::PropositionalLogic::Utils

Included in:
Base
Defined in:
lib/hilbert/world/propositional_logic.rb

Instance Method Summary collapse

Instance Method Details

#dpll!Object



75
76
77
# File 'lib/hilbert/world/propositional_logic.rb', line 75

def dpll!
  !!!!!!!!!!!!self
end

#include?(p) ⇒ Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/hilbert/world/propositional_logic.rb', line 71

def include?(p)
  false
end

#is_and?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/hilbert/world/propositional_logic.rb', line 67

def is_and?
  is_form?(:*)
end

#is_form?(ope = true) ⇒ Boolean

Returns:

  • (Boolean)


58
59
60
61
# File 'lib/hilbert/world/propositional_logic.rb', line 58

def is_form?(ope=true)
  return is_a?(FORM) if ope === true
  is_a?(FORM) && @ope == ope
end

#is_neg?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/hilbert/world/propositional_logic.rb', line 54

def is_neg?
  is_a?(NEG)
end

#is_or?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/hilbert/world/propositional_logic.rb', line 63

def is_or?
  is_form?(:+)
end

#neg?(p) ⇒ Boolean

Returns:

  • (Boolean)


49
50
51
52
# File 'lib/hilbert/world/propositional_logic.rb', line 49

def neg?(p)
  (is_a?(NEG) && self.p == p) ||
  (p.is_a?(NEG) && p.p == self)
end