Commit graph

290 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
5bb9c87d4c python: fix return of is_rabin_like() and is_streett_like()
* python/spot/impl.i: Fix instantiation of vector_rs_pairs.
* tests/python/setacc.py: Add test cases.
* NEWS: Mention the bugs.
2018-10-31 19:44:19 +01:00
Alexandre Duret-Lutz
266581b272 python: fix binding of used_inf_fin_sets()
* python/spot/impl.i: Here.
* tests/python/setacc.py: Test it.
* NEWS: Mention the bug.
2018-10-31 15:48:39 +01:00
Alexandre Duret-Lutz
e0958ee7c6 python: add xargs support to translate() and postprocess()
Fixes #361.

* python/spot/__init__.py: Implement it.
* tests/python/optionmap.py: Test it.
* NEWS: Mention it.
2018-10-17 18:16:46 +02:00
Alexandre Duret-Lutz
d94efe9fe1 implement is_liveness() and is_liveness_automaton()
* spot/twaalgos/strength.cc, spot/twaalgos/strength.hh,
spot/tl/hierarchy.cc, spot/tl/hierarchy.hh: Here.
* bin/ltlfilt.cc (--liveness): New filter.
* NEWS: Mention those.
* tests/core/ltlfilt.test, tests/python/ltlsimple.py: Add test cases.
2018-10-15 21:37:31 +02:00
Alexandre Duret-Lutz
e5f76b77d4 solve build issue on Debian unstable i386
* tests/python/_product_weak.ipynb: Split large loop in two cells.
2018-10-08 16:03:17 +02:00
Alexandre Duret-Lutz
82a152c38a unabbreviate: add new rules based on eventual/universal arguments
Based on a report by Simon Jantsch.  Fixes #362.

* NEWS, doc/tl/tl.tex: Mention the new rules.
* spot/tl/unabbrev.cc: Implement them.
* tests/core/unabbrevwm.test: Test them.
* tests/python/randltl.ipynb: Adjust.
2018-10-01 17:53:05 +02:00
Alexandre Duret-Lutz
8a26744720 fix python bindings for spot::parsed_formula::f getter
* python/spot/impl.i: Add a typemap.
* tests/python/ltlsimple.py: Add a test case for an issue.
* NEWS: Mention the bug.
2018-08-02 23:05:22 +02:00
Alexandre Duret-Lutz
23722c031f contains: fix the semantics
spot::contains(a, b) should test a⊇b.  It was testing a⊆b instead.

* NEWS: Mention the bug.
* spot/twaalgos/contains.cc, spot/twaalgos/contains.hh: Fix the
code and documentation.
* tests/python/contains.ipynb: Adjust description and expected
results.
* python/spot/__init__.py: Also swap the argument of
language_containment_checker.contains()
* bin/autfilt.cc: Adjust usage.
2018-08-01 17:17:25 +02:00
Alexandre Duret-Lutz
4ce0d92896 tl: add some implication-based rewritings for "<->", "->", and "xor"
This prevents an exception from being raised if NNF is not performed
on Boolean properties and implication-based checks are used.

* NEWS: Mention the issue.
* spot/tl/simplify.cc, doc/tl/tl.tex: Add some rules.
* tests/python/ltlsimple.py: Test them.
2018-08-01 17:17:09 +02:00
Maximilien Colange
516e9536df LAR made smarter with symmetry-based degeneralization
* spot/twaalgos/toparity.cc: here
* spot/twa/acc.hh, spot/twa/acc.cc: compute symmetries of an acceptance
  condition
* tests/python/accparse2.py, tests/python/toparity.py: test it
2018-07-27 00:44:19 +02:00
Alexandre Duret-Lutz
3303b86a89 ltl-split: translate any "safety" with "rest"
* tests/core/ltl2tgba2.test: Add a test-case reported by Maximilien.
* spot/twaalgos/translate.cc: Translate any "safety" formula with
"rest".
* tests/python/highlighting.ipynb: Adjust.
2018-07-26 18:17:13 +02:00
Alexandre Duret-Lutz
469d2b4ef4 genem: fix removal of unsatisfied Fin(x) sets
Fixes #360.

* spot/twa/acc.cc, spot/twa/acc.hh (force_inf): New method.
* spot/twaalgos/genem.cc: Fix the emptiness check using force_inf.
* tests/python/genem.py: Add test case and adjust the python
version of the emptiness check.
2018-07-26 16:07:30 +02:00
Alexandre Duret-Lutz
9f81df2cd4 scc_info: fix split_on_sets
* spot/twaalgos/sccinfo.cc (split_on_sets): Correctly register APs.
* tests/python/sccsplit.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the bug.
2018-07-26 16:07:22 +02:00
Maximilien Colange
465536d1fe translate any automaton to a parity automaton
* spot/twaalgos/toparity.cc, spot/twaalgos/toparity.hh: implement it,
  based on last-appearance record (LAR)
