Commit graph

3509 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
b6c8a18dbc * wrap/python/spot.py: Check exit status also when timeout is used. 2015-10-22 12:11:59 +02:00
Alexandre Duret-Lutz
82ce722d42 * wrap/python/spot.py: Kill the shell and its children on timeout. 2015-10-21 19:05:37 +02:00
Alexandre Duret-Lutz
64df4fbccc fix "input buffer overflow, can't enlarge buffer..."
This occured when parsing the HOA automaton generated by Rabinizer3 for
a very long LTL formula with many nested U.  State labels could easily
be more than 40k characters.

* src/parseaut/scanaut.ll: Fix that.
* src/tests/parseaut.test: New test case.
* NEWS: Mention the fix.
2015-10-21 17:55:02 +02:00
Alexandre Duret-Lutz
619b227eff * wrap/python/spot.py (automata): Use universal_newlines. 2015-10-21 14:42:52 +02:00
Alexandre Duret-Lutz
64607af7ab propagate the new minimum version of python
* README, doc/org/install.org, m4/pypath.m4: We now require Python 3.3
or later.
2015-10-21 14:27:18 +02:00
Alexandre Duret-Lutz
80a6a183e3 python: add a timeout argument to automaton() and automata()
* wrap/python/spot.py: Implement it.  Also report non-zero
exit using CalledProcessError.
* wrap/python/tests/automata-io.ipynb, wrap/python/tests/piperead.ipynb:
Adjust.
* NEWS: Mention the change.
2015-10-21 11:57:57 +02:00
Alexandre Duret-Lutz
0f3bc27d7b python: fix bindings for scc_filter as a method
* wrap/python/spot.py: Fix bindings for scc_filter.
* wrap/python/tests/remfin.py: Test them.
2015-10-20 14:54:06 +02:00
Alexandre Duret-Lutz
c7d063aaa0 org: fix multiple examples
I have to remember that org-mode does not evaluate something unless it
is eventually exported.

* doc/org/hoa.org, doc/org/ioltl.org, doc/org/tut21.org,
doc/org/tut30.org: Adjust exports commands.
2015-10-20 14:53:57 +02:00
Alexandre Duret-Lutz
cd8e53de09 is_unambiguous: fix detection of empty languages
* src/tests/unambig.test: New test case.  Reported by Ming-Hsien Tsai.
* src/twaalgos/sccfilter.cc: Always create an initial state.
* src/twaalgos/isunamb.cc: Speed up on empty languages.
* NEWS, THANKS: Update.
2015-10-20 08:06:31 +02:00
Alexandre Duret-Lutz
61bf5daab4 Add code example using the postprocessor.
* doc/org/tut30.org: New file.
* doc/Makefile.am, doc/org/tut.org: Add it.
2015-10-19 23:15:52 +02:00
Alexandre Duret-Lutz
87cb58d0a1 python: introduce a spot.postprocess() function
This simplifies the use of the spot.postprocessor object.

* wrap/python/spot.py: Add it.
* wrap/python/tests/automata.ipynb: Use it.
* NEWS: Mention it.
2015-10-19 18:09:22 +02:00
Alexandre Duret-Lutz
e1ddf97862 fix unabbreviate
This is a bug:

    % ltlfilt -f 'a W b' --unabbreviate=WR
    a U (b | (a W b))

