Class: Gisele::Analysis::Ghmsc

Inherits:
Object
  • Object
show all
Includes:
Mixin::BddManagement
Defined in:
lib/gisele/analysis/ghmsc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Mixin::BddManagement

#bdd, #bdd_interface, #cudd_manager, #one, #with_bdd, #zero

Constructor Details

#initialize(session) {|_self| ... } ⇒ Ghmsc

Returns a new instance of Ghmsc.

Yields:

  • (_self)

Yield Parameters:



5
6
7
8
# File 'lib/gisele/analysis/ghmsc.rb', line 5

def initialize(session, &bl)
  @session = session
  yield(self) if bl
end

Instance Attribute Details

#ast=(value) ⇒ Object (writeonly)

Sets the attribute ast

Parameters:

  • value

    the value to set the attribute ast to.



26
27
28
# File 'lib/gisele/analysis/ghmsc.rb', line 26

def ast=(value)
  @ast = value
end

#glts=(value) ⇒ Object (writeonly)

Sets the attribute glts

Parameters:

  • value

    the value to set the attribute glts to.



40
41
42
# File 'lib/gisele/analysis/ghmsc.rb', line 40

def glts=(value)
  @glts = value
end

#graph=(value) ⇒ Object (writeonly)

Sets the attribute graph

Parameters:

  • value

    the value to set the attribute graph to.



31
32
33
# File 'lib/gisele/analysis/ghmsc.rb', line 31

def graph=(value)
  @graph = value
end

#sessionObject (readonly)

Returns the value of attribute session.



9
10
11
# File 'lib/gisele/analysis/ghmsc.rb', line 9

def session
  @session
end

#sourceObject

Returns the value of attribute source.



11
12
13
# File 'lib/gisele/analysis/ghmsc.rb', line 11

def source
  @source
end

Instance Method Details

#c0Object



13
14
15
16
17
# File 'lib/gisele/analysis/ghmsc.rb', line 13

def c0
  with_bdd session.c0 do |s_c0|
    (@c0 || one) & s_c0
  end
end

#c0=(c0) ⇒ Object



19
20
21
# File 'lib/gisele/analysis/ghmsc.rb', line 19

def c0=(c0)
  @c0 = session.bdd(c0)
end

#merge(other) ⇒ Object Also known as: |



46
47
48
49
50
# File 'lib/gisele/analysis/ghmsc.rb', line 46

def merge(other)
  Ghmsc.new(session) do |g|
    g.glts = to_glts | other.to_glts
  end
end

#to_astObject



23
24
25
# File 'lib/gisele/analysis/ghmsc.rb', line 23

def to_ast
  @ast ||= Gisele.ast(source)
end

#to_dotObject



42
43
44
# File 'lib/gisele/analysis/ghmsc.rb', line 42

def to_dot
  to_graph.to_dot
end

#to_gltsObject



33
34
35
36
37
38
39
# File 'lib/gisele/analysis/ghmsc.rb', line 33

def to_glts
  @glts ||= begin
    glts = Compiling::Ast2Glts.call(session, to_ast)
    glts.c0 = @c0 if @c0
    glts
  end
end

#to_graphObject



28
29
30
# File 'lib/gisele/analysis/ghmsc.rb', line 28

def to_graph
  @graph ||= Compiling::Ast2Graph.call(to_ast)
end