Commit graph

1307 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
ad93f87591 Fixup minimize_monitor().
* src/tgbaalgos/minimize.cc (minimize_monitor): Fix typo yielding
incorrect monitor if the input tgba is not deterministic.
* src/tgbatest/ltl2tgba.test: Add test case.
2011-01-28 12:11:20 +01:00
Alexandre Duret-Lutz
c8140de9d6 Report formulas that are both safety and guarantee.
* src/tgbatest/ltl2tgba.cc (-O): Report formulas that are both
safety and guarantee.
* src/tgbatest/obligation.test: Add cases.
2011-01-27 21:41:04 +01:00
Alexandre Duret-Lutz
db124d02c0 Rename is_safety_automaton() as is_guarantee_automaton() and
implement is_safety_mwdba().

Note: I swapped the name of safety and guarantee when I
implemented is_safety_automaton() on 2010-03-20.  Fortunately,
is_safety_automaton() was only used where is_guarantee_automaton()
would have been correct.

* src/tgbaalgos/safety.cc (is_guarantee_automaton): Rename as ...
(is_guarantee_automaton): ... this.
(is_safety_mwdba): New function.
* src/tgbaalgos/safety.hh: Adjust and add documentation.
* src/tgbaalgos/minimize.cc: Use is_guarantee_automaton() instead
of is_safety_automaton().
* src/tgbatests/safety.test: Rename as ...
* src/tgbatests/obligation.test: ... this, and augment the
test.
* src/tgbatest/Makefile.am: Adjust.
* src/tgbatest/ltl2tgba.cc (-O): Display whether a formula
represent a safety, guarantee, or obligation property.
* NEWS: Adjust.
2011-01-27 18:21:27 +01:00
Alexandre Duret-Lutz
14b701b54d * NEWS: Minor rewritings. 2011-01-27 15:08:57 +01:00
Alexandre Duret-Lutz
0c9c9fc639 Replace delete by destroy in comments dealing with states.
* src/tgba/succiter.hh, src/tgba/tgba.hh,
src/tgba/tgbabddconcrete.hh, src/tgba/tgbaproduct.hh,
src/tgba/tgbaunion.hh, src/tgbaalgos/bfssteps.hh,
src/tgbaalgos/gtec/ce.cc, src/tgbaalgos/gtec/explscc.hh,
src/tgbaalgos/gtec/gtec.cc, src/tgbaalgos/replayrun.cc,
src/tgbaalgos/scc.cc, src/tgbaalgos/scc.hh: Update comments
to say that we "destroy" a state instead of "deleting" it.
2011-01-27 10:48:49 +01:00
Alexandre Duret-Lutz
95cc50da51 Update gspn interface for recent tools.
* iface/gspn/ssp.cc: Use the new destroy() interface, and
fix a couple of recent g++ reports.
* iface/gspn/gspn.cc: Adjust to newer g++.
2011-01-27 10:48:48 +01:00
Alexandre Duret-Lutz
574a228583 Introduce a destroy() method on states, and use it instead of delete.
Right now, destroy() just executes "delete this".  But in a later
version, we will rewrite tgba_explicit so that it does not
allocate new states (and the destroy() method for explicit state
will do nothing).

