prune_scc() leaked memory and failed to remove chains of useless SCCs.
* src/tgbaalgos/reductgba_sim.cc (reduc_tgba_sim): Call
scc_filter() instead of prune_scc(), and do it before running
any simulation-based reduction.
* src/tgbaalgos/reductgba_sim.hh (reduc_tgba_sim): Return a const
tgba*.
* src/tgbatest/ltl2tgba.cc: Call scc_filter() instead of
prune_scc().
* src/tgbatest/scc.test: Add two more tests that failed with
prune_scc().
Also compute useless SCCs.
* src/tgbaalgos/scc.cc (scc_map::scc::trivial): New field.
(scc_stats::useless_scc_map): New field.
* src/tgbaalgos/scc.cc (scc_map::build_map): Mark SCCs that are
not trivial.
(scc_map::accepting): Always return false for trivial SCC.
(build_scc_stats): Fill in useless_scc_map.
* src/tgbaalgos/reachiter.hh (tgba_reachable_iterator::want_state):
New method.
* src/tgbaalgos/reachiter.cc (tgba_reachable_iterator::want_state):
Implement it.
(tgba_reachable_iterator::run): Call want_state before processing
a state.
counter updated each time we create a new (unique) formula.
Doing so saves a lot of memory during the translation of the
ltlcounter formulae, because the formulae are quite big and
storing a string representation of each formula on its node was a
bad idea. For instance with n=12, the translation now uses 40MB
where it used 290MB. (Note: in both cases, 20MB is being used by
the BDD cache.)
* src/ltlast/formula.hh (hash_key_): Rename as ...
(count_): ... this.
(hash): Adjust.
(max_count): New static variable to count the number of
formulae created.
(formula): Update max_count and set count_.
(dump): Make it a virtual pure method.
(set_key_): Remove.
(formula_ptr_less_than): Speed up and return false when
the two formula pointer are equal.
* src/ltlast/formula.cc (set_key_, dump): Remove.
* src/ltlast/atomic_prop.cc, src/ltlast/atomic_prop.hh,
src/ltlast/automatop.cc, src/ltlast/automatop.hh,
src/ltlast/binop.cc, src/ltlast/binop.hh, src/ltlast/constant.cc,
src/ltlast/constant.hh, src/ltlast/multop.cc,
src/ltlast/multop.hh, src/ltlast/unop.cc, src/ltlast/unop.hh:
Empty the constructor (do not precompute the dump_ anymore),
and add a dump() implementation.
* bench/ltl2tgba/algorithms: Use -l for all LaCIM invocations.
* src/tgbatest/dupexp.test, src/tgbatest/emptchk.test,
src/tgbatest/spotlbtt.test: Likewise.
* src/tgbatest/ltl2tgba.cc (syntax): Reorganize the help text, so
that we can find options without resorting to grep... Also
cleanup the program name if it is a libtool wrapper.
translation. It still is the default translation.
(opt_fm, opt_taa): Replace these two variables by ...
(translation): ... this enum. And use a switch to call the
correct translation.
much time when the formula is large, and it is useless when the
purpose is model-checking with Spin.
* src/tgbaalgos/neverclaim.hh (never_claim_reachable): Add the
comments option.
* src/tgbaalgos/neverclaim.cc (never_claim_bfs,
never_claim_reachable): Honor the comment option.
* src/tgba/tests/ltl2tgba.cc (-N): Do not comment states.
(-NN) New option to output a commented never claim.
* src/tgbaalgos/ltl2taa.cc: Do NOT use the same bdd_dict for both
the translation and the language containment checker.
* src/tgbatest/spotlbtt.test: Update TAA related tests.
This gives a nice speedup (>1.4) in the ltlcounter benchmark,
because we no longer have to generate a copy the string
representations of the LTL formulae.
* src/tgbaalgos/ltl2tgba_fm.cc: Adjust. Also get rid of the
formulae_seen map, since we can now ask the tgba_explicit_formula
if it knows the state.
tgba_explicit instances labelled by other objects than strings.
* src/tgba/tgbaexplicit.cc, src/tgba/tgbaexplicit.hh:
Split tgba_explicit in two levels: tgba_explicit with unlabelled
states, and tgba_explicit_labelled templated by the type of
the label. Define tgba_explicit_string (with the interface
of the former tgba_explicit class) and tgba_explicit_formula
for future use in ltl2tgba.cc.
* src/tgba/tgbareduc.cc, src/tgba/tgbareduc.hh,
src/tgbaalgos/cutscc.cc, src/tgbaalgos/dupexp.cc,
src/tgbaalgos/emptiness.cc, src/tgbaalgos/ltl2tgba_fm.cc,
src/tgbaalgos/powerset.cc, src/tgbaalgos/randomgraph.cc,
src/tgbaparse/public.hh, src/tgbaparse/tgbaparse.yy,
src/tgbatest/explicit.cc, src/tgbatest/ltl2tgba.cc: Adjust to
use tgba_explicit_string when appropriate.
Before this patch, every time you cloned a formula, the clone
visitor would recurse into the entire AST to increment the
reference count of all nodes. When running ltl2tgba_fm on
the formula generated by "LTLcounterLinear.pl 8", approx 27% of
the time was spent in the clone visitor.
After this patch, cloning a formula is just an increment of the
reference count of the top node. Children are decremented only
when the top node's ref count is decremented to zero. With this
change, clone() and destroy() become constant time, the
ltl2tgba_fm spend only 0.01% of the time cloning formulae.
* src/ltlast/automatop.cc (~automatop): Decrement children.
(instance): Decrement children if the instance already exists.
* src/ltlast/binop.cc, src/ltlast/multop.cc, src/ltlast/unop.cc:
Likewise.
* src/ltlvisit/clone.cc (clone): Simplify, now we only need to
call ref().
* src/ltlvisit/destroy.cc (destroy): Simplify, now we only need
to call unref().
(destroy_visitor): Remove, no longer needed.
* src/ltlast/automatop.cc, src/ltlast/automatop.hh,
src/ltlast/binop.cc, src/ltlast/binop.hh, src/ltlast/multop.cc,
src/ltlast/multop.hh, src/ltlast/unop.cc, src/ltlast/unop.hh:
Add a dump_instance() static method to all class.
* src/ltltest/readltl.cc: Add option -r to dump all instances
with their reference count, after parsing and after deletion.
* src/ltlast/unop.hh (map): Use unop* as values.
* src/ltlast/binop.hh (map): Use binop* as values.
* src/ltlast/multop.hh (map): Use multop* as values.
* src/ltlast/automatop.hh (paircmp): Rename as tripletcmp.
(map): Use automaton* as values, not formula*.
* src/ltlast/automatop.hh, src/ltlast/automatop.cc: Add missing
instance_count() functions.
* src/tgbatests/eltl2tgba.cc: Add missing instance_count()
assertions at the end.
* src/tgbatests/ltl2tgba.cc: Also call automatop::instance_count(),
even if automatop are not used in ltl2tgba yet. This way we won't
forget once eltl2tgba and ltl2tgba are merged.
* src/tgbatest/defs.in (srcdir): Adjust from VPATH builds.
* src/tgbatest/ltlcounter.test (lcdir): Adjust definition to
new value of $srcdir.
(run): Fix setting of $run after $n = 2. Using run=: would in
fact disable all the big tests...
* src/ltlast/formula.hh (formula_ptr_less_than::operator()):
Fix a typo where `l' was typed as `1'.
* src/tgbatest/ltlcounter/: New files from Kristin Y. Rozier.
* src/tgbatest/ltlcounter.test: New
* src/tgbatest/Makefile.am (TESTS): Add ltlcounter.test.
(EXTRA_DIST): Add files in ltlcounter/.
constructor. It does the same thing as the default copy
constructor, and g++ 4.2.3 complained that the copy constructor
of spot::state was not called. Reported by Denis Poitrenaud.
* src/tgbaalgos/scc.cc (dump_scc_dot): Escape labels and other
strings output between quote in dot.
* src/tgbatest/kv.test: New file.
* src/tgbatest/Makefile.am (TESTS): Add it.
* src/tgba/taa.cc, src/tgba/taa.hh: taa_succ_iterator is not
on-the-fly anymore allowing some redundant transitions to be
removed. Also a new function to output a TAA.
* src/tgbaalgos/ltl2taa.cc, src/tgbaalgos/ltl2taa.hh: Add the
refined rules from Tauriainen.
* src/tgbatest/ltl2tgba.cc: Use -c to activate refined rules in
ltl_to_taa.
* src/tgbatest/spotlbtt.test: More tests.
TGBA which uses TAA as an intermediate representation. This is a
basic version, optimizations and enhancements will come later.
* src/tgbaalgos/ltl2taa.cc, src/tgbaalgos/ltl2taa.hh: The algortihm.
* src/tgbaalgos/Makefile.am: Adjust.
* src/tgbatest/ltl2tgba: New option: -taa, which uses this new
translation algorithm.
* src/tgbatest/spotlbtt.test: Add ltl2tgba -taa.
* misc/Makefile.am, misc/bbop.cc, misc/bddop.hh: Factorize some
code on BDDs to compute all_acceptance_conditions from
neg_acceptance_condition.
* src/tgba/Makefile.am, src/tgbatest/Makefile.am: Adjust.
* src/tgba/taa.cc, src/tgba/taa.hh: The TAA class.
* src/tgba/tgbaexplicit.hh: Use the factorized code in bddop.hh.
* src/tgbatest/taa.cc, src/tgbatest/taa.test: Some test cases.
the original automaton has no acceptance condition.
* src/tgba/tgbasgba.cc, src/tgba/tgbasgba.hh: New option:
when the original automaton has no accepting condition, it
explicitly considers that every state is accepting.
shared_ptr on states...
* src/tgba/state.hh: ... here.
* src/tgbatest/complementation.test: Do not apply some tests on
the new algorithm because it takes to much time to run.
* src/tgba/tgbacomplement.cc, src/tgba/tgbacomplement.hh: The
construction.
* src/tgbatest/Makefile.am: Adjust.
* src/tgbatest/complementation.cc: Add options to support this
construction in addition to Safra construction.
* src/tgba/Makefile.am: Adjust.
* src/tgbatest/complementation.test: Adjust to test also this
complementation.