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:
parent
6380968f32
commit
20c088a45a
4 changed files with 8 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue