Commit graph

57 commits

Author SHA1 Message Date
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
Alexandre Duret-Lutz
33391798a3 python: export tgba_determinize
* python/spot/impl.i: Here.
* tests/python/automata.ipynb: Use it.
* NEWS: Mention it.
2016-04-22 18:50:51 +02:00
Alexandre Duret-Lutz
901f287032 python: add prints for atomic_prop_set
Fixes #159.

* python/spot/ltsmin.i: Here.
* python/spot/impl.i: Disable duplicate instantiation.
* tests/python/ltsmin.ipynb: Test it.
2016-04-08 23:01:07 +02:00
Alexandre Duret-Lutz
ed3b58c99c let ltsmin.model.kripke() take the output of atomic_prop_collect()
Fixes #160.

* spot/tl/formula.hh (formula::ap): New specialization.
* tests/python/ltsmin.ipynb: Test it.
2016-04-08 22:33:48 +02:00
Alexandre Duret-Lutz
cd661801df word: throw an exception when printing an empty word
Fixes #146.

* spot/twaalgos/word.cc: Here.
* tests/python/word.ipynb: Add a test case.
2016-03-08 14:22:58 +01:00
Alexandre Duret-Lutz
774895418a * tests/python/word.ipynb: Add a new test and some comments. 2016-03-08 12:14:14 +01:00
Alexandre Duret-Lutz
6bfde8e454 eval: Fix typography in error messages
* spot/twaalgos/word.cc: Here.
* tests/python/word.ipynb: Adjust.
2016-03-08 12:14:14 +01:00
Amaury Fauchille
1fd76ee918 word: implement twa word parsing
* spot/twaalgos/word.hh: add parse_word method and a new constructor
* spot/twaalgos/word.cc: implement word parsing
* python/spot/__init__.py: add parse_word method binding
* tests/python/word.ipynb: add word parsing tests
2016-03-07 20:17:00 +01:00
Alexandre Duret-Lutz
22f442f758 parsetl: change the interface to return a parsed_formula
This gets the interface of all the functions parsing formula in line
with the interface of the automaton parser: both return a "parsed_*"
object (parsed_formula or parsed_automaton) that contains the said
object and its list of errors.  Doing so avoid having to declare the
parse_error_list in advance.

* spot/tl/parse.hh, spot/parsetl/parsetl.yy: Do the change.
* spot/parsetl/fmterror.cc: Adjust the error printer.
* NEWS: Document it.
* bin/common_finput.cc, bin/common_finput.hh, bin/ltlcross.cc,
bin/ltldo.cc, bin/ltlfilt.cc, doc/org/tut01.org, doc/org/tut02.org,
doc/org/tut10.org, doc/org/tut20.org, python/ajax/spotcgi.in,
python/spot/impl.i, spot/parseaut/parseaut.yy, tests/core/checkpsl.cc,
tests/core/checkta.cc, tests/core/consterm.cc, tests/core/emptchk.cc,
tests/core/equalsf.cc, tests/core/ikwiad.cc, tests/core/kind.cc,
tests/core/length.cc, tests/core/ltlprod.cc, tests/core/ltlrel.cc,
tests/core/randtgba.cc, tests/core/readltl.cc, tests/core/reduc.cc,
tests/core/safra.cc, tests/core/syntimpl.cc, tests/core/tostring.cc,
tests/ltsmin/modelcheck.cc, tests/python/alarm.py,
tests/python/interdep.py, tests/python/ltl2tgba.py,
tests/python/ltlparse.py: Adjust all uses.
2016-02-17 20:31:58 +01:00
Alexandre Duret-Lutz
9692d734a9 cleanup ltsmin bindings
* python/spot/aux.py (rm_f): new function.
* python/spot/ltsmin.i: Replace the %require magic by a simple function.
Rewrite the %%dve magic.
* tests/python/otfcrash.py: Simplify using spot.ltsmin.require()
* tests/python/ltsmin.ipynb: Likewise, also add more text for the
documentation.
* NEWS: Adjust.
2016-02-16 19:08:28 +01:00
Alexandre Duret-Lutz
3a3913cf50 otf_product: fix deletion of iter_cache_
Fixes #152, reported by Valentin Iovene.

* spot/twa/twaproduct.cc (~twa_product): Delete iter_cache_.
* tests/python/otfcrash.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the bug.
2016-02-16 17:26:41 +01:00
Alexandre Duret-Lutz
22af7aefdf python: report dot errors
* python/spot/aux.py: Catch errors from dot and signal them.
* tests/python/_aux.ipynb: New file.
* tests/Makefile.am: Add it.
* tests/sanity/ipynb.pl: Support the convention that tests starting with
'_' should not be published on the web site.
2016-02-16 14:34:57 +01:00
Etienne Renault
091251b5b7 Provide support for %dve and %require
* NEWS, python/spot/ltsmin.i,
tests/python/ltsmin.ipynb: Here.
2016-02-15 09:08:37 +01:00
Alexandre Duret-Lutz
e146527852 twa_run: add a highlight method
* spot/twaalgos/emptiness.hh, spot/twaalgos/emptiness.cc: Add
the method.
* tests/python/highlighting.ipynb: Add a small test.
2016-02-06 17:10:55 +01:00
Alexandre Duret-Lutz
77b0b5b3fe dot: add option C(COLOR)
This fixes the output gliches visible in the previous patches,
where highlighting a state would remove its fill color.

