Commit fc609057 authored by Thomas Medioni's avatar Thomas Medioni
Browse files

streett_like: clear the pair vector when non Streett-like

When an acceptance condition is not Streett-like, is_streett_like
now clears the rs_pair vector parameter before returning. Fixes #270.

* spot/twa/acc.cc: Clear the pair vector.
* spot/twaalgos/totgba.cc: Stop calling streett_to_generalized_buchi()
  when the acceptance condition is not Streett-like.
parent 0a21a4c8
......@@ -479,9 +479,9 @@ namespace spot
s = 5;
}
else if (mainop != highop)
{
return false;
}
{
return false;
}
while (s)
{
auto op = code[--s].sub.op;
......@@ -494,7 +494,10 @@ namespace spot
acc_cond::mark_t inf(0U);
if (op == singleop && m.count() != 1)
return false;
{
pairs.clear();
return false;
}
for (unsigned mark: m.sets())
{
if (op == acc_cond::acc_op::Fin)
......@@ -507,7 +510,10 @@ namespace spot
else
{
if (op != lowop || size != 4)
return false;
{
pairs.clear();
return false;
}
auto o1 = code[--s].sub.op;
auto m1 = code[--s].mark;
......@@ -527,7 +533,10 @@ namespace spot
|| o2 != acc_cond::acc_op::Inf
|| m1.count() != 1
|| m2.count() != 1)
return false;
{
pairs.clear();
return false;
}
pairs.emplace_back(m1, m2);
}
}
......
......@@ -331,8 +331,8 @@ namespace spot
}();
std::vector<acc_cond::rs_pair> pairs;
in->acc().is_streett_like(pairs);
if (min == 0 || min > pairs.size())
bool res = in->acc().is_streett_like(pairs);
if (!res || min == 0 || min > pairs.size())
return nullptr;
else
return streett_to_generalized_buchi(in);
......
Markdown is supported
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