Module: Cudd::BDD

Defined in:
lib/cudd-rb/bdd.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#managerObject (readonly)

Returns the value of attribute manager.



17
18
19
# File 'lib/cudd-rb/bdd.rb', line 17

def manager
  @manager
end

Class Method Details

.define_delegate_method(from, to = from) ⇒ Object



4
5
6
7
8
# File 'lib/cudd-rb/bdd.rb', line 4

def self.define_delegate_method(from, to = from)
  define_method from do |*args, &bl|
    manager.send(to, *([self] + args), &bl)
  end
end

.define_delegate_methods(*methods) ⇒ Object



10
11
12
13
14
15
# File 'lib/cudd-rb/bdd.rb', line 10

def self.define_delegate_methods(*methods)
  methods = methods.first if methods.size==1 && methods.first.is_a?(Hash)
  methods.each do |m|
    define_delegate_method *Array(m)
  end
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



57
58
59
# File 'lib/cudd-rb/bdd.rb', line 57

def ==(other)
  address==other.address
end

#hashObject



53
54
55
# File 'lib/cudd-rb/bdd.rb', line 53

def hash
  address.hash
end

#one?Boolean Also known as: true?, tautology?

Returns:

  • (Boolean)


29
30
31
# File 'lib/cudd-rb/bdd.rb', line 29

def one?
  self == manager.one
end

#to_sObject Also known as: inspect



62
63
64
# File 'lib/cudd-rb/bdd.rb', line 62

def to_s
  "BDD(#{address})"
end

#zero?Boolean Also known as: false?, contradiction?

Returns:

  • (Boolean)


23
24
25
# File 'lib/cudd-rb/bdd.rb', line 23

def zero?
  self == manager.zero
end