Speedup some rewriting by detecting cases where they do nothing.

* src/ltlvisit/nenoform.cc, src/ltlvisit/lunabbrev.cc,
src/ltlvisit/simpfg.cc, src/ltlvisit/tunabbrev.cc: Do not recurse
if the formula properties indicate that it is already in the right
form.
This commit is contained in:
Alexandre Duret-Lutz 2010-12-09 18:49:33 +01:00
parent 6380968f32
commit 20c088a45a
4 changed files with 8 additions and 0 deletions

View file

@ -106,6 +106,8 @@ namespace spot
formula*
unabbreviate_logic(const formula* f)
{
if (f->is_sugar_free_boolean())
return f->clone();
unabbreviate_logic_visitor v;
const_cast<formula*>(f)->accept(v);
return v.result();

View file

@ -289,6 +289,8 @@ namespace spot
formula*
negative_normal_form(const formula* f, bool negated)
{
if (!negated && f->is_in_nenoform())
return f->clone();
negative_normal_form_visitor v(negated);
const_cast<formula*>(f)->accept(v);
return v.result();

View file

@ -98,6 +98,8 @@ namespace spot
formula*
simplify_f_g(const formula* f)
{
if (f->is_boolean())
return f->clone();
simplify_f_g_visitor v;
const_cast<formula*>(f)->accept(v);
return v.result();

View file

@ -70,6 +70,8 @@ namespace spot
formula*
unabbreviate_ltl(const formula* f)
{
if (f->is_sugar_free_boolean() && f->is_sugar_free_ltl())
return f->clone();
unabbreviate_ltl_visitor v;
const_cast<formula*>(f)->accept(v);
return v.result();