* src/tl/unabbrev.cc: Here.
* src/tests/unabbrevwm.test: Harden test case.
* wrap/python/tests/randltl.ipynb: Adjust expected output.
* NEWS: Mention the fix.
2015-10-19 10:56:31 +02:00
Alexandre Duret-Lutz
43a5187ab4 python: add get_name & set_name for automata
* wrap/python/spot_impl.i (get_name, set_name): New methods for twa.
* wrap/python/tests/remfin.py: Test them.
* wrap/python/ajax/spotcgi.in: Use set_name().
* NEWS: Mention it.
2015-10-18 15:43:19 +02:00
Alexandre Duret-Lutz
176c9e2e17 tl: rename ltl_simplifier to tl_simplifier
* doc/org/tut01.org, doc/tl/tl.tex, src/bin/common_r.hh,
src/bin/ltlfilt.cc, src/tests/equalsf.cc, src/tests/ikwiad.cc,
src/tests/randtgba.cc, src/tests/reduc.cc, src/tests/syntimpl.cc,
src/tl/nenoform.cc, src/tl/randomltl.cc, src/tl/randomltl.hh,
src/tl/simplify.cc, src/tl/simplify.hh, src/twaalgos/ltl2tgba_fm.cc,
src/twaalgos/ltl2tgba_fm.hh, src/twaalgos/stutter.cc,
src/twaalgos/translate.cc, src/twaalgos/translate.hh,
wrap/python/ajax/spotcgi.in, wrap/python/spot.py,
wrap/python/tests/interdep.py: Rename ltl_simplifier to tl_simplifier.
* NEWS: Mention it.
2015-10-18 13:35:23 +02:00
Alexandre Duret-Lutz
21be883cf6 * src/tl/simplify.hh: Fix comment. 2015-10-18 11:56:58 +02:00
Alexandre Duret-Lutz
9689c4ccfc python: update the formulaiterator bindings
* wrap/python/spot.py: Add the unabbreviate() method, and
remove unabbrivate_ltl() and get_literal().
* wrap/python/tests/randltl.ipynb: Demonstrate unabbreviate().
2015-10-18 11:54:51 +02:00
Alexandre Duret-Lutz
1d30242d17 remove_fin: fix bug in remove_fin_det_weak
* wrap/python/tests/remfin.py: New file.
* wrap/python/tests/Makefile.am: Add it.
* src/twaalgos/remfin.cc (remove_fin_det_weak): Purge dead states.
2015-10-17 17:42:50 +02:00
Alexandre Duret-Lutz
9be0cd7f69 debian: catch more MathJax uses
* debian/rules: Fix notebooks to use the local mathjax.
2015-10-16 11:35:40 +02:00
Alexandre Duret-Lutz
3669eba5b2 debian: compile for all supported Python3 versions
* debian/rules: Build for all supported python3 versions.
* NEWS: Mention it.
2015-10-16 11:18:52 +02:00
Alexandre Duret-Lutz
9e7d0677e7 parseaut: better diagnostic of unsupported versions
* src/parseaut/parseaut.yy: Add and the a check_version() function.
* src/tests/parseaut.test: Test it.
* NEWS: Mention it.
2015-10-15 18:27:58 +02:00
Alexandre Duret-Lutz
0671d62806 ltlgrind: fix handling of FILENAME/COL
This additionally fixes #107.

* src/bin/ltlgrind.cc: Fix handling for FILEANAME/COL.  Document FORMAT
in --help.  Assume -F for arguments given without options.
* src/tests/ltlgrind.test: Add two tests.
* NEWS: Mention this.
2015-10-15 17:08:08 +02:00
Alexandre Duret-Lutz
e3682a2301 autfilt: easier simplification defaults
This is motivated by an email from Fanda.

* src/bin/common_post.cc, src/bin/common_post.hh: Add variables to
detect when level or pref are sets.
* src/bin/autfilt.cc: Adjust default for pref/sets.
* src/tests/readsave.test: Add test cases.
* NEWS: Mention it.
2015-10-15 16:37:26 +02:00
Alexandre Duret-Lutz
2ae1b6a6f0 autfilt: implement --complement
* src/bin/autfilt.cc: Add option --complete.
* src/twaalgos/complete.cc: Better handling of 0-edge automata.
* src/tests/complement.test: New file.
* src/tests/Makefile.am: Add it.
2015-10-15 13:58:20 +02:00
Alexandre Duret-Lutz
6cf807da6e fix crash of randaut -Q0
* src/twaalgos/randomgraph.cc: Replace an assertion by an exception.
* src/bin/randaut.cc: Diagnose -Q0.
* src/tests/randaut.test: Test it.
* NEWS: Mention the bug.
2015-10-15 13:29:59 +02:00
Alexandre Duret-Lutz
cd2e527526 scc_filter_states: also remove useless acceptance marks
* src/twaalgos/sccfilter.hh,
src/twaalgos/sccfilter.cc (scc_filter_states): Remove useless acceptance
marks while preserving state-based acceptance.  Add a new argument
to specify if all useless mark have to be removed, like for scc_filter.
* src/twaalgos/simulation.cc: Use the new parameter.
* src/twaalgos/postproc.cc: Likewise.  Also call do_scc_filter even
after WDBA simplification to cleanup trivial SCCs.  Preserve state-based
acceptance for weak automata.
* src/tests/readsave.test: Add one test.
* src/tests/dstar.test, src/tests/prodor.test, src/tests/remfin.test,
src/tests/sim3.test, wrap/python/tests/automata.ipynb,
wrap/python/tests/piperead.ipynb: Adjust expected output.
* NEWS: Mention the change.
2015-10-14 20:02:19 +02:00
Alexandre Duret-Lutz
2af3678893 * HACKING: Update list of dependencies. 2015-10-14 10:47:45 +02:00
Alexandre Duret-Lutz
06d3bc67ea restructure the complementation code
The previous code was sometime doing the work of remove_fin() in
addition to complementing the acceptance conditions.  This separate
the two operations clearly.  Also the specialized code for
complementing weak automata is now a specialized code for remove_fin()
on weak automata.