* spot/twaalgos/Makefile.am: build it
* NEWS: document it
* python/spot/impl.i: add to python bindings
* tests/Makefile.am, tests/python/toparity.py: test it
2018-07-24 14:58:53 +02:00
Alexandre Duret-Lutz
d708174cfe genem: implement a generic emptiness check for twa_graph_ptr
* spot/twa/acc.cc, spot/twa/acc.hh (fin_unit, one_fin): New function.
* spot/twaalgos/genem.cc, spot/twaalgos/genem.hh: New files.
* spot/twaalgos/Makefile.am: Add it.
* tests/python/genem.py: New file.
* tests/Makefile.am: Add it.
* python/spot/impl.i: Add bindings for genem.hh.
* NEWS: Mention the new function.
2018-07-24 13:36:04 +02:00
Alexandre Duret-Lutz
6875284f94 fix two issues related to jupyter notebook execution
* tests/python/ipnbdoctest.py: Invert diffs inputs.
* tests/run.in: Run notebooks with
PYTHONIOENCODING=utf-8:surrogateescape to avoid exceptions when trying
to display utf-8 characters on ascii terminals.
2018-07-12 17:18:22 +02:00
Alexandre Duret-Lutz
46590af693 more documentation for twa_graph internals
* spot/graph/graph.hh, spot/twa/twagraph.hh, spot/twa/twagraph.cc:
Implement a dump_storage_as_dot() method.
* python/spot/__init__.py (twa_graph.show_storage): New method, above
dump_storage_as_dot().
* tests/python/twagraph-internals.ipynb: New file, with documentation
about the twa_graph internals, using show_storage() to illustrate
everything.
* tests/Makefile.am, doc/org/tut.org: Add it.
* python/spot/impl.i: Add bindings for out_iterasor, demonstrated in
the Python notebook.
* spot/twa/twa.hh: Add prop_reset().  Used in the notebook.
* NEWS: Mention the new notebook and function.
* doc/org/tut50.org: Link to the notebook.
* tests/python/ipnbdoctest.py: Adjust for twa_graph_ptr being
redefined in the spot namespace.
2018-07-12 15:23:23 +02:00
Alexandre Duret-Lutz
0411099506 trival: prefer a global operator== relying on implicit conversion
Hopefully fixes #359.

* spot/misc/trival.hh: Declare a global operator==(trival,trival) that
replace the specialized operator==(bool,trival), and the in class
trival::operator(trival), thanks to the implicit construction from
bool to trival.  Make the repr_t/value_t constructor explicit, are
those are mostly internal to the library and may cause conflicts.
* spot/twa/twa.hh: Adjust to construct trival explicitly.
* python/spot/impl.i: Since Swig/Python does not support global
comparison operators, implement a member version, supporting
only __eq__(trival,bool) as before.
* tests/python/setacc.py: Adjust erroneous code.
* tests/python/trival.py: Add test cases.
2018-07-04 16:00:00 +02:00
43d426aaae complement: improve code coverage
* spot/twaalgos/complement.cc: removed unused code
* tests/python/except.py: test for exception raised
2018-07-02 18:36:56 +02:00
c717b58827 implement NCSB complementation
* spot/twaalgos/isdet.cc,spot/twaalgos/isdet.hh: Two new functions to
highlight deterministic SCCs
* spot/twaalgos/complement.cc,spot/twaalgos/complement.hh:
Implementation of the NCSB complementation algorithm
* tests/Makefile.am, tests/python/complement_semidet.py: Test the
implementation
* NEWS: document function
2018-07-02 14:32:57 +02:00
Alexandre Duret-Lutz
4e8b35d7ca twa: introduce exclusive_word() and exclusive_run()
* spot/twa/twa.cc, spot/twa/twa.hh: Add these methods.
* NEWS, tests/python/contains.ipynb: Document them.
2018-06-29 21:55:21 +02:00
Alexandre Duret-Lutz
f5f5daec9a translate: enable a restricted form of ltl-split for TGBA/BA
Fixes #267

