Module: MagicLogic::Utils

Included in:
Base
Defined in:
lib/magic_logic.rb

Instance Method Summary collapse

Instance Method Details

#dpllObject



71
72
73
# File 'lib/magic_logic.rb', line 71

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

#include?(p) ⇒ Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/magic_logic.rb', line 67

def include?(p)
  false
end

#is_and?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/magic_logic.rb', line 63

def is_and?
  is_form?(:*)
end

#is_form?(ope = nil) ⇒ Boolean

Returns:

  • (Boolean)


54
55
56
57
# File 'lib/magic_logic.rb', line 54

def is_form?(ope=nil)
  return is_a?(FORM) && self.ope == ope if ope
  is_a?(FORM)
end

#is_neg?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/magic_logic.rb', line 50

def is_neg?
  is_a?(NEG)
end

#is_or?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/magic_logic.rb', line 59

def is_or?
  is_form?(:+)
end

#neg?(p) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/magic_logic.rb', line 46

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