* src/twaalgos/dtgbacomp.hh, src/twaalgos/dtgbacomp.cc: Rename as ...
* src/twaalgos/complement.hh, src/twaalgos/complement.cc: ... these.
* src/twaalgos/Makefile.am: Adjust.
* src/twaalgos/complement.hh (dtgba_complement): Rename as ...
(dtwa_complement): ... this, and restrict the purpose to completion
and accetance complementation.  Further acceptance simplification
can be done with remove_fin() and to_generalized_buchi().
* src/twaalgos/remfin.cc (remove_fin): Specialize handling of weak
automata using the code that was originally in dtgba_complement().
Also mark the output as state-based when the input has to Inf.
* src/twaalgos/postproc.cc, src/twaalgos/postproc.hh: Make sure
scc_filter is always called after to_generalized_buchi().
* bench/stutter/stutter_invariance_randomgraph.cc,
src/bin/ltlcross.cc, src/tests/ikwiad.cc, src/twaalgos/minimize.cc,
src/twaalgos/powerset.cc, src/twaalgos/stutter.cc: Adjust usage.
* src/tests/dstar.test, src/tests/ltl2dstar4.test,
src/tests/remfin.test: Adjust expected outputs.
* wrap/python/spot_impl.i: Export dtwa_complement().
2015-10-13 22:34:02 +02:00
Alexandre Duret-Lutz
fb642c6df5 * src/bin/ltlcross.cc: Typo. 2015-10-13 13:40:12 +02:00
Alexandre Duret-Lutz
e8ce08a989 python: better way to extend existing classes
* wrap/python/spot.py: Use a decorator to extend classes.
* wrap/python/tests/formulas.ipynb: Adjust expected help text.
2015-10-08 08:54:50 +02:00
Alexandre Duret-Lutz
1f0258e9f7 python: docstrings cleanup
* wrap/python/spot.py: Better docstrings.
* wrap/python/tests/formulas.ipynb: Update.
2015-10-04 12:17:06 +02:00
Alexandre Duret-Lutz
67468acb18 * wrap/python/spot.py: Minor cleanups to follow PEP8. 2015-10-04 00:38:13 +02:00
Alexandre Duret-Lutz
24a8affbc5 org: better syntax highlighting
* doc/org/init.el.in: Activate CSS for code fragments.
* doc/org/spot.css: Style relevant elements.
2015-10-03 17:14:52 +02:00
Alexandre Duret-Lutz
5bfd0267e7 python: implement formula.__format__
Fixes #105.

