Simplify ![*0] as [+].

* src/ltlast/unop.cc: Simplify ![*0] as 1[+].
* src/ltlast/unop.hh: Document it.
This commit is contained in:
Alexandre Duret-Lutz 2010-10-14 18:38:28 +02:00
parent 437128b55b
commit d7781bc4d6
2 changed files with 14 additions and 0 deletions

View file

@ -145,6 +145,11 @@ namespace spot
// !0 = 1
if (child == constant::false_instance())
return constant::true_instance();
// ![*0] = 1[+]
if (child == constant::empty_word_instance())
return bunop::instance(bunop::Star,
constant::true_instance(), 1);
unop* u = dynamic_cast<unop*>(child);
if (u)
{
@ -155,6 +160,7 @@ namespace spot
u->destroy();
return c;
}
// !Closure(Exp) = NegClosure(Exp)
if (u->op() == Closure)
{
formula* c = unop::instance(NegClosure,
@ -162,6 +168,7 @@ namespace spot
u->destroy();
return c;
}
// !NegClosure(Exp) = Closure(Exp)
if (u->op() == NegClosure)
{
formula* c = unop::instance(Closure,