Speedup mark_concat_ops() and simplify_mark() with a cache.

* src/ltlvisit/mark.hh, src/ltlvisit/mark.cc (mark_concat_ops,
simplify_mark): Rewrite these two functions as methods of
(mark_tools): this new class.
* src/ltlast/binop.cc, src/ltlast/unop.cc: Adjust computation
of not_marked to ignore marked operators that are not at
the top-level.  I.e., something like X(!{a}) is not marked.
* src/tgbaalgos/ltl2tgba_fm.cc (translate_dict::mt): New
instance of mark_tools.
(formula_canonizer::translate) Adjust calls to
mark_concat_ops() and simplify_mark().
This commit is contained in:
Alexandre Duret-Lutz 2011-11-13 19:44:40 +01:00
parent f68f639e68
commit 0f11e5fe0e
5 changed files with 116 additions and 77 deletions

View file

@ -39,6 +39,7 @@ namespace spot
switch (op)
{
case Not:
is.not_marked = true;
is.eventual = child->is_universal();
is.universal = child->is_eventual();
is.in_nenoform = (child->kind() == AtomicProp);
@ -53,6 +54,7 @@ namespace spot
is.accepting_eword = false;
break;
case X:
is.not_marked = true;
is.boolean = false;
is.X_free = false;
is.eltl_formula = false;
@ -65,6 +67,7 @@ namespace spot
is.accepting_eword = false;
break;
case F:
is.not_marked = true;
is.boolean = false;
is.eltl_formula = false;
is.sere_formula = false;
@ -79,6 +82,7 @@ namespace spot
is.accepting_eword = false;
break;
case G:
is.not_marked = true;
is.boolean = false;
is.eltl_formula = false;
is.sere_formula = false;
@ -93,6 +97,7 @@ namespace spot
is.accepting_eword = false;
break;
case Finish:
is.not_marked = true;
is.boolean = false;
is.ltl_formula = false;
is.psl_formula = false;
@ -120,6 +125,7 @@ namespace spot
is.accepting_eword = false;
break;
case Closure:
is.not_marked = true;
is.boolean = false;
is.ltl_formula = false;
is.eltl_formula = false;