* src/bin/common_trans.cc (quote_shell_string): Move ...
* src/misc/escape.cc, src/misc/escape.hh (quote_shell_string):
... here.
* wrap/python/spot_impl.i: Wrap escape.hh.
* wrap/python/spot.py: Implement formula.__format__.
* wrap/python/tests/ltlsimple.py: Test it.
* NEWS, doc/org/tut01.org, wrap/python/tests/formulas.ipynb: Document
it.
2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
20bb171904 * NEWS: Summarize recent changes. 2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
6ff4fa9722 Work around weird Python 3.5 generator/iterator interaction
* wrap/python/spot.py: Python 3.5 reports some unexpected SystemError
messages when the stack of iterator(...(iterator(generator))) we build
for random LTL generation raises a StopIteration.  The messages are
attached either to delete_formula or delete_randltlgenerator, claiming
that these functions exit with an error; but I have checked that they
do not.  I've been unable to understand the cause of the issue.
Replacing the generator by an iterator at least fixes the problem in a
way that is transparent for our API.
* wrap/python/tests/randltl.ipynb: Adjust expected formulas.
2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
5f2d55ab2e python: do not crash when a function returns a null formula
* wrap/python/spot_impl.i: Map null formulas to None.
* wrap/python/tests/randgen.py: New file.
* wrap/python/tests/Makefile.am: Add it.
2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
24ef5a0b7f bdddict: remove dead code
* src/twa/bdddict.cc,
src/twa/bdddict.hh (unregister_all_typed_variables, oneacc_to_formula,
register_acceptance_variables): Remove these unused methods.
2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
2fa9c27534 postproc: default to an empty formula
* src/twaalgos/postproc.hh: Allow the formula not to be specified.  The
code already support that, as it is called with an explicit nullptr in
autfilt (for example), but not requiring the nullptr is better for the
Python bindings.
2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
5e07e8384d tgba_complete: rename as complete and export in Python
* src/twaalgos/complete.cc, src/twaalgos/complete.hh
(tgba_complete, tgba_complete_here): Rename as...
(complete, complete_here): ... these.  Also fix useless output of
acceptance marks on transition leading to the sink when the automaton
does not use state-based acceptance.
* src/tests/ikwiad.cc, src/twaalgos/dtgbacomp.cc,
src/twaalgos/dtgbasat.cc, src/twaalgos/postproc.cc,
src/twaalgos/product.cc: Adjust.
* wrap/python/spot_impl.i: Export these function.
* wrap/python/tests/automata.ipynb: Test spot.complete().
2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
afe5b2a1c0 simpfg: remove this unused function
* src/tl/simpfg.cc, src/tl/simpfg.hh: Delete.
* src/tl/Makefile.am: Adjust.
2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
c8785a2854 * m4/gccwarn.m4: Add -Woverloaded-virtual. 2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
54935cb9c7 Add noexcept to various constructors related to graphs.
* m4/gccwarn.m4: Enable -Wnoexcept.
* src/graph/graph.hh, src/twa/acc.hh, src/twa/twagraph.hh: Add noexcept
to various constructors.
2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
20365e53f0 Enable -Wmissing-declarations in development mode.
* m4/gccwarn.m4: Add -Wmissing-declarations.
* iface/ltsmin/ltsmin.cc, iface/ltsmin/modelcheck.cc,
src/bin/common_trans.cc, src/bin/genltl.cc, src/bin/ltlgrind.cc,
src/tests/acc.cc, src/tests/bitvect.cc, src/tests/checkpsl.cc,
src/tests/checkta.cc, src/tests/complementation.cc,
src/tests/consterm.cc, src/tests/emptchk.cc, src/tests/equalsf.cc,
src/tests/graph.cc, src/tests/ikwiad.cc, src/tests/intvcmp2.cc,
src/tests/intvcomp.cc, src/tests/kind.cc, src/tests/length.cc,
src/tests/ltlprod.cc, src/tests/ltlrel.cc, src/tests/ngraph.cc,
src/tests/randtgba.cc, src/tests/readltl.cc, src/tests/reduc.cc,
src/tests/syntimpl.cc, src/tests/tostring.cc, src/tests/twagraph.cc,
src/tl/contain.cc, src/twaalgos/dtgbacomp.cc, src/twaalgos/minimize.cc:
Add "static" and move in anonymous namespace when appropriate.
2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
162d8d297d * bench/stutter/stutter_invariance_formulas.cc: Remove useless include. 2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
06971a2698 get rid of SPOT_DELETED
It was only needed with Swig versions older than what we have now.

* src/misc/common.hh: Here.
* src/misc/bitvect.hh, src/misc/common.hh, src/ta/taexplicit.hh,
src/ta/taproduct.hh, src/tl/simplify.hh, src/twa/bdddict.hh,
src/twa/taatgba.hh, src/twa/twaproduct.hh: Use = delete directly.
2015-10-01 20:06:39 +02:00
Alexandre Duret-Lutz
17a7a782a9 * src/tl/formula.hh: Handle saturation of refs_. 2015-10-01 19:04:16 +02:00
Alexandre Duret-Lutz
e5aebfd59c * wrap/python/ajax/spotcgi.in: Fix typo. 2015-10-01 11:36:15 +02:00
Alexandre Duret-Lutz
c43245e778 * NEWS, configure.ac: Bump version to 1.99.4a. 2015-10-01 10:10:11 +02:00
Alexandre Duret-Lutz
59685eada0 Spot 1.99.4
* NEWS, configure.ac, doc/org/setup.org: Bump version.
* doc/org/index.org: Better wording of a link.
2015-10-01 07:39:02 +02:00
Alexandre Duret-Lutz
85112b04f3 * src/twa/acc.hh: Fix warning with newer clang++. 2015-09-30 19:48:49 +02:00