* spot/twaalgos/gfguarantee.cc: Fix a typo when comparing automata
sizes.
* spot/twaalgos/translate.cc, spot/twaalgos/translate.hh: Use
ltl-split even for BA/TGBA, but only of conjunctions with GF(..)
in those cases.
* tests/core/ltl2tgba2.test: Adjust and add the example of #267.
* tests/core/degenid.test, tests/core/parity2.test,
tests/core/stutter-tgba.test, tests/python/automata.ipynb,
tests/python/highlighting.ipynb, tests/python/stutter-inv.ipynb,
bin/spot-x.cc: Adjust.
2018-06-28 23:02:26 +02:00
Alexandre Duret-Lutz
a325de8678 postproc: simplify the acceptance condition
* spot/twaalgos/postproc.cc: Here.
* spot/twaalgos/cobuchi.cc, spot/twaalgos/totgba.cc: Fix some bug
uncovered by the new simplified automata.
* tests/core/satmin2.test, tests/core/sccdot.test,
tests/core/sim3.test, tests/python/decompose.ipynb,
tests/python/satmin.ipynb: Update expected results.
* NEWS: Mention the simplification and the bug.
2018-06-22 17:17:45 +02:00
Alexandre Duret-Lutz
4815a361de translate: add ltl-split option
* spot/twaalgos/translate.cc, spot/twaalgos/translate.hh: Build
automata with generic acceptance by doing product of automata for
smaller subformulas.
* bin/spot-x.cc: Mention ltl-split.
* NEWS: Mention the change, and show some results.
* tests/core/genltl.test, tests/python/_product_susp.ipynb,
tests/python/highlighting.ipynb: Adjust test cases.
* doc/org/ltl2tgba.org: Update.
* tests/core/gragsa.test: Add another formula to cover more
code.
2018-06-20 11:38:59 +02:00
Alexandre Duret-Lutz
4f2e9512a2 product_susp: new function
* spot/twaalgos/product.cc, spot/twaalgos/product.hh: Implement it.
* tests/python/_product_susp.ipynb: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention it.
2018-06-20 11:38:59 +02:00
Alexandre Duret-Lutz
fbc372e292 scc_filter: add quick test for very-weak
Related to issue #351.

* spot/twaalgos/sccfilter.cc: When handling weak automata, we know
they are very-weak if the SCC count is equal to the number of states.
* tests/core/dca2.test, tests/core/monitor.test,
tests/core/parity2.test, tests/core/randomize.test,
tests/core/readsave.test, tests/core/remfin.test,
tests/core/sccsimpl.test, tests/core/wdba2.test,
tests/python/dualize.py, tests/python/remfin.py: Adjust output.
2018-06-11 21:42:21 +02:00
Alexandre Duret-Lutz
95d732e331 specialize scc_filter for inherently_weak automata
Part of issue #351.

* spot/twaalgos/sccfilter.cc, spot/twaalgos/sccfilter.hh: Specialize
for inherently-weak automata.
* spot/twaalgos/postproc.cc: Simplify.
* tests/core/dca2.test, tests/core/parity2.test,
tests/core/prodor.test, tests/core/randomize.test,
tests/python/automata.ipynb, tests/python/highlighting.ipynb,
tests/python/product.ipynb, tests/python/remfin.py,
tests/python/stutter-inv.ipynb: Adjust.
* NEWS: Mention it.
2018-06-11 15:01:49 +02:00
Alexandre Duret-Lutz
939f63eec9 genltl: add support for --sejk-f=n,m
Together with the previous patch, this Fixes #353.

Implementing this required to extend our interface two support
two-parameter patterns.

* spot/gen/formulas.cc, spot/gen/formulas.hh: Implement it.
* bin/genltl.cc: Add --sejk-f.
* bin/common_output.cc, bin/common_output.hh: Adjust to handle
"line numbers" that are not integers (e.g., "3,2"), since those
are used to display pattern parameters.
* bin/ltlfilt.cc: Adjust.
* python/spot/gen.i: Add support for two-parameters patterns.
* tests/core/genltl.test, tests/python/gen.ipynb: Augment.
* NEWS: Mention it.
2018-06-05 08:48:40 +02:00
Alexandre Duret-Lutz
e87d308eba improve alternation removal to match G&O construction
When dealternating the VWAA for GFa, our result had two states that
could not be fused by simulation because of unmatched acceptance mark.
With this change, the result can be simplified.

