class So::Eq

Public Class Methods

eq(a, b) click to toggle source
# File lib/spec_object.rb, line 159
def self.eq(a, b)
  a = a.to_so_expr
  b = b.to_so_expr

  if a.kind_of?(Const) && b.kind_of?(Const)
    (a.value == b.value).to_so_expr
  else
    new(a, b)
  end
end
new(a, b) click to toggle source
# File lib/spec_object.rb, line 154
def initialize(a, b)
  @a = a
  @b = b
end

Public Instance Methods

pp(n) click to toggle source
# File lib/spec_object.rb, line 170
def pp(n)
  "#{' '*n}(==\n#{@a.pp(n+2)}\n#{@b.pp(n+2)})"
end
substitute(v, e) click to toggle source
# File lib/spec_object.rb, line 174
def substitute(v, e)
  Eq.eq(@a.substitute(v, e), @b.substitute(v, e))
end