Commit graph

1167 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
202ab92d1d ltlsynt: detect APs with constant polarity
This implements the first point of issue #529.

* spot/tl/apcollect.cc, spot/tl/apcollect.hh (collect_litterals): New
function.
* bin/ltlsynt.cc: Implement the --polarity option, use
collect_litterals() to simplify the specification, finally patch the
game, Mealy, or Aiger output.
* spot/twaalgos/aiger.cc, spot/twaalgos/aiger.hh: Take a
relabeling_map has argument to specify extra APs.
* tests/core/ltlsynt.test, tests/core/ltlsynt2.test: Adjust test
cases.
2023-09-19 11:35:21 +02:00
Alexandre Duret-Lutz
6ac2416e5d forq: remove the "same AP set" restriction
* spot/twaalgos/forq_contains.cc: Remove the check.
* tests/python/forq_contains.py: Add two test cases for this.
2023-09-15 10:51:00 +02:00
Alexandre Duret-Lutz
05d7622f8f forq: make it easier to select contains's version
* spot/twaalgos/contains.hh, spot/twaalgos/contains.cc
(containment_select_version): New function.
(contains): Use it.
* spot/twa/twa.cc (exclusive_word): Likewise.
* bin/autfilt.cc (--included-in): Adjust to use forq depending
on containement_select_version.
* bin/man/spot-x.x: Adjust documentation of
CONTAINMENT_SELECT_VERSION.
* tests/core/included.test, tests/python/forq_contains.py: Add more
tests.
* NEWS: Mention the new feature.
2023-09-15 10:51:00 +02:00
Alexandre Duret-Lutz
ca4e6c4b48 forq: swap arguments of contains_forq
* spot/twaalgos/forq_contains.hh,
spot/twaalgos/forq_contains.cc (contains_forq): Swap arguments so
they follow the same order as contains().
* tests/python/forq_contains.py: Adjust.
2023-09-15 10:50:52 +02:00
Jonah Romero
d1c5b2efdf implement a FORQ-based inclusion check for SBAs
* spot/twaalgos/forq_contains.cc, spot/twaalgos/forq_contains.hh: New
files.
* spot/twaalgos/Makefile.am, python/spot/impl.i: Add them.
* tests/python/forq_contains.py: New file.
* tests/Makefile.am: Add it.
2023-09-13 15:48:17 +02:00
Jonah Romero
c2832cabfc split: add a new split_edge variant
* spot/twaalgos/split.cc, spot/twaalgos/split.hh: Here.
* tests/python/splitedge.py: New file.
* tests/Makefile.am: Add it.
2023-09-13 15:48:17 +02:00
Alexandre Duret-Lutz
7149521f48 relabel_bse: rework to simplify more patterns
Rework the way we compute and use cut-points to catch more patterns we
can rewrite.  Also Use BDDs to check if a Boolean sub-expression is
false or true.   Fixes issue #540.

* spot/tl/relabel.hh: Update documentation
* spot/tl/relabel.cc (relabel_bse): Rework.
* tests/core/ltlfilt.test: Add more test cases.
* tests/python/_mealy.ipynb: Update.
* NEWS: Mention the change.
2023-09-13 11:31:49 +02:00
Alexandre Duret-Lutz
cbb981ffd5 python: add bindings for set of unsigned int
Requested by Marek Jankola.

* python/spot/impl.i: Add bindings for std::set<unsigned>.
* tests/python/powerset.py: New file.
* tests/Makefile.am: Add it.
* THANKS: Add Marek.
2023-09-08 12:05:06 +02:00
Alexandre Duret-Lutz
110b052b7d translate: add a new relabel-overlap option
Fixes issue #536.  Also a part of issue #500.

* spot/twaalgos/translate.hh, spot/twaalgos/translate.cc: Implement
this new option.
* bin/spot-x.cc, NEWS: Mention it.
* tests/core/ltl2tgba2.test: Add the test case from issue #536.
2023-08-30 16:49:28 +02:00
Alexandre Duret-Lutz
18478e663f relabel: introduce an overlapping relabeling version
Related to issue #500 and issue #536.

* spot/tl/relabel.hh (relabel_overlapping_bse): New function.
* spot/tl/relabel.cc: Implement it.
* bin/ltlfilt.cc: Add a --relabel-overlapping-bool option.
* tests/core/ltlfilt.test: Test it.
* NEWS: Mention it.
2023-08-30 16:49:19 +02:00
Alexandre Duret-Lutz
14347cdc52 * tests/sanity/style.test: Don't use egrep. 2023-08-03 11:49:08 +02:00
Alexandre Duret-Lutz
7358a26492 improve coverage of LaTeX/utf8 printers for SERE
* bin/common_output.cc, bin/common_output.hh,
bin/randltl.cc: Adjust so that running "randltl -S" use
the SERE flavor of the spot/latex/utf8 formula printers.
* tests/core/latex.test, tests/core/utf8.test,
tests/python/ltlparse.py: Add more test cases.
2023-07-27 16:30:35 +02:00
Alexandre Duret-Lutz
95e3bb815c bin: cover more tmpfile failure when running as root
* tests/core/ltlcross5.test: reorganize to test missing directory
before permission issues, as the latter cannot be run as root.
2023-07-27 16:30:35 +02:00
Alexandre Duret-Lutz
e1e9f960e6 tests: add some test to cover autcross' univ-edges removal
* tests/core/ltl3ba.test: Here.
2023-07-27 16:30:35 +02:00
Alexandre Duret-Lutz
95379c18cc aiger: order the inputs of binary AND gates
* spot/twaalgos/aiger.cc: Here.
* tests/core/ltlsynt.test: Adjust, and add test case for aiger=optim.
2023-07-27 16:30:35 +02:00
Alexandre Duret-Lutz
61e43edde8 bin: fix handling of -o '>>-' in the close/reopen path
* tests/core/serial.test: Add test case.
* bin/common_file.cc: Fix it.
2023-07-26 21:50:16 +02:00
Alexandre Duret-Lutz
0923f8efe2 bin: fix handling for --output & --format with LTL outputs
* bin/common_output.cc: Set the output stream for LTL formats.
* tests/core/serial.test: Add a test case about this issue that also
improve the covering of the previous patch about saving file
descriptors.
2023-07-26 21:33:36 +02:00
Alexandre Duret-Lutz
06b1ecb50b work around spurious GCC 13 warnings
* spot/graph/graph.hh (new_univ_dests): Add an overload taking
a temporary vector.
* spot/twa/twagraph.cc (defrag_states): Use it.
* tests/core/parity.cc: Remove some temporary variables.
2023-07-26 16:19:23 +02:00
Alexandre Duret-Lutz
40e30df7e3 bin: handle thousands of output files
Fixes #534.

* bin/common_file.hh, bin/common_file.cc: Make it possible
to reopen a closed file.
* bin/common_output.cc, bin/common_aoutput.cc: Add a heuristic
to decide when to close files.
* tests/core/serial.test: Add a test case.
* NEWS: Mention the issue.
2023-07-24 16:56:24 +02:00
Alexandre Duret-Lutz
17a5b41d8c * tests/core/ltlcross4.test: Work around recent Pandas change. 2023-07-24 12:16:30 +02:00
Alexandre Duret-Lutz
61b457a37e bin: allow %l to be used to print serial numbers
* NEWS: Mention it.
* bin/autfilt.cc, bin/common_aoutput.cc, bin/common_aoutput.hh,
bin/common_output.cc, bin/common_output.hh, bin/dstar2tgba.cc,
bin/genaut.cc, bin/genltl.cc, bin/ltl2tgba.cc, bin/ltldo.cc,
bin/ltlfilt.cc, bin/ltlgrind.cc, bin/randaut.cc, bin/randltl.cc:
Implement it.
* doc/org/oaut.org: Add a short example.
* tests/core/serial.test: New file.
* tests/Makefile.am: Add it.
2023-07-21 17:16:19 +02:00
Alexandre Duret-Lutz
8369663380 fix spurious failure of ltlcross4.test
Reported by Yuri Victorovich.

