Commit graph

546 commits

Author SHA1 Message Date
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
c76df95c69 genltl: three new families --sejk-{j,k,patterns}
These correspond to the first three blocks of table 1 in S. Sickert,
J. Esparza, S. Jaax, and J. Křetínský: Limit-Deterministic Büchi
Automata for Linear Temporal Logic.  CAV'16.  LNCS 9780.

For #353.

* spot/gen/formulas.cc, spot/gen/formulas.hh, bin/genltl.cc: Implement
the new families.
* tests/core/genltl.test: Test it.
* bin/man/genltl.x, NEWS: Document it.
2018-06-03 20:20:59 +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
a9293f329e fix warnings when compiling without assertions
* spot/twa/acc.hh, spot/twaalgos/alternation.cc,
  spot/twaalgos/determinize.cc, spot/twaalgos/ndfs_result.hxx,
  spot/twaalgos/tau03.cc, spot/ltsmin/ltsmin.cc, tests/core/parity.cc:
  here
2018-05-25 14:41:18 +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
Maximilien Colange
5a819e0c93 twa_graph: add a method to merge states with same outgoing edges
* spot/twa/twagraph.hh, spot/twa/twagraph.cc: here
* NEWS: document it
* tests/core/twagraph.cc, tests/core/tgbagraph.test: test it
2018-05-25 12:09:04 +02:00
Alexandre Duret-Lutz
2e165f188d rename SPOT_NB_ACC to SPOT_MAX_ACCSETS
* NEWS, bin/autcross.cc, bin/autfilt.cc, bin/ltlcross.cc,
configure.ac, spot/parseaut/parseaut.yy, spot/twa/acc.cc,
spot/twa/acc.hh, tests/core/acc.cc, .gitlab-ci.yml: Here.
2018-05-24 22:18:42 +02:00
Alexandre Duret-Lutz
b17a9f8578 * tests/sanity/style.test: Allow {{x}} in constructors. 2018-05-24 19:23:48 +02:00
Alexandre Duret-Lutz
c87c13db67 autfilt: better handling of chain of products with -B
Fixes #348, reported by Jeroen Meijer.

* bin/autfilt.cc: If -B is used with many --product,
degeneralize intermediate products as needed.
* NEWS: Mention the change.
* tests/core/prodchain.test: New file.
* tests/Makefile.am: Add it.
* spot/twa/acc.cc, spot/twa/acc.hh: Fix reporting of
overflow.
* tests/core/acc.cc: Adjust.
2018-05-24 19:23:48 +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
b655038803 ltlsynt: improve coverage
* tests/core/ltlsynt.test: here
2018-05-23 18:40:15 +02:00
Maximilien Colange
61b2b9b140 genltl: improve coverage
* tests/core/genltl.test: here
* spot/gen/formulas.cc: typo
2018-05-23 17:32:54 +02:00
Maximilien Colange
321230f869 ltlfilt: improve coverage
* tests/core/ltlfilt.test: here
2018-05-23 12:01:43 +02:00
Maximilien Colange
1a4117a07f randltl: fix option --allow-dups
* bin/randltl.cc: here
* tests/core/rand.test: test it
* NEWS: document it
2018-05-23 12:01:43 +02:00
Maximilien Colange
c6c085ab22 various fixes to bitset
* spot/misc/bitset.hh: here
* tests/core/acc.cc: test it
2018-05-23 10:02:43 +02:00
Maximilien Colange
65a56f4cef improve coverage
* tests/core/acc.cc: here
* tests/core/acc.test: fix test invokation
2018-05-22 12:16:43 +02:00
Maximilien Colange
6f057941ce better coverage for ltlsynt
* tests/core/ltlsynt.test: here
2018-05-22 11:26:31 +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
Maximilien Colange
1aaeccf1d3 remove parity_product and parity_product_or
* NEWS: document it
* spot/twaalgos/parity.cc, spot/twaalgos/parity.hh,
  tests/core/parity.cc: here
