Commit graph

81 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
8968bf6c4e simplify: fix related to event_univ handling
Fixes #260.  Reported by František Blahoudek.

The simplification F(f)|q = F(f|q), where q designates an event_univ
formula, was not always applied because of a couple of issue: (1) the
mospliter was ignoring event_univ unless favor_event_univ was set, (2)
when processing formulas from res_EventUniv they were not put back
into res_F or res_G to be subject to the F/G rules.

* spot/tl/simplify.cc: Improve handling of the above points.
* tests/core/reduccmp.test: Adjust and add test case.
* tests/core/ltl2tgba2.test, tests/python/atva16-fig2a.ipynb: Adjust.
2017-05-08 13:32:55 +02:00
Alexandre Duret-Lutz
f5d53e3a5e python: update some incorrect or obsolete code
* tests/python/ipnbdoctest.py: Use importlib instead of imp.
* tests/python/ltlparse.py: Fix invalid escape sequence.
2017-03-31 21:22:04 +02:00
Alexandre Duret-Lutz
6623af67e6 twa_graph: fix purge_unreachable_states on alternating automata
The algorithm had two problems: it was removing only useless
destination from universal destination (instead of removing the entire
edge), and it was not properly iterating over the entire reachable
automaton.

* spot/twa/twagraph.cc: Fix it.
* spot/twa/twagraph.hh: Adjust documentation.
* tests/core/alternating.test: Add more tests.
* tests/python/twagraph.py: Adjust.
* NEWS: Mention the bug.
2017-03-29 10:34:41 +02:00
Alexandre Duret-Lutz
bf31ff12ad parsetl: improve coverage
* spot/parsetl/parsetl.yy: Adjust one diagnostic.
* spot/parsetl/scantl.ll: Fix recovering of missing closing brace
in lenient mode.
* tests/python/ltlparse.py: Add tests.
* NEWS: Mention the lenient mode bug.
2017-03-22 22:48:16 +01:00
Alexandre Duret-Lutz
d6d987bd96 emptiness checks: replace assert-preconditions by exceptions
* spot/twaalgos/couvreurnew.cc, spot/twaalgos/gv04.cc,
spot/twaalgos/magic.cc, spot/twaalgos/se05.cc, spot/twaalgos/tau03.cc,
spot/twaalgos/tau03opt.cc: Throw if precondition on acceptance
condition is not satisfied.
* tests/python/misc-ec.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the change.
2017-03-10 15:41:57 +01:00
Alexandre Duret-Lutz
cd89983ca5 typos: dictionnary -> dictionary
* doc/org/upgrade2.org, tests/python/prodexpt.py,
tests/python/product.ipynb, NEWS: Fix typos.
* tests/sanity/style.test: Add a check for this.
2017-03-08 16:44:30 +01:00
Alexandre Duret-Lutz
d1d3ee38e6 python: add bindings for bdd_to_formula()
Follow-up to an email from Ayrat Khalimov.

* python/spot/impl.i: Include twa/formula2bdd.hh.
* python/spot/__init__.py: Make the dictionnary
optional.
* spot/twa/formula2bdd.cc: Throw an exception instead of asserting.
* tests/python/bdditer.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Update.
2017-03-08 16:44:30 +01:00
Alexandre Duret-Lutz
cd4c326f7b twa_graph: more test coverage
The goal is to improve coverage stats, but I discovered two issues
while doing so.

* tests/python/twagraph.py: New test case.
* tests/Makefile.am: Add it.
* spot/twa/twagraph.hh: Add fix typos in error messages.
* python/spot/impl.i: Fix broken wrappers for state_from_number and
state_acc_sets.
2017-03-07 23:16:07 +01:00
Arthur Remaud
f7bbfd2812 autfilt: Better display of cluster when universal edge loops in it
Fixes #208

* NEWS: Informations about the modifications
* spot/twaalgos/dot.cc (print): Gestion of cluster for
universal transitions
* tests/core/alternating.test: tests added
* tests/core/neverclaimread.test: tests changed for
new dot format
* tests/core/readsave.test: tests changed
* tests/core/sccdot.test: tests changed
* tests/python/_altscc.ipynb: tests changed
* tests/python/decompose.ipynb: tests changed
2017-02-16 18:53:18 +01:00
Alexandre Duret-Lutz
fefb375d5f is_alternating() -> !is_existential()
Part of #212.