* spot/twaalgos/dot.cc, spot/taalgos/dot.cc: Implement option C(COLOR).
* bin/common_aoutput.cc, doc/org/oaut.org: Document it.
* doc/org/.dir-locals.el.in, doc/org/init.el.in,
python/spot/__init__.py: Use it.
* tests/python/automata-io.ipynb, tests/python/automata.ipynb,
tests/python/highlighting.ipynb: Test it.
* tests/core/readsave.test: Adjust.
* NEWS: Mention recent changes.
2016-02-05 19:26:38 +01:00
Alexandre Duret-Lutz
23c2cbf46a python: highlighting functions for edges and states
* python/spot/impl.i (highlight_state, highlight_edge): New function.
* python/spot/__init__.py (highlight_states, highlight_edges): New
functions.
* spot/twaalgos/dot.cc: Add a '#' option.
* spot/taalgos/dot.cc: Ignore '#'.
* tests/python/highlighting.ipynb: New file to illustrate everything.
* tests/Makefile.am, doc/org/tut.org: Add it.
2016-02-05 17:29:30 +01:00
Alexandre Duret-Lutz
af96cbca83 * tests/python/ltsmin.ipynb: Erase the model file. 2016-02-03 08:51:37 +01:00
Alexandre Duret-Lutz
02b5460b91 dot, hoa: default to "k" for kripke structure
* spot/twaalgos/dot.cc, spot/twaalgos/hoa.cc: If a Kripke
structure is passed, automatically enable the "k" option.
* tests/core/parse_print_test.cc, tests/ltsmin/modelcheck.cc,
tests/python/ltsmin.ipynb: Remove the explicit use of "k".
* NEWS: Mention the change.
2016-02-01 22:12:13 +01:00
Alexandre Duret-Lutz
a9b4560f3d dot: add option "k"
Fixes #134.

* spot/twaalgos/dot.cc: Implement it.
* bin/common_aoutput.cc, spot/twaalgos/dot.hh, NEWS: Document it.
* tests/core/readsave.test, tests/python/ltsmin.ipynb: Test it.
2016-02-01 08:38:45 +01:00
Alexandre Duret-Lutz
5a5f83f468 python: add missing bindings for twa_word and twa_run
Fixes #133.

* python/spot/impl.i: Add bindings for twa_word.  Add a __repr__
for twa_run, and instantiate templates for twa_run's members.
* tests/python/word.ipynb: New file with examples.
* tests/Makefile.am, doc/org/tut.org: Add it.
2016-01-31 21:05:44 +01:00
Alexandre Duret-Lutz
b11c07b351 dot: add a <N option
* spot/twaalgos/dot.cc: Implement it.
* spot/taalgos/dot.cc: Ignore it.
* spot/twaalgos/copy.cc, spot/twaalgos/copy.hh: Add option
to limit the number of states.
* tests/python/ltsmin.ipynb: Improve test case.
* tests/Makefile.am: Cleanup the files generated by ltsmin.ipynb.
* python/spot/__init__.py (setup): Add a max_states argument
that default to 50.
* bin/common_aoutput.cc: Mention the <INT option.
* NEWS: Likewise.
2016-01-29 09:09:05 +01:00
Alexandre Duret-Lutz
4571d6dd3a copy: rewrite as a BFS without using reachiter
* spot/twaalgos/copy.hh: Trim includes.
* spot/twaalgos/copy.cc: Rewrite.
* tests/python/ltsmin.ipynb: Adjust.
2016-01-28 15:37:00 +01:00
Alexandre Duret-Lutz
db1e842a67 ltsmin: add accessors for variable names and types
* spot/ltsmin/ltsmin.hh, spot/ltsmin/ltsmin.cc: Expose more of the
ltsmin interface.
* python/spot/ltsmin.i: Add some helper functions on top of this
new interface.
* tests/python/ltsmin.ipynb: Test them.
* NEWS: Mention it.
2016-01-26 19:21:35 +01:00
Alexandre Duret-Lutz
907b72fbfb ltsmin: implement a two-step loading
* spot/ltsmin/ltsmin.cc, spot/ltsmin/ltsmin.hh: Split load_ltsmin() into
ltsmin_model::load() and ltsmin_model::kripke().  Report errors using
exceptions instead of on std::cerr.
* python/spot/ltsmin.i: Deal with exceptions.
* tests/ltsmin/modelcheck.cc, tests/python/ltsmin.ipynb: Adjust.
2016-01-26 19:21:35 +01:00
Alexandre Duret-Lutz
5a9b0aa1c1 python: add bindings for ltsmin
* python/spot/ltsmin.i: New file.
* python/Makefile.am: Add it.
* python/spot/impl.i: Add bindings for kripke and fair_kripke.
* tests/python/ltsmin.ipynb: New file.
* tests/Makefile.am, doc/org/tut.org: Add it.
* tests/python/ipnbdoctest.py: Make it possible for notebook
to exit(77).
* debian/control: Make the Python package dependent
on libspotltsmin0.
* python/spot/__init__.py: Typo.
2016-01-26 19:20:53 +01:00