Do not assume that concatenation cannot accept the empty word.

For instance "(a+#e);(b+#e);(c*)" does.

* src/ltlvisit/consterm.cc: Fix handling of Concat operator.
* src/ltltest/consterm.test: Add more tests.
This commit is contained in:
Alexandre Duret-Lutz 2010-03-02 12:44:46 +01:00
parent bd9136a98e
commit ad519b8568
2 changed files with 4 additions and 9 deletions

View file

@ -37,3 +37,6 @@ run 1 ../consterm '((a ; b) + #e)'
run 0 ../consterm '((a ; b) + #e) & e'
run 1 ../consterm '((a ; b) + #e) & #e'
run 1 ../consterm '((a ; b) + #e) & (a* + b)'
run 1 ../consterm '(a + #e);(b + #e);(c + #e)'
run 0 ../consterm '(a + #e);(b + e);(c + #e)'
run 1 ../consterm '(a + #e);(b + e)*;(c + #e)'

View file

@ -97,12 +97,6 @@ namespace spot
void
visit(const multop* mo)
{
if (mo->op() == multop::Concat)
{
result_ = false;
return;
}
unsigned max = mo->size();
// This sets the initial value of result_.
mo->nth(0)->accept(*this);
@ -119,13 +113,11 @@ namespace spot
return;
break;
case multop::And:
case multop::Concat:
result_ &= r;
if (!result_)
return;
break;
case multop::Concat:
assert(!"unreachable code");
break;
}
}
}