Commit graph

1400 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
1e19aa3a5f * src/tgbatest/ltl2tgba.cc (main): Stop the SCC timer. I mean
really stop it!
2009-11-25 18:06:46 +01:00
Alexandre Duret-Lutz
b796bb3d0a Detect running timers, and stop a timer in ltl2tgba.
* src/misc/timer.hh (time_info::running): New attribute.
(time_info::start, time_info::stop): Update and check
time_info::running.
* src/misc/timer.cc (timer_map::print): Mark running timers with
a "+" in the output.
* src/tgbatest/ltl2tgba.cc (main): Rename the name of the timers
for SCC and simulation reduction, and actually stop the SCC timer.
2009-11-24 11:47:42 +01:00
Alexandre Duret-Lutz
ab02ee60fe * src/tgbaalgos/sccfilter.cc (create_transition): Do not clone
the same node twice when dealing with loops.
2009-11-23 22:24:55 +01:00
Alexandre Duret-Lutz
9a14d28a06 Use bdd_satprefix() to speedup minato on BDDs that are almost cubes.
* src/misc/minato.cc (minato_isop::minato_isop): Call bdd_satprefix.
(minato_isop::next): Avoid useless intermediate variables.
* src/misc/minato.hh: Typo in comments.
2009-11-23 21:58:00 +01:00
Alexandre Duret-Lutz
81e0872b5d Specialize scc_filter when handling tgba_explicit_formula automata.
If the input is a tgba_explicit_formula we can output a
tgba_explicit_formula too, and we want to do that because it is
more space efficient.

* src/tgba/tgbaexplicit.hh (get_label): New method.
* src/tgbaalgos/sccfilter.cc (create_transition): New function,
to handle tgba_explicit_formula and tgba_explicit_string output
differently.
(filter_iter): Template it on the output tgba type, and adjust
to call create_transition.
(scc_filter): Use filter_iter<tgba_explicit_formula> or
filter_iter<tgba_explicit_string> depending on the input tgba
type.
2009-11-23 10:19:38 +01:00
Alexandre Duret-Lutz
dfb9c6622b Strip useless acceptance conditions in scc_filter().
A useless acceptance conditions is one that is always implied by
another.