* tests/core/ltlcross4.test: Drop the 'formula' column before
computing aggregates.  It causes warnings in some Pandas versions, and
errors in others.
2023-06-12 11:05:54 +02:00
Florian Renkin
7868115a8b parity_type_to_parity: Add missing cases
* spot/twaalgos/toparity.cc: Correct some cases where the solution was
not detected.
* tests/python/toparity.py: Update tests.
2023-05-24 20:05:43 +02:00
Alexandre Duret-Lutz
134da9209c genem: Add yet another version of the algorithm
* spot/twa/acc.hh, spot/twa/acc.cc (fin_unit_one_split_improved): New
function.
* python/spot/impl.i: Add bindings for fin_unit_one_split_improved.
* spot/twaalgos/genem.cc: Add the spot212 version.
* tests/python/genem.py: Test it.
2023-05-15 09:43:46 +02:00
Alexandre Duret-Lutz
0e54a85310 powerset: fix segfault when the initial state is a sink
Reported by Raven Beutner.

* spot/twaalgos/minimize.cc: Improve comment.
* spot/twaalgos/powerset.cc: Fix handling of an initial state that
is also a sink.
* tests/core/wdba2.test: Add test case.
* NEWS: Mention the bug.
2023-04-18 22:18:16 +02:00
Alexandre Duret-Lutz
ae10361bdd twa_run: let as_twa work on the result of intersecting_run
Reported by Philipp Schlehuber-Caissier.

* spot/twaalgos/emptiness.cc (as_twa): Simplify considerably.  Don't
try to replay the run, and don't merge identical states.
* spot/twaalgos/word.hh, spot/twaalgos/emptiness.hh: Improve
documentation.
* tests/python/intrun.py: Add a test case.
* NEWS: Mention the bug.
2023-04-18 22:18:16 +02:00
Philipp Schlehuber-Caissier
d152b3a316 Fix parity solver if edgevector is not contiguous
Validity of strategies was tested relying on
num_edges() which might be smaller than the edge_number

* spot/twaalgos/game.cc: Fix here
* tests/python/game.py: Test here
2023-03-31 15:17:57 +02:00
Alexandre Duret-Lutz
039cd756d5 fix spurious test-case failure when Python is not installed
Fixes #530.

* tests/core/ltlsynt2.test: Skip when PYTHON is empty.
* NEWS: Mention the fix.
2023-03-29 16:20:51 +02:00
Philipp Schlehuber
e7e23d5ffc Adding option to solve parity games globally
Parity games have been solved semi-locally so far.
We deduced a strategy for the reachable part of the arena
This lead to some inconsistencies when not all state were
rachable.
Now you can chose to solve parity games truely globally.

* spot/twaalgos/game.cc, spot/twaalgos/game.hh: Here
* tests/python/games.ipynb: Test
2023-03-23 09:02:09 +01:00
Alexandre Duret-Lutz
66839b1a29 bdd_to_formula: add CNF variant
* spot/twa/formula2bdd.hh,
spot/twa/formula2bdd.cc (bdd_to_cnf_formula): New function.
* python/spot/__init__.py: Add a default dictionary for convenience.
* tests/python/bdditer.py: Add test cases.
* NEWS: Mention it.
2023-02-24 11:26:12 +01:00
Alexandre Duret-Lutz
a117fe1a22 to_finit: fix issue #526
* spot/twaalgos/remprop.cc: Use bdd_restrict instead of bdd_exists.
* tests/core/ltlf.test: Add test case.
* NEWS: Mention the bug.
2023-02-07 14:40:20 +01:00
Alexandre Duret-Lutz
43b4d80da1 dbranch: fix handling of state-based acceptance
Fixes issue #525.