* spot/misc/common.hh (SPOT_DEPRECATED): Improve support current
compilers and options flags.
* spot/twa/twagraph.hh, spot/graph/graph.hh (is_alternating): Mark it
as deprecated.
(is_existential): New method.
* bin/autfilt.cc, bin/ltlcross.cc, spot/parseaut/parseaut.yy,
spot/twa/twa.cc, spot/twa/twagraph.cc, spot/twaalgos/alternation.cc,
spot/twaalgos/are_isomorphic.cc, spot/twaalgos/canonicalize.cc,
spot/twaalgos/couvreurnew.cc, spot/twaalgos/cycles.cc,
spot/twaalgos/degen.cc, spot/twaalgos/determinize.cc,
spot/twaalgos/dot.cc, spot/twaalgos/dtbasat.cc,
spot/twaalgos/dtwasat.cc, spot/twaalgos/hoa.cc,
spot/twaalgos/isunamb.cc, spot/twaalgos/isweakscc.cc,
spot/twaalgos/mask.hh, spot/twaalgos/minimize.cc,
spot/twaalgos/postproc.cc, spot/twaalgos/product.cc,
spot/twaalgos/randomize.cc, spot/twaalgos/remfin.cc,
spot/twaalgos/sbacc.cc, spot/twaalgos/sccfilter.cc,
spot/twaalgos/sccinfo.cc, spot/twaalgos/simulation.cc,
spot/twaalgos/strength.cc, tests/core/graph.cc, tests/core/ngraph.cc,
tests/python/alternating.py: Adjust all uses.
* NEWS: Mention the renaming.
2017-02-12 15:56:02 +01:00
Alexandre Duret-Lutz
fb59cab09f emptiness: allow twa_run::as_twa to preserve names
* spot/twaalgos/emptiness.cc, spot/twaalgos/emptiness.hh: Here.
* tests/python/ltsmin-dve.ipynb: Add a test.
* NEWS: Mention the change.
2017-02-04 10:02:23 +01:00
Alexandre Duret-Lutz
ff4c4a7231 python: render the M&P hierarchy in SVG
* python/spot/__init__.py (show_mp_hierarchy, mp_hierarchy_svg): New
functions.
* tests/python/formulas.ipynb: Illustrate show_mp_hierarchy.
* python/ajax/spotcgi.in: Use mp_hierarchy_svg.
* python/ajax/css/trans.css: Adjust for possible overflows.
* NEWS: Mention this new feature.
2017-01-18 20:58:20 +01:00
Alexandre Duret-Lutz
5939ca4e85 langmap: Add example in notebook
* tests/python/highlighting.ipynb: Add an example of
highlight_languages().
2017-01-17 22:53:20 +01:00
Alexandre Duret-Lutz
0ad62cb97b langmap: adjust to only color non-unique languages
Fixes #203.

