Commit graph

1351 commits

Author SHA1 Message Date
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
Damien Lefortier
84060b49e5 Minor fixes.
* src/misc/bddop.hh, src/tgba/taa.hh, src/tgbaalgos/ltl2taa.hh:
Fix sanity (incorrect include guard).
* src/tgba/tgbacomplement.cc, src/tgba/tgbacomplement.hh:
Copyright 2009.
* src/tgbaalgos/eltl2tgba_lacim.cc: Use abbreviations.
* src/tgbatest/taa.cc: Fix it.
2009-10-16 17:48:47 +02:00
Damien Lefortier
627b667712 Add a new algorithm (from Tauriainen) to translate LTL formulae to
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.
2009-10-16 17:04:47 +02:00
Damien Lefortier
20c1f01e48 Add a class to represent Transition-based Alternating Automata (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.
2009-10-16 17:03:58 +02:00
Alexandre Duret-Lutz
98215ed9a4 more authors 2009-10-07 18:04:43 +02:00
Alexandre Duret-Lutz
b7db0c3085 [buddy] Fix the previous patch in reorder.c 2009-10-01 13:33:36 +02:00
Guillaume Sadegh
44ab903b86 The sgba proxy adds an acceptance condition to every states when
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.
2009-10-01 00:35:54 +02:00
Guillaume Sadegh
6d18623e4b * src/tgba/tgbacomplement.cc: Move functions related to
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.
2009-10-01 00:32:06 +02:00
Guillaume Sadegh
d6e22c0674 A new complementation construction based on ranking.
* 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.
2009-10-01 00:32:06 +02:00
Guillaume Sadegh
d037008cdc * src/ltltest/randltl.cc, src/ltltest/reduc.test,
src/tgbatest/dfs.test: Adjust headers to 80 columns.
2009-10-01 00:32:06 +02:00
Guillaume Sadegh
8f5f0354ad A wrapper around tgba to produce state-labeled automata.
* src/tgba/tgbasgba.hh, src/tgba/tgbasgba.hh: Here.
* src/tgbatest/ltl2tgba.cc: New option `-lS' for state-labeled
automata.
* src/tgba/Makefile.am: Adjust and sort files in tgba_HEADERS
and libtgba_la_SOURCES.
2009-10-01 00:32:06 +02:00
Guillaume Sadegh
9775dd9701 Rename files related to Safra complementation.
* src/tgba/tgbacomplement.cc, src/tgba/tgbacomplement.hh: Rename
as...
* src/tgba/tgbasafracomplement.cc,
src/tgba/tgbasafracomplement.hh: ... these, and adjust class name.
* src/tgba/Makefile.am, src/tgbatest/Makefile.am: Adjust.
* src/tgbatest/complementation.cc: Adjust.
2009-10-01 00:32:06 +02:00
Alexandre Duret-Lutz
1208365b8c Fix previous patch.
* src/tgbaalgos/scc.cc (scc_map::update_supp_rec): Also take the
label of the outgoing edges into account.
2009-09-28 15:29:31 +02:00
Alexandre Duret-Lutz
fd0de04d24 Optimize previous patch.
* src/tgbaalgos/scc.hh (scc_map::scc::supp_rec): Initialize to
bddfalse, since this cannot occur in reallife.
* src/tgbaalgos/scc.cc (scc_map::update_supp_rec): Adjust.
2009-09-18 10:39:07 +02:00
Alexandre Duret-Lutz
fa8dd7f160 Have scc_map keep track of APs that are reachable from a SCC.
* src/tgbaalgos/scc.hh (scc_map::scc): Add a supp_rec member to
hold reachable APs.
* src/tgbaalgos/scc.cc (scc_map::update_supp_rec): New function,
to update supp_rec.
(scc_map::build_map): Call it.
(scc_map::aprec_set_of): New function.
(dump_scc_dot): Show the output of aprec_set_of().
2009-09-17 17:56:55 +02:00
Alexandre Duret-Lutz
b3486965a0 Have scc_map keep track of APs that are occurring in a SCC.
* src/tgbaalgos/scc.hh (scc_map::scc): Add a supp member to hold APs.
* src/tgbaalgos/scc.cc (scc_map::build_map): Update supp.
(scc_map::ap_set_of): New function.
(dump_scc_dot): Show the output of ap_set_of().
2009-09-17 15:06:30 +02:00
Alexandre Duret-Lutz
ada681d813 [buddy] Fix some issues reported by LLVM/Clang's static analyser. 2009-09-08 11:05:45 +02:00
Damien Lefortier
995335618a Fix some memory leaks.
* src/eltlparse/eltlparse.yy: Free the automatop::vec when
CHECK_ARITY fails while parsing an automatop.
* src/eltltest/acc.cc: Free all constructed formulae.
2009-09-07 16:41:49 +02:00
Alexandre Duret-Lutz
4964c9a1a4 Fix a memory leak in reduce_tau03().
* src/ltlvisit/contain.cc (reduce_tau03_visitor::visit): Free
the operand array when a multop reduces to a constant.
2009-09-07 16:10:40 +02:00
Alexandre Duret-Lutz
058bb83c6d Fix a memory leak in randltl.
* src/ltltest/randltl.cc: Free the atomic properties from AP
before exit.
2009-09-07 14:35:35 +02:00
Damien Lefortier
edd4b2b532 Add an algorithm (from Couvreur) working on BDDs to reduce the
size of TGBAs represented as BDDs by deleting unaccepting SCCs.

* src/eltlparse/eltlparse.yy: Remove a warning.
* src/tgba/tgbabddconcrete.cc, src/tgba/tgbabddconcrete.hh,
src/tgba/tgbabddcoredata.cc, src/tgba/tgbabddcoredata.hh: Add a
new function delete_unaccepting_scc in both classes.
* src/tgbatest/eltl2tgba.cc, src/tgbatest/spotlbtt.test: Use this
new function in LaCIM for ELTL and bench it.
* src/tgbatest/defs.in: Fix it.
* bench/ltl2tgba/algorithms, bench/ltl2tgba/defs.in: Add LaCIM for
ELTL in benchs.
2009-09-07 14:26:42 +02:00
Alexandre Duret-Lutz
dc8cb56b67 Fix path to libtool in test suites.
* src/ltltest/defs.in, src/eltltest/defs.in, src/tgbatest/defs.in,
src/evtgbatest/defs.in (run): Use ../../../libtool instead of
../../libtool, now that testcases have been moved down one directory.
2009-09-02 10:41:19 +02:00
Alexandre Duret-Lutz
1098c62de2 Use Automake 1.11's parallel-tests feature.
* configure.ac: Enable parallel-tests.
* src/eltltest/defs.in, src/evtgbatest/defs.in,
src/ltltest/defs.in, src/tgbatest/defs.in: Always output verbose
tests.  Make a subdirectory for each test case.
* src/ltltest/Makefile.am, src/eltltest/Makefile.am,
src/tgbatest/Makefile.am, src/evtgbatest/Makefile.am: Remove
CLEANFILES and clean the test subdirectories in a distclean-local
rule instead.
* src/eltltest/acc.test, src/eltltest/nfa.test,
src/evtgbatest/explicit.test, src/evtgbatest/ltl2evtgba.test,
src/evtgbatest/product.test, src/evtgbatest/readsave.test,
src/ltltest/equals.test, src/ltltest/lunabbrev.test,
src/ltltest/nenoform.test, src/ltltest/parse.test,
src/ltltest/parseerr.test, src/ltltest/reduc.test,
src/ltltest/reduccmp.test, src/ltltest/syntimpl.test,
src/ltltest/tostring.test, src/ltltest/tunabbrev.test,
src/ltltest/tunenoform.test, src/tgbatest/bddprod.test,
src/tgbatest/complementation.test, src/tgbatest/dfs.test,
src/tgbatest/dupexp.test, src/tgbatest/eltl2tgba.test,
src/tgbatest/emptchk.test, src/tgbatest/emptchke.test,
src/tgbatest/emptchkr.test, src/tgbatest/explicit.test,
src/tgbatest/explpro2.test, src/tgbatest/explpro3.test,
src/tgbatest/explpro4.test, src/tgbatest/explprod.test,
src/tgbatest/ltl2neverclaim.test, src/tgbatest/ltl2tgba.test,
src/tgbatest/ltlprod.test, src/tgbatest/mixprod.test,
src/tgbatest/readsave.test, src/tgbatest/reduccmp.test,
src/tgbatest/reductgba.test, src/tgbatest/scc.test,
src/tgbatest/spotlbtt.test, src/tgbatest/tgbaread.test,
src/tgbatest/tripprod.test: Adjust to run from a subdirectory.
2009-09-02 10:41:19 +02:00
Alexandre Duret-Lutz
1f7aa90d74 more files to ignore 2009-09-02 10:41:18 +02:00
Alexandre Duret-Lutz
f22b5ae371 * configure.ac: Switch to Automake 1.11 and enable color-tests. 2009-09-02 10:41:18 +02:00
Alexandre Duret-Lutz
43ba3f8378 [buddy] configure.ac: Switch from Libtool 1.5.x to Libtool 2.x, and add an AC_CONFIG_MACRO_DIR call. 2009-09-02 10:41:18 +02:00
Alexandre Duret-Lutz
9eecd6aed5 * configure.ac: Switch from Libtool 1.5.x to Libtool 2.x, and
add an AC_CONFIG_MACRO_DIR call.
* m4/libtool.m4, tools/ltmain.sh: Remove.
2009-09-02 10:41:15 +02:00
Flix Abecassis
b19ea79f43 Add TGBA union implementation.
* src/tgba/tgbaunion.cc, src/tgba/tgbaunion.hh: New files.
Union of two TGBAs.
* src/tgba/Makefile.am: Adjust.
2009-07-30 16:48:01 +02:00