Commit 6e32b658 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

* src/twa/acc.cc: Fix BDD conversion in case of unused sets.

parent 0ede9687
...@@ -412,13 +412,14 @@ namespace spot ...@@ -412,13 +412,14 @@ namespace spot
auto used = acc_cond::acc_code::used_sets(); auto used = acc_cond::acc_code::used_sets();
unsigned c = used.count(); unsigned c = used.count();
unsigned max = used.max_set();
bdd_allocator ba; bdd_allocator ba;
int base = ba.allocate_variables(c); int base = ba.allocate_variables(c);
assert(base == 0); assert(base == 0);
std::vector<bdd> r; std::vector<bdd> r;
std::vector<unsigned> sets(c); std::vector<unsigned> sets(c);
for (unsigned i = 0; r.size() < c; ++i) for (unsigned i = 0; r.size() < max; ++i)
{ {
if (used.has(i)) if (used.has(i))
{ {
...@@ -473,6 +474,7 @@ namespace spot ...@@ -473,6 +474,7 @@ namespace spot
c.append_or(std::move(rescode)); c.append_or(std::move(rescode));
std::swap(c, rescode); std::swap(c, rescode);
} }
return rescode; return rescode;
} }
...@@ -483,13 +485,14 @@ namespace spot ...@@ -483,13 +485,14 @@ namespace spot
auto used = acc_cond::acc_code::used_sets(); auto used = acc_cond::acc_code::used_sets();
unsigned c = used.count(); unsigned c = used.count();
unsigned max = used.max_set();
bdd_allocator ba; bdd_allocator ba;
int base = ba.allocate_variables(c); int base = ba.allocate_variables(c);
assert(base == 0); assert(base == 0);
std::vector<bdd> r; std::vector<bdd> r;
std::vector<unsigned> sets(c); std::vector<unsigned> sets(c);
for (unsigned i = 0; r.size() < c; ++i) for (unsigned i = 0; r.size() < max; ++i)
{ {
if (used.has(i)) if (used.has(i))
{ {
...@@ -555,13 +558,14 @@ namespace spot ...@@ -555,13 +558,14 @@ namespace spot
auto used = acc_cond::acc_code::used_sets(); auto used = acc_cond::acc_code::used_sets();
unsigned c = used.count(); unsigned c = used.count();
unsigned max = used.max_set();
bdd_allocator ba; bdd_allocator ba;
int base = ba.allocate_variables(c); int base = ba.allocate_variables(c);
assert(base == 0); assert(base == 0);
std::vector<bdd> r; std::vector<bdd> r;
std::vector<unsigned> sets(c); std::vector<unsigned> sets(c);
for (unsigned i = 0; r.size() < c; ++i) for (unsigned i = 0; r.size() < max; ++i)
{ {
if (used.has(i)) if (used.has(i))
{ {
...@@ -616,6 +620,7 @@ namespace spot ...@@ -616,6 +620,7 @@ namespace spot
} }
auto used = acc_cond::acc_code::used_sets(); auto used = acc_cond::acc_code::used_sets();
unsigned c = used.count(); unsigned c = used.count();
unsigned max = used.max_set();
bdd_allocator ba; bdd_allocator ba;
int base = ba.allocate_variables(c); int base = ba.allocate_variables(c);
...@@ -623,7 +628,7 @@ namespace spot ...@@ -623,7 +628,7 @@ namespace spot
std::vector<bdd> r; std::vector<bdd> r;
std::vector<unsigned> sets(c); std::vector<unsigned> sets(c);
bdd known = bddtrue; bdd known = bddtrue;
for (unsigned i = 0; r.size() < c; ++i) for (unsigned i = 0; r.size() < max; ++i)
{ {
if (used.has(i)) if (used.has(i))
{ {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment