Commit graph

1265 commits

Author SHA1 Message Date
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
Alexandre Duret-Lutz
ac9d0a502a Add full_parent support to to_spin_string().
* src/ltlvisit/tostrinc.hh (to_spin_string): Add a full_parent
optional parameter, like for the to_string() function.
* src/ltlvisit/tostrinc.cc (to_string_visitor): Fix the
handling of full_parent.
(to_spin_string_visitor): Handle full_parent.
2010-12-04 11:34:48 +01:00
Alexandre Duret-Lutz
c735249873 Halve the number of application of eventual_universal_visitor in
reduce_visitor::visit(binop).

* src/ltlvisit/reduce.cc (eventual_universal_visitor::recurse_):
Move this method...
(recurse_eu): ... outside as a separate function.  Likewise for
the universal/eventual result struct.
(reduce_visitor::visit(binop)): Call recurse_eu() once to replace
two calls to is_eventual and is_universal, thus replacing two
recursions by one.
2010-12-01 08:40:22 +01:00
Alexandre Duret-Lutz
dabb7ecc97 Move the eventual-universal functions where the belong.
* src/ltlvisit/syntimpl.cc (eventual_universal_visitor,
is_eventual, is_universal): Move ...
* src/ltlvisit/reduce.cc (eventual_universal_visitor,
is_eventual, is_universal): ... here.
2010-12-01 08:40:22 +01:00
Alexandre Duret-Lutz
f5503090b1 * src/ltlvisit/randomltl.cc (random_ltl::update_sums): Typo in string. 2010-12-01 08:40:22 +01:00
Alexandre Duret-Lutz
2a33bd17ec Remove a quadratic behavior in eventual_universal_visitor.
* src/ltlvisit/syntimpl.cc (eventual_universal_visitor): Use
a union to store the eventual and universal properties as two
bit in a bit-field, and "AND" both of them at once.
(eventual_universal_visitor::recurse_un,
eventual_universal_visitor::recurse_ev): Replace these
two functions by ...
(eventual_universal_visitor::recurse_): ... this one, that
returns both bits as an unsigned.
2010-12-01 08:40:09 +01:00
Alexandre Duret-Lutz
487c4ac48c * src/tgbatest/ltl2tgba.cc (main): Delete the accepting run
even if it hasn't been printed.
2010-12-01 08:38:47 +01:00
Alexandre Duret-Lutz
75a24111da Rationalize options for counter-example output.
* src/tgbatest/ltl2tgba.cc (main): Either replay the accepting
run or print it, but do not do both.
* src/tgbatest/emptchk.test: Adjust. I.e. use -C instead of -CR
when we expect the run to be displayed.
2010-11-30 17:28:15 +01:00
Alexandre Duret-Lutz
ae03bc6704 Fix a GCC 4.6 warning.
* src/tgbatest/randtgba.cc (main): Remove the set but unused opt_A
variable (the upcoming GCC 4.6 would warn about it) and set opt_ec
to 1 if -A is used without -e.
2010-11-30 12:19:45 +01:00
Alexandre Duret-Lutz
3b3711286b * src/tgbatest/ltl2tgba.cc (syntax): Typo. 2010-11-27 21:45:47 +01:00
Alexandre Duret-Lutz
8156766fe3 Another Clang report.
* iface/nips/nips.cc (format_state): Do not use a variable-sized
array, this is not allowed in C++.
2010-11-27 14:29:28 +01:00
Alexandre Duret-Lutz
019c85dff6 Fix more errors reported by Clang.
* src/tgbaalgos/reducerun.hh (tgba_run): Predeclare as a struct
since this is what it is.
* src/tgbatest/randtgba.cc (main): Avoid using "i" with two
different type in the same loop.
2010-11-27 10:21:44 +01:00
Alexandre Duret-Lutz
0d9d0b08ec Finalize Kripke interface.
* src/kripke/fairkripke.hh, src/kripke/fairkripke.cc,
* src/kripke/kripke.hh, src/kripke/kripke.cc: Finalize and
document the Kripke interface.  I have tested it by updating
checkpn to use it.
2010-11-26 17:50:12 +01:00
Alexandre Duret-Lutz
67f46b85b3 Never claim output used to print the degeneralized automaton
before some optional operations (like more optimizations, or a
product).

* src/tgbatest/ltl2tgba.cc (-N, -NN): Make sure we print the last
automaton computed, not just the automaton when we degeneralized
it.  We may have applied other algorithms since the original
degeneralization.
2010-11-25 20:29:16 +01:00
Alexandre Duret-Lutz
7627b9673b * src/tgbatest/ltl2tgba.test: Test both -l and -f. This should
have been done on 2010-01-30 when the default translation was
changed from -l to -f.
2010-11-25 19:59:46 +01:00
Alexandre Duret-Lutz
0dca4be69d * src/tgbaalgos/scc.hh: Typos in the documentation. 2010-11-25 19:57:10 +01:00
Alexandre Duret-Lutz
0a2dbab413 * src/tgbaalgos/sccfilter.hh: Fix some typos in the documentation. 2010-11-24 22:00:57 +01:00
Alexandre Duret-Lutz
57d4df47dd Suggest using bddtrue and bddfalse instead of bdd_true() and
bdd_false().

* src/sanity/style.test: Catch uses of bdd_true() or bdd_false().
2010-11-24 22:00:57 +01:00
Alexandre Duret-Lutz
2ba963200a Fix some struct/class missmatches reported by clang.
* src/ltlast/predecl.hh: Predeclare the LTL AST nodes as class,
not struct.
* src/ltlast/nfa.hh (formula_tree::node): Predeclare as struct,
not class.
2010-11-20 18:02:20 +01:00
Alexandre Duret-Lutz
2b46cb4bab Add interface for and test the bdd_setxor() function added to Buddy.
* wrap/python/buddy.i (bdd_setxor): New function.
* wrap/python/tests/setxor.py: New file.
* wrap/python/tests/Makefile.am (TESTS): Add setxor.py.
2010-11-07 11:15:56 +01:00
Alexandre Duret-Lutz
38913302dd * src/Makefile.am (libspot_la_LIBADD): Rename libneverclaimparse.la
as libneverparse.la.
* src/neverparse/Makefile.am: Install files in
$(pkgincludedir)/neverparse, not $(pkgincludedir)/neverclaimparse.
2010-11-06 20:44:37 +01:00
Alexandre Duret-Lutz
1e0f99e824 Cosmetics to please sanity checks.
* src/neverparse/public.hh, src/neverparse/parsedecl.hh: Fix
inclusion guards.
* src/tgba/tgbaexplicit.hh, src/tgbatest/emptchk.test,
src/tgbatest/ltl2tgba.cc: Fix trailing whitespaces.
2010-11-06 17:56:27 +01:00
Alexandre Duret-Lutz
87f69eaf18 * src/tgbatest/ltl2tgba.cc: Clock the time spent reading -P file. 2010-11-06 16:40:44 +01:00
Alexandre Duret-Lutz
b1dbfed17f * src/tgbatest/neverclaimread.test: Check that Spot can read the
neverclaims it outputs.
2010-11-06 15:56:50 +01:00
Alexandre Duret-Lutz
a6677c2984 Do not output a counterexample by default in ltl2tgba, introduce
options -C and -CR for that.

* src/tgbatest/ltl2tgba.cc: Add option -C and -CR to control
whether we want the accepting run to be printed or replayed.
* src/tgbatest/dfs.test, src/tgbatest/eltl2tgba.test,
src/tgbatest/emptchk.test, src/tgbatest/emptchke.test,
src/tgbatest/ltl2tgba.cc, src/tgbatest/ltlcounter.test: Use -CR.
2010-11-06 15:38:00 +01:00