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

@ -108,6 +108,7 @@ namespace spot
bdd_dict* dict;
ltl_simplifier* ls;
mark_tools mt;
typedef bdd_dict::fv_map fv_map;
typedef bdd_dict::vf_map vf_map;
@ -1760,7 +1761,11 @@ namespace spot
// Handle a Miyano-Hayashi style unrolling for
// rational operators. Marked nodes correspond to
// subformulae in the Miyano-Hayashi set.
if (simplify_mark(dest))
formula* tmp = d_.mt.simplify_mark(dest);
dest->destroy();
dest = tmp;
if (dest->is_marked())
{
// Make the promise that we will exit marked sets.
int a =
@ -1772,7 +1777,7 @@ namespace spot
// We have no marked operators, but still
// have other rational operator to check.
// Start a new marked cycle.
formula* dest2 = mark_concat_ops(dest);
formula* dest2 = d_.mt.mark_concat_ops(dest);
dest->destroy();
dest = dest2;
}