Commit graph

1339 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
da571a151a * NEWS: Convert to utf-8 and fix a few typos. 2011-01-06 19:31:18 +01:00
Alexandre Duret-Lutz
256eb5bb15 '([]a && XXXX!a)' was not properly minimized because its
translation contain useless SCCs that where not ignored for
minimization.

* src/tgbaalgos/minimize.cc (minimize_wdba): Strip useless
SCCs before minimization.
* src/tgbatest/ltl2tgba.test: Add a check.
2011-01-06 19:25:38 +01:00
Alexandre Duret-Lutz
df2a950ed4 The neverclaim output by spin -f '([]a && XXXX!a)' was not
understood by Spot.

* src/neverparse/neverclaimparse.yy: Support "if :: false fi;"
instructions.  Spin sometimes output these on dead states.
Also rewrite the "transitions" rule as a left recursion.
* src/tgbatest/neverclaimread.test: Adjust output because
of the right->left recursion change, and add two more formula
to submit to Spin to test its output.
2011-01-06 19:25:38 +01:00
Alexandre Duret-Lutz
6cb5df0bd7 Speed up computation of non_final states for minimize_wdba.
* src/tgbaalgos/minimize.cc (minimize_dfa): Take final and
non_final sets.
(minimize_wdba): Fill in non_final at the same time as final.
(minimize_monitor): Call state_set() to fill non_final.
(init_sets): Simplify and rename as ...
(state_set): ... this.
2011-01-06 19:25:38 +01:00
Alexandre Duret-Lutz
474e69565b Introduce a class to complement a WDBA on-the-fly.
* src/tgba/wdbacomp.hh, src/tgba/wdbacomp.cc: New file.
* src/tgba/Makefile.am: Add them.
* src/tgbaalgos/minimize.cc (minimize_obligation): Use
wdba_complement().
2011-01-06 19:25:37 +01:00
Alexandre Duret-Lutz
b9dd72b29b * src/tgbatest/Makefile.am: Remove the unused minimize program.
* src/tgbatest/minimize.cc: Delete.
2011-01-05 23:12:33 +01:00
Alexandre Duret-Lutz
8c972ad3ce Cleanup the minimize.hh interface.
* src/tgbaalgos/minimize.hh, src/tgbaalgos/minimize.cc
(minimize): Split into ...
(minimize_wdba, minimize_monitor): ... these two functions.
* src/tgbatest/ltl2tgba.cc (main): Adjust the call to
minimize_monitor.
* wrap/python/cgi-bin/ltl2tgba.in: Adjust the calls to
minimize_monitor and minimize_obligation.
* wrap/python/spot.i: Declare minimize_monitor, minimize_wdba,
minimize_obligations.
* src/tgba/tgbaexplicit.hh (tgba_explicit_string)
(tgba_explicit_formula, tgba_explicit_number): Add fake
declarations so that SWIG can see they inherits from tgba.
2011-01-05 22:53:57 +01:00
Alexandre Duret-Lutz
92126a6cf9 Cleanup the DFA minimization algorithm.
* src/tgbaalgos/minimize.cc (minimize):  Move the minimization
code into...
(minimize_dfa): ... this new function, and fix the condition
under which a partition is considered to be minimal.  Also
use a map instead of a list to lookup known formulae.
2011-01-05 21:55:29 +01:00
Alexandre Duret-Lutz
ef317685c8 Speed up the obligation test.
* src/tgbaalgos/minimize.cc (minimize_obligation): Do not
minimize aut_neg_f, complement min_aut_f instead.
* src/tgbaalgos/minimize.hh: Adjust description.
2011-01-05 14:15:15 +01:00
Alexandre Duret-Lutz
f06fc8ac77 * src/tgbaalgos/minimize.cc (minimize): Use the Loeding algorithm
to label transient states.
2011-01-05 12:34:37 +01:00
Alexandre Duret-Lutz
358d4bfdf2 Rewrite the check of WDBA state acceptance in minimize().
* src/tgbaalgos/powerset.hh (power_map): New structure, allowing
the caller to retrieve the set of original states corresponding to
the set in the deterministic automaton.
(power_set): Adjust prototype to take a power_map instead of the
acc_list.
* src/tgbaalgos/powerset.cc (power_set): Strip all code using
acc_list, and update power_set.
* src/tgbaalgos/minimize.cc (minimize): Rewrite, using an
algorithm similar to the one in the Dax paper to check whether
state of the minimized automaton should be accepting.
2011-01-05 08:02:39 +01:00
Alexandre Duret-Lutz
37a8d1dc92 Add trivial() and one_state_of() functions to scc_map.
* src/tgbaalgos/scc.hh, src/tgbaalgos/scc.cc (scc_map::trivial,
scc_map::one_state_of): Two new helper functions.
2011-01-05 08:02:39 +01:00
Alexandre Duret-Lutz
5bc6d1d4ff * src/tgba/tgbaunion.hh: Remove one useless include. 2011-01-05 08:02:39 +01:00
Alexandre Duret-Lutz
3a8e1cdce0 * README: Mention bench/wdba/. 2011-01-05 08:02:39 +01:00
Alexandre Duret-Lutz
92756e49c8 Define tgba_product_init, a new kind of product with different
initial states.

