Rewrite Exp[=0..] as [*].

* src/ltlast/bunop.cc: Implement this rewriting.
* src/ltlast/bunop.hh: Document it.
* src/ltltest/equals.test: Test it.
This commit is contained in:
Alexandre Duret-Lutz 2010-10-14 19:14:42 +02:00
parent 8d4a413a37
commit 2c31e541b5
3 changed files with 12 additions and 1 deletions

View file

@ -167,13 +167,22 @@ namespace spot
{
case Equal:
{
// - Exp[=0..] = [*]
if (min == 0 && max == unbounded)
{
op = Star;
child->destroy();
child = constant::true_instance();
break;
}
// - 0[=0..max] = [*]
// - 0[=min..max] = 0 if min > 0
if (child == constant::false_instance())
{
if (min == 0)
{
max = -1U;
max = unbounded;
op = Star;
child = constant::true_instance();
break;