* src/misc/bddop.hh, src/misc/bddop.cc
(compute_neg_acceptance_conditions): New function.
* src/tgba/tgbaexplicit.hh, src/tgba/tgbaexplicit.cc
(set_acceptance_conditions): New function.
* src/tgbaalgos/scc.cc (build_map, build_scc_stats, dump_scc_dot):
Keep track of useful acceptance conditions.
(useful_acc_of): New function.
* src/tgbaalgos/scc.hh (scc_stats, scc_map::scc::useful_scc): New
attributes.
* src/tgbaalgos/sccfilter.cc (filter_iter): Adjust to filter
useless acceptance conditions.
(scc_filter): Compute useful acceptance conditions and pass them
to filter_iter.
2009-11-20 19:21:12 +01:00
Alexandre Duret-Lutz
5d427f6d15 * src/tgbaalgos/sccfilter.cc (scc_filter): Merge transitions
after removing acceptance conditions.
2009-11-20 15:33:40 +01:00
Alexandre Duret-Lutz
7ac3c5e70c Remove prune_scc(), prune_acc(), and related fonctions.
* src/tgba/tgbareduc.cc, src/tgba/tgbareduc.hh (prune_scc,
prune_acc, remove_component, compute_scc, remove_acc,
is_not_accepting, delete_scc, is_terminal, remove_scc,
display_scc): Remove anything related to the simplification of
SCCs.
2009-11-18 18:22:53 +01:00
Alexandre Duret-Lutz
7ea51cc65f Replace prune_scc() by scc_filter().
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().
2009-11-18 18:22:45 +01:00
Alexandre Duret-Lutz
74f620d192 Quick implementation of a "useless SCC" filter using scc_map.
* src/tgbaalgos/sccfilter.hh, src/tgbaalgos/sccfilter.cc: New
files.
* src/tgbaalgos/Makefile.am: Add them.
2009-11-18 15:36:35 +01:00
Alexandre Duret-Lutz
99981153e6 Fix acceptance check in scc_map: trivial SCCs are not accepting.
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.
2009-11-18 15:18:40 +01:00
Alexandre Duret-Lutz
ac5dda1032 Make it easy to filter states while iterating over an automaton.
* 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.
2009-11-18 14:54:53 +01:00
Alexandre Duret-Lutz
38148f87f8 * src/tgbaalgos/cutscc.cc (cut_scc): Pass `s' by reference instead
of by pointer.
* src/tgbaalgos/cutscc.cc, src/tgbaalgos/cutscc.hh: Fix copyright
header.
2009-11-17 16:48:42 +01:00
Alexandre Duret-Lutz
f2be64dd2c Replace the hash key construction of LTL formulae by a simple
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.
2009-11-13 18:13:59 +01:00
Alexandre Duret-Lutz
8cdc196719 Use -l wherever we where expecting ltl2tgba to default to LaCIM.
* bench/ltl2tgba/algorithms: Use -l for all LaCIM invocations.
* src/tgbatest/dupexp.test, src/tgbatest/emptchk.test,
src/tgbatest/spotlbtt.test: Likewise.
2009-11-12 16:46:04 +01:00
Alexandre Duret-Lutz
c9b65cff71 Cleanup the help of ltl2tgba.
* 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.
2009-11-12 16:38:24 +01:00
Alexandre Duret-Lutz
8ccc2b81c1 * src/tgbatest/ltl2tgba.cc (-l): New option to select the lacim
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.
2009-11-12 15:30:55 +01:00
Alexandre Duret-Lutz
49d1abbda7 Remove python bindings for ltl::clone and ltl::destroy.
* wrap/python/spot.i: Do not include clone.hh and destroy.hh.
2009-11-11 11:13:00 +01:00
Alexandre Duret-Lutz
7c946878e4 Typo from a previous patch.
* src/tgbaalgos/ltl2tgba_fm.cc (ltl_to_tgba_fm): Fix a typo
introduced three patches ago in the handling of unobserved events.
2009-11-11 00:01:14 +01:00
Alexandre Duret-Lutz
8c6a2b33d9 Do not comment states in the never claim by default. It takes too
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.
2009-11-10 17:46:25 +01:00
Damien Lefortier
1d8b115b83 * src/tgba/taa.cc, src/tgba/taa.hh: Fix it.
* 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.
2009-11-10 17:43:43 +01:00
Alexandre Duret-Lutz
007e2bd0b9 Use tgba_explicit_formula instead of tgba_explicit_string in FM.
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.
2009-11-10 17:24:39 +01:00
Alexandre Duret-Lutz
32a4647d03 Ease debugging of LTL formulae leaks.
* src/tgbatest/ltl2tgba.cc: Dump all LTLinstances with their
reference count.
2009-11-10 16:57:36 +01:00
Alexandre Duret-Lutz
4e22bb8b09 Introduce tgba_explicit_labelled<label> so that we can build
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.
2009-11-10 16:57:28 +01:00
Alexandre Duret-Lutz
d3dcecc6c3 Do not use the Boost macro from the Autoconf macro archive.
* m4/boost.m4: Rewrite like I already did in Vaucanson.
2009-11-09 17:02:40 +01:00
Alexandre Duret-Lutz
39912aa51e * src/tgbatest/ltlcounter.test (run): Do not run with n=12, as
the test case might become too slow for the autobuilder.
2009-11-09 16:10:58 +01:00
Alexandre Duret-Lutz
3ce1627251 Add a benchmark using Kristin Y. Rozier's LTLcounter scripts.
* bench/ltlcounter/README, bench/ltlcounter/run,
bench/ltlcounter/plot.gnu, bench/ltlcounter/defs.in,
bench/ltlcounter/Makefile.am: New files.
* bench/Makefile.am (SUBDIRS): Add ltlcounter.
* configure.ac (AC_CONFIG_FILES): Adjust.
* THANKS: Add her.
2009-11-09 12:15:24 +01:00
Alexandre Duret-Lutz
e539226e13 Use a timer to clock the different phases of the translation.
* src/tgbatest/ltl2tgba.cc: Add option -T.
2009-11-09 12:14:20 +01:00
Alexandre Duret-Lutz
77df39b4dd Deprecate ltl::destroy(f) in favor of f->destroy()
* src/ltlast/formula.cc, src/ltlast/formula.hh (formula::clone):
Transform this static function into a member function.
* src/ltlvisit/destroy.hh (destroy): Document and declare as
deprecated.
* bench/split-product/cutscc.cc, iface/gspn/ltlgspn.cc,
src/eltlparse/eltlparse.yy, src/eltltest/acc.cc,
src/evtgbaalgos/tgba2evtgba.cc, src/evtgbatest/ltl2evtgba.cc,
src/ltlast/automatop.cc, src/ltlast/binop.cc,
src/ltlast/multop.cc, src/ltlast/unop.cc, src/ltlenv/declenv.cc,
src/ltlenv/declenv.hh, src/ltlparse/ltlparse.yy,
src/ltltest/equals.cc, src/ltltest/randltl.cc,
src/ltltest/readltl.cc, src/ltltest/reduc.cc,
src/ltltest/syntimpl.cc, src/ltltest/tostring.cc,
src/ltlvisit/destroy.cc src/ltlvisit/basicreduce.cc,
src/ltlvisit/contain.cc, src/ltlvisit/reduce.cc,
src/ltlvisit/syntimpl.cc, src/tgba/bdddict.cc,
src/tgba/bddprint.cc, src/tgba/taa.cc,
src/tgba/tgbabddconcretefactory.cc, src/tgba/tgbaexplicit.cc,
src/tgba/tgbafromfile.cc, src/tgbaalgos/eltl2tgba_lacim.cc,
src/tgbaalgos/ltl2taa.cc, src/tgbaalgos/ltl2tgba_fm.cc,
src/tgbaalgos/ltl2tgba_lacim.cc, src/tgbaalgos/neverclaim.cc,
src/tgbaalgos/randomgraph.cc, src/tgbaparse/tgbaparse.yy,
src/tgbatest/complementation.cc, src/tgbatest/eltl2tgba.cc,
src/tgbatest/ltl2tgba.cc, src/tgbatest/ltlprod.cc,
src/tgbatest/mixprod.cc, src/tgbatest/randtgba.cc,
src/tgbatest/reductgba.cc, wrap/python/cgi/ltl2tgba.in,
wrap/python/tests/ltl2tgba.py, wrap/python/tests/ltlparse.py,
wrap/python/tests/ltlsimple.py: Adjust destroy() usage, and remove
the #include "destroy.hh" when appropriate.
2009-11-09 07:13:31 +01:00
Alexandre Duret-Lutz
48fb19ea44 Deprecate ltl::clone(f) in favor of f->clone().
* src/ltlvisit/clone.hh (clone): Document and declare as deprecated.
* src/ltlast/formula_tree.cc, src/ltlvisit/basicreduce.cc,
src/ltlvisit/clone.cc, src/ltlvisit/contain.cc,
src/ltlvisit/lunabbrev.cc, src/ltlvisit/reduce.cc,
src/ltlvisit/syntimpl.cc, src/tgba/bdddict.cc,
src/tgba/formula2bdd.cc, src/tgba/tgbabddconcretefactory.cc,
src/tgbaalgos/ltl2taa.cc, src/tgbaalgos/ltl2tgba_fm.cc,
src/tgbatest/complementation.cc, wrap/python/tests/ltlsimple.py:
Adjust clone() usage, and remove the #include "clone.hh" when
appropriate.
2009-11-09 07:13:31 +01:00
Alexandre Duret-Lutz
e44f1b8997 Make it possible to clone const formulae.
* src/ltlast/formula.hh, src/ltlast/formula.cc (clone): Declare
as const.
2009-11-09 07:13:31 +01:00
Alexandre Duret-Lutz
b0888257f8 Rename formula::ref and formula::unref as formula::clone
and formula::destroy.

* src/ltlast/atomic_prop.cc, src/ltlast/automatop.cc,
src/ltlast/binop.cc, src/ltlast/formula.hh, src/ltlast/formula.cc,
src/ltlast/multop.cc, src/ltlast/unop.cc, src/ltlenv/declenv.cc,
src/ltlvisit/basicreduce.cc, src/ltlvisit/clone.cc,
src/ltlvisit/destroy.cc, src/ltlvisit/nenoform.cc,
src/ltlvisit/randomltl.cc, src/ltlvisit/reduce.cc,
src/tgbatest/randtgba.cc: Adjust.
2009-11-09 07:13:31 +01:00
Alexandre Duret-Lutz
8e4e692e7f Change the way references are counted to speedup cloning.
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.
2009-11-09 07:13:31 +01:00
Alexandre Duret-Lutz
631f4b5bea Make it easier to debug reference counts in LTL nodes.
* 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.
2009-11-09 07:13:31 +01:00
Alexandre Duret-Lutz
3488bf45e0 Better types for instance maps.
* 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*.
2009-11-09 07:13:31 +01:00
Alexandre Duret-Lutz
f2e941cd07 Add missing instance_count() in automatop and eltl2tgba.
* 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.
2009-11-09 07:13:31 +01:00
Damien Lefortier
09bba54b5f * src/tgba/taa.cc, src/tgbatest/taa.cc: Adjust. 2009-11-07 19:20:16 +01:00
Damien Lefortier
11ecdf2b86 * src/tgba/taa.cc, src/tgba/taa.hh: Speed up the cartesian product
in taa_succ_iterator and allow multiple initial states in taa.
* src/tgba/ltl2taa.cc: Remove temporary printing.
2009-11-07 15:50:45 +01:00
Alexandre Duret-Lutz
eab1261437 Fix ltlcounter.test for VPATH builds and n > 2.
* 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...
2009-11-05 21:34:40 +01:00
Alexandre Duret-Lutz
b57fdcb684 * src/tgbatest/ltlcounter.test (run): Only construct small
formulae (i.e. n<=2) under valgrind.  The test case is too
slow otherwise.
2009-11-05 14:12:47 +01:00
Alexandre Duret-Lutz
24527d6f99 Fix spurious failure of style.test.
* src/sanity/style.test: Make sure sh does not abort when read
exits with false.
2009-11-04 18:29:38 +01:00
Alexandre Duret-Lutz
6fb7e9faff Fix a longstanding bug reported by Kristin Y. Rozier..
* 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/.
2009-11-04 18:29:30 +01:00
Alexandre Duret-Lutz
24b78fde34 Fix the help text of ltl2tgba.
* src/tgbatest/ltl2tgba.cc (syntax): Add missing std::endl
before -taa.  Remove -r8 and -fr8, since they do not exist.
2009-11-03 16:35:54 +01:00
Alexandre Duret-Lutz
cb6b74f5ec * src/tgba/tgbacomplement.cc (state_complement): Remove the copy
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.
2009-10-28 14:42:51 +01:00
Alexandre Duret-Lutz
8901d0d5be * src/ltlast/formula_tree.cc (instanciate, arity): Add a useless
return 0 at the end to prevent g++ 4.2.3 from complaining about
a missing return.  Reported by Denis Poitrenaud.
2009-10-28 14:24:26 +01:00
Alexandre Duret-Lutz
802754c60a * src/tgbatest/kv.test: Don't run valgrind on dot! 2009-10-23 14:32:39 +02:00
Alexandre Duret-Lutz
913637a7ae Escape labels in -KV output.
* 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.
2009-10-22 18:20:36 +02:00
Alexandre Duret-Lutz
4d8239e855 * src/tgbaalgos/ltl2tgba_fm.cc: Typos. 2009-10-22 18:20:35 +02:00
Damien Lefortier
7ce27ef994 Improve ltl_to_taa.
* 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.
2009-10-22 16:18:31 +02:00
Damien Lefortier
9f47dde5a7 Fix make check in sanity.
* src/tgba/taa.cc, src/tgbaalgos/ltl2taa.cc: Fix style.
2009-10-17 13:47:59 +02:00