* spot/twaalgos/langmap.hh (highlight_languages): Simplify the
interface by only taking the automaton to color.
* spot/twaalgos/langmap.cc (highlight_languages): Only introduce
color for states that have a non-unique language.
* tests/core/highlightstate.test: Update and add more tests.
* tests/python/langmap.py: Keep the tests simple.
* bin/autfilt.cc: Adjust usage and help string.
2017-01-17 21:58:03 +01:00
Alexandre GBAGUIDI AISSE
ef2355a542 twaalgos: Set 'dicho' algo as default for SAT-based minimization
* python/spot/__init__.py: Handle options.
* spot/twaalgos/dtwasat.cc: Handle options.
* spot/twaalgos/postproc.cc: Handle options.
* spot/twaalgos/postproc.hh: Handle options.
* tests/core/satmin.test: Update tests.
Now use 'sat-minimize=4' to use the naive algo.
* tests/core/satmin2.test: Update tests.
Now use --sat-minimize='naive' to use the naive algo.
* tests/python/satmin.py: Update tests.
Now use 'naive=True' to use the naive algo.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
67e3a4f28e spot: Add 'langmap' option with dichotomy (it helps to choose min val)
* python/spot/__init__.py: Handle 'dicho' option in 'sat_minimize'.
* spot/priv/satcommon.cc: Implement get_number_of_distinct_vals.
* spot/priv/satcommon.hh: Declare get_number_of_distinct_vals.
* spot/twaalgos/dtbasat.cc: Use get_number_of_distinct_vals.
* spot/twaalgos/dtbasat.hh: Change dichotomy function's prototype.
* spot/twaalgos/dtwasat.cc: Use get_number_of_distinct_vals.
* spot/twaalgos/dtwasat.hh: Change dichotomy function's prototype.
Handle options.
* spot/twaalgos/postproc.cc: Handle options.
* spot/twaalgos/postproc.hh: Add dicho_langmap_ var for options.
* tests/core/satmin2.test: Add tests for dichotomy.
* tests/core/satmin.test: Add tests for dichotomy.
* tests/python/satmin.py: Replace 'dichotomy' with 'dicho' option.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
8a0eed6cef twaalgos: Implement language_map algo
* python/spot/impl.i: Add python bindings.
* spot/twaalgos/langmap.cc: Implement algo.
* spot/twaalgos/langmap.hh: Declare algo.
* spot/twaalgos/Makefile.am: Add new files.
* tests/python/langmap.py: Add tests.
* NEWS: Update.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
9a204b770f spot: Implement dt*a_sat_minimize_assume(...) methods
* python/spot/__init__.py: Add 'assume' option.
* spot/misc/satsolver.cc: Add function to handle assumptions.
* spot/misc/satsolver.hh: Declare assumption function.
* spot/twaalgos/dtbasat.cc: Implement dtba_sat_minimize_assume.
* spot/twaalgos/dtbasat.hh: Declare it.
* spot/twaalgos/dtwasat.cc: Implement dtwa_sat_minimize_assume and
handle options.
* spot/twaalgos/dtwasat.hh: Declare it.
* spot/twaalgos/postproc.cc: Handle options.
* spot/twaalgos/postproc.hh: Use param_ var for incr and assume.
* tests/core/satmin.test: Add tests for the new function.
* tests/core/satmin2.test: Add tests for the new function.
* tests/python/satmin.py: Add tests for the new function.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
ee17c2dee4 twaalgos: Implement dt*a_sat_minimize_incr(...) functions
* python/spot/__init__.py: Add 'incr' boolean argument.
* spot/twaalgos/dtbasat.cc: Implement dtba_sat_minimize_incr(...).
* spot/twaalgos/dtbasat.hh: Declare it.
* spot/twaalgos/dtwasat.cc: Implement dtwa_sat_minimize_incr(...) and
deal with options.
* spot/twaalgos/dtwasat.hh: Declare it.
* spot/twaalgos/postproc.cc: Add option --sat-minimize=incr.
* spot/twaalgos/postproc.hh: Add incr parameter.
* tests/core/satmin.test: Add tests for incremental version.
Update expected result.
* tests/core/satmin2.test: Add tests for incremental version.
* tests/python/satmin.py: Add tests for incremental version.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
dfd500a559 tests: Improve tests related to SAT-minimization
* tests/core/satmin.test: Delete check for SPOT_SATSOLVER env
variable and add state numbers verification.
* tests/core/satmin2.test: Delete check for SPOT_SATSOLVER
env variable.
* tests/python/satmin.py: Delete check for SPOT_SATSOLVER
env variable.
2017-01-06 19:53:21 +01:00
Alexandre Duret-Lutz
32086f7c83 tests: update ipnbdoctest to graphviz 2.40 and Python 3.6
This fix recent failures observed on arch linux because
it uses newer versions of graphviz and Python.

* tests/python/ipnbdoctest.py (sanitize): More substitutions.
2017-01-06 17:20:55 +01:00
Alexandre Duret-Lutz
12f6c8cf10 twa_graph: add a merge_univ_dests() method
and call it after parsing

* spot/twa/twagraph.cc, spot/twa/twagraph.hh
(twa_graph::merge_univ_dests): New method.
* spot/parseaut/parseaut.yy: Call it.
* spot/twaalgos/dot.cc: Improve output, now that
several edges can use the same universal destination.
* tests/core/alternating.test, tests/core/complete.test,
tests/core/parseaut.test, tests/python/_altscc.ipynb,
tests/python/alternating.py, tests/python/alternation.ipynb: Adjust
test case.
* doc/org/tut24.org: Adjust example.
2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
fa06cfa303 alternation: implement remove_alternation() for weak alt automata
This mixes the subset construction (for 1-state rejecting SCCs) and
the breakpoint construction (for larger rejecting SCCs).  The
algorithm should probably be rewritten in a cleaner and more efficient
way, but that should do for a first version.  It should be easy to
extend it to support Büchi acceptance (since the breakpoint
construction works for this) when we need it.

* spot/twaalgos/alternation.hh,
spot/twaalgos/alternation.cc (remove_alternation): New function.
* tests/python/alternation.ipynb: New file.
* tests/Makefile.am, doc/org/tut.org: Add it.
2016-12-29 12:57:16 +01:00
Alexandre Duret-Lutz
a4ce999402 sccinfo: adjust to work with alternating automata
* spot/twaalgos/sccinfo.cc: Consider universal edges as if they were
existential edges.
* spot/twaalgos/sccinfo.hh: Document that.
* spot/twaalgos/dot.cc: Allow option 's' again, for easy testing.
* tests/core/alternating.test: Adjust tests.
* tests/python/_altscc.ipynb: New file (more tests).
* tests/Makefile.am: Add it.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
27ab631cdc alternation: add a states_and algorithm
This should will come handy to implement the convertion from LTL to
alternating automata, and to handle automata with multiple initial
states.

