Commit graph

1454 commits

Author SHA1 Message Date
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
Guillaume Sadegh
1f19198d2d [LBTT] Add a missing include.
* src/translate.cc: exit(2) requires cstdlib.
2010-01-17 02:15:08 +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
Alexandre Duret-Lutz
d462f50b59 [buddy]
Inline bdd_addref() and bdd_delref() to speedup BDD operations.

* src/kernel.c, src/kernel.h (bdd_addref, bdd_delref): Move these
functions and there associated global variables...
* src/bdd.c (bdd_error): ... and this function ...
* src/bdd.h (bdd_addref, bdd_delref, bdd_error): ...here so that
they can be inlined.
2009-12-09 14:05:54 +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
3cbd681c6d [lbtt]
Fix generation of random formulae on 64bits systems.

* src/main.cc (testLoop): Generate random short ints between 0 and
SHRT_MAX, not between 0 and LONG_MAX.  On systems where long ints
are 64bits, LRAND(0,LONG_MAX) was returning a value with the lower
32 bits set to 0, and the latter truncation to short int always
yielded the value 0.  Consequently all generated formulae were
identical...
2009-11-26 15:51:01 +01:00
Alexandre Duret-Lutz
c95eb21ecf [lbtt]
* src/Configuration.cc (registerAlgorithm): Do not complain about
a missing path for disabled algorithms.
2009-11-25 18:07:55 +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
253ee35030 [buddy]
Introduce bdd_satprefix, to speedup spot::minato().

* src/bdd.h (bdd_satprefix): New function.
* src/bddop.c (bdd_satprefix, bdd_sat_prefixrec): New functions.
2009-11-23 21:40:26 +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