2018-05-22 09:54:13 +02:00
Alexandre Duret-Lutz
924a642939 * tests/core/randtgba.cc: Remove code related to random formulas. 2018-05-21 17:39:38 +02:00
Alexandre Duret-Lutz
6e8af75ee9 autcross: exercise %S, %L, and {name{nest}}
* tests/core/autcross.test, tests/core/autcross2.test: More tests.
2018-05-21 17:39:38 +02:00
Alexandre Duret-Lutz
c369f899a3 bin: teach conversion options to report about the options
* bin/common_conv.cc, bin/common_conv.hh: Here.
* bin/autfilt.cc, bin/common_trans.cc, bin/ltlcross.cc, bin/ltldo.cc,
bin/ltlfilt.cc, bin/ltlgrind.cc, bin/randaut.cc, bin/randltl.cc: Pass
the name of the argumennt to the conversion function.
* tests/core/ltlcross3.test, tests/core/ltldo.test,
tests/core/randaut.test: Add test cases.
2018-05-21 17:39:38 +02:00
Alexandre Duret-Lutz
1f9f3c77ea bin: abort autcross on input parse error
* bin/common_hoaread.hh (hoa_processor): Add a abort_on_error
option.
* bin/autcross.cc: Use it.
* tests/core/autcross4.test: Add many more error cases to improve
coverage.
2018-05-21 17:39:38 +02:00
Alexandre Duret-Lutz
faca835a5e bin: improve coverage of range-checking code
* tests/core/genaut.test: Here.
2018-05-21 11:00:36 +02:00
Alexandre Duret-Lutz
eca96cdf80 parseaut: accept Alias: before AP:
Fixes #345.

* spot/parseaut/parseaut.yy: Deal with this inconvenient order.
* tests/core/parseaut.test: Test it.
* NEWS: Mention the bug fix.
2018-05-21 10:24:25 +02:00
Alexandre Duret-Lutz
2e90460b8a tests: exercise --stats='%[v]c %[IW]c' and friends
* tests/core/scc.test: Here.
2018-05-18 20:50:48 +02:00
Alexandre Duret-Lutz
47974cd004 autfilt: support --is-colored
This also improve the coverage of the is_colored() function, because
it was not used in negative cases so far.

* bin/autfilt.cc: Implement it.
* tests/core/satmin2.test: Test it.
* NEWS: Mention it.
2018-05-18 20:50:48 +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
f0b57d7264 tests: use ltlcross --color for better code coverage
* tests/core/ltlcross3.test: Here.
2018-05-16 17:05:21 +02:00
Alexandre Duret-Lutz
589a4035bc tests: cover error handling of ltlfilt -r
* tests/core/ltlfilt.test: Add test cases.
2018-05-16 17:05:21 +02:00
Alexandre Duret-Lutz
a94cc623ad * tests/core/bdd.test: Cover garbage collection hooks. 2018-05-16 16:16:47 +02:00
Alexandre Duret-Lutz
4d82758726 autfilt: --complement accepts non-deterministic input
* bin/autfilt.cc: Fix the --help string for --complement, and also
merge edges in the resulting automaton, as suggested by František
Blahoudek.
* tests/core/complement.test: Adjust output and add František's
example.
2018-05-16 14:23:31 +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
4fbcdaca91 print_dot: correctly escape \n in html output
* spot/misc/escape.cc (escape_html): Handle \n.
* tests/core/readsave.test: Test it.
* NEWS: Mention the fix.
2018-04-27 15:46:56 +02:00
Maximilien Colange
9d34c1f500 fix parity game printing
* spot/misc/game.cc: a state could be printed several times
* tests/core/ltlsynt.test: update tests
2018-04-23 14:38:45 +02:00
Maximilien Colange
0e29d30d1b ltlsynt: fix the construction of the arena
* bin/ltlsynt.cc: implement it
* tests/core/ltlsynt.test: update tests
2018-04-23 11:51:12 +02:00
Alexandre Duret-Lutz
bc2fa1a2a3 * tests/python/satmin.ipynb: Remove a debug statement. 2018-04-20 16:55:20 +02:00