* spot/twaalgos/alternation.hh, spot/twaalgos/alternation.cc: New files.
* spot/twaalgos/Makefile.am: Add them.
* python/spot/impl.i: Add bindings.
* tests/python/alternating.py: Test states_and.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
48c812a595 twa_graph: add support for universal initial states
The only missing point is that the HOA parser cannot deal with multiple
universal initial states, as seen in parseaut.test.

* spot/graph/graph.hh (new_univ_dests): New function, extracted from...
(new_univ_edge): ... this one.
* spot/twa/twagraph.hh (set_univ_init_state): Implement using
new_univ_dests.
* spot/twaalgos/dot.cc, spot/twaalgos/hoa.cc, python/spot/impl.i:
Add support for universal initial states.
* spot/parseaut/parseaut.yy: Add preliminary support for
universal initial states.  Multiple universal initial states
are still not supported.
* tests/core/alternating.test, tests/core/parseaut.test,
tests/python/alternating.py: Adjust tests and exercise this new feature.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
e620368696 parseaut: preliminary support for reading alternating automata
Currently this only reads universal branches.  The parser (and the
automaton code) do not support universal initial states.

* spot/parseaut/parseaut.yy: Read universal branches.  Deal with
the no-univ-branch/!univ-branch change in HOA 1.1.
* tests/python/alternating.py: Read the output of print_hoa.
* tests/core/parseaut.test: Adjust test output, and add more tests.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
56df459c75 print_hoa: add support for universal branches
* spot/twaalgos/hoa.cc: Implement it.
* tests/python/alternating.py: Test it.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
6aad559c29 twa_graph: add basic support for alternation
This only allows creating universal edges, and reading the associated
destinations.

* spot/twa/twagraph.hh (new_univ_edges, univ_dests, is_alternating): New
function.
* python/spot/impl.i: Add Python bindings.
* tests/python/alternating.py: New file.
* tests/Makefile.am: Add it.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
c225747749 twa: introduce intersects() and friends
* spot/twa/twa.hh, spot/twa/twa.cc (intersects, intersecting_run,
intersecting_word): New functions.
* NEWS: Mention them.
* doc/org/tut51.org, tests/python/bugdet.py: Use them.
2016-11-13 11:23:12 +01:00
Alexandre Duret-Lutz
ee85cf7759 * tests/python/ipnbdoctest.py: Ignore more SVG differences. 2016-11-11 15:27:36 +01:00
Alexandre Duret-Lutz
85f6e0e158 scc_filter: preserve state names and highlighted states
Suggested by Juraj Major.

* spot/twaalgos/sccfilter.cc: Here.
* tests/python/sccfilter.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the news.
2016-11-11 15:21:17 +01:00
Alexandre Duret-Lutz
dd706d7847 twa: do not set prop_state_acc in set_acceptance
Reported by Juraj Major.

* spot/twa/twa.hh: check num_sets() in prop_state_acc() so we do not
have to set it in set_acceptance(), causing trouble if set_acceptance()
is called multiple times.
* tests/python/setacc.py: New test case.
* tests/Makefile.am: Add it.
* THANKS: Add Juraj.
* NEWS: Mention the bug.
2016-11-11 15:20:56 +01:00
Alexandre Duret-Lutz
a0956d25b6 tests: do not hide stderr in ipnbdoctest
* tests/python/ipnbdoctest.py: here.
2016-11-10 23:18:57 +01:00
Alexandre Duret-Lutz
75c33defb3 attempt to mitigate our Debian build failures
* tests/Makefile.am: Run Python tests before other tests.
* tests/python/ipnbdoctest.py: Add some debug.
2016-11-09 05:55:02 +01:00
Alexandre Duret-Lutz
939e713e09 tests: update to work with Jupyter 4.2
Jupyter 4.2 just landed in Debian unstable, so we have a few failures
because of all the renamings.

* tests/python/ipnbdoctest.py: Adjust imports for Jupyter 4.2.
2016-11-05 23:14:21 +01:00
Alexandre Duret-Lutz
2e69e04583 from_ltlf: new LTL transformation.
Fixes #187.

