Class: Gisele::Analysis::Compiling::Boolexpr2BDD
- Inherits:
-
Processor
- Object
- Sexpr::Processor
- Processor
- Gisele::Analysis::Compiling::Boolexpr2BDD
show all
- Defined in:
- lib/gisele/analysis/compiling/boolexpr2bdd.rb
Instance Attribute Summary
Attributes inherited from Processor
#session
Instance Method Summary
collapse
Methods inherited from Processor
call, #initialize
#bdd, #bdd_interface, #cudd_manager, #one, #with_bdd, #zero
Instance Method Details
#on_bool_and(sexpr) ⇒ Object
16
17
18
19
20
|
# File 'lib/gisele/analysis/compiling/boolexpr2bdd.rb', line 16
def on_bool_and(sexpr)
with_bdd_apply(sexpr[1..-1]) do |left, right|
bdd_interface.and(left, right)
end
end
|
#on_bool_expr(sexpr) ⇒ Object
6
7
8
|
# File 'lib/gisele/analysis/compiling/boolexpr2bdd.rb', line 6
def on_bool_expr(sexpr)
apply(sexpr.last)
end
|
#on_bool_lit(sexpr) ⇒ Object
32
33
34
|
# File 'lib/gisele/analysis/compiling/boolexpr2bdd.rb', line 32
def on_bool_lit(sexpr)
sexpr.last ? one : zero
end
|
#on_bool_not(sexpr) ⇒ Object
10
11
12
13
14
|
# File 'lib/gisele/analysis/compiling/boolexpr2bdd.rb', line 10
def on_bool_not(sexpr)
with_bdd_apply(sexpr[1..-1]) do |bdd|
bdd_interface.not(bdd)
end
end
|
#on_bool_or(sexpr) ⇒ Object
22
23
24
25
26
|
# File 'lib/gisele/analysis/compiling/boolexpr2bdd.rb', line 22
def on_bool_or(sexpr)
with_bdd_apply(sexpr[1..-1]) do |left, right|
bdd_interface.or(left, right)
end
end
|
#on_var_ref(sexpr) ⇒ Object
28
29
30
|
# File 'lib/gisele/analysis/compiling/boolexpr2bdd.rb', line 28
def on_var_ref(sexpr)
session.variable(sexpr.last.to_sym, true).bdd
end
|