* src/tgba/tgbaproduct.hh, src/tgba/tgbaproduct.cc
(tgba_product_init): New class.
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
f4e583d078 * src/tgbatest/spotlbtt.test: Add test for -l -R3b, showing many
failure because the minimization() algorithm is currently
incorrect when applied to non-weak automata.
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
607676d701 * src/tgbaalgos/scc.hh: Typo in documentation. 2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
907d173d6a Move the logic for detecting when the minimize() algorithm is
correct from ltl2tgba to the library.

* src/tgbaalgos/minimize.hh,
src/tgbaalgos/minimize.cc (minimize_obligation): New function.
* src/tgbatests/ltl2tgba.cc (main): Fix constness of automata,
and call minimize_obligation() for -R3b.
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
241ba112d6 Make minimization of obligation properties and deterministic
monitor available in the CGI script.

* wrap/python/spot.i: Declare the minimize() interface.
* wrap/python/cgi-bin/ltl2tgba.in: Add reduce_dmonitor and
reduce_wdba options.
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
edc71b807e Add a WDBA benchmark.
* bench/wdba/: New directory.
* bench/Makefile.am (SUBDIRS): Add wdba.
* NEWS: Mention it.
* configure.ac: Output bench/wdba/defs and bench/wdba/Makefile.
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
aadef1fd87 * NEWS: Update the news about minimization. 2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
d72a2f0a31 Speed up wdba.test, it was too slow for our buildfarm.
* src/tgbatest/wdba.test: Speed up execution by running only a
couple of formula with valgrind.  Half of those with`-l -R3b' and
the other half with `-f -R3'.
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
0392058e6e * src/tgbatest/ltl2tgba.cc (syntax): Regroup -M, -s, and -S option
under the same heading "automaton conversion".
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
cc8dd49d06 Preliminary support for monitors.
* src/tgbatest/ltl2tgba.cc (-M): New option for building
deterministic monitors.
* src/tgbaalgos/minimize.cc (minimize): Take a monitor
argument and adjust the code.
* src/tgbaalgos/minimize.hh (minimize): Document it.
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
a962bb6ddc "ltl2tgba -Rm -X foo.tgba" would fail.
* src/tgbatest/ltl2tgba.cc (main): Warn if -Rm is used without
knowing the formula whose automaton is minimized.
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
7d8a5310e4 Fix bugs in minimize().
* src/tgbaalgos/minimize.cc (init_sets, minimize): Fix memory
leaks and a usage of the wrong automaton.
* src/tgbatest/wdba.test: Try using -Rm with -R3 or -R3b, and with
valgrind.  This caught all the bugs fixed above.
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
72139fd760 Fix bugs in minimize(), caught by spotlbtt.test.
* src/tgbaalgos/minimize.cc (minimize): Don't add acceptance
conditions if the final set is empty.
* src/tgbaalgos/powerset.cc (tgba_powerset): Add the initial state
to acc_list if it is accepting.  Also do not compute an SCC build
map if we don't have to build acc_list.
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
54e10c2501 "ltl2tgba -Rm" will apply WDBA-minimization only if correct.
* src/tgbatest/ltl2tgba.cc (main): Use WDBA-minimization only when
it is correct. Either we can quickly determine that a formula or
its negation is a safety formula, or we can slowly check the
equivalence of the WDBA-minimized automaton and the original
automaton.
* src/tgbatest/wdba.test: New test.
* src/tgbatest/safety.test: Adjust comment.
* src/tgbatest/spotlbtt.test: Use -Rm.
* src/tgbatest/Makefile.am (TESTS): Add wdba.test.
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
f9e84ac245 Better resource handling in minimization.
* src/tgbatest/ltl2tgba.cc (main): Delete the minimized automaton.
* src/tgbaalgos/minimize.cc (minimize): Remove the call to
unregister_variable() at the end.  It was both
wrong (unregistering only the first variable) and useless ("delete
del_a" will unregister all these variables).  Use a map and a set
to keep track of free BDD variable and reuse them, otherwise the
algorithm would sometimes use more variables than allocated.
2011-01-05 08:02:38 +01:00
Alexandre Duret-Lutz
0af8d03261 Implement is_safety_automaton().
* src/tgbaalgos/safety.hh, src/tgbaalgos/safety.cc: New
files.
* src/tgbaalgos/Makefile.am: Add them.
* src/tgbatests/ltl2tgba.cc: Add option "-O".
* src/tgbaalgos/scc.hh: Update documentation.
* src/tgbatest/Makefile.am (TESTS): Add safety.test.
* src/tgbatest/safety.test: New file.
2011-01-05 08:02:38 +01:00
Felix Abecassis
99c1b607de * src/tgbaalgos/minimize.cc: Now use register_anonymous_variables. 2011-01-05 08:02:38 +01:00
Felix Abecassis
52090e4875 Small fixes.
* src/tgbatest/minimize.cc: Delete useless includes.
* src/tgbaalgos/minimize.cc: Delete useless includes,
fixed acceptance conditions.
* src/tgbatest/ltl2tgba.cc: Add -Rm option for minimization.
* src/tgba/tgbaexplicit.cc: Fixed typo.
2011-01-05 08:02:38 +01:00
Felix Abecassis
fac30eb08e Test program for the minimization algorithm.
* src/tgbatest/minimize.cc: New file.  Minimize an automaton
from a LTL formula and compare the size of the initial automaton
to the size of the minimized automaton.
2011-01-05 08:02:37 +01:00
Felix Abecassis
03e6dc4769 * src/tgbaalgos/minimize.cc, src/tgbaalgos/minimize.hh:
New files.  Algorithm to minimize an automaton using first the powerset
construction to determinize the input automaton, the automaton is then
minimized using the standard algorithm, using BDDs to check if states
are equivalent.
2011-01-05 08:02:37 +01:00
Felix Abecassis
e2e138f6e6 Modify the powerset algorithm to keep track of accepting states
from the initial automaton.

* src/tgba/tgbaexplicit.cc, src/tgba/tgbaexplicit.hh:
Added class tgba_explicit_number, a tgba_explicit where states are
labelled by integers.
* src/tgbaalgos/powerset.hh, src/tgbaalgos/powerset.cc:
When building the deterministic automaton, keep track of which states
were created from an accepting state in the initial automaton.
The states are added to the new optional parameter (if not 0),
acc_list.
Use tgba_explicit_number instead of tgba_explicit_string to build
the result.
* src/tgbaalgos/scc.cc (spot): Small fix.
Print everything on std::cout.
2011-01-05 08:02:37 +01:00
Alexandre Duret-Lutz
bd742ef6a4 Fix computation of support_conditions for bdd-based TGBA.
This fixes a bug in the powerset of such TGBA on the minimize branch.

* src/tgba/tgbabddconcrete.cc (compute_support_conditions): Also
account for the conditions from the acceptance relations.
* rc/tgba/tgbabddconcretefactory.hh, rc/tgba/tgbabddconcretefactory.cc
(acceptance_conditions_support): New variable to hold the value
of bdd_support(acceptance_conditions_support).
* src/tgba/tgbabddconcretefactory.cc (finish): Update
data_.acceptance_conditions_support.
2011-01-05 08:01:46 +01:00
Alexandre Duret-Lutz
0f08fbc206 * wrap/python/cgi-bin/ltl2tgba.in: Remove all "new" markers. 2010-12-26 18:42:14 +01:00
Alexandre Duret-Lutz
f1d3e999ae Define SWIG_TYPE_TABLE as suggested by the SWIG documentation.
* wrap/python/Makefile.am: Add -DSWIG_TYPE_TABLE=spot.
2010-12-24 10:28:47 +01:00
Alexandre Duret-Lutz
8419cb6f8d Use swig2.0 if available.
* configure.ac: Search for swig2.0 and swig.
* wrap/python/Makefile.am: Use $(SWIG).
2010-12-24 10:28:47 +01:00
Alexandre Duret-Lutz
3d61b3a3c0 Get rid of ltihooks.py.
ltihooks.py apparently breaks the import mechanisms of Python 2.6,
causes SWIG's runtime to fail to share a global type table, and
yields various failures in our tests.

* wrap/python/ltihooks.py: Delete.
* wrap/python/Makefile.am (EXTRA_DIST): remove ltihooks.py.
* wrap/python/tests/bddnqueen.py, wrap/python/tests/interdep.py,
wrap/python/tests/ltl2tgba.py, wrap/python/tests/ltlparse.py,
wrap/python/tests/ltlsimple.py, wrap/python/tests/minato.py,
wrap/python/tests/modgray.py, wrap/python/tests/optionmap.py,
wrap/python/tests/setxor.py: Do not use ltihooks.
* wrap/python/tests/run.in (pypath): Include the .libs/ directory
in the search path so that Python can find the *.so libraries.
2010-12-24 10:28:47 +01:00
Alexandre Duret-Lutz
2ac37ad58f * NEWS: Summarize recent changes. 2010-12-12 12:02:48 +01:00
Alexandre Duret-Lutz
01843379a3 Merge transitions in tgba_tba_proxy.
With this change the output of
ltl2tgba -f -x -k -DS "GF(p_1) & ... & GF(p_n)
uses less than (n+1)^2 transitions when it used
exactly (n+1)*(2^n) transitions before.

* src/tgba/tgbatba.cc (tgba_tba_proxy_succ_iterator): Merge
transitions going to the same states if they are both accepting or
if neither are.
(state_ptr_bool_t, state_ptr_bool_less_than): Helper type to
store a transition in tgba_tba_proxy_succ_iterator.
* src/tgba/tgbatba.cc, src/tgba/tgbatba.hh
(tgba_tba_proxy::transition_annotation): Remove.  We cannot
implement this method if transitions are merged.
2010-12-12 12:02:48 +01:00
Alexandre Duret-Lutz
87ee1cfe7d Augment the size of the ltlclasses benchmark.
* bench/ltlclasses/run: Augment the max size to 20.
* bench/ltlcounter/run: Typo in comment.
2010-12-10 10:12:20 +01:00
Alexandre Duret-Lutz
1dd524ebce Introduce -ks to print only the size of the automaton (without
SCC information).

* src/tgbatest/ltl2tgba.cc (syntax, main): Add a -ks option.
* src/tgbatest/ltl2tgba.test, bench/ltlclasses/run,
bench/ltlcounter/run: Use -ks instead of -k to speed things up.
2010-12-10 10:02:53 +01:00
Alexandre Duret-Lutz
3e7debe53e Use a cache to speed up tgba_tba_proxy.
tgba_tba_proxy used to spend a lot of time (re)computing the
acceptance condition common to all outgoing transition of a state.

* src/tgba/tgbatba.hh (accmap_): New cache.
(common_acceptance_conditions_of_original_state): New method.
* src/tgba/tgbatba.cc (tgba_tba_proxy_succ_iterator::~sync)
Call common_acceptance_conditions_of_original_state() instead of
computing the result.
(~tgba_tba_proxy): Cleanup the cache.
(common_acceptance_conditions_of_original_state): Implement it.
2010-12-09 19:37:01 +01:00
Alexandre Duret-Lutz
d9fb4d1d09 * src/ltltest/Makefile.am (genltl_SOURCES): Add missing variable. 2010-12-07 18:32:43 +01:00
Alexandre Duret-Lutz
48e4c13da9 * README: Mention bench/ltlclases/. 2010-12-07 15:52:22 +01:00
Alexandre Duret-Lutz
d42deb7fa4 Preliminary benchmark using genltl, introduced earlier.
* bench/ltlclasses/: New benchmark.
* bench/Makefile.am: Add it.
* configure.ac: Adjust.
2010-12-04 18:07:22 +01:00
Alexandre Duret-Lutz
c4a7efb9e0 * src/ltlvisit/syntimpl.cc: Reduce the number of dynamic_cast<>s. 2010-12-04 17:10:47 +01:00
Alexandre Duret-Lutz
437af50afe Preliminary implementation of a tool to generate some interesting
families of LTL formulae.

* src/ltltest/genltl.cc: New file.  Based on five classes of
formulae defined in a paper by Cichón, Czubak, and Jasiński.
* src/ltltest/Makefile.am (noinst_PROGRAMS): Build genltl.
2010-12-04 11:34:48 +01:00