* spot/twaalgos/alternation.cc: Here.
* tests/core/alternating.test, tests/python/alternation.ipynb: Update
test case.
* NEWS: Mention it.
2018-06-01 10:59:37 +02:00
Alexandre Duret-Lutz
6d9d35c985 acc: turn some assertions into exceptions
* spot/misc/bitset.cc, spot/misc/bitset.hh (set, clear):
Turn asserts into exceptions.
* spot/twa/acc.hh (mark_t): As a consequence, the
constructor is not noexcept anymore.
* tests/core/acc.cc, tests/python/except.py: More tests.
2018-05-26 09:44:18 +02:00
Alexandre Duret-Lutz
b12eb0508f fix and check shifting issue
The exception raised by << and >> when shifting mark_t by too many
bits are only enabled in SPOT_DEBUG, as those operations are quite
low-level.  However we were always testing them, and although we
wanted them to be active in Python, it was not always the case.

* spot/twa/acc.hh: introduce max_accsets() as
a static constexpr method, so we can see it in Python.
* spot/misc/bitset.hh: Fix preprocessing directive
so the check is actually enabled when compiling the Python
bindings.
* bin/autcross.cc, bin/autfilt.cc, bin/ltlcross.cc: Use max_accsets().
* tests/core/acc.cc: Comment out the shifting exception when
SPOT_DEBUG is unset.
* tests/python/except.py: Make sure the exception is always raised in
Python.
2018-05-25 16:08:00 +02:00
Alexandre Duret-Lutz
23e0d718fd * tests/python/except.py: Make sure exceptions are raised. 2018-05-25 14:44:34 +02:00
Maximilien Colange
e886609269 optimize split_2step
* spot/twaalgos/split.cc: split_2step relies less on bdd, which improves
  its performance
* tests/python/split.py: update test
2018-05-25 12:09:04 +02:00
Alexandre Duret-Lutz
a738801edf product: optimize product with weak automata
Fixes #350.

* spot/twaalgos/product.cc: Implement this change.
* NEWS, spot/twaalgos/product.hh: Mention it.
* spot/twa/acc.cc, spot/twa/acc.hh (acc_cond::sat_mark): New method.
* tests/python/_product_weak.ipynb: New file.
* tests/Makefile.am: Add it.
* tests/python/automata.ipynb, tests/python/highlighting.ipynb,
tests/python/product.ipynb, tests/core/prodor.test: Adjust test cases.
2018-05-23 22:07:50 +02:00
Maximilien Colange
d7ee23ed2f acc_cond::mark_t now relies on bitset
This allows to represent more than 32 acceptance marks.

* configure.ac: add an option to specify the number of marks
* spot/twa/acc.hh: implement it
* tests/python/acc_cond.ipynb, tests/core/acc.cc,
  tests/core/ltlcross3.test: update tests
* NEWS: document it
* bin/randltl.cc: fix an include
2018-05-22 09:54:19 +02:00
Alexandre Duret-Lutz
00c3271c72 python: tests exceptions raised by is_weak_scc() and friends
* tests/python/except.py: Here.
2018-05-18 20:50:48 +02:00
Alexandre Duret-Lutz
fc0ed01a45 randomltl: avoid #define
As this pollutes the user's namespace.

* spot/tl/randomltl.hh: Use class-level enum and constexpr instead
of #define.
* spot/tl/randomltl.cc, python/spot/__init__.py, bin/randltl.cc,
tests/python/dualize.py, tests/python/sum.py: Adjust usage.
2018-05-16 18:35:36 +02:00
Alexandre Duret-Lutz
36b5b76ca5 python: improve formating of double-quoted AP in MathJax
* python/spot/impl.i: Move the rendering code...
* python/spot/__init__.py: ... here, and ajust it for MathJax.
* tests/python/formulas.ipynb, tests/python/ltsmin-dve.ipynb: Adjust
expected results.
2018-05-15 17:27:21 +02:00
Alexandre Duret-Lutz
6a808492c1 python: implicit str->formula conversion
* python/spot/impl.i, python/spot/__init__.py: Implement it.
* NEWS: Mention it.
* tests/python/atva16-fig2a.ipynb, tests/python/atva16-fig2b.ipynb,
tests/python/formulas.ipynb, tests/python/ltsmin-dve.ipynb,
tests/python/ltsmin-pml.ipynb, tests/python/stutter-inv.ipynb,
doc/org/tut02.org: Modernize.
2018-05-15 16:16:11 +02:00
Alexandre Duret-Lutz
5c1d9c492c dot: add option K
* spot/twaalgos/dot.cc: Here.
* NEWS, bin/common_aoutput.cc: Mention it.
* tests/python/ltsmin-pml.ipynb: Use it.
* tests/python/ipnbdoctest.py: Work around some graphviz
version differences.
2018-05-14 18:07:58 +02:00
Alexandre Duret-Lutz
9361bd9401 python: add a show= keyword to display_inline()
* python/spot/jupyter.py: Here.
* tests/python/alternation.ipynb: Use it.
* NEWS: Mention the above notebook as usage example.
2018-05-12 09:23:05 +02:00
Alexandre Duret-Lutz
60898b6d22 dot: support 'u'
* spot/twaalgos/dot.cc: Implement it.
* bin/common_aoutput.cc, NEWS: Mention it.
* tests/python/alternation.ipynb: Test it.
2018-05-12 09:23:05 +02:00
Alexandre Duret-Lutz
26f5e93e90 * tests/python/stutter-inv.ipynb: Remove debug print. 2018-05-04 17:44:09 +02:00
Alexandre Duret-Lutz
d6f9618172 introduce containement checks functions
* spot/twaalgos/contains.hh, spot/twaalgos/contains.cc: New files.
* spot/twaalgos/Makefile.am, python/spot/impl.i: Add them.
* python/spot/__init__.py: Also attach these functions as methods,
and support string arguments.
* tests/python/contains.ipynb: New file.
* tests/Makefile.am, doc/org/tut.org: Add it.
* bin/autfilt.cc, tests/python/streett_totgba.py, tests/python/sum.py,
tests/python/toweak.py: Use the new function.
2018-05-04 17:18:49 +02:00
Alexandre Duret-Lutz
58d9a12495 python: introduce spot.jupyter.display_inline()
* python/spot/jupyter.py: New file.
* python/Makefile.am: Add it.
* tests/python/product.ipynb: Use it.
* NEWS: Mention it.
2018-05-04 15:27:51 +02:00
Alexandre Duret-Lutz
b0b431a5a4 improve gf_guarantee_to_ba
* spot/twaalgos/gfguarantee.cc: Combine the last letter read
with the first one of the next pass when doing transition-based
acceptance.  Also move the initial states to the source of any
accepting transition if the input is deterministic.
* tests/core/ltl2tgba2.test, tests/core/satmin.test,
tests/python/stutter-inv.ipynb: Reduce expected sizes of a few
automata.
2018-05-03 20:05:50 +02:00
Maximilien Colange
1fdc32f9bb ltlsynt: improve construction of turn-based games
Improve the way transitions are duplicated when preparing the turn-based
game for synthesis. The resulting arena should now be deterministic on
nodes owned by the environment. Also move the code to another file, so
that it is easier to test (e.g. in Python).

* bin/ltlsynt.cc: move the code
* spot/twaalgos/split.cc, spot/twaalgos/split.hh: move the code and
  implement the improvements
* tests/Makefile.am, tests/python/split.py: test it
* tests/core/ltlsynt.test: update existing tests to reflect the changes
2018-04-30 14:41:52 +02:00
Alexandre Duret-Lutz
bc2fa1a2a3 * tests/python/satmin.ipynb: Remove a debug statement. 2018-04-20 16:55:20 +02:00
Alexandre Duret-Lutz
6cec43294d dot: name the digraph
* spot/twaalgos/dot.cc: Here.
* NEWS: Mention the change.
* tests/core/alternating.test, tests/core/det.test,
tests/core/dstar.test, tests/core/monitor.test,
tests/core/neverclaimread.test, tests/core/readsave.test,
tests/core/sccdot.test, tests/core/tgbagraph.test,
tests/python/_altscc.ipynb, tests/python/_autparserr.ipynb,
tests/python/alternation.ipynb, tests/python/atva16-fig2a.ipynb,
tests/python/atva16-fig2b.ipynb, tests/python/automata-io.ipynb,
tests/python/automata.ipynb, tests/python/decompose.ipynb,
tests/python/gen.ipynb, tests/python/highlighting.ipynb,
tests/python/ltsmin-dve.ipynb, tests/python/ltsmin-pml.ipynb,
tests/python/parity.ipynb, tests/python/product.ipynb,
tests/python/randaut.ipynb, tests/python/satmin.ipynb,
tests/python/stutter-inv.ipynb, tests/python/testingaut.ipynb,
tests/python/word.ipynb: Adjust test cases.
2018-04-07 18:58:58 +02:00
Alexandre Duret-Lutz
2775b0abc8 dot: use tooltips with option "1"
Fixes #327.

* spot/twaalgos/dot.cc: Emit a tooltip="..." for state names and
labels that are disabled by option "1".
* doc/org/tut51.org, tests/python/product.ipynb, NEWS: Discuss this.
* tests/core/readsave.test, tests/python/alternation.ipynb,
tests/python/automata.ipynb: Adjust test cases.
2018-04-07 18:58:58 +02:00