* src/tgba/state.hh (state::destroy): New method, to replace
state::~state() in the future.
(shared_state_deleter): New function.
* src/evtgba/product.cc, src/evtgbaalgos/reachiter.cc,
src/evtgbaalgos/save.cc, src/evtgbaalgos/tgba2evtgba.cc,
src/tgba/tgba.cc, src/tgba/tgbaproduct.cc, src/tgba/tgbareduc.cc,
src/tgba/tgbasafracomplement.cc, src/tgba/tgbasgba.cc,
src/tgba/tgbatba.cc, src/tgba/tgbaunion.cc, src/tgba/wdbacomp.cc,
src/tgbaalgos/cutscc.cc, src/tgbaalgos/emptiness.cc,
src/tgbaalgos/gtec/ce.cc, src/tgbaalgos/gtec/explscc.cc,
src/tgbaalgos/gtec/gtec.cc, src/tgbaalgos/gtec/nsheap.cc,
src/tgbaalgos/gv04.cc, src/tgbaalgos/magic.cc,
src/tgbaalgos/minimize.cc, src/tgbaalgos/ndfs_result.hxx,
src/tgbaalgos/neverclaim.cc, src/tgbaalgos/powerset.hh,
src/tgbaalgos/reachiter.cc, src/tgbaalgos/reducerun.cc,
src/tgbaalgos/reductgba_sim.cc,
src/tgbaalgos/reductgba_sim_del.cc, src/tgbaalgos/replayrun.cc,
src/tgbaalgos/safety.cc, src/tgbaalgos/save.cc,
src/tgbaalgos/scc.cc, src/tgbaalgos/se05.cc,
src/tgbaalgos/tau03.cc, src/tgbaalgos/tau03opt.cc: Adjust to call
"s->destroy()" instead of "delete s".
* src/saba/sabacomplementtgba.cc, src/tgba/tgbakvcomplement.cc:
Pass shared_state_deleter to the shared_ptr constructor, so that
it calls destroy() instead of delete.
2011-01-27 10:48:48 +01:00
Alexandre Duret-Lutz
60930d7a12 * wrap/python/ajax/ltl2tgba.html: Display the Spot version in
the tooltip over the Spot logo.
2011-01-26 23:13:40 +01:00
Alexandre Duret-Lutz
656eeeaf3b * wrap/python/ajax/Makefile.am (EXTRA_DIST): Add icons/mail.png. 2011-01-26 22:10:57 +01:00
Alexandre Duret-Lutz
6df06aceeb * NEWS: Mention the new on-line ltl2tgba version. 2011-01-26 22:09:37 +01:00
Alexandre Duret-Lutz
f3c6f01e8d Updates to the ltl2tgba ajax version.
* wrap/python/ajax/ltl2tgba.html: Remove the auto-update button, and
enable auto-update automatically after the first submission.  Add
tools tips for the "Desired Output" tabs, and the Spot logo.
Add a email icon to encourage feedback.
* wrap/python/ajax/ltl2tgba.css: fix sizes of formula field and
send button.  Set position of mail icon.
* wrap/python/ajax/logos/mail.png: New logo, based on a public
domain SVG icon retrieved today from
http://commons.wikimedia.org/wiki/File:Internet-mail.svg
2011-01-26 22:03:14 +01:00
Alexandre Duret-Lutz
c7f3bd5111 * wrap/python/ajax/ltl2tgba.html: Disable the browser spellcheck
on the input box.
2011-01-19 08:44:33 +01:00
Alexandre Duret-Lutz
34f49a8692 Preliminary implementation of an ajax-based ltl2tgba translator.
* configure.ac: Output wrap/python/ajax/Makefile.
* wrap/python/Makefile.am (SUBDIRS): Add ajax.
* wrap/python/ajax/Makefile.am, wrap/python/ajax/README,
wrap/python/ajax/ltl2tgba.html, wrap/python/ajax/spot.in: New files.
* wrap/python/ajax/css/, wrap/python/ajax/js,
wrap/python/ajax/logos: New directories.
* README: Document wrap/python/ajax/.
2011-01-18 16:31:33 +01:00
Alexandre Duret-Lutz
dc2a89f853 Do not output empty parse error blocks in the CGI script.
* wrap/python/spot.i: Provide a __nonzero__() method for
parse_error_list.
* wrap/python/cgi-bin/ltl2tgba.in: Do not call format_parse_errors()
unconditionally.
2011-01-17 21:52:59 +01:00
Alexandre Duret-Lutz
fe535a1594 Fix "unused function" warnings reported by clang++.
* src/evtgbaparse/Makefile.am, src/ltlparse/Makefile.am,
src/neverparse/Makefile.am, src/tgbaparse/Makefile.am
(AM_CPPFLAGS): Define -DYY_NO_INPUT so that the unused yyinput()
function does not get compiled.
* src/eltlparse/Makefile.am (AM_CPPFLAGS): Likewise.
(AM_CXXFLAGS): Also enable warnings.
* src/eltlparse/eltlparse.yy: Move helper functions from
the "%code requires" block to the "%code" block, so that they
do not appear in the eltlparse.hh file (which is included in
two places...).
* iface/nips/nips.cc (search_error_callback_assert): Comment
this unused function.
2011-01-12 18:44:29 +01:00
Alexandre Duret-Lutz
45d7c88062 Fix segfault with g++-3.3.
* src/tgbaalgos/minimize.cc (minimize_dfa): Fix deletion of the
state_set_map.  It led to a crash when compiled with g++-3.3.
2011-01-12 16:59:42 +01:00
Alexandre Duret-Lutz
b39e68c51e Fix a compilation failure with g++-3.3.
* src/misc/hash.hh (identity_hash): New function.
* src/tgba/tgbaexplicit.hh (tgba_explicit_number): Use
identity_hash<int> instead of std::tr1::hash<int> that does not
exist with g++-3.3.
2011-01-12 16:59:42 +01:00
Alexandre Duret-Lutz
74f14567d1 Fix usage of minimize_obligation in the CGI script.
* wrap/python/cgi-bin/ltl2tgba.py (reduce_wdba): Use
minimize_obligation_new a pass the formula.
* wrap/python/spot.i (minimize_obligation_new): New function, to
cope with the strange specification of spot::minimize_obligation()
not always creating a new automaton.
2011-01-07 23:31:30 +01:00
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