Trivially reduce 1[*]&&f = f and 1[*]|f = 1[*].

* src/ltlast/bunop.hh (one_star): New static method building 1[*].
* src/ltlast/bunop.cc (bunop::~bunop, bunop::instance_count): Adjust.
* src/ltlast/multop.cc: Implement the trivial rewriting.
* src/ltlast/multop.hh, doc/tl/tl.tex: Document it.
* src/ltltest/equals.test: Test it.
This commit is contained in:
Alexandre Duret-Lutz 2012-04-24 17:22:23 +02:00
parent 5bea6e4950
commit e06b3b7974
6 changed files with 39 additions and 6 deletions

View file

@ -27,6 +27,7 @@
#include <iostream>
#include "multop.hh"
#include "constant.hh"
#include "bunop.hh"
#include "visitor.hh"
namespace spot
@ -300,7 +301,7 @@ namespace spot
weak_abs = 0;
break;
case AndRat:
neutral = 0; /* FIXME: we should use 1[*] as neutral */
neutral = bunop::one_star();
neutral2 = 0;
abs = constant::false_instance();
abs2 = 0;
@ -325,7 +326,7 @@ namespace spot
case OrRat:
neutral = constant::false_instance();
neutral2 = 0;
abs = 0; // FIXME: should be 1[*].
abs = bunop::one_star();
abs2 = 0;
weak_abs = 0;
gather_bool(v, Or);
@ -409,7 +410,7 @@ namespace spot
for (i = v->begin(); i != v->end(); ++i)
(*i)->destroy();
delete v;
return abs;
return abs->clone();
}
else
{
@ -469,7 +470,7 @@ namespace spot
{
delete v;
assert(neutral != 0);
return neutral;
return neutral->clone();
}
else if (s == 1)
{