* spot/twaalgos/dbranch.hh, NEWS: Document.
* spot/twaalgos/dbranch.cc: Detect cases where the acceptance should
be changed from state-based to transition-based.
* tests/python/dbranch.py: Add a test case.
2023-02-03 09:35:46 +01:00
Alexandre Duret-Lutz
e5150d0314 autfilt: allow --highlight-word to work on Fin acceptance
Fixes #523.

* bin/autfilt.cc: Remove the restriction.
* tests/core/acc_word.test: Add test case.
* NEWS: Mention the fix.
2023-01-24 17:55:17 +01:00
Alexandre Duret-Lutz
a9c457f93f dbranch: fix handling of states without successors
Fixes #524, reported by Rüdiger Ehlers.

* spot/twaalgos/dbranch.cc: When merging an edge going to state
without successors simply delete it.
* bin/spot-x.cc: Typo in documentation.
* tests/core/ltlcross.test: Add a test case.
* NEWS: Mention the bug.
2023-01-23 11:59:49 +01:00
Alexandre Duret-Lutz
96c3972c5c bin: detect overflows in conversion functions
* bin/common_conv.cc (to_int, to_unsigned): Here.
* bin/common_range.cc (parse_range): And there.
* tests/core/ltlgrind.test, tests/core/genaut.test,
tests/core/randaut.test: Add test cases.
2023-01-09 11:34:21 +01:00
Alexandre Duret-Lutz
396009c014 parseaut: better merge of multiple initial states
If an initial states without incoming transition has to be merged into
another one, its outgoing edges can be reused by just changing their
source.

* spot/parseaut/parseaut.yy (fix_initial_state): Implement this here.
* tests/core/522.test: Add more tests.
* tests/core/readsave.test: Adjust one expected output.
* doc/org/hoa.org: Mention the completeness change.
* NEWS: Mention the new feature.
2023-01-05 16:15:08 +01:00
Alexandre Duret-Lutz
daf797b9d4 fix merging of initial states in state-based automata
Fixes #522 reported by Raven Beutner.

* spot/parseaut/parseaut.yy: Make sure all edges leaving
the initial state have the same color.
* THANKS: Add Raven.
* NEWS: Mention the bug.
* tests/core/522.test: New file.
* tests/Makefile.am: Add it.
2023-01-04 15:12:59 +01:00
Alexandre Duret-Lutz
ba695194cd priv: remove unused allocator.hh
* spot/priv/allocator.hh: Delete.
* spot/priv/Makefile.am, tests/core/mempool.cc: Adjust.
2022-12-10 22:18:18 +00:00
Alexandre Duret-Lutz
d0b1508831 acd: rewrite Python wrapper without jQuery
* python/spot/__init__.py (acd): Rewrite javascript so that it does
not use jQuery, to make it easier to use in jupyterlab, or with
nbconvert.
* tests/python/zlktree.ipynb: Adjust.
* NEWS: Mention this.
2022-12-10 22:18:18 +00:00
Philipp Schlehuber-Caissier
6e2e7c942e Using partitioned_relabel_here
Put the new function to use in order to speed up
mealy machine minimization

* spot/twaalgos/mealy_machine.cc: Here
* spot/twaalgos/synthesis.cc
, spot/twaalgos/synthesis.hh: Helper function to relabel games
* tests/python/_mealy.ipynb
, tests/python/except.py
, tests/python/_partitioned_relabel.ipynb: Adapt/expand tests
2022-12-09 17:00:52 +01:00
Philipp Schlehuber-Caissier
fb63dfc309 introduce partitioned_relabel_here
Function taking an automaton and trying to relabel
it by partitioning the old conditions and encode the
different subsets of the partition with new variables

