Module: MetaAlgebra

Defined in:
lib/bud/meta_algebra.rb

Instance Method Summary collapse

Instance Method Details

#get_tag(nm, op) ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/bud/meta_algebra.rb', line 78

def get_tag(nm, op)
  if nm and op == '<~'
    :D
  elsif nm
    :N
  elsif op == '<~'
    :A
  else
    :M
  end
end

#in_prefix(node, path) ⇒ Object



90
91
92
# File 'lib/bud/meta_algebra.rb', line 90

def in_prefix(node, path)
  path.split("|").include? node
end

#max_of(a, b) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/bud/meta_algebra.rb', line 37

def max_of(a, b)
  if b > a
    b
  else
    a
  end
end