Commit graph

1230 commits

Author SHA1 Message Date
Guillaume Sadegh
cbdb0feb68 * src/sanity/readme.test: A script to check whether all the
directories referenced in README exist.
* src/sanity/Makefile.am: Adjust to call `readme.test' when make
check is invoked.
2010-01-24 03:06:00 +01:00
Guillaume Sadegh
3633fced1d Update the README.
* README: Reference src/saba/, src/sabaalgos/, src/sabatest/,
iface/nips/, iface/nips/nipstest/ and iface/nips/nips_vm/.
2010-01-24 02:48:31 +01:00
Alexandre Duret-Lutz
391372ae2a Turn parse_error_list into an opaque type for Swig. This
kills a memory leak warning from swig/python.

* src/ltlparse/public.hh (parse_error_list): Declare
as an empty struct for Swig.
* wrap/python/tests/ltlparse.py: Fix copyright.
2010-01-22 17:29:12 +01:00
Alexandre Duret-Lutz
919fc298ff Fix the computation of the length of multops.
* src/ltlvisit/length.cc (visit(multop*)): New function. "a & b &
c" has length 5, not 4, even though it is stored as And(a,b,c).
This caused reduc.test to fail on some formulae.
2010-01-22 11:14:10 +01:00
Alexandre Duret-Lutz
e733f951be Please the style checks...
* src/tgbaalgos/randomgraph.cc: Fix the copyright and make it fit
on 80 columns.
2010-01-21 22:09:10 +01:00
Alexandre Duret-Lutz
38a1fadaa0 * src/ltltest/reduc.cc (main): Fix harmless memory leak introduced
today.
2010-01-21 16:56:44 +01:00
Alexandre Duret-Lutz
e663c222e5 Fix taa_tgba_formula's destructor.
* src/tgba/taatgba.cc (taa_tgba_formula::~taa_tgba_formula):
Really destroy all formulae, not only half of them.
2010-01-21 15:16:43 +01:00
Alexandre Duret-Lutz
eef27f4496 * src/tgbatest/randtgba.cc: Do not include <string> twice. 2010-01-21 14:55:01 +01:00
Alexandre Duret-Lutz
062045eb45 Speedup reduc.test by not spawning one process per formula.
* src/ltltest/reduc.cc: Add an option -f to read a lost of
formulae from a file.  Running a process for each formula was
too slow.  Also add an option -h to hide reduced formulae.
* src/ltltest/reduc.test: Simplify accordingly.
2010-01-21 14:54:36 +01:00
Alexandre Duret-Lutz
7262dff0d9 Move the last test from emptchk.test to emptchke.test.
* src/tgbatest/emptchk.test: Move the newly added test ...
* src/tgbatest/emptchke.test: ... here, with other explicit test.
Also test more algorithms.
2010-01-21 13:50:25 +01:00
Alexandre Duret-Lutz
79cb3ff512 Fix a memory leak in Cou99 statistics.
* src/tgbaalgos/gtec/ce.cc (couvreur99_check_result::acss_states):
Delete the iterator after using it.
* src/tgbatest/emptchkr.test: Run 'randtgba -z' with valgrind too.
2010-01-21 12:00:04 +01:00
Alexandre Duret-Lutz
99884e8e0f Fix a longstanding bug in our implementation of GV04.
* src/tgbaalgos/gv04.cc (push): Fix the tracking of the accepting
link.  This bug was discovered on a random generated graph with
a complex accepting cycle.
* src/tgbatest/emptchk.test: Add the troublesome graph as
test case.
2010-01-21 12:00:04 +01:00
Damien Lefortier
04827ef4a1 When iterating a hash_map, be careful not to delete i->first
before doing ++i to avoid memory issues.

* src/tgba/taatgba.cc, src/tgba/taatgba.hh,
src/tgba/tgbaexplicit.cc, src/tgba/tgbaexplicit.hh: Fix them.
2010-01-20 18:06:28 +01:00
Damien Lefortier
0d6fd3225a Minor fixes to compile with GCC 3.3
* src/ltlast/automatop.cc, src/ltlast/automatop.hh: Rename nfa as
get_nfa to avoid a name clash with the `nfa' class.
* src/ltlvisit/clone.cc, src/ltlvisit/nenoform.cc,
src/ltlvisit/tostring.cc, src/tgbaalgos/eltl2tgba_lacim.cc: Use
get_nfa instead of nfa.
* src/tgba/tgbasafracomplement.cc: Don't use a
const_reverse_iterator.
2010-01-20 18:06:00 +01:00
Alexandre Duret-Lutz
dcf7eed11f Remove some non-determinism in random_graph()
* src/tgbaalgos/randomgraph.cc (random_graph): Revert the part of
the patch from 2007-02-06 which silently replaced the use of state
index by state pointers.  Storing states pointer in this map cause
some non-determinism because of the memory layout.  It was almost
impossible to reproduce bugs found by tests based on randtgba.
2010-01-20 15:24:29 +01:00
Damien Lefortier
9fb8701667 * src/tgbaalgos/ltl2taa.cc: Fix the previous patch. 2010-01-19 10:43:43 +01:00
Damien Lefortier
9cebcdc124 * src/tgba/taatgba.cc, src/tgba/taatgba.hh: Fix memory issues
occuring when labels are pointers.
* src/tgbaalgos/ltl2taa.cc: Fix a bug.
* src/tgbatest/ltl2tgba.cc: Fix a bug.
2010-01-18 18:27:53 +01:00
Guillaume Sadegh
be78c82e44 * src/saba/sabacomplementtgba.cc: Fix a bug. 2010-01-17 02:16:10 +01:00
Damien Lefortier
beb3744581 Use taa_tgba_formula instead of taa_tgba_string in ltl_to_taa to
speed up a little the translation.