* spot/priv/Makefile.am: Add
* spot/priv/partitioned_relabel.hh
, spot/priv/partitioned_relabel.cc: try_partition_me,
computes the partition of a given vector of bdds
* spot/twaalgos/relabel.hh
, spot/twaalgos/relabel.cc: Here. Adapt also relabel()
to cope with the different type of relabeling_maps
* tests/python/_partitioned_relabel.ipynb
, tests/python/except.py: Test and Usage
* tests/Makefile.am: Add test
2022-12-09 17:00:51 +01:00
Alexandre Duret-Lutz
720c380412 formula: new trivial simplifications
Add the following rules:
  - f|[+] = [+] if f rejects [*0]
  - f|[*] = [*] if f accepts [*0]
  - f&&[+] = f if f rejects [*0]
  - b:b[*i..j] = b[*max(i,1)..j]
  - b[*i..j]:b[*k..l] = b[*max(i,1)+max(k,1)-1,1), j+l-1]

* spot/tl/formula.cc: Implement the new rules.
* doc/tl/tl.tex: Document them.
* tests/core/equals.test: Test them.
* NEWS: Add them
2022-12-09 09:30:10 +01:00
Philipp Schlehuber-Caissier
37d4e513d9 game: fix appending strategies bug
When calling solve_parity_game() multiple times on the same
automaton the strategies are appended one after the other.
Reported by Dávid Smolka.

* NEWS: Mention the bug.
* spot/twaalgos/game.cc: Fix it.
* tests/python/game.py: Test it.
* THANKS: Add Dávid.
2022-12-06 16:06:04 +01:00
Philipp Schlehuber-Caissier
86c433cf80 mealy: fix incorrect assertion
* spot/twaalgos/mealy_machine.cc (minimize_mealy): Do not compare
result to the original unsplit machine without splitting it first.
* tests/python/mealy.py: Add a test case.
2022-12-06 16:04:40 +01:00
Alexandre Duret-Lutz
29037c1f55 autfilt: print match count even on parse errors
* bin/autfilt.cc: If -c is used, print the match_count even
in present of parse errors.
* tests/core/readsave.test: Adjust.
* NEWS: Mention the bug.
2022-12-02 15:24:31 +01:00
Alexandre Duret-Lutz
a032abf0c5 parseaut: diagnose states that are unused and undefined
Reported by Pierre Ganty.

* spot/parseaut/parseaut.yy: Add diagnostics.
* tests/core/parseaut.test: Adjust expected output, and add a test
case.
* NEWS: Mention the bug.
2022-12-02 15:24:25 +01:00
Alexandre Duret-Lutz
843c4cdb91 translate, simplify: limit containment checks of n-ary operators
Fixes #521.

* spot/tl/simplify.cc, spot/tl/simplify.hh,
spot/twaalgos/translate.cc, spot/twaalgos/translate.hh: Add an option
to limit automata-based implication checks of n-ary operators when too
many operands are used.  Defaults to 16.
* bin/spot-x.cc, NEWS, doc/tl/tl.tex: Document it.
* tests/core/bdd.test: Disable the limit for this test.
2022-11-15 17:49:21 +01:00
Alexandre Duret-Lutz
f2c65ea557 simplify: set exprop=false during containment checks
For issue #521, reported by Jacopo Binchi.

* spot/tl/simplify.cc: Here.
* tests/core/521.test: New test case.
* tests/Makefile.am: Add it.
* NEWS: Mention it.
* THANKS: Add Jacopo Binchi.
2022-11-15 17:22:13 +01:00
Alexandre Duret-Lutz
b36cee06a1 adjust to Swig 4.1.0
* python/spot/__init__.py: Add flatnested versions of some static
methods.
* spot/twa/acc.hh: Hide && version of & and |, causing trouble
to swig.
* tests/python/_synthesis.ipynb, tests/python/synthesis.ipynb:
Upgrade expected type names.
* tests/python/ipnbdoctest.py: Adjust for difference between 4.0 and
4.1.
2022-11-10 17:08:30 +01:00
Alexandre Duret-Lutz
6dc740184c * tests/sanity/style.test: Fix recent grep warnings. 2022-11-07 09:37:40 +01:00