* spot/tl/ltlf.cc, spot/tl/ltlf.hh: New files.
* spot/tl/Makefile.am: Add them.
* bin/ltlfilt.cc: Add a new option.
* bin/man/ltlfilt.x: Add bibliographic reference.
* tests/core/ltlfilt.test: Add more tests.
* tests/python/ltlf.py: New file.
* tests/Makefile.am: Add it.
* python/spot/impl.i: Python bindings.
* NEWS: Mention it.
2016-11-05 22:59:02 +01:00
Alexandre Duret-Lutz
d919b78c89 simulation: do not purge unreachable states when recording implications
This fixes the incorrect output of tgba_determinize() reported yesterday
by Reuben Rowe.

* spot/twaalgos/simulation.cc: Do not purge unreachable states when
recording implications.
* tests/python/bugdet.py: New test case.
* tests/Makefile.am: Add it.
* THANKS: Add Reuben.
* NEWS: Mention the bug.
2016-11-01 09:29:55 +01:00
Alexandre Duret-Lutz
d2068bb1a0 sbacc: improve using SCCs and common marks
* spot/twaalgos/sbacc.cc: Here.
* tests/core/parseaut.test, tests/python/automata.ipynb: Adjust.
* tests/core/sbacc.test: Likewise + more tests.
* NEWS: Mention it.
2016-07-31 22:57:50 +02:00
Alexandre Duret-Lutz
d271dfd592 python: make it possible to modify edges during iteration
Reported by Laurent Xu.

* python/spot/impl.i: Fix the iterator to return pointers instead of
references.  Because references are ultimately copied.
* tests/python/automata.ipynb: Add test cases.
* NEWS: Mention it.
2016-07-29 16:09:54 +02:00
Alexandre Duret-Lutz
29a1e3a299 python: add missing bindings for randomize()
* python/spot/impl.i: Here.
* NEWS: Mention it.
* tests/python/highlighting.ipynb: Add test case.
2016-07-19 02:55:07 +02:00
Alexandre Duret-Lutz
69b687ab66 dot: preserve highlights for <N output
* spot/twa/twagraph.hh (twa_graph::edge_number): New method.
* spot/twaalgos/copy.cc: Copy the highlights if requested.
* tests/python/highlighting.ipynb: More tests.
2016-07-19 02:41:34 +02:00
Alexandre Duret-Lutz
014a9dbd6b twa: add accepting_run() and accepting_word() methods
Fixes #153.

* spot/twa/twa.cc, spot/twa/twa.hh: Add the methods.
* bin/autfilt.cc, bin/common_aoutput.hh, bin/ltlcross.cc,
tests/python/highlighting.ipynb, tests/python/word.ipynb: Use
them to simplify the code.
* NEWS: Mention them.
2016-07-18 23:23:01 +02:00
Alexandre Duret-Lutz
3836ea8d18 python: more examples of highlighting
* tests/python/highlighting.ipynb: Augment.
2016-07-18 23:23:01 +02:00
Alexandre Duret-Lutz
ed04e2b421 adjust tests to SpinS 1.1
* tests/python/ipnbdoctest.py: Adjust sanitize function.
* tests/python/ltsmin-pml.ipynb: Adjust expected output.
2016-06-22 21:26:35 +02:00
Alexandre Duret-Lutz
a1260105a4 python: add the examples from the ATVA'16 paper
* tests/python/atva16-fig2a.ipynb, tests/python/atva16-fig2b.ipynb: New
files.
* tests/Makefile.am, doc/org/tut.org: Add them.
2016-06-17 14:18:48 +02:00
Alexandre Duret-Lutz
272daf62fc python: add a %%pml magic
Fixes #162.

* python/spot/ltsmin.i: Implement the magic.
* NEWS: Mention it.
* tests/python/ltsmin-pml.ipynb: New file.
* tests/Makefile.am, doc/org/tut.org: Add it.
* tests/python/ipnbdoctest.py: Adjust.
2016-06-12 12:53:55 +02:00
Alexandre Duret-Lutz
a7e4395f9d tests: rename ltsmin.ipynb
* tests/python/ltsmin.ipynb: Rename as ...
* tests/python/ltsmin-dve.ipynb: ... this.
* doc/org/tut.org, tests/Makefile.am: Adjust.
2016-06-12 12:28:15 +02:00
Alexandre Duret-Lutz
e91c6ba2f1 python: support operator rewriting in __format__
Fixes #168.

* python/spot/__init__.py: Implement it.
* tests/python/formulas.ipynb: Test it.
* NEWS: Mention it.
2016-05-01 21:05:49 +02:00
Alexandre Duret-Lutz
188cb8e4ab * tests/python/ltsmin.ipynb: Remove some debugging code. 2016-04-22 18:50:51 +02:00