* src/tgbaalgos/ltl2taa.cc: Adjust.  Also fix a bug with
acceptance conditions in all_n_tuples.
* src/tgba/taatgba.cc, src/tgba/taatgba.hh: Adjust.
2010-01-17 00:50:37 +01:00
Damien Lefortier
7c20d8ae5d Introduce taa_tgba_labelled<label> so that we can build
taa_tgba instances labelled by other objects than strings
in the same way Alexandre did for tgba_explicit.

* src/tgba/taatgba.cc, src/tgba/taatgba.hh: Split taa_tgba in two
levels: taa_tgba with no label and taa_tgba_labelled templated by
the type of the label.  Define taa_tgba_string (with the interface
of the former taa_tgba class) and taa_tgba_formula for future use
in ltl2taa.cc.
* src/tgbaalgos/ltl2taa.cc, src/tgbatest/taatgba.cc: Adjust to use
taa_tgba_string.
2010-01-16 13:15:42 +01:00
Damien Lefortier
88df8c0a1d Fix a longstanding bug reported by Guillaume Sadegh.
* src/eltlparse/eltlscan.ll: Fix a typo.
2010-01-06 09:37:05 +01:00
Damien Lefortier
830e482836 Merge eltl2tgba.cc into ltl2tgba.cc.
* src/tgbatest/eltl2tgba.cc: Remove.
* src/tgbatest/Makefile.am: Adjust.
* src/tgbatest/ltl2tgba.cc: New option: -xltl to translate an
extended LTL instead of an LTL, a feature previously offered by
eltl2tgba.cc. Also: -R3b to use delete_unaccepting_scc.
* src/tgbatest/spotlbtt.test: Adjust.
2010-01-05 23:06:58 +01:00
Damien Lefortier
1aa10e1395 * src/tgba/tgbabddcoredata.cc (delete_unaccepting_scc): Fix a bug.
* src/tgbatest/spotlbtt.test: Use the above function with LaCIM
for ELTL which greatly reduce the size of the automata!
2009-12-18 12:19:07 +01:00
Alexandre Duret-Lutz
2a94402e82 * src/misc/timer.hh (timer::timer): Initialize running... 2009-12-11 11:38:20 +01:00
Alexandre Duret-Lutz
57c41de5f0 * src/Makefile.am (SUBDIRS): Fix missing ".", mistakenly removed
by previous patch.
2009-12-09 14:09:00 +01:00
Guillaume Sadegh
d659001f0e An algorithm to complement TGBA into SABA.
* src/saba/sabacomplementtgba.hh,
src/saba/sabacomplementtgba.cc: New.  The algorithm.
* src/saba/Makefile.am: Adjust.
* src/sabatest/sabacomplementtgba.cc, src/sabatest/Makefile.am,
src/sabatest/defs.in: New.  Test the algorithm.
* configure.ac, src/Makefile.am: Adjust to the new directory
`sabatest'.
2009-11-30 23:52:37 +01:00
Guillaume Sadegh
7cb6ff331d Add a new type of automata: State-labeled Alternating Büchi
Automata (SABA).

* src/saba/saba.hh, src/saba/saba.cc, src/saba/sabastate.hh,
src/saba/sabasucciter.hh: New.  Interface for
SABA (State-labeled Alternating Büchi Automata).
* src/saba/explicitstateconjunction.cc,
src/saba/explicitstateconjunction.hh: New.  Default
implementation for a conjunction of states.
* src/saba/Makefile.am: New.
* src/Makefile.am, configure.ac: Adjust.
* src/sabaalgos/sabareachiter.cc,
src/sabaalgos/sabareachiter.hh: New.  Iterate over all reachable
states of a spot::saba.
* src/sabaalgos/sabadotty.cc, src/sabaalgos/sabadotty.hh: New.
Print reachable states in dot format.
* src/sabaalgos/Makefile.am: New.
2009-11-30 23:24:47 +01:00
Guillaume Sadegh
f00aa49dc3 Rename the class taa as taa_tgba.
* src/tgba/taa.cc, src/tgba/taa.hh: Rename as ...
* src/tgba/taatgba.cc, src/tgba/taatgba.hh: ... these, and
rename the class taa as taa_tgba.
* src/tgbaalgos/ltl2taa.cc, src/tgbaalgos/ltl2taa.hh,
src/tgbaalgos/Makefile.am: Adjust.
* src/tgbatest/ltl2tgba.cc, src/tgbatest/Makefile.am: Adjust.
* src/tgbatest/taa.test: Rename as ...
* src/tgbatest/taatgba.test ... this.
* src/tgbatest/taa.cc: Rename as ...
* src/tgbatest/taatgba.cc ... this, and adjust.
2009-11-27 23:28:23 +01:00
Alexandre Duret-Lutz
d362e752d1 * src/tgbatest/ltl2tgba.cc (main): Fix typo to re-enable
reductions by simulation.
2009-11-26 17:40:21 +01:00
Alexandre Duret-Lutz
deff1a5ca7 * m4/buddy.m4 (AX_CHECK_BUDDY): Check for bdd_satprefix, the
latest function added to BuDDy.
2009-11-26 17:16:49 +01:00
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