Compare commits

...
Sign in to create a new pull request.

612 commits

Author SHA1 Message Date
c63412ab94 translate_aa: fix sere copy
When adapting the code to handle transition-based acceptance, a bug was
introduced so that only accepting edges were copied to the result
automaton.

The self-loop labeled as false edge-case is here as prevention, I am not
sure it happens in practice.

* spot/twaalgos/translate_aa.cc: Here.
2025-10-17 17:40:11 +02:00
bb33c5120f translate_aa: fix construction for transition based acc
* spot/twaalgos/translate_aa.cc: Here.
2025-10-15 16:38:20 +02:00
8c6b1d90c6 translate_aa: expose lf-trans option
* spot/twaalgos/translate_aa.cc:
2025-10-15 16:38:20 +02:00
5156ac1286 translate_aa: Factorize sere translation choice
* spot/twaalgos/translate_aa.cc: Here.
2025-10-15 16:38:20 +02:00
be3597cb46 translate_aa: rename expansion option to lf
* spot/twaalgos/translate_aa.cc: Here.
2025-10-15 16:38:20 +02:00
59cfd6ed17 sonf: fix recursion of rewriting, was only called on operand
* spot/tl/sonf.cc: Here.
2025-10-15 16:38:20 +02:00
c5746ef5cf expansions: fix bogus false pairs in linear forms 2025-03-17 16:11:36 +01:00
3d3f311733 expansions: remove unused lambda capture 2025-03-17 16:11:36 +01:00
939942af30 expansions: fix sort behavior
The previous implementation was wrong and led to segfaults when sorting
large expansions
2025-03-17 16:11:36 +01:00
37b814c750 expansions: make signature canonical
Linear forms are now sorted and duplicates are removed
2025-03-17 16:11:36 +01:00
7fa1973613 expansions: fusion can produce false
let's discard the result if it's false
2025-03-17 16:11:36 +01:00
a32431c341 ltl2tgba_fm: setup switch between bdd and exp 2025-03-17 16:11:36 +01:00
dfa828739b translate_aa: setup translation choice 2025-03-17 16:11:36 +01:00
f687ef7bbb ltl2tgba_fm: switch for expansions 2025-03-17 16:11:36 +01:00
7cbf544d33 expansions: split 2025-03-17 16:11:36 +01:00
b15c0818c5 expansions: up variants 2025-03-17 16:11:36 +01:00
ed3d1ef4aa expansions: expose easy expansion in python 2025-03-17 16:11:36 +01:00
90ea02d42a expansions: store as vector of pairs 2025-03-17 16:11:36 +01:00
d760d2cb3b expansions: US order in pipeline configurable 2025-03-17 16:11:36 +01:00
e50be0692d expansions: UniquePrefixSeenOpt 2025-03-17 16:11:36 +01:00
29e0b22c2a expansions: fixes + BDD encode changes + printer 2025-03-17 16:11:36 +01:00
f09c1dd7f3 expansions: simple determinization 2025-03-17 16:11:36 +01:00
931d39e739 expansions: signature merge impl 2025-03-17 16:11:36 +01:00
bbbcdc331a expansions: optimize sigma star encoding 2025-03-17 16:11:36 +01:00
a4091ffc37 expansions: remove multiple old implementations 2025-03-17 16:11:36 +01:00
77d25d87a1 expansions: fix first_match case 2025-03-17 16:11:36 +01:00
382c57923c twaalgos: ltl2tgba_fm: allow disabling SCC trim 2025-03-17 16:11:36 +01:00
b5f11f7366 expansions: allow toggling merge_edges off 2025-03-17 16:11:36 +01:00
518c58fe52 expansions: latest implementation 2025-03-17 16:11:36 +01:00
003230ed19 expansions: multimap version 2025-03-17 16:11:36 +01:00
ce9a94f224 expansions: determinize only once per state 2025-03-17 16:11:36 +01:00
faaefa7424 expansions: fix bdd method 2025-03-17 16:11:36 +01:00
12a8d5382d expansions: add BDD method 2025-03-17 16:11:36 +01:00
9361116431 expansions: multiple implementations 2025-03-17 16:11:36 +01:00
3c6929829d expansions: split-off OrRat case 2025-03-17 16:11:36 +01:00
1240fec39b expansions: first_match deterministic 2025-03-17 16:11:36 +01:00
b9f461c025 expansions: draft 2025-03-17 16:11:36 +01:00
0fdd3c31f4 derive: add options to control distribution 2025-03-17 16:11:36 +01:00
89543e6a73 derive: option for some optimisations 2025-03-17 16:11:36 +01:00
e80c98751d sere_to_tgba: produce state-names 2025-03-17 16:11:36 +01:00
7b936819cc ltl2aa: handle edge case in UConcat
If SERE recognizes false, then combined with UConcat the property is
always true.
2025-03-17 16:11:36 +01:00
07a283498f alternation: fix bug introduced in oe_combiner
turns out sometimes we want to account for bddfalse
2025-03-17 16:11:36 +01:00
465b135f44 ltl2aa: implement EConcat 2025-03-17 16:11:36 +01:00
e5d7ba9e22 ltl2aa: comment 2025-03-17 16:11:36 +01:00
dec854ee07 ltl2aa: finalize UConcat 2025-03-17 16:11:36 +01:00
0957c11c94 ltl2aa: finish SERE aut merging with rhs outedges 2025-03-17 16:11:36 +01:00
eca0bd4590 ltl2aa: fix two bugs in SERE aut merge 2025-03-17 16:11:36 +01:00
93c50e1610 ltl2aa: place new state in var_to_state map 2025-03-17 16:11:36 +01:00
58965475fb ltl2aa: implem closure 2025-03-17 16:11:36 +01:00
4153ce0655 ltl2aa: share dict between sere and final aut 2025-03-17 16:11:36 +01:00
0c76e6dd21 ltl2aa: fix bdd manipulation in UConcat 2025-03-17 16:11:36 +01:00
8e8e44c5f9 ltl2aa: fix R & M operators handling 2025-03-17 16:11:36 +01:00
7b376a212c Add ltl2aa binary to tests/core 2025-03-17 16:11:36 +01:00
ffd60219b5 psl not working 2025-03-17 16:11:36 +01:00
43ed07d283 ltl2aa: factorize self-loop creation 2025-03-17 16:11:36 +01:00
e4bfebf36f twaalgos: add LTL to AA translation 2025-03-17 16:11:36 +01:00
6ebbb93024 twaalgos: filter accepting sinks in oe combiner 2025-03-17 16:11:36 +01:00
00ad02070b graph: filter accepting sinks in univ_dest_mapper 2025-03-17 16:11:36 +01:00
a046a4983c derive: use first 2025-03-17 16:11:36 +01:00
1925910f4a derive: handle AndNLM 2025-03-17 16:11:36 +01:00
eea35cdb31 derive: extract AndNLM rewriting 2025-03-17 16:11:36 +01:00
5b3b292b10 derive: no nullptr handling 2025-03-17 16:11:36 +01:00
2df8e200d8 derive: use from_finite 2025-03-17 16:11:36 +01:00
3b3ec16b20 twaalgos: add from_finite
* spot/twaalgos/remprop.cc, spot/twaalgos/remprop.hh: add a from_finite
  function to perform the opposite operation to to_finite
2025-03-17 16:11:36 +01:00
175012b919 twaalgos: extract internal sere2dfa 2025-03-17 16:11:36 +01:00
4a646e5aa0 tl: implement SERE derivation 2025-03-17 16:11:36 +01:00
2ae9da1bc6 twagraph: merge_edges supports finite automata
* spot/twa/twagraph.cc: don't remove false-labeled edges if the
  automaton uses state-based acceptance and the edge is a self loop
2025-03-17 16:11:36 +01:00
Alexandre Duret-Lutz
b6e782589e bin: handle '--parity=X --colored-parity' like '--colored-parity=X'
Fixes #602.

* bin/common_post.cc (-P, -p): Do not overwrite an existing parity
specification if none were given.
* tests/core/parity2.test: Test this.
2025-03-11 14:19:30 +01:00
Alexandre Duret-Lutz
1dd2ce3ae2 sanity: improve bin.test
* tests/sanity/bin.test: Add missing exit status on error,
and report manpage and binaries missing from spot.spec.in.
* spot.spec.in: Add ltlmix and ltlmix.1.
* bin/ltlsynt.cc: Fix formating for --algo.
2025-03-11 14:19:30 +01:00
c4e3509d18 * bin/.gitignore: Add ltlmix to gitignore 2025-03-07 10:34:56 +01:00
Alexandre Duret-Lutz
539d250587 * spot/twaalgos/gtec/gtec.cc: Work around spurious warning. 2025-02-26 12:08:46 +01:00
Alexandre Duret-Lutz
00456e5211 ltlfilt: add a --save-part-file option
* bin/ltlfilt.cc: Add support for --save-part-file.
* NEWS, doc/org/ltlfilt.org: Mention it.
* tests/core/ltlfilt.test: Test it.
2025-02-25 22:47:51 +01:00
Alexandre Duret-Lutz
b1b06ef7bd ltlsynt: remove superfluous output options
No point in having options such as --spin, --lbtt, --check, etc.
Also --dot was documented twice...

* bin/ltlsynt.cc (children): Remove aoutput_argp.
(options): Add explicit support for -d, -H, -q.
* bin/common_aoutput.cc, bin/common_aoutput.hh: Share the HOA help
text.
2025-02-25 22:47:10 +01:00
Alexandre Duret-Lutz
d0e404fec0 gnulib: fix argp --help formatting
This is a patch that was sent by Simon Reinhardt to gnulib and has
never been applied.  It fixes a several formatting issues in --help.
https://lists.gnu.org/archive/html/bug-gnulib/2016-02/msg00013.html

* lib/argp-fmtstream.c (__argp_fmtstream_update): Flush output as soon
as possible.
* lib/argp-fmtstream.h (struct argp_fmtstream): Member point_offs is
no longer needed.
* lib/argp-help.c (indent_to): Flush output to avoid a spurious
newline before an overlong word.
2025-02-25 17:26:36 +01:00
Alexandre Duret-Lutz
27fb175276 ltlsynt: fix a memory leak
* bin/ltlsynt.cc: Declare the realizability_simplifier as a unique_ptr
so that it gets deleted after use.
* NEWS: Mention the bug.
2025-02-25 17:26:18 +01:00
Alexandre Duret-Lutz
aba0e8dd24 * spot/twaalgos/mealy_machine.hh: Typo in documentation. 2025-02-25 17:26:10 +01:00
Alexandre Duret-Lutz
602aad013f aiger: never use state names for encoding
* spot/twaalgos/aiger.cc (mealy_machine_to_aig): Remove the code that
attempted to convert state names to integer, throwing exceptions on
failure.  That code was not exercised anywhere, but it caused failure
in the implementation of an LTLf->AIG pipeline in which LTLf formulas
that label states are preserved.
2025-02-25 17:26:01 +01:00
Alexandre Duret-Lutz
c5a0f323c8 Merge branch 'master' into next 2025-01-18 22:36:56 +01:00
Alexandre Duret-Lutz
5cbc28897e * configure.ac, NEWS: Bump version to 2.12.2.dev. 2025-01-18 16:20:57 +01:00
Alexandre Duret-Lutz
ec3e6750ee release Spot 2.12.2
* configure.ac, doc/org/setup.org: Bump version to 2.12.2.
* bin/common_setup.cc, debian/copyright: Bump copyright year to 2025.
* NEWS: Update.
2025-01-18 16:20:46 +01:00
Philipp Schlehuber-Caissier
480e5e999b Fix slight error in aiger
The negation of global equivalences for outputs
contained a slight error when the output corresponded
to a negated gate.

* spot/twaalgos/aiger.cc: Fix
* tests/core/ltlsynt.test: Test
2025-01-17 22:33:35 +01:00
Alexandre Duret-Lutz
465210cbc9 python: improve ACD's CSS
Some colleagues complained that the highlighting of edges and nodes
in the ACD display where not very readable, especially when sharing
screen during some video call.  This should improve it.

* python/spot/__init__.py (acd): Fill the contents of the nodes when
they are highlighted.  Add some glowing effect the the highlighted
edges.
* tests/python/zlktree.ipynb: Adjust.
2025-01-17 22:30:44 +01:00
Alexandre Duret-Lutz
e4a49cda02 work around a change in python 3.13
* python/spot/__init__.py: Unindent the docstring for
formula.__format__.  Because Python 3.13 strips the indentation but
previous version didn't, the following test case failed with Python
3.13.
* tests/python/formulas.ipynb: Adjust to unindented docstring.
2025-01-17 22:30:19 +01:00
Alexandre Duret-Lutz
c67332f825 Fix LaTeX rendering of strong next
Fix #597.

* spot/tl/print.cc: Fix rendering of X[!].
* doc/tl/spotltl.sty: Add a \StrongX definition.
* tests/core/latex.test: Add a test case.
* NEWS: Mention the issue.
2025-01-17 22:29:59 +01:00
Alexandre Duret-Lutz
6e6219af54 correct to_finite
This fixes issue #596.

* spot/twaalgos/remprop.cc: Rewrite main loop.
* tests/core/ltlf.test: Add test case.
* tests/python/game.py: Remove a test that appears
to make incorrect assumptions about to_finite.
* NEWS: Mention the bug.
2025-01-17 22:29:55 +01:00
Alexandre Duret-Lutz
cd5ac041f2 hierarchy: improve error message
* spot/tl/hierarchy.cc (mp_class): Fix type of o so that it is
displayed as an character in error messages.
2025-01-17 22:29:53 +01:00
Philipp Schlehuber-Caissier
ddbe0e32b0 Fix slight error in aiger
The negation of global equivalences for outputs
contained a slight error when the output corresponded
to a negated gate.

* spot/twaalgos/aiger.cc: Fix
* tests/core/ltlsynt.test: Test
2025-01-09 08:56:43 +01:00
Alexandre Duret-Lutz
461dc842e9 work around a change in python 3.13
* python/spot/__init__.py: Unindent the docstring for
formula.__format__.  Because Python 3.13 strips the indentation but
previous version didn't, the following test case failed with Python
3.13.
* tests/python/formulas.ipynb: Adjust to unindented docstring.
2025-01-01 21:55:23 +01:00
Alexandre Duret-Lutz
c971ce57a6 Fix LaTeX rendering of strong next
Fix #597.

* spot/tl/print.cc: Fix rendering of X[!].
* doc/tl/spotltl.sty: Add a \StrongX definition.
* tests/core/latex.test: Add a test case.
* NEWS: Mention the issue.
2025-01-01 21:55:15 +01:00
Alexandre Duret-Lutz
82401b3254 correct to_finite
This fixes issue #596.

* spot/twaalgos/remprop.cc: Rewrite main loop.
* tests/core/ltlf.test: Add test case.
* tests/python/game.py: Remove a test that appears
to make incorrect assumptions about to_finite.
* NEWS: Mention the bug.
2025-01-01 21:55:12 +01:00
Alexandre Duret-Lutz
4a33f0fe65 hierarchy: improve error message
* spot/tl/hierarchy.cc (mp_class): Fix type of o so that it is
displayed as an character in error messages.
2024-10-30 12:07:55 +01:00
Alexandre Duret-Lutz
368eb6e0cd Merge branch 'master' into next 2024-09-23 13:42:31 +02:00
Alexandre Duret-Lutz
b05c90cd87 bump version to 2.12.1.dev
* NEWS, configure.ac: Here.
2024-09-23 13:33:08 +02:00
Alexandre Duret-Lutz
b63f16060a release Spot 2.12.1
* NEWS, configure.ac, doc/org/setup.org: Update.
2024-09-23 12:04:28 +02:00
Alexandre Duret-Lutz
c92418b51c * .gitlab-ci.yml (publish-stable): Add scp for LRE's dload host. 2024-09-23 11:56:34 +02:00
Alexandre Duret-Lutz
376755dbd4 game: avoid a spurious g++14 warning
* spot/twaalgos/game.cc, spot/twaalgos/game.hh (get_state_winners):
Declare a non-const version as well to avoid a "possibly dangling
reference" error in code show by tut40.org.
2024-09-23 11:55:22 +02:00
Alexandre Duret-Lutz
941475fbdb fix spurious g++-14 warning
* spot/twaalgos/mealy_machine.cc (mm_sat_prob_t<true>::get_sol): Here.
2024-09-23 11:55:02 +02:00
Alexandre Duret-Lutz
1a36ea6ce4 ltlsynt: fix usage for --dot's argument
* bin/ltlsynt.cc (dispatch_print_hoa): Pass the right argument to
print_dot.
* tests/core/ltlsynt.test: Test it.
* NEWS: Mention the bug.
2024-09-23 11:54:57 +02:00
Alexandre Duret-Lutz
514209e80f * configure.ac: Typo. 2024-09-23 11:54:51 +02:00
Alexandre Duret-Lutz
f5ab5678b5 python: improve support of spot-extra, and recent swig
I could not run "make check" in a copy of seminator 2.0 regenerated
with swig 4.0, because of changes in the way Swig imports its shared
libraries.

* python/spot/__init__.py: If sys.path contains "/spot-extra"
directory, add it to spot.__path__ as well.  This helps situations
where a plugin use libtool and the development tree has the shared
libraries in .../spot-extra/.libs/
2024-09-23 11:54:40 +02:00
Alexandre Duret-Lutz
cc0f6f1e0d game: fix solving "parity min" games with multi-colored edges
* spot/twaalgos/game.cc: If the original acceptance is "parity min",
use min_set(), not max_set(), to read edge priorities.
* tests/python/game.py: Add a test case.
* NEWS: Mention the bug.
2024-09-23 11:54:22 +02:00
Alexandre Duret-Lutz
97832af321 randltl: fix generation without unary operators
* spot/tl/randomltl.hh (has_unary_ops): New method.
* spot/tl/randomltl.cc: Avoid creating subformulas of even size
when we do not have unary operators.
* tests/core/randpsl.test: Test it.
* NEWS: Mention it.
2024-09-23 11:53:41 +02:00
Alexandre Duret-Lutz
bdc63db9f0 ltlgrind: improve error message when formulas are missing
The error message, inherited from ltl2tgba, used to say "No formula to
translate", but "translate" isn't appropriate here.

* bin/common_finput.cc, bin/common_finput.hh (check_no_formula): Allow
"translate" to be changed.
* bin/ltlgrind.cc: Change it.
* tests/core/ltlgrind.test: Test it.
2024-09-23 11:52:43 +02:00
Alexandre Duret-Lutz
783efa2fe8 * doc/tl/tl.tex: Some typos. 2024-09-23 11:52:15 +02:00
Alexandre Duret-Lutz
e48506f548 improve some comments
* spot/twaalgos/complement.hh, spot/twaalgos/complement.cc: Here.
2024-09-23 11:51:59 +02:00
Alexandre Duret-Lutz
e13deeb143 * .gitlab-ci.yml (publish-stable): Add scp for LRE's dload host. 2024-09-23 11:49:26 +02:00
Alexandre Duret-Lutz
b9cb4022cf gen: rename pps-arbiter's APs
* bin/genltl.cc, spot/gen/formulas.cc: Adjust the name of the AP
produced by pps-arbiter.
* NEWS: Mention the change.
2024-09-19 18:45:44 +02:00
Alexandre Duret-Lutz
40a45eff22 * doc/org/ltlmix.org: Typos. 2024-09-19 18:45:44 +02:00
Alexandre Duret-Lutz
7b0e15a7fb implement maximum cardinality search
* spot/twaalgos/mcs.cc, spot/twaalgos/mcs.hh: New files.
* spot/twaalgos/Makefile.am: Add them.
* python/spot/impl.i: Include mcs.hh.
* bin/autfilt.cc: Add --mcs option.
* NEWS: Mention it.
* doc/spot.bib: Add reference.
* tests/core/mcs.test: New file.
* tests/Makefile.am: Add it.
2024-09-19 18:45:34 +02:00
Alexandre Duret-Lutz
77a17881a3 defrag_states: allow a permutation of state numbers
* spot/misc/permute.hh: New file.
* spot/misc/Makefile.am: Add it.
* spot/graph/graph.hh, spot/twa/twagraph.cc,
spot/twaalgos/randomize.cc: Use the new permute_vector() function.
* spot/twa/twagraph.hh: Update documentation.
* NEWS: Update.
2024-09-18 13:59:51 +02:00
Alexandre Duret-Lutz
4ccdcb4a5b tests: rewrite the syntimpl test
* tests/core/syntimpl.cc: Rewrite to test multiple formulas at once,
and test them with three different implication checks.
* tests/core/syntimpl.test: Adjust the test to execute syntimpl only
once.
2024-09-18 13:59:51 +02:00
Alexandre Duret-Lutz
99a622059c synthesis: fix handling of deadstates
* spot/twaalgos/synthesis.cc: Remove a debuging print
from the semisym code, and add an additional case
in the fullysym code.
* tests/core/ltlsynt.test: Add a some test case,
and remove some bashism.
2024-09-12 14:00:08 +02:00
Alexandre Duret-Lutz
90fb7b1cd9 * doc/org/ltlmix.org: Fix example. 2024-09-11 11:38:12 +02:00
Alexandre Duret-Lutz
1724d2b14c ltlsynt: -q should also hide status and AIG output
* bin/ltlsynt.cc: Honnor -q properly.
* doc/org/ltlsynt.org, tests/core/ltlsynt.test: Adjust.
* NEWS: Mention this bug.
2024-09-10 12:29:23 +02:00
Alexandre Duret-Lutz
950b205b63 ltlsynt: have --csv exclude the formula column by default
* bin/ltlsynt.cc: Add the --csv-with-formula option.
* doc/org/ltlsynt.org, tests/core/ltlsynt2.test, NEWS: Adjust.
2024-09-10 12:29:23 +02:00
Alexandre Duret-Lutz
5488cb75c6 ltlsynt: overhaul CSV output
Previous output was not very usable in presence of decomposed
specifications.  We now keep track of the number of parts, and also
prefix the columns names with "max_" or "sum_" to indicate how their
statistics are updated in presence of multiple part.  Other missing
statistics, like the size of the translated automaton, or maximal
number of colors seen in a game, have been added.

* spot/twaalgos/synthesis.hh (bench_var): Rename, augment, and
document each statistsic.
* spot/twaalgos/mealy_machine.cc, spot/twaalgos/synthesis.cc,
bin/ltlsynt.cc: Adjust to the new naming scheme.
* doc/org/ltlsynt.org: Show a CSV file, and document its columns.
* tests/core/ltlsynt-pgame.test, tests/core/ltlsynt2.test,
tests/core/ltlsynt.test: Adjust test cases.
* NEWS: Mention the backward incompatible change.
2024-09-10 12:29:14 +02:00
Alexandre Duret-Lutz
b729aa3f30 ltlsynt: fix a few issues with --csv
Some columns were superfluous, other had inconsistent names, and some
times where not tracked.

* spot/twaalgos/synthesis.cc: Improve tracking of times and verbose
messages.
* bin/ltlsynt.cc (print_csv): Adjust CSV columns.
* tests/core/ltlsynt.test, tests/core/ltlsynt2.test,
tests/core/ltlsynt-pgame.test: Adjust expected CSV and verbose
messages.
* doc/org/ltlsynt.org: Give some example.
2024-09-05 08:41:30 +02:00
Alexandre Duret-Lutz
a22a05b8ec ltlsynt: implement --csv-without-formula
* bin/ltlsynt.cc: Implement that new option.
* tests/core/ltlsynt2.test: Test it.
* NEWS: Mention the change.
2024-09-05 08:41:30 +02:00
Alexandre Duret-Lutz
6e5592fe6a ltlsynt: save source filename with --csv
* bin/ltlsynt.cc (print_csv): Make filename mandatory, and add a
"was_game" argument.
(process_formula, process_aut_file): Adjust calls.
* tests/core/ltlsynt2.test: Adjust test cases.
2024-09-05 00:18:12 +02:00
Alexandre Duret-Lutz
45cb9caa0e game: avoid a spurious g++14 warning
* spot/twaalgos/game.cc, spot/twaalgos/game.hh (get_state_winners):
Declare a non-const version as well to avoid a "possibly dangling
reference" error in code show by tut40.org.
2024-09-05 00:18:04 +02:00
Alexandre Duret-Lutz
e6ebbdf65f ltlfilt, ltlsynt, ltlmix: add a --part-file option
* bin/common_ioap.cc, bin/common_ioap.hh (read_part_file): New
function.
* bin/ltlfilt.cc, bin/ltlmix.cc, bin/ltlsynt.cc: Use it.
* doc/org/ltlfilt.org, doc/org/ltlmix.org, doc/org/ltlsynt.org:
Mention that new option, and improve the links to its description
in ltlsynt.org.
* NEWS: Mention the new option.
* tests/core/ltlfilt.test, tests/core/ltlmix.test,
tests/core/ltlsynt.test: Adjust test cases.
2024-09-04 16:09:31 +02:00
Alexandre Duret-Lutz
388d005635 fix spurious g++-14 warning
* spot/twaalgos/mealy_machine.cc (mm_sat_prob_t<true>::get_sol): Here.
2024-09-02 17:28:28 +02:00
Alexandre Duret-Lutz
a8a0a1973e ltlsynt: fix usage for --dot's argument
* bin/ltlsynt.cc (dispatch_print_hoa): Pass the right argument to
print_dot.
* tests/core/ltlsynt.test: Test it.
* NEWS: Mention the bug.
2024-09-02 17:26:42 +02:00
Alexandre Duret-Lutz
8eec295e23 * configure.ac: Typo. 2024-09-02 13:54:36 +02:00
Alexandre Duret-Lutz
c9911962d4 python: improve support of spot-extra, and recent swig
I could not run "make check" in a copy of seminator 2.0 regenerated
with swig 4.0, because of changes in the way Swig imports its shared
libraries.

* python/spot/__init__.py: If sys.path contains "/spot-extra"
directory, add it to spot.__path__ as well.  This helps situations
where a plugin use libtool and the development tree has the shared
libraries in .../spot-extra/.libs/
2024-09-02 13:50:36 +02:00
Alexandre Duret-Lutz
89a06772b8 game: fix solving "parity min" games with multi-colored edges
* spot/twaalgos/game.cc: If the original acceptance is "parity min",
use min_set(), not max_set(), to read edge priorities.
* tests/python/game.py: Add a test case.
* NEWS: Mention the bug.
2024-08-30 22:18:20 +02:00
Alexandre Duret-Lutz
c5d991e55c autfilt: add a --track-formula option
Fixes #591.

* spot/twaalgos/matchstates.cc,
spot/twaalgos/matchstates.hh (match_states_decorate): New function.
* bin/autfilt.cc: Add a --track-formula option.
* tests/core/trackf.test: New file.
* tests/Makefile.am: Test it.
* NEWS: Mention it.
2024-08-30 22:18:20 +02:00
Alexandre Duret-Lutz
3d3e87948c twaalgos: add a match_states variant with a formula argument
This is related to issue #591, reported by Blake C. Rawlings.

* spot/twaalgos/ltl2tgba_fm.cc, spot/twaalgos/ltl2tgba_fm.hh
(ltl_to_tgba_fm): Add option to keep LTL labels.
* spot/twaalgos/matchstates.cc, spot/twaalgos/matchstates.hh
(match_states): Add variant with a formula as second argument.
* tests/python/matchstates.py: Test it.
* NEWS: Mention it.
* THANKS: Add reporter.
2024-08-30 22:18:09 +02:00
Alexandre Duret-Lutz
5f1d00b858 twaalgos: introduce match_states(a,b)
This is a useful part for issue #591.

* spot/twaalgos/matchstates.cc, spot/twaalgos/matchstates.hh: New
files.
* spot/twaalgos/Makefile.am: Add them.
* python/spot/impl.i: Add python bindings.
* tests/python/matchstates.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention this new function.
2024-08-30 22:17:51 +02:00
Alexandre Duret-Lutz
b549e8e8c1 * doc/org/ltlmix.org: Fix several typos. 2024-08-27 00:28:35 +02:00
Alexandre Duret-Lutz
3e90265ce7 org: add example of ltlmix used on synthesis specifications
* doc/org/ltlmix.org: Here.
2024-08-26 21:57:20 +02:00
Alexandre Duret-Lutz
c6f4b18655 genltl: add --lily-patterns
* spot/gen/formulas.cc, spot/gen/formulas.hh, bin/genltl.cc: Implement
support for --lily-pattern.
* doc/spot.bib, bin/man/genltl.x: Add references.
* NEWS: Mention it.
* tests/core/ltlsynt.test: Use these formulas.
* tests/core/genltl.test: Adjust.
2024-08-26 21:56:59 +02:00
Alexandre Duret-Lutz
844fb887d9 ltlmix: add support for the I/O variants
* bin/ltlmix.cc: Add options --ins, --outs, as well as the
two-argument form of -A/-P.
* bin/common_ioap.hh, bin/common_ioap.cc (is_output): New function.
* spot/tl/apcollect.cc, spot/tl/apcollect.hh (create_atomic_prop_set):
Allow the prefix string to be changed.
* spot/tl/randomltl.cc, spot/tl/randomltl.hh: Add support for an I/O
version with two set of atomic proposition, and a predicate to decide
if the original proposition was input or output.
* tests/core/ltlmix.test: More tests.
2024-08-26 11:42:09 +02:00
Alexandre Duret-Lutz
6fa42c90b8 ltlfilt: add support for --relabel=io, --ins, and --outs
* bin/common_ioap.cc, bin/common_ioap.hh (relabel_io): New function.
* bin/ltlfilt.cc: Implement the above options.
* doc/org/ltlfilt.org, NEWS: Illustrate them.
* tests/core/ltlfilt.test: Add some quick tests.
2024-08-25 18:16:50 +02:00
Alexandre Duret-Lutz
bea1713f4e ltlsynt: extract In/Out AP processing in separate file
We'd like to reuse the --ins/--outs matching in ltlfilt
as well, so let's put that code in a common file.

* bin/common_ioap.cc, bin/common_ioap.hh: New files.
* bin/ltlsynt.cc: Extracted from here.
* bin/Makefile.am: Add them.
2024-08-24 22:15:15 +02:00
Alexandre Duret-Lutz
2390a89986 ltlmix: learn option -R for random conjuncts
* bin/ltlmix.cc: Implement this option.
* doc/org/ltlmix.org: Illustrate it.
* tests/core/ltlmix.test: Add a test.
2024-08-23 21:54:52 +02:00
Alexandre Duret-Lutz
c8b8ac60be bin: new ltlmix tool
Fixes #400.

* spot/tl/randomltl.cc, spot/tl/randomltl.hh: Adjust to accept
a set of formula to replace the atomic propositions.
* bin/ltlmix.cc: New file.
* bin/Makefile.am: Add it.
* bin/man/ltlmix.x: New file.
* bin/man/Makefile.am: Add it.
* doc/org/ltlmix.org: New file.
* doc/Makefile.am: Add it.
* bin/man/genltl.x, bin/man/randltl.x, bin/man/spot.x, bin/spot.cc,
doc/org/arch.tex, doc/org/concepts.org, doc/org/tools.org, NEWS: Mention
ltlmix.
* tests/core/ltlmix.test: New file.
* tests/Makefile.am: Add it.
2024-08-23 21:46:05 +02:00
Alexandre Duret-Lutz
baf2778c9a randltl: fix generation without unary operators
* spot/tl/randomltl.hh (has_unary_ops): New method.
* spot/tl/randomltl.cc: Avoid creating subformulas of even size
when we do not have unary operators.
* tests/core/randpsl.test: Test it.
* NEWS: Mention it.
2024-08-23 21:45:47 +02:00
Alexandre Duret-Lutz
436e5a2d7f ltlgrind: improve error message when formulas are missing
The error message, inherited from ltl2tgba, used to say "No formula to
translate", but "translate" isn't appropriate here.

* bin/common_finput.cc, bin/common_finput.hh (check_no_formula): Allow
"translate" to be changed.
* bin/ltlgrind.cc: Change it.
* tests/core/ltlgrind.test: Test it.
2024-08-23 21:45:47 +02:00
Alexandre Duret-Lutz
3693bbab08 synthesis: rewrite a C++20 construct into C++17
It is illegal to capture the element of a structured binding
in C++17, GCC 15 will complain about it.

* spot/twaalgos/synthesis.cc: Move the illegal structured binding
inside the lambda.
2024-08-20 16:52:27 +02:00
Alexandre Duret-Lutz
a0a6ec6794 * doc/tl/tl.tex: Some typos. 2024-08-20 10:35:31 +02:00
Alexandre Duret-Lutz
44efc96595 formula: add a missing trivial rewriting in SERE
We should have [*0]|f ≡ f when f is a SERE that already accept the
empty word.  Fixes issue #454.

* spot/tl/formula.cc: Implement the rewriting.
* tests/core/reduccmp.test: Add a test case.
* doc/tl/tl.tex, NEWS: Document it.
2024-08-20 10:35:31 +02:00
Alexandre Duret-Lutz
bcdfe44c44 ltlfilt: add support for --to-delta2
* bin/ltlfilt.cc: Implement this option.
* tests/core/delta2.test: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention it.
2024-08-20 10:35:31 +02:00
Alexandre Duret-Lutz
41abe3f831 tl: implement to_delta2()
* spot/tl/delta2.cc, spot/tl/delta2.hh: New files.
* spot/tl/Makefile.am: Add them.
* python/spot/impl.i: Include delta2.hh.
* tests/python/delta2.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the change.
2024-08-20 10:35:31 +02:00
Alexandre Duret-Lutz
5bc4d12bba ltlfilt: support --pi1 --sigma1 --delta1 --pi2 --sigma2
* bin/ltlfilt.cc: Implement those option.
* tests/core/hierarchy.test: Add a quick test.
* NEWS: Mention it.
2024-08-20 10:35:30 +02:00
Alexandre Duret-Lutz
7901a37747 formula: track Δ₁, Σ₂, Π₂, and Δ₂ membership
* spot/tl/formula.hh, spot/tl/formula.cc: Update the properties
and track them.
* tests/core/kind.test: Augment the test case.
* doc/tl/tl.tex, doc/spot.bib, NEWS: Document these new classes.
2024-08-20 10:35:30 +02:00
Alexandre Duret-Lutz
0c52c49079 doc: fix documentation of P and R classes
* doc/tl/tl.tex: Remove four incorrect production rules in the grammar
for φ_P and φ_R, and fix two.
2024-07-19 17:07:39 +02:00
Alexandre Duret-Lutz
6a7ef4db3f postprocess: call restrict_dead_end_edges_here()
Related to issue #587.

* spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh: Add
support for option "rde".
* bin/spot-x.cc, NEWS: Mention it.
* tests/core/deadends.test, tests/core/ltl2tgba2.test,
tests/python/atva16-fig2a.ipynb, tests/python/deadends.py: Adjust test
cases to reflect the improvement.
* tests/core/ltlsynt.test: Also adjust this test case, which is the
only one worsened.  Some extra gates are generated when translating
GFa<->GFb with --algo=ds or --algo=sd.  Issue #588 would be one way to
fix that.
2024-07-19 17:07:39 +02:00
Alexandre Duret-Lutz
31511e042a twaalgos: implement restrict_dead_end_edges_here()
Discussed in issue #587.

* spot/twaalgos/deadends.cc, spot/twaalgos/deadends.hh: New files.
* spot/twaalgos/Makefile.am, python/spot/impl.i: Add them.
* tests/core/deadends.test, tests/python/deadends.py: New files.
* tests/Makefile.am: Add them.
* spot/twa/acc.cc, spot/twa/acc.hh (keep_one_inf_per_branch): New
method.
* bin/autfilt.cc: Learn option --restrict-dead-end-edges.
* NEWS: Mention it.
2024-07-19 17:07:39 +02:00
Alexandre Duret-Lutz
f03e32619a improve some comments
* spot/twaalgos/complement.hh, spot/twaalgos/complement.cc: Here.
2024-07-19 17:07:38 +02:00
Philipp Schlehuber
5ddac258e1 Introduce new ways to split an automaton
The explicit way of splitting suffers if there are
too many input APs, two new ways of splitting
are introduced as well as a heuristic to chose
between them.

* NEWS: update
* spot/twaalgos/synthesis.cc,
spot/twaalgos/synthesis.hh: New fonctions
* bin/ltlsynt.cc: Add corresponding option
* tests/core/gamehoa.test,
tests/core/ltlsynt.test,
tests/python/_partitioned_relabel.ipynb,
tests/python/_synthesis.ipynb,
tests/python/game.py,
tests/python/split.py,
tests/python/synthesis.py: Adjusting and adding test
2024-07-18 10:13:14 +02:00
Florian Renkin
2274308cad reduce_mealy_here: do not reduce when size is 1
* spot/twaalgos/mealy_machine.cc: here
2024-07-18 10:12:29 +02:00
Alexandre Duret-Lutz
c7c18db6db work around GCC bug 108860
GCC 12/13/14 can emit spurious warnings for something
as innocent as vec.insert(vec.begin(), 12)...
Reported by Antoine Martin and Quentin Rataud.

* m4/gccwarn.m4: Test the above code and disable GCC's
-Wnull-dereference warning if necessary.
2024-06-27 15:39:15 +02:00
Alexandre Duret-Lutz
fdb09f787e * spot.spec.in: Update URL and description. 2024-05-20 16:15:57 +02:00
Alexandre Duret-Lutz
6420bde5fd debian: drop ipython3-notebook dependency
* debian/control: Remove the ipython3-notebook alternate
build-depends, as this package was removed from Debian in 2016.  Add
gdb ad build-depends, in attempt to fix some OSB builds.
2024-05-20 16:11:18 +02:00
Alexandre Duret-Lutz
799db05111 * doc/org/tut25.org: Fix typos in the example. 2024-05-16 22:40:52 +02:00
Alexandre Duret-Lutz
c44e03c791 * NEWS, configure.ac: Bump version to 2.12.0.dev. 2024-05-16 13:15:55 +02:00
Alexandre Duret-Lutz
532b57d0df Release spot 2.12
* NEWS, configure.ac, doc/org/setup.org: Bump version to 2.12.
2024-05-16 13:15:19 +02:00
Alexandre Duret-Lutz
913e807d66 stats: fix rounding issues
Fixes #582.

* spot/twaalgos/stats.cc: Add 0.5 to the result of bdd_satcountset()
before truncating it.
* NEWS: Mention the bug.
2024-05-16 13:14:03 +02:00
Alexandre Duret-Lutz
2bd2abd4c9 pdegen & toparity: minor refactor
* spot/twaalgos/degen.hh (is_partially_degeneralizable): Pass the
forbid vector by reference, and document it.  I hope that not passing
forbid by copy will get rid of a spurious "potential nullptr" warning
by gcc on Arch Linux.
* spot/twaalgos/degen.cc: Adjust, and refactor the code a bit.
* spot/twaalgos/toparity.cc: Likewise.
2024-05-14 10:41:18 +02:00
Alexandre Duret-Lutz
ed91f59bbd tl: new PSL trivial simplifications
Always rewrite {[*]}[]->0 as 0, and {[*]}<>->1 = 1.  Fixes #572.

* spot/tl/formula.cc: Implement them.
* doc/tl/tl.tex, NEWS: Document them.
* tests/core/equals.test: Test those.
2024-05-13 22:15:15 +02:00
Alexandre Duret-Lutz
a826a4ae6f * tests/python/formulas.ipynb: Improve SONF example (fixes #578). 2024-05-06 21:01:37 +02:00
Alexandre Duret-Lutz
c5c3e905ae python: workaround different help() output in Python 3.12
Python 3.12 introduced some subtle changes in the way doc strings are
displayed by help().  This was causing spurious errors in the
following test.

* tests/python/formulas.ipynb: Use print(x.__doc__) instead of
help(x).
2024-05-03 16:32:16 +02:00
Alexandre Duret-Lutz
e6362b785b python: use raw strings when appropriate
We had some incorrectly escaped strings that are now causing
SyntaxWarnings with Python 3.12

* bin/options.py, python/spot/aux_.py, python/spot/ltsmin.i,
python/spot/__init__.py: Here.
* NEWS: Mention the fix.
2024-05-03 10:47:43 +02:00
Alexandre Duret-Lutz
dbe31c72c8 Upgrade detection of Python include path for Python 3.12
Fixes #577.

* m4/pypath.m4: Python 3.12 removed distutils, so use sysconfig
instead.
* NEWS: Mention the bug.
2024-05-02 21:37:50 +02:00
Alexandre Duret-Lutz
be102e09d4 implement BA acceptance set reduction and enlargement
For issue #570.

* spot/twaalgos/cleanacc.hh,
spot/twaalgos/cleanacc.cc (reduce_buchi_acceptance_set_here,
enlarge_buchi_acceptance_set_here): New functions.
* bin/autfilt.cc: Add options --reduce-acceptance-set and
--enlarge-acceptance-set.
* tests/core/basetred.test: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention it.
2024-04-25 23:27:30 +02:00
Alexandre Duret-Lutz
ab7f4f51c4 simulation: fix determinism check
Commit bda40a5f introduced a subtle bug where nm_minato was being
increased in more cases causing some non-deterministic automata to be
incorrectly tagged as deterministic automata.

Fixes issue #575, reported by Dávid Smolka.

* spot/twaalgos/simulation.cc (create_edges): Do not increment
nm_minato when dest is bddfalse.
* tests/core/568.test: Add Dávid's first test-case.
* tests/python/forq_contains.py: Add Dávid's second test-case.
2024-04-24 23:59:07 +02:00
Alexandre Duret-Lutz
ffddbd84d0 * NEWS: Fix some typos. 2024-04-19 10:20:49 +02:00
Alexandre Duret-Lutz
c5490428be * tests/sanity/style.test: Fix spurious failure. 2024-04-19 09:43:50 +02:00
Florian Renkin
2ffdd84942 Rename split_independant_formulas
split_independant_formulas is now split_independent_formulas

* spot/twaalgos/synthesis.hh, spot/twaalgos/synthesis.cc: change name.
* bin/ltlsynt.cc: update call
* NEWS: Mention it.
2024-04-16 17:02:52 +02:00
Florian Renkin
f57782686d Rename minimize_obligation_garanteed_to_work
minimize_obligation_garanteed_to_work is now
minimize_obligation_guaranteed_to_work

* spot/twaalgos/minimize.hh, spot/twaalgos/minimize.cc: change name.
* spot/twaalgos/postproc.cc: update call
* NEWS: Mention it.
2024-04-16 17:02:52 +02:00
Florian Renkin
96ff2225e3 Fix typos in doc, comments and messages
* bin/README, bin/common_conv.hh, bin/common_trans.cc,
    bin/ltlsynt.cc, bin/spot-x.cc, spot/gen/automata.hh,
    spot/graph/graph.hh, spot/ltsmin/ltsmin.hh,
    spot/ltsmin/spins_interface.hh, spot/ltsmin/spins_kripke.hh,
    spot/mc/bloemen.hh, spot/mc/bloemen_ec.hh, spot/mc/cndfs.hh,
    spot/mc/deadlock.hh, spot/mc/intersect.hh, spot/mc/lpar13.hh,
    spot/mc/mc_instanciator.hh, spot/misc/bareword.cc,
    spot/misc/fixpool.hh, spot/misc/formater.hh, spot/misc/minato.hh,
    spot/misc/satsolver.hh, spot/misc/timer.hh,
    spot/parseaut/public.hh, spot/priv/partitioned_relabel.cc,
    spot/priv/satcommon.hh, spot/ta/ta.hh, spot/ta/taexplicit.cc,
    spot/ta/taproduct.hh, spot/ta/tgta.hh, spot/taalgos/reachiter.hh,
    spot/taalgos/tgba2ta.hh, spot/tl/apcollect.cc,
    spot/tl/apcollect.hh, spot/tl/formula.cc, spot/tl/parse.hh,
    spot/tl/randomltl.hh, spot/tl/relabel.hh, spot/tl/simplify.cc,
    spot/twa/acc.hh, spot/twa/bddprint.hh, spot/twa/formula2bdd.cc,
    spot/twa/twa.hh, spot/twa/twagraph.cc, spot/twa/twagraph.hh,
    spot/twaalgos/aiger.cc, spot/twaalgos/aiger.hh,
    spot/twaalgos/alternation.hh,  spot/twaalgos/cleanacc.cc,
    spot/twaalgos/cobuchi.cc, spot/twaalgos/contains.cc,
    spot/twaalgos/couvreurnew.cc, spot/twaalgos/cycles.hh,
    spot/twaalgos/degen.cc, spot/twaalgos/degen.hh,
    spot/twaalgos/dot.hh, spot/twaalgos/dtbasat.cc,
    spot/twaalgos/dtwasat.cc, spot/twaalgos/dtwasat.hh,
    spot/twaalgos/dualize.cc, spot/twaalgos/emptiness.hh,
    spot/twaalgos/emptiness_stats.hh, spot/twaalgos/game.cc,
    spot/twaalgos/genem.hh, spot/twaalgos/hoa.hh,
    spot/twaalgos/langmap.hh, spot/twaalgos/ltl2tgba_fm.hh,
    spot/twaalgos/magic.cc, spot/twaalgos/magic.hh,
    spot/twaalgos/mask.hh, spot/twaalgos/mealy_machine.cc,
    spot/twaalgos/mealy_machine.hh,
    spot/twaalgos/minimize.hh, spot/twaalgos/parity.cc,
    spot/twaalgos/parity.hh, spot/twaalgos/postproc.cc,
    spot/twaalgos/product.hh, spot/twaalgos/reachiter.hh,
    spot/twaalgos/relabel.cc, spot/twaalgos/remfin.cc,
    spot/twaalgos/remfin.hh, spot/twaalgos/sccfilter.cc,
    spot/twaalgos/sccinfo.hh, spot/twaalgos/se05.cc,
    spot/twaalgos/se05.hh, spot/twaalgos/simulation.hh,
    spot/twaalgos/split.hh, spot/twaalgos/stats.hh,
    spot/twaalgos/synthesis.cc, spot/twaalgos/synthesis.hh,
    spot/twaalgos/tau03.hh, spot/twaalgos/tau03opt.hh,
    spot/twaalgos/toparity.hh, spot/twaalgos/totgba.hh,
    spot/twaalgos/translate.hh, spot/twaalgos/word.cc,
    spot/twaalgos/word.hh, spot/twaalgos/zlktree.cc,
    spot/twaalgos/zlktree.hh, spot/twacube/cube.hh,
    spot/twacube/twacube.hh, tests/core/cube.cc,
    tests/core/ltlsynt.test, tests/core/parity.cc,
    tests/core/safra.cc, tests/core/twagraph.cc: here
2024-04-16 17:01:31 +02:00
Alexandre Duret-Lutz
952e502480 * .gitlab-ci.yml: Use CI_JOB_ID instead of CI_PIPELINE_ID. 2024-04-10 21:58:47 +02:00
Alexandre Duret-Lutz
1a5b4f00f5 * spot/twaalgos/split.hh: Typo in comment. 2024-04-10 21:58:32 +02:00
Alexandre Duret-Lutz
9230614f8d ltlsynt implement polarity and gequiv after decomposition too
* bin/ltlsynt.cc: Also simplify subformulas using polarity and global
equivalence.  Add support for --polarity=before-decompose and
--global-equiv=before-decompose to restablish the previous behavior.
* spot/tl/apcollect.hh,
spot/tl/apcollect.cc (realizability_simplifier::merge_mapping): New
method.
* tests/core/ltlsynt.test: Add new test cases.
2024-04-05 12:42:43 +02:00
Alexandre Duret-Lutz
848d1a3901 man: fix several issues
The \f(CW macro to switch to "constant-width" does not seem to
honored when converting to html, and I've found some patch to
groff removing its use from their own man page.
https://lists.gnu.org/archive/html/groff-commit/2020-07/msg00015.html
Lets use \fC instead, as it seems to produce some <tt> in HTML.

Two manpages had URLs pointing to spot.lrde.epita.fr instead of
spot.lre.epita.fr.

Finally, spot-x.x had an incorrectly closed .EX block, that completly
broke the HTML conversion.

* bin/man/autcross.x, bin/man/ltl2tgba.x, bin/man/ltlcross.x,
bin/man/spot-x.x, bin/man/spot.x: Fix the aforementioned issues.
2024-04-03 23:05:12 +02:00
Alexandre Duret-Lutz
a17d8a0501 help2man: work around some utf8 issues
help2man used characters in the range 0x80,...,0x84 to mark special
sections/characters during its processing, but those bytes where also
occurring in other utf-8 characters breaking the output.  For instance
the character '₁' ( a subscript 1), is encoded as "0xE2 0x82 0x81" in
utf-8.

* tools/help2man: Tell perl that input and output should be assumed to
be utf-8.  Also use "private-use codepoints" for those special
characters to avoid any future conflict.
2024-04-03 17:47:18 +02:00
pierreganty
27a0137208 Small fixes in the man pages
* bin/man/dstar2tgba.x, bin/man/spot-x.x: Typos.
2024-04-03 16:05:17 +02:00
Alexandre Duret-Lutz
79b7cfea01 ltl2tgba_fm: simplify the ratexp_to_dfa interface
* spot/twaalgos/ltl2tgba_fm.cc (ratexp_to_dfa::succ): Rewrite using a
vector of (label,dest) as return type.
2024-04-03 15:27:21 +02:00
Alexandre Duret-Lutz
7ac570fa3f modernize some Python code
Since we now require Python 3.6, we can use f-strings instead of
format() to make the code more readable.

* doc/org/tut01.org, doc/org/tut02.org, doc/org/tut03.org,
doc/org/tut21.org, doc/org/tut24.org, doc/org/tut90.org,
python/spot/__init__.py, python/spot/jupyter.py, tests/python/acc.py,
tests/python/acc_cond.ipynb, tests/python/complement_semidet.py,
tests/python/decompose.ipynb, tests/python/formulas.ipynb,
tests/python/highlighting.ipynb, tests/python/ipnbdoctest.py,
tests/python/ltlf.py, tests/python/parity.ipynb,
tests/python/product.ipynb, tests/python/relabel.py,
tests/python/satmin.ipynb, tests/python/stutter-inv.ipynb,
tests/python/twagraph-internals.ipynb, tests/python/zlktree.ipynb: Use
f-strings.
2024-03-27 14:32:03 +01:00
Alexandre Duret-Lutz
df44f7a5c2 require python 3.6
* HACKING, NEWS, README, doc/org/install.org: Update.
* m4/pypath.m4, python/spot/__init__.py: Adjust requirements.
* python/spot/ltsmin.i: Don't use capture_output, this is a 3.7
option.
2024-03-27 14:31:32 +01:00
Alexandre Duret-Lutz
88f8af22c3 autfilt: add option --separate-edges
* bin/autfilt.cc: Implement it.
* tests/core/split.test: Test it.
* doc/org/tut25.org: Demonstrate it.
* NEWS: Mention it.
2024-03-25 20:25:24 +01:00
pierreganty
89f87795ca * doc/org/tut25.org: Minor corrections. 2024-03-25 20:25:24 +01:00
Alexandre Duret-Lutz
26ef5458eb determinize: speedup on automata with many AP and few labels
This uses the same trick as discussed in issue #566 and issue #568.

* spot/twaalgos/determinize.cc (safra_support): Use a basis
if it is smaller than 2^|support| for the current Safra state.
* tests/core/568.test: Add some tests.
* NEWS: Mention the optimization.
2024-03-25 20:25:24 +01:00
Alexandre Duret-Lutz
bda40a5f19 simulation: heuristically use a separated-label approach to rebuild
Closes issue #568.

* spot/twaalgos/simulation.cc (direct_simulation::build_result):
Implement an alternate loop based on edge_separator::basis to iterate
over a signature to build results.
* tests/core/568.test: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the optimization.
2024-03-25 20:25:24 +01:00
Alexandre Duret-Lutz
7ee2d9995f genaut: add two families of cyclic automata
These are meant to test the optimization implemented in issue #568.

* spot/gen/automata.hh, spot/gen/automata.cc, bin/genaut.cc: Add
support for --cycle-log-nba and --cycle-onehot-nba.
* tests/core/genaut.test: Add some tests.
* tests/python/gen.ipynb: Illustrate them.
* NEWS: Mention them.
2024-03-25 20:25:24 +01:00
Alexandre Duret-Lutz
26a62c8b68 minimize: t acceptance is compatible with wdba-minimization
* spot/twaalgos/minimize.cc (minimize_obligation_garanteed_to_work):
Skip some tests when the acceptance is "t".
* tests/core/det.test: Adjust.
2024-03-25 20:24:08 +01:00
Alexandre Duret-Lutz
7e228e86ee hoa: add option 'b' to build an alias-based basis for all labels
Related to issue #563.

* spot/twaalgos/hoa.hh (create_alias_basis): New function.
* spot/twaalgos/hoa.cc (create_alias_basis): New function.
(print_hoa): Add support for option 'b' and create_alias_basis
in this case.
* bin/common_aoutput.cc, NEWS: Document -Hb.
* tests/core/readsave.test, tests/python/aliases.py: Add test cases.
2024-03-22 14:41:42 +01:00
Alexandre Duret-Lutz
03a4f01184 acc: work around a Swig 4.2.1 bug
Pierre Ganty wrote that he could not compile Spot with Swig 4.2.1
anymore, and when I upgraded from 4.2.0 to 4.2.1 I could not either.

It seems that declaring operator<< as friends in subclasses is
confusing Swig 4.2.1.  See https://github.com/swig/swig/issues/2845

* spot/twa/acc.cc, spot/twa/acc.hh: Declare operator<< for
acc_cond::mark_t and acc_cond::acc_code outside the class, so that we
do not need friend declarations.
2024-03-21 22:18:15 +01:00
Alexandre Duret-Lutz
cb15840c56 org: add an example of conversion to BA format
This script was first posted on https://github.com/adl/hoaf/issues/73

* doc/org/tut25.org: New file.
* doc/Makefile.am: Add it.
* doc/org/tut.org, doc/org/tut21.org, NEWS: Link to it.
* doc/org/init.el.in: Install *.py files.
* doc/org/.gitignore: Add toba.py.
2024-03-21 09:00:06 +01:00
Alexandre Duret-Lutz
06099f649e powerset: improve tgba_powerset on small automata with large |AP|
For issue #566.

* spot/twaalgos/powerset.cc: Use the edge_separator on automata
with |AP|>5 that have few distinct labels.
* tests/core/566.test: Augment test-case.
* NEWS: Update.
2024-03-19 10:09:38 +01:00
Alexandre Duret-Lutz
c220107eb4 remove_alternation: use edge_separator
* spot/twaalgos/split.cc,
spot/twaalgos/split.hh (edge_separator::add_to_basis): Add a variant
that is limited in the number of labels it adds.
* spot/twaalgos/alternation.cc: Use it.  Also add
a cache of separated edges, as in the split.
2024-03-19 10:09:38 +01:00
Alexandre Duret-Lutz
3bcffa2fcd split: add separate_edges() and a edge_separator class
This generalizes (and replaces) the two-argument split that was
introduced in c2832cabfc.

* spot/twaalgos/split.cc, spot/twaalgos/split.hh (edge_separator): New
class.
(separate_edges): New function.
(split_edges): Remove the two argument version.
* spot/twaalgos/forq_contains.cc: Adjust to use the edge_separator
class.
* tests/python/splitedge.py: Adjust test case.
* tests/python/split.ipynb: New file.
* tests/Makefile.am, doc/org/tut.org: Add it.
* NEWS: Mention it.
2024-03-19 10:09:30 +01:00
Alexandre Duret-Lutz
0a045e5f76 split: factor the code common to both split_edges() versions
* spot/twaalgos/split.cc: The two split_edges() versions only differ
by the way they split a label.  Let's define all the rest of the
algorithm in split_edges_aux().
2024-03-18 11:24:56 +01:00
Alexandre Duret-Lutz
ef10be047c fix previous two patches
make sure we don't split a label with a label that subsume it

* spot/twaalgos/alternation.cc, spot/twaalgos/dualize.cc: Here.
2024-03-18 11:24:56 +01:00
Alexandre Duret-Lutz
f26f3243dd alternation: speed up remove_alternation when few labels are used
Related to issue #566.

* spot/twaalgos/alternation.cc (alternation_remover::run): Here.
* tests/core/566.test: Augment test case.
* NEWS: Mention the change.
2024-03-17 22:42:18 +01:00
Alexandre Duret-Lutz
1e512d422b dualize: improve performance on small automata with large |AP|
For issue #566.

* spot/twaalgos/dualize.cc (dualizer::copy_edges): Implement another
loop to be used when the number of outgoing edges of a state is
smaller than the number of AP.
* tests/core/566.test: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the improvement.
2024-03-17 22:36:01 +01:00
Alexandre Duret-Lutz
75e552fdac python: add bindings for BuDDy's minterms_of
minterms_of was introduced in BuDDy with Spot 2.10, but
wasn't properly binded in Python.

* python/buddy.i: Add bindings.
* tests/python/bdditer.py: Test them.
2024-03-11 17:42:05 +01:00
Alexandre Duret-Lutz
0d4e93a4ec [buddy] add missing typedefs to minterm_iterator
* src/bddx.h: Here.
2024-03-11 17:42:02 +01:00
Alexandre Duret-Lutz
1b81ecb80c dualize: should not call cleanup_acceptance_here
Based on a report by Emmanuel Filiot, who was surprized that dualizing
Büchi did not always produce co-Büchi.

* spot/twaalgos/dualize.cc: Remove the call to
cleanup_acceptance_here.
* spot/twaalgos/dualize.hh: Improve documentation.
* NEWS: Mention the possible backward incompatible change.
* tests/core/dualize.test, tests/python/dualize.py,
tests/python/pdegen.py: Adjust test cases.
* spot/twaalgos/complement.cc (complement): Call
cleanup_acceptance_here when dualize() returns a smaller automaton.
* THANKS: Add Emmanuel.
2024-03-07 23:50:04 +01:00
Alexandre Duret-Lutz
60f046a574 add intersection checks between words and automata
Several people have asked for a way to check whether a word is
accepted by an automaton, including at least Jonah Romero and Scott
Buckley.  So it's time we have it.

* spot/twa/twa.hh, spot/twa/twa.cc,
spot/twaalgos/word.hh (intersects): Add the new variant.
* spot/twa/fwd.hh: Forward declare twa_word, so that
we can use it in twa.hh.
* spot/twaalgos/forq_contains.cc: Use the new intersection check.
* tests/python/word.ipynb, NEWS: Mention it.
* THANKS: Add Scott Buckley.
2024-03-07 21:31:20 +01:00
Alexandre Duret-Lutz
83cabfa6f9 ltlsynt: fix suggested references
* bin/man/ltlsynt.x: Add the Dissecting ltlsynt paper.
* doc/org/citing.org: Put Adrien in italics.
2024-02-19 11:43:58 +01:00
Alexandre Duret-Lutz
82311c3e3b ltlsynt: fix the case where AP removal is disabled and decomp fails
* bin/ltlsynt.cc: Correctly update the output variables in the case
decomposition failed and AP removal is disabled.
* tests/core/ltlsynt.test: Add a test case.
2024-02-19 11:43:58 +01:00
Alexandre Duret-Lutz
15b876d368 ltlsynt: allow regular expressions in --ins/--outs
* bin/ltlsynt.cc: Implement this.
* doc/org/ltlsynt.org, NEWS: Adjust documentation.
* tests/core/ltlsynt.test: Add test cases.
2024-02-19 11:43:58 +01:00
Alexandre Duret-Lutz
31462d84ba style: relax the else's body check
* tests/sanity/style.test: Skip the "else body should be on next line"
check when else is followed by if.
2024-02-19 11:43:58 +01:00
Alexandre Duret-Lutz
bcfcea6272 * bin/spot-x.cc: Fix some typos. 2024-02-16 12:10:14 +01:00
Alexandre Duret-Lutz
eff7966cef sccinfo: fix documentation for split_on_sets
* spot/twaalgos/sccinfo.hh (split_on_sets): Fix the documentation to
match what the code does.  Reported by Pierre Ganty.
2024-02-11 22:54:49 +01:00
Alexandre Duret-Lutz
3034e8fcc3 python: render <svg> via _repr_html_
Work around a recent decision in Jupyter Lab and Notebook to render
<svg> is inline <img>, breaking tooltips or text selection.

(Rerendering all notebooks was painful.)

* NEWS: Mention the change.
* python/spot/__init__.py: Add a _repr_html_ method to all
classes that had a _repr_svg_.  It seems Jupyter will use
_repr_html_ by default.
* python/spot/jupyter.py: SVG replace the _repr_svg_ method
by a _repr_html.
* tests/python/_altscc.ipynb, tests/python/_autparserr.ipynb,
tests/python/_aux.ipynb, tests/python/_mealy.ipynb,
tests/python/_partitioned_relabel.ipynb,
tests/python/_product_susp.ipynb, tests/python/_product_weak.ipynb,
tests/python/_synthesis.ipynb, tests/python/aliases.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/cav22-figs.ipynb,
tests/python/contains.ipynb, tests/python/decompose.ipynb,
tests/python/formulas.ipynb, tests/python/games.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/synthesis.ipynb,
tests/python/testingaut.ipynb, tests/python/twagraph-internals.ipynb,
tests/python/word.ipynb, tests/python/zlktree.ipynb: Update all
notebooks.
2024-02-09 15:06:07 +01:00
Alexandre Duret-Lutz
4cf7503fff org: fix many errors
Most of those errors were pointed out by the language-check tool.
However while fixing those I found a few other issues that I fixed.
In particular I updated the bibliographic reference for ltlsynt,
added some DOI links for some cited papers that had no link, and
fixed the broken introduction of ltlgrind.

* doc/org/autcross.org, doc/org/autfilt.org, doc/org/citing.org,
doc/org/compile.org, doc/org/concepts.org, doc/org/csv.org,
doc/org/dstar2tgba.org, doc/org/genaut.org, doc/org/hierarchy.org,
doc/org/install.org, doc/org/ioltl.org, doc/org/ltl2tgba.org,
doc/org/ltl2tgta.org, doc/org/ltlcross.org, doc/org/ltldo.org,
doc/org/ltlfilt.org, doc/org/ltlgrind.org, doc/org/ltlsynt.org,
doc/org/oaut.org, doc/org/randaut.org, doc/org/randltl.org,
doc/org/satmin.org, doc/org/tut01.org, doc/org/tut02.org,
doc/org/tut03.org, doc/org/tut10.org, doc/org/tut11.org,
doc/org/tut12.org, doc/org/tut20.org, doc/org/tut22.org,
doc/org/tut24.org, doc/org/tut30.org, doc/org/tut40.org,
doc/org/tut50.org, doc/org/tut51.org, doc/org/tut52.org,
doc/org/tut90.org, doc/org/upgrade2.org: Fix errors.
* bin/autfilt.cc, bin/common_aoutput.cc, bin/genaut.cc: Fix some
typos in --help text that appeared in the above org files.
2024-02-09 12:16:52 +01:00
Alexandre Duret-Lutz
a6f79c6211 more doc handling of prop_universal for fused initial states
Fixes #560.

* spot/parseaut/parseaut.yy: Add more comments about handling
of prop_universal in present of multiple initial states.  It took
me time to figure out that it was done correctly.  Also only
reset prop_complete() in the case an initial state is reused.
* tests/core/det.test: Add a test case for the deterministic property.
* tests/python/parsetgba.py: Add tests for complete.
* doc/org/hoa.org: Add more text about the effect of fusing initial
states.
* doc/org/concepts.org (properties): Replace "deterministic" by
"universal".  The former was obsoleted in Spot 2.4.
2024-02-09 10:11:58 +01:00
Alexandre Duret-Lutz
a735c2b72d tl_simplifier: add more test cases
Fixes #558 by just adding test cases showing there is no issue.

* tests/core/reduccmp.test: Add test cases.
2024-02-06 23:48:23 +01:00
Alexandre Duret-Lutz
ca739ce816 * NEWS: Fix some typos. 2024-02-06 23:48:23 +01:00
Alexandre Duret-Lutz
db168f97e6 tl: fix detection of goto
Fixes #559.

* spot/tl/print.cc (strip_star_not): Only match a full star.
* tests/core/sugar.test: Add test case.
2024-02-06 23:48:23 +01:00
Alexandre Duret-Lutz
94ab42612a work around some Swig 4.2 change
Several test cases started failing after updating to Swig 4.2 because
the spot.ltsmin module and the spot.impl module were using different
names for atomic_prop_set.  This seems to work around it.

* python/spot/impl.i: Specify the full type for atomic_prop_set.
2024-02-06 23:47:59 +01:00
Alexandre Duret-Lutz
342360f8ca fix some preprocessor directive
Apparently using `#if defined(X) or defined(Y)` did not
trouve the compilers, but Swig was confused by the "or".

* spot/misc/common.hh, spot/tl/formula.hh: Use || instead.
2024-02-06 14:12:16 +01:00
Alexandre Duret-Lutz
27b8e5aa73 postproc: fix default for acd and interaction with colored
* spot/twaalgos/postproc.hh (postprocess::acd_): Default to true.
* spot/twaalgos/postproc.cc (postprocess::run): When acd is used
to color an automaton, do not run scc_filter to remove color
from transiant edges.
* tests/python/acd.py: New file.
* tests/Makefile.am: Add it.
2024-02-06 14:09:42 +01:00
Alexandre Duret-Lutz
dc5a569582 ltlsynt: fix --global-equiv
Fixes #557.

* spot/tl/apcollect.cc (realizability_simplifier): When detecting
global equivalence such as o1 := i2, the left is always an output, so
it should never be marked as input.
* tests/core/ltlsynt.test: Add test case.
2024-01-26 22:31:17 +01:00
Alexandre Duret-Lutz
690e5a213d remove_alternation: option to return nullptr if too many sets needed
* spot/twaalgos/alternation.hh, spot/twaalgos/alternation.cc: Add the
new options.
* spot/twaalgos/complement.cc, spot/twaalgos/minimize.cc: Use it.
* tests/core/optba.test: Add a test case from Yann.
* NEWS: Mention those changes.
2024-01-26 22:09:22 +01:00
Alexandre Duret-Lutz
9957aa1a3a bump copyright to 2024
* bin/common_setup.cc, debian/copyright: Here.
2024-01-13 12:53:54 +01:00
Alexandre Duret-Lutz
69c8187330 * spot/twaalgos/aiger.cc: Work around gcc snapshot diagnostics. 2023-12-18 10:04:15 +01:00
Alexandre Duret-Lutz
55992b1ca2 * spot/bricks/brick-assert: include <cstdint>. 2023-12-17 21:34:51 +01:00
Alexandre Duret-Lutz
983964d037 strength: generalize is_safety_automaton to any type of automata
Reported by Samuel Judson.

* spot/twaalgos/strength.cc (is_safety_automaton): Reimplement it.
* spot/twaalgos/strength.hh (is_safety_automaton): Update
documentation.
* tests/python/safety.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention this change.
* THANKS: Add Samuel.
2023-12-16 00:34:58 +01:00
Alexandre Duret-Lutz
e8c2b27ad2 * spot/tl/hierarchy.cc: Typo in comment. 2023-12-16 00:10:03 +01:00
Alexandre Duret-Lutz
3c638f2a88 python: add get_highlight_state and get_highlight_edge
* python/spot/impl.i: Here.
* tests/python/highlighting.ipynb: Test it.
* NEWS: Mention it.
2023-12-06 16:39:49 +01:00
Alexandre Duret-Lutz
ba86dc6b18 twa: guard against highlighting of non-existing edges and states
For issue #556, reported by Dávid Smolka.  Not sure if this is a
complete fix yet, but that's at least part of the issue.

* spot/twa/twagraph.cc (defrag_states): Skip those unexisting edges
and states while remaping highlight-states and highlight-edges.
* spot/parseaut/parseaut.yy: Likewise for dropped edges.
* tests/python/parsetgba.py: Augment test case.
2023-12-04 22:15:37 +01:00
Alexandre Duret-Lutz
444d4f773d twa: fix issue #555 better
Reported by Dávid Smolka.

* spot/twa/twagraph.cc (defrag_states): Also ignore edges with erased
source when updating highlight-edges.
* tests/python/parsetgba.py: Add Dávid's test case.
2023-12-03 22:26:12 +01:00
Alexandre Duret-Lutz
3d05ecb4ac remove many useless includes
Removal suggestions from clang-include-cleaner-17 applied manually.

* spot/gen/automata.cc, spot/ltsmin/ltsmin.cc, spot/misc/bitvect.cc,
spot/misc/intvcomp.cc, spot/misc/satsolver.cc, spot/misc/tmpfile.cc,
spot/priv/trim.cc, spot/priv/weight.cc, spot/ta/taexplicit.cc,
spot/ta/tgtaexplicit.cc, spot/ta/tgtaproduct.cc,
spot/taalgos/emptinessta.cc, spot/taalgos/minimize.cc,
spot/taalgos/reachiter.cc, spot/taalgos/statessetbuilder.cc,
spot/taalgos/tgba2ta.cc, spot/tl/apcollect.cc, spot/tl/contain.cc,
spot/tl/exclusive.cc, spot/tl/formula.cc, spot/tl/mark.cc,
spot/tl/randomltl.cc, spot/tl/relabel.cc, spot/tl/remove_x.cc,
spot/twa/acc.cc, spot/twa/bdddict.cc, spot/twa/taatgba.cc,
spot/twa/twagraph.cc, spot/twaalgos/aiger.cc,
spot/twaalgos/alternation.cc, spot/twaalgos/canonicalize.cc,
spot/twaalgos/cobuchi.cc, spot/twaalgos/complement.cc,
spot/twaalgos/compsusp.cc, spot/twaalgos/dbranch.cc,
spot/twaalgos/degen.cc, spot/twaalgos/determinize.cc,
spot/twaalgos/dot.cc, spot/twaalgos/dtbasat.cc,
spot/twaalgos/dtwasat.cc, spot/twaalgos/emptiness.cc,
spot/twaalgos/forq_contains.cc, spot/twaalgos/game.cc,
spot/twaalgos/genem.cc, spot/twaalgos/gv04.cc, spot/twaalgos/hoa.cc,
spot/twaalgos/isunamb.cc, spot/twaalgos/isweakscc.cc,
spot/twaalgos/lbtt.cc, spot/twaalgos/ltl2tgba_fm.cc,
spot/twaalgos/magic.cc, spot/twaalgos/mealy_machine.cc,
spot/twaalgos/minimize.cc, spot/twaalgos/neverclaim.cc,
spot/twaalgos/parity.cc, spot/twaalgos/powerset.cc,
spot/twaalgos/product.cc, spot/twaalgos/randomgraph.cc,
spot/twaalgos/randomize.cc, spot/twaalgos/relabel.cc,
spot/twaalgos/remfin.cc, spot/twaalgos/remprop.cc,
spot/twaalgos/sccinfo.cc, spot/twaalgos/se05.cc,
spot/twaalgos/sepsets.cc, spot/twaalgos/simulation.cc,
spot/twaalgos/split.cc, spot/twaalgos/strength.cc,
spot/twaalgos/stutter.cc, spot/twaalgos/synthesis.cc,
spot/twaalgos/tau03.cc, spot/twaalgos/tau03opt.cc,
spot/twaalgos/translate.cc, spot/twacube/cube.cc: Remove useless
includes.
2023-11-29 22:38:21 +01:00
Alexandre Duret-Lutz
c9d9c10cb2 * HACKING: Mention bear, to build compile_commands.json. 2023-11-29 22:38:21 +01:00
Florian Renkin
cee2819a45 auts_to_aiger: Fix output name index
* spot/twaalgos/aiger.cc: Correct the position of an output in
  a realizability_simplifier.
* tests/core/ltlsynt.test: Add test.
2023-11-29 13:10:04 +00:00
Alexandre Duret-Lutz
234ba2bb84 work around some gcc 9.4 warnings
* spot/twa/twagraph.cc, spot/twaalgos/split.cc: Here.
2023-11-28 18:50:52 +01:00
Alexandre Duret-Lutz
738d62e0b9 hoa: do not output empty highlighting maps
* spot/twaalgos/hoa.cc: Here.
* tests/python/parsetgba.py: Test it.
2023-11-24 20:40:07 +01:00
Alexandre Duret-Lutz
55575a11e3 twagraph: fix highlight-edges in defrag_states
Fixes #555 reported by Dávid Smolka.

* spot/twa/twagraph.cc (defrag_states): Update highlight-edge.
* spot/graph/graph.hh (defrag_states): Just point to
twa_graph::defrag_states in a comment, because the latter relies
on the implementation detail of graph::defrag_state.
* tests/python/parsetgba.py: Add test case.
* NEWS: Mention the bug.
2023-11-24 20:40:02 +01:00
Alexandre Duret-Lutz
193fdd6f95 python: add easy ways to remove highlights
Fixes #554, reported by Dávid Smolka.

* python/spot/impl.i (highlight_edge, highlight_state): Add versions
where the color is nullptr and map that to None.
(remove_highlight_states, remove_highlight_edges): New function.
* tests/python/highlighting.ipynb: Demonstrate those new methods.
2023-11-23 17:08:31 +01:00
Alexandre Duret-Lutz
0dd623b358 hoa: improve the diagnostic for unregistered propositions
* spot/twaalgos/hoa.cc: Here.
2023-11-22 17:28:17 +01:00
Alexandre Duret-Lutz
d4827c5e00 acc: improve the "too many acceptance sets used" message
* spot/twa/acc.cc (report_too_many_sets): Mention --enable-max-sets
and the email address for reporting problems.
2023-11-22 17:28:17 +01:00
Alexandre Duret-Lutz
62fb0c354e stength: fix detection of terminal automata
Fixes issue #553.

* spot/twaalgos/strength.cc (is_type_automaton): Make sure an
accepting SCC is not followed by a rejecting one.
(is_terminal_automaton): Mark the third-argument version deprecated.
* spot/twaalgos/strength.hh: Adjust.
* spot/twaalgos/couvreurnew.cc: Remove the inappropriate terminal
optimization.
* bin/ltlfilt.cc, spot/tl/hierarchy.cc, spot/twaalgos/gfguarantee.cc,
tests/core/ikwiad.cc: Remove usage of the third argument of
is_terminal_automaton.
* tests/core/readsave.test, tests/core/strength.test: Adjust test
cases.
* NEWS: Mention the bug.
2023-11-22 17:28:02 +01:00
Alexandre Duret-Lutz
63362d535f Upgrade the Copyright strings to point to AUTHORS and drop years
Fixes #539.

* AUTHORS: Update by indicating the status of each contributor.
* Makefile.am, bench/Makefile.am, bench/dtgbasat/Makefile.am,
bench/dtgbasat/gen.py, bench/emptchk/Makefile.am,
bench/emptchk/defs.in, bench/ltl2tgba/Makefile.am,
bench/ltl2tgba/defs.in, bench/ltl2tgba/sum.py,
bench/ltlclasses/Makefile.am, bench/ltlcounter/Makefile.am,
bench/spin13/Makefile.am, bench/stutter/Makefile.am,
bench/stutter/stutter_invariance_formulas.cc,
bench/stutter/stutter_invariance_randomgraph.cc,
bench/wdba/Makefile.am, bin/Makefile.am, bin/autcross.cc,
bin/autfilt.cc, bin/common_aoutput.cc, bin/common_aoutput.hh,
bin/common_color.cc, bin/common_color.hh, bin/common_conv.cc,
bin/common_conv.hh, bin/common_cout.cc, bin/common_cout.hh,
bin/common_file.cc, bin/common_file.hh, bin/common_finput.cc,
bin/common_finput.hh, bin/common_hoaread.cc, bin/common_hoaread.hh,
bin/common_output.cc, bin/common_output.hh, bin/common_post.cc,
bin/common_post.hh, bin/common_r.cc, bin/common_r.hh,
bin/common_range.cc, bin/common_range.hh, bin/common_setup.cc,
bin/common_setup.hh, bin/common_sys.hh, bin/common_trans.cc,
bin/common_trans.hh, bin/dstar2tgba.cc, bin/genaut.cc, bin/genltl.cc,
bin/ltl2tgba.cc, bin/ltl2tgta.cc, bin/ltlcross.cc, bin/ltldo.cc,
bin/ltlfilt.cc, bin/ltlgrind.cc, bin/ltlsynt.cc, bin/man/Makefile.am,
bin/options.py, bin/randaut.cc, bin/randltl.cc, bin/spot-x.cc,
bin/spot.cc, configure.ac, debian/copyright, doc/Makefile.am,
doc/tl/Makefile.am, elisp/Makefile.am, python/Makefile.am,
python/buddy.i, python/spot/__init__.py, python/spot/aux_.py,
python/spot/gen.i, python/spot/impl.i, python/spot/jupyter.py,
python/spot/ltsmin.i, spot/Makefile.am, spot/gen/Makefile.am,
spot/gen/automata.cc, spot/gen/automata.hh, spot/gen/formulas.cc,
spot/gen/formulas.hh, spot/graph/Makefile.am, spot/graph/graph.hh,
spot/graph/ngraph.hh, spot/kripke/Makefile.am,
spot/kripke/fairkripke.cc, spot/kripke/fairkripke.hh,
spot/kripke/fwd.hh, spot/kripke/kripke.cc, spot/kripke/kripke.hh,
spot/kripke/kripkegraph.hh, spot/ltsmin/Makefile.am,
spot/ltsmin/ltsmin.cc, spot/ltsmin/ltsmin.hh,
spot/ltsmin/spins_interface.cc, spot/ltsmin/spins_interface.hh,
spot/ltsmin/spins_kripke.hh, spot/ltsmin/spins_kripke.hxx,
spot/mc/Makefile.am, spot/mc/bloemen.hh, spot/mc/bloemen_ec.hh,
spot/mc/cndfs.hh, spot/mc/deadlock.hh, spot/mc/intersect.hh,
spot/mc/lpar13.hh, spot/mc/mc.hh, spot/mc/mc_instanciator.hh,
spot/mc/unionfind.cc, spot/mc/unionfind.hh, spot/mc/utils.hh,
spot/misc/Makefile.am, spot/misc/bareword.cc, spot/misc/bareword.hh,
spot/misc/bddlt.hh, spot/misc/bitset.cc, spot/misc/bitset.hh,
spot/misc/bitvect.cc, spot/misc/bitvect.hh, spot/misc/casts.hh,
spot/misc/clz.hh, spot/misc/common.hh, spot/misc/escape.cc,
spot/misc/escape.hh, spot/misc/fixpool.hh, spot/misc/formater.cc,
spot/misc/formater.hh, spot/misc/hash.hh, spot/misc/hashfunc.hh,
spot/misc/intvcmp2.cc, spot/misc/intvcmp2.hh, spot/misc/intvcomp.cc,
spot/misc/intvcomp.hh, spot/misc/ltstr.hh, spot/misc/memusage.cc,
spot/misc/memusage.hh, spot/misc/minato.cc, spot/misc/minato.hh,
spot/misc/mspool.hh, spot/misc/optionmap.cc, spot/misc/optionmap.hh,
spot/misc/random.cc, spot/misc/random.hh, spot/misc/satsolver.cc,
spot/misc/satsolver.hh, spot/misc/timer.cc, spot/misc/timer.hh,
spot/misc/tmpfile.cc, spot/misc/tmpfile.hh, spot/misc/trival.hh,
spot/misc/version.cc, spot/misc/version.hh, spot/parseaut/Makefile.am,
spot/parseaut/fmterror.cc, spot/parseaut/parseaut.yy,
spot/parseaut/parsedecl.hh, spot/parseaut/public.hh,
spot/parseaut/scanaut.ll, spot/parsetl/Makefile.am,
spot/parsetl/fmterror.cc, spot/parsetl/parsedecl.hh,
spot/parsetl/parsetl.yy, spot/parsetl/scantl.ll,
spot/priv/Makefile.am, spot/priv/accmap.hh, spot/priv/bddalloc.cc,
spot/priv/bddalloc.hh, spot/priv/freelist.cc, spot/priv/freelist.hh,
spot/priv/partitioned_relabel.cc, spot/priv/partitioned_relabel.hh,
spot/priv/satcommon.cc, spot/priv/satcommon.hh, spot/priv/trim.cc,
spot/priv/trim.hh, spot/priv/weight.cc, spot/priv/weight.hh,
spot/ta/Makefile.am, spot/ta/ta.cc, spot/ta/ta.hh,
spot/ta/taexplicit.cc, spot/ta/taexplicit.hh, spot/ta/taproduct.cc,
spot/ta/taproduct.hh, spot/ta/tgta.hh, spot/ta/tgtaexplicit.cc,
spot/ta/tgtaexplicit.hh, spot/ta/tgtaproduct.cc,
spot/ta/tgtaproduct.hh, spot/taalgos/Makefile.am, spot/taalgos/dot.cc,
spot/taalgos/dot.hh, spot/taalgos/emptinessta.cc,
spot/taalgos/emptinessta.hh, spot/taalgos/minimize.cc,
spot/taalgos/minimize.hh, spot/taalgos/reachiter.cc,
spot/taalgos/reachiter.hh, spot/taalgos/statessetbuilder.cc,
spot/taalgos/statessetbuilder.hh, spot/taalgos/stats.cc,
spot/taalgos/stats.hh, spot/taalgos/tgba2ta.cc,
spot/taalgos/tgba2ta.hh, spot/tl/Makefile.am, spot/tl/apcollect.cc,
spot/tl/apcollect.hh, spot/tl/contain.cc, spot/tl/contain.hh,
spot/tl/declenv.cc, spot/tl/declenv.hh, spot/tl/defaultenv.cc,
spot/tl/defaultenv.hh, spot/tl/dot.cc, spot/tl/dot.hh,
spot/tl/environment.hh, spot/tl/exclusive.cc, spot/tl/exclusive.hh,
spot/tl/formula.cc, spot/tl/formula.hh, spot/tl/hierarchy.cc,
spot/tl/hierarchy.hh, spot/tl/length.cc, spot/tl/length.hh,
spot/tl/ltlf.cc, spot/tl/ltlf.hh, spot/tl/mark.cc, spot/tl/mark.hh,
spot/tl/mutation.cc, spot/tl/mutation.hh, spot/tl/nenoform.cc,
spot/tl/nenoform.hh, spot/tl/parse.hh, spot/tl/print.cc,
spot/tl/print.hh, spot/tl/randomltl.cc, spot/tl/randomltl.hh,
spot/tl/relabel.cc, spot/tl/relabel.hh, spot/tl/remove_x.cc,
spot/tl/remove_x.hh, spot/tl/simplify.cc, spot/tl/simplify.hh,
spot/tl/snf.cc, spot/tl/snf.hh, spot/tl/sonf.cc, spot/tl/sonf.hh,
spot/tl/unabbrev.cc, spot/tl/unabbrev.hh, spot/twa/Makefile.am,
spot/twa/acc.cc, spot/twa/acc.hh, spot/twa/bdddict.cc,
spot/twa/bdddict.hh, spot/twa/bddprint.cc, spot/twa/bddprint.hh,
spot/twa/formula2bdd.cc, spot/twa/formula2bdd.hh, spot/twa/fwd.hh,
spot/twa/taatgba.cc, spot/twa/taatgba.hh, spot/twa/twa.cc,
spot/twa/twa.hh, spot/twa/twagraph.cc, spot/twa/twagraph.hh,
spot/twa/twaproduct.cc, spot/twa/twaproduct.hh,
spot/twaalgos/Makefile.am, spot/twaalgos/aiger.cc,
spot/twaalgos/aiger.hh, spot/twaalgos/alternation.cc,
spot/twaalgos/alternation.hh, spot/twaalgos/are_isomorphic.cc,
spot/twaalgos/are_isomorphic.hh, spot/twaalgos/bfssteps.cc,
spot/twaalgos/bfssteps.hh, spot/twaalgos/canonicalize.cc,
spot/twaalgos/canonicalize.hh, spot/twaalgos/cleanacc.cc,
spot/twaalgos/cleanacc.hh, spot/twaalgos/cobuchi.cc,
spot/twaalgos/cobuchi.hh, spot/twaalgos/complement.cc,
spot/twaalgos/complement.hh, spot/twaalgos/complete.cc,
spot/twaalgos/complete.hh, spot/twaalgos/compsusp.cc,
spot/twaalgos/compsusp.hh, spot/twaalgos/contains.cc,
spot/twaalgos/contains.hh, spot/twaalgos/copy.hh,
spot/twaalgos/couvreurnew.cc, spot/twaalgos/couvreurnew.hh,
spot/twaalgos/cycles.cc, spot/twaalgos/cycles.hh,
spot/twaalgos/dbranch.cc, spot/twaalgos/dbranch.hh,
spot/twaalgos/degen.cc, spot/twaalgos/degen.hh,
spot/twaalgos/determinize.cc, spot/twaalgos/determinize.hh,
spot/twaalgos/dot.cc, spot/twaalgos/dot.hh, spot/twaalgos/dtbasat.cc,
spot/twaalgos/dtbasat.hh, spot/twaalgos/dtwasat.cc,
spot/twaalgos/dtwasat.hh, spot/twaalgos/dualize.cc,
spot/twaalgos/dualize.hh, spot/twaalgos/emptiness.cc,
spot/twaalgos/emptiness.hh, spot/twaalgos/emptiness_stats.hh,
spot/twaalgos/forq_contains.cc, spot/twaalgos/forq_contains.hh,
spot/twaalgos/game.cc, spot/twaalgos/game.hh, spot/twaalgos/genem.cc,
spot/twaalgos/genem.hh, spot/twaalgos/gfguarantee.cc,
spot/twaalgos/gfguarantee.hh, spot/twaalgos/gtec/Makefile.am,
spot/twaalgos/gtec/ce.cc, spot/twaalgos/gtec/ce.hh,
spot/twaalgos/gtec/gtec.cc, spot/twaalgos/gtec/gtec.hh,
spot/twaalgos/gtec/sccstack.cc, spot/twaalgos/gtec/sccstack.hh,
spot/twaalgos/gtec/status.cc, spot/twaalgos/gtec/status.hh,
spot/twaalgos/gv04.cc, spot/twaalgos/gv04.hh, spot/twaalgos/hoa.cc,
spot/twaalgos/hoa.hh, spot/twaalgos/iscolored.cc,
spot/twaalgos/iscolored.hh, spot/twaalgos/isdet.cc,
spot/twaalgos/isdet.hh, spot/twaalgos/isunamb.cc,
spot/twaalgos/isunamb.hh, spot/twaalgos/isweakscc.cc,
spot/twaalgos/isweakscc.hh, spot/twaalgos/langmap.cc,
spot/twaalgos/langmap.hh, spot/twaalgos/lbtt.cc,
spot/twaalgos/lbtt.hh, spot/twaalgos/ltl2taa.cc,
spot/twaalgos/ltl2taa.hh, spot/twaalgos/ltl2tgba_fm.cc,
spot/twaalgos/ltl2tgba_fm.hh, spot/twaalgos/magic.cc,
spot/twaalgos/magic.hh, spot/twaalgos/mask.cc, spot/twaalgos/mask.hh,
spot/twaalgos/mealy_machine.cc, spot/twaalgos/mealy_machine.hh,
spot/twaalgos/minimize.cc, spot/twaalgos/minimize.hh,
spot/twaalgos/ndfs_result.hxx, spot/twaalgos/neverclaim.cc,
spot/twaalgos/neverclaim.hh, spot/twaalgos/parity.cc,
spot/twaalgos/parity.hh, spot/twaalgos/postproc.cc,
spot/twaalgos/postproc.hh, spot/twaalgos/powerset.cc,
spot/twaalgos/powerset.hh, spot/twaalgos/product.cc,
spot/twaalgos/product.hh, spot/twaalgos/randomgraph.cc,
spot/twaalgos/randomgraph.hh, spot/twaalgos/randomize.cc,
spot/twaalgos/randomize.hh, spot/twaalgos/reachiter.cc,
spot/twaalgos/reachiter.hh, spot/twaalgos/relabel.cc,
spot/twaalgos/relabel.hh, spot/twaalgos/remfin.cc,
spot/twaalgos/remfin.hh, spot/twaalgos/remprop.cc,
spot/twaalgos/remprop.hh, spot/twaalgos/sbacc.cc,
spot/twaalgos/sbacc.hh, spot/twaalgos/sccfilter.cc,
spot/twaalgos/sccfilter.hh, spot/twaalgos/sccinfo.cc,
spot/twaalgos/sccinfo.hh, spot/twaalgos/se05.cc,
spot/twaalgos/se05.hh, spot/twaalgos/sepsets.cc,
spot/twaalgos/sepsets.hh, spot/twaalgos/simulation.cc,
spot/twaalgos/simulation.hh, spot/twaalgos/split.cc,
spot/twaalgos/split.hh, spot/twaalgos/stats.cc,
spot/twaalgos/stats.hh, spot/twaalgos/strength.cc,
spot/twaalgos/strength.hh, spot/twaalgos/stripacc.cc,
spot/twaalgos/stripacc.hh, spot/twaalgos/stutter.cc,
spot/twaalgos/stutter.hh, spot/twaalgos/sum.cc, spot/twaalgos/sum.hh,
spot/twaalgos/synthesis.cc, spot/twaalgos/synthesis.hh,
spot/twaalgos/tau03.cc, spot/twaalgos/tau03.hh,
spot/twaalgos/tau03opt.cc, spot/twaalgos/tau03opt.hh,
spot/twaalgos/toparity.cc, spot/twaalgos/toparity.hh,
spot/twaalgos/totgba.cc, spot/twaalgos/totgba.hh,
spot/twaalgos/toweak.cc, spot/twaalgos/toweak.hh,
spot/twaalgos/translate.cc, spot/twaalgos/translate.hh,
spot/twaalgos/word.cc, spot/twaalgos/word.hh,
spot/twaalgos/zlktree.cc, spot/twaalgos/zlktree.hh,
spot/twacube/Makefile.am, spot/twacube/cube.cc, spot/twacube/cube.hh,
spot/twacube/fwd.hh, spot/twacube/twacube.cc, spot/twacube/twacube.hh,
spot/twacube_algos/Makefile.am, spot/twacube_algos/convert.cc,
spot/twacube_algos/convert.hh, tests/Makefile.am, tests/core/385.test,
tests/core/500.test, tests/core/521.test, tests/core/522.test,
tests/core/acc.cc, tests/core/acc.test, tests/core/acc2.test,
tests/core/acc_word.test, tests/core/accsimpl.test,
tests/core/alternating.test, tests/core/autcross.test,
tests/core/autcross2.test, tests/core/autcross3.test,
tests/core/autcross4.test, tests/core/autcross5.test,
tests/core/babiak.test, tests/core/bare.test, tests/core/basimul.test,
tests/core/bdd.test, tests/core/bdddict.cc, tests/core/bdddict.test,
tests/core/bitvect.cc, tests/core/bitvect.test, tests/core/bricks.cc,
tests/core/bricks.test, tests/core/checkpsl.cc, tests/core/checkta.cc,
tests/core/complement.test, tests/core/complementation.test,
tests/core/complete.test, tests/core/consterm.cc,
tests/core/consterm.test, tests/core/cube.cc, tests/core/cube.test,
tests/core/cycles.test, tests/core/dbacomp.test, tests/core/dca.test,
tests/core/dca2.test, tests/core/defs.in, tests/core/degendet.test,
tests/core/degenid.test, tests/core/degenlskip.test,
tests/core/degenscc.test, tests/core/det.test, tests/core/dfs.test,
tests/core/dnfstreett.test, tests/core/dot2tex.test,
tests/core/dra2dba.test, tests/core/dstar.test,
tests/core/dualize.test, tests/core/dupexp.test,
tests/core/emptchk.cc, tests/core/emptchk.test,
tests/core/emptchke.test, tests/core/emptchkr.test,
tests/core/equals.test, tests/core/equalsf.cc,
tests/core/eventuniv.test, tests/core/exclusive-ltl.test,
tests/core/exclusive-tgba.test, tests/core/explpro2.test,
tests/core/explpro3.test, tests/core/explpro4.test,
tests/core/explprod.test, tests/core/explsum.test,
tests/core/format.test, tests/core/full.test, tests/core/gamehoa.test,
tests/core/genaut.test, tests/core/genltl.test,
tests/core/gragsa.test, tests/core/graph.cc, tests/core/graph.test,
tests/core/hierarchy.test, tests/core/highlightstate.test,
tests/core/ikwiad.cc, tests/core/included.test,
tests/core/intvcmp2.cc, tests/core/intvcomp.cc,
tests/core/intvcomp.test, tests/core/isomorph.test,
tests/core/isop.test, tests/core/kind.cc, tests/core/kind.test,
tests/core/kripke.test, tests/core/kripkecat.cc,
tests/core/latex.test, tests/core/lbt.test, tests/core/lbttparse.test,
tests/core/length.cc, tests/core/length.test, tests/core/lenient.test,
tests/core/ltl2dstar.test, tests/core/ltl2dstar2.test,
tests/core/ltl2dstar3.test, tests/core/ltl2dstar4.test,
tests/core/ltl2neverclaim-lbtt.test, tests/core/ltl2neverclaim.test,
tests/core/ltl2ta.test, tests/core/ltl2ta2.test,
tests/core/ltl2tgba.test, tests/core/ltl2tgba2.test,
tests/core/ltl3ba.test, tests/core/ltl3dra.test,
tests/core/ltlcounter.test, tests/core/ltlcross.test,
tests/core/ltlcross2.test, tests/core/ltlcross3.test,
tests/core/ltlcross4.test, tests/core/ltlcross5.test,
tests/core/ltlcross6.test, tests/core/ltlcrossce.test,
tests/core/ltlcrossce2.test, tests/core/ltlcrossgrind.test,
tests/core/ltldo.test, tests/core/ltldo2.test, tests/core/ltlf.test,
tests/core/ltlfilt.test, tests/core/ltlgrind.test,
tests/core/ltlrel.cc, tests/core/ltlrel.test,
tests/core/ltlsynt-pgame.test, tests/core/ltlsynt.test,
tests/core/ltlsynt2.test, tests/core/lunabbrev.test,
tests/core/maskacc.test, tests/core/maskkeep.test,
tests/core/mempool.cc, tests/core/mempool.test, tests/core/minterm.cc,
tests/core/minterm.test, tests/core/minusx.test,
tests/core/monitor.test, tests/core/nenoform.test,
tests/core/neverclaimread.test, tests/core/ngraph.cc,
tests/core/ngraph.test, tests/core/nondet.test,
tests/core/obligation.test, tests/core/optba.test,
tests/core/parity.cc, tests/core/parity.test, tests/core/parity2.test,
tests/core/parse.test, tests/core/parseaut.test,
tests/core/parseerr.test, tests/core/pdegen.test,
tests/core/pgsolver.test, tests/core/prodchain.test,
tests/core/prodor.test, tests/core/rabin2parity.test,
tests/core/rand.test, tests/core/randaut.test,
tests/core/randomize.test, tests/core/randpsl.test,
tests/core/randtgba.cc, tests/core/randtgba.test,
tests/core/readltl.cc, tests/core/readsave.test, tests/core/reduc.cc,
tests/core/reduc.test, tests/core/reduc0.test,
tests/core/reduccmp.test, tests/core/reducpsl.test,
tests/core/remfin.test, tests/core/remove_x.test,
tests/core/remprop.test, tests/core/renault.test, tests/core/safra.cc,
tests/core/safra.test, tests/core/satmin.test,
tests/core/satmin2.test, tests/core/satmin3.test,
tests/core/sbacc.test, tests/core/scc.test, tests/core/sccdot.test,
tests/core/sccif.cc, tests/core/sccif.test, tests/core/sccsimpl.test,
tests/core/semidet.test, tests/core/sepsets.test,
tests/core/serial.test, tests/core/sim2.test, tests/core/sim3.test,
tests/core/sonf.test, tests/core/split.test, tests/core/spotlbtt.test,
tests/core/spotlbtt2.test, tests/core/streett.test,
tests/core/strength.test, tests/core/stutter-ltl.test,
tests/core/stutter-tgba.test, tests/core/sugar.test,
tests/core/syfco.test, tests/core/syntimpl.cc,
tests/core/syntimpl.test, tests/core/taatgba.cc,
tests/core/taatgba.test, tests/core/tgbagraph.test,
tests/core/tostring.cc, tests/core/tostring.test,
tests/core/tripprod.test, tests/core/trival.cc,
tests/core/trival.test, tests/core/tunabbrev.test,
tests/core/tunenoform.test, tests/core/twacube.cc,
tests/core/twacube.test, tests/core/twagraph.cc,
tests/core/unabbrevwm.test, tests/core/unambig.test,
tests/core/unambig2.test, tests/core/uniq.test, tests/core/utf8.test,
tests/core/uwrm.test, tests/core/wdba.test, tests/core/wdba2.test,
tests/ltsmin/check.test, tests/ltsmin/check2.test,
tests/ltsmin/check3.test, tests/ltsmin/finite.test,
tests/ltsmin/finite2.test, tests/ltsmin/finite3.test,
tests/ltsmin/kripke.test, tests/ltsmin/modelcheck.cc,
tests/ltsmin/testconvert.cc, tests/ltsmin/testconvert.test,
tests/python/298.py, tests/python/341.py, tests/python/471.py,
tests/python/acc.py, tests/python/accparse2.py, tests/python/aiger.py,
tests/python/alarm.py, tests/python/aliases.py,
tests/python/alternating.py, tests/python/bdddict.py,
tests/python/bdditer.py, tests/python/bddnqueen.py,
tests/python/bugdet.py, tests/python/complement_semidet.py,
tests/python/dbranch.py, tests/python/declenv.py,
tests/python/decompose_scc.py, tests/python/det.py,
tests/python/dualize.py, tests/python/ecfalse.py,
tests/python/except.py, tests/python/forq_contains.py,
tests/python/game.py, tests/python/gen.py, tests/python/genem.py,
tests/python/implies.py, tests/python/interdep.py,
tests/python/intrun.py, tests/python/kripke.py,
tests/python/langmap.py, tests/python/ltl2tgba.py,
tests/python/ltl2tgba.test, tests/python/ltlf.py,
tests/python/ltlparse.py, tests/python/ltlsimple.py,
tests/python/mealy.py, tests/python/merge.py,
tests/python/mergedge.py, tests/python/minato.py,
tests/python/misc-ec.py, tests/python/optionmap.py,
tests/python/origstate.py, tests/python/otfcrash.py,
tests/python/parity.py, tests/python/parsetgba.py,
tests/python/pdegen.py, tests/python/powerset.py,
tests/python/prodexpt.py, tests/python/randgen.py,
tests/python/relabel.py, tests/python/remfin.py,
tests/python/removeap.py, tests/python/rs_like.py,
tests/python/satmin.py, tests/python/sbacc.py,
tests/python/sccfilter.py, tests/python/sccinfo.py,
tests/python/sccsplit.py, tests/python/semidet.py,
tests/python/setacc.py, tests/python/setxor.py,
tests/python/simplacc.py, tests/python/simstate.py,
tests/python/sonf.py, tests/python/split.py,
tests/python/splitedge.py, tests/python/streett_totgba.py,
tests/python/streett_totgba2.py, tests/python/stutter.py,
tests/python/sum.py, tests/python/synthesis.py,
tests/python/toparity.py, tests/python/toweak.py,
tests/python/tra2tba.py, tests/python/trival.py,
tests/python/twagraph.py, tests/python/zlktree.py, tests/run.in,
tests/sanity/80columns.test, tests/sanity/bin.test,
tests/sanity/getenv.test, tests/sanity/includes.test,
tests/sanity/ipynb.pl, tests/sanity/namedprop.test,
tests/sanity/private.test, tests/sanity/readme.pl,
tests/sanity/style.test, tools/man2html.pl: Update all copyright
headers.
2023-11-18 21:50:32 +01:00
Alexandre Duret-Lutz
3be62a907c parity: don't change_parity to the same acceptance
Follow up to #552.

* spot/twaalgos/parity.cc (change_parity): Do not work if the output
is supposed to have the same acceptance as the input and 0 or 1
colors.
2023-11-17 23:20:18 +01:00
Alexandre Duret-Lutz
205df01390 never iterate on the edge_vector()
This fixes #552, reported by Rüdiger and Ayrat.

* tests/sanity/style.test: Warn aginst iterations on edge_vector.
* spot/parseaut/parseaut.yy, spot/twaalgos/complete.cc,
spot/twaalgos/parity.cc: Iterate over edges(), not edge_vector().
* tests/core/ltlcross.test: Add a test case for #552.
* NEWS: Mention the bug.
2023-11-17 22:23:47 +01:00
Alexandre Duret-Lutz
313e43c84b translate: fix #551
Reported by Yann Thierry-Mieg.

* spot/twaalgos/translate.cc: Run scc_filter if relabel_here reduced
the number of edges, because maybe we have more to remove.
* tests/core/ltl2tgba2.test: Add test case.
2023-11-17 17:28:00 +01:00
Alexandre Duret-Lutz
f0928f2b52 translate: fix relabel-overlap setting
* spot/twaalgos/translate.cc: Adjust the default relabel-overlap value
to match the doc.
2023-11-17 13:48:17 +01:00
Alexandre Duret-Lutz
0e71dd70c1 sccfilter: some inherently-weak automata should have t acceptance
* spot/twaalgos/sccfilter.cc: If an inherently-weak automaton has
no rejecting cycle, reduce its acceptance to t instead of Büchi.
* spot/twa/acc.hh (operator==, operator<): Fix comparisons of
true acceptances.
* NEWS: Mention these two changes.
* spot/twaalgos/sccfilter.hh: Update documentation.
* spot/twaalgos/determinize.cc (tgba_determinize): The call
to scc_filter assume that the input BA is never reduced to t
acceptance.  Call scc_filter with an extra option to ensure that.
* spot/twaalgos/postproc.cc (do_scc_filter): Adjust to add the
extra option when we want to build Büchi or coBuchi.
(ensure_ba): Don't mark trivial SCCs as accepting.
* tests/core/complement.test, tests/core/dstar.test,
tests/core/ltlsynt.test, tests/core/readsave.test,
tests/core/wdba2.test, tests/python/_product_susp.ipynb,
tests/python/automata-io.ipynb, tests/python/dualize.py,
tests/python/highlighting.ipynb, tests/python/intrun.py,
tests/python/setacc.py, tests/python/simstate.py,
tests/python/stutter-inv.ipynb, tests/python/zlktree.py: Adjust test
cases.
2023-11-17 13:41:19 +01:00
Alexandre Duret-Lutz
13377542cd autfilt: fix a typo in the --help output
* bin/common_aoutput.cc: Here.
* doc/org/autfilt.org: Adjust the documentation.
2023-11-16 10:52:55 +01:00
Alexandre Duret-Lutz
5ed56c054b ltsmin: make it easier to find the README
Fixes #550, reported by Daniel Stan.

* tests/ltsmin/README: Move...
* README.ltsmin: ... here.
* Makefile.am (EXTRA_DIST): Add README.ltsmin.
* README: Mention README.ltsmin.
* spot/ltsmin/spins_interface.cc: Mention README.ltsmin in the error
message.
* tests/ltsmin/check.test, tests/ltsmin/check3.test: Adjust reference
to README.
* NEWS: Mention this fix.
* THANKS: Add Danial.
2023-11-15 17:23:47 +01:00
Alexandre Duret-Lutz
b7995fcc5d * .gitlab-ci.yml (rpm-pkg): Start from the make-dist tarball. 2023-11-15 17:19:52 +01:00
Alexandre Duret-Lutz
35fca49075 parseaut: allow false edges to not be dropped
This is a followup to issue #548, which was caused by edges being
dropped.  In that context dropping edge was not really desirable, so
let's make this behavior configurable.

* spot/parseaut/public.hh: Add a new option.
* python/spot/__init__.py: Likewise.
* spot/parseaut/parseaut.yy: Honor that option.
* tests/python/parsetgba.py: Add a short test for it.
* NEWS: Mention it.
2023-11-15 11:15:32 +01:00
Alexandre Duret-Lutz
bed87c60a4 parseaut: update highlight-edges when edges are dropped/added
This fixes #548, reported by Dávid Smolka.

* spot/parseaut/parseaut.yy: Update the edge numbers in the
highlight-edges property.
* tests/core/highlightstate.test: Add test case.
* NEWS: Mention the bug.
2023-11-15 11:15:32 +01:00
Alexandre Duret-Lutz
b7a0a8c324 gfguarante: update citation
* spot/twaalgos/gfguarantee.hh: Properly cite the LICS'18 paper.
* doc/spot.bib: Add the entry.
2023-11-15 11:15:08 +01:00
Alexandre Duret-Lutz
997f7ec7fb gfguarantee: fix handling of true/false languages
Fixes #546 (again).

* spot/twaalgos/gfguarantee.cc (g_f_terminal_inplace): Detect
true/false languages early, so that we do not tag them as
non-inherently-weak.
* tests/core/ltlcross.test: Improve test case.
2023-11-14 16:52:12 +01:00
Alexandre Duret-Lutz
13f66e55af * tests/core/twacube.cc: Remove duplicate line. 2023-11-10 23:38:25 +01:00
Alexandre Duret-Lutz
5826a40063 add test case for issue #546
This, and the previous two patches, fixes issue #546.

* tests/core/ltlcross.test: Add a test case.
2023-11-10 23:38:25 +01:00
Alexandre Duret-Lutz
67b5d2aa9a fix several algorithms that incorrectly preserved !weak
This massive set of changes was triggered by issue #546.
In addition to the better handling of !weak, this also adds some
weak properties in a few places.

* spot/twaalgos/product.cc (product_aux): Throw some exception
if an automaton with t or f acceptance has the !weak property.  This
is a cheap sanity check to help detect algorithms that incorrectly
assumed !weak input would necessarily become !weak output.
* spot/twaalgos/hoa.cc (print_hoa): Likewise, also do not assume
that terminal implies very-weak.
* spot/parseaut/parseaut.yy: Add several diagnostics for similar
cases.  E.g., a one-state automaton cannot be declared as !very-weak.
* tests/core/parseaut.test: Check those new diagnostics.
* spot/twa/twa.cc (twa::intersecting_run): Temporary remove the weak
property by setting it to maybe, not to false.
* spot/twaalgos/minimize.cc, spot/twaalgos/parity.cc,
spot/twaalgos/sccfilter.cc, spot/twaalgos/simulation.cc: Account for
the fact that these algorithm may in fact improve the weakness.
* spot/twaalgos/strength.cc: Only look at colors used by the
acceptance condition when deciding weakness.
* spot/twaalgos/synthesis.cc: Declare the strategy as weak.
* bin/randaut.cc: Add weak to automata with t/f acceptance.
* spot/kripke/kripke.hh: Make kripke structures as weak.
* tests/core/acc_word.test, tests/core/alternating.test,
tests/core/complement.test, tests/core/complete.test,
tests/core/ltlsynt.test, tests/core/randomize.test,
tests/core/readsave.test, tests/core/remfin.test,
tests/core/sccsimpl.test, tests/core/strength.test,
tests/core/wdba2.test, tests/ltsmin/kripke.test,
tests/python/automata-io.ipynb, tests/python/automata.ipynb,
tests/python/dbranch.py, tests/python/highlighting.ipynb,
tests/python/kripke.py, tests/python/ltsmin-dve.ipynb,
tests/python/mealy.py, tests/python/simstate.py: Adjust all these test
cases.
* NEWS: Mention the fixes.
2023-11-10 23:38:25 +01:00
Alexandre Duret-Lutz
ac05035267 product_susp: fix handling of unsatisfiable/universal acceptances
Part of issue #546 reported by Rüdiger Ehlers

* spot/twaalgos/product.cc (product_susp): Fix detection and handling
of unsatisfiable/universal acceptances.
* tests/python/_product_susp.ipynb: Add test cases.
2023-11-10 23:38:25 +01:00
Florian Renkin
127cb89cad Remove binary integer literals
Remove this notation because Swig only supports it since version 4.0.0,
whereas Spot requires a version greater than or equal to 3.0.2.

* spot/tl/apcollect.hh: Here.
2023-11-08 10:05:54 +01:00
Alexandre Duret-Lutz
9bdc500013 powerset: speedup computation for singleton with single edge
* spot/twaalgos/powerset.cc: Here.
2023-11-03 10:15:24 +01:00
Alexandre Duret-Lutz
75f3a5f2c5 Fix warnings with GCC 7 on Centos 7
* spot/twa/twagraph.cc: Mark two variables as unused.
* spot/twaalgos/aiger.cc: Avoid spurious nullptr dereference warning,
and mark more variable as unused.
* spot/twaalgos/forq_contains.cc (word::operator==): Mark as
maybe_unused.
* bin/ltlsynt.cc, spot/twaalgos/relabel.cc,
spot/twaalgos/mealy_machine.cc, spot/twaalgos/synthesis.cc,
spot/twaalgos/zlktree.cc: Avoid unused variables warnings.
* spot/twaalgos/toparity.cc: Remove uses of std::optional, they were
not necessary, and they trigger spurious warnings in GCC 7.  Also
work around a spurious "potential nullptr deref".
* tests/core/twacube.cc: Fix another potential nullptr warning.
* spot/twaalgos/simulation.cc: Work a around GCC 6/7 bug.
2023-11-03 10:14:34 +01:00
Alexandre Duret-Lutz
1a2746e182 sbacc: ignore false edges and unreachable states
* spot/twaalgos/sbacc.cc: Here.
2023-10-12 16:06:00 +02:00
Alexandre Duret-Lutz
f2d034130a introduce realizability_simplifier to share more of ltlsynt's code
* spot/tl/apcollect.hh,
spot/tl/apcollect.cc (realizability_simplifier): New class, built from
code existing in ltlsynt, so that other tools may use this too.
* bin/ltlsynt.cc: Use realizability_simplifier.
* spot/twaalgos/aiger.cc, spot/twaalgos/aiger.hh: Adjust to use
realizability_simplifier instead of relabeling_map.
* NEWS: Mention the new class.
2023-10-09 17:53:12 +02:00
Alexandre Duret-Lutz
9e40a32fd1 * .gitlab-ci.yml: Add a centos7 build. 2023-10-05 13:56:45 +02:00
Alexandre Duret-Lutz
02f9f0a1c9 * .gitlab-ci.yml: Activate Raspbian again. 2023-10-03 16:25:19 +02:00
Alexandre Duret-Lutz
9bf1edd80d ltlsynt: add option --global-equivalence
Fixes issue #529.

* spot/tl/apcollect.hh,
spot/tl/apcollect.cc (collect_equivalent_literals): New function.
* python/spot/impl.i: Adjust.
* spot/tl/formula.hh,
spot/tl/formula.cc (formula_ptr_less_than_bool_first): New comparison
function.
* spot/twaalgos/aiger.hh, spot/twaalgos/aiger.cc: Adjust to deal
with equivalent assignments.
* bin/ltlsynt.cc: Implement the new option.
* tests/core/ltlsynt.test: Adjust test cases.
2023-10-03 09:21:55 +02:00
Alexandre Duret-Lutz
c016f561fa sccinfo: implement PROCESS_UNREACHABLE_STATES
This is actually used by next patch.

* spot/twaalgos/sccinfo.cc, spot/twaalgos/sccinfo.hh: Here.
* tests/python/sccinfo.py: Add a small test case.
* NEWS: Mention it.
2023-10-02 14:19:53 +02:00
Alexandre Duret-Lutz
70812046d2 ltlsynt: do a fixpoint around the polarity simplifications
* bin/ltlsynt.cc: Here.
* tests/core/ltlsynt.test: Adjust.
2023-10-02 14:19:53 +02:00
Florian Renkin
6dc11b4715 notebooks: correction of typos
* tests/python/_partitioned_relabel.ipynb,
  tests/python/_product_weak.ipynb,
  tests/python/acc_cond.ipynb,
  tests/python/aliases.ipynb,
  tests/python/automata.ipynb,
  tests/python/cav22-figs.ipynb,
  tests/python/contains.ipynb,
  tests/python/decompose.ipynb,
  tests/python/formulas.ipynb,
  tests/python/games.ipynb,
  tests/python/highlighting.ipynb,
  tests/python/ltsmin-dve.ipynb,
  tests/python/parity.ipynb,
  tests/python/product.ipynb,
  tests/python/satmin.ipynb,
  tests/python/stutter-inv.ipynb,
  tests/python/synthesis.ipynb,
  tests/python/twagraph-internals.ipynb,
  tests/python/word.ipynb,
  tests/python/zlktree.ipynb: here
2023-09-26 11:56:26 +02:00
Alexandre Duret-Lutz
858629dd3a twagraph: fix merge_states() on automata without edges
This corner case was simply causing segfaults.

* tests/python/mergedge.py: Add a test case.
* spot/twa/twagraph.cc (merge_states): Add special handling for
the case where the automaton has no edges.
2023-09-20 00:02:29 +02:00
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
abca0f7fd9 * spot/tl/formula.hh: Typo in comment. 2023-09-15 11:25:48 +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
6eff384fca forq: remove the relevance test
Looks like the comparison operator between std::set<std::pair<state,
bool>> and std::set<state> had a few issue.  This is part of an
optimization that Pierre Ganty prefers to see removed, so I'm just
removing that code.

For reference, changing the removed operator<= to the following
also seem to fix all tests.

  static bool operator<=(std::set<std::pair<state, bool>> const& f,
                         state_set const& set)
  {
    auto first1 = set.begin(), last1 = set.end();
    auto first2 = f.begin(), last2 = f.end();
    for (; first2 != last2; ++first1)
      if (first1 == last1 || first2->first < *first1)
        {
          return false;
        }
      else if (first2->first == *first1)
        {
          ++first2;
          // Some states of f may appear twice because of the attached
          // Boolean.
          if (first2 != last2 && first2->first == *first1)
            ++first2;
        }
    return true;
  }

* spot/twaalgos/forq_contains.cc: Remove relevance-based optimization.
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
Alexandre Duret-Lutz
3861c04581 forq: fix Buchi acceptance test
* spot/twa/twa.cc: Here.
* spot/twaalgos/forq_contains.cc: And there.  Also simplify the
handling code by simply throwing the exception when the error is
detected.
2023-09-13 15:48:17 +02:00
Alexandre Duret-Lutz
28a6471efb forq: fix bib entry and bind the doxygen doc to a group
* doc/spot.bib: Reformat the FORQ reference in the style of the
rest of the bibliographic file.
* spot/twaalgos/forq_contains.hh: Adjust, and add missing \ingroup.
2023-09-13 15:48:17 +02:00
Jonah Romero
ad22eb3e65 add enviroment variables for FORQ algorithm
* AUTHORS: added Jonah Romero
* bin/man/spot-x.x: Added the enviroment variables,
                    SPOT_EXCLUSIVE_WORD and SPOT_CONTAINMENT_CHECK
* doc/spot.bib: Added paper citation for FORQ inclusion algorithm
* spot/twa/twa.cc: Modified exclusive_word to also use FORQ
* spot/twaalgos/contains.cc: Modified contains to also use FORQ
2023-09-13 15:48:17 +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
d96796121a replace sprintf by snprintf
This was reported by Pierre Ganty, who said that sprintf is reported
as deprecated on MacOS 13.5.2 (22G91).

* spot/twa/acc.cc, spot/twaalgos/aiger.cc: Here.
2023-09-13 15:39:36 +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
538afeb73b * spot/twaalgos/aiger.hh: Add missing include. 2023-09-08 11:37:47 +02:00
Alexandre Duret-Lutz
e2149fabf4 determinize: work around overflow in reachability matrix indices
Fixes #541, reported by David Dokoupil.

* spot/twaalgos/determinize.cc: Disable use_simulation when the input
has more than 2^16 SCCs..  Also rework the reachability
matrix to store only its lower half triangle.
* spot/twaalgos/determinize.hh, NEWS: Mention the limitation of
use_simulation.
* THANKS: Add David.
2023-09-05 09:12:15 +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
93ded57e52 Merge branch 'master' into next 2023-08-01 14:26:35 +02:00
Alexandre Duret-Lutz
41751b80a1 * NEWS, configure.ac: Bump version to 2.11.6.dev. 2023-08-01 14:22:32 +02:00
Alexandre Duret-Lutz
f4b397a2bf Release Spot 2.11.6
* NEWS, configure.ac, doc/org/setup.org: Update version.
2023-08-01 12:19:47 +02:00
Alexandre Duret-Lutz
bb95705d52 mention the bug fixed in BuDDy
* NEWS: Explain the bug fixed in previous patch and reported in
issue #535.
* THANKS: Add Guillermo.
2023-08-01 11:12:49 +02:00
Alexandre Duret-Lutz
e37bc9e1ae [buddy] fix cache index of bdd_forall
Fix a 20 year old typo that caused a bug reported by Guillermo Perez.

* src/bddop.c (bdd_forall, bdd_forallcomp): Fix the cache index.
2023-08-01 11:12:49 +02:00
Alexandre Duret-Lutz
de7d5a956f * .gitlab-ci.yml: temporary disable raspbian. 2023-08-01 11:12:49 +02:00
Alexandre Duret-Lutz
44d9e34e32 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-08-01 11:12:49 +02:00
Alexandre Duret-Lutz
15857385a5 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-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
3d412fbb78 tests: add some test to cover autcross' univ-edges removal
* tests/core/ltl3ba.test: Here.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
531252119c 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-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
e548bf0a8e acc: remove some dead functions
* spot/twa/acc.hh, spot/twa/acc.cc (has_parity_prefix,
is_parity_max_equiv): Remove.
* spot/twa/acc.hh, spot/twa/twagraph.cc,
spot/twa/twagraph.hh (apply_permutation): Remove.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
69b9ffef9a bin: fix handling for --output & --format with LTL outputs
* bin/common_output.cc: Set the output stream for LTL formats.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
8065759fbd * HACKING: Mention the svgo version we use. 2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
090dcf17eb 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-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
bd1809f758 bin: handle thousands of output files
Fixes #534.  Test case is only on next branch.

* 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.
* NEWS: Mention the issue.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
adca03a30a * tests/core/ltlcross4.test: Work around recent Pandas change. 2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
47674c0d2f 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-08-01 10:51:33 +02:00
Florian Renkin
330b34e84d 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-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
75bd595d28 bitvect: work around incorrect warning from gcc
* spot/misc/bitvect.hh: Don't free the old ptr if realloc() returns
NULL, as this confuse GCC who warns that we are freeing something that
has already been freed.   Instead, let the ~bitvect() destructor
handle this.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
9c6fa4921b debian: add missing build dependencies
* debian/control: Add Build-Depends on graphviz, jupyter-nbconvert,
doxygen.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
2495004afd avoid a g++-12 warning about potential null pointer dereference
* spot/twaalgos/determinize.cc (sorted_nodes): Rewrite to
avoid reallocation of temporary vector.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
16373cfb10 Work around spurious g++-12 warnings
* spot/twaalgos/ltl2tgba_fm.cc, spot/tl/formula.hh,
spot/twaalgos/translate.cc: Add SPOT_ASSUME in various places to help
g++.
2023-08-01 10:51:33 +02:00
Alexandre Duret-Lutz
69d9b78a55 mention the bug fixed in BuDDy
* NEWS: Explain the bug fixed in previous patch and reported in
issue #535.
* THANKS: Add Guillermo.
2023-08-01 09:19:03 +02:00
Alexandre Duret-Lutz
d58b7da562 [buddy] fix cache index of bdd_forall
Fix a 20 year old typo that caused a bug reported by Guillermo Perez.

* src/bddop.c (bdd_forall, bdd_forallcomp): Fix the cache index.
2023-07-31 21:07:07 +02:00
Alexandre Duret-Lutz
e3e50672b5 * .gitlab-ci.yml: temporary disable raspbian. 2023-07-28 16:20:18 +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
37325f1942 acc: remove some dead functions
* spot/twa/acc.hh, spot/twa/acc.cc (has_parity_prefix,
is_parity_max_equiv): Remove.
* spot/twa/acc.hh, spot/twa/twagraph.cc,
spot/twa/twagraph.hh (apply_permutation): Remove.
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
7f1a33cc61 * HACKING: Mention the svgo version we use. 2023-07-26 16:19:35 +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
3b59240133 gen: generalize fin_unit to mafins()
Based on work with Jan Strejček.

* spot/twa/acc.cc, spot/twa/acc.hh (acc_cond::mafins,
acc_cond::acc_code::mafins): New methods.
(fin_unit_one_split, fin_unit_one_split_improved): Use mafins()
instead on fin_unit().
* spot/twaalgos/genem.cc: Use mafins() instead on fin_unit().
2023-07-25 16:44:21 +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
abe7222973 bitvect: work around incorrect warning from gcc
* spot/misc/bitvect.hh: Don't free the old ptr if realloc() returns
NULL, as this confuse GCC who warns that we are freeing something that
has already been freed.   Instead, let the ~bitvect() destructor
handle this.
2023-05-15 09:43:46 +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
747ec8b1c5 debian: add missing build dependencies
* debian/control: Add Build-Depends on graphviz, jupyter-nbconvert,
doxygen.
2023-05-15 09:43:43 +02:00
Alexandre Duret-Lutz
b487ff4190 Merge branch 'master' into next 2023-04-20 09:50:23 +02:00
Alexandre Duret-Lutz
d0ae0dfc38 * NEWS, configure.ac: Bump version to 2.11.5.dev. 2023-04-20 09:48:22 +02:00
Alexandre Duret-Lutz
b6c076ce19 release Spot 2.11.5
* NEWS, configure.ac, doc/org/setup.org: Update version.
2023-04-20 09:45:41 +02:00
Alexandre Duret-Lutz
184aa9931e org: replace version references with org-babel blocks
This way we have fewer lines to edit multiple when making releases.

* doc/org/index.org, doc/org/init.el.in, doc/org/install.org,
doc/org/setup.org, doc/org/tools.org: Use org-babel instead of macros
for release version and links.
2023-04-19 09:07:02 +02:00
Alexandre Duret-Lutz
eb80f5d5af 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-19 09:06:58 +02:00
Alexandre Duret-Lutz
eb0f40b9d6 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-19 09:06:55 +02:00
Philipp Schlehuber-Caissier
993695a2c4 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-04-19 09:06:25 +02:00
Alexandre Duret-Lutz
0c8093eded correctly fails if emacs needed and missing
Fixes #528.

* configure.ac: Define EMACS using tools/missing.
* NEWS: Mention the bug.
2023-04-19 09:06:01 +02:00
Alexandre Duret-Lutz
646b6e546f 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-04-19 09:05:42 +02:00
Alexandre Duret-Lutz
1a0b1f235d * doc/tl/tl.tex: Typo in firstmatch semantics. 2023-04-19 09:04:16 +02:00
Philipp Schlehuber
5714ecce32 Ignore ltargz.m4
* .gitignore: Ignore it
* m4/ltargz.m4: Remove it
2023-04-19 09:04:11 +02:00
Alexandre Duret-Lutz
dcd4759896 org: fix rendering of R examples for recent ESS/Org
* doc/org/.dir-locals.el.in, doc/org/init.el.in: Newer ESS version
need to be taught to use default-directory instead of the project
directory.
* doc/org/ltlcross.org: Use "result file" to render the output.
2023-04-19 09:04:07 +02:00
Alexandre Duret-Lutz
a146457ea1 * doc/org/tut03.org: Typos. 2023-04-19 09:04:02 +02:00
Alexandre Duret-Lutz
d3013b072d org: do not require org-install
org-install has been obsolete for a long time, and has been removed
from Org 9.6.

* doc/org/init.el.in: Remove org-install.
2023-04-19 09:03:53 +02:00
Alexandre Duret-Lutz
c12b0622b4 org: replace version references with org-babel blocks
This way we have fewer lines to edit multiple when making releases.

* doc/org/index.org, doc/org/init.el.in, doc/org/install.org,
doc/org/setup.org, doc/org/tools.org: Use org-babel instead of macros
for release version and links.
2023-04-18 22:18:16 +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
0c34152a33 correctly fails if emacs needed and missing
Fixes #528.

* configure.ac: Define EMACS using tools/missing.
* NEWS: Mention the bug.
2023-03-29 17:01:13 +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
Alexandre Duret-Lutz
7a97a6080c * doc/tl/tl.tex: Typo in firstmatch semantics. 2023-03-29 16:16:06 +02:00
Philipp Schlehuber
7a91cf78ec Ignore ltargz.m4
* .gitignore: Ignore it
* m4/ltargz.m4: Remove it
2023-03-23 09:02:32 +01: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
146942953a org: fix rendering of R examples for recent ESS/Org
* doc/org/.dir-locals.el.in, doc/org/init.el.in: Newer ESS version
need to be taught to use default-directory instead of the project
directory.
* doc/org/ltlcross.org: Use "result file" to render the output.
2023-03-03 15:36:31 +01:00
Alexandre Duret-Lutz
f117159ec4 * doc/org/tut03.org: Typos. 2023-02-24 11:26:12 +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
8a5b86521c * NEWS: Remove duplicate entries. 2023-02-16 17:48:49 +01:00
Alexandre Duret-Lutz
4bd023e515 org: do not require org-install
org-install has been obsolete for a long time, and has been removed
from Org 9.6.

* doc/org/init.el.in: Remove org-install.
2023-02-16 17:46:51 +01:00
Alexandre Duret-Lutz
e16d82d5bd Merge branch 'master' into next 2023-02-10 08:53:17 +01:00
Alexandre Duret-Lutz
e44cb5152a Bump version to 2.11.4.dev
* NEWS, configure.ac: Here.
2023-02-10 08:51:29 +01:00
Alexandre Duret-Lutz
50a58254a7 Release spot 2.11.4
* NEWS, configure.ac, doc/org/setup.org: Update version.
2023-02-10 08:49:26 +01:00
Alexandre Duret-Lutz
6fd0eebad4 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 23:13:25 +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
058975c167 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-05 14:59:50 +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
5969aa4925 work around gcc-snapshot warnings about dangling references
* spot/twaalgos/game.hh, spot/twaalgos/game.cc (get_state_players,
get_strategy, get_state_winners): Take argument by reference, not
copy.
* spot/twaalgos/synthesis.cc, spot/twaalgos/mealy_machine.cc: Replace
auto by actual type for readability.
2023-01-31 17:55:51 +01:00
Alexandre Duret-Lutz
2666072867 * .gitlab-ci.yml: Use pipeline id to name volumes. 2023-01-31 17:55:51 +01:00
Alexandre Duret-Lutz
126d9bc103 bin: fix number conversion routines on 32bit
On 32bit archetectures, long int = int the current check for detecting
values that overflow int will fail.  Conversion routings should check
errno.

* bin/common_conv.cc, bin/common_range.cc: Here.
2023-01-31 17:55:51 +01:00
Alexandre Duret-Lutz
a1c02856ac 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-31 17:55:51 +01:00
Florian Renkin
315872a54b ltlsynt: typo in doc
* bin/ltlsynt.cc: here
2023-01-31 17:55:51 +01:00
Alexandre Duret-Lutz
9ca2927291 bin: update copyright year and laboratory name
* bin/common_setup.cc: Here.
2023-01-31 17:55:51 +01:00
Alexandre Duret-Lutz
eae91e97cd robin_hood: update to version version 3.11.5
* spot/priv/robin_hood.hh: Update.
* spot/priv/Makefile.am: Patch ROBIN_HOOD_IS_TRIVIALLY_COPYABLE to
work around an issue with clang on Arch linux.
2023-01-31 17:55:51 +01:00
Alexandre Duret-Lutz
7e1d684797 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-31 17:55:51 +01:00
Alexandre Duret-Lutz
39212bbcd2 more code smells
* bin/common_file.cc, bin/common_file.hh, bin/common_finput.cc,
bin/common_finput.hh, bin/common_output.cc, bin/common_setup.cc,
bin/common_setup.hh, bin/common_trans.cc, bin/common_trans.hh,
bin/dstar2tgba.cc, bin/genaut.cc, bin/genltl.cc, bin/ltl2tgba.cc,
bin/ltl2tgta.cc, bin/ltlcross.cc, bin/ltldo.cc, bin/ltlfilt.cc,
bin/ltlsynt.cc, bin/randltl.cc: Fix minor code issues reported by
sonarcloud.
2023-01-31 17:51:18 +01:00
Alexandre Duret-Lutz
7b0507a950 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-31 17:51:18 +01:00
Alexandre Duret-Lutz
4a78d1bff4 fix some code smells reported by sonarcloud
* bench/dtgbasat/gen.py, bin/autcross.cc, bin/autfilt.cc,
bin/common_aoutput.cc, bin/common_aoutput.hh: Various cleanups.
2023-01-31 17:51:18 +01:00
Alexandre Duret-Lutz
36e79ecca6 * spot/twaalgos/game.cc: Fix incorrect std::forward. 2023-01-31 17:51:18 +01:00
Alexandre Duret-Lutz
344d82f2b4 simplify several comparison operators
* spot/twaalgos/dtbasat.cc, spot/twaalgos/dtwasat.cc,
spot/twaalgos/simulation.cc: Simplify, as reported by sonarcloud.
2023-01-31 17:51:18 +01:00
Alexandre Duret-Lutz
403e55d555 * doc/org/spot.css: Do not define background twice. 2023-01-31 17:51:18 +01:00
Alexandre Duret-Lutz
104e98aca6 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-31 17:51:18 +01:00
Alexandre Duret-Lutz
cab3ea7faf 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.
2023-01-31 17:51:18 +01:00
Alexandre Duret-Lutz
bdaa31ef21 work around gcc-snapshot warnings about dangling references
* spot/twaalgos/game.hh, spot/twaalgos/game.cc (get_state_players,
get_strategy, get_state_winners): Take argument by reference, not
copy.
* spot/twaalgos/synthesis.cc, spot/twaalgos/mealy_machine.cc: Replace
auto by actual type for readability.
2023-01-31 14:29:40 +01:00
Alexandre Duret-Lutz
d16183c053 * .gitlab-ci.yml: Use pipeline id to name volumes. 2023-01-25 08:36:40 +01:00
Alexandre Duret-Lutz
121d5e5524 bin: fix number conversion routines on 32bit
On 32bit archetectures, long int = int the current check for detecting
values that overflow int will fail.  Conversion routings should check
errno.

* bin/common_conv.cc, bin/common_range.cc: Here.
2023-01-25 08:36:27 +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
Florian Renkin
5b0143eba6 ltlsynt: typo in doc
* bin/ltlsynt.cc: here
2023-01-23 16:35:16 +01:00
Alexandre Duret-Lutz
60abfeb31f bin: update copyright year and laboratory name
* bin/common_setup.cc: Here.
2023-01-23 16:07:49 +01:00
Alexandre Duret-Lutz
3aba452b5b robin_hood: update to version version 3.11.5
* spot/priv/robin_hood.hh: Update.
* spot/priv/Makefile.am: Patch ROBIN_HOOD_IS_TRIVIALLY_COPYABLE to
work around an issue with clang on Arch linux.
2023-01-23 15:25:06 +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
09bbaa1e41 more code smells
* bin/common_file.cc, bin/common_file.hh, bin/common_finput.cc,
bin/common_finput.hh, bin/common_output.cc, bin/common_setup.cc,
bin/common_setup.hh, bin/common_trans.cc, bin/common_trans.hh,
bin/dstar2tgba.cc, bin/genaut.cc, bin/genltl.cc, bin/ltl2tgba.cc,
bin/ltl2tgta.cc, bin/ltlcross.cc, bin/ltldo.cc, bin/ltlfilt.cc,
bin/ltlsynt.cc, bin/randltl.cc: Fix minor code issues reported by
sonarcloud.
2023-01-10 21:53:40 +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
05edab3f5a fix some code smells reported by sonarcloud
* bench/dtgbasat/gen.py, bin/autcross.cc, bin/autfilt.cc,
bin/common_aoutput.cc, bin/common_aoutput.hh: Various cleanups.
2023-01-06 10:12:50 +01:00
Alexandre Duret-Lutz
716bb781eb * spot/twaalgos/game.cc: Fix incorrect std::forward. 2023-01-05 17:51:01 +01:00
Alexandre Duret-Lutz
2ba6fba29f simplify several comparison operators
* spot/twaalgos/dtbasat.cc, spot/twaalgos/dtwasat.cc,
spot/twaalgos/simulation.cc: Simplify, as reported by sonarcloud.
2023-01-05 17:50:37 +01:00
Alexandre Duret-Lutz
16ad7bdf77 * doc/org/spot.css: Do not define background twice. 2023-01-05 17:47:46 +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
c9ba998200 avoid a g++-12 warning about potential null pointer dereference
* spot/twaalgos/determinize.cc (sorted_nodes): Rewrite to
avoid reallocation of temporary vector.
2022-12-10 22:18:18 +00: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
427f667f9f lazy eval for sat mealy minimization
Evaluate incomp of player conditions only if necessary

* spot/twaalgos/mealy_machine.cc: Here
2022-12-09 17:00:52 +01: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
b02d8328ee Merge branch 'master' into next 2022-12-09 09:45:01 +01:00
Alexandre Duret-Lutz
09e147ee4b * NEWS, configure.ac: Bump version to 2.11.3.dev. 2022-12-09 09:43:18 +01:00
Alexandre Duret-Lutz
d7feeca13e Release Spot 2.11.3
* NEWS, configure.ac, doc/org/setup.org: Bump version to 2.11.3.
2022-12-09 09:40:27 +01:00
Alexandre Duret-Lutz
1248d326aa Work around spurious g++-12 warnings
* spot/twaalgos/ltl2tgba_fm.cc, spot/tl/formula.hh,
spot/twaalgos/translate.cc: Add SPOT_ASSUME in various places to help
g++.
2022-12-09 09:30:10 +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
Alexandre Duret-Lutz
8ed9e3381f formula: introduce one_plus(), and saturate predefined formulas
* spot/tl/formula.hh, spot/tl/formula.cc (one_plus): New.
(fnode): Add a saturated argument.
(tt_, ff_, eword_, one_plus, one_star): Create saturated node.
(destroy): Do not check for id() < 3.
2022-12-09 09:29:46 +01:00
Alexandre Duret-Lutz
4629d074ab Fix semantics of [*i..j] and [:*i..j]
* doc/tl/tl.tex: After a discussion with Antoin, it appears that the
semantics previously given for f[*0..j] was not considering that f[*0]
should accept any sequence of one letter.
2022-12-07 11:26:51 +01:00
Alexandre Duret-Lutz
5dbf601afb * NEWS: Typos. 2022-12-06 16:07:21 +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
6b70edabf0 getopt: do not include sys/cdefs.h to please Alpine Linux
* m4/getopt.m4: Pretend sys/cdefs.h is missing, so that Alpine linux
does not output a warning which we would turn into an error.
2022-12-02 17:30:29 +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
cfe1b0b70d configure: --with-pythondir should also override pyexecdir
Fixes #512.

* configure.ac: Here.
* NEWS: Mention the bug.
2022-11-17 11:14:32 +01:00
Alexandre Duret-Lutz
c2a3f2941d ltl_to_tgba_fm: fix a memory leak on abort
This issue surfaced in twacube.test after the previous patches.

* spot/twaalgos/ltl2tgba_fm.cc: Release the formula namer on abort.
* NEWS: Mention the bug.
2022-11-15 17:50:45 +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
a6c65dff8d misc Doxygen fixes
* spot/misc/satsolver.hh, spot/tl/formula.hh, spot/twaalgos/hoa.hh,
spot/twaalgos/synthesis.hh, spot/twaalgos/zlktree.hh,
spot/twacube_algos/convert.hh: Typos in Doxygen comments.
2022-11-10 17:08:30 +01:00
Alexandre Duret-Lutz
0f4f7ec287 * debian/copyright: Fix download URL. 2022-11-10 17:08:30 +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
Alexandre Duret-Lutz
5c5133348e mealy: improve error reporting
* spot/twaalgos/mealy_machine.cc: Add more exceptions.
* tests/python/except.py: Test them.
2022-11-07 09:07:31 +01:00
Alexandre Duret-Lutz
fafe40c530 fix namespace for exception errors
* spot/priv/satcommon.cc, spot/twaalgos/dtbasat.cc,
spot/twaalgos/dtwasat.cc: When setting exception on std::ofstream, use
ofstream::failbit and ofstream::badbit instead of ifstream::failbit
and ifstream::badbit.
2022-11-04 18:21:13 +01:00
Alexandre Duret-Lutz
17a959aa29 Bump version to 2.11.2.dev
* NEWS, configure.ac: Here.
2022-10-26 11:24:20 +02:00
Alexandre Duret-Lutz
66aaa11580 Release Spot 2.11.2
* NEWS, configure.ac, doc/org/setup.org: Bump version to 2.11.2.
2022-10-26 11:15:39 +02:00
Alexandre Duret-Lutz
c312a05bbd do not use id for animating the logo
because we remove ids using svgo...

* doc/org/spot2.svg, doc/org/spot.css: Animate the verison using a
class.
2022-10-26 10:04:48 +02:00
Alexandre Duret-Lutz
0a710eb995 declare all argp_program_doc as static
* bench/stutter/stutter_invariance_formulas.cc, bin/autcross.cc,
bin/autfilt.cc, bin/dstar2tgba.cc, bin/genaut.cc, bin/genltl.cc,
bin/ltl2tgba.cc, bin/ltl2tgta.cc, bin/ltlcross.cc, bin/ltldo.cc,
bin/ltlfilt.cc, bin/ltlsynt.cc, bin/randaut.cc, bin/randltl.cc,
bin/spot-x.cc, bin/spot.cc, tests/ltsmin/modelcheck.cc: Here.
2022-10-25 16:31:35 +02:00
Alexandre Duret-Lutz
65bc67f300 relabel_here: make sure free_bddpair is called
* spot/twaalgos/relabel.cc (relabel_here): This function has multiple
exit paths, and none of them were calling bdd_freepair.  Use a
unique_ptr to ensure that.
2022-10-25 11:53:05 +02:00
Alexandre Duret-Lutz
0ecc870a0e [buddy] Add a default_deleter for bddPair
* src/bddx.h (std::default_deleter<bddPair>): Here.
2022-10-25 11:52:03 +02:00
Alexandre Duret-Lutz
0ba6949f7d use bdd_restrict more
Doing so reduced the number of GC passes tested in bdd.test, which is
good.

* spot/twaalgos/ltl2tgba_fm.cc: Simplify minato loops with
bdd_restrict.
* spot/twaalgos/synthesis.cc (split_2step): Use bdd_restrict instead
of bdd_appex.
* tests/core/bdd.test, tests/core/ltlf.test: Adjust test cases.
2022-10-25 10:16:20 +02:00
Alexandre Duret-Lutz
de29ba9e4c stats: add options to count unreachable states and transitions
Based on a request from Pierre Ganty.

* spot/twaalgos/stats.cc, spot/twaalgos/stats.hh,
bin/common_aoutput.cc, bin/common_aoutput.hh: Implement those
options.
* tests/core/format.test: Add test case.
* doc/org/autfilt.org: Update doc.
* NEWS: Mention them.
2022-10-19 17:10:37 +02:00
Alexandre Duret-Lutz
52ed3d1e8f * bin/common_aoutput.cc: Missing space in doc string. 2022-10-19 14:54:34 +02:00
Alexandre Duret-Lutz
c4a33d3457 add a .mailmap for git
* .mailmap: New file, to fix email inconsistencies.
2022-10-18 17:34:13 +02:00
Alexandre Duret-Lutz
67722db78f reduce_parity: expose the internal vectors of colors
* spot/twaalgos/parity.cc, spot/twaalgos/parity.hh: Add a
reduce_parity_data class for access to the vectors of colors
computed by reduce_parity.
* python/spot/impl.i: Add bindings for std::vector<int>.
2022-10-17 15:42:45 +02:00
Alexandre Duret-Lutz
b0c299b9e9 reduce_parity: add layered option
* spot/twaalgos/parity.cc: Implement it.
* spot/twaalgos/parity.hh, NEWS: Document it.
* tests/python/parity.ipynb: Demonstrate it.  This is the only test so
far, but more uses are coming.
2022-10-17 15:42:45 +02:00
Alexandre Duret-Lutz
eb2616efaa * .gitlab-ci.yml (debian-unstable-gcc-coverage): Disable devel mode. 2022-10-14 09:45:23 +02:00
Alexandre Duret-Lutz
179672fe3b relabel: fix handling of concat and fusion
* spot/tl/relabel.cc (formula_to_fgraph): Do not assume that n-ary
operators are Boolean operators.
* tests/python/relabel.py: Add a test case found while discussing
some expression with Antoine Martin.
* NEWS: Mention it.
2022-10-13 11:39:10 +02:00
Alexandre Duret-Lutz
666d78d499 * doc/org/init.el.in: Typo in comment. 2022-10-13 11:22:14 +02:00
Alexandre Duret-Lutz
7f6e3c2bf8 * NEWS: Add news entry for previous fix. 2022-10-13 11:21:50 +02:00
Alexandre Duret-Lutz
da356f1142 substitute @LIBSPOT_PTHREAD@ in spot/libspot.pc
Fixes #520, reported by Fangyi Zhou.

* spot/Makefile.am (libspot.pc): Substitute @LIBSPOT_PTHREAD@.
* THANKS: Add Fangyi Zhou.
2022-10-11 15:37:34 +02:00
Alexandre Duret-Lutz
bfb8f0a078 * .gitlab-ci.yml: Fail if coverage goes below 90.7%. 2022-10-11 15:06:54 +02:00
Alexandre Duret-Lutz
dae46567e7 org: work around newer org-mode not displaying SVG as <object>
* doc/org/init.el.in (spot-svg-output-as-object): New function.
2022-10-11 14:54:24 +02:00
Alexandre Duret-Lutz
9de5455552 fix some typos
* spot/graph/graph.hh, spot/ltsmin/spins_kripke.hxx,
spot/mc/bloemen.hh, spot/mc/lpar13.hh, spot/twaalgos/determinize.cc:
Here.
2022-10-11 13:28:15 +02:00
Alexandre Duret-Lutz
583ca38d91 replace bdd_relprod by bdd_restrict
* spot/twaalgos/alternation.cc, spot/twaalgos/dualize.cc,
spot/twaalgos/simulation.cc, spot/twaalgos/toweak.cc: Here.
2022-10-11 10:43:27 +02:00
Alexandre Duret-Lutz
548f3d7663 * NEWS, configure.ac: Bump version to 2.11.1.dev. 2022-10-10 14:15:23 +02:00
Alexandre Duret-Lutz
c2bbb3fd00 Release Spot 2.11.1
* NEWS, configure.ac, doc/org/setup.org: Update.
2022-10-10 14:13:42 +02:00
Alexandre Duret-Lutz
55e4d340fe CI: fix upload of stable Debian packages for amd64
This prevented the Spot website to regenerate.
Should fix #516 once we release 2.11.1.

* .gitlab-ci.yml (publish-stable): Upload changes for amd64 and i386,
not just the later.
2022-10-10 10:42:40 +02:00
Alexandre Duret-Lutz
d0c296e1cf org: mention "make check" and the new GPG key
Fixes #515.

* doc/org/install.org: Here.
2022-10-10 10:06:25 +02:00
Alexandre Duret-Lutz
2c13b299b8 hoa: add missing include
Fixes #515, reported by Yuri Victorovich.

* spot/twaalgos/hoa.hh: Include <unordered_map>.
2022-10-10 10:00:38 +02:00
Alexandre Duret-Lutz
db79d5a79e * NEWS, configure.ac: Bump version to 2.11.0.dev. 2022-10-08 21:05:04 +02:00
Alexandre Duret-Lutz
8131fae1a6 Release Spot 2.11
* NEWS, configure.ac, doc/org/setup.org: Update version.
2022-10-08 20:59:27 +02:00
Alexandre Duret-Lutz
1a5b5602db * .gitlab-ci.yml (publish-unstable): Publish both amd64 and i386. 2022-10-08 15:28:15 +02:00
Alexandre Duret-Lutz
9fc48daf28 CI: work around GIT_STRATEGY=none not cleaning the build dir
* .gitlab-ci.yml (publish-rpm, publish-stable, publish-unstable):
Use the latest files and clean things up after publication.
2022-10-08 10:35:35 +02:00
Alexandre Duret-Lutz
1a4121c6c2 * tests/Makefile.am (.ipynb.html): Use classic template. 2022-10-07 19:26:54 +02:00
Alexandre Duret-Lutz
05b8fa8dbf fix previous patch
this patch failed on i386 and on Raspberry.

* spot/twaalgos/translate.cc: Clear.
* spot/twaalgos/postproc.cc: Call reduce_parity_here
in more cases.
2022-10-05 16:29:47 +02:00
Alexandre Duret-Lutz
344e01d4e2 translate, postproc: improve parity output
* spot/twaalgos/translate.cc: When producing Parity output, split LTL
as we do in the Generic case.
* spot/twaalgos/postproc.hh, spot/twaalgos/postproc.cc: Use
acd_transform() and add an "acd" option to disable this.
* bin/spot-x.cc, NEWS: Document this.
* tests/core/genltl.test, tests/core/minusx.test,
tests/core/parity2.test: Adjust test cases for improved outputs.
2022-10-05 11:08:19 +02:00
Alexandre Duret-Lutz
e867242cf6 Update troubleshouting instruction for Python bindings
For issue #512

* README: Update instructions.
* configure.ac: Add some code to warn if Python files will be
installed in a place that is not searched up by default.  Add
--with-pythondir support.
* NEWS: Mention --with-pythondir.
2022-10-04 13:11:14 +02:00
Alexandre Duret-Lutz
4ab51e1c88 toparity: cover more options
* tests/python/toparity.py: Augment test cases.
2022-10-04 09:24:03 +02:00
Alexandre Duret-Lutz
e907f11488 emptinesscheck: improve coverage of CVWY90 and SE05
* tests/core/randtgba.cc: Test the ar:form_stack variants.
2022-10-03 17:00:15 +02:00
Alexandre Duret-Lutz
ce006cbbaa * .dir-locals.el (bug-reference-bug-regexp): Fix first group. 2022-10-03 16:48:03 +02:00
Alexandre Duret-Lutz
35b4cb89fc add test for previous decomposition patch
* tests/core/ltlsynt.test: Here.
2022-10-03 16:27:38 +02:00
Alexandre Duret-Lutz
fa4500a8d3 * tests/python/ipnbdoctest.py: Also retry if Kernel does not respond. 2022-10-03 16:27:38 +02:00
Alexandre Duret-Lutz
74b752eb79 * .gitlab-ci.yml (debian-gcc-snapshot): Build from tarball. 2022-10-03 16:27:38 +02:00
Florian Renkin
4d2c096ec0 dot: fix 'g' with a Mealy machine
* spot/twaalgos/dot.cc: here
* tests/python/mealy.py: add test
2022-10-03 10:35:38 +02:00
Florian Renkin
27816ea438 synthesis: Fix for implication decomposition
* spot/twaalgos/synthesis.cc: here
2022-10-03 10:35:38 +02:00
Alexandre Duret-Lutz
3cd43f618c test: fix running on python test in OpenBSD
* tests/run.in: Add LD_LIBRARY_PATH.
2022-10-02 14:37:21 +02:00
Alexandre Duret-Lutz
0521901e9d revert c45ff0c94 and add test case showing why
* bin/ltlsynt.cc: Revert c45ff0c94.  Also fix documentation of exit
status.
* tests/core/ltlsynt2.test: New file.
* tests/Makefile.am: Add it.
2022-09-26 14:15:33 +02:00
Alexandre Duret-Lutz
51caa5588e update gitlab references
As LRDE is being renamed LRE, gitlab is one of the first URL to
migrate.  The old URL is still supported, but we want to only use the
new one eventually.

* .dir-locals.el, .gitlab-ci.yml, HACKING, NEWS, doc/org/concepts.org,
doc/org/install.org, doc/org/setup.org, elisp/Makefile.am,
elisp/hoa-mode.el, tests/ltsmin/README: Update to the new gitlab URL.
2022-09-23 08:57:57 +02:00
Alexandre Duret-Lutz
383128d983 * doc/tl/tl.tex: Fix a couple of typos detected by ispell. 2022-09-23 08:57:57 +02:00
Alexandre Duret-Lutz
3729dfad90 translate: add a branch-post option
* spot/twaalgos/translate.cc, spot/twaalgos/translate.hh: Here.
* NEWS, bin/spot-x.cc: Mention it.
* tests/core/genltl.test: Test it.
2022-09-23 08:57:57 +02:00
Alexandre Duret-Lutz
7ed62f7eed genltl: introduce --eil-gsi
Based on a mail from Edmond Irani Liu.  The test case also serves for
the previous patch.

* bin/genltl.cc, spot/gen/formulas.cc, spot/gen/formulas.hh: Add it.
* NEWS: Mention it.
* tests/core/genltl.test: Test it.
2022-09-23 08:57:57 +02:00
Alexandre Duret-Lutz
3efab05cf2 introduce delay_branching_here
This is motivated by an example sent by Edmond Irani Liu,
that will be tested in next patch.

* spot/twaalgos/dbranch.cc, spot/twaalgos/dbranch.hh: New files.
* python/spot/impl.i, spot/twaalgos/Makefile.am: Add them.
* spot/twaalgos/translate.cc: Call delay_branching_here
unconditionally.
* spot/twa/twagraph.cc (defrag_states): Do not assume
that games are alternating.
* tests/core/genltl.test: Adjust expected numbers.
* tests/python/dbranch.py: New file.
* tests/Makefile.am: Add it.
2022-09-23 08:57:57 +02:00
Alexandre Duret-Lutz
aa7992c65f simplify some uses of minato_isop
Typically intead of doing

    minato_isop isop(rel & letter);
    while (bdd cube = isop.next()) {
       bdd res = bdd_exists(cube, ap)
       ...
    }

do

    minato_isop isop(bdd_relprod(rel, letter, ap);
    while (bdd res = isop.next()) {
       ...
    }

this way the existential quantification is done once at the same time
of the conjunction, and isop has fewer variable to work with.

* spot/twaalgos/alternation.cc, spot/twaalgos/dualize.cc,
spot/twaalgos/simulation.cc, spot/twaalgos/toweak.cc: Here.
2022-09-23 08:57:57 +02:00
Philipp Schlehuber-Caissier
c45ff0c94c fix: ltlsynt --tlsf does not propagate name to csv
* bin/ltlsynt.cc: Here
2022-09-21 21:03:06 +02:00
Philipp Schlehuber-Caissier
4a24739c3f Improving minimize_mealy benchmarking
* python/spot/__init__.py: Adding helper function for
inline plot of csv
*spot/twaalgos/mealy_machine.cc, spot/twaalgos/mealy_machine.hh:
Main changes
* tests/python/_mealy.ipynb: Update
* tests/python/ipnbdoctest.py: Ignore timing table
* tests/python/synthesis.ipynb: Update
2022-09-21 21:03:06 +02:00
Philipp Schlehuber-Caissier
c63c1796b9 Improve aiger INF encoding
the encoding cna be simplified to produce less gates
when high or low is True.

* spot/twaalgos/aiger.cc: Here
* tests/python/_synthesis.ipynb: Test
2022-09-21 17:28:04 +02:00
Alexandre Duret-Lutz
c1c874b1a5 ltlsynt: add options --dot and --hide-status
* bin/ltlsynt.cc: Implement these options.
* bin/common_aoutput.hh, bin/common_aoutput.cc (automaton_format_opt):
Make extern.
* NEWS: Mention the new options.
* doc/org/ltlsynt.org: Use dot output in documentation.
* tests/core/ltlsynt.test: Quick test of the new options.
2022-09-14 15:33:46 +02:00
Alexandre Duret-Lutz
ef0aeed228 ltlsynt: fix documentation of --aiger option
* bin/ltlsynt.cc: Here.
2022-09-14 11:29:18 +02:00
Alexandre Duret-Lutz
b3b22388c9 postproc: introduce -x merge-states-min
* spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh: Introduce a
merge-states-min option.
* bin/spot-x.cc: Document it.
* spot/gen/automata.cc, spot/gen/automata.hh, bin/genaut.cc: Add
option to generate cyclist test cases.
* NEWS: Document the above.
* tests/core/included.test: Add test cases that used to be too slow.
2022-09-13 15:19:55 +02:00
Alexandre Duret-Lutz
d9248e2e97 * doc/org/concepts.org (T-based vs. S-based acceptance): Adjust example. 2022-09-12 14:15:05 +02:00
Alexandre Duret-Lutz
bdac53511a degen: learn to work on generalized-Co-Büchi as well
* spot/twaalgos/degen.hh, spot/twaalgos/degen.cc: Adjust
degeneralize() and degeneralize_tba() to work on generalized-co-Büchi.
* NEWS: Mention this.
* spot/twaalgos/cobuchi.hh, spot/twaalgos/cobuchi.cc (to_nca): Use
degeneralization on generalized-co-Büchi.
* spot/twaalgos/postproc.cc: Use degeneralization for generalized
co-Büchi as well.
* bin/autfilt.cc: Improve chain products of co-Büchi automata by using
generalization if too many colors are needed.
* tests/core/prodchain.test, tests/python/pdegen.py: Add test cases.
2022-09-12 14:14:43 +02:00
Alexandre Duret-Lutz
fe3ebd370b add the TACAS'22 reference
* doc/org/citing.org, doc/spot.bib: There.
2022-09-07 09:59:31 +02:00
Alexandre Duret-Lutz
0f131f2eee product: Büchi|Büchi=Büchi, CoBüchi&CoBüchi=CoBüchi
Improve the construction of the above constructions, saving colors.

* spot/twaalgos/product.cc: Here.
* spot/twaalgos/product.hh, NEWS: Mention it.
* tests/core/prodchain.test, tests/core/prodor.test,
tests/python/_product_weak.ipynb: Adjust.
2022-09-06 18:05:52 +02:00
Alexandre Duret-Lutz
7cf580a9c5 we want the tarball we distribute to be built on Debian unstable
See issue #512.

* .gitlab-ci.yml (make-dist): New build.
(debian-unstable-gcc-pypy, arch-gcc-glibcxxdebug, mingw-shared,
mingw-static, publish-stable): Depend upon make-dist.
2022-09-02 20:50:04 +02:00
Alexandre Duret-Lutz
2e32793ed1 * .gitlab-ci.yml (debian-unstable-gcc-coverage): Export coverage.css. 2022-09-02 20:49:58 +02:00
Alexandre Duret-Lutz
925ac6bbe4 * .gitlab-ci.yml: Use gcovr and produce an XML report for gitlab. 2022-09-01 10:40:40 +02:00
Alexandre Duret-Lutz
cd21521bfe * spot/twa/twagraph.cc (merge_states): Some cleanup and simplifications. 2022-08-14 23:09:56 +02:00
Alexandre Duret-Lutz
d1b8495510 do not use a global variable to define the number of available threads
* python/spot/impl.i: Make parallel_policy implicitly contractible.
* spot/graph/graph.hh (sort_edges_srcfirst_): Pass a parallel_policy
explicitly.
* spot/twa/twagraph.hh, spot/twa/twagraph.cc (merge_states): Likewise.
* spot/misc/common.cc: Remove file.
* spot/misc/common.hh (set_nthreads, get_nthreads): Remove, and
replace with...
(parallel_policy): ... this.
* spot/misc/Makefile.am, tests/python/mergedge.py, NEWS: Adjust.
2022-08-14 23:09:56 +02:00
Alexandre Duret-Lutz
2848951965 * doc/spot.bib: Add entries for last two tool papers. 2022-08-10 10:28:44 +02:00
Alexandre Duret-Lutz
a7e87a1fc7 Mention the CAV'22 paper
* doc/org/citing.org: Here.
* doc/org/spot.css: Add support for "begin_note...end_note".
2022-08-10 10:28:41 +02:00
Alexandre Duret-Lutz
faa8fe8873 mealy: cleanup the doxygen documentation
* spot/twaalgos/mealy_machine.hh: Create a new "Mealy" section for
all these function, and fix some doc strings.
2022-08-06 15:08:11 +02:00
Alexandre Duret-Lutz
de9041bb31 mealy: make output_assignment the default for reduce_mealy
* spot/twaalgos/mealy_machine.hh: Here. Also cite the FORTE paper.
* doc/spot.bib (renkin.22.forte): New entry.
2022-08-06 14:08:23 +02:00
Alexandre Duret-Lutz
b0165cf39c * doc/org/tut10.org: Use the same formula in C++ as in Python and sh. 2022-08-05 18:55:44 +02:00
Alexandre Duret-Lutz
8b93b6967d rename pg_print() as print_pg() and add it to to_str()
* NEWS: Mention those change.
* spot/twaalgos/game.hh (print_pg): New function.
(pg_print): Mark as deprecated.
* spot/twaalgos/game.cc (pg_print): Redirect to print_pg().
(print_pg): Update to output state names.
* python/spot/__init__.py: Teach to_str() about print_pg().
* bin/ltlsynt.cc: Adjust to call print_pg().
* tests/python/games.ipynb: Add an example.
* tests/core/ltlsynt.test: Adjust to remove the "INIT" note.
2022-07-23 21:38:23 +02:00
Alexandre Duret-Lutz
b3e994c249 * spot/twaalgos/hoa.cc: Typo in error message. 2022-07-22 10:54:15 +02:00
Alexandre Duret-Lutz
444e2b5b89 parseaut: Add support for PGSolver's format
* spot/parseaut/parseaut.yy, spot/parseaut/scanaut.ll: Add rules for
PGSolver's format.
* spot/parseaut/public.hh: PGAME is a new type of output.
* tests/core/pgsolver.test: New file.
* tests/Makefile.am: Add it.
* tests/python/games.ipynb: More exemples.
* NEWS: Mention the new feature.
2022-07-22 10:54:08 +02:00
Alexandre Duret-Lutz
d6b3c757d0 test: ignore OpenBSD's "Terminated" messages
For #501.

* tests/core/autcross4.test: Here.
2022-07-12 15:43:39 +02:00
Alexandre Duret-Lutz
3e2201bd80 tests: add figures from CAV'22 paper
* tests/python/cav22-figs.ipynb: New file.
* doc/org/tut.org, tests/Makefile.am: Add it.
2022-07-12 15:05:09 +02:00
12920c44e3 Trigger archival services on new release
* .gitlab-ci.yml: curl Software Heritage and Internet Archive endpoints
to trigger archival on push to stable
2022-07-07 23:23:41 +02:00
Florian Renkin
6dd99e049b to_parity: Rewrite the function and add new transformations
* spot/twaalgos/synthesis.cc: Now needs to call reduce_parity.
* spot/twaalgos/toparity.cc, spot/twaalgos/toparity.hh: here.
* spot/twaalgos/zlktree.hh: make zielonka_node public
* tests/core/ltlsynt.test, tests/python/games.ipynb,
  tests/python/synthesis.ipynb, tests/python/toparity.py:
  update tests
2022-07-07 20:43:21 +02:00
Florian Renkin
3f333792ff Add a procedure that detects if an automaton is parity-type
* spot/twaalgos/genem.cc, spot/twaalgos/genem.hh: add detection
  of edges that are in at least one accepting cycle.
* spot/twaalgos/toparity.cc,
  spot/twaalgos/toparity.hh: add parity_type_to_parity and
  buchi_type_to_buchi.
2022-07-07 20:43:21 +02:00
Alexandre Duret-Lutz
5b8350bc9b rpm: omit *.la files
* spot.spec.in: It seems RedHat does not distribute *.la files anymore.
2022-07-07 15:51:11 +02:00
Alexandre Duret-Lutz
1cfb4a14ec bloemen: simplify style
Fixes #510.

* spot/mc/bloemen_ec.hh: Here.
2022-07-06 17:11:55 +02:00
Alexandre Duret-Lutz
69eba6fd9a bloemen: fix a unused variable warning
As discussed in #510.

* spot/mc/bloemen_ec.hh: Here.
2022-07-06 16:34:01 +02:00
Alexandre Duret-Lutz
ee55dabfaa * spot/mc/cndfs.hh: Fix a unused variable warning in NDEBUG. 2022-07-05 23:56:36 +02:00
Alexandre Duret-Lutz
a66c305609 gen: work around a warning on red hat
When n is an int, doing "new formula[n];" gives us "warning: argument 1
value '18446744073709551615' exceeds maximum object size
9223372036854775807" on Red Hat.

* spot/gen/formulas.cc (pps_arbiter): Pass n as unsigned.  Also
fix some determinism in the strict variant.
2022-07-05 11:10:43 +02:00
Alexandre Duret-Lutz
ff89601306 utf8: Update to match current version
* utf8/LICENSE, utf8/utf8/cpp11.h, utf8/utf8/cpp17.h: New files.
* Makefile.am: Distribute them.
* utf8/README.md, utf8/utf8/checked.h, utf8/utf8/core.h,
utf8/utf8/unchecked.h: Update to the current version of utfcpp.
* README: Add a link to the upstream github.
2022-07-05 10:56:57 +02:00
Alexandre Duret-Lutz
efee1c4130 * spot/twaalgos/mealy_machine.cc (is_complete_): Define in debug only. 2022-07-05 10:41:24 +02:00
Alexandre Duret-Lutz
833fcdebc1 work around GCC bug 106159
* m4/gccwarn.m4: Add an example of multiple inheritance of virtual
classes to trigger to new -Woverloaded-virtual warning on the
destructor.
2022-07-05 10:38:51 +02:00
Alexandre Duret-Lutz
1fc94ee6f2 gnulib: install the environ module
This should fix compilation on OSX, as reported by Yann Thierry-Mieg.

* m4/environ.m4: New file.
* m4/gnulib-cache.m4, m4/gnulib-comp.m4: Update.
* bin/common_trans.cc [HAVE_SPAWN_H]: Do not define environ.
2022-06-30 09:50:13 +02:00
Alexandre Duret-Lutz
db725ffaf8 * spot/twaalgos/degen.cc (propagate_marks_here): Cleanup previous patch. 2022-06-30 09:18:03 +02:00
Philipp Schlehuber-Caissier
99bf152673 propagate_marks_here can break state-acc prop
* spot/twaalgos/degen.cc: Fix
* tests/python/pdegen.py: Test
2022-06-29 14:02:36 +02:00
Philipp Schlehuber-Caissier
ddbdcd39cb Adept ltlsynt pgame to new solver
* bin/ltlsynt.cc: Remove change/colorize_parity, check alternating
2022-06-29 13:19:57 +02:00
Philipp Schlehuber-Caissier
6bc1dd0467 Use new zielonka for synthesis
Remove all now unnecessary colorize_parity and
change_parity calls.

* spot/twaalgos/synthesis.cc: Change here
* spot/twaalgos/game.cc: Adjust pg-print
* tests/core/ltlsynt.test,
  tests/python/_mealy.ipynb,
  tests/python/games.ipynb,
  tests/python/synthesis.ipynb,
  tests/python/synthesis.py: Adjust tests
2022-06-27 09:29:46 +02:00
philipp
9124484719 Modifying Zielonka
* spot/twaalgos/game.cc: solve_parity_game now works for any of
the four parity types and partially colored graphs.
 Also removing unnescessary steps from Zielonka.
h: Update
* tests/python/game.py: Update and additional tests
* tests/python/except.py: Remove outdated exception
2022-06-27 09:29:36 +02:00
Alexandre Duret-Lutz
9222e9713b parseaut: fix handling of [ outside HOA
Fixes #509.

* spot/parseaut/scanaut.ll: Reset ->str whenever a [ is read,
so that we do not attempt to clear ->str while reading garbage.
* NEWS: Mention the bug.
* tests/core/parseaut.test: Test it.
2022-06-23 17:19:09 +02:00
Alexandre Duret-Lutz
b4279d3a12 dot: quote identifiers containing a minus
* spot/twaalgos/dot.cc: Quote identifiers containing a minus.
* tests/core/alternating.test: Add test case.
* NEWS: Mention the bug.
2022-06-23 16:19:50 +02:00
Alexandre Duret-Lutz
166a26417c graph: fix creation of universal edge
* spot/graph/graph.hh: Use a temporary array to store the destination
vector if the passed range belong to the dests_ vector.  Otherwise the
passed begin/end risk being invalidated when dests_ is reallocated.
* NEWS: Mention the bug.
2022-06-23 15:52:24 +02:00
Alexandre Duret-Lutz
288b1c7958 contains: generalize second argument to a twa
This was triggered by a question from Pierre Ganty on the mailing
list.

* spot/twaalgos/contains.hh, spot/twaalgos/contains.cc (contains):
Generalize second argument to const_twa_ptr instead of
const_twa_graph_ptr.
* NEWS: Mention this.
* tests/python/ltsmin-pml.ipynb: Show that it work.
* THANKS: Mention Pierre.
2022-06-22 23:43:07 +02:00
Alexandre Duret-Lutz
be28365db4 ltlsynt: add --from-pgame option to read parity games
* bin/common_file.cc, bin/common_file.hh (output_file): Add a
force_append option.
* bin/ltlsynt.cc: Implement the --from-pgame option, and
fix suppot for --csv when multiple inputs are processed.
* NEWS: Mention the new option.
* tests/core/syfco.test: Add a test case.
* tests/core/ltlsynt-pgame.test: New file.
* tests/Makefile.am: Add it.
2022-06-22 23:20:20 +02:00
Alexandre Duret-Lutz
04d718ab9c ltlsynt: support multiple --tlsf options
* bin/common_finput.cc, bin/common_finput.hh: Add support for
process_tlsf_file.
* bin/ltlsynt.cc: Implement it.
* tests/core/syfco.test: Adjust test case.
2022-06-22 19:37:41 +02:00
Alexandre Duret-Lutz
df685433f4 bin: separate process_file() for aut and ltl
* bin/common_finput.cc, bin/common_finput.hh,
bin/common_hoaread.hh (process_file): Split into...
(process_ltl_file, process_aut_filt): ... these, as we will need both
in ltlsynt.
2022-06-22 19:37:41 +02:00
Alexandre Duret-Lutz
8161a8c531 tests: workaround test not failing if the Spot support more colors
* configure.ac (MAX_ACCSETS): Add AC_SUBST.
* tests/run.in: Define MAX_ACCSETS.
* tests/core/prodchain.test: Test MAX_ACCSETS.
2022-06-21 14:24:08 +02:00
Alexandre Duret-Lutz
23908f3d2f Add a --enable-pthread option to activate experimental threading code
* NEWS, README, doc/org/compile.org: Mention the option and
its effect on compilation requirements.
* configure.ac: Add the --enable-pthread option, and ENABLE_PTHREAD
macro.
* doc/org/g++wrap.in, spot/Makefile.am, spot/libspot.pc.in: Compile
with -pthread conditionally.
* spot/graph/graph.hh, spot/twa/twagraph.cc: Adjust the code to not
use thread-local variables, and let the pthread code be optional.
* .gitlab-ci.yml: Activate --enable-pthread in two configurations.
2022-06-21 09:56:13 +02:00
Alexandre Duret-Lutz
721d5695ec add a newer version of the generic emptiness check
As discussed with Jan Strejček.

* spot/twa/acc.cc, spot/twa/acc.hh (fin_unit_one_split): New function.
(fin_one_extract): Return the simplified acceptance condition as an
optimization.
* python/spot/impl.i: Bind this new function.
* tests/python/acc.py: New file, to test it.
* tests/Makefile.am: Add acc.py.
* spot/twaalgos/genem.cc, spot/twaalgos/genem.hh: Implement the
spot211 variant of the emptiness check.
* tests/python/genem.py: Test it.
* tests/python/acc_cond.ipynb: Adjust test for fin_one_extract.
2022-06-17 09:54:42 +02:00
Florian Renkin
aca6bd9042 synthesis: Deletion of an incorrect case in the bypass
With a formula like G(b1) & (GFi <-> GF(b1)), a direct strategy was
created while it is unrealizable.

* spot/twaalgos/synthesis.cc: here.
* tests/core/ltlsynt.test: add tests
2022-05-31 13:56:20 +02:00
Philipp Schlehuber-Caissier
d8cc0c5acb Introduce a faster merge_states
merge_states is now hash-based, uses the new edge-sorting with
src first and can be executed in parallel.

* spot/twa/twagraph.cc: Here
* tests/python/mergedge.py: Test
2022-05-24 16:58:07 +02:00
Philipp Schlehuber-Caissier
71c2a7b1a6 Add a new function to sort edges
sort_edge_srcfirst_ will sort the edge with respect
to the src state, then sort each sub list with respect
to the given predicate, possibly in parallel.

* spot/graph/graph.hh: Here
2022-05-24 16:58:07 +02:00
Philipp Schlehuber-Caissier
e064726b64 Introducing a global variable to define the number of threads
* NEWS: Announce
* spot/Makefile.am: Add pthread to use threads
* spot/misc/common.cc,
  spot/misc/common.hh: Add variable + getter/setter
* spot/misc/Makefile.am: Add common.cc
2022-05-24 16:58:07 +02:00
Alexandre Duret-Lutz
b11208440b zlktree: use a cache in the construction of zielonka_tree
This largely speeds up the computation for conditions
like "Rabin n" sharing a lot of subtrees.

Also implement options to stop the construction if the shape is wrong.

* spot/twaalgos/zlktree.cc, spot/twaalgos/zlktree.hh: Implement the
cache and the options.
* tests/python/zlktree.ipynb, tests/python/zlktree.py: New tests.
2022-05-20 17:07:26 +02:00
Alexandre Duret-Lutz
f784e40548 complete: do not force Büchi on universal automata
* spot/twaalgos/complete.hh: Adjust documentation.
* spot/twaalgos/complete.cc: If the acceptance condition is a
tautology, delay the forcing of Büchi acceptance until we are sure it
is needed.
* NEWS: Mention the change.
2022-05-20 14:51:48 +02:00
Alexandre Duret-Lutz
3b8e11322b Merge branch 'master' into next 2022-05-18 09:03:40 +02:00
Alexandre Duret-Lutz
457839df36 * NEWS, configure.ac: Bump version to 2.10.6. 2022-05-18 08:52:33 +02:00
Alexandre Duret-Lutz
e0de77d8a4 Release Spot 2.10.6
* NEWS, configure.ac, doc/org/setup.org: Set version to 2.10.6.
2022-05-18 08:52:33 +02:00
Alexandre Duret-Lutz
a6639e56cb more noexcept to pleace GCC
* spot/bricks/brick-hashset (Row): Add noexcept.
* bin/autcross.cc (out_statistics): Likewise.
* bin/ltlcross.cc (statistics): Likewise.
2022-05-18 08:52:33 +02:00
Alexandre Duret-Lutz
99d030f5e1 GCC 12 warns too much about <regex>
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105562

* m4/gccwarn.m4: Compile a small regex and add
-Wno-maybe-uninitialized if needed.
2022-05-18 08:52:33 +02:00
Alexandre Duret-Lutz
10bc253dd8 work around spurious gcc 12 "potentially null dereference"
The issue seems to be inside std::vector's copy constructor, but it
highlighted places in Spot were we could avoid this copy.

* spot/twaalgos/ltl2taa.cc: Avoid some copies of std::vector<formula>.
2022-05-18 08:52:33 +02:00
Alexandre Duret-Lutz
eecb9af21e Fix a clang++15 warning
* spot/parseaut/parseaut.yy: Move the try-block inside the code of the
constructors, so that they can refer to non-static members.
2022-05-18 08:52:33 +02:00
Alexandre Duret-Lutz
8a628d96bc fix warnings from clang-15
* spot/twa/acc.cc (acc_cond::acc_code::symmetries): Fix weird loop.
* spot/twaalgos/aiger.cc (aig::circ_step): Replace & by &&.
2022-05-18 08:52:33 +02:00
Alexandre Duret-Lutz
b5f8e3c75d [buddy] remove some unused variables
* src/reorder.c (reorder_win2ite): Do not set c=1.
2022-05-18 08:52:33 +02:00
Alexandre Duret-Lutz
c609f4cb4b * spot/twa/bdddict.hh (bdd_info): Add noexcept, suggested by gcc 12. 2022-05-18 08:52:33 +02:00
Alexandre Duret-Lutz
cb5bc38f35 bin: reset column specification between files
* bin/common_finput.cc (job_processor::process_file): Reset
col_to_read.
* tests/core/ltlfilt.test: Test it.
* NEWS: Mention the bug.
2022-05-18 08:52:33 +02:00
Alexandre Duret-Lutz
f14b0bb4bd Fix compilation on MacOS X
Patch by Shachar Itzhaky.

* spot/parseaut/scanaut.ll, spot/parsetl/scantl.ll: Include
libc-config.h instead of config.h.
* NEWS: Mention the fix.
* THANKS: Add Shachar.
2022-05-18 08:52:33 +02:00
Alexandre Duret-Lutz
78d7224026 twagraph: improve copy of kripke_graph
Fix #505, Reported by Edmond Irani Liu.

* spot/twa/twagraph.cc (copy): Deal with kripke_graph in a better way.
* spot/twaalgos/hoa.cc: Do not force the use of named-states since
when the input is a kripke_graph.
* tests/python/kripke.py: Adjust test cases.
* NEWS: Mention the change.
* THANKS: Add Edmund.
2022-05-18 08:52:33 +02:00
Alexandre Duret-Lutz
506442450e parsetl: remove a superfluous diagnostic on some erroneous input
* tests/core/neverclaimread.test: Adjust and remove FIXME.
* spot/parsetl/parsetl.yy (try_recursive_parse): Return false
on empty string.
2022-05-18 07:07:52 +02:00
Alexandre Duret-Lutz
9ae2e9c03d Fix link to parity game example
Reported by Florian Renkin.

* doc/org/index.org: Here.
2022-05-18 07:07:26 +02:00
Alexandre Duret-Lutz
2a4e68bfae more noexcept to pleace GCC
* spot/bricks/brick-hashset (Row): Add noexcept.
* bin/autcross.cc (out_statistics): Likewise.
* bin/ltlcross.cc (statistics): Likewise.
2022-05-17 22:06:59 +02:00
Alexandre Duret-Lutz
a23b30abdc GCC 12 warns too much about <regex>
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105562

* m4/gccwarn.m4: Compile a small regex and add
-Wno-maybe-uninitialized if needed.
2022-05-17 17:01:48 +02:00
Alexandre Duret-Lutz
e4f8226c62 work around spurious gcc 12 "potentially null dereference"
The issue seems to be inside std::vector's copy constructor, but it
highlighted places in Spot were we could avoid this copy.

* spot/twaalgos/ltl2taa.cc: Avoid some copies of std::vector<formula>.
2022-05-17 15:25:17 +02:00
Alexandre Duret-Lutz
e8f496bb6c Fix a clang++15 warning
* spot/parseaut/parseaut.yy: Move the try-block inside the code of the
constructors, so that they can refer to non-static members.
2022-05-17 12:01:11 +02:00
Alexandre Duret-Lutz
3a234e24ae fix warnings from clang-15
* spot/twa/acc.cc (acc_cond::acc_code::symmetries): Fix weird loop.
* spot/twaalgos/aiger.cc (aig::circ_step): Replace & by &&.
2022-05-17 11:43:55 +02:00
Alexandre Duret-Lutz
5dab2ede41 [buddy] remove some unused variables
* src/reorder.c (reorder_win2ite): Do not set c=1.
2022-05-17 11:37:52 +02:00
Alexandre Duret-Lutz
4bb58f457b * spot/twa/bdddict.hh (bdd_info): Add noexcept, suggested by gcc 12. 2022-05-17 11:17:37 +02:00
Alexandre Duret-Lutz
d35f7bd37c bin: reset column specification between files
* bin/common_finput.cc (job_processor::process_file): Reset
col_to_read.
* tests/core/ltlfilt.test: Test it.
* NEWS: Mention the bug.
2022-05-17 11:11:23 +02:00
Alexandre Duret-Lutz
d697f57a97 bin: introduce a non-binary job_type
This will later help improve the handling of different input types of
ltlsynt.

* bin/common_finput.hh (job_type): New enum.
(job::type): Use it.
* bin/autcross.cc, bin/autfilt.cc, bin/common_finput.cc,
bin/dstar2tgba.cc, bin/ltl2tgba.cc, bin/ltl2tgta.cc, bin/ltlcross.cc,
bin/ltldo.cc, bin/ltlfilt.cc, bin/ltlgrind.cc, bin/ltlsynt.cc: Adjust
to use the job_type enum instead of a boolean.
2022-05-17 10:49:06 +02:00
Alexandre Duret-Lutz
3b809c0a14 Fix compilation on MacOS X
Patch by Shachar Itzhaky.

* spot/parseaut/scanaut.ll, spot/parsetl/scantl.ll: Include
libc-config.h instead of config.h.
* NEWS: Mention the fix.
* THANKS: Add Shachar.
2022-05-17 09:35:09 +02:00
Alexandre Duret-Lutz
013c879b41 twagraph: improve copy of kripke_graph
Fix #505, Reported by Edmond Irani Liu.

* spot/twa/twagraph.cc (copy): Deal with kripke_graph in a better way.
* spot/twaalgos/hoa.cc: Do not force the use of named-states since
when the input is a kripke_graph.
* tests/python/kripke.py: Adjust test cases.
* NEWS: Mention the change.
* THANKS: Add Edmund.
2022-05-09 13:42:20 +02:00
Alexandre Duret-Lutz
ef9267a58e parsetl: remove a superfluous diagnostic on some erroneous input
* tests/core/neverclaimread.test: Adjust and remove FIXME.
* spot/parsetl/parsetl.yy (try_recursive_parse): Return false
on empty string.
2022-05-06 13:58:52 +02:00
Alexandre Duret-Lutz
4a2bdd6e86 Fix link to parity game example
Reported by Florian Renkin.

* doc/org/index.org: Here.
2022-05-04 17:40:17 +02:00
Alexandre Duret-Lutz
73e148446c Merge branch 'master' into next 2022-05-03 09:05:26 +02:00
Alexandre Duret-Lutz
56666e0db5 * NEWS, configure.ac: Bump version to 2.10.5.dev. 2022-05-03 09:01:03 +02:00
Alexandre Duret-Lutz
c70a06ae0a Release Spot 2.10.5
* NEWS, configure.ac, doc/org/setup.org: Update.
2022-05-03 08:59:17 +02:00
Alexandre Duret-Lutz
385da8ebd0 update NEWS for upcoming release
* NEWS: Here.
2022-05-02 17:47:53 +02:00
Florian Renkin
0f3ffd59ce ltlsynt: don't solve games when we want to display them
* bin/ltlsynt.cc: here
2022-05-02 17:24:23 +02:00
Alexandre Duret-Lutz
fa6912a574 debian: simplify LTO configuration to work around newer libtool
Libtool 2.4.7 breaks if AR_FLAGS contains a space. See
https://lists.gnu.org/archive/html/bug-libtool/2022-03/msg00009.html

* debian/rules: Use gcc-{nm,ar,ranlib} so we do not have to pass
the plugin explicitly.
2022-05-02 17:24:23 +02:00
Philipp Schlehuber-Caissier
add2fced44 Correct bug in zielonka
Optimization in Zielonka failed
under certain circumstances
todo: Devise a specialized test
for direct attr computation

* spot/twaalgos/game.cc: Correction
* tests/python/game.py: Test
2022-05-02 17:24:23 +02:00
Alexandre Duret-Lutz
58f39ec287 * doc/org/tut40.org: Clarify, as suggested by a CAV'22 reviewer. 2022-05-02 17:24:23 +02:00
Florian Renkin
d1f49c721a ltlsynt: don't fail if --outs or --ins is set to empty
* bin/ltlsynt.cc: here
* tests/core/ltlsynt.test: add tests
2022-05-02 17:24:23 +02:00
Alexandre Duret-Lutz
53118d9314 * spot/twaalgos/gfguarantee.hh: Typos in comments. 2022-05-02 17:24:23 +02:00
Alexandre Duret-Lutz
96e051d2bb graph: fix invalid read
Reported by Florian Renkin.

* spot/graph/graph.hh (sort_edges_of): Fix invalid read when sorting a
state without successor.  Seen on core/tgbagraph.test.
2022-05-02 17:24:23 +02:00
Florian Renkin
968ef0f7b8 ltlsynt: typo in help
* bin/ltlsynt.cc: here
2022-05-02 17:24:23 +02:00
Alexandre Duret-Lutz
2aecf9a79e fix typos and make formula_from_bdd more usable in Python
* python/spot/impl.i (formula_from_bdd): Instantiate for twa_graph.
* spot/twa/twa.hh (register_aps_from_dict): Typo in exception.
* tests/python/except.py: More tests for the above.
* tests/python/bdddict.py: Typo in comment.
2022-05-02 17:24:23 +02:00
734de00bfd tests: don't wipe python environment
* tests/run.in: keep original PYTHONPATH contents
* NEWS: mention the bug
2022-05-02 15:36:27 +02:00
Alexandre Duret-Lutz
d61d6e5e2f tests: avoid seq
Partial fix for #501.

* tests/core/prodchain.test: Hardcode the seq output.
* tests/core/bricks.test: Use $AWK instead of seq.
* tests/core/defs.in: Define $AWK.
* NEWS: Mention the bug.
2022-05-02 15:36:11 +02:00
Alexandre Duret-Lutz
7149e5a34d * .gitlab-ci.yml (alpine-gcc): Fix path for logs. 2022-05-02 15:35:51 +02:00
Alexandre Duret-Lutz
7d9fddadce work around an issue in Flex 2.6.4
The fallback definition of SIZE_MAX supplied by flex was not
preprocessor friendly and prevented robin_hood.hh from doing "#if
SIZE_MAX == UINT64_MAX", as observed by Marc Espie on OpenBSD.

* spot/parseaut/scanaut.ll, spot/parsetl/scantl.ll: Define
__STDC_VERSION__ just so that the code generated by Flex
include <inttypes.h>.
* NEWS: Mention the bug.
* THANKS: Add Marc.
2022-05-02 15:35:09 +02:00
Alexandre Duret-Lutz
64020279cb reduce_parity: fix to work on automata with deleted edges
* spot/twaalgos/parity.cc (reduce_parity): Use the
size of the edge vector to initialize piprime1 and piprime2,
not the number of edges.
* tests/python/parity.py: Add test case, based on a report
by Yann Thierry-Mieg.
2022-05-02 15:34:57 +02:00
Alexandre Duret-Lutz
b7825552f8 remove uses of unary_function and binary_function
These were deprecated in C++11, and are supposed to be removed from
C++17, however gcc-snapshot just started warning about those.

* spot/misc/bddlt.hh, spot/misc/hash.hh, spot/misc/ltstr.hh,
spot/twa/taatgba.hh, spot/twaalgos/ltl2tgba_fm.cc: Here.
2022-05-02 15:34:14 +02:00
Florian Renkin
355c5ffeb1 ltlsynt: display the number of subformulas
* bin/ltlsynt.cc: here
* tests/core/ltlsynt.test: ajust tests
2022-04-25 11:25:29 +02:00
Florian Renkin
62725fb507 ltlsynt: don't solve games when we want to display them
* bin/ltlsynt.cc: here
2022-04-25 11:25:29 +02:00
Florian Renkin
55aac8e107 ltlsynt: display ACD instead of LAR when needed
* spot/twaalgos/synthesis.cc: here
* tests/core/ltlsynt.test: add test
2022-04-25 11:25:25 +02:00
Alexandre Duret-Lutz
5f43c9bfce ltlsynt: implement --tlsf to call syfco automatically
Fixes #473.

* NEWS, doc/org/ltlsynt.org: Mention it.
* bin/common_trans.cc, bin/common_trans.hh (read_stdout_of_command):
New function.
* bin/ltlsynt.cc: Implement the --tlsf option.
* tests/core/syfco.test: New file.
* tests/Makefile.am: Add it.
2022-04-13 09:08:40 +02:00
Philipp Schlehuber-Caissier
06b73c39fa +ud option of mealy_machine_to_aig received wrong value
Also aiger received a tracing option for
debugging

* spot/twaalgos/aiger.cc: Here
* tests/core/ltlsynt.test: Test
2022-04-07 21:21:52 +02:00
Philipp Schlehuber-Caissier
524edea8da Propagate colors in split_2step
Reduce the amount of uncolored transitions
after split_2step by trying to color the env transitions.
This is currently only supported for parity like
acceptance conditions.

* spot/twaalgos/game.cc: Determinizatio of "colored"
game can created trivial self-loops. Fix them
* spot/twaalgos/synthesis.cc: Here
* tests/core/ltlsynt.test,
tests/python/_synthesis.ipynb,
tests/python/games.ipynb,
tests/python/synthesis.ipynb,
tests/python/synthesis.py: New and adjusted tests
2022-04-07 21:21:06 +02:00
Philipp Schlehuber-Caissier
dfb75632ba Update merge_states
Current implementation of merge_states fails
on certain self-loops.
Updated implementation to take them into
account and use a hashbased implementation
to speed up calculations.
Moreover, merge_states() is now aware
of "state-player", just like defrag_states_

* spot/twa/twagraph.cc: Here
* spot/twaalgos/game.cc: Fix odd cycle for sink
* spot/twaalgos/synthesis.cc: Adapt split_det pipeline
* tests/python/_synthesis.ipynb: Tests
2022-04-07 17:42:14 +02:00
Alexandre Duret-Lutz
a211bace68 autcross: implement --language-complemented
Suggested by Ondřej Lengál.  Fixes #504.

* bin/autcross.cc: Implement the --language-complemented option.
* NEWS, doc/org/autcross.org: Document it.
* tests/core/autcross.test: Test it.
* THANKS: Add Ondřej.
2022-04-06 15:38:23 +02:00
Alexandre Duret-Lutz
5e1b751971 debian: simplify LTO configuration to work around newer libtool
Libtool 2.4.7 breaks if AR_FLAGS contains a space. See
https://lists.gnu.org/archive/html/bug-libtool/2022-03/msg00009.html

* debian/rules: Use gcc-{nm,ar,ranlib} so we do not have to pass
the plugin explicitly.
2022-03-30 11:20:25 +02:00
Philipp Schlehuber-Caissier
27d455389e Correct bug in zielonka
Optimization in Zielonka failed
under certain circumstances
todo: Devise a specialized test
for direct attr computation

* spot/twaalgos/game.cc: Correction
* tests/python/game.py: Test
2022-03-29 22:36:35 +02:00
Alexandre Duret-Lutz
9c6a09890e parsetl: speedup parsing of n-ary operators with many operands
Issue #500, reported by Yann Thierry-Mieg.

* spot/parsetl/parsetl.yy, spot/parsetl/scantl.ll: Use variant
to store a new pnode objects that delays the construction of n-ary
operators.
* spot/parsetl/Makefile.am: Do not distribute stack.hh anymore.
* spot/tl/formula.cc: Fix detection of overflow in Star and FStar.
* HACKING: Update Bison requirements to 3.3.
* tests/core/500.test: New test case.
* tests/Makefile.am: Add it.
* tests/core/ltl2tgba2.test, tests/core/ltlsynt.test,
tests/core/tostring.test: Adjust to new expected order.
* NEWS: Mention the change.
2022-03-28 09:00:18 +02:00
Alexandre Duret-Lutz
46f3f5aaf4 * doc/org/tut40.org: Clarify, as suggested by a CAV'22 reviewer. 2022-03-25 22:56:37 +01:00
Florian Renkin
7abcf4e38b ltlsynt: create a "bypass" option
* bin/ltlsynt.cc: here.
* tests/core/ltlsynt.test: add tests
2022-03-22 19:05:31 +01:00
Florian Renkin
328cf95816 ltlsynt: generalization of the bypass
* spot/twaalgos/synthesis.cc, spot/twaalgos/synthesis.hh: generalize the
  bypass and avoid to construct a strategy when we want realizability.
* bin/ltlsynt.cc: adapt for realizability
* tests/core/ltlsynt.test: update tests
2022-03-22 19:05:28 +01:00
Florian Renkin
0a6b627914 option_map: Don't report unused options if option_map is not used
* spot/misc/optionmap.cc, spot/misc/optionmap.hh: here.
2022-03-22 16:08:51 +01:00
Florian Renkin
8d9597d80d ltlsynt: add --algo=acd
* bin/ltlsynt.cc: Add "acd" to the list of possible paritization
		  algorithms used by ltlsynt
* spot/twaalgos/synthesis.cc, spot/twaalgos/synthesis.hh: Add
	ACD as paritisation algorithm
* tests/core/ltlsynt.test: add tests
2022-03-22 16:08:51 +01:00
Florian Renkin
dd58747659 synthesis.ipynb: remove useless import
* tests/python/synthesis.ipynb: here.
2022-03-22 16:08:51 +01:00
Florian Renkin
0dd36e9a53 ltlsynt: don't fail if --outs or --ins is set to empty
* bin/ltlsynt.cc: here
* tests/core/ltlsynt.test: add tests
2022-03-22 16:08:51 +01:00
Alexandre Duret-Lutz
e9c1aeaa54 * spot/twaalgos/gfguarantee.hh: Typos in comments. 2022-03-22 15:50:36 +01:00
Alexandre Duret-Lutz
3ed337ec46 graph: fix invalid read
Reported by Florian Renkin.

* spot/graph/graph.hh (sort_edges_of): Fix invalid read when sorting a
state without successor.  Seen on core/tgbagraph.test.
2022-03-22 15:50:36 +01:00
Philipp Schlehuber-Caissier
bb7072402a Removing eeroneaus test
* tests/python/except.py: Here
2022-03-21 10:51:38 +01:00
Philipp Schlehuber-Caissier
97fc3f6c0b Introduce simplify_mealy
Convenience function dispatching to
minimize_mealy and reduce_mealy.
Change tests accordingly

* spot/twaalgos/mealy_machine.cc,
  spot/twaalgos/mealy_machine.hh: Here
* bin/ltlsynt.cc: Use simplify
* spot/twaalgos/synthesis.cc,
  spot/twaalgos/synthesis.hh: Remove
 minimization, Update options
* tests/core/ltlsynt.test,
  tests/python/synthesis.ipynb,
  tests/python/_synthesis.ipynb: Adapt
2022-03-18 15:35:54 +01:00
Philipp Schlehuber-Caissier
86de4d4052 Introduce mealy_prod
Product between mealy machines
with propagation of synthesis outputs
and additional assertions.
Currently it only supports input complete machines

* spot/twaalgos/mealy_machine.cc,
  spot/twaalgos/mealy_machine.hh: Here
* bin/ltlsynt.cc: Use
* tests/python/except.py,
  tests/python/synthesis.ipynb: Test
2022-03-18 15:33:15 +01:00
Alexandre Duret-Lutz
5cd0ce14b0 fix mempool test to use __has_include
This follows 6b88d6f35b.

* tests/core/mempool.cc: Use __has_include too.
2022-03-17 16:50:01 +01:00
Alexandre Duret-Lutz
75818fde13 synthesis: fix suboptimal colorization after LAR
* spot/twaalgos/synthesis.cc (ltl_to_game): In LAR and LAR_OLD mode,
for max odd and colorize the game after the split, not before.  The
previous code used to colorize twice, and could waste up to 4 colors
in the process.
* tests/core/ltlsynt.test, tests/python/_mealy.ipynb,
tests/python/games.ipynb, tests/python/synthesis.ipynb,
tests/python/synthesis.py: Adjust all test cases to reflect the fact
that the game uses fewer colors.
2022-03-17 16:44:48 +01:00
Alexandre Duret-Lutz
c1e6340228 optionmap: set_if_unset and simplifications
* spot/misc/optionmap.hh (set_if_unset): New method.
* spot/misc/optionmap.cc (set_if_unset, set, set_str): Implement
set_if_unset, and simplify set and set_str to not perform two lookups.
* spot/twaalgos/synthesis.cc (create_translator): Use set_if_unset
to simplify the code.
2022-03-17 16:42:01 +01:00
Florian Renkin
4f69e99c45 synthesis.ipynb: correct typos
* tests/python/synthesis.ipynb: here
2022-03-17 11:53:51 +01:00
Florian Renkin
e248f4500d ltlsynt: typo in help
* bin/ltlsynt.cc: here
2022-03-15 14:04:16 +01:00
Alexandre Duret-Lutz
0745e735bb fix typos and make formula_from_bdd more usable in Python
* python/spot/impl.i (formula_from_bdd): Instantiate for twa_graph.
* spot/twa/twa.hh (register_aps_from_dict): Typo in exception.
* tests/python/except.py: More tests for the above.
* tests/python/bdddict.py: Typo in comment.
2022-03-11 09:53:04 +01:00
187bacc254 tests: don't wipe python environment
* tests/run.in: keep original PYTHONPATH contents
* NEWS: mention the bug
2022-03-10 15:57:19 +01:00
Alexandre Duret-Lutz
530cf7ca47 tests: replace all "assert" by unittest assertions
If the assert fails because of a comparison, it is useful that the
test suite log contains a comparison of these values.
unittest.assertEqual() and friends do that for us.

* HACKING: Add a section about Python tests.
* tests/sanity/style.test: Forbid the use of "assert" in
Python tests.
* tests/python/298.py, tests/python/341.py, tests/python/471.py,
tests/python/accparse2.py, tests/python/aiger.py,
tests/python/aliases.py, tests/python/alternating.py,
tests/python/bdddict.py, tests/python/bdditer.py,
tests/python/bugdet.py, tests/python/complement_semidet.py,
tests/python/declenv.py, tests/python/decompose_scc.py,
tests/python/det.py, tests/python/dualize.py, tests/python/ecfalse.py,
tests/python/except.py, tests/python/game.py, tests/python/gen.py,
tests/python/genem.py, tests/python/implies.py,
tests/python/intrun.py, tests/python/kripke.py,
tests/python/langmap.py, tests/python/ltl2tgba.py,
tests/python/ltlf.py, tests/python/ltlparse.py,
tests/python/ltlsimple.py, tests/python/mealy.py,
tests/python/merge.py, tests/python/mergedge.py,
tests/python/misc-ec.py, tests/python/optionmap.py,
tests/python/origstate.py, tests/python/otfcrash.py,
tests/python/parity.py, tests/python/parsetgba.py,
tests/python/pdegen.py, tests/python/prodexpt.py,
tests/python/randgen.py, tests/python/relabel.py,
tests/python/remfin.py, tests/python/removeap.py,
tests/python/rs_like.py, tests/python/satmin.py,
tests/python/sbacc.py, tests/python/sccfilter.py,
tests/python/sccinfo.py, tests/python/sccsplit.py,
tests/python/semidet.py, tests/python/setacc.py,
tests/python/setxor.py, tests/python/simplacc.py,
tests/python/simstate.py, tests/python/sonf.py, tests/python/split.py,
tests/python/streett_totgba.py, tests/python/streett_totgba2.py,
tests/python/stutter.py, tests/python/sum.py,
tests/python/synthesis.py, tests/python/toparity.py,
tests/python/toweak.py, tests/python/tra2tba.py,
tests/python/trival.py, tests/python/twagraph.py,
tests/python/zlktree.py: Replace all occurrences of "assert" by calls
to unittest.TestCase methods.
2022-03-07 09:03:21 +01:00
Alexandre Duret-Lutz
7b7e1b254b tests: avoid seq
Partial fix for #501.

* tests/core/prodchain.test: Hardcode the seq output.
* tests/core/bricks.test: Use $AWK instead of seq.
* tests/core/defs.in: Define $AWK.
* NEWS: Mention the bug.
2022-03-04 17:25:37 +01:00
93fb11017b ltlfilt: add --sonf and --sonf-aps flags
* bin/ltlfilt.cc: Here.
* NEWS: Mention new ltlfilt flags.
* tests/Makefile.am, tests/core/sonf.test: Test these flags.
2022-03-04 17:24:26 +01:00
c71691659b tl: implement suffix operator normal form
* spot/tl/Makefile.am: New sonf files
* spot/tl/sonf.cc, spot/tl/sonf.hh: Here.
* python/spot/impl.i: include sonf.hh header
* doc/spot.bib: add entry for the SONF paper
* tests/Makefile.am: new python tests
* tests/python/formulas.ipynb: show sample usage
* tests/python/sonf.py: test automata equivalence before/after SONF
* NEWS: mention the change
2022-03-04 17:23:58 +01:00
926 changed files with 107075 additions and 23260 deletions

View file

@ -3,9 +3,9 @@
(require-final-newline . t)
(mode . global-whitespace)
(bug-reference-bug-regexp
. "\\(?:[Ff]ix\\(es\\)? \\|[Ii]ssue \\)#\\(?2:[0-9]+\\)")
. "\\(?1:\\(?:[Ff]ix\\(?:es\\)? \\|[Ii]ssue \\)#\\(?2:[0-9]+\\)\\)")
(bug-reference-url-format
. "https://gitlab.lrde.epita.fr/spot/spot/issues/%s")
. "https://gitlab.lre.epita.fr/spot/spot/issues/%s")
(mode . bug-reference)
(magit-branch-adjust-remote-upstream-alist ("origin/next" . "/"))))
(c++-mode . ((c-default-style . "gnu")

1
.gitignore vendored
View file

@ -4,6 +4,7 @@ configure
config.log
config.status
aclocal.m4
ltargz.m4
autom4te.cache
libtool
auto

View file

@ -19,12 +19,12 @@ debian-stable-gcc:
- branches
except:
- /wip/
image: gitlab-registry.lrde.epita.fr/spot/buildenv/debian:stable
image: gitlab-registry.lre.epita.fr/spot/buildenv/debian:stable
script:
- autoreconf -vfi
- ./configure --enable-max-accsets=256
- ./configure --enable-max-accsets=256 --enable-pthread
- make
- make distcheck
- make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-max-accsets=256 --enable-pthread'
artifacts:
when: always
paths:
@ -32,22 +32,47 @@ debian-stable-gcc:
- ./*.log
- ./*.tar.gz
# We build on Debian unstable because we want an up-to-date Automake.
# (See issue #512.) We do not run distcheck here to speedup this build
# that several other builds depend upon. Other builds will run distcheck.
make-dist:
stage: build
only:
- branches
except:
- /wip/
image: gitlab-registry.lre.epita.fr/spot/buildenv/debian
script:
- autoreconf -vfi
- ./configure --disable-static --enable-doxygen
- make
- make dist
- autoconf --trace='AC_INIT:$2' > VERSION
artifacts:
when: always
paths:
- spot-*/_build/sub/tests/*/*.log
- ./*.log
- ./*.tar.gz
- VERSION
# We --disable-devel for coverage, because debug mode replaces
# SPOT_UNREACHABLE by an assertion wich is never reachable, lowering
# our coverage.
debian-unstable-gcc-coverage:
stage: build
only:
- branches
except:
- /wip/
image: gitlab-registry.lrde.epita.fr/spot/buildenv/debian
image: gitlab-registry.lre.epita.fr/spot/buildenv/debian
script:
- autoreconf -vfi
- ./configure CXX='g++ --coverage' --enable-devel --disable-static --enable-doxygen
- ./configure CXX='g++ --coverage' --disable-devel --enable-warnings --disable-static --enable-doxygen
- make
- make check
- lcov --capture --directory . --no-external --output spot.info
- lcov --remove spot.info '*/bin/spot.cc' '*/bin/spot-x.cc' '*/spot/parse*/scan*.cc' '*/spot/parse*/parse*.cc' '*/utf8/*' '*/python/*' '*/buddy/*' '*/doc/org/tmp/*' --output spot2.info
- lcov --summary spot2.info
- genhtml --legend --demangle-cpp --output-directory coverage spot2.info
- gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root $PWD -e 'bin/spot.cc' -e 'bin/spot-x.cc' -e 'spot/bricks/.*' -e 'spot/parse.*/scan.*.cc' -e 'spot/parse.*/parse.*.cc' -e 'utf8/.*' -e 'python/.*' -e 'buddy/.*' -e 'doc/org/tmp/.*' --html-details coverage.html --html-tab-size 8 --fail-under-line 90.7
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
when: always
paths:
@ -55,50 +80,66 @@ debian-unstable-gcc-coverage:
- ./*.log
- doc/spot.html/
- doc/userdoc/
- coverage/
- coverage*.html
- coverage*.css
- ./*.tar.gz
- spot2.info
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
debian-unstable-gcc-pypy:
stage: build
stage: build2
needs:
- job: make-dist
artifacts: true
variables:
GIT_STRATEGY: none
only:
- branches
except:
- /wip/
image: gitlab-registry.lrde.epita.fr/spot/buildenv/debian
image: gitlab-registry.lre.epita.fr/spot/buildenv/debian
script:
- autoreconf -vfi
- VERSION=`cat VERSION`
- tar xvf spot-$VERSION.tar.gz
- cd spot-$VERSION
- ./configure PYTHON=/usr/bin/pypy3 --disable-static
- make
- make check TESTS='$(TESTS_python) $(TESTS_ipython)'
artifacts:
when: always
paths:
- tests/*/*.log
- ./*.log
- spot-*/tests/*/*.log
- spot-*/*.log
# With emacs now using gcc for on-the-fly compilation,
# we cannot rebuild the documentation using gcc-snapshot. So we start
# from the tarball instead.
debian-gcc-snapshot:
stage: build
stage: build2
needs:
- job: make-dist
artifacts: true
only:
- branches
except:
- /wip/
image: gitlab-registry.lrde.epita.fr/spot/buildenv/debian
image: gitlab-registry.lre.epita.fr/spot/buildenv/debian
script:
- export PATH="/usr/lib/gcc-snapshot/bin:$PATH" LD_LIBRARY_PATH="/usr/lib/gcc-snapshot/lib:$LD_LIBRARY_PATH"
- autoreconf -vfi
- VERSION=`cat VERSION`
- tar xvf spot-$VERSION.tar.gz
- cd spot-$VERSION
- ./configure --with-included-ltdl CXX='g++'
- make
- make distcheck DISTCHECK_CONFIGURE_FLAGS='--with-included-ltdl'
- make distcheck DISTCHECK_CONFIGURE_FLAGS='--with-included-ltdl'
allow_failure: true
artifacts:
when: always
paths:
- ./spot-*/_build/sub/tests/*/*.log
- ./*.log
- doc/spot.html/
- doc/userdoc/
- ./*.tar.gz
- spot-*/tests/*/*.log
- spot-*/*.log
alpine-gcc:
stage: build
@ -106,12 +147,12 @@ alpine-gcc:
- branches
except:
- /wip/
image: gitlab-registry.lrde.epita.fr/spot/buildenv/alpine
image: gitlab-registry.lre.epita.fr/spot/buildenv/alpine
script:
- autoreconf -vfi
- ./configure
- make
- make distcheck || { chmod -R u+w ./spot-*; false; }
- make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-pthread' || { chmod -R u+w ./spot-*; false; }
artifacts:
when: always
paths:
@ -125,7 +166,7 @@ arch-clang:
- branches
except:
- /wip/
image: gitlab-registry.lrde.epita.fr/spot/buildenv/arch
image: gitlab-registry.lre.epita.fr/spot/buildenv/arch
script:
- autoreconf -vfi
- ./configure --prefix ~/install_dir CC='clang -Qunused-arguments' CXX='clang++ -Qunused-arguments' --enable-devel --enable-c++20 --enable-doxygen
@ -138,22 +179,30 @@ arch-clang:
- ./*.log
arch-gcc-glibcxxdebug:
stage: build
stage: build2
needs:
- job: make-dist
artifacts: true
variables:
GIT_STRATEGY: none
only:
- branches
except:
- /wip/
image: gitlab-registry.lrde.epita.fr/spot/buildenv/arch
image: gitlab-registry.lre.epita.fr/spot/buildenv/arch
script:
- autoreconf -vfi
- ./configure --enable-devel --enable-c++20 --enable-glibcxx-debug
- VERSION=`cat VERSION`
- tar xvf spot-$VERSION.tar.gz
- mkdir build-$VERSION
- cd build-$VERSION
- ../spot-$VERSION/configure --enable-devel --enable-c++20 --enable-glibcxx-debug
- make
- make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-devel --enable-c++20 --enable-glibcxx-debug'
artifacts:
when: on_failure
paths:
- ./spot-*/_build/sub/tests/*/*.log
- ./*.log
- build-*/spot-*/_build/sub/tests/*/*.log
- build-*/*.log
mingw-shared:
stage: build2
@ -161,15 +210,17 @@ mingw-shared:
# We start from the tarball generated from a non-cross-compiling
# job, so that all generated files are included, especially those
# built from the executables.
- job: debian-stable-gcc
- job: make-dist
artifacts: true
variables:
GIT_STRATEGY: none
only:
- branches
except:
- /wip/
image: gitlab-registry.lrde.epita.fr/spot/buildenv/debian
image: gitlab-registry.lre.epita.fr/spot/buildenv/debian
script:
- VERSION=`autoconf --trace='AC_INIT:$2'`
- VERSION=`cat VERSION`
- tar xvf spot-$VERSION.tar.gz
- cd spot-$VERSION
- ./configure CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++-posix --host i686-w64-mingw32 --disable-python
@ -186,15 +237,17 @@ mingw-static:
# We start from the tarball generated from a non-cross-compiling
# job, so that all generated files are included, especially those
# built from the executables.
- job: debian-stable-gcc
- job: make-dist
artifacts: true
variables:
GIT_STRATEGY: none
only:
- branches
except:
- /wip/
image: gitlab-registry.lrde.epita.fr/spot/buildenv/debian
image: gitlab-registry.lre.epita.fr/spot/buildenv/debian
script:
- VERSION=`autoconf --trace='AC_INIT:$2'`
- VERSION=`cat VERSION`
- tar xvf spot-$VERSION.tar.gz
- cd spot-$VERSION
- mkdir install_dir
@ -214,17 +267,19 @@ mingw-static:
debpkg-stable:
stage: build
variables:
GIT_STRATEGY: none
only:
- /-deb$/
- master
- next
- stable
script:
- docker pull gitlab-registry.lrde.epita.fr/spot/buildenv/debian:stable
- vol=spot-stable-$CI_COMMIT_SHA
- docker pull gitlab-registry.lre.epita.fr/spot/buildenv/debian:stable
- vol=spot-stable-$CI_COMMIT_SHA-$CI_JOB_ID
- docker volume create $vol
- exitcode=0
- docker run -v $vol:/build/result --name helper-$vol gitlab-registry.lrde.epita.fr/spot/buildenv/debian:stable ./build-spot.sh $CI_COMMIT_REF_NAME -j${NBPROC-1} || exitcode=$?
- docker run -v $vol:/build/result --name helper-$vol gitlab-registry.lre.epita.fr/spot/buildenv/debian:stable ./build-spot.sh $CI_COMMIT_REF_NAME -j${NBPROC-1} || exitcode=$?
- docker cp helper-$vol:/build/result _build_stable || exitcode=$?
- docker rm helper-$vol || exitcode=$?
- docker volume rm $vol || exitcode=$?
@ -238,6 +293,8 @@ debpkg-stable:
debpkg-stable-i386:
stage: build2
variables:
GIT_STRATEGY: none
only:
- /-deb$/
- master
@ -246,11 +303,11 @@ debpkg-stable-i386:
tags: ["x86"]
needs: ["debpkg-stable"]
script:
- docker pull gitlab-registry.lrde.epita.fr/spot/buildenv/debian-i386:stable
- vol=spot-stable-$CI_COMMIT_SHA
- docker pull gitlab-registry.lre.epita.fr/spot/buildenv/debian-i386:stable
- vol=spot-stable-$CI_COMMIT_SHA-$CI_JOB_ID
- docker volume create $vol
- exitcode=0
- docker create -v $vol:/build/result --name helper-$vol gitlab-registry.lrde.epita.fr/spot/buildenv/debian-i386:stable ./bin-spot.sh -j${NBPROC-1} || exitcode=$?
- docker create -v $vol:/build/result --name helper-$vol gitlab-registry.lre.epita.fr/spot/buildenv/debian-i386:stable ./bin-spot.sh -j${NBPROC-1} || exitcode=$?
- docker cp _build_stable/. helper-$vol:/build/result || exitcode=$?
- rm -rf _build_stable
- docker start -a helper-$vol || exitcode=$?
@ -267,15 +324,17 @@ debpkg-stable-i386:
debpkg-unstable:
stage: build
variables:
GIT_STRATEGY: none
only:
- /-deb$/
- next
script:
- docker pull gitlab-registry.lrde.epita.fr/spot/buildenv/debian
- vol=spot-unstable-$CI_COMMIT_SHA
- docker pull gitlab-registry.lre.epita.fr/spot/buildenv/debian
- vol=spot-unstable-$CI_COMMIT_SHA-$CI_JOB_ID
- docker volume create $vol
- exitcode=0
- docker run -v $vol:/build/result --name helper-$vol gitlab-registry.lrde.epita.fr/spot/buildenv/debian ./build-spot.sh $CI_COMMIT_REF_NAME -j${NBPROC-1} || exitcode=$?
- docker run -v $vol:/build/result --name helper-$vol gitlab-registry.lre.epita.fr/spot/buildenv/debian ./build-spot.sh $CI_COMMIT_REF_NAME -j${NBPROC-1} || exitcode=$?
- docker cp helper-$vol:/build/result _build_unstable || exitcode=$?
- docker rm helper-$vol || exitcode=$?
- docker volume rm $vol || exitcode=$?
@ -289,17 +348,19 @@ debpkg-unstable:
debpkg-unstable-i386:
stage: build2
variables:
GIT_STRATEGY: none
only:
- /-deb$/
- next
tags: ["x86"]
needs: ["debpkg-unstable"]
script:
- docker pull gitlab-registry.lrde.epita.fr/spot/buildenv/debian-i386
- vol=spot-unstable-$CI_COMMIT_SHA
- docker pull gitlab-registry.lre.epita.fr/spot/buildenv/debian-i386
- vol=spot-unstable-$CI_COMMIT_SHA-$CI_JOB_ID
- docker volume create $vol
- exitcode=0
- docker create -v $vol:/build/result --name helper-$vol gitlab-registry.lrde.epita.fr/spot/buildenv/debian-i386 ./bin-spot.sh -j${NBPROC-1} || exitcode=$?
- docker create -v $vol:/build/result --name helper-$vol gitlab-registry.lre.epita.fr/spot/buildenv/debian-i386 ./bin-spot.sh -j${NBPROC-1} || exitcode=$?
- docker cp _build_unstable/. helper-$vol:/build/result || exitcode=$?
- rm -rf _build_unstable
- docker start -a helper-$vol || exitcode=$?
@ -315,20 +376,23 @@ debpkg-unstable-i386:
- _build_unstable/
rpm-pkg:
stage: build
stage: build2
needs:
- job: make-dist
artifacts: true
variables:
GIT_STRATEGY: none
only:
- /-rpm$/
- master
- next
- stable
image: gitlab-registry.lrde.epita.fr/spot/buildenv/fedora
image: gitlab-registry.lre.epita.fr/spot/buildenv/fedora
script:
- autoreconf -vfi
- ./configure
- make
- make dist
- cp spot-*.tar.gz ~/rpmbuild/SOURCES/
- cp spot.spec ~/rpmbuild/SPECS/
- VERSION=`cat VERSION`
- tar xvf spot-$VERSION.tar.gz spot-$VERSION/spot.spec
- cp spot-$VERSION.tar.gz ~/rpmbuild/SOURCES/
- cp spot-$VERSION/spot.spec ~/rpmbuild/SPECS/
- rpmbuild -bb ~/rpmbuild/SPECS/spot.spec
- mv ~/rpmbuild/RPMS/x86_64/*.rpm .
allow_failure: true
@ -340,6 +404,8 @@ rpm-pkg:
publish-rpm:
stage: publish
variables:
GIT_STRATEGY: none
only:
- /-rpm$/
- next
@ -350,6 +416,7 @@ publish-rpm:
- rpm-pkg
script:
- case $CI_COMMIT_REF_NAME in stable) rput fedora stable *.rpm;; next) rput fedora unstable *.rpm;; esac
- rm -rf ./*
publish-stable:
only:
@ -357,15 +424,24 @@ publish-stable:
tags:
- dput
stage: publish
variables:
GIT_STRATEGY: none
dependencies:
- debpkg-stable-i386
- make-dist
script:
- cd _build_stable
- ls -l
- dput lrde *.changes
- dput lrde `ls -t *amd64.changes | head -1` `ls -t *i386.changes | head -1`
- cd ..
- ls -l
- tgz=`ls spot-*.tar.* | head -n 1`
- case $tgz in *[0-9].tar.*) scp $tgz doc@perso:/var/www/dload/spot/;; esac
- curl -X POST -F ref=master -F token=$TRIGGER_SPOT_WEB -F "variables[spot_branch]=stable" https://gitlab.lrde.epita.fr/api/v4/projects/131/trigger/pipeline
- case $tgz in *[0-9].tar.*) scp $tgz doc@perso:/var/www/dload/spot/; scp $tgz doc@dload:/var/www/html/spot/;; esac
- rm -rf ./*
- curl -X POST -F ref=master -F token=$TRIGGER_SPOT_WEB -F "variables[spot_branch]=stable" https://gitlab.lre.epita.fr/api/v4/projects/131/trigger/pipeline
- curl -X POST "https://archive.softwareheritage.org/api/1/origin/save/git/url/https://gitlab.lre.epita.fr/spot/spot/"
- curl "https://web.archive.org/save/https://www.lrde.epita.fr/dload/spot/$tgz"
- curl "https://web.archive.org/save/https://www.lre.epita.fr/dload/spot/$tgz"
publish-unstable:
only:
@ -373,14 +449,19 @@ publish-unstable:
tags:
- dput
stage: publish
variables:
GIT_STRATEGY: none
dependencies:
- debpkg-unstable-i386
script:
- cd _build_unstable
- ls -l
- dput lrde *.changes
- curl -X POST -F ref=master -F token=$TRIGGER_SPOT_WEB -F "variables[spot_branch]=next" https://gitlab.lrde.epita.fr/api/v4/projects/131/trigger/pipeline
- curl -X POST -F ref=master -F token=$TRIGGER_SANDBOX https://gitlab.lrde.epita.fr/api/v4/projects/181/trigger/pipeline
- dput lrde `ls -t *amd64.changes | head -1` `ls -t *i386.changes | head -1`
- cd ..
- rm -rf _build_unstable
- curl -X POST -F ref=master -F token=$TRIGGER_SPOT_WEB -F "variables[spot_branch]=next" https://gitlab.lre.epita.fr/api/v4/projects/131/trigger/pipeline
- curl -X POST -F ref=master -F token=$TRIGGER_SANDBOX https://gitlab.lre.epita.fr/api/v4/projects/181/trigger/pipeline
raspbian:
stage: build
@ -401,3 +482,29 @@ raspbian:
- ./spot-*/_build/sub/tests/*/*.log
- ./*.log
- ./*.tar.gz
centos7:
stage: build2
needs:
- job: make-dist
artifacts: true
variables:
GIT_STRATEGY: none
only:
- branches
except:
- /wip/
image: gitlab-registry.lre.epita.fr/spot/buildenv/centos7
script:
- VERSION=`cat VERSION`
- tar xvf spot-$VERSION.tar.gz
- mkdir build-$VERSION
- cd build-$VERSION
- scl enable devtoolset-7 "../spot-$VERSION/configure --enable-devel"
- scl enable devtoolset-7 make
- scl enable devtoolset-7 "make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-devel --enable-optimizations'"
artifacts:
when: on_failure
paths:
- build-*/spot-*/_build/sub/tests/*/*.log
- build-*/*.log

20
.mailmap Normal file
View file

@ -0,0 +1,20 @@
Ala-Eddine Ben-Salem <ala@lrde.epita.fr> <ala@gaborone.lrde.epita.fr>
Ala-Eddine Ben-Salem <ala@lrde.epita.fr> <ala@pret-move.rsr.lip6.fr>
Ala-Eddine Ben-Salem <ala@lrde.epita.fr> <ala@gaborone.lrde.epita.fr>
Antoine Martin <amartin@lrde.epita.fr> <antoine97.martin@gmail.com>
Arthur Remaud <aremaud@lrde.epita.fr> <aremaud@avignon.lrde.epita.fr>
Arthur Remaud <aremaud@lrde.epita.fr> <aremaud@node7.lrde.epita.fr>
Damien Lefortier <dam@lrde.epita.fr> <eg@feather.vurt>
Felix Abecassis <felix.abecassis@lrde.epita.fr> <abecassis@bosc-guerard.lrde.epita.fr>
Felix Abecassis <felix.abecassis@lrde.epita.fr> <abecassis@scalea.lrde.epita.fr>
Felix Abecassis <felix.abecassis@lrde.epita.fr> <abecassis@lrde.epita.fr>
Guillaume Sadegh <sadegh@lrde.epita.fr>
Guillaume Sadegh <sadegh@lrde.epita.fr> <guillaume.sadegh@lrde.epita.fr>
Henrich Lauko <xlauko@mail.muni.cz>
Henrich Lauko <xlauko@mail.muni.cz> <henrich.lau@gmail.com>
Jerome Dubois <jdubois@lrde.epita.fr> Jérôme Dubois <jdubois@lrde.epita.fr>
Philipp Schlehuber-Caissier <philipp@lrde.epita.fr>
Thibaud Michaud <thibaud.michaud@epita.fr> <michau_n@epita.fr>
Thomas Badie <badie@lrde.epita.fr> <badie@champoteux.lrde.epita.fr>
Rachid Rebiha <rebiha>
Thomas Martinez <martinez>

129
AUTHORS
View file

@ -1,32 +1,101 @@
The following people have contributed code to Spot:
Ala-Eddine Ben-Salem
Alexandre Duret-Lutz
Alexandre Gbaguidi Aïsse
Alexandre Lewkowicz
Amaury Fauchille
Antoine Martin
Arthur Remaud
Clément Gillard
Damien Lefortier
Denis Poitrenaud
Elie Abi Saad
Étienne Renault
Félix Abecassis
Florian Renkin
Guillaume Sadegh
Heikki Tauriainen
Henrich Lauko
Jérôme Dubois
Laurent Xu
Maximilien Colange
Philipp Schlehuber
Pierre Parutto
Rachid Rebiha
Souheib Baarir
Thibaud Michaud
Thomas Badie
Thomas Martinez
Thomas Medioni
Tomáš Babiak
Vincent Tourneur
- Ala-Eddine Ben-Salem (2010-2012)
During is PhD thesis at EPITA.
- Alexandre Duret-Lutz (2002-)
During his master and then PhD at Université Pierre et Marie Curie.
Then as an employee of EPITA.
- Alexandre Gbaguidi Aïsse (2016-2017)
While a student at EPITA.
- Alexandre Lewkowicz (2014-2016)
While a student at EPITA.
- Amaury Fauchille (2016)
While a student at EPITA.
- Antoine Martin (2018-)
While a student at EPITA, and then during his PhD at EPITA.
- Arthur Remaud (2017)
While a student at EPITA.
- Clément Gillard (2017-2019)
While a student at EPITA.
- Damien Lefortier (2008-2010)
While a student at EPITA.
- Denis Poitrenaud (2004-2005)
As an employee of Univesité Paris V.
- Elie Abi Saad (2013)
While a student at EPITA.
- Étienne Renault (2013-2020)
During his PhD at EPITA & Université Pierre et Marie Curie.
Then as an employee of EPITA.
- Félix Abecassis (2009-2010)
While a student at EPITA.
- Florian Perlié-Long (2017)
While a student at EPITA.
- Florian Renkin (2020-)
During his PhD at EPITA.
Then as an employee of Université Paris Cité.
- Guillaume Sadegh (2008-2010)
While a student at EPITA.
- Heikki Tauriainen (2004-2005)
During his PhD at Helsinki University of Technology.
- Henrich Lauko (2017)
As an ERASMUS student from Masaryk University (Brno) visiting EPITA.
- Jérôme Dubois (2020-2021)
While a student at EPITA.
- Jonah Romero (2023)
During an internship at IMDEA Software Institute, supervised by Pierre Ganty.
- Laurent Xu (2016-2017)
While a student at EPITA.
- Maximilien Colange (2016-2018)
As an employee of EPITA.
- Philipp Schlehuber (2020-)
As an employee of EPITA.
- Pierre Parutto (2012)
While a student at EPITA.
- Rachid Rebiha (2003)
During his master's internship at Université Pierre et Marie Curie.
- Souheib Baarir (2004, 2008, 2013)
During his PhD at Université Pierre et Marie Curie.
Then during a sabatical visit at EPITA.
- Thibaud Michaud (2014, 2017)
While a student at EPITA.
- Thomas Badie (2011-2013)
While a student at EPITA.
- Thomas Martinez (2004)
While a student at EPITA.
- Thomas Medioni (2017)
During a master internship done at EPITA.
- Tomáš Babiak (2012)
During his PHD at Masaryk University (Brno).
- Vincent Tourneur (2017)
While a student at EPITA.

74
HACKING
View file

@ -5,11 +5,11 @@ Bootstraping from the GIT repository
Spot's gitlab page is at
https://gitlab.lrde.epita.fr/spot/spot
https://gitlab.lre.epita.fr/spot/spot
The GIT repository can be cloned with
git clone https://gitlab.lrde.epita.fr/spot/spot.git
git clone https://gitlab.lre.epita.fr/spot/spot.git
Some files in SPOT's source tree are generated. They are distributed
so that users do not need to install tools to rebuild them, but we
@ -25,7 +25,7 @@ since the generated files they produce are distributed.)
GNU Automake >= 1.11
GNU Libtool >= 2.4
GNU Flex >= 2.6
GNU Bison >= 3.0
GNU Bison >= 3.3
GNU Emacs (preferably >= 24 but it may work with older versions)
org-mode >= 9.1 (the version that comes bundled with your emacs
version is likely out-of-date; but distribution often have
@ -42,7 +42,7 @@ since the generated files they produce are distributed.)
A complete LaTeX distribution, including latexmk and extra fonts
like dsfont.sty.
ImageMagick
Python >= 3.5, IPython >= 2.3
Python >= 3.6, IPython >= 2.3
Jupyter >= 4, with nbconvert
GraphViz
Java >= 1.7 (needed to run PlantUML while generating the doc)
@ -55,7 +55,7 @@ only for certain operations (like releases):
pandoc used during Debian packaging for the conversion of
IPython notebooks to html
svgo for reducing SVG images before generating the tarball
(install with: npm install -g svgo)
(install with: npm install -g svgo@1.3.2)
ltl2ba used in the generated documentation and the test suite
ltl2dstar likewise
ltl3dra likewise
@ -290,8 +290,28 @@ would understand with:
make check LOG_DRIVER=$PWD/tools/test-driver-teamcity
Coding conventions
==================
Generating compile_commands.json
--------------------------------
The file compile_commands.json is used by many clang tools in order to
know how a single file is compiled (in particular, which include paths
should be used). Autotools-based build systems do not support the
generation of this file, but there is a tool called "bear" (for "Build
EAR") that is packaged with most distribution that can be used here.
Simply run a full build through "bear" using something like this:
% ./configure CC=clang-17 CXX=clang++-17
% make -j8 clean # make sure your will rebuild everything
% bear -- make -j8
This will simply intercept all command executions are record them in
the compile_commands.json database. Depending on the tools you plan to
use, you probably want to compile everything with clang, as shown above.
C++ Coding conventions
======================
Here some of the conventions we follow in Spot, so that the code looks
homogeneous. Please follow these strictly. Since this is free
@ -682,3 +702,43 @@ Other style recommandations
* Always code as if the person who ends up maintaining your code is
a violent psychopath who knows where you live.
Coding conventions for Python Tests
===================================
Unless you have some specific reason to write test cases in C++ (for
instance do test some specific C++ constructions, or to use valgrind),
prefer writing test cases in Python. Writing test cases in C++
requires some compilation, which slows down the test suite. Doing the
same test in Python is therefore faster, and it has the added benefit
of ensuring that the Python bindings works.
We have two types of Python tests: Python scripts or jupyter
notebooks. Jupyter notebooks are usually used for a sequence of
examples and comments that can also serve as part of the
documentation. Such jupyter notebooks should be added to the list of
code examples in doc/org/tut.org. Testing a notebook is done by the
tests/python/ipnbdoctest.py scripts, which evaluate each cells, and
checks that the obtainted result is equivalent to the result saved in
the notebook. The process is a bit slow, so plain Python scripts
should be prefered for most tests.
If you do need a notebook to tests Jupyter-specific code but this
notebook should not be shown in the documentation, use a filename
starting with '_'.
Tests written as Python scripts should follow the same convention as
shell scripts: exit 0 for PASS, exit 77 for SKIP, and any other exit
code for FAIL.
Do not use assert() in those scripts, as (1) asserts can be disabled,
and (2) they provide poor insights in case of failures. Instead do
from unittest import TestCase
tc = TestCase()
and then use tc.assertTrue(...), tc.assertEqual(..., ...),
tc.assertIn(..., ...), etc. In case of failures, those will print
useful messages in the trace of the tests. For instance multiline
strings that should have been equal will be presented with a diff.

View file

@ -1,9 +1,5 @@
## -*- coding: utf-8 -*-
## Copyright (C) 2011-2017, 2020 Laboratoire de Recherche et Développement
## de l'Epita (LRDE).
## Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
## département Systèmes Répartis Coopératifs (SRC), Université Pierre
## et Marie Curie.
## Copyright (C) by the Spot authors, see the AUTHORS file for details.
##
## This file is part of Spot, a model checking library.
##
@ -36,8 +32,9 @@ DOC_SUBDIR = doc
SUBDIRS = picosat buddy lib ltdl spot bin tests $(PYTHON_SUBDIR) $(DOC_SUBDIR) \
$(NEVER_SUBDIRS)
UTF8 = utf8/README.md utf8/utf8.h \
utf8/utf8/checked.h utf8/utf8/core.h utf8/utf8/unchecked.h
UTF8 = utf8/README.md utf8/LICENSE utf8/utf8.h \
utf8/utf8/checked.h utf8/utf8/core.h utf8/utf8/unchecked.h \
utf8/utf8/cpp11.h utf8/utf8/cpp17.h
DEBIAN = \
debian/changelog \
@ -68,7 +65,7 @@ EXTRA_DIST = HACKING ChangeLog.1 tools/gitlog-to-changelog \
tools/help2man tools/man2html.pl \
tools/test-driver-teamcity $(UTF8) $(DEBIAN) \
m4/gnulib-cache.m4 .dir-locals.el \
spot.spec spot.spec.in
spot.spec spot.spec.in README.ltsmin
dist-hook: gen-ChangeLog

841
NEWS
View file

@ -1,16 +1,706 @@
New in spot 2.10.4.dev (net yet released)
New in spot 2.12.2.dev (not yet released)
Command-line tools:
- ltlmix is a new tool that generates formulas by combining existing
ones. See https://spot.lre.epita.fr/ltlmix.html for examples.
- (BACKWARD INCOMPATIBILITY) ltlsynt's CSV output has been largely
overhauled, and the output columns have been both renamed (for
consistency) and augmented (with new statistics). The new CSV
output should be more useful when the input specification is
decomposed, in particular, there is a column giving the number of
sub-specifications obtained, and other statistics columns have
names starting with "max_" or "sum_" indicating how said
statistics are updated across sub-specifications.
See https://spot.lre.epita.fr/ltlsynt.html#csv for an example.
Additionally, --csv=FILENAME will now save the source filename for
the processed formulas as the first column of the CSV file, and
the "formula" column is no longer output by default to save space.
This "formula" column can be added back with the new option
--csv-with-formula=FILENAME if really needed.
- ltlsynt learned a --part-file option, to specify the partition of
input/output proposition from a *.part file, as used in several
other tools.
- ltlfilt learned a --relabel=io mode, that is useful to shorten
atomic propositions in the context of LTL synthesis. For instance
% ltlfilt -f 'G(req->Fack)&G(go->Fgrant)' --relabel=io --ins=req,go
G(i1 -> Fo0) & G(i0 -> Fo1)
The resulting formulas are now usable by ltlsynt without having to
specify which atomic propositions are input or output, as this can
be inferred from their name. (This suspports a --part-file option
as well.)
- ltlfilt learned --save-part-file[=FILENAME] option that can be
used to create partition files suitable for many synthesis tools
(including ltlsynt).
- genltl learned --lily-patterns to generate the example LTL
synthesis specifications from Lily 1.0.2. Those come with input
and output atomic proposition rewriten in the form "iNN" or "oNN",
so they can be fed to ltlsynt directly, as in
% genltl --lily-patterns | ltlsynt -q
- genltl's --pps-arbiter-standard and --pps-arbiter-strict have been
changed to rename variables {r1,r2,...,g1,g2...} as
{i1,i1,...,o1,o2,...} so that these formula can be fed directly to
ltlsynt.
- autfilt learned --restrict-dead-end-edges, to restricts labels of
edges leading to dead-ends. See the description of
restrict_dead_end_edges_here() below.
- autfilt learned --track-formula=F to label states with formulas
derived from F. (This is more precise on deterministic automata.)
- autfilt learned --mcs[=any|scc] to reorder states according to a
maximum cardinality search. The argument specifies how to break
ties.
- ltlfilt learned --pi1, --sigma1, --delta1, --pi2, --sigma2, and
--delta2 to filter according to classes Π₁,Σ₁,Δ₁,Π₂,Σ₂, and Δ₂.
- ltlfilt learned --to-delta2 to transform an LTL formula into Δ₂.
Library:
- restrict_dead_end_edges_here() can reduce non-determinism (but
not remove it) by restricting the label L of some edge (S)-L->(D)
going to a state D that does not have other successor than
itself. The conditions are detailled in the documentation of
this function.
- spot::postprocessor will now call restrict_dead_end_edges_here()
in its highest setting. This can be fine-tuned with the "rde"
extra option, see the spot-x (7) man page for detail.
- The formula class now keeps track of membership to the Δ₁, Σ₂,
Π₂, and Δ₂ syntactic class. This can be tested with
formula::is_delta1(), formula::is_sigma2(), formula::is_pi2(),
formula::is_delta2(). See doc/tl/tl.pdf from more discussion.
- spot::to_delta2() implements Δ₂-normalization for LTL formulas,
following "Efficient Normalization of Linear Temporal Logic" by
Esparza et al. (J. ACM, 2024).
- Trivial rewritings (those performed everytime at construction)
were missing the rule "[*0]|f ≡ f" when f already accepts the
empty word. (Issue #545.)
- spot::match_states(A, B) is a new function that returns a vector
V such that V[x] contains all states y such that state (x, y) can
reach an accepting cycle in product(A, B). In particular, if A
and B accept the same language, any word accepted by A from state
x can be accepted in B from some state in V[x].
That function also has a variant spot::match_states(A, f) where f
is an LTL formula. In this case it returns and array of
formulas. If f represents a superset of the language of A, then
any word accepted by A from state x satisfies V[x]. Related to
Issue #591.
- twa_graph::defrag_states(num) no longer require num[i]≤i; num
can now describe a permutation of the state numbers.
- spot::maximum_cardinality_search() and
spot::maximum_cardinality_search_reorder_here() are new function
to compute (and apply) an ordering of state based on a maximum
cardinality search.
Bug fixes:
- "ltlsynt --aiger -q ..." was still printing the realizability
status and the AIG circuit; it now does the job silently as
requested.
- ltlsynt had a minor memory leak
New in spot 2.12.2 (2025-01-18)
Bug fixes:
- to_finite() was dealing incorrectly with edges that were
both alive and dead. (Issue #596.)
- LaTeX output of the X[!] operator with broken in both
LaTeX and self-contained LaTeX mode. (Issue #597)
- Fix a bug in the AIGER encoding with certain forms of
global-equivalence.
- Work around a spurious test failure with Python 3.13.
New in spot 2.12.1 (2024-09-23)
Bug fixes:
- Generating random formula without any unary opertors would very
often create formulas much smaller than asked.
- The parity game solver, which internally works on "parity max
odd", but actually accept any type of parity acceptance, could be
confused by games with "parity min" acceptance using transition
with several colors (a rather uncommon situation).
- "ltlsynt ... --print-game --dot=ARGS" was ignoring ARGS.
- Work around various warnings from g++14.
- Improved handling of spot-extra/ directory with newer Swig
versions. Necessary to recompile Seminator 2 with Swig 4.
New in spot 2.12 (2024-05-16)
Build:
- When Python bindings are enabled, Spot now requires Python 3.6 or
later. Python 3.6 has reached end-of-life in 2021, but is still
used on CentOS 7 (which will reach end-of-support later in 2024).
Documentation:
- https://spot.lre.epita.fr/tut25.html is a new example showing
how to print an automaton in the "BA format" (used by Rabbit
and other tools).
Command-line tools:
- In places that accept format strings with '%' sequences, like
options --stats, --name, or --output, the new '%l' can now be used
to produce the 0-based serial number of the produced object. This
differs from the existing '%L' that is usually related to the line
number of the input (when that makes sense). For instance to
split a file that contains many automata into one file per
automaton, do
autfilt input.hoa -o output-%l.hoa
- For tools that produce automata, using -Hb or --hoa=b will produce
an HOA file in which aliases are used to form a basis for the
whole set of labels. Those aliases are only used when more than
one atomic proposition is used (otherwise, the atomic proposition
and its negation is already a basis). This can help reduce the
size of large HOA files.
- autfilt learned --separate-edges, to split the labels of
the automaton using a basis of disjoint labels. See
https://spot.lre.epita.fr/tut25.html for some motivation.
- autfilt learned --reduce-acceptance-set/--enlarge-acceptance-set
to heurisitcally remove/add to unnecessary acceptance marks in
Büchi automata. (Issue #570)
- ltlfilt has a new option --relabel-overlapping-bool=abc|pnn that
will replace boolean subformulas by fresh atomic propositions even
if those subformulas share atomic propositions.
- ltlsynt's --ins and --outs options will iterpret any atomic
proposition surrounded by '/' as a regular expression.
For intance with
ltlsynt --ins='/^in/,/env/' --outs=/^out/,/control/' ...
any atomic proposition that starts with 'in' or contains 'env'
will be considered as input, and one that starts with 'out'
or contain 'control' will be considered output.
By default, if neither --ins nor --outs is given, ltlsynt will
behave as if --ins='/^[iI]/' and --outs='/^[oO]/ were used.
- ltlsynt will now check for atomic propositions that always have
the same polarity in the specification. When this happens, these
output APs are replaced by true or false before running the
synthesis pipeline, and the resulting game, Mealy machine, or
Aiger circuit is eventually patched to include that constant
output. This can be disabled with --polarity=no.
- ltlsynt will now check for atomic propositions that are specified
as equivalent. When this is detected, equivalent atomic
propositions are replaced by one representative of their class, to
limit the number of different APs processed by the synthesis
pipeline. The resulting game, Mealy machine, or Aiger circuit is
eventually patched to include the removed APs. This optimization
can be disabled with --global-equivalence=no. As an exception, an
equivalence between input and output signals (such as G(in<->out))
will be ignored if ltlsynt is configured to output a game (because
patching the game a posteriori is cumbersome if the equivalence
concerns different players).
- genaut learned two new familes of automata, --cycle-log-nba and
--cycle-onehot-nba. They both create a cycle of n^2 states that
can be reduced to a cycle of n states using reduction based on
direct simulation.
Library:
- split_2step has now multiple ways to split for improved performance.
The option can be controlled via the synthesis_info::splittype
- EXPL: explicit splitting of each state as before
- SEMISYM: The outgoing transition of each state are encoded
as a bdd; Works better for larger number of input APs
- FULLYSYM: The automaton is first translated into a
fully symbolic version, then split.
- AUTO: Let the heuristic decide what to do.
- The following new trivial simplifications have been implemented for SEREs:
- 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, j+l-1]
- The following new trivial simplifications have been implemented
for PSL operators:
- {[*]}[]->0 = 0
- {[*]}<>->1 = 1
- The HOA parser is a bit smarter when merging multiple initial
states into a single initial state (Spot's automaton class
supports only one): it now reuses the edges leaving initial states
without incoming transitions.
- The automaton parser has a new option "drop_false_edges" to
specify whether edges labeled by "false" should be ignored during
parsing. It is enabled by default for backward compatibility.
- spot::bdd_to_cnf_formula() is a new variant of spot::bdd_to_formula()
that converts a BDD into a CNF instead of a DNF.
- spot::relabel_bse() has been improved to better deal with more
cases. For instance '(a & b & c) U (!c & d & e)' is now
correctly reduced as '(p0 & p1) U (!p1 & p2)', and
'((a & !b) | (a->b)) U c' now becomes '1 U c'. (Issue #540.)
- spot::relabel_overlapping_bse() is a new function that will
replace boolean subformulas by fresh atomic propositions even if
those subformulas share atomic propositions.
- spot::translate() has a new -x option "relabel-overlap=M" that
augments the existing "relabel-bool=N". By default, N=4, M=8.
When the formula to translate has more than N atomic propositions,
relabel_bse() is first called to attempt to rename non-overlapping
boolean subexpressions (i.e., no shared atomic proposition) in
order to reduce the number of atomic proposition, a source of
exponential explosion in several places of the translation
pipeline. This relabel-bool optimization exists since Spot 2.4.
The new feature is that if, after relabel-bool, the formula still
has more than M atomic propositions, then spot::translate() now
attempts to relabel boolean subexpressions even if they have
overlapping atomic propositions, in an attempt to reduce the
number of atomic proposition even more. Doing so has the slightly
unfortunate side effect of hindering some simplifications (because
the new atomic propositions hide their interactions), but it
usually incures a large speedup. (See Issue #500, Issue #536.)
For instance on Alexandre's laptop, running
'ltlsynt --tlsf SPIReadManag.tlsf --aiger'
with Spot 2.11.6 used to produce an AIG circuit with 48 nodes in
36 seconds; it now produces an AIG circuit with 53 nodes in only
0.1 second.
- spot::contains_forq() is an implementation of the paper "FORQ-Based
Language Inclusion Formal Testing" (Doveri, Ganty, Mazzocchi;
CAV'22) contributed by Jonah Romero.
- spot::contains() still defaults to the complementation-based
algorithm, however by calling
spot::containment_select_version("forq") or by setting
SPOT_CONTAINMENT_CHECK=forq in the environment, the
spot::contains_forq() implementation will be used instead when
applicable (inclusion between Büchi automata).
The above also impacts autfilt's --included-in option.
- spot::reduce_buchi_acceptance_set_here() and
spot::enlarge_buchi_acceptance_set_here() will heuristically
remove/add unnecessary acceptance marks in Büchi automata.
(Issue #570.)
- Given a twa_word_ptr W and a twa_ptr A both sharing the same
alphabet, one can now write W->intersects(A) or A->intersects(W)
instead of the longuer W->as_automaton()->intersects(A) or
A->intersects(W->as_automaton()).
- spot::scc_info has a new option PROCESS_UNREACHABLE_STATES that
causes it to enumerate even unreachable SCCs.
- spot::realizability_simplifier is a new class that performs the
removal of superfluous APs that is now performed by ltlsynt
(search for --polarity and --global-equivalence above).
- scc_filter used to reduce automata tagged with the inherently-weak
property to weak Büchi automata (unless the acceptance was already
t or co-Büchi). In cases where the input automaton had no
rejecting cycle, the Büchi acceptance was overkill: scc_filter
will now use "t" acceptance. This change may have unexpected
consequences in code paths that assume running scc_filter on a
Büchi automaton will always return a Büchi automaton. For those,
a "keep_one_color" option has been added to scc_filter.
- spot::separate_edges() and spot::edge_separator offers more ways
to split labels. See https://spot.lrde.epita.fr/ipynb/split.html
- ltsmin's interface will now point to README.ltsmin in case an
error is found while running divine or spins.
- spot::is_safety_automaton() was generalized to detect any
automaton for which the acceptance could be changed to "t" without
changing the language. In previous versions this function assumed
weak automata as input, but the documentation did not reflect
this.
- spot::remove_alternation() has a new argument to decide whether it
should raise an exception or return nullptr if it requires more
acceptance sets than supported.
- spot::dualize() learned a trick to be faster on states that have
less outgoing edges than atomic proposition declared on the
automaton. spot::remove_alternation(), spot::tgba_powerset(),
simulation-based reductions, and spot::tgba_determinize() learned
a similar trick, except it isn't applied at the state level but if
the entire automaton uses few distinct labels. These changes may
speed up the processing of automata with many atomic propositions
but few distinct labels. (Issue #566 and issue #568.)
Backward incompatibilities:
- spot::dualize() does not call cleanup_acceptance() anymore. This
change ensures that the dual of a Büchi automaton will always be a
co-Büchi automaton. Previously cleanup_acceptance(), which remove
unused colors from the acceptance, was sometimes able to simplify
co-Büchi to "t", causing surprizes.
- Function minimize_obligation_garanteed_to_work() was renamed to
minimize_obligation_guaranteed_to_work(). We believe this
function is only used by Spot currently.
- Function split_independant_formulas() was renamed to
split_independent_formulas(). We believe this function is only
used by Spot currently.
Python:
- The spot.automata() and spot.automaton() functions now accept a
drop_false_edges=False argument to disable the historical behavior
of ignoring edges labeled by False.
- Calling aut.highlight_state(s, None) or aut.highlight_edge(e,
None) may now be used to remove the highlighting color of some
given state or edge. Use aut.remove_highlight_states() or
aut.remove_highlight_edges() to remove all colors. (Issue #554.)
- Calling aut.get_hight_state(s) or get.highlight_edge(e) will
return the highlight color of that state/edge or None.
- Recent version Jupyter Notebook and Jupyter Lab started to render
SVG elements using <img...> tag to make it easier to copy/paste
those images. This breaks several usages, including the
possibility to have informative tooltips on states and edges (used
in Spot). See the following issues for more details.
https://github.com/jupyter/notebook/issues/7114
https://github.com/jupyterlab/jupyterlab/issues/10464
This version of Spot now declares its svg outputs as HTML to
prevent Jypyter from wrapping them is images.
Bugs fixed:
- tgba_determinize()'s use_simulation option would cause it to
segfault on automata with more than 2^16 SCCs, due to overflows in
computations of indices in the reachability matrix for SCCs.
(Issue #541.) This has been fixed by disabling the use_simulation
optimization in this case.
- product_or_susp() and product_susp() would behave incorrectly in
presence of unsatisifable or universal acceptance conditions that
were not f or t. (Part of issue #546.)
- Several algorithms were incorrectly dealing with the "!weak"
property. Because they (rightly) assumed that a weak input would
produce a weak output, they also wrongly assumed that a non-weak
output would produce a non-weak output. Unfortunately removing
states or edges in a non-weak automaton can lead a weak automaton.
The incorrect property lead to issue #546. In addition to fixing
several algorithms, product() and print_hoa() will now raise an
exception if automaton with t or f acceptance is declared !weak.
(This cheap check will not catch all automata incorrectly labeled
by !weak, but helps detects some issues nonetheless.)
- The automaton parser forgot to update the list of highlighted
edges while dropping edges labeled by bddfalse. (issue #548.)
- The comparison operators for acceptance condition (==, !=)
could fail to equate two "t" condition, because we have two ways
to represent "t": the empty condition, or the empty "Inf({})".
- Functions complement() and change_parity() could incorrectly read
or write the unused edge #0. In the case of complement(), writing
that edge was usually harmless. However, in some scenario,
complement could need to stick a ⓪ acceptance mark on edge #0,
then the acceptance condition could be simplified to "t", and
finally change_parity could be confused to find such an accepting
mark in an automaton that declares no colors, and perform some
computation on that color that caused it to crash with a "Too many
acceptance sets used" message. (issue #552)
- The detection of terminal automata used did not exactly
match the definition used in the HOA format. The definition
of a terminal automaton is supposed to be:
1. the automaton is weak
2. its accepting SCCs are complete
3. no accepting cycle can reach a rejecting cycle
However the implementation actually replaced the last point
by the following variant:
3'. no accepting edge can reach a rejecting cycle
This caused issues in automata with t acceptance. Fixing the code
by replacing 3' by 3 this also made the third argument of
is_terminal_automaton(), an optional boolean indicating whether
transition between SCCs should be ignored when computing 3',
completely obsolete. This third argument has been marked as
depreated. (Issue #553)
- twa::defrag_states(), which is called for instance by
purge_dead_state(), did not update the highlight-edges property.
(Issue #555.)
- spot::minimize_obligation will skip attempts to complement very
weak automata when those would require too many acceptance sets.
- acd_transform() was not used by spot::postprocessor unless an
option_map was passed. This was due to some bad default for the
"acd" option: it defaulted to true when an option_map was given,
and to false otherwise. This had no consequences on
ltl2tgba/autfilt were some option_map is always passed, but for
instance the parity automata generated by spot.postprocessor in
Python were not using ACD by default.
- Using spot::postprocessor to produce colored parity automata could
fail to color some transiant edges when the "acd" option was
activated.
- The formula printer incorrectly replaced a SERE like "(!a)[*3];a"
by "a[->]". The latter should only replace "(!a)[*];a".
(Issue #559.)
- The configure script failed to detect the include path for Python 3.12.
(Issue #577.)
- Work around many failures caused by incorrect rounding of floating
point values in the counting of transitions. (Issue #582)
- Some incorrectly escaped strings in Python code were causing
warnings with Python 3.12.
New in spot 2.11.6 (2023-08-01)
Bug fixes:
- Running command lines such as "autfilt input.hoa -o output-%L.hoa"
where thousands of different filenames can be created failed with
"Too many open files". (Issue #534)
- Using --format=... on a tool that output formulas would force
the output on standard output, even when --output was given.
- Using "randltl -S" did not correctly go through the SERE printer
functions.
- Our copy of BuDDy's bdd_forall() had a 20 year old typo that
caused cache entries from bdd_exist() and bdd_forall() to be
mixed. Spot was safe from this bug because it was only using
bdd_exist(). (Issue #535)
- Work around recent Pandas and GCC changes.
New in spot 2.11.5 (2023-04-20)
Bug fixes:
- Fix spurious failure of ltlsynt2.test when Python is not installed
(issue #530).
- Building from the git repository would fail to report a missing
emacs (issue #528).
- Fix exception raised by aut1.intersecting_run(aut2).as_twa()
because the run did not match transitions present in aut1
verbatim. We also changed the behavior of as_twa() to not merge
identical states.
- Fix segfaults occuring in determinization of 1-state terminal
automata.
- Fix incorrect assertion in game solver when the edge vector
contains deleted transitions.
New in spot 2.11.4 (2023-02-10)
Python:
- spot.acd() no longer depends on jQuery for interactivity.
Bug fixes:
- When merging initial states from state-based automata with
multiple initial states (because Spot supports only one), the HOA
parser could break state-based acceptance. (Issue #522.)
- autfilt --highlight-word refused to work on automata with Fin
acceptance for historical reasons, however the code has been
perfectly able to handle this for a while. (Issue #523.)
- delay_branching_here(), a new optimization of Spot 2.11 had an
incorrect handling of states without successors, causing some
segfaults. (Issue #524.)
- Running delay_branching_here() on state-based automata (this was not
done in Spot so far) may require the output to use transition-based
acceptance. (Issue #525.)
- to_finite(), introduce in 2.11, had a bug that could break the
completeness of automata and trigger an exception from the HOA
printer. (Issue #526.)
New in spot 2.11.3 (2022-12-09)
Bug fixes:
- Automata-based implication checks, used to simplify formulas were
slower than necessary because the translator was configured to
favor determinism unnecessarily. (Issue #521.)
- Automata-based implication checks for f&g and f|g could be
very slow when those n-ary operator had two many arguments.
They have been limited to 16 operands, but this value can be changed
with option -x tls-max-ops=N. (Issue #521 too.)
- Running ltl_to_tgba_fm() with an output_aborter (which is done
during automata-based implication checks) would leak memory on
abort.
- configure --with-pythondir should also redefine pyexecdir,
otherwise, libraries get installed in the wrong place on Debian.
(Issue #512.)
- The HOA parser used to silently declare unused and undefined states
(e.g., when the State: header declare many more states than the body
of the file). It now warns about those.
- 'autfilt -c ...' should display a match count even in presence of
parse errors.
- Calling solve_parity_game() multiple times on the same automaton
used to append the new strategy to the existing one instead of
overwriting it.
New in spot 2.11.2 (2022-10-26)
Command-line tools:
- The --stats specifications %s, %e, %t for printing the number of
(reachable) states, edges, and transitions, learned to support
options [r], [u], [a] to indicate if only reachable, unreachable,
or all elements should be counted.
Library:
- spot::reduce_parity() now has a "layered" option to force all
transition in the same parity layer to receive the same color;
like acd_transform() would do.
Bugs fixed:
- Fix pkg-config files containing @LIBSPOT_PTHREAD@ (issue #520)
- spot::relabel_bse() was incorrectly relabeling some dependent
Boolean subexpressions in SERE. (Note that this had no
consequence on automata translated from those SERE.)
New in spot 2.11.1 (2022-10-10)
Bugs fixed:
- Fix a build issue preventing the update of website (issue #516).
- Fix a compilation error with clang-14 on FreeBSD (issue #515).
New in spot 2.11 (2022-10-08)
Build:
- configure will now diagnose situations where Python bindings will
be installed in a directory that is not part of Python's search
path. A new configure option --with-pythondir can be used to
modify this installation path.
- A new configure option --enable-pthread enables the compilation of
Spot with -pthread, and render available the parallel version of
some algorithms. If Spot is compiled with -pthread enabled, any
user linking with Spot should also link with the pthread library.
In order to not break existing build setups using Spot, this
option is currently disabled by default in this release. We plan
to turn it on by default in some future release. Third-party
project using Spot may want to start linking with -pthread in
prevision for this change.
Command-line tools:
- autfilt has a new options --aliases=drop|keep to specify
if the output code should attempt to preserve aliases
if the HOA printer should attempt to preserve aliases
present in the HOA input. This defaults to "keep".
- autfilt has a new --to-finite option, illustrated on
https://spot.lrde.epita.fr/tut12.html
- ltlfilt has a new --sonf option to produce a formula's Suffix
Operator Normal Form, described in [cimatti.06.fmcad]. The
associated option --sonf-aps allows listing the newly introduced
atomic propositions.
- autcross learned a --language-complemented option to assist in the
case one is testing tools that complement automata. (issue #504).
- ltlsynt has a new option --tlsf that takes the filename of a TLSF
specification and calls syfco (which must be installed) to convert
it into an LTL formula.
- ltlsynt has a new option --from-pgame that takes a parity game in
extended HOA format, as used in the Synthesis Competition.
- ltlsynt has a new option --hide-status to hide the REALIZABLE or
UNREALIZABLE output expected by SYNTCOMP. (This line is
superfluous, because the exit status of ltlsynt already indicate
whether the formula is realizable or not.)
- ltlsynt has a new option --dot to request GraphViz output instead
of most output. This works for displaying Mealy machines, games,
or AIG circuits. See https://spot.lrde.epita.fr/ltlsynt.html for
examples.
- genaut learned the --cyclist-trace-nba and --cyclist-proof-dba
options. Those are used to generate pairs of automata that should
include each other, and are used to show a regression (in speed)
present in Spot 2.10.x and fixed in 2.11.
- genltl learned --eil-gsi to generate a familly a function whose
translation and simplification used to be very slow. In particular
genltl --eil-gsi=23 | ltlfilt --from-ltlf | ltl2tgba
was reported as taking 9 days. This is now instantaneous.
Library:
- The new function suffix_operator_normal_form() implements
transformation of formulas to Suffix Operator Normal Form,
described in [cimatti.06.fmcad].
- "original-classes" is a new named property similar to
"original-states". It maps an each state to an unsigned integer
such that if two classes are in the same class, they are expected
@ -21,16 +711,20 @@ New in spot 2.10.4.dev (net yet released)
- tgba_determinize() learned to fill the "original-classes" property.
States of the determinized automaton that correspond to the same
subset of states of the original automaton belong to the same
class. Filling this property is only done on demand has it inccurs
on small overhead.
class. Filling this property is only done on demand as it inccurs
a small overhead.
- sbacc() learned to take the "original-classes" property into
account and preserve it.
account and to preserve it.
- The HOA parser and printer learned to map the synthesis-outputs
property of Spot to the controllable-AP header for the Extended
HOA format used in SyntComp. https://arxiv.org/abs/1912.05793
- The automaton parser learned to parse games in the PGSolver format.
See the bottom of https://spot.lrde.epita.fr/ipynb/games.html for
an example.
- "aliases" is a new named property that is filled by the HOA parser
using the list of aliases declared in the HOA file, and then used
by the HOA printer on a best-effort basis. Aliases can be used to
@ -57,14 +751,147 @@ New in spot 2.10.4.dev (net yet released)
- purge_dead_states() will now also remove edges labeled by false
(except self-loops).
- When parsing formulas with a huge number of operands for an n-ary
operator (for instance 'p1 | p2 | ... | p1000') the LTL parser
would construct that formula two operand at a time, and the
formula constructor for that operator would be responsible for
inlining, sorting, deduplicating, ... all operands at each step.
This resulted in a worst-than-quadratic slowdown. This is now
averted in the parser by delaying the construction of such n-ary
nodes until all children are known.
- complement() used to always turn tautological acceptance conditions
into Büchi. It now only does that if the automaton is modified.
- The zielonka_tree construction was optimized using the same
memoization trick that is used in ACD. Additionally it can now be
run with additional options to abort when the tree as an unwanted
shape, or to turn the tree into a DAG.
- contains() can now take a twa as a second argument, not just a
twa_graph. This allows for instance to do contains(ltl, kripke)
to obtain a simple model checker (that returns true or false,
without counterexample).
- degeneralize() and degeneralize_tba() learned to work on
generalized-co-Büchi as well.
- product() learned that the product of two co-Büchi automata
is a co-Büchi automaton. And product_or() learned that the
"or"-product of two Büchi automata is a Büchi automaton.
- spot::postprocessor has a new extra option "merge-states-min" that
indicates above how many states twa_graph::merge_states() (which
perform a very cheap pass to fuse states with identicall
succesors) should be called before running simulation-based
reductions.
- A new function delay_branching_here(aut) can be used to simplify
some non-deterministic branching. If two transitions (q₁,,M,q₂)
and (q₁,,M,q₃) differ only by their destination state, and are
the only incoming transitions of their destination states, then q₂
and q₃ can be merged (taking the union of their outgoing
transitions). This is cheap function is automatically called by
spot::translate() after translation of a formula to GBA, before
further simplification. This was introduced to help with automata
produced from formulas output by "genltl --eil-gsi" (see above).
- spot::postprocessor has new configuration variable branch-post
that can be used to control the use of branching-postponement
(disabled by default) or delayed-branching (see above, enabled by
default). See the spot-x(7) man page for details.
- spot::postprocessor is now using acd_transform() by default when
building parity automata. Setting option "acd=0" will revert
to using "to_parity()" instead.
- to_parity() has been almost entirely rewritten and is a bit
faster.
- When asked to build parity automata, spot::translator is now more
aggressively using LTL decomposition, as done in the Generic
acceptance case before paritizing the result. This results in
much smaller automata in many cases.
- spot::parallel_policy is an object that can be passed to some
algorithm to specify how many threads can be used if Spot has been
compiled with --enable-pthread. Currently, only
twa_graph::merge_states() supports it.
Python bindings:
- The to_str() method of automata can now export a parity game into
the PG-Solver format by passing option 'pg'. See
https://spot.lrde.epita.fr/ipynb/games.html for an example.
Deprectation notice:
- spot::pg_print() has been deprecated in favor of spot::print_pg()
for consistency with the rest of the API.
Bugs fixed:
- calling twa_graph::new_univ_edge(src, begin, end, cond, acc) could
produce unexpected result if begin and end where already pointing
into the universal edge vector, since the later can be
reallocated during that process.
- Printing an alternating automaton with print_dot() using 'u' to
hide true state could produce some incorrect GraphViz output if
the automaton as a true state as part of a universal group.
- Due to an optimization introduces in 2.10 to parse HOA label more
efficiently, the automaton parser could crash when parsing random
input (not HOA) containing '[' (issue #509).
New in spot 2.10.6 (2022-05-18)
Bugs fixed:
- Fix compilation error on MacOS X.
- Using -Ffile/N to read column N of a CSV file would not reset the
/N specification for the next file.
- make_twa_graph() will now preserve state number when copying a
kripke_graph object. As a consequence, print_dot() and
print_hoa() will now use state numbers matching those of the
kripke_graph (issue #505).
- Fix several compilation warning introduced by newer versions
of GCC and Clang.
New in spot 2.10.5 (2022-05-03)
Bugs fixed:
- reduce_parity() produced incorrect results when applied to
automata with deleted edges.
- work around a portability issue in Flex 2.6.4 preventing
- An optimization of Zielonka could result in incorrect results
in some cases.
- ltlsynt --print-pg incorrectly solved the game in addition to
printing it.
- ltlsynt would fail if only one of --ins or --outs was set, and
if it was set empty.
- Work around a portability issue in Flex 2.6.4 preventing
compilation on OpenBSD.
- Do not use the seq command in test cases, it is not available
everywhere.
- Do not erase the previous contents of the PYTHONPATH environment
variable when running tests, prepend to it instead.
- Simplify Debian instructions for LTO build to work around newer
libtool version.
- Fix invalid read in digraph::sort_edges_of_(), currently unused in
Spot.
New in spot 2.10.4 (2022-02-01)
Bug fixed:
@ -1424,7 +2251,7 @@ New in spot 2.6.2 (2018-09-28)
- We no longer distribute the Python-based CGI script + javascript
code for the online translator. Its replacement has its own
repository: https://gitlab.lrde.epita.fr/spot/spot-web-app/
repository: https://gitlab.lre.epita.fr/spot/spot-web-app/
Library:

58
README
View file

@ -76,7 +76,7 @@ Requirements
Spot requires a C++17-compliant compiler. G++ 7.x or later, as well
as Clang++ 5.0 or later should work.
Spot expects a complete installation of Python (version 3.5 or later).
Spot expects a complete installation of Python (version 3.6 or later).
Especially, Python's headers files should be installed. If you don't
have Python installed, and do NOT want to install it, you should run
configure with the --disable-python option (see below).
@ -93,6 +93,10 @@ automata.
If the SAT-solver glucose is found on your system, it will be used by
our test suite to test our SAT-based minimization algorithm.
If you want to use Spot with DiVinE2 (for model checking DVE models)
or with SpinS (for model checking Promela models), please read the
file named "README.ltsmin" for installation instructions.
Spot used to distribute a modified version of LBTT (an LTL to Büchi
test bench), mostly fixing errors reported by recent compilers.
However Spot now distributes its own reimplementation of LBTT, called
@ -110,16 +114,16 @@ Spot follows the traditional `./configure && make && make check &&
make install' process. People unfamiliar with the GNU Build System
should read the file INSTALL for generic instructions.
If you plan to use the Python binding, we recommend you use one
of the following --prefix options when calling configure:
If you plan to use the Python bindings, we recommend you use the
following --prefix options when calling configure:
--prefix /usr
--prefix /usr/local (the default)
--prefix ~/.local (if you do not have root permissions)
--prefix ~/.local
The reason is that all these locations are usually automatically
searched by Python. If you use a different prefix directory, you may
have to tune the PYTHONPATH environment variable.
The reason is that ~/.local/lib/python3.X/site-packages, where Spot's
Python bindings will be installed, is automatically searched by
Python. If you use a different prefix directory, you may have to tune
the PYTHONPATH environment variable, or use the --with-pythondir
option to specify different installation paths.
In addition to its usual options, ./configure will accept some
flags specific to Spot:
@ -129,7 +133,7 @@ flags specific to Spot:
offers a convenient interface when used in an IPython notebook,
and are also used to build the CGI script that translates LTL
formulas on-line. You may safely disable these, especially if you
do not have a working Python 3.2+ installation or if you are
do not have a working Python 3.6+ installation or if you are
attempting some cross-compilation.
--enable-max-accsets=N
@ -173,6 +177,12 @@ flags specific to Spot:
client code should be compiled with -D_GLIBCXX_DEBUG as well. This
options should normally only be useful to run Spot's test-suite.
--enable-pthread
Build and link with the -pthread option, and activate a few
parallel variants of the algorithms. This is currently disabled
by default, as it require all third-party tools using Spot to
build with -pthread as well.
--enable-c++20
Build everything in C++20 mode. We use that in our build farm to
ensure that Spot can be used in C++20 projects as well.
@ -244,17 +254,31 @@ To test the Python bindings, try running
>>> import spot
>>> print(spot.version())
If you installed Spot with a prefix that is not one of those suggested
in the "Building and installing" section, it is likely that the above
import statement will fail to locate the spot package. You can show
the list of directories that are searched by Python using:
If you installed Spot with a prefix that is not searched by Python by
default it is likely that the above import statement will fail to
locate the spot package. You can show the list of directories that
are searched by Python using:
% python3
>>> import sys
>>> print(sys.path)
And you can modify that list of searched directories using the
PYTHONPATH environment variable.
PYTHONPATH environment variable. Alternatively, you can instruct Spot
to install its Python files in one of those directory using the
--with-pythondir configure option. As an example, an issue in
distributions derived from Debian is that if you run
./configure && make && make install
Python files get installed in /usr/local/lib/python3.X/site-packages
while Debian's version of Python only looks for them into
/usr/local/lib/python3.X/dist-packages instead. You can fix that by
instructing configure that you want packages installed into the right
directory instead:
./configure --with-pythondir=/usr/local/lib/python3.X/dist-packages \
&& make && make install
To test if man pages can be found, simply try:
@ -319,13 +343,13 @@ bench/ Benchmarks for ...
wdba/ ... WDBA minimization (for obligation properties).
python/ Python bindings for Spot and BuDDy
Third party software
Third-party software
--------------------
buddy/ A customized version of BuDDy 2.3 (a BDD library).
ltdl/ Libtool's portable dlopen() wrapper library.
lib/ Gnulib's portability modules.
utf8/ Nemanja Trifunovic's utf-8 routines.
utf8/ Trifunovic's utf-8 routines. https://github.com/nemtrif/utfcpp
elisp/ Related emacs modes, used for building the documentation.
picosat/ A distribution of PicoSAT 965 (a satsolver library).
spot/bricks/ A collection of useful C++ code provided by DiVinE

View file

@ -31,7 +31,7 @@ Installation of DiVinE
Use the following commands to compile and install the patched version
of DiVinE.
git clone https://gitlab.lrde.epita.fr/spot/divine-ltsmin-deb
git clone https://gitlab.lre.epita.fr/spot/divine-ltsmin-deb
cd divine-ltsmin-deb
mkdir _build && cd _build
cmake .. -DMURPHI=OFF -DHOARD=OFF -DGUI=OFF -DRX_PATH= -DCMAKE_INSTALL_PREFIX=$HOME/usr

20
THANKS
View file

@ -5,22 +5,31 @@ Andreas Tollkötter
Andrew Wells
Anton Pirogov
Ayrat Khalimov
Blake C. Rawlings
Cambridge Yang
Caroline Lemieux
Christian Dax
Christopher Ziegler
Clément Tamines
Daniel Stan
David Dokoupil
David Müller
Dávid Smolka
Edmond Irani Liu
Emmanuel Filiot
Ernesto Posse
Étienne Renault
Fabrice Kordon
Fangyi Zhou
Felix Klaedtke
Florian Perlié-Long
František Blahoudek
Gerard J. Holzmann
Guillermo A. Perez
Hashim Ali
Heikki Tauriainen
Henrich Lauko
Jacopo Binchi
Jan Strejček
Jean-Michel Couvreur
Jean-Michel Ilié
@ -32,6 +41,7 @@ Juan Tzintzun
Juraj Major
Kristin Y. Rozier
Marc Espie
Marek Jankola
Martin Dieguez Lodeiro
Matthias Heizmann
Maxime Bouton
@ -41,14 +51,20 @@ Michael Weber
Mikuláš Klokočka
Ming-Hsien Tsai
Nikos Gorogiannis
Ondřej Lengál
Paul Guénézan
Pierre Ganty
Raven Beutner
Reuben Rowe
Roei Nahum
Rüdiger Ehlers
Silien Hong
Simon Jantsch
Samuel Judson
Scott Buckley
Shachar Itzhaky
Shengping Shaw
Shufang Zhu
Silien Hong
Simon Jantsch
Sonali Dutta
Tereza Šťastná
Tobias Meggendorfer.

View file

@ -1,8 +1,4 @@
## Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014 Laboratoire de Recherche
## et Développement de l'Epita (LRDE).
## Copyright (C) 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
## département Systèmes Répartis Coopératifs (SRC), Université Pierre
## et Marie Curie.
## Copyright (C) by the Spot authors, see the AUTHORS file for details.
##
## This file is part of Spot, a model checking library.
##

View file

@ -1,5 +1,4 @@
## Copyright (C) 2013 Laboratoire de Recherche et Développement de
## l'Epita (LRDE).
## Copyright (C) by the Spot authors, see the AUTHORS file for details.
##
## This file is part of Spot, a model checking library.
##

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python3
# Copyright (C) 2016-2018 Laboratoire de Recherche et Développement de
# l'Epita (LRDE).
# Copyright (C) by the Spot authors, see the AUTHORS file for details.
#
# This file is part of Spot, a model checking library.
#
@ -55,12 +54,12 @@ class BenchConfig(object):
if line[0] == '#' or line.isspace():
continue
elif line[0:2] == "sh":
sh = re.search('sh (.+?)$', line).group(1)
sh = re.search('sh (.+)$', line).group(1)
continue
else:
name = re.search('(.+?):', line).group(1)
code = re.search(':(.+?)>', line).group(1)
xoptions = re.search('>(.+?)$', line).group(1)
xoptions = re.search('>(.+)$', line).group(1)
b = Bench(name=name, code=code, xoptions=xoptions)
self.l.append(b)
self.sh.append(sh)

View file

@ -1,6 +1,4 @@
## Copyright (C) 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
## département Systèmes Répartis Coopératifs (SRC), Université Pierre
## et Marie Curie.
## Copyright (C) by the Spot authors, see the AUTHORS file for details.
##
## This file is part of Spot, a model checking library.
##

View file

@ -1,7 +1,5 @@
# -*- shell-script -*-
# Copyright (C) 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie.
# Copyright (C) by the Spot authors, see the AUTHORS file for details.
#
# This file is part of Spot, a model checking library.
#

View file

@ -1,6 +1,5 @@
## -*- coding: utf-8 -*-
## Copyright (C) 2013, 2016 Laboratoire de Recherche et Développement
## de l'Epita (LRDE).
## Copyright (C) by the Spot authors, see the AUTHORS file for details.
##
## This file is part of Spot, a model checking library.
##

View file

@ -1,9 +1,5 @@
# -*- mode: shell-script; coding: utf-8 -*-
# Copyright (C) 2012, 2013, 2016, 2018 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
# Copyright (C) 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie.
# Copyright (C) by the Spot authors, see the AUTHORS file for details.
#
# This file is part of Spot, a model checking library.
#

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python3
## -*- coding: utf-8 -*-
## Copyright (C) 2013 Laboratoire de Recherche et Développement de
## l'Epita (LRDE).
## Copyright (C) by the Spot authors, see the AUTHORS file for details.
##
## This file is part of Spot, a model checking library.
##

View file

@ -1,5 +1,4 @@
# Copyright (C) 2009, 2010 Laboratoire de Recherche et Développement de
# l'EPITA (LRDE)
# Copyright (C) by the Spot authors, see the AUTHORS file for details.
#
# This file is part of Spot, a model checking library.
#

View file

@ -1,5 +1,4 @@
# Copyright (C) 2009, 2014 Laboratoire de Recherche et Développement
# de l'EPITA (LRDE)
# Copyright (C) by the Spot authors, see the AUTHORS file for details.
#
# This file is part of Spot, a model checking library.
#

View file

@ -1,5 +1,4 @@
## Copyright (C) 2013 Laboratoire de Recherche et Développement de
## l'Epita (LRDE).
## Copyright (C) by the Spot authors, see the AUTHORS file for details.
##
## This file is part of Spot, a model checking library.
##

View file

@ -1,6 +1,5 @@
## -*- coding: utf-8 -*-
## Copyright (C) 2014, 2015, 2017 Laboratoire de Recherche et Développement
## de l'Epita (LRDE).
## Copyright (C) by the Spot authors, see the AUTHORS file for details.
##
## This file is part of Spot, a model checking library.
##

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2014, 2015, 2016, 2017 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -28,7 +27,7 @@
#include <spot/misc/timer.hh>
#include <argp.h>
const char argp_program_doc[] ="";
static const char argp_program_doc[] = "";
const struct argp_child children[] =
{

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2014, 2015, 2017 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//

View file

@ -1,5 +1,4 @@
# Copyright (C) 2010 Laboratoire de Recherche et Développement de
# l'EPITA (LRDE)
# Copyright (C) by the Spot authors, see the AUTHORS file for details.
#
# This file is part of Spot, a model checking library.
#

1
bin/.gitignore vendored
View file

@ -9,6 +9,7 @@ ltlcross
ltldo
ltlfilt
ltlgrind
ltlmix
ltlsynt
randaut
randltl

View file

@ -1,6 +1,5 @@
## -*- coding: utf-8 -*-
## Copyright (C) 2012-2017 Laboratoire de Recherche et Développement
## de l'Epita (LRDE).
## Copyright (C) by the Spot authors, see the AUTHORS file for details.
##
## This file is part of Spot, a model checking library.
##
@ -44,6 +43,8 @@ libcommon_a_SOURCES = \
common_finput.hh \
common_hoaread.cc \
common_hoaread.hh \
common_ioap.cc \
common_ioap.hh \
common_output.cc \
common_output.hh \
common_post.cc \
@ -70,6 +71,7 @@ bin_PROGRAMS = \
ltldo \
ltlfilt \
ltlgrind \
ltlmix \
ltlsynt \
randaut \
randltl
@ -93,6 +95,7 @@ ltl2tgta_SOURCES = ltl2tgta.cc
ltlcross_SOURCES = ltlcross.cc
ltlgrind_SOURCES = ltlgrind.cc
ltldo_SOURCES = ltldo.cc
ltlmix_SOURCES = ltlmix.cc
ltlsynt_SOURCES = ltlsynt.cc
dstar2tgba_SOURCES = dstar2tgba.cc
spot_x_SOURCES = spot-x.cc

View file

@ -12,7 +12,7 @@ whose purpose is just to generate a man-page with the same format as
the other man pages (this includes keeping the version number
up-to-date).
There is also a script called 'options.py' that summerizes how the
There is also a script called 'options.py' that summarizes how the
different short options are used among the tools.
Routines that are shared by multiple command-line tools are stored in

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2017-2020 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -51,7 +50,7 @@
#include <spot/misc/escape.hh>
#include <spot/misc/timer.hh>
const char argp_program_doc[] ="\
static const char argp_program_doc[] = "\
Call several tools that process automata and cross-compare their output \
to detect bugs, or to gather statistics. The list of automata to use \
should be supplied on standard input, or using the -F option.\v\
@ -64,6 +63,7 @@ Exit status:\n\
enum {
OPT_BOGUS = 256,
OPT_COMPLEMENTED,
OPT_CSV,
OPT_HIGH,
OPT_FAIL_ON_TIMEOUT,
@ -94,6 +94,8 @@ static const argp_option options[] =
"consider timeouts as errors", 0 },
{ "language-preserved", OPT_LANG, nullptr, 0,
"expect that each tool preserves the input language", 0 },
{ "language-complemented", OPT_COMPLEMENTED, nullptr, 0,
"expect that each tool complements the input language", 0 },
{ "no-checks", OPT_NOCHECKS, nullptr, 0,
"do not perform any sanity checks", 0 },
/**************************************************/
@ -144,6 +146,7 @@ static bool fail_on_timeout = false;
static bool stop_on_error = false;
static bool no_checks = false;
static bool opt_language_preserved = false;
static bool opt_language_complemented = false;
static bool opt_omit = false;
static const char* csv_output = nullptr;
static unsigned round_num = 0;
@ -158,7 +161,7 @@ parse_opt(int key, char* arg, struct argp_state*)
switch (key)
{
case 'F':
jobs.emplace_back(arg, true);
jobs.emplace_back(arg, job_type::AUT_FILENAME);
break;
case 'q':
quiet = true;
@ -170,6 +173,9 @@ parse_opt(int key, char* arg, struct argp_state*)
bogus_output_filename = arg;
break;
}
case OPT_COMPLEMENTED:
opt_language_complemented = true;
break;
case OPT_CSV:
csv_output = arg ? arg : "-";
break;
@ -209,7 +215,7 @@ parse_opt(int key, char* arg, struct argp_state*)
break;
case ARGP_KEY_ARG:
if (arg[0] == '-' && !arg[1])
jobs.emplace_back(arg, true);
jobs.emplace_back(arg, job_type::AUT_FILENAME);
else
tools_push_autproc(arg);
break;
@ -338,7 +344,6 @@ struct in_statistics
struct out_statistics
{
// If OK is false, output statistics are not available.
bool ok;
const char* status_str;
@ -346,7 +351,7 @@ struct out_statistics
double time;
aut_statistics output;
out_statistics()
out_statistics() noexcept
: ok(false),
status_str(nullptr),
status_code(0),
@ -533,25 +538,32 @@ namespace
const spot::const_twa_graph_ptr& aut_j,
size_t i, size_t j)
{
auto is_really_comp = [lc = opt_language_complemented,
ts = tools.size()](unsigned i) {
return lc && i == ts;
};
if (aut_i->num_sets() + aut_j->num_sets() >
spot::acc_cond::mark_t::max_accsets())
{
if (!quiet)
std::cerr << "info: building " << autname(i)
<< '*' << autname(j, true)
std::cerr << "info: building " << autname(i, is_really_comp(i))
<< '*' << autname(j, !is_really_comp(j))
<< " requires more acceptance sets than supported\n";
return false;
}
if (verbose)
std::cerr << "info: check_empty "
<< autname(i) << '*' << autname(j, true) << '\n';
<< autname(i, is_really_comp(i))
<< '*' << autname(j, !is_really_comp(j)) << '\n';
auto w = aut_i->intersecting_word(aut_j);
if (w)
{
std::ostream& err = global_error();
err << "error: " << autname(i) << '*' << autname(j, true)
err << "error: " << autname(i, is_really_comp(i))
<< '*' << autname(j, !is_really_comp(j))
<< (" is nonempty; both automata accept the infinite word:\n"
" ");
example() << *w << '\n';
@ -600,7 +612,7 @@ namespace
return src.str();
}();
input_statistics.push_back(in_statistics());
input_statistics.emplace_back(in_statistics());
input_statistics[round_num].input_source = std::move(source);
if (auto name = input->get_named_prop<std::string>("automaton-name"))
@ -621,12 +633,15 @@ namespace
int problems = 0;
size_t m = tools.size();
size_t mi = m + opt_language_preserved;
size_t mi = m + opt_language_preserved + opt_language_complemented;
std::vector<spot::twa_graph_ptr> pos(mi);
std::vector<spot::twa_graph_ptr> neg(mi);
vector_tool_statistics stats(m);
if (opt_language_preserved)
// For --language-complemented, we store the input automata in
// pos and will compute its complement in neg. Before running
// checks we will swap both automata.
if (opt_language_preserved || opt_language_complemented)
pos[mi - 1] = input;
if (verbose)
@ -642,7 +657,7 @@ namespace
problems += prob;
}
spot::cleanup_tmpfiles();
output_statistics.push_back(std::move(stats));
output_statistics.emplace_back(std::move(stats));
if (verbose)
{
@ -718,6 +733,9 @@ namespace
};
}
if (opt_language_complemented)
std::swap(pos[mi - 1], neg[mi - 1]);
// Just make a circular implication check
// A0 <= A1, A1 <= A2, ..., AN <= A0
unsigned ok = 0;
@ -824,10 +842,15 @@ main(int argc, char** argv)
check_no_automaton();
if (s == 1 && !opt_language_preserved && !no_checks)
error(2, 0, "Since --language-preserved is not used, you need "
"at least two tools to compare.");
if (s == 1 && !no_checks
&& !opt_language_preserved
&& !opt_language_complemented)
error(2, 0, "Since --language-preserved and --language-complemented "
"are not used, you need at least two tools to compare.");
if (opt_language_preserved && opt_language_complemented)
error(2, 0, "Options --language-preserved and --language-complemented "
"are incompatible.");
setup_color();
setup_sig_handler();

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013-2022 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -45,12 +44,15 @@
#include <spot/misc/timer.hh>
#include <spot/parseaut/public.hh>
#include <spot/tl/exclusive.hh>
#include <spot/tl/parse.hh>
#include <spot/twaalgos/alternation.hh>
#include <spot/twaalgos/are_isomorphic.hh>
#include <spot/twaalgos/canonicalize.hh>
#include <spot/twaalgos/cobuchi.hh>
#include <spot/twaalgos/cleanacc.hh>
#include <spot/twaalgos/complement.hh>
#include <spot/twaalgos/contains.hh>
#include <spot/twaalgos/deadends.hh>
#include <spot/twaalgos/degen.hh>
#include <spot/twaalgos/dtwasat.hh>
#include <spot/twaalgos/dualize.hh>
@ -62,6 +64,8 @@
#include <spot/twaalgos/isweakscc.hh>
#include <spot/twaalgos/langmap.hh>
#include <spot/twaalgos/mask.hh>
#include <spot/twaalgos/matchstates.hh>
#include <spot/twaalgos/mcs.hh>
#include <spot/twaalgos/product.hh>
#include <spot/twaalgos/randomize.hh>
#include <spot/twaalgos/remfin.hh>
@ -75,7 +79,7 @@
#include <spot/twaalgos/sum.hh>
#include <spot/twaalgos/totgba.hh>
static const char argp_program_doc[] ="\
static const char argp_program_doc[] = "\
Convert, transform, and filter omega-automata.\v\
Exit status:\n\
0 if some automata were output\n\
@ -102,6 +106,7 @@ enum {
OPT_DUALIZE,
OPT_DNF_ACC,
OPT_EDGES,
OPT_ENLARGE_ACCEPTANCE_SET,
OPT_EQUIVALENT_TO,
OPT_EXCLUSIVE_AP,
OPT_GENERALIZED_RABIN,
@ -133,12 +138,14 @@ enum {
OPT_KEEP_STATES,
OPT_KILL_STATES,
OPT_MASK_ACC,
OPT_MCS,
OPT_MERGE,
OPT_NONDET_STATES,
OPT_PARTIAL_DEGEN,
OPT_PRODUCT_AND,
OPT_PRODUCT_OR,
OPT_RANDOMIZE,
OPT_REDUCE_ACCEPTANCE_SET,
OPT_REJ_SCCS,
OPT_REJECT_WORD,
OPT_REM_AP,
@ -146,9 +153,11 @@ enum {
OPT_REM_UNREACH,
OPT_REM_UNUSED_AP,
OPT_REM_FIN,
OPT_RESTRICT_DEAD_ENDS,
OPT_SAT_MINIMIZE,
OPT_SCCS,
OPT_SEED,
OPT_SEPARATE_EDGES,
OPT_SEP_SETS,
OPT_SIMPL_ACC,
OPT_SIMPLIFY_EXCLUSIVE_AP,
@ -160,6 +169,7 @@ enum {
OPT_SUM_AND,
OPT_TERMINAL_SCCS,
OPT_TO_FINITE,
OPT_TRACK_FORMULA,
OPT_TRIV_SCCS,
OPT_USED_AP_N,
OPT_UNUSED_AP_N,
@ -230,7 +240,7 @@ static const argp_option options[] =
{ "is-alternating", OPT_IS_ALTERNATING, nullptr, 0,
"keep only automata using universal branching", 0 },
{ "intersect", OPT_INTERSECT, "FILENAME", 0,
"keep automata whose languages have an non-empty intersection with"
"keep automata whose languages have a non-empty intersection with"
" the automaton from FILENAME", 0 },
{ "included-in", OPT_INCLUDED_IN, "FILENAME", 0,
"keep automata whose languages are included in that of the "
@ -277,11 +287,20 @@ static const argp_option options[] =
{ "nth", 'N', "RANGE", 0,
"assuming input automata are numbered from 1, keep only those in RANGE",
0 },
{ "enlarge-acceptance-set", OPT_ENLARGE_ACCEPTANCE_SET, nullptr, 0,
"enlarge the number of accepting transitions (or states if -S) in a "
"Büchi automaton", 0 },
{ "reduce-acceptance-set", OPT_REDUCE_ACCEPTANCE_SET, nullptr, 0,
"reduce the number of accepting transitions (or states if -S) in a "
"Büchi automaton", 0 },
/**************************************************/
RANGE_DOC_FULL,
WORD_DOC,
/**************************************************/
{ nullptr, 0, nullptr, 0, "Transformations:", 7 },
{ "mcs-order", OPT_MCS, "any|scc", OPTION_ARG_OPTIONAL,
"reorder states using a maximum cardinality search; use option to"
" specify how to break ties", 0 },
{ "merge-transitions", OPT_MERGE, nullptr, 0,
"merge transitions with same destination and acceptance", 0 },
{ "product", OPT_PRODUCT_AND, "FILENAME", 0,
@ -364,12 +383,18 @@ static const argp_option options[] =
{ "remove-dead-states", OPT_REM_DEAD, nullptr, 0,
"remove states that are unreachable, or that cannot belong to an "
"infinite path", 0 },
{ "restrict-dead-end-edges", OPT_RESTRICT_DEAD_ENDS, nullptr, 0,
"restrict labels of dead-end edges, based on useful transitions of the "
"state they reach", 0 },
{ "simplify-acceptance", OPT_SIMPL_ACC, nullptr, 0,
"simplify the acceptance condition by merging identical acceptance sets "
"and by simplifying some terms containing complementary sets", 0 },
{ "split-edges", OPT_SPLIT_EDGES, nullptr, 0,
"split edges into transitions labeled by conjunctions of all atomic "
"propositions, so they can be read as letters", 0 },
{ "separate-edges", OPT_SEPARATE_EDGES, nullptr, 0,
"split edges into transitions labeled by a disjoint set of labels that"
" form a basis for the original automaton", 0 },
{ "sum", OPT_SUM_OR, "FILENAME", 0,
"build the sum with the automaton in FILENAME "
"to sum languages", 0 },
@ -396,6 +421,7 @@ static const argp_option options[] =
"Convert an automaton with \"alive\" and \"!alive\" propositions "
"into a Büchi automaton interpretable as a finite automaton. "
"States with a outgoing \"!alive\" edge are marked as accepting.", 0 },
/**************************************************/
{ nullptr, 0, nullptr, 0, "Decorations (for -d and -H1.1 output):", 9 },
{ "highlight-accepting-run", OPT_HIGHLIGHT_ACCEPTING_RUN, "NUM",
OPTION_ARG_OPTIONAL, "highlight one accepting run using color NUM", 0},
@ -409,9 +435,12 @@ static const argp_option options[] =
OPTION_ARG_OPTIONAL,
"highlight nondeterministic states and edges with color NUM", 0},
{ "highlight-word", OPT_HIGHLIGHT_WORD, "[NUM,]WORD", 0,
"highlight one run matching WORD using color NUM", 0},
"highlight one run matching WORD using color NUM", 0 },
{ "highlight-languages", OPT_HIGHLIGHT_LANGUAGES, nullptr, 0 ,
"highlight states that recognize identical languages", 0},
"highlight states that recognize identical languages", 0 },
{ "track-formula", OPT_TRACK_FORMULA, "FORMULA", 0,
"attempt to label the states of the automaton assuming the automaton "
"recognize FORMULA (use deterministic automata for precision)", 0 },
/**************************************************/
{ nullptr, 0, nullptr, 0,
"If any option among --small, --deterministic, or --any is given, "
@ -448,7 +477,7 @@ struct canon_aut
std::vector<tr_t> edges;
std::string acc;
canon_aut(const spot::const_twa_graph_ptr& aut)
explicit canon_aut(const spot::const_twa_graph_ptr& aut)
: num_states(aut->num_states())
, edges(aut->edge_vector().begin() + 1,
aut->edge_vector().end())
@ -498,6 +527,21 @@ static bool const aliases_types[] =
};
ARGMATCH_VERIFY(aliases_args, aliases_types);
spot::mcs_tie_break opt_mcs_tie = spot::MCS_TIE_ANY;
static char const* const mcs_args[] =
{
"any",
"scc",
nullptr,
};
static spot::mcs_tie_break const mcs_types[] =
{
spot::MCS_TIE_ANY,
spot::MCS_TIE_SCC,
};
ARGMATCH_VERIFY(mcs_args, mcs_types);
enum acc_type {
ACC_Any = 0,
ACC_Given,
@ -629,6 +673,7 @@ static struct opt_t
std::vector<std::pair<spot::twa_graph_ptr, unsigned>> hl_words;
}* opt;
static bool opt_mcs = false;
static bool opt_merge = false;
static bool opt_has_univ_branching = false;
static bool opt_has_exist_branching = false;
@ -692,14 +737,19 @@ static bool opt_rem_unreach = false;
static bool opt_rem_unused_ap = false;
static bool opt_sep_sets = false;
static bool opt_split_edges = false;
static bool opt_separate_edges = false;
static const char* opt_sat_minimize = nullptr;
static const char* opt_to_finite = nullptr;
static int opt_highlight_nondet_states = -1;
static int opt_highlight_nondet_edges = -1;
static int opt_highlight_accepting_run = -1;
static bool opt_highlight_languages = false;
static spot::formula opt_track_formula = nullptr;
static bool opt_dca = false;
static bool opt_streett_like = false;
static bool opt_enlarge_acceptance_set = false;
static bool opt_reduce_acceptance_set = false;
static bool opt_restrict_dead_ends = false;
static spot::twa_graph_ptr
ensure_deterministic(const spot::twa_graph_ptr& aut, bool nonalt = false)
@ -713,10 +763,12 @@ ensure_deterministic(const spot::twa_graph_ptr& aut, bool nonalt = false)
return p.run(aut);
}
static spot::twa_graph_ptr ensure_tba(spot::twa_graph_ptr aut)
static spot::twa_graph_ptr
ensure_tba(spot::twa_graph_ptr aut,
spot::postprocessor::output_type type = spot::postprocessor::Buchi)
{
spot::postprocessor p;
p.set_type(spot::postprocessor::Buchi);
p.set_type(type);
p.set_pref(spot::postprocessor::Any);
p.set_level(spot::postprocessor::Low);
return p.run(aut);
@ -726,12 +778,14 @@ static spot::twa_graph_ptr ensure_tba(spot::twa_graph_ptr aut)
static spot::twa_graph_ptr
product(spot::twa_graph_ptr left, spot::twa_graph_ptr right)
{
if ((type == spot::postprocessor::Buchi)
&& (left->num_sets() + right->num_sets() >
spot::acc_cond::mark_t::max_accsets()))
// Are we likely to fail because of too many colors?
if ((left->num_sets() + right->num_sets() >
spot::acc_cond::mark_t::max_accsets())
&& (type == spot::postprocessor::Buchi
|| type == spot::postprocessor::CoBuchi))
{
left = ensure_tba(left);
right = ensure_tba(right);
left = ensure_tba(left, type);
right = ensure_tba(right, type);
}
return spot::product(left, right);
}
@ -739,16 +793,34 @@ product(spot::twa_graph_ptr left, spot::twa_graph_ptr right)
static spot::twa_graph_ptr
product_or(spot::twa_graph_ptr left, spot::twa_graph_ptr right)
{
if ((type == spot::postprocessor::Buchi)
&& (left->num_sets() + right->num_sets() >
spot::acc_cond::mark_t::max_accsets()))
// Are we likely to fail because of too many colors?
if ((left->num_sets() + right->num_sets() >
spot::acc_cond::mark_t::max_accsets())
&& (type == spot::postprocessor::Buchi
|| type == spot::postprocessor::CoBuchi))
{
left = ensure_tba(left);
right = ensure_tba(right);
left = ensure_tba(left, type);
right = ensure_tba(right, type);
}
return spot::product_or(left, right);
}
static spot::twa_graph_ptr
word_to_aut(const char* word, const char *argname)
{
try
{
return spot::parse_word(word, opt->dict)->as_automaton();
}
catch (const spot::parse_error& e)
{
error(2, 0, "failed to parse the argument of --%s:\n%s",
argname, e.what());
}
SPOT_UNREACHABLE();
return nullptr;
}
static int
parse_opt(int key, char* arg, struct argp_state*)
{
@ -761,7 +833,7 @@ parse_opt(int key, char* arg, struct argp_state*)
automaton_format = Count;
break;
case 'F':
jobs.emplace_back(arg, true);
jobs.emplace_back(arg, job_type::AUT_FILENAME);
break;
case 'n':
opt_max_count = to_pos_int(arg, "-n/--max-count");
@ -770,17 +842,14 @@ parse_opt(int key, char* arg, struct argp_state*)
opt_nth = parse_range(arg, 0, std::numeric_limits<int>::max());
break;
case 'u':
opt->uniq = std::unique_ptr<unique_aut_t>(new std::set<canon_aut>());
opt->uniq = std::make_unique<unique_aut_t>();
break;
case 'v':
opt_invert = true;
break;
case 'x':
{
const char* opt = extra_options.parse_options(arg);
if (opt)
error(2, 0, "failed to parse --options near '%s'", opt);
}
if (const char* opt = extra_options.parse_options(arg))
error(2, 0, "failed to parse --options near '%s'", opt);
break;
case OPT_ALIASES:
opt_aliases = XARGMATCH("--aliases", arg, aliases_args, aliases_types);
@ -796,16 +865,7 @@ parse_opt(int key, char* arg, struct argp_state*)
opt_art_sccs_set = true;
break;
case OPT_ACCEPT_WORD:
try
{
opt->acc_words.push_back(spot::parse_word(arg, opt->dict)
->as_automaton());
}
catch (const spot::parse_error& e)
{
error(2, 0, "failed to parse the argument of --accept-word:\n%s",
e.what());
}
opt->acc_words.emplace_back(word_to_aut(arg, "accept-word"));
break;
case OPT_ACCEPTANCE_IS:
{
@ -884,12 +944,12 @@ parse_opt(int key, char* arg, struct argp_state*)
opt_dnf_acc = true;
opt_cnf_acc = false;
break;
case OPT_STREETT_LIKE:
opt_streett_like = true;
break;
case OPT_EDGES:
opt_edges = parse_range(arg, 0, std::numeric_limits<int>::max());
break;
case OPT_ENLARGE_ACCEPTANCE_SET:
opt_enlarge_acceptance_set = true;
break;
case OPT_EXCLUSIVE_AP:
opt->excl_ap.add_group(arg);
break;
@ -958,16 +1018,7 @@ parse_opt(int key, char* arg, struct argp_state*)
"%d should be followed by a comma and WORD", res);
arg = endptr + 1;
}
try
{
opt->hl_words.emplace_back(spot::parse_word(arg, opt->dict)
->as_automaton(), res);
}
catch (const spot::parse_error& e)
{
error(2, 0, "failed to parse the argument of --highlight-word:\n%s",
e.what());
}
opt->hl_words.emplace_back(word_to_aut(arg, "highlight-word"), res);
}
break;
case OPT_HIGHLIGHT_LANGUAGES:
@ -983,12 +1034,24 @@ parse_opt(int key, char* arg, struct argp_state*)
break;
case OPT_INCLUDED_IN:
{
auto aut = ensure_deterministic(read_automaton(arg, opt->dict), true);
aut = spot::dualize(aut);
if (!opt->included_in)
opt->included_in = aut;
auto aut = read_automaton(arg, opt->dict);
if (spot::containment_select_version() == 0)
{
aut = spot::complement(aut);
if (!aut->is_existential())
aut = spot::remove_alternation(aut);
if (!opt->included_in)
opt->included_in = aut;
else
opt->included_in = ::product_or(opt->included_in, aut);
}
else
opt->included_in = spot::product_or(opt->included_in, aut);
{
if (opt->included_in)
error(2, 0, "FORQ-based inclusion check only works "
"with one inclusion-test at a time");
opt->included_in = aut;
}
}
break;
case OPT_INHERENTLY_WEAK_SCCS:
@ -1065,9 +1128,6 @@ parse_opt(int key, char* arg, struct argp_state*)
opt_rem_dead = true;
break;
}
case OPT_MERGE:
opt_merge = true;
break;
case OPT_MASK_ACC:
{
for (auto res : to_longs(arg))
@ -1083,6 +1143,14 @@ parse_opt(int key, char* arg, struct argp_state*)
}
break;
}
case OPT_MCS:
opt_mcs = true;
if (arg)
opt_mcs_tie = XARGMATCH("--mcs", arg, mcs_args, mcs_types);
break;
case OPT_MERGE:
opt_merge = true;
break;
case OPT_NONDET_STATES:
opt_nondet_states = parse_range(arg, 0, std::numeric_limits<int>::max());
opt_nondet_states_set = true;
@ -1146,21 +1214,15 @@ parse_opt(int key, char* arg, struct argp_state*)
randomize_st = true;
}
break;
case OPT_REDUCE_ACCEPTANCE_SET:
opt_reduce_acceptance_set = true;
break;
case OPT_REJ_SCCS:
opt_rej_sccs = parse_range(arg, 0, std::numeric_limits<int>::max());
opt_art_sccs_set = true;
break;
case OPT_REJECT_WORD:
try
{
opt->rej_words.push_back(spot::parse_word(arg, opt->dict)
->as_automaton());
}
catch (const spot::parse_error& e)
{
error(2, 0, "failed to parse the argument of --reject-word:\n%s",
e.what());
}
opt->rej_words.emplace_back(word_to_aut(arg, "reject-word"));
break;
case OPT_REM_AP:
opt->rem_ap.add_ap(arg);
@ -1177,6 +1239,9 @@ parse_opt(int key, char* arg, struct argp_state*)
case OPT_REM_UNUSED_AP:
opt_rem_unused_ap = true;
break;
case OPT_RESTRICT_DEAD_ENDS:
opt_restrict_dead_ends = true;
break;
case OPT_SAT_MINIMIZE:
opt_sat_minimize = arg ? arg : "";
break;
@ -1200,9 +1265,15 @@ parse_opt(int key, char* arg, struct argp_state*)
case OPT_SPLIT_EDGES:
opt_split_edges = true;
break;
case OPT_SEPARATE_EDGES:
opt_separate_edges = true;
break;
case OPT_STATES:
opt_states = parse_range(arg, 0, std::numeric_limits<int>::max());
break;
case OPT_STREETT_LIKE:
opt_streett_like = true;
break;
case OPT_STRIPACC:
opt_stripacc = true;
break;
@ -1234,6 +1305,9 @@ parse_opt(int key, char* arg, struct argp_state*)
case OPT_TO_FINITE:
opt_to_finite = arg ? arg : "alive";
break;
case OPT_TRACK_FORMULA:
opt_track_formula = spot::parse_formula(arg);
break;
case OPT_TRIV_SCCS:
opt_triv_sccs = parse_range(arg, 0, std::numeric_limits<int>::max());
opt_art_sccs_set = true;
@ -1252,7 +1326,7 @@ parse_opt(int key, char* arg, struct argp_state*)
opt_art_sccs_set = true;
break;
case ARGP_KEY_ARG:
jobs.emplace_back(arg, true);
jobs.emplace_back(arg, job_type::AUT_FILENAME);
break;
default:
@ -1285,7 +1359,7 @@ namespace
static
bool match_acceptance(spot::twa_graph_ptr aut)
{
auto& acc = aut->acc();
const spot::acc_cond& acc = aut->acc();
switch (opt_acceptance_is)
{
case ACC_Any:
@ -1340,8 +1414,7 @@ namespace
{
bool max;
bool odd;
bool is_p = acc.is_parity(max, odd, true);
if (!is_p)
if (!acc.is_parity(max, odd, true))
return false;
switch (opt_acceptance_is)
{
@ -1415,6 +1488,9 @@ namespace
else if (opt_clean_acc)
cleanup_acceptance_here(aut);
if (opt_restrict_dead_ends)
restrict_dead_end_edges_here(aut);
if (opt_sep_sets)
separate_sets_here(aut);
if (opt_complement_acc)
@ -1454,7 +1530,7 @@ namespace
if (matched && opt_acceptance_is)
matched = match_acceptance(aut);
if (matched && (opt_sccs_set | opt_art_sccs_set))
if (matched && (opt_sccs_set || opt_art_sccs_set))
{
spot::scc_info si(aut);
unsigned n = si.scc_count();
@ -1528,20 +1604,25 @@ namespace
if (opt->intersect)
matched &= aut->intersects(opt->intersect);
if (opt->included_in)
matched &= !aut->intersects(opt->included_in);
{
if (spot::containment_select_version() == 0)
matched &= !aut->intersects(opt->included_in);
else
matched &= spot::contains(opt->included_in, aut);
}
if (opt->equivalent_pos)
matched &= !aut->intersects(opt->equivalent_neg)
&& spot::contains(aut, opt->equivalent_pos);
if (matched && !opt->acc_words.empty())
for (auto& word_aut: opt->acc_words)
for (const spot::twa_graph_ptr& word_aut: opt->acc_words)
if (spot::product(aut, word_aut)->is_empty())
{
matched = false;
break;
}
if (matched && !opt->rej_words.empty())
for (auto& word_aut: opt->rej_words)
for (const spot::twa_graph_ptr& word_aut: opt->rej_words)
if (!spot::product(aut, word_aut)->is_empty())
{
matched = false;
@ -1654,8 +1735,18 @@ namespace
else if (opt_rem_unused_ap) // constrain(aut, true) already does that
aut->remove_unused_ap();
if (opt_enlarge_acceptance_set)
spot::enlarge_buchi_acceptance_set_here(aut, sbacc);
if (opt_reduce_acceptance_set)
spot::reduce_buchi_acceptance_set_here(aut, sbacc);
if (opt_split_edges)
aut = spot::split_edges(aut);
else if (opt_separate_edges)
aut = spot::separate_edges(aut);
if (opt_track_formula)
match_states_decorate(aut, opt_track_formula);
if (opt_to_finite)
aut = spot::to_finite(aut, opt_to_finite);
@ -1675,14 +1766,12 @@ namespace
aut->accepting_run()->highlight(opt_highlight_accepting_run);
if (!opt->hl_words.empty())
for (auto& word_aut: opt->hl_words)
{
if (aut->acc().uses_fin_acceptance())
error(2, 0,
"--highlight-word does not yet work with Fin acceptance");
if (auto run = spot::product(aut, word_aut.first)->accepting_run())
run->project(aut)->highlight(word_aut.second);
}
for (auto& [word_aut, color]: opt->hl_words)
if (auto run = spot::product(aut, word_aut)->accepting_run())
run->project(aut)->highlight(color);
if (opt_mcs)
spot::maximum_cardinality_search_reorder_here(aut, opt_mcs_tie);
timer.stop();
if (opt->uniq)
@ -1694,8 +1783,6 @@ namespace
return 0;
}
++match_count;
if (aliases)
{
if (opt_aliases)
@ -1704,7 +1791,9 @@ namespace
set_aliases(aut, {});
}
printer.print(aut, timer, nullptr, haut->filename.c_str(), -1,
haut, prefix, suffix);
match_count, haut, prefix, suffix);
++match_count;
if (opt_max_count >= 0 && match_count >= opt_max_count)
abort_run = true;
@ -1757,15 +1846,17 @@ main(int argc, char** argv)
post.set_level(level);
autfilt_processor processor(post, o.dict);
if (processor.run())
return 2;
// Diagnose unused -x options
extra_options.report_unused_options();
int err = processor.run();
if (automaton_format == Count)
std::cout << match_count << std::endl;
// Diagnose unused -x options
if (!err)
extra_options.report_unused_options();
else
return 2;
check_cout();
return match_count ? 0 : 1;
});

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2021 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -41,7 +40,7 @@
#include <spot/twaalgos/isdet.hh>
automaton_format_t automaton_format = Hoa;
static const char* automaton_format_opt = nullptr;
const char* automaton_format_opt = nullptr;
const char* opt_name = nullptr;
static const char* opt_output = nullptr;
static const char* stats = "";
@ -92,6 +91,19 @@ enum {
OPT_CHECK,
};
const char* hoa_option_doc_short = "1.1|b|i|k|l|m|s|t|v";
const char* hoa_option_doc_long =
"Output the automaton in HOA format (default). Add letters to select "
"(1.1) version 1.1 of the format, "
"(b) create an alias basis if >=2 AP are used, "
"(i) use implicit labels for complete deterministic automata, "
"(s) prefer state-based acceptance when possible [default], "
"(t) force transition-based acceptance, "
"(m) mix state and transition-based acceptance, "
"(k) use state labels when possible, "
"(l) single-line output, "
"(v) verbose properties";
static const argp_option options[] =
{
/**************************************************/
@ -130,16 +142,8 @@ static const argp_option options[] =
"(+INT) add INT to all set numbers, "
"(<INT) display at most INT states, "
"(#) show internal edge numbers", 0 },
{ "hoaf", 'H', "1.1|i|k|l|m|s|t|v", OPTION_ARG_OPTIONAL,
"Output the automaton in HOA format (default). Add letters to select "
"(1.1) version 1.1 of the format, "
"(i) use implicit labels for complete deterministic automata, "
"(s) prefer state-based acceptance when possible [default], "
"(t) force transition-based acceptance, "
"(m) mix state and transition-based acceptance, "
"(k) use state labels when possible, "
"(l) single-line output, "
"(v) verbose properties", 0 },
{ "hoaf", 'H', hoa_option_doc_short, OPTION_ARG_OPTIONAL,
hoa_option_doc_long, 0 },
{ "lbtt", OPT_LBTT, "t", OPTION_ARG_OPTIONAL,
"LBTT's format (add =t to force transition-based acceptance even"
" on Büchi automata)", 0 },
@ -198,17 +202,25 @@ static const argp_option io_options[] =
" minuscules for output):", 4 },
{ "%F", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, F_doc, 0 },
{ "%L", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, L_doc, 0 },
{ "%l", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"serial number of the output automaton (0-based)", 0 },
{ "%H, %h", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the automaton in HOA format on a single line (use %[opt]H or %[opt]h "
"to specify additional options as in --hoa=opt)", 0 },
{ "%M, %m", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"name of the automaton", 0 },
{ "%S, %s", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of reachable states", 0 },
{ "%E, %e", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of reachable edges", 0 },
{ "%T, %t", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of reachable transitions", 0 },
{ "%S, %s, %[LETTER]S, %[LETTER]s",
0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of states (add one LETTER to select (r) reachable [default], "
"(u) unreachable, (a) all).", 0 },
{ "%E, %e, %[LETTER]E, %[LETTER]e",
0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of edges (add one LETTER to select (r) reachable [default], "
"(u) unreachable, (a) all).", 0 },
{ "%T, %t, %[LETTER]T, %[LETTER]t",
0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of transitions (add one LETTER to select (r) reachable "
"[default], (u) unreachable, (a) all).", 0 },
{ "%A, %a", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of acceptance sets", 0 },
{ "%G, %g, %[LETTERS]G, %[LETTERS]g", 0, nullptr,
@ -221,7 +233,7 @@ static const argp_option io_options[] =
"(iw) inherently weak. Use uppercase letters to negate them.", 0 },
{ "%R, %[LETTERS]R", 0, nullptr,
OPTION_DOC | OPTION_NO_USAGE,
"CPU time (excluding parsing), in seconds; Add LETTERS to restrict to"
"CPU time (excluding parsing), in seconds; add LETTERS to restrict to "
"(u) user time, (s) system time, (p) parent process, "
"or (c) children processes.", 0 },
{ "%N, %n", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
@ -263,17 +275,22 @@ static const argp_option o_options[] =
"the following interpreted sequences:", 4 },
{ "%F", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, F_doc, 0 },
{ "%L", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, L_doc, 0 },
{ "%l", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"serial number of the output automaton (0-based)", 0 },
{ "%h", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the automaton in HOA format on a single line (use %[opt]h "
"to specify additional options as in --hoa=opt)", 0 },
{ "%m", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"name of the automaton", 0 },
{ "%s", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of reachable states", 0 },
{ "%e", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of reachable edges", 0 },
{ "%t", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of reachable transitions", 0 },
{ "%s, %[LETTER]s", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of states (add one LETTER to select (r) reachable [default], "
"(u) unreachable, (a) all).", 0 },
{ "%e, %[LETTER]e", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of edges (add one LETTER to select (r) reachable [default], "
"(u) unreachable, (a) all).", 0 },
{ "%t, %[LETTER]t", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of transitions (add one LETTER to select (r) reachable "
"[default], (u) unreachable, (a) all).", 0 },
{ "%a", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"number of acceptance sets", 0 },
{ "%g, %[LETTERS]g", 0, nullptr,
@ -285,7 +302,7 @@ static const argp_option o_options[] =
"(iw) inherently weak. Use uppercase letters to negate them.", 0 },
{ "%R, %[LETTERS]R", 0, nullptr,
OPTION_DOC | OPTION_NO_USAGE,
"CPU time (excluding parsing), in seconds; Add LETTERS to restrict to"
"CPU time (excluding parsing), in seconds; add LETTERS to restrict to"
"(u) user time, (s) system time, (p) parent process, "
"or (c) children processes.", 0 },
{ "%n", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
@ -433,6 +450,7 @@ hoa_stat_printer::hoa_stat_printer(std::ostream& os, const char* format,
if (input != ltl_input)
declare('f', &filename_); // Override the formula printer.
declare('h', &output_aut_);
declare('l', &index_);
declare('m', &aut_name_);
declare('u', &aut_univbranch_);
declare('w', &aut_word_);
@ -444,11 +462,12 @@ hoa_stat_printer::print(const spot::const_parsed_aut_ptr& haut,
const spot::const_twa_graph_ptr& aut,
spot::formula f,
const char* filename, int loc,
spot::process_timer& ptimer,
unsigned index,
const spot::process_timer& ptimer,
const char* csv_prefix, const char* csv_suffix)
{
timer_ = ptimer;
index_ = index;
filename_ = filename ? filename : "";
csv_prefix_ = csv_prefix ? csv_prefix : "";
csv_suffix_ = csv_suffix ? csv_suffix : "";
@ -472,15 +491,15 @@ hoa_stat_printer::print(const spot::const_parsed_aut_ptr& haut,
if (has('T'))
{
spot::twa_sub_statistics s = sub_stats_reachable(haut->aut);
haut_states_ = s.states;
haut_edges_ = s.edges;
haut_trans_ = s.transitions;
haut_states_.set(s.states, haut->aut->num_states());
haut_edges_.set(s.edges, haut->aut->num_edges());
haut_trans_.set(s.transitions, count_all_transitions(haut->aut));
}
else if (has('E') || has('S'))
{
spot::twa_statistics s = stats_reachable(haut->aut);
haut_states_ = s.states;
haut_edges_ = s.edges;
haut_states_.set(s.states, haut->aut->num_states());
haut_edges_.set(s.edges, haut->aut->num_edges());
}
if (has('M'))
{
@ -590,6 +609,7 @@ automaton_printer::print(const spot::twa_graph_ptr& aut,
// Input location for errors and statistics.
const char* filename,
int loc,
unsigned index,
// input automaton for statistics
const spot::const_parsed_aut_ptr& haut,
const char* csv_prefix,
@ -613,7 +633,8 @@ automaton_printer::print(const spot::twa_graph_ptr& aut,
if (opt_name)
{
name.str("");
namer.print(haut, aut, f, filename, loc, ptimer, csv_prefix, csv_suffix);
namer.print(haut, aut, f, filename, loc, index,
ptimer, csv_prefix, csv_suffix);
aut->set_named_prop("automaton-name", new std::string(name.str()));
}
@ -621,13 +642,33 @@ automaton_printer::print(const spot::twa_graph_ptr& aut,
if (opt_output)
{
outputname.str("");
outputnamer.print(haut, aut, f, filename, loc, ptimer,
csv_prefix, csv_suffix);
outputnamer.print(haut, aut, f, filename, loc, index,
ptimer, csv_prefix, csv_suffix);
std::string fname = outputname.str();
auto p = outputfiles.emplace(fname, nullptr);
if (p.second)
p.first->second.reset(new output_file(fname.c_str()));
out = &p.first->second->ostream();
auto [it, b] = outputfiles.try_emplace(fname, nullptr);
if (b)
it->second.reset(new output_file(fname.c_str()));
else
// reopen if the file has been closed; see below
it->second->reopen_for_append(fname);
out = &it->second->ostream();
// If we have opened fewer than 10 files, we keep them all open
// to avoid wasting time on open/close calls.
//
// However we cannot keep all files open, especially in
// scenarios were we use thousands of files only once. To keep
// things simple, we only close the previous file if it is not
// the current output. This way we still save the close/open
// cost when consecutive automata are sent to the same file.
static output_file* previous = nullptr;
static const std::string* previous_name = nullptr;
if (previous
&& outputfiles.size() > 10
&& &previous->ostream() != out)
previous->close(*previous_name);
previous = it->second.get();
previous_name = &it->first;
}
// Output it.
@ -651,8 +692,8 @@ automaton_printer::print(const spot::twa_graph_ptr& aut,
break;
case Stats:
statistics.set_output(*out);
statistics.print(haut, aut, f, filename, loc, ptimer,
csv_prefix, csv_suffix) << '\n';
statistics.print(haut, aut, f, filename, loc, index,
ptimer, csv_prefix, csv_suffix) << '\n';
break;
}
flush_cout();

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2014-2018, 2020 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -47,11 +46,16 @@ enum automaton_format_t {
// The format to use in output_automaton()
extern automaton_format_t automaton_format;
extern const char* automaton_format_opt;
// Set to the argument of --name, else nullptr.
extern const char* opt_name;
// Output options
extern const struct argp aoutput_argp;
// help text for --hoaf
extern const char* hoa_option_doc_short;
extern const char* hoa_option_doc_long;
// help text for %F and %L
extern char F_doc[32];
extern char L_doc[32];
@ -132,10 +136,10 @@ public:
void print(std::ostream& os, const char* pos) const override;
};
/// \brief prints various statistics about a TGBA
/// \brief prints various statistics about a TwA
///
/// This object can be configured to display various statistics
/// about a TGBA. Some %-sequence of characters are interpreted in
/// about a TwA. Some %-sequence of characters are interpreted in
/// the format string, and replaced by the corresponding statistics.
class hoa_stat_printer: protected spot::stat_printer
{
@ -152,10 +156,12 @@ public:
/// to be output.
std::ostream&
print(const spot::const_parsed_aut_ptr& haut,
const spot::const_twa_graph_ptr& aut,
spot::formula f,
const char* filename, int loc, spot::process_timer& ptimer,
const char* csv_prefix, const char* csv_suffix);
const spot::const_twa_graph_ptr& aut,
spot::formula f,
const char* filename, int loc,
unsigned index,
const spot::process_timer& ptimer,
const char* csv_prefix, const char* csv_suffix);
private:
spot::printable_value<const char*> filename_;
@ -164,10 +170,11 @@ private:
spot::printable_value<std::string> aut_name_;
spot::printable_value<std::string> aut_word_;
spot::printable_value<std::string> haut_word_;
spot::printable_value<unsigned> index_;
spot::printable_acc_cond haut_gen_acc_;
spot::printable_value<unsigned> haut_states_;
spot::printable_value<unsigned> haut_edges_;
spot::printable_value<unsigned long long> haut_trans_;
spot::printable_size haut_states_;
spot::printable_size haut_edges_;
spot::printable_long_size haut_trans_;
spot::printable_value<unsigned> haut_acc_;
printable_varset haut_ap_;
printable_varset aut_ap_;
@ -195,7 +202,7 @@ class automaton_printer
std::map<std::string, std::unique_ptr<output_file>> outputfiles;
public:
automaton_printer(stat_style input = no_input);
explicit automaton_printer(stat_style input = no_input);
~automaton_printer();
void
@ -205,6 +212,8 @@ public:
// Input location for errors and statistics.
const char* filename = nullptr,
int loc = -1,
// serial numbner
unsigned index = 0,
// Time and input automaton for statistics
const spot::const_parsed_aut_ptr& haut = nullptr,
const char* csv_prefix = nullptr,

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2017, 2019 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2017 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015, 2018 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -25,10 +24,15 @@ int
to_int(const char* s, const char* where)
{
char* endptr;
int res = strtol(s, &endptr, 10);
errno = 0;
long int lres = strtol(s, &endptr, 10);
if (*endptr)
error(2, 0, "failed to parse '%s' as an integer (in argument of %s).",
s, where);
int res = lres;
if (res != lres || errno == ERANGE)
error(2, 0, "value '%s' is too large for an int (in argument of %s).",
s, where);
return res;
}
@ -45,11 +49,17 @@ unsigned
to_unsigned (const char *s, const char* where)
{
char* endptr;
unsigned res = strtoul(s, &endptr, 10);
errno = 0;
unsigned long lres = strtoul(s, &endptr, 10);
if (*endptr)
error(2, 0,
"failed to parse '%s' as an unsigned integer (in argument of %s).",
s, where);
unsigned res = lres;
if (res != lres || errno == ERANGE)
error(2, 0,
"value '%s' is too large for a unsigned int (in argument of %s).",
s, where);
return res;
}
@ -57,8 +67,9 @@ float
to_float(const char* s, const char* where)
{
char* endptr;
errno = 0;
float res = strtof(s, &endptr);
if (*endptr)
if (*endptr || errno == ERANGE)
error(2, 0, "failed to parse '%s' as a float (in argument of %s)",
s, where);
return res;
@ -80,8 +91,9 @@ to_longs(const char* arg)
while (*arg)
{
char* endptr;
errno = 0;
long value = strtol(arg, &endptr, 10);
if (endptr == arg)
if (endptr == arg || errno)
error(2, 0, "failed to parse '%s' as an integer.", arg);
res.push_back(value);
while (*endptr == ' ' || *endptr == ',')

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015, 2018 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -28,5 +27,5 @@ unsigned to_unsigned (const char *s, const char* where);
float to_float(const char* s, const char* where);
float to_probability(const char* s, const char* where);
// Parse the comma or space seperate string of numbers.
// Parse the comma or space separated string of numbers.
std::vector<long> to_longs(const char* s);

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2016 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015, 2016 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -21,34 +20,50 @@
#include <error.h>
#include <iostream>
output_file::output_file(const char* name)
output_file::output_file(const char* name, bool force_append)
{
std::ios_base::openmode mode = std::ios_base::trunc;
if (name[0] == '>' && name[1] == '>')
{
mode = std::ios_base::app;
append_ = true;
name += 2;
}
if (force_append)
append_ = true;
if (append_)
mode = std::ios_base::app;
if (name[0] == '-' && name[1] == 0)
{
os_ = &std::cout;
return;
}
of_ = new std::ofstream(name, mode);
of_ = std::make_unique<std::ofstream>(name, mode);
if (!*of_)
error(2, errno, "cannot open '%s'", name);
os_ = of_;
os_ = of_.get();
}
void
output_file::reopen_for_append(const std::string& name)
{
if (os_ == &std::cout || of_->is_open()) // nothing to do
return;
const char* cname = name.c_str();
if (cname[0] == '>' && cname[1] == '>')
cname += 2;
// the name cannot be "-" at this point, otherwise os_ would be
// equal to std::cout.
of_->open(cname, std::ios_base::app);
if (!*of_)
error(2, errno, "cannot reopen '%s'", cname);
}
void output_file::close(const std::string& name)
{
// We close of_, not os_, so that we never close std::cout.
if (os_)
os_->flush();
if (of_)
if (of_ && of_->is_open())
of_->close();
if (os_ && !*os_)
error(2, 0, "error writing to %s",

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015, 2016 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -21,26 +20,23 @@
#include "common_sys.hh"
#include <iosfwd>
#include <memory>
#include <fstream>
#include <error.h>
class output_file
{
std::ostream* os_;
std::ofstream* of_ = nullptr;
std::unique_ptr<std::ofstream> of_;
bool append_ = false;
public:
// Open a file for output. "-" is interpreted as stdout.
// Names that start with ">>" are opened for append.
// The function calls error() on... error.
output_file(const char* name);
output_file(const char* name, bool force_append = false);
void close(const std::string& name);
~output_file()
{
delete of_;
}
void reopen_for_append(const std::string& name);
bool append() const
{

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2017, 2019, 2021 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -68,10 +67,10 @@ parse_opt_finput(int key, char* arg, struct argp_state*)
switch (key)
{
case 'f':
jobs.emplace_back(arg, false);
jobs.emplace_back(arg, job_type::LTL_STRING);
break;
case 'F':
jobs.emplace_back(arg, true);
jobs.emplace_back(arg, job_type::LTL_FILENAME);
break;
case OPT_LBT:
lbt_input = true;
@ -96,12 +95,6 @@ parse_formula(const std::string& s)
(s, spot::default_environment::instance(), false, lenient);
}
job_processor::job_processor()
: abort_run(false), real_filename(nullptr),
col_to_read(0), prefix(nullptr), suffix(nullptr)
{
}
job_processor::~job_processor()
{
if (real_filename)
@ -303,8 +296,22 @@ job_processor::process_stream(std::istream& is,
}
int
job_processor::process_file(const char* filename)
job_processor::process_aut_file(const char*)
{
throw std::runtime_error("process_aut_file not defined for this tool");
}
int
job_processor::process_tlsf_file(const char*)
{
throw std::runtime_error("process_tlsf_file not defined for this tool");
}
int
job_processor::process_ltl_file(const char* filename)
{
col_to_read = 0;
// Special case for stdin.
if (filename[0] == '-' && filename[1] == 0)
return process_stream(std::cin, filename);
@ -356,27 +363,40 @@ int
job_processor::run()
{
int error = 0;
for (auto& j: jobs)
for (const auto& j: jobs)
{
if (!j.file_p)
error |= process_string(j.str);
else
error |= process_file(j.str);
switch (j.type)
{
case job_type::LTL_STRING:
error |= process_string(j.str);
break;
case job_type::LTL_FILENAME:
error |= process_ltl_file(j.str);
break;
case job_type::AUT_FILENAME:
error |= process_aut_file(j.str);
break;
case job_type::TLSF_FILENAME:
error |= process_tlsf_file(j.str);
break;
default:
throw std::runtime_error("unexpected job type");
}
if (abort_run)
break;
}
return error;
}
void check_no_formula()
void check_no_formula(const char* action)
{
if (!jobs.empty())
return;
if (isatty(STDIN_FILENO))
error(2, 0, "No formula to translate? Run '%s --help' for help.\n"
error(2, 0, "No formula to %s? Run '%s --help' for help.\n"
"Use '%s -' to force reading formulas from the standard "
"input.", program_name, program_name);
jobs.emplace_back("-", true);
"input.", action, program_name, program_name);
jobs.emplace_back("-", job_type::LTL_FILENAME);
}
void check_no_automaton()
@ -387,5 +407,5 @@ void check_no_automaton()
error(2, 0, "No automaton to process? Run '%s --help' for help.\n"
"Use '%s -' to force reading automata from the standard "
"input.", program_name, program_name);
jobs.emplace_back("-", true);
jobs.emplace_back("-", job_type::AUT_FILENAME);
}

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2017 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -25,13 +24,18 @@
#include <vector>
#include <spot/tl/parse.hh>
enum class job_type : char { LTL_STRING,
LTL_FILENAME,
AUT_FILENAME,
TLSF_FILENAME };
struct job
{
const char* str;
bool file_p; // true if str is a filename, false if it is a formula
job_type type;
job(const char* str, bool file_p) noexcept
: str(str), file_p(file_p)
job(const char* str, job_type type) noexcept
: str(str), type(type)
{
}
};
@ -51,9 +55,11 @@ spot::parsed_formula parse_formula(const std::string& s);
class job_processor
{
protected:
bool abort_run; // Set to true in process_formula() to abort run().
bool abort_run = false; // Set to true in process_formula() to abort run().
public:
job_processor();
job_processor() = default;
job_processor(const job_processor&) = delete;
job_processor& operator=(const job_processor&) = delete;
virtual ~job_processor();
@ -68,18 +74,24 @@ public:
process_stream(std::istream& is, const char* filename);
virtual int
process_file(const char* filename);
process_ltl_file(const char* filename);
virtual int
process_aut_file(const char* filename);
virtual int
process_tlsf_file(const char* filename);
virtual int
run();
char* real_filename;
long int col_to_read;
char* prefix;
char* suffix;
char* real_filename = nullptr;
long int col_to_read = 0;
char* prefix = nullptr;
char* suffix = nullptr;
};
// Report and error message or add a default job depending on whether
// the input is a tty.
void check_no_formula();
void check_no_formula(const char* action = "translate");
void check_no_automaton();

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015, 2019 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015, 2017, 2018 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -80,8 +79,10 @@ public:
}
int
process_file(const char* filename) override
process_aut_file(const char* filename) override
{
col_to_read = 0;
// If we have a filename like "foo/NN" such
// that:
// ① foo/NN is not a file,

268
bin/common_ioap.cc Normal file
View file

@ -0,0 +1,268 @@
// -*- coding: utf-8 -*-
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
// Spot is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "common_ioap.hh"
#include "error.h"
#include <fstream>
#include <unordered_set>
// --ins and --outs, as supplied on the command-line
std::optional<std::vector<std::string>> all_output_aps;
std::optional<std::vector<std::string>> all_input_aps;
// Store refirst, separate the filters that are regular expressions from
// the others. Compile the regular expressions while we are at it.
std::vector<std::regex> regex_in;
std::vector<std::regex> regex_out;
// map identifier to input/output (false=input, true=output)
std::unordered_map<std::string, bool> identifier_map;
static bool a_part_file_was_read = false;
static std::string
str_tolower(std::string s)
{
std::transform(s.begin(), s.end(), s.begin(),
[](unsigned char c){ return std::tolower(c); });
return s;
}
void
split_aps(const std::string& arg, std::vector<std::string>& where)
{
std::istringstream aps(arg);
std::string ap;
while (std::getline(aps, ap, ','))
{
ap.erase(remove_if(ap.begin(), ap.end(), isspace), ap.end());
where.push_back(str_tolower(ap));
}
}
void process_io_options()
{
// Filter identifiers from regexes.
if (all_input_aps.has_value())
for (const std::string& f: *all_input_aps)
{
unsigned sz = f.size();
if (f[0] == '/' && f[sz - 1] == '/')
regex_in.push_back(std::regex(f.substr(1, sz - 2)));
else
identifier_map.emplace(f, false);
}
if (all_output_aps.has_value())
for (const std::string& f: *all_output_aps)
{
unsigned sz = f.size();
if (f[0] == '/' && f[sz - 1] == '/')
regex_out.push_back(std::regex(f.substr(1, sz - 2)));
else if (auto [it, is_new] = identifier_map.try_emplace(f, true);
!is_new && !it->second)
error(2, 0,
a_part_file_was_read ?
"'%s' appears in both inputs and outputs" :
"'%s' appears in both --ins and --outs",
f.c_str());
}
}
static std::unordered_set<std::string>
list_aps_in_formula(spot::formula f)
{
std::unordered_set<std::string> aps;
f.traverse([&aps](spot::formula s) {
if (s.is(spot::op::ap))
aps.emplace(s.ap_name());
return false;
});
return aps;
}
bool
is_output(const std::string& a, const char* filename, int linenum)
{
if (auto it = identifier_map.find(a); it != identifier_map.end())
return it->second;
bool found_in = false;
for (const std::regex& r: regex_in)
if (std::regex_search(a, r))
{
found_in = true;
break;
}
bool found_out = false;
for (const std::regex& r: regex_out)
if (std::regex_search(a, r))
{
found_out = true;
break;
}
if (all_input_aps.has_value() == all_output_aps.has_value())
{
if (!all_input_aps.has_value())
{
// If the atomic proposition hasn't been classified
// because neither --ins nor --out were specified,
// attempt to classify automatically using the first
// letter.
int fl = a[0];
if (fl == 'i' || fl == 'I')
found_in = true;
else if (fl == 'o' || fl == 'O')
found_out = true;
}
if (found_in && found_out)
error_at_line(2, 0, filename, linenum,
a_part_file_was_read ?
"'%s' matches both inputs and outputs" :
"'%s' matches both --ins and --outs",
a.c_str());
if (!found_in && !found_out)
{
if (all_input_aps.has_value() || all_output_aps.has_value())
error_at_line(2, 0, filename, linenum,
a_part_file_was_read ?
"'%s' does not match any input or output" :
"one of --ins or --outs should match '%s'",
a.c_str());
else
error_at_line(2, 0, filename, linenum,
"since '%s' does not start with 'i' or 'o', "
"it is unclear if it is an input or "
"an output;\n use --ins, --outs, or --part-file",
a.c_str());
}
}
else
{
// if we had only --ins or only --outs, anything not
// matching that was given is assumed to belong to the
// other one.
if (!all_input_aps.has_value() && !found_out)
found_in = true;
else if (!all_output_aps.has_value() && !found_in)
found_out = true;
}
return found_out;
}
// Takes a set of the atomic propositions appearing in the formula,
// and separate them into two vectors: input APs and output APs.
std::pair<std::vector<std::string>, std::vector<std::string>>
filter_list_of_aps(spot::formula f, const char* filename, int linenum)
{
std::unordered_set<std::string> aps = list_aps_in_formula(f);
// now iterate over the list of atomic propositions to filter them
std::vector<std::string> matched[2]; // 0 = input, 1 = output
for (const std::string& a: aps)
matched[is_output(a, filename, linenum)].push_back(a);
return {matched[0], matched[1]};
}
spot::formula relabel_io(spot::formula f, spot::relabeling_map& fro,
const char* filename, int linenum)
{
auto [ins, outs] = filter_list_of_aps(f, filename, linenum);
// Different implementation of unordered_set, usinged in
// filter_list_of_aps can cause aps to be output in different order.
// Let's sort everything for the sake of determinism.
std::sort(ins.begin(), ins.end());
std::sort(outs.begin(), outs.end());
spot::relabeling_map to;
unsigned ni = 0;
for (std::string& i: ins)
{
std::ostringstream s;
s << 'i' << ni++;
spot::formula a1 = spot::formula::ap(i);
spot::formula a2 = spot::formula::ap(s.str());
fro[a2] = a1;
to[a1] = a2;
}
unsigned no = 0;
for (std::string& o: outs)
{
std::ostringstream s;
s << 'o' << no++;
spot::formula a1 = spot::formula::ap(o);
spot::formula a2 = spot::formula::ap(s.str());
fro[a2] = a1;
to[a1] = a2;
}
return spot::relabel_apply(f, &to);
}
// Read FILENAME as a ".part" file. It should
// contains lines of text of the following form:
//
// .inputs IN1 IN2 IN3...
// .outputs OUT1 OUT2 OUT3...
void read_part_file(const char* filename)
{
std::ifstream in(filename);
if (!in)
error(2, errno, "cannot open '%s'", filename);
// This parsing is inspired from Lily's parser for .part files. We
// read words one by one, and change the "mode" if we the word is
// ".inputs" or ".outputs". A '#' introduce a comment until the end
// of the line.
std::string word;
enum { Unknown, Input, Output } mode = Unknown;
while (in >> word)
{
// The benchmarks for Syft use ".inputs:" instead of ".inputs".
if (word == ".inputs" || word == ".inputs:")
{
mode = Input;
if (!all_input_aps.has_value())
all_input_aps.emplace();
}
// The benchmarks for Syft use ".outputs:" instead of ".outputs".
else if (word == ".outputs" || word == ".outputs:")
{
mode = Output;
if (!all_output_aps.has_value())
all_output_aps.emplace();
}
else if (word[0] == '#')
{
// Skip the rest of the line.
in.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
else if (mode == Unknown)
{
error_at_line(2, 0, filename, 0,
"expected '.inputs' or '.outputs' instead of '%s'",
word.c_str());
}
else if (mode == Input)
{
all_input_aps->push_back(str_tolower(word));
}
else /* mode == Output */
{
all_output_aps->push_back(str_tolower(word));
}
}
a_part_file_was_read = true;
}

69
bin/common_ioap.hh Normal file
View file

@ -0,0 +1,69 @@
// -*- coding: utf-8 -*-
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
// Spot is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include "common_sys.hh"
#include <optional>
#include <regex>
#include <string>
#include <vector>
#include <unordered_map>
#include <spot/tl/formula.hh>
#include <spot/tl/relabel.hh>
// --ins and --outs, as supplied on the command-line
extern std::optional<std::vector<std::string>> all_output_aps;
extern std::optional<std::vector<std::string>> all_input_aps;
// Comma-separated list of strings, such as those passed to --ins/--outs
void split_aps(const std::string& arg, std::vector<std::string>& where);
// process the all_output_aps and all_input_aps above to
// fill regex_in, regex_out, and identifier_map.
void process_io_options();
// Store refirst, separate the filters that are regular expressions from
// the others. Compile the regular expressions while we are at it.
extern std::vector<std::regex> regex_in;
extern std::vector<std::regex> regex_out;
// map identifier to input/output (false=input, true=output)
extern std::unordered_map<std::string, bool> identifier_map;
// Given an atomic proposition AP and the above
// regex_in/regex_out/identifier_map, decide if this AP is an output
// (true) or input (false.
bool
is_output(const std::string& ap,
const char* filename = nullptr, int linenum = 0);
// Separate the set of the atomic propositions appearing in f, into
// two vectors: input APs and output APs, becased on regex_in,
// regex_out, and identifier_map.
std::pair<std::vector<std::string>, std::vector<std::string>>
filter_list_of_aps(spot::formula f, const char* filename, int linenum);
// Relabel APs incrementally, based on i/o class.
spot::formula relabel_io(spot::formula f, spot::relabeling_map& fro,
const char* filename, int linenum);
// Read a .part file.
void read_part_file(const char* filename);

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2019 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -23,6 +22,7 @@
#include "common_setup.hh"
#include <iostream>
#include <sstream>
#include <memory>
#include <spot/tl/print.hh>
#include <spot/tl/length.hh>
#include <spot/tl/apcollect.hh>
@ -44,6 +44,7 @@ output_format_t output_format = spot_output;
bool full_parenth = false;
bool escape_csv = false;
char output_terminator = '\n';
bool output_ratexp = false;
static const argp_option options[] =
{
@ -104,7 +105,10 @@ stream_formula(std::ostream& out,
report_not_ltl(f, filename, linenum, "LBT");
break;
case spot_output:
spot::print_psl(out, f, full_parenth);
if (output_ratexp)
spot::print_sere(out, f, full_parenth);
else
spot::print_psl(out, f, full_parenth);
break;
case spin_output:
if (f.is_ltl_formula())
@ -119,10 +123,16 @@ stream_formula(std::ostream& out,
report_not_ltl(f, filename, linenum, "Wring");
break;
case utf8_output:
spot::print_utf8_psl(out, f, full_parenth);
if (output_ratexp)
spot::print_utf8_sere(out, f, full_parenth);
else
spot::print_utf8_psl(out, f, full_parenth);
break;
case latex_output:
spot::print_latex_psl(out, f, full_parenth);
if (output_ratexp)
spot::print_latex_sere(out, f, full_parenth);
else
spot::print_latex_psl(out, f, full_parenth);
break;
case count_output:
case quiet_output:
@ -159,6 +169,7 @@ namespace
spot::formula f;
const char* filename;
const char* line;
unsigned index;
const char* prefix;
const char* suffix;
};
@ -223,7 +234,7 @@ namespace
}
};
class formula_printer final: protected spot::formater
class formula_printer final: public spot::formater
{
public:
formula_printer(std::ostream& os, const char* format)
@ -236,6 +247,7 @@ namespace
declare('R', &timer_);
declare('r', &timer_);
declare('L', &line_);
declare('l', &index_);
declare('s', &size_);
declare('h', &class_);
declare('n', &nesting_);
@ -247,7 +259,8 @@ namespace
}
std::ostream&
print(const formula_with_location& fl, spot::process_timer* ptimer)
print(const formula_with_location& fl,
spot::process_timer* ptimer)
{
if (has('R') || has('r'))
timer_ = *ptimer;
@ -255,6 +268,7 @@ namespace
fl_ = &fl;
filename_ = fl.filename ? fl.filename : "";
line_ = fl.line;
index_ = fl.index;
prefix_ = fl.prefix ? fl.prefix : "";
suffix_ = fl.suffix ? fl.suffix : "";
auto f = fl_.val()->f;
@ -287,6 +301,7 @@ namespace
printable_timer timer_;
spot::printable_value<const char*> filename_;
spot::printable_value<const char*> line_;
spot::printable_value<unsigned> index_;
spot::printable_value<const char*> prefix_;
spot::printable_value<const char*> suffix_;
spot::printable_value<int> size_;
@ -297,9 +312,9 @@ namespace
};
}
static formula_printer* format = nullptr;
static std::unique_ptr<formula_printer> format;
static std::ostringstream outputname;
static formula_printer* outputnamer = nullptr;
static std::unique_ptr<formula_printer> outputnamer;
static std::map<std::string, std::unique_ptr<output_file>> outputfiles;
int
@ -320,7 +335,7 @@ parse_opt_output(int key, char* arg, struct argp_state*)
output_format = lbt_output;
break;
case 'o':
outputnamer = new formula_printer(outputname, arg);
outputnamer = std::make_unique<formula_printer>(outputname, arg);
break;
case 'p':
full_parenth = true;
@ -341,8 +356,7 @@ parse_opt_output(int key, char* arg, struct argp_state*)
output_format = wring_output;
break;
case OPT_FORMAT:
delete format;
format = new formula_printer(std::cout, arg);
format = std::make_unique<formula_printer>(std::cout, arg);
break;
default:
return ARGP_ERR_UNKNOWN;
@ -356,6 +370,7 @@ static void
output_formula(std::ostream& out,
spot::formula f, spot::process_timer* ptimer,
const char* filename, const char* linenum,
unsigned index,
const char* prefix, const char* suffix)
{
if (!format)
@ -391,7 +406,9 @@ output_formula(std::ostream& out,
}
else
{
formula_with_location fl = { f, filename, linenum, prefix, suffix };
formula_with_location fl = { f, filename, linenum,
index, prefix, suffix };
format->set_output(out);
format->print(fl, ptimer);
}
}
@ -399,6 +416,7 @@ output_formula(std::ostream& out,
void
output_formula_checked(spot::formula f, spot::process_timer* ptimer,
const char* filename, const char* linenum,
unsigned index,
const char* prefix, const char* suffix)
{
if (output_format == count_output)
@ -414,15 +432,36 @@ output_formula_checked(spot::formula f, spot::process_timer* ptimer,
if (outputnamer)
{
outputname.str("");
formula_with_location fl = { f, filename, linenum, prefix, suffix };
formula_with_location fl = { f, filename, linenum,
index, prefix, suffix };
outputnamer->print(fl, ptimer);
std::string fname = outputname.str();
auto p = outputfiles.emplace(fname, nullptr);
if (p.second)
p.first->second.reset(new output_file(fname.c_str()));
out = &p.first->second->ostream();
auto [it, b] = outputfiles.try_emplace(fname, nullptr);
if (b)
it->second.reset(new output_file(fname.c_str()));
else
// reopen if the file has been closed; see below
it->second->reopen_for_append(fname);
out = &it->second->ostream();
// If we have opened fewer than 10 files, we keep them all open
// to avoid wasting time on open/close calls.
//
// However we cannot keep all files open, especially in
// scenarios were we use thousands of files only once. To keep
// things simple, we only close the previous file if it is not
// the current output. This way we still save the close/open
// cost when consecutive formulas are sent to the same file.
static output_file* previous = nullptr;
static const std::string* previous_name = nullptr;
if (previous
&& outputfiles.size() > 10
&& &previous->ostream() != out)
previous->close(*previous_name);
previous = it->second.get();
previous_name = &it->first;
}
output_formula(*out, f, ptimer, filename, linenum, prefix, suffix);
output_formula(*out, f, ptimer, filename, linenum, index, prefix, suffix);
*out << output_terminator;
// Make sure we abort if we can't write to std::cout anymore
// (like disk full or broken pipe with SIGPIPE ignored).
@ -432,10 +471,12 @@ output_formula_checked(spot::formula f, spot::process_timer* ptimer,
void output_formula_checked(spot::formula f,
spot::process_timer* ptimer,
const char* filename, int linenum,
unsigned index,
const char* prefix,
const char* suffix)
{
output_formula_checked(f, ptimer, filename,
std::to_string(linenum).c_str(),
index,
prefix, suffix);
}

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2018 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -36,6 +35,7 @@ enum output_format_t { spot_output, spin_output, utf8_output,
extern output_format_t output_format;
extern bool full_parenth;
extern bool escape_csv;
extern bool output_ratexp;
#define COMMON_X_OUTPUT_SPECS(where) \
"number of atomic propositions " #where "; " \
@ -81,11 +81,13 @@ void output_formula_checked(spot::formula f,
spot::process_timer* ptimer = nullptr,
const char* filename = nullptr,
const char* linenum = nullptr,
unsigned output_index = 0U,
const char* prefix = nullptr,
const char* suffix = nullptr);
void output_formula_checked(spot::formula f,
spot::process_timer* ptimer,
const char* filename, int linenum,
unsigned output_index,
const char* prefix = nullptr,
const char* suffix = nullptr);

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2016, 2018-2020 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -232,7 +231,14 @@ parse_opt_post(int key, char* arg, struct argp_state*)
if (arg)
type = XARGMATCH(key == 'P' ? "--parity" : "--colored-parity",
arg, parity_args, parity_types);
else
else if (!(type & spot::postprocessor::Parity))
// If no argument was given, we just require Parity.
// However, if a Parity condition was already set before,
// don't overwrite it. This way if someone mistakenly write
// `--parity='max even' --colored` without realizing that
// `--colored` is just the abbreviation for
// `--colored-parity=...` with the default argument, we
// won't reset the 'max even' setting.
type = spot::postprocessor::Parity;
if (key == 'p')
colored = spot::postprocessor::Colored;

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2018 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2015 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2014, 2016 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -36,13 +35,17 @@ parse_range(const char* str, int missing_left, int missing_right)
{
range res;
char* end;
res.min = strtol(str, &end, 10);
errno = 0;
long lres = strtol(str, &end, 10);
res.min = lres;
if (res.min != lres || errno == ERANGE)
error(2, 0, "start of range '%s' is too large for an int.", str);
if (end == str)
{
// No leading number. It's OK as long as the string is not
// empty.
if (!*end)
error(1, 0, "invalid empty range");
error(2, 0, "invalid empty range");
res.min = missing_left;
}
if (!*end)
@ -66,19 +69,23 @@ parse_range(const char* str, int missing_left, int missing_right)
{
// Parse the next integer.
char* end2;
res.max = strtol(end, &end2, 10);
errno = 0;
lres = strtol(end, &end2, 10);
res.max = lres;
if (res.max != lres || errno == ERANGE)
error(2, 0, "end of range '%s' is too large for an int.", str);
if (str == end2)
error(1, 0, "invalid range '%s' "
error(2, 0, "invalid range '%s' "
"(should start with digits, dots, or colon)", str);
if (end == end2)
error(1, 0, "invalid range '%s' (missing end?)", str);
error(2, 0, "invalid range '%s' (missing end?)", str);
if (*end2)
error(1, 0, "invalid range '%s' (trailing garbage?)", str);
error(2, 0, "invalid range '%s' (trailing garbage?)", str);
}
}
if (res.min < 0 || res.max < 0)
error(1, 0, "invalid range '%s': values must be positive", str);
error(2, 0, "invalid range '%s': values must be positive", str);
return res;
}

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2014, 2015, 2016 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2022 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -20,13 +19,14 @@
#include "common_setup.hh"
#include "common_aoutput.hh"
#include "argp.h"
#include "closeout.h"
#include <argp.h>
#include <closeout.h>
#include <cstdlib>
#include <unistd.h>
#include <iostream>
#include <signal.h>
#include <sys/wait.h>
#include <error.h>
#include <spot/misc/tmpfile.hh>
static void
@ -35,7 +35,7 @@ display_version(FILE *stream, struct argp_state*)
fputs(program_name, stream);
fputs(" (" PACKAGE_NAME ") " PACKAGE_VERSION "\n\
\n\
Copyright (C) 2022 Laboratoire de Recherche et Développement de l'Epita.\n\
Copyright (C) 2025 by the Spot authors, see the AUTHORS File for details.\n\
License GPLv3+: \
GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n\
This is free software: you are free to change and redistribute it.\n\

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013, 2018, 2019 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -34,5 +33,5 @@ int protected_main(char** progname, std::function<int()> mainfun);
// Diagnose exceptions.
[[noreturn]] void handle_any_exception();
#define BEGIN_EXCEPTION_PROTECT try { (void)0;
#define BEGIN_EXCEPTION_PROTECT try { (void)0
#define END_EXCEPTION_PROTECT } catch (...) { handle_any_exception(); }

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015-2022 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -27,6 +26,7 @@
#include <sys/wait.h>
#include <fcntl.h>
#include <iomanip>
#include <fstream>
#if __has_include(<spawn.h>)
#define HAVE_SPAWN_H 1
#include <spawn.h>
@ -52,7 +52,7 @@ struct shorthands_t
};
#define SHORTHAND(PRE, POST) { PRE, std::regex("^" PRE), POST }
static shorthands_t shorthands_ltl[] = {
static const shorthands_t shorthands_ltl[] = {
SHORTHAND("delag", " %f>%O"),
SHORTHAND("lbt", " <%L>%O"),
SHORTHAND("ltl2ba", " -f %s>%O"),
@ -72,7 +72,7 @@ static shorthands_t shorthands_ltl[] = {
SHORTHAND("owl.* ltl-utilities\\b", " -f %f"),
};
static shorthands_t shorthands_autproc[] = {
static const shorthands_t shorthands_autproc[] = {
SHORTHAND("autfilt", " %H>%O"),
SHORTHAND("dra2dpa", " <%H>%O"),
SHORTHAND("dstar2tgba", " %H>%O"),
@ -84,7 +84,7 @@ static shorthands_t shorthands_autproc[] = {
" <%H>%O"),
};
static void show_shorthands(shorthands_t* begin, shorthands_t* end)
static void show_shorthands(const shorthands_t* begin, const shorthands_t* end)
{
std::cout
<< ("If a COMMANDFMT does not use any %-sequence, and starts with one of\n"
@ -99,7 +99,8 @@ static void show_shorthands(shorthands_t* begin, shorthands_t* end)
}
tool_spec::tool_spec(const char* spec, shorthands_t* begin, shorthands_t* end,
tool_spec::tool_spec(const char* spec,
const shorthands_t* begin, const shorthands_t* end,
bool is_ref) noexcept
: spec(spec), cmd(spec), name(spec), reference(is_ref)
{
@ -112,15 +113,15 @@ tool_spec::tool_spec(const char* spec, shorthands_t* begin, shorthands_t* end,
{
if (*pos == '{')
++count;
else if (*pos == '}')
if (!--count)
{
name = strndup(cmd + 1, pos - cmd - 1);
cmd = pos + 1;
while (*cmd == ' ' || *cmd == '\t')
++cmd;
break;
}
else if (*pos == '}' && --count == 0)
{
name = strndup(cmd + 1, pos - cmd - 1);
cmd = pos + 1;
// skip leading whitespace
while (*cmd == ' ' || *cmd == '\t')
++cmd;
break;
}
}
}
// If there is no % in the string, look for a known
@ -146,11 +147,11 @@ tool_spec::tool_spec(const char* spec, shorthands_t* begin, shorthands_t* end,
auto& p = *begin++;
if (std::regex_search(basename, p.rprefix))
{
int m = strlen(p.suffix);
int q = strlen(cmd);
size_t m = strlen(p.suffix);
size_t q = strlen(cmd);
char* tmp = static_cast<char*>(malloc(q + m + 1));
strcpy(tmp, cmd);
strcpy(tmp + q, p.suffix);
memcpy(tmp, cmd, q);
memcpy(tmp + q, p.suffix, m + 1);
cmd = tmp;
allocated = true;
break;
@ -461,6 +462,92 @@ autproc_runner::round_automaton(spot::const_twa_graph_ptr aut, unsigned serial)
filename_automaton.new_round(aut, serial);
}
std::string
read_stdout_of_command(char* const* args)
{
#if HAVE_SPAWN_H
int cout_pipe[2];
if (int err = pipe(cout_pipe))
error(2, err, "pipe() failed");
posix_spawn_file_actions_t actions;
if (int err = posix_spawn_file_actions_init(&actions))
error(2, err, "posix_spawn_file_actions_init() failed");
posix_spawn_file_actions_addclose(&actions, STDIN_FILENO);
posix_spawn_file_actions_addclose(&actions, cout_pipe[0]);
posix_spawn_file_actions_adddup2(&actions, cout_pipe[1], STDOUT_FILENO);
posix_spawn_file_actions_addclose(&actions, cout_pipe[1]);
pid_t pid;
if (int err = posix_spawnp(&pid, args[0], &actions, nullptr, args, environ))
error(2, err, "failed to run '%s'", args[0]);
if (int err = posix_spawn_file_actions_destroy(&actions))
error(2, err, "posix_spawn_file_actions_destroy() failed");
if (close(cout_pipe[1]) < 0)
error(2, errno, "closing write-side of pipe failed");
std::string results;
ssize_t bytes_read;
for (;;)
{
static char buffer[512];
bytes_read = read(cout_pipe[0], buffer, sizeof(buffer));
if (bytes_read > 0)
results.insert(results.end(), buffer, buffer + bytes_read);
else
break;
}
if (bytes_read < 0)
error(2, bytes_read, "failed to read from pipe");
if (cout_pipe[0] < 0)
error(2, errno, "closing read-side of pipe failed");
int exit_code = 0;
if (waitpid(pid, &exit_code, 0) == -1)
error(2, errno, "waitpid() failed");
if (exit_code)
error(2, 0, "'%s' exited with status %d", args[0], exit_code);
return results;
#else
// We could provide a pipe+fork+exec alternative implementation, but
// systems without posix_spawn() might also not have fork and exec.
// For instance MinGW does not. So let's fallback to system+tmpfile
// instead for maximum portability.
char prefix[30];
snprintf(prefix, sizeof prefix, "spot-tmp");
spot::temporary_file* tmpfile = spot::create_tmpfile(prefix);
std::string tmpname = tmpfile->name();
std::ostringstream cmd;
for (auto t = args; *t != nullptr; ++t)
spot::quote_shell_string(cmd, *t) << ' ';
cmd << '>';
spot::quote_shell_string(cmd, tmpfile->name());
std::string cmdstr = cmd.str();
int exit_code = system(cmdstr.c_str());
if (exit_code < 0)
error(2, errno, "failed to execute %s", cmdstr.c_str());
if (exit_code > 0)
error(2, 0, "'%s' exited with status %d", args[0], exit_code);
std::ifstream ifs(tmpname, std::ifstream::in);
if (!ifs)
error(2, 0, "failed to open %s (output of %s)", tmpname.c_str(), args[0]);
ifs.exceptions(std::ifstream::failbit | std::ifstream::badbit);
std::stringstream buffer;
buffer << ifs.rdbuf();
delete tmpfile;
return buffer.str();
#endif
}
std::atomic<bool> timed_out{false};
unsigned timeout_count = 0;
@ -524,7 +611,7 @@ get_arg(const char*& cmd)
{
const char* start = cmd;
std::string arg;
while (int c = *cmd)
while (char c = *cmd)
{
switch (c)
{
@ -554,14 +641,14 @@ get_arg(const char*& cmd)
goto end_loop;
case '\'':
{
int d = 0;
char d = '\0';
while ((d = *++cmd))
{
if (d == '\'')
break;
arg.push_back(d);
}
if (d == 0)
if (d == '\0')
return nullptr;
}
break;
@ -706,6 +793,7 @@ parse_simple_command(const char* cmd)
return res;
}
#ifndef HAVE_SPAWN_H
static void
exec_command(const char* cmd)
@ -751,8 +839,6 @@ exec_command(const char* cmd)
SPOT_UNREACHABLE();
return;
}
#else
extern char **environ;
#endif
int
@ -894,9 +980,9 @@ static const argp_option options[] =
"atomic proposition that compatible with Spin's syntax. You can "
"force this relabeling to always occur with option --relabel.\n"
"The sequences %f,%s,%l,%w,%F,%S,%L,%W can optionally be \"infixed\""
" by a bracketed sequence of operators to unabbreviate before outputing"
" by a bracketed sequence of operators to unabbreviate before outputting"
" the formula. For instance %[MW]f will rewrite operators M and W"
" before outputing it.\n"
" before outputting it.\n"
"Furthermore, if COMMANDFMT has the form \"{NAME}CMD\", then only CMD "
"will be passed to the shell, and NAME will be used to name the tool "
"in the output.", 4 },

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015-2018, 2020 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -51,7 +50,8 @@ struct tool_spec
// Whether the tool is a reference.
bool reference;
tool_spec(const char* spec, shorthands_t* begin, shorthands_t* end,
tool_spec(const char* spec,
const shorthands_t* begin, const shorthands_t* end,
bool is_ref) noexcept;
tool_spec(const tool_spec& other) noexcept;
tool_spec& operator=(const tool_spec& other);
@ -71,7 +71,7 @@ struct quoted_formula final: public spot::printable_value<spot::formula>
struct filed_formula final: public spot::printable
{
filed_formula(const quoted_formula& ltl) : f_(ltl)
explicit filed_formula(const quoted_formula& ltl) : f_(ltl)
{
}
@ -89,9 +89,7 @@ struct filed_formula final: public spot::printable
struct filed_automaton final: public spot::printable
{
filed_automaton()
{
}
filed_automaton() = default;
void print(std::ostream& os, const char* pos) const override;
@ -112,7 +110,7 @@ struct printable_result_filename final:
unsigned translator_num;
printable_result_filename();
~printable_result_filename();
~printable_result_filename() override;
void reset(unsigned n);
void cleanup();
@ -126,7 +124,7 @@ protected:
spot::bdd_dict_ptr dict;
// Round-specific variables
quoted_formula ltl_formula;
filed_formula filename_formula = ltl_formula;
filed_formula filename_formula{ltl_formula};
// Run-specific variables
printable_result_filename output;
public:
@ -151,9 +149,9 @@ protected:
public:
using spot::formater::has;
autproc_runner(// whether we accept the absence of output
// specifier
bool no_output_allowed = false);
explicit autproc_runner(// whether we accept the absence of output
// specifier
bool no_output_allowed = false);
void round_automaton(spot::const_twa_graph_ptr aut, unsigned serial);
};
@ -175,3 +173,9 @@ int exec_with_timeout(const char* cmd);
#define exec_with_timeout(cmd) system(cmd)
#define setup_sig_handler() while (0);
#endif // !ENABLE_TIMEOUT
// Run a command (whose args[0], args[1], etc. are given by args), and
// return its captured stdout. Stderr is not captured. Will abort
// with an error message if the command is not found, or if it exit
// with a non-zero status code.
std::string read_stdout_of_command(char* const* args);

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013-2019 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -48,7 +47,7 @@
#include <spot/parseaut/public.hh>
#include <spot/twaalgos/sccinfo.hh>
static const char argp_program_doc[] ="\
static const char argp_program_doc[] = "\
Convert automata with any acceptance condition into variants of \
Büchi automata.\n\nThis reads automata into any supported format \
(HOA, LBTT, ltl2dstar, never claim) and outputs a \
@ -89,7 +88,7 @@ parse_opt(int key, char* arg, struct argp_state*)
switch (key)
{
case 'F':
jobs.emplace_back(arg, true);
jobs.emplace_back(arg, job_type::AUT_FILENAME);
break;
case 'x':
{
@ -99,7 +98,7 @@ parse_opt(int key, char* arg, struct argp_state*)
}
break;
case ARGP_KEY_ARG:
jobs.emplace_back(arg, true);
jobs.emplace_back(arg, job_type::AUT_FILENAME);
break;
default:
return ARGP_ERR_UNKNOWN;
@ -117,7 +116,7 @@ namespace
spot::postprocessor& post;
automaton_printer printer;
dstar_processor(spot::postprocessor& post)
explicit dstar_processor(spot::postprocessor& post)
: hoa_processor(spot::make_bdd_dict()), post(post), printer(aut_input)
{
}
@ -129,7 +128,9 @@ namespace
timer.start();
auto aut = post.run(haut->aut, nullptr);
timer.stop();
printer.print(aut, timer, nullptr, haut->filename.c_str(), -1, haut);
static unsigned index = 0;
printer.print(aut, timer, nullptr, haut->filename.c_str(), -1,
index++, haut);
flush_cout();
return 0;
}

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2017-2019 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -43,7 +42,8 @@
using namespace spot;
const char argp_program_doc[] ="Generate ω-automata from predefined patterns.";
static const char argp_program_doc[] =
"Generate ω-automata from predefined patterns.";
static const argp_option options[] =
{
@ -61,7 +61,18 @@ static const argp_option options[] =
"equivalent deterministic Rabin automaton of less than N! states.", 0},
{ "m-nba", gen::AUT_M_NBA, "RANGE", 0,
"An NBA with N+1 states whose determinization needs at least "
"N! states", 0},
"N! states.", 0},
{ "cyclist-trace-nba", gen::AUT_CYCLIST_TRACE_NBA, "RANGE", 0,
"An NBA with N+2 states that should include cyclist-proof-dba=B.", 0},
{ "cyclist-proof-dba", gen::AUT_CYCLIST_PROOF_DBA, "RANGE", 0,
"A DBA with N+2 states that should be included "
"in cyclist-trace-nba=B.", 0},
{ "cycle-log-nba", gen::AUT_CYCLE_LOG_NBA, "RANGE", 0,
"A cyclic NBA with N*N states and log(N) atomic propositions, that "
"should be simplifiable to a cyclic NBA with N states.", 0 },
{ "cycle-onehot-nba", gen::AUT_CYCLE_ONEHOT_NBA, "RANGE", 0,
"A cyclic NBA with N*N states and N atomic propositions, that "
"should be simplifiable to a cyclic NBA with N states.", 0 },
RANGE_DOC,
/**************************************************/
{ nullptr, 0, nullptr, 0, "Miscellaneous options:", -1 },
@ -116,13 +127,14 @@ output_pattern(gen::aut_pattern_id pattern, int n)
twa_graph_ptr aut = spot::gen::aut_pattern(pattern, n);
timer.stop();
automaton_printer printer;
printer.print(aut, timer, nullptr, aut_pattern_name(pattern), n);
static unsigned serial = 0;
printer.print(aut, timer, nullptr, aut_pattern_name(pattern), n, serial++);
}
static void
run_jobs()
{
for (auto& j: jobs)
for (const auto& j: jobs)
{
int inc = (j.range.max < j.range.min) ? -1 : 1;
int n = j.range.min;

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013, 2015-2019 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -45,7 +44,7 @@
using namespace spot;
const char argp_program_doc[] ="\
static const char argp_program_doc[] = "\
Generate temporal logic formulas from predefined patterns.";
// We reuse the values from gen::ltl_pattern_id as option keys.
@ -84,6 +83,8 @@ static const argp_option options[] =
{ "eh-patterns", gen::LTL_EH_PATTERNS, "RANGE", OPTION_ARG_OPTIONAL,
"Etessami and Holzmann [Concur'00] patterns "
"(range should be included in 1..12)", 0 },
{ "eil-gsi", gen::LTL_EIL_GSI, "RANGE", 0,
"G[0..n]((a S b) -> c) rewritten using future operators", 0 },
{ "fxg-or", gen::LTL_FXG_OR, "RANGE", 0,
"F(p0 | XG(p1 | XG(p2 | ... XG(pn))))", 0},
{ "gf-equiv", gen::LTL_GF_EQUIV, "RANGE", 0,
@ -114,6 +115,11 @@ static const argp_option options[] =
{ "kv-psi", gen::LTL_KV_PSI, "RANGE", 0,
"quadratic formula with doubly exponential DBA", 0 },
OPT_ALIAS(kr-n2),
{ "lily-patterns", gen::LTL_LILY_PATTERNS, "RANGE", OPTION_ARG_OPTIONAL,
"LTL synthesis specification examples from Lily 1.0.2 "
"[Jobstmann & Bloem, FMCAD'06] "
"(range should be included in 1..23)", 0 },
OPT_ALIAS(jb-patterns),
{ "ms-example", gen::LTL_MS_EXAMPLE, "RANGE[,RANGE]", 0,
"GF(a1&X(a2&X(a3&...Xan)))&F(b1&F(b2&F(b3&...&Xbm)))", 0 },
{ "ms-phi-h", gen::LTL_MS_PHI_H, "RANGE", 0,
@ -134,11 +140,11 @@ static const argp_option options[] =
OPT_ALIAS(beem-patterns),
OPT_ALIAS(p),
{ "pps-arbiter-standard", gen::LTL_PPS_ARBITER_STANDARD, "RANGE", 0,
"Arbiter with n clients that sent requests (ri) and "
"receive grants (gi). Standard semantics.", 0 },
"Arbiter with n clients that sent requests (iN) and "
"receive grants (oN). Standard semantics.", 0 },
{ "pps-arbiter-strict", gen::LTL_PPS_ARBITER_STRICT, "RANGE", 0,
"Arbiter with n clients that sent requests (ri) and "
"receive grants (gi). Strict semantics.", 0 },
"Arbiter with n clients that sent requests (iN) and "
"receive grants (oN). Strict semantics.", 0 },
{ "r-left", gen::LTL_R_LEFT, "RANGE", 0, "(((p1 R p2) R p3) ... R pn)", 0 },
{ "r-right", gen::LTL_R_RIGHT, "RANGE", 0, "(p1 R (p2 R (... R pn)))", 0 },
{ "rv-counter", gen::LTL_RV_COUNTER, "RANGE", 0, "n-bit counter", 0 },
@ -190,6 +196,8 @@ static const argp_option options[] =
"the formula (in the selected syntax)", 0 },
{ "%F", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the name of the pattern", 0 },
{ "%l", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"serial number of the output formula (0-based)", 0 },
{ "%L", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the argument of the pattern", 0 },
{ "%%", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
@ -285,6 +293,8 @@ parse_opt(int key, char* arg, struct argp_state*)
}
static unsigned output_count = 0U;
static void
output_pattern(gen::ltl_pattern_id pattern, int n, int n2)
{
@ -301,21 +311,21 @@ output_pattern(gen::ltl_pattern_id pattern, int n, int n2)
if (opt_positive || !opt_negative)
{
output_formula_checked(f, nullptr, gen::ltl_pattern_name(pattern),
args.c_str());
args.c_str(), output_count++);
}
if (opt_negative)
{
std::string tmp = "!";
tmp += gen::ltl_pattern_name(pattern);
output_formula_checked(formula::Not(f), nullptr, tmp.c_str(),
args.c_str());
args.c_str(), output_count++);
}
}
static void
run_jobs()
{
for (auto& j: jobs)
for (const auto& j: jobs)
{
int inc = (j.range.max < j.range.min) ? -1 : 1;
int n = j.range.min;

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2019 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -39,7 +38,7 @@
#include <spot/misc/optionmap.hh>
#include <spot/misc/timer.hh>
static const char argp_program_doc[] ="\
static const char argp_program_doc[] = "\
Translate linear-time formulas (LTL/PSL) into various types of automata.\n\n\
By default it will apply all available optimizations to output \
the smallest Transition-based Generalized Büchi Automata, \
@ -105,10 +104,9 @@ parse_opt(int key, char* arg, struct argp_state*)
break;
case ARGP_KEY_ARG:
// FIXME: use stat() to distinguish filename from string?
if (*arg == '-' && !arg[1])
jobs.emplace_back(arg, true);
else
jobs.emplace_back(arg, false);
jobs.emplace_back(arg, ((*arg == '-' && !arg[1])
? job_type::LTL_FILENAME
: job_type::LTL_STRING));
break;
default:
@ -125,10 +123,10 @@ namespace
{
public:
spot::translator& trans;
automaton_printer printer;
automaton_printer printer{ltl_input};
trans_processor(spot::translator& trans)
: trans(trans), printer(ltl_input)
explicit trans_processor(spot::translator& trans)
: trans(trans)
{
}
@ -156,8 +154,9 @@ namespace
auto aut = trans.run(&f);
timer.stop();
printer.print(aut, timer, f, filename, linenum, nullptr,
prefix, suffix);
static unsigned index = 0;
printer.print(aut, timer, f, filename, linenum, index++,
nullptr, prefix, suffix);
// If we keep simplification caches around, atomic propositions
// will still be defined, and one translation may influence the
// variable order of the next one.

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2020 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -46,7 +45,7 @@
#include <spot/taalgos/minimize.hh>
#include <spot/misc/optionmap.hh>
const char argp_program_doc[] ="\
static const char argp_program_doc[] = "\
Translate linear-time formulas (LTL/PSL) into Testing Automata.\n\n\
By default it outputs a transition-based generalized Testing Automaton \
the smallest Transition-based Generalized Büchi Automata, \
@ -148,10 +147,9 @@ parse_opt(int key, char* arg, struct argp_state*)
break;
case ARGP_KEY_ARG:
// FIXME: use stat() to distinguish filename from string?
if (*arg == '-' && !arg[1])
jobs.emplace_back(arg, true);
else
jobs.emplace_back(arg, false);
jobs.emplace_back(arg, ((*arg == '-' && !arg[1])
? job_type::LTL_FILENAME
: job_type::LTL_STRING));
break;
default:
@ -169,7 +167,7 @@ namespace
public:
spot::translator& trans;
trans_processor(spot::translator& trans)
explicit trans_processor(spot::translator& trans)
: trans(trans)
{
}

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2020 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -69,7 +68,7 @@
#include <spot/misc/tmpfile.hh>
#include <spot/misc/timer.hh>
const char argp_program_doc[] ="\
static const char argp_program_doc[] = "\
Call several LTL/PSL translators and cross-compare their output to detect \
bugs, or to gather statistics. The list of formulas to use should be \
supplied on standard input, or using the -f or -F options.\v\
@ -264,55 +263,32 @@ end_error()
struct statistics
{
statistics()
: ok(false),
alternating(false),
status_str(nullptr),
status_code(0),
time(0),
states(0),
edges(0),
transitions(0),
acc(0),
scc(0),
nonacc_scc(0),
terminal_scc(0),
weak_scc(0),
strong_scc(0),
nondetstates(0),
nondeterministic(false),
terminal_aut(false),
weak_aut(false),
strong_aut(false)
{
}
// If OK is false, only the status_str, status_code, and time fields
// should be valid.
bool ok;
bool alternating;
const char* status_str;
int status_code;
double time;
unsigned states;
unsigned edges;
unsigned long long transitions;
unsigned acc;
unsigned scc;
unsigned nonacc_scc;
unsigned terminal_scc;
unsigned weak_scc;
unsigned strong_scc;
unsigned nondetstates;
bool nondeterministic;
bool terminal_aut;
bool weak_aut;
bool strong_aut;
bool ok = false;
bool alternating = false;
const char* status_str = nullptr;
int status_code = 0;
double time = 0.0;
unsigned states = 0;
unsigned edges = 0;
unsigned long long transitions = 0;
unsigned acc = 0;
unsigned scc = 0;
unsigned nonacc_scc = 0;
unsigned terminal_scc = 0;
unsigned weak_scc = 0;
unsigned strong_scc = 0;
unsigned nondetstates = 0;
bool nondeterministic = false;
bool terminal_aut = false;
bool weak_aut = false;
bool strong_aut = false;
std::vector<double> product_states;
std::vector<double> product_transitions;
std::vector<double> product_scc;
bool ambiguous;
bool complete;
bool ambiguous = false;
bool complete = false;
std::string hoa_str;
static void
@ -484,7 +460,7 @@ parse_opt(int key, char* arg, struct argp_state*)
break;
case ARGP_KEY_ARG:
if (arg[0] == '-' && !arg[1])
jobs.emplace_back(arg, true);
jobs.emplace_back(arg, job_type::LTL_FILENAME);
else
tools_push_trans(arg);
break;
@ -581,7 +557,7 @@ namespace
class xtranslator_runner final: public translator_runner
{
public:
xtranslator_runner(spot::bdd_dict_ptr dict)
explicit xtranslator_runner(spot::bdd_dict_ptr dict)
: translator_runner(dict)
{
}
@ -1095,17 +1071,14 @@ namespace
}
// Make sure we do not translate the same formula twice.
if (!allow_dups)
if (!allow_dups && !unique_set.insert(f).second)
{
if (!unique_set.insert(f).second)
{
if (!quiet)
std::cerr
<< ("warning: This formula or its negation has already"
" been checked.\n Use --allow-dups if it "
"should not be ignored.\n\n");
return 0;
}
if (!quiet)
std::cerr
<< ("warning: This formula or its negation has already"
" been checked.\n Use --allow-dups if it "
"should not be ignored.\n\n");
return 0;
}
int problems = 0;

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015-2020 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -47,7 +46,7 @@
#include <spot/twaalgos/totgba.hh>
#include <spot/parseaut/public.hh>
const char argp_program_doc[] ="\
static const char argp_program_doc[] = "\
Run LTL/PSL formulas through another program, performing conversion\n\
of input and output as required.";
@ -193,7 +192,7 @@ parse_opt(int key, char* arg, struct argp_state*)
break;
case ARGP_KEY_ARG:
if (arg[0] == '-' && !arg[1])
jobs.emplace_back(arg, true);
jobs.emplace_back(arg, job_type::LTL_FILENAME);
else
tools_push_trans(arg);
break;
@ -209,7 +208,7 @@ namespace
class xtranslator_runner final: public translator_runner
{
public:
xtranslator_runner(spot::bdd_dict_ptr dict)
explicit xtranslator_runner(spot::bdd_dict_ptr dict)
: translator_runner(dict, true)
{
}
@ -224,8 +223,6 @@ namespace
format(command, tools[translator_num].cmd);
std::string cmd = command.str();
//std::cerr << "Running [" << l << translator_num << "]: "
// << cmd << std::endl;
timer.start();
int es = exec_with_timeout(cmd.c_str());
timer.stop();
@ -312,7 +309,7 @@ namespace
spot::printable_value<std::string> inputf;
public:
processor(spot::postprocessor& post)
explicit processor(spot::postprocessor& post)
: runner(dict), best_printer(best_stream, best_format), post(post)
{
printer.add_stat('T', &cmdname);
@ -323,9 +320,7 @@ namespace
best_printer.declare('f', &inputf);
}
~processor()
{
}
~processor() override = default;
int
process_string(const std::string& input,
@ -364,8 +359,7 @@ namespace
const char* csv_prefix, const char* csv_suffix)
{
static long int output_count = 0;
++output_count;
printer.print(aut, ptimer, f, filename, loc, nullptr,
printer.print(aut, ptimer, f, filename, loc, output_count++, nullptr,
csv_prefix, csv_suffix);
if (opt_max_count >= 0 && output_count >= opt_max_count)
abort_run = true;
@ -424,8 +418,8 @@ namespace
aut = post.run(aut, f);
if (best_type)
{
best_printer.print(nullptr, aut, f, filename, linenum, timer,
prefix, suffix);
best_printer.print(nullptr, aut, f, filename, linenum, 0,
timer, prefix, suffix);
std::string aut_stats = best_stream.str();
if (!best_aut ||
(strverscmp(best_stats.c_str(), aut_stats.c_str())

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2021 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -32,12 +31,15 @@
#include "common_output.hh"
#include "common_cout.hh"
#include "common_conv.hh"
#include "common_ioap.hh"
#include "common_r.hh"
#include "common_range.hh"
#include <spot/misc/hash.hh>
#include <spot/misc/timer.hh>
#include <spot/tl/simplify.hh>
#include <spot/tl/sonf.hh>
#include <spot/tl/delta2.hh>
#include <spot/tl/length.hh>
#include <spot/tl/relabel.hh>
#include <spot/tl/unabbrev.hh>
@ -58,7 +60,7 @@
#include <spot/twaalgos/totgba.hh>
#include <spot/twaalgos/word.hh>
const char argp_program_doc[] ="\
static const char argp_program_doc[] = "\
Read a list of formulas and output them back after some optional processing.\v\
Exit status:\n\
0 if some formulas were output (skipped syntax errors do not count)\n\
@ -74,6 +76,8 @@ enum {
OPT_BSIZE_MAX,
OPT_BSIZE_MIN,
OPT_DEFINE,
OPT_DELTA1,
OPT_DELTA2,
OPT_DROP_ERRORS,
OPT_EQUIVALENT_TO,
OPT_EXCLUSIVE_AP,
@ -83,23 +87,30 @@ enum {
OPT_IGNORE_ERRORS,
OPT_IMPLIED_BY,
OPT_IMPLY,
OPT_INS,
OPT_LIVENESS,
OPT_LTL,
OPT_NEGATE,
OPT_NNF,
OPT_OBLIGATION,
OPT_PERSISTENCE,
OPT_PI2,
OPT_RECURRENCE,
OPT_REJECT_WORD,
OPT_RELABEL,
OPT_RELABEL_BOOL,
OPT_RELABEL_OVERLAP,
OPT_REMOVE_WM,
OPT_REMOVE_X,
OPT_SAFETY,
OPT_SAVE_PART_FILE,
OPT_SIGMA2,
OPT_SIZE,
OPT_SIZE_MAX,
OPT_SIZE_MIN,
OPT_SKIP_ERRORS,
OPT_SONF,
OPT_SONF_APS,
OPT_STUTTER_INSENSITIVE,
OPT_SUSPENDABLE,
OPT_SYNTACTIC_GUARANTEE,
@ -108,6 +119,9 @@ enum {
OPT_SYNTACTIC_RECURRENCE,
OPT_SYNTACTIC_SAFETY,
OPT_SYNTACTIC_SI,
OPT_TO_DELTA2,
OPT_OUTS,
OPT_PART_FILE,
OPT_UNABBREVIATE,
OPT_UNIVERSAL,
};
@ -127,12 +141,21 @@ static const argp_option options[] =
{ "negate", OPT_NEGATE, nullptr, 0, "negate each formula", 0 },
{ "nnf", OPT_NNF, nullptr, 0,
"rewrite formulas in negative normal form", 0 },
{ "relabel", OPT_RELABEL, "abc|pnn", OPTION_ARG_OPTIONAL,
{ "sonf", OPT_SONF, "PREFIX", OPTION_ARG_OPTIONAL,
"rewrite formulas in suffix operator normal form", 0 },
{ "sonf-aps", OPT_SONF_APS, "FILENAME", OPTION_ARG_OPTIONAL,
"when used with --sonf, output the newly introduced atomic "
"propositions", 0 },
{ "relabel", OPT_RELABEL, "abc|pnn|io", OPTION_ARG_OPTIONAL,
"relabel all atomic propositions, alphabetically unless " \
"specified otherwise", 0 },
{ "relabel-bool", OPT_RELABEL_BOOL, "abc|pnn", OPTION_ARG_OPTIONAL,
"relabel Boolean subexpressions, alphabetically unless " \
"specified otherwise", 0 },
"relabel Boolean subexpressions that do not share atomic propositions,"
" relabel alphabetically unless specified otherwise", 0 },
{ "relabel-overlapping-bool", OPT_RELABEL_OVERLAP, "abc|pnn",
OPTION_ARG_OPTIONAL,
"relabel Boolean subexpressions even if they share atomic propositions,"
" relabel alphabetically unless specified otherwise", 0 },
{ "define", OPT_DEFINE, "FILENAME", OPTION_ARG_OPTIONAL,
"when used with --relabel or --relabel-bool, output the relabeling map "
"using #define statements", 0 },
@ -145,6 +168,8 @@ static const argp_option options[] =
{ "remove-x", OPT_REMOVE_X, nullptr, 0,
"remove X operators (valid only for stutter-insensitive properties)",
0 },
{ "to-delta2", OPT_TO_DELTA2, nullptr, 0,
"rewrite LTL formula in Δ₂-form", 0 },
{ "unabbreviate", OPT_UNABBREVIATE, "STR", OPTION_ARG_OPTIONAL,
"remove all occurrences of the operators specified by STR, which "
"must be a substring of \"eFGiMRW^\", where 'e', 'i', and '^' stand "
@ -158,6 +183,20 @@ static const argp_option options[] =
{ "from-ltlf", OPT_FROM_LTLF, "alive", OPTION_ARG_OPTIONAL,
"transform LTLf (finite LTL) to LTL by introducing some 'alive'"
" proposition", 0 },
{ "ins", OPT_INS, "PROPS", 0,
"comma-separated list of input atomic propositions to use with "
"--relabel=io or --save-part-file, interpreted as a regex if enclosed "
"in slashes", 0 },
{ "outs", OPT_OUTS, "PROPS", 0,
"comma-separated list of output atomic propositions to use with "
"--relabel=io or --save-part-file, interpreted as a regex if "
"enclosed in slashes", 0 },
{ "part-file", OPT_PART_FILE, "FILENAME", 0,
"file containing the partition of atomic propositions to use with "
"--relabel=io", 0 },
{ "save-part-file", OPT_SAVE_PART_FILE, "FILENAME", OPTION_ARG_OPTIONAL,
"file containing the partition of atomic propositions, "
"readable by --part-file", 0 },
DECLARE_OPT_R,
LEVEL_DOC(4),
/**************************************************/
@ -172,15 +211,22 @@ static const argp_option options[] =
{ "suspendable", OPT_SUSPENDABLE, nullptr, 0,
"synonym for --universal --eventual", 0 },
{ "syntactic-safety", OPT_SYNTACTIC_SAFETY, nullptr, 0,
"match syntactic-safety formulas", 0 },
"match syntactic-safety (a.k.a. Π₁) formulas", 0 },
{ "pi1", 0, nullptr, OPTION_ALIAS, nullptr, 0 },
{ "syntactic-guarantee", OPT_SYNTACTIC_GUARANTEE, nullptr, 0,
"match syntactic-guarantee formulas", 0 },
"match syntactic-guarantee (a.k.a. Σ₁) formulas", 0 },
{ "sigma1", 0, nullptr, OPTION_ALIAS, nullptr, 0 },
{ "syntactic-obligation", OPT_SYNTACTIC_OBLIGATION, nullptr, 0,
"match syntactic-obligation formulas", 0 },
{ "delta1", OPT_DELTA1, nullptr, 0,
"match Δ₁ formulas", 0 },
{ "syntactic-recurrence", OPT_SYNTACTIC_RECURRENCE, nullptr, 0,
"match syntactic-recurrence formulas", 0 },
{ "pi2", OPT_PI2, nullptr, 0, "match Π₂ formulas", 0 },
{ "syntactic-persistence", OPT_SYNTACTIC_PERSISTENCE, nullptr, 0,
"match syntactic-persistence formulas", 0 },
{ "sigma2", OPT_SIGMA2, nullptr, 0, "match Σ₂ formulas", 0 },
{ "delta2", OPT_DELTA2, nullptr, 0, "match Δ₂ formulas", 0 },
{ "syntactic-stutter-invariant", OPT_SYNTACTIC_SI, nullptr, 0,
"match stutter-invariant formulas syntactically (LTL-X or siPSL)", 0 },
{ "nox", 0, nullptr, OPTION_ALIAS, nullptr, 0 },
@ -246,6 +292,8 @@ static const argp_option options[] =
"the formula (in the selected syntax)", 0 },
{ "%F", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the name of the input file", 0 },
{ "%l", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the serial number of the output formula", 0 },
{ "%L", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the original line number in the input file", 0 },
{ "%r", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
@ -298,6 +346,10 @@ static bool syntactic_guarantee = false;
static bool syntactic_obligation = false;
static bool syntactic_recurrence = false;
static bool syntactic_persistence = false;
static bool delta1 = false;
static bool delta2 = false;
static bool sigma2 = false;
static bool pi2 = false;
static bool syntactic_si = false;
static bool safety = false;
static bool guarantee = false;
@ -306,7 +358,11 @@ static bool recurrence = false;
static bool persistence = false;
static range size = { -1, -1 };
static range bsize = { -1, -1 };
enum relabeling_mode { NoRelabeling = 0, ApRelabeling, BseRelabeling };
enum relabeling_mode { NoRelabeling = 0,
ApRelabeling,
IOApRelabeling,
BseRelabeling,
OverlappingRelabeling };
static relabeling_mode relabeling = NoRelabeling;
static spot::relabeling_style style = spot::Abc;
static bool remove_x = false;
@ -316,7 +372,8 @@ static range opt_nth = { 0, std::numeric_limits<int>::max() };
static int opt_max_count = -1;
static long int match_count = 0;
static const char* from_ltlf = nullptr;
static const char* sonf = nullptr;
static bool to_delta2 = false;
// We want all these variables to be destroyed when we exit main, to
// make sure it happens before all other global variables (like the
@ -326,7 +383,9 @@ static struct opt_t
{
spot::bdd_dict_ptr dict = spot::make_bdd_dict();
spot::exclusive_ap excl_ap;
std::unique_ptr<output_file> output_part = nullptr;
std::unique_ptr<output_file> output_define = nullptr;
std::unique_ptr<output_file> output_sonf = nullptr;
spot::formula implied_by = nullptr;
spot::formula imply = nullptr;
spot::formula equivalent_to = nullptr;
@ -346,6 +405,22 @@ parse_formula_arg(const std::string& input)
return pf.f;
}
static void
parse_relabeling_style(const char* arg, const char* optname)
{
if (!arg || !strncasecmp(arg, "abc", 6))
style = spot::Abc;
else if (!strncasecmp(arg, "pnn", 4))
style = spot::Pnn;
else if (!*optname && !strncasecmp(arg, "io", 2))
relabeling = IOApRelabeling; // style is actually not supported
else
error(2, 0, "invalid argument for --relabel%s: '%s'\n"
"expecting %s", optname, arg,
*optname ? "'abc' or 'pnn'" : "'abc', 'pnn', or 'io'");
}
static int
parse_opt(int key, char* arg, struct argp_state*)
{
@ -377,7 +452,7 @@ parse_opt(int key, char* arg, struct argp_state*)
break;
case ARGP_KEY_ARG:
// FIXME: use stat() to distinguish filename from string?
jobs.emplace_back(arg, true);
jobs.emplace_back(arg, job_type::LTL_FILENAME);
break;
case OPT_ACCEPT_WORD:
try
@ -409,6 +484,12 @@ parse_opt(int key, char* arg, struct argp_state*)
case OPT_DEFINE:
opt->output_define.reset(new output_file(arg ? arg : "-"));
break;
case OPT_DELTA1:
delta1 = true;
break;
case OPT_DELTA2:
delta2 = true;
break;
case OPT_DROP_ERRORS:
error_style = drop_errors;
break;
@ -445,6 +526,10 @@ parse_opt(int key, char* arg, struct argp_state*)
opt->imply = spot::formula::And({opt->imply, i});
break;
}
case OPT_INS:
all_input_aps.emplace();
split_aps(arg, *all_input_aps);
break;
case OPT_LIVENESS:
liveness = true;
break;
@ -460,9 +545,25 @@ parse_opt(int key, char* arg, struct argp_state*)
case OPT_NNF:
nnf = true;
break;
case OPT_OUTS:
all_output_aps.emplace();
split_aps(arg, *all_output_aps);
break;
case OPT_PART_FILE:
read_part_file(arg);
break;
case OPT_SONF:
sonf = arg ? arg : "sonf_";
break;
case OPT_SONF_APS:
opt->output_sonf.reset(new output_file(arg ? arg : "-"));
break;
case OPT_OBLIGATION:
obligation = true;
break;
case OPT_PI2:
pi2 = true;
break;
case OPT_PERSISTENCE:
persistence = true;
break;
@ -482,16 +583,16 @@ parse_opt(int key, char* arg, struct argp_state*)
}
break;
case OPT_RELABEL:
relabeling = ApRelabeling;
parse_relabeling_style(arg, "");
break;
case OPT_RELABEL_BOOL:
relabeling = (key == OPT_RELABEL_BOOL ? BseRelabeling : ApRelabeling);
if (!arg || !strncasecmp(arg, "abc", 6))
style = spot::Abc;
else if (!strncasecmp(arg, "pnn", 4))
style = spot::Pnn;
else
error(2, 0, "invalid argument for --relabel%s: '%s'",
(key == OPT_RELABEL_BOOL ? "-bool" : ""),
arg);
relabeling = BseRelabeling;
parse_relabeling_style(arg, "-bool");
break;
case OPT_RELABEL_OVERLAP:
relabeling = OverlappingRelabeling;
parse_relabeling_style(arg, "-overlapping-bool");
break;
case OPT_REMOVE_WM:
unabbreviate += "MW";
@ -502,6 +603,9 @@ parse_opt(int key, char* arg, struct argp_state*)
case OPT_SAFETY:
safety = obligation = true;
break;
case OPT_SAVE_PART_FILE:
opt->output_part.reset(new output_file(arg ? arg : "-"));
break;
case OPT_SIZE:
size = parse_range(arg, 0, std::numeric_limits<int>::max());
break;
@ -517,6 +621,9 @@ parse_opt(int key, char* arg, struct argp_state*)
case OPT_STUTTER_INSENSITIVE:
stutter_insensitive = true;
break;
case OPT_TO_DELTA2:
to_delta2 = true;
break;
case OPT_UNABBREVIATE:
if (arg)
unabbreviate += arg;
@ -526,6 +633,9 @@ parse_opt(int key, char* arg, struct argp_state*)
case OPT_AP_N:
ap_n = parse_range(arg, 0, std::numeric_limits<int>::max());
break;
case OPT_SIGMA2:
sigma2 = true;
break;
case OPT_SUSPENDABLE:
universal = true;
eventual = true;
@ -570,7 +680,7 @@ namespace
fset_t unique_set;
spot::relabeling_map relmap;
ltl_processor(spot::tl_simplifier& simpl)
explicit ltl_processor(spot::tl_simplifier& simpl)
: simpl(simpl)
{
}
@ -650,6 +760,28 @@ namespace
if (nnf)
f = simpl.negative_normal_form(f);
if (sonf != nullptr)
{
std::vector<std::string> new_aps;
std::tie(f, new_aps) = suffix_operator_normal_form(f, sonf);
if (opt->output_sonf
&& output_format != count_output
&& output_format != quiet_output)
{
for (size_t i = 0; i < new_aps.size(); ++i)
{
if (i > 0)
opt->output_sonf->ostream() << ' ';
opt->output_sonf->ostream() << new_aps[i];
}
opt->output_sonf->ostream() << '\n';
}
}
if (to_delta2)
f = spot::to_delta2(f);
switch (relabeling)
{
case ApRelabeling:
@ -658,12 +790,24 @@ namespace
f = spot::relabel(f, style, &relmap);
break;
}
case IOApRelabeling:
{
relmap.clear();
f = relabel_io(f, relmap, filename, linenum);
break;
}
case BseRelabeling:
{
relmap.clear();
f = spot::relabel_bse(f, style, &relmap);
break;
}
case OverlappingRelabeling:
{
relmap.clear();
f = spot::relabel_overlapping_bse(f, style, &relmap);
break;
}
case NoRelabeling:
break;
}
@ -682,12 +826,16 @@ namespace
matched &= !syntactic_safety || f.is_syntactic_safety();
matched &= !syntactic_guarantee || f.is_syntactic_guarantee();
matched &= !syntactic_obligation || f.is_syntactic_obligation();
matched &= !delta1 || f.is_delta1();
matched &= !syntactic_recurrence || f.is_syntactic_recurrence();
matched &= !pi2 || f.is_pi2();
matched &= !syntactic_persistence || f.is_syntactic_persistence();
matched &= !sigma2 || f.is_sigma2();
matched &= !delta2 || f.is_delta2();
matched &= !syntactic_si || f.is_syntactic_stutter_invariant();
if (matched && (ap_n.min > 0 || ap_n.max >= 0))
{
auto s = atomic_prop_collect(f);
spot::atomic_prop_set* s = atomic_prop_collect(f);
int n = s->size();
delete s;
matched &= (ap_n.min <= 0) || (n >= ap_n.min);
@ -726,7 +874,7 @@ namespace
aut = ltl_to_tgba_fm(f, simpl.get_dict(), true);
if (matched && !opt->acc_words.empty())
for (auto& word_aut: opt->acc_words)
for (const spot::twa_graph_ptr& word_aut: opt->acc_words)
if (spot::product(aut, word_aut)->is_empty())
{
matched = false;
@ -734,7 +882,7 @@ namespace
}
if (matched && !opt->rej_words.empty())
for (auto& word_aut: opt->rej_words)
for (const spot::twa_graph_ptr& word_aut: opt->rej_words)
if (!spot::product(aut, word_aut)->is_empty())
{
matched = false;
@ -780,7 +928,7 @@ namespace
{
spot::scc_info si(min);
matched &= !guarantee
|| is_terminal_automaton(min, &si, true);
|| is_terminal_automaton(min, &si);
matched &= !safety || is_safety_automaton(min, &si);
}
}
@ -808,16 +956,51 @@ namespace
{
// Sort the formulas alphabetically.
std::map<std::string, spot::formula> m;
for (auto& p: relmap)
m.emplace(str_psl(p.first), p.second);
for (auto& p: m)
for (const auto& [newformula, oldname]: relmap)
m.emplace(str_psl(newformula), oldname);
for (const auto& [newname, oldname]: m)
stream_formula(opt->output_define->ostream()
<< "#define " << p.first << " (",
p.second, filename,
<< "#define " << newname << " (",
oldname, filename,
std::to_string(linenum).c_str()) << ")\n";
}
if (opt->output_part
&& output_format != count_output
&& output_format != quiet_output)
{
std::vector<spot::formula> ins;
std::vector<spot::formula> outs;
spot::atomic_prop_set* s = atomic_prop_collect(f);
for (spot::formula ap: *s)
{
spot::formula apo = ap;
if (auto it = relmap.find(ap); it != relmap.end())
apo = it->second;
if (is_output(apo.ap_name(), filename, linenum))
outs.push_back(ap);
else
ins.push_back(ap);
}
delete s;
auto& os = opt->output_part->ostream();
if (!ins.empty())
{
os << ".inputs";
for (const auto& ap: ins)
os << ' ' << str_psl(ap);
os << '\n';
}
if (!outs.empty())
{
os << ".outputs";
for (const auto& ap: outs)
os << ' ' << str_psl(ap);
os << '\n';
}
}
one_match = true;
output_formula_checked(f, &timer, filename, linenum, prefix, suffix);
output_formula_checked(f, &timer, filename, linenum,
match_count, prefix, suffix);
++match_count;
}
return 0;
@ -841,7 +1024,10 @@ main(int argc, char** argv)
exit(err);
if (jobs.empty())
jobs.emplace_back("-", 1);
jobs.emplace_back("-", job_type::LTL_FILENAME);
if (relabeling == IOApRelabeling || opt->output_part)
process_io_options();
if (boolean_to_isop && simplification_level == 0)
simplification_level = 1;

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2014, 2015, 2016, 2017, 2018, 2019 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -87,6 +86,8 @@ static const argp_option options[] = {
"the formula (in the selected syntax)", 0 },
{ "%F", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the name of the input file", 0 },
{ "%l", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the serial number of the output formula (0-based)", 0 },
{ "%L", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the original line number in the input file", 0 },
{ "%<", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
@ -112,6 +113,8 @@ static const argp_child children[] = {
namespace
{
static unsigned output_count = 0;
class mutate_processor final: public job_processor
{
public:
@ -122,7 +125,8 @@ namespace
auto mutations =
spot::mutate(f, mut_opts, max_output, mutation_nb, opt_sort);
for (auto g: mutations)
output_formula_checked(g, nullptr, filename, linenum, prefix, suffix);
output_formula_checked(g, nullptr, filename, linenum,
output_count++, prefix, suffix);
return 0;
}
};
@ -143,7 +147,7 @@ parse_opt(int key, char* arg, struct argp_state*)
break;
case ARGP_KEY_ARG:
// FIXME: use stat() to distinguish filename from string?
jobs.emplace_back(arg, true);
jobs.emplace_back(arg, job_type::LTL_FILENAME);
break;
case OPT_AP2CONST:
opt_all = 0;
@ -195,7 +199,7 @@ main(int argc, char* argv[])
mut_opts |= opt_all;
check_no_formula();
check_no_formula("mutate");
mutate_processor processor;
if (processor.run())

389
bin/ltlmix.cc Normal file
View file

@ -0,0 +1,389 @@
// -*- coding: utf-8 -*-
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
// Spot is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// Spot is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "common_sys.hh"
#include <argp.h>
#include "error.h"
#include "common_setup.hh"
#include "common_finput.hh"
#include "common_output.hh"
#include "common_ioap.hh"
#include "common_conv.hh"
#include "common_cout.hh"
#include "common_range.hh"
#include <spot/tl/defaultenv.hh>
#include <spot/tl/randomltl.hh>
#include <spot/misc/random.hh>
enum {
OPT_BOOLEAN_PRIORITIES = 256,
OPT_DUMP_PRIORITIES,
OPT_DUPS,
OPT_INS,
OPT_LTL_PRIORITIES,
OPT_OUTS,
OPT_PART_FILE,
OPT_SEED,
OPT_TREE_SIZE,
};
static const char * argp_program_doc =
"Combine formulas taken randomly from an input set.\n\n\
The input set is specified using FILENAME, -F FILENAME, or -f formula.\n\
By default this generates a Boolean pattern of size 5, for instance\n\
\"(φ₁ & φ₂) | φ₃\", where each φᵢ is randomly taken from the input set.\n\
The size and nature of the pattern can be changed using generation\n\
parameters. Additionally, it is possible to rename the atomic propositions\n\
in each φ using -A or -P.\v\
Example:\n\
\n\
Generates 10 random Boolean combinations of terms of the form GFa, with\n\
'a' picked from a set of 5 atomic propositions:\n\
% ltlmix -f GFa -n10 -A5\n\
\n\
Build a single LTL formula over subformulas taken randomly from the list of\n\
55 patterns by Dwyer et al., using a choice of 10 atomic propositions to\n\
relabel subformulas:\n\
% genltl --dac | ltlmix -L -A10\n\
\n\
Build 5 random positive Boolean combination of GFa and GFb:\n"
// next line is in its own double-quote to please sanity.test
" % ltlmix -f GFa -f GFb --boolean-prio=not=0,xor=0,implies=0,equiv=0 -n5";
static const argp_option options[] = {
// Keep this alphabetically sorted (expect for aliases).
/**************************************************/
{ nullptr, 0, nullptr, 0, "Generation parameters:", 2 },
{ "allow-dups", OPT_DUPS, nullptr, 0,
"allow duplicate formulas to be output", 0 },
{ "ap-count", 'A', "N[,M]", 0,
"rename the atomic propositions in each selected formula by drawing "
"randomly from N atomic propositions (the rewriting is bijective "
"if N is larger than the original set). If M is specified, two sets "
"of atomic propositions are used to represent inputs and outputs, and "
"options --ins/--outs can be used to classify the original propositions.",
0 },
{ "boolean", 'B', nullptr, 0,
"generate Boolean combinations of formulas (default)", 0 },
{ "formulas", 'n', "INT", 0,
"number of formulas to generate (default: 1);\n"
"use a negative value for unbounded generation", 0 },
{ "ltl", 'L', nullptr, 0, "generate LTL combinations of subformulas", 0 },
{ "polarized-ap", 'P', "N[,M]", 0,
"similar to -A, but randomize the polarity of the new atomic "
"propositions", 0 },
{ "random-conjuncts", 'C', "N", 0,
"generate random-conjunctions of N conjuncts; "
"shorthand for --tree-size {2N-1} -B "
"--boolean-priorities=[disable everything but 'and']", 0 },
{ "seed", OPT_SEED, "INT", 0,
"seed for the random number generator (default: 0)", 0 },
{ "tree-size", OPT_TREE_SIZE, "RANGE", 0,
"tree size of main pattern generated (default: 5);\n"
"input formulas count as size 1.", 0 },
{ "ins", OPT_INS, "PROPS", 0,
"comma-separated list of atomic propositions to consider as input, "
"interpreted as a regex if enclosed in slashes", 0 },
{ "outs", OPT_OUTS, "PROPS", 0,
"comma-separated list of atomic propositions to consider as output, "
"interpreted as a regex if enclosed in slashes", 0 },
{ "part-file", OPT_PART_FILE, "FILENAME", 0,
"read the I/O partition of atomic propositions from FILENAME", 0 },
RANGE_DOC,
/**************************************************/
{ nullptr, 0, nullptr, 0, "Adjusting probabilities:", 4 },
{ "dump-priorities", OPT_DUMP_PRIORITIES, nullptr, 0,
"show current priorities, do not generate any formula", 0 },
{ "ltl-priorities", OPT_LTL_PRIORITIES, "STRING", 0,
"set priorities for LTL formulas", 0 },
{ "boolean-priorities", OPT_BOOLEAN_PRIORITIES, "STRING", 0,
"set priorities for Boolean formulas", 0 },
{ nullptr, 0, nullptr, 0, "STRING should be a comma-separated list of "
"assignments, assigning integer priorities to the tokens "
"listed by --dump-priorities.", 0 },
/**************************************************/
{ nullptr, 0, nullptr, 0, "Output options:", -20 },
{ nullptr, 0, nullptr, 0, "The FORMAT string passed to --format may use "
"the following interpreted sequences:", -19 },
{ "%f", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the formula (in the selected syntax)", 0 },
{ "%l", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the (serial) number of the formula (0-based)", 0 },
{ "%L", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the (serial) number of the formula (1-based)", 0 },
{ "%%", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"a single %", 0 },
COMMON_LTL_OUTPUT_SPECS,
/**************************************************/
{ nullptr, 0, nullptr, 0, "Miscellaneous options:", -1 },
{ nullptr, 0, nullptr, 0, nullptr, 0 }
};
static const argp_child children[] = {
{ &finput_argp, 0, nullptr, 0 },
{ &output_argp, 0, nullptr, 0 },
{ &misc_argp, 0, nullptr, 0 },
{ nullptr, 0, nullptr, 0 }
};
static int opt_formulas = 1;
static spot::randltlgenerator::output_type output =
spot::randltlgenerator::Bool;
static char* opt_pL = nullptr;
static char* opt_pB = nullptr;
static char random_conj[] = "not=0,implies=0,equiv=0,xor=0,or=0";
static bool opt_dump_priorities = false;
static int opt_seed = 0;
static range opt_tree_size = { 5, 5 };
static bool opt_unique = true;
static int opt_ap_count = 0;
static int opt_out_ap_count = 0;
static bool opt_literal = false;
static bool opt_io = false;
namespace
{
// We want all these variables to be destroyed when we exit main, to
// make sure it happens before all other global variables (like the
// atomic propositions maps) are destroyed. Otherwise we risk
// accessing deleted stuff.
static struct opt_t
{
spot::atomic_prop_set sub;
}* opt = nullptr;
class sub_processor final: public job_processor
{
public:
int
process_formula(spot::formula f, const char* filename = nullptr,
int linenum = 0) override
{
if (opt_io)
// Filter the atomic propositions of each formula in order to
// report those that are not classifiable. Throw the result
// of that filtering away, as we only care about the potential
// diagnostics.
(void) filter_list_of_aps(f, filename, linenum);
opt->sub.insert(f);
return 0;
}
};
}
static sub_processor subreader;
std::pair<int, int> to_int_pair(const char* arg, const char* opt)
{
const char* comma = strchr(arg, ',');
if (!comma)
{
int res = to_int(arg, opt);
return {res, 0};
}
else
{
std::string arg1(arg, comma);
int res1 = to_int(arg1.c_str(), opt);
int res2 = to_int(comma + 1, opt);
return {res1, res2};
}
}
static int
parse_opt(int key, char* arg, struct argp_state*)
{
// Called from C code, so should not raise any exception.
BEGIN_EXCEPTION_PROTECT;
switch (key)
{
case 'A':
std::tie(opt_ap_count, opt_out_ap_count) =
to_int_pair(arg, "-A/--ap-count");
opt_literal = false;
break;
case 'B':
output = spot::randltlgenerator::Bool;
break;
case 'C':
{
int s = 2 * to_int(arg, "-C/--random-conjuncs") - 1;
opt_tree_size = {s, s};
output = spot::randltlgenerator::Bool;
opt_pB = random_conj;
break;
}
case 'L':
output = spot::randltlgenerator::LTL;
break;
case 'n':
opt_formulas = to_int(arg, "-n/--formulas");
break;
case 'P':
std::tie(opt_ap_count, opt_out_ap_count) =
to_int_pair(arg, "-P/--polarized-ap");
opt_literal = true;
break;
case OPT_BOOLEAN_PRIORITIES:
opt_pB = arg;
break;
case OPT_LTL_PRIORITIES:
opt_pL = arg;
break;
case OPT_DUMP_PRIORITIES:
opt_dump_priorities = true;
break;
case OPT_DUPS:
opt_unique = false;
break;
case OPT_INS:
all_input_aps.emplace();
split_aps(arg, *all_input_aps);
opt_io = true;
break;
case OPT_OUTS:
all_output_aps.emplace();
split_aps(arg, *all_output_aps);
opt_io = true;
break;
case OPT_PART_FILE:
read_part_file(arg);
opt_io = true;
break;
case OPT_SEED:
opt_seed = to_int(arg, "--seed");
break;
case OPT_TREE_SIZE:
opt_tree_size = parse_range(arg);
if (opt_tree_size.min > opt_tree_size.max)
std::swap(opt_tree_size.min, opt_tree_size.max);
break;
case ARGP_KEY_ARG:
jobs.emplace_back(arg, job_type::LTL_FILENAME);
break;
default:
return ARGP_ERR_UNKNOWN;
}
END_EXCEPTION_PROTECT;
return 0;
}
int
main(int argc, char* argv[])
{
return protected_main(argv, [&] {
const argp ap = { options, parse_opt, "[FILENAME[/COL]...]",
argp_program_doc, children, nullptr, nullptr };
// This will ensure that all objects stored in this struct are
// destroyed before global variables.
opt_t o;
opt = &o;
if (int err = argp_parse(&ap, argc, argv, ARGP_NO_HELP, nullptr, nullptr))
exit(err);
check_no_formula("combine");
if (opt_io && !opt_out_ap_count)
error(2, 0,
"options --ins, --outs, --part-file only make sense when the "
"two-argument version of '-A N,M' or '-P N,M' is used.");
if (opt_out_ap_count > 0)
// Do not require --ins/--outs to be used, as the input
// pattern may use atomic propositions starting with i/o
// already. Setting opt_io will cause the subreader to
// complain about unclassifible atomic propositions.
opt_io = true;
if (opt_io)
process_io_options();
if (subreader.run())
return 2;
if (opt->sub.empty())
error(2, 0, "the set of subformulas to build from is empty");
spot::srand(opt_seed);
std::function<bool(spot::formula)> output_p = nullptr;
if (opt_out_ap_count)
output_p = [&](spot::formula f) { return is_output(f.ap_name()); };
spot::randltlgenerator rg
(opt_ap_count,
[&] (){
spot::option_map opts;
opts.set("output", output);
opts.set("out_ap_size", opt_out_ap_count);
opts.set("tree_size_min", opt_tree_size.min);
opts.set("tree_size_max", opt_tree_size.max);
opts.set("seed", opt_seed);
opts.set("simplification_level", 0);
opts.set("unique", opt_unique);
opts.set("literals", opt_literal);
return opts;
}(), opt_pL, nullptr, opt_pB, &opt->sub, output_p);
if (opt_dump_priorities)
{
switch (output)
{
case spot::randltlgenerator::LTL:
std::cout <<
"Use --ltl-priorities to set the following LTL priorities:\n";
rg.dump_ltl_priorities(std::cout);
break;
case spot::randltlgenerator::Bool:
std::cout <<
"Use --boolean-priorities to set the following Boolean "
"formula priorities:\n";
rg.dump_bool_priorities(std::cout);
break;
case spot::randltlgenerator::PSL:
case spot::randltlgenerator::SERE:
error(2, 0, "PSL/SERE output is unsupported");
break;
}
exit(0);
}
int count = 0;
while (opt_formulas < 0 || opt_formulas--)
{
spot::formula f = rg.next();
if (!f)
{
error(2, 0, "failed to generate a new unique formula after %d " \
"trials", spot::randltlgenerator::MAX_TRIALS);
}
else
{
output_formula_checked(f, nullptr, nullptr, count + 1, count);
++count;
}
};
flush_cout();
return 0;
});
}

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,5 @@
## -*- coding: utf-8 -*-
## Copyright (C) 2012-2017 Laboratoire de Recherche et Développement
## de l'Epita (LRDE).
## Copyright (C) by the Spot authors, see the AUTHORS file for details.
##
## This file is part of Spot, a model checking library.
##
@ -36,6 +35,7 @@ dist_man1_MANS = \
ltldo.1 \
ltlfilt.1 \
ltlgrind.1 \
ltlmix.1 \
ltlsynt.1 \
randaut.1 \
randltl.1
@ -73,6 +73,9 @@ ltlfilt.1: $(common_dep) $(srcdir)/ltlfilt.x $(srcdir)/../ltlfilt.cc
ltlgrind.1: $(common_dep) $(srcdir)/ltlgrind.x $(srcdir)/../ltlgrind.cc
$(convman) ../ltlgrind$(EXEEXT) $(srcdir)/ltlgrind.x $@
ltlmix.1: $(common_dep) $(srcdir)/ltlmix.x $(srcdir)/../ltlmix.cc
$(convman) ../ltlmix$(EXEEXT) $(srcdir)/ltlmix.x $@
ltlsynt.1: $(common_dep) $(srcdir)/ltlsynt.x $(srcdir)/../ltlsynt.cc
$(convman) ../ltlsynt$(EXEEXT) $(srcdir)/ltlsynt.x $@

View file

@ -59,29 +59,29 @@ Information about how the execution of the tool went.
values:
.RS
.TP
\f(CW"ok"\fR
\fC"ok"\fR
The tool ran succesfully (this does not imply that the produced
automaton is correct) and autcross could parse the resulting
automaton. In this case \fBexit_code\fR is always 0.
.TP
\f(CW"timeout"\fR
\fC"timeout"\fR
The tool ran for more than the number of seconds
specified with the \fB\-\-timeout\fR option. In this
case \fBexit_code\fR is always -1.
.TP
\f(CW"exit code"\fR
\fC"exit code"\fR
The tool terminated with a non-zero exit code.
\fBexit_code\fR contains that value.
.TP
\f(CW"signal"\fR
\fC"signal"\fR
The tool terminated with a signal.
\fBexit_code\fR contains that signal's number.
.TP
\f(CW"parse error"\fR
\fC"parse error"\fR
The tool terminated normally, but autcross could not
parse its output. In this case \fBexit_code\fR is always -1.
.TP
\f(CW"no output"\fR
\fC"no output"\fR
The tool terminated normally, but without creating the specified
output file. In this case \fBexit_code\fR is always -1.
.RE

View file

@ -70,7 +70,7 @@ Documents the output format of
.TP
2.
Chistof Löding: Mehods for the Transformation of ω-Automata:
Christof Löding: Mehods for the Transformation of ω-Automata:
Complexity and Connection to Second Order Logic. Diploma Thesis.
University of Kiel. 1998.

View file

@ -29,13 +29,17 @@ gh
J. Geldenhuys and H. Hansen: Larger automata and less
work for LTL model checking. Proceedings of Spin'06. LNCS 3925.
.TP
go
P. Gastin and D. Oddoux: Fast LTL to Büchi Automata Translation.
Proceedings of CAV'01. LNCS 2102.
.TP
hkrss
J. Holeček, T. Kratochvila, V. Řehák, D. Šafránek, and P. Šimeček:
Verification Results in Liberouter Project. Tech. Report 03, CESNET, 2004.
.TP
go
P. Gastin and D. Oddoux: Fast LTL to Büchi Automata Translation.
Proceedings of CAV'01. LNCS 2102.
jb, lily
B. Jobstmann, and R. Bloem:
Optimizations for LTL Synthesis. Proceedings of FMCAD'06. IEEE.
.TP
kr
O. Kupferman and A. Rosenberg: The Blow-Up in Translating LTL to Deterministic
@ -80,3 +84,4 @@ Proceedings of RV'10. LNCS 6418.
.BR ltlfilt (1),
.BR randaut (1),
.BR randltl (1)
.BR ltlmix (1)

View file

@ -13,7 +13,7 @@ condition, meanings that a run of the automaton is accepted iff it
visits ininitely often multiple acceptance sets, and it also uses
transition-based acceptance, i.e., those acceptance sets are sets of
transitions. TGBA are often more consise than traditional Büchi
automata. For instance the LTL formula \f(CWGFa & GFb\fR can be
automata. For instance the LTL formula \fCGFa & GFb\fR can be
translated into a single-state TGBA while a traditional Büchi
automaton would need 3 states. Compare
.PP
@ -158,11 +158,11 @@ are not recognized, i.e., infinite words that start with a bad prefix.
.PP
Because of this limited expressiveness, a monitor for some given LTL
or PSL formula may accept a larger language than the one specified by
the formula. For instance a monitor for the LTL formula \f(CWa U b\fR
will reject (for instance) any word starting with \f(CW!a&!b\fR as
the formula. For instance a monitor for the LTL formula \fCa U b\fR
will reject (for instance) any word starting with \fC!a&!b\fR as
there is no way such a word can validate the formula, but it will not
reject a finite prefix repeating only \f(CWa&!b\fR as such a prefix
could be extented in a way that is comptible with \f(CWa U b\fR.
reject a finite prefix repeating only \fCa&!b\fR as such a prefix
could be extented in a way that is comptible with \fCa U b\fR.
.PP
For more information about monitors, we refer the readers to the
following two papers (the first paper describes the construction of

View file

@ -12,7 +12,7 @@ for 100 random formulas, using a timeout of 2 minutes. Because
knows those tools, there is no need to specify their input and
output. A trace of the execution of the two tools, including any
potential issue detected, is reported on standard error, while
statistics are written to \f(CWresults.json\fR.
statistics are written to \fCresults.json\fR.
.PP
.in +4n
.nf
@ -26,14 +26,14 @@ The next command compares
.BR ltl3ba ,
and
.BR ltl2tgba (1)
on a set of formulas saved in file \f(CWinput.ltl\fR.
on a set of formulas saved in file \fCinput.ltl\fR.
Statistics are again writen
as CSV into \f(CWresults.csv\fR. This examples specify the
as CSV into \fCresults.csv\fR. This examples specify the
input and output for each tool, to show how this can be done.
Note the use of \f(CW%L\fR to indicate that the formula passed t
Note the use of \fC%L\fR to indicate that the formula passed t
for the formula in
.BR spin (1)'s
format, and \f(CW%f\fR for the
format, and \fC%f\fR for the
formula in Spot's format. Each of these tool produces an
automaton in a different format (respectively, LBTT's format,
Spin's never claims, and HOA format), but Spot's parser can
@ -51,7 +51,7 @@ distinguish and understand these three formats.
Rabin or Streett automata output by
.B ltl2dstar
in its historical format can be read from a
file specified with \f(CW%D\fR instead of \f(CW%O\fR. For instance:
file specified with \fC%D\fR instead of \fC%O\fR. For instance:
.PP
.in +4n
.nf
@ -99,7 +99,7 @@ The formula translated.
\fBtool\fR
The tool used to translate this formula. This is either the value of the
full \fICOMMANDFMT\fR string specified on the command-line, or,
if \fICOMMANDFMT\fR has the form \f(CW{\fISHORTNAME\fR\f(CW}\fR\fICMD\fR,
if \fICOMMANDFMT\fR has the form \fC{\fISHORTNAME\fR\fC}\fR\fICMD\fR,
the value of \fISHORTNAME\fR.
.TP
\fBexit_status\fR, \fBexit_code\fR
@ -110,29 +110,29 @@ Otherwise, \fBexit_status\fR is a string that can take the following
values:
.RS
.TP
\f(CW"ok"\fR
\fC"ok"\fR
The translator ran succesfully (this does not imply that the produced
automaton is correct) and ltlcross could parse the resulting
automaton. In this case \fBexit_code\fR is always 0.
.TP
\f(CW"timeout"\fR
\fC"timeout"\fR
The translator ran for more than the number of seconds
specified with the \fB\-\-timeout\fR option. In this
case \fBexit_code\fR is always -1.
.TP
\f(CW"exit code"\fR
\fC"exit code"\fR
The translator terminated with a non-zero exit code.
\fBexit_code\fR contains that value.
.TP
\f(CW"signal"\fR
\fC"signal"\fR
The translator terminated with a signal.
\fBexit_code\fR contains that signal's number.
.TP
\f(CW"parse error"\fR
\fC"parse error"\fR
The translator terminated normally, but ltlcross could not
parse its output. In this case \fBexit_code\fR is always -1.
.TP
\f(CW"no output"\fR
\fC"no output"\fR
The translator terminated normally, but without creating the specified
output file. In this case \fBexit_code\fR is always -1.
.RE
@ -150,7 +150,7 @@ translated automaton. Column \fBedges\fR counts the number of edges
(labeled by Boolean formulas) in the automaton seen as a graph, while
\fBtransitions\fR counts the number of assignment-labeled transitions
that might have been merged into a formula-labeled edge. For instance
an edge labeled by \f(CWtrue\fR will be counted as 2^3=8 transitions if
an edge labeled by \fCtrue\fR will be counted as 2^3=8 transitions if
the automaton uses 3 atomic propositions.
.TP
\fBscc\fR, \fBnonacc_scc\fR, \fBterminal_scc\fR, \fBweak_scc\fR, \fBstrong_scc\fR

7
bin/man/ltlmix.x Normal file
View file

@ -0,0 +1,7 @@
[NAME]
ltlmix \- combine formulas selected randomly
[DESCRIPTION]
.\" Add any additional description here
[SEE ALSO]
.BR randltl (1),
.BR genltl (1)

View file

@ -4,8 +4,15 @@ ltlsynt \- reactive synthesis from LTL specifications
[BIBLIOGRAPHY]
If you would like to give a reference to this tool in an article,
we suggest you cite the following paper:
we suggest you cite the following papers:
.TP
\(bu
Thibaud Michaud, Maximilien Colange: Reactive Synthesis from LTL
Specification with Spot. Proceedings of SYNT@CAV'18.
Florian Renkin, Philipp Schlehuber-Caissier, Alexandre Duret-Lutz,
and Adrien Pommellet.
Dissecting ltlsynt. In Formal Methods in System Design, 2023.
.TP
\(bu
Thibaud Michaud and Maximilien Colange.
Reactive Synthesis from LTL Specification with Spot.
In proceedings of SYNT@CAV'18.

View file

@ -14,3 +14,4 @@ Proceedings of ATVA'13. LNCS 8172.
.BR genltl (1),
.BR ltlfilt (1),
.BR randaut (1)
.BR ltlmix (1)

View file

@ -10,7 +10,7 @@ spot-x \- Common fine-tuning options and environment variables.
.\" Add any additional description here
[SAT\-MINIMIZE VALUES]
When the sat-minimize=K option is used to enable SAT-based
When the \fBsat-minimize=K\fR option is used to enable SAT-based
minimization of deterministic automata, a SAT solver is
used to minimize an input automaton with N states into an
output automaton with 1≤M≤N states. The parameter K specifies
@ -19,7 +19,7 @@ how the smallest possible M should be searched.
.TP
\fB1\fR
The default, \fB1\fR, performs a binary search between 1 and N. The
lower bound can sometimes be improved when the \fBsat-langmap\fR
lower bound can sometimes be improved when the \fBsat\-langmap\fR
option is used.
.TP
@ -50,6 +50,15 @@ time. Note that it restarts all the encoding each time.
If this variable is set to any value, statistics about BDD garbage
collection and resizing will be output on standard error.
.TP
\fBSPOT_CONTAINMENT_CHECK\fR
Specifies which inclusion algorithm Spot should use. If the variable
is unset, or set to \fB"default"\fR, containment checks are done
using a complementation-based procedure. If the variable is set to
\fB"forq"\fR, then the FORQ-based containment check is used for Büchi automata
(the default procedure is still used for non-Büchi automata). See
[6] in the bibliography below.
.TP
\fBSPOT_DEFAULT_FORMAT\fR
Set to a value of \fBdot\fR or \fBhoa\fR to override the default
@ -63,12 +72,12 @@ passed to the printer by suffixing the output format with
.in +4n
.EX
% SPOT_DEFAULT_FORMAT=dot=bar autfilt ...
.EN
.EE
.in -4n
is the same as running
.in +4n
.EX
% autfilt --dot=bar ...
% autfilt \-\-dot=bar ...
.EE
.in -4n
but the use of the environment variable makes more sense if you set
@ -81,13 +90,13 @@ executed in debug mode, showing how the input is processed.
.TP
\fBSPOT_DOTDEFAULT\fR
Whenever the \f(CW--dot\fR option is used without argument (even
Whenever the \fB\-\-dot\fR option is used without argument (even
implicitely via \fBSPOT_DEFAULT_FORMAT\fR), the contents of this
variable is used as default argument. If you have some default
variable are used as default argument. If you have some default
settings in \fBSPOT_DOTDEFAULT\fR and want to append to options
\f(CWxyz\fR temporarily for one call, use \f(CW--dot=.xyz\fR:
\fCxyz\fR temporarily for one call, use \fB\-\-dot=.xyz\fR:
the dot character will be replaced by the contents of the
\f(CWSPOT_DOTDEFAULT\fR environment variable.
\fBSPOT_DOTDEFAULT\fR environment variable.
.TP
\fBSPOT_DOTEXTRA\fR
@ -95,6 +104,14 @@ The contents of this variable is added to any dot output, immediately
before the first state is output. This makes it easy to override
global attributes of the graph.
.TP
\fBSPOT_EXCLUSIVE_WORD\fR
Specifies which algorithm spot should use for exclusive_word. This can
currently take on 1 of 2 values: 0 for the legacy implementation, and 1
for the forq implementation [6] (See bibliography below). Forq assumes buchi
automata in order to find an exclusive word, and will default to the legacy
version if these constraints are not satisfied with the automata passed.
.TP
\fBSPOT_HOA_TOLERANT\fR
If this variable is set, a few sanity checks performed by the HOA
@ -106,7 +123,7 @@ is actually used)
.TP
\fBSPOT_O_CHECK\fR
Specifies the default algorithm that should be used
by the \f(CWis_obligation()\fR function. The value should
by the \fCis_obligation()\fR function. The value should
be one of the following:
.RS
.RS
@ -124,24 +141,24 @@ by a weak and deterministic Büchi automata.
.TP
\fBSPOT_OOM_ABORT\fR
If this variable is set, Out-Of-Memory errors will \f(CWabort()\fR the
If this variable is set, Out-Of-Memory errors will \fCabort()\fR the
program (potentially generating a coredump) instead of raising an
exception. This is useful to debug a program and to obtain a stack
trace pointing to the function doing the allocation. When this
variable is unset (the default), \f(CWstd::bad_alloc\fR are thrown on
variable is unset (the default), \fCstd::bad_alloc\fR are thrown on
memory allocation failures, and the stack is usually unwinded up to
top-level, losing the original context of the error. Note that at
least \f(CWltlcross\fR has some custom handling of
\f(CWstd::bad_alloc\fR to recover from products that are too large (by
least \fCltlcross\fR has some custom handling of
\fCstd::bad_alloc\fR to recover from products that are too large (by
ignoring them), and setting this variable will interfer with that.
.TP
\fBSPOT_PR_CHECK\fR
Select the default algorithm that must be used to check the persistence
or recurrence property of a formula f. The values it can take are between
1 and 3. All methods work either on f or !f thanks to the duality of
1 and 3. All methods work either on f or !f thanks to the duality of
persistence and recurrence classes. See
.UR https://spot.lrde.epita.fr/hierarchy.html
.UR https://spot.lre.epita.fr/hierarchy.html
this page
.UE
for more details. If it is set to:
@ -179,8 +196,8 @@ format.
If set, this variable should indicate how to call an external
SAT\-solver \- by default, Spot uses PicoSAT, which is distributed
with. This is used by the sat\-minimize option described above.
The format to follow is the following: \f(CW"<sat_solver> [options] %I >%O"\fR.
The escape sequences \f(CW%I\fR and \f(CW%O\fR respectively
The format to follow is the following: \fC"<sat_solver> [options] %I >%O"\fR.
The escape sequences \fC%I\fR and \fC%O\fR respectively
denote the names of the input and output files. These temporary files
are created in the directory specified by \fBSPOT_TMPDIR\fR or
\fBTMPDIR\fR (see below). The SAT\-solver should follow the convention
@ -235,10 +252,11 @@ sl(a) x sl(!a), performed on-the-fly
.IP 8
cl(a) x cl(!a)
.RE
This variable is used by the \fB\-\-check=stutter-invariance\fR and
\fB\-\-stutter-invariant\fR options, but it is ignored by
\fB\-\-check=stutter-sensitive-example\fR.
.RE
This variable is used by the \fB--check=stutter-invariance\fR and
\fB--stutter-invariant\fR options, but it is ignored by
\fB--check=stutter-sensitive-example\fR.
.TP
\fBSPOT_SIMULATION_REDUCTION\fR
@ -263,7 +281,7 @@ This is mostly useful for debugging.
.TP
\fBSPOT_XCNF\fR
Assign a folder path to this variable to generate XCNF files whenever
SAT\-based minimization is used \- the file is outputed as "incr.xcnf"
SAT\-based minimization is used \- the file is output as "incr.xcnf"
in the specified directory. This feature works only with an external
SAT\-solver. See \fBSPOT_SATSOLVER\fR to know how to provide one. Also note
that this needs an incremental approach without restarting the encoding i.e
@ -272,6 +290,9 @@ autfilt (see sat\-minimize options described above or autfilt man page).
The XCNF format is the one used by the SAT incremental competition.
[BIBLIOGRAPHY]
The following papers are related to some of the options and
environment variables.
.TP
1.
Christian Dax, Jochen Eisinger, Felix Klaedtke: Mechanizing the
@ -311,12 +332,20 @@ Describes the stutter-invariance checks that can be selected through
5.
Javier Esparza, Jan Křetínský and Salomon Sickert: One Theorem to Rule
Them All: A Unified Translation of LTL into ω-Automata. Proceedings
of LICS'18. To appear.
of LICS'18.
Describes (among other things) the constructions used for translating
formulas of the form GF(guarantee) or FG(safety), that can be
disabled with \fB-x gf-guarantee=0\fR.
.TP
6.
Kyveli Doveri and Pierre Ganty and Nicolas Mazzocchi:
FORQ-Based Language Inclusion Formal Testing.
Proceedings of CAV'22. LNCS 13372.
The containment check implemented as \fCspot::contains_forq()\fR, and
used for Büchi automata when \fBSPOT_CONTAINMENT_CHECK=forq\fR.
[SEE ALSO]
.BR ltl2tgba (1)

View file

@ -22,11 +22,12 @@ that are listed below.
.BR ltldo (1)
.BR ltlfilt (1)
.BR ltlgrind (1)
.BR ltlmix (1)
.BR ltlsynt (1)
.BR randaut (1)
.BR randltl (1)
.BR spot-x (7)
.UR https://spot.lrde.epita.fr/
.UR https://spot.lre.epita.fr/
The Spot web page.
.UE

View file

@ -1,7 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
# Copyright (C) by the Spot authors, see the AUTHORS file for details.
#
# This file is part of Spot, a model checking library.
#
@ -30,10 +29,10 @@ import subprocess
with open('Makefile.am', 'r') as mf:
lines = mf.read()
lines = re.sub('\s*\\\\\s*', ' ', lines)
bin_programs = re.search('bin_PROGRAMS\s*=([\w \t]*)', lines).group(1).split()
lines = re.sub(r'\s*\\\s*', ' ', lines)
bin_programs = re.search(r'bin_PROGRAMS\s*=([\w \t]*)', lines).group(1).split()
optre = re.compile('(-\w), (--[\w=-]+)')
optre = re.compile(r'(-\w), (--[\w=-]+)')
d = {}

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2016, 2018-2020 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -42,7 +41,7 @@
#include <spot/twaalgos/canonicalize.hh>
const char argp_program_doc[] = "\
static const char argp_program_doc[] = "\
Generate random connected automata.\n\n\
The automata are built over the atomic propositions named by PROPS...\n\
or, if N is a nonnegative number, using N arbitrary names.\n\
@ -385,6 +384,8 @@ main(int argc, char** argv)
if (opt_acceptance)
aut->set_acceptance(accs, code);
if (aut->acc().is_t() || aut->acc().is_f())
aut->prop_weak(true);
if (opt_uniq)
{
@ -406,7 +407,8 @@ main(int argc, char** argv)
timer.stop();
printer.print(aut, timer, nullptr,
opt_seed_str, automaton_num, nullptr);
opt_seed_str, automaton_num,
automaton_num, nullptr);
++automaton_num;
if (opt_automata > 0 && automaton_num >= opt_automata)

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012-2016, 2018-2019 Laboratoire de Recherche
// et Développement de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -40,7 +39,7 @@
#include <spot/misc/random.hh>
#include <spot/misc/optionmap.hh>
const char argp_program_doc[] ="\
static const char argp_program_doc[] = "\
Generate random temporal logic formulas.\n\n\
The formulas are built over the atomic propositions named by PROPS...\n\
or, if N is a nonnegative number, using N arbitrary names.\v\
@ -65,7 +64,6 @@ enum {
OPT_DUMP_PRIORITIES,
OPT_DUPS,
OPT_LTL_PRIORITIES,
OPT_PSL_PRIORITIES,
OPT_SEED,
OPT_SERE_PRIORITIES,
OPT_TREE_SIZE,
@ -116,8 +114,10 @@ static const argp_option options[] =
"the following interpreted sequences:", -19 },
{ "%f", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the formula (in the selected syntax)", 0 },
{ "%l", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the (serial) number of the formula (0-based)", 0 },
{ "%L", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"the (serial) number of the formula", 0 },
"the (serial) number of the formula (1-based)", 0 },
{ "%%", 0, nullptr, OPTION_DOC | OPTION_NO_USAGE,
"a single %", 0 },
COMMON_LTL_OUTPUT_SPECS,
@ -181,6 +181,7 @@ parse_opt(int key, char* arg, struct argp_state* as)
break;
case 'S':
output = spot::randltlgenerator::SERE;
output_ratexp = true;
break;
case OPT_BOOLEAN_PRIORITIES:
opt_pB = arg;
@ -194,7 +195,6 @@ parse_opt(int key, char* arg, struct argp_state* as)
case OPT_DUMP_PRIORITIES:
opt_dump_priorities = true;
break;
// case OPT_PSL_PRIORITIES: break;
case OPT_SERE_PRIORITIES:
opt_pS = arg;
break;
@ -307,9 +307,9 @@ main(int argc, char** argv)
exit(0);
}
int count = 0;
while (opt_formulas < 0 || opt_formulas--)
{
static int count = 0;
spot::formula f = rg.next();
if (!f)
{
@ -318,7 +318,8 @@ main(int argc, char** argv)
}
else
{
output_formula_checked(f, nullptr, nullptr, ++count);
output_formula_checked(f, nullptr, nullptr, count + 1, count);
++count;
}
};
flush_cout();

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013-2021 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -24,7 +23,7 @@
#include <argp.h>
#include "common_setup.hh"
const char argp_program_doc[] ="\
static const char argp_program_doc[] = "\
Common fine-tuning options for programs installed with Spot.\n\
\n\
The argument of -x or --extra-options is a comma-separated list of KEY=INT \
@ -47,9 +46,17 @@ depends on the --low, --medium, or --high settings.") },
{ DOC("tls-max-states",
"Maximum number of states of automata involved in automata-based \
implication checks for formula simplifications. Defaults to 64.") },
{ DOC("tls-max-ops",
"Maximum number of operands in n-ary operators (or, and) on which \
implication-based simplifications are attempted. Defaults to 16.") },
{ nullptr, 0, nullptr, 0, "Translation options:", 0 },
{ DOC("ltl-split", "Set to 0 to disable the translation of automata \
as product or sum of subformulas.") },
{ DOC("branch-post", "Set to 0 to disable branching-postponement \
(done during translation, may create more states) and delayed-branching \
(almost similar, but done after translation to only remove states). \
Set to 1 to force branching-postponement, and to 2 \
to force delayed-branching. By default, delayed-branching is used.") },
{ DOC("comp-susp", "Set to 1 to enable compositional suspension, \
as described in our SPIN'13 paper (see Bibliography below). Set to 2, \
to build only the skeleton TGBA without composing it. Set to 0 (the \
@ -75,13 +82,16 @@ only if it is smaller than the original skeleton. This option is only \
used when comp-susp=1 and default to 1 or 2 depending on whether --small \
or --deterministic is specified.") },
{ nullptr, 0, nullptr, 0, "Postprocessing options:", 0 },
{ DOC("acd", "Set to 1 (the default) to use paritize automata using \
the alternating cycle decomposition. Set to 0 to use paritization based \
on latest appearance record variants.") },
{ DOC("scc-filter", "Set to 1 (the default) to enable \
SCC-pruning and acceptance simplification at the beginning of \
post-processing. Transitions that are outside of accepting SCC are \
post-processing. Transitions that are outside accepting SCC are \
removed from accepting sets, except those that enter into an accepting \
SCC. Set to 2 to remove even these entering transition from the \
accepting sets. Set to 0 to disable this SCC-pruning and acceptance \
simpification pass.") },
simplification pass.") },
{ DOC("degen-reset", "If non-zero (the default), the \
degeneralization algorithm will reset its level any time it exits \
an SCC.") },
@ -96,7 +106,7 @@ uses the first level created, 2 uses the minimum level seen so far, and \
will compute an independent degeneralization order for each SCC it \
processes. This is currently disabled by default.") },
{ DOC("degen-lskip", "If non-zero (the default), the degeneralization \
algorithm will skip as much levels as possible for each transition. This \
algorithm will skip as many levels as possible for each transition. This \
is enabled by default as it very often reduce the number of resulting \
states. A consequence of skipping levels is that the degeneralized \
automaton tends to have smaller cycles around the accepting states. \
@ -111,7 +121,7 @@ level, as it might favor finding accepting cycles earlier. If \
degen-lowinit is non-zero, then level L is always used without looking \
for the presence of an accepting self-loop.") },
{ DOC("degen-remscc", "If non-zero (the default), make sure the output \
of the degenalization has as many SCCs as the input, by removing superfluous \
of the degeneralization has as many SCCs as the input, by removing superfluous \
ones.") },
{ DOC("det-max-states", "When defined to a positive integer N, \
determinizations will be aborted whenever the number of generated \
@ -164,25 +174,44 @@ Set to 1 to use only direct simulation. Set to 2 to use only reverse \
simulation. Set to 3 to iterate both direct and reverse simulations. \
The default is the value of parameter \"simul\" in --high mode, and 0 \
therwise.") },
{ DOC("merge-states-min", "Number of states above which states are \
merged using a cheap approximation of a bisimulation quotient before \
attempting simulation-based reductions. Defaults to 128. Set to 0 to \
never merge states.") },
{ DOC("simul-max", "Number of states above which simulation-based \
reductions are skipped. Defaults to 4096. Set to 0 to disable. This \
applies to all simulation-based optimization, including thoses of the \
applies to all simulation-based optimization, including those of the \
determinization algorithm.") },
{ DOC("simul-trans-pruning", "Number of equivalence classes above which \
simulation-based transition-pruning for non-deterministic automata is disabled \
automata. Defaults to 512. Set to 0 to disable. This applies to all \
simulation-based reduction, as well as to the simulation-based optimization of \
the determinization algorithm. Simulation-based reduction perform a number of \
BDD implication checks that is quadratic in the number of classes to implement \
transition pruning. The equivalence classes is equal to the number \
of output states of simulation-based reduction when transition-pruning is \
disabled, it is just an upper bound otherwise.") },
simulation-based transition-pruning for non-deterministic automata is \
disabled. Defaults to 512. Set to 0 to disable. This applies to all \
simulation-based reductions, as well as to the simulation-based optimization \
of the determinization algorithm. Simulation-based reductions perform a \
number of BDD implication checks that is quadratic in the number of classes to \
implement transition pruning. The number of equivalence classes is equal to \
the number of output states of the simulation-based reduction when \
transition-pruning is disabled, it is just an upper bound otherwise.") },
{ DOC("relabel-bool", "If set to a positive integer N, a formula \
with N atomic propositions or more will have its Boolean subformulas \
abstracted as atomic propositions during the translation to automaton. \
This relabeling can speeds the translation if a few Boolean subformulas \
use a large number of atomic propositions. By default N=4. Setting \
use many atomic propositions. This relabeling make sure \
the subexpressions that are replaced do not share atomic propositions. \
By default N=4. Setting this value to 0 will disable the rewriting.") },
{ DOC("relabel-overlap", "If set to a positive integer N, a formula \
with N atomic propositions or more will have its Boolean subformulas \
abstracted as atomic propositions during the translation to automaton. \
This version does not care about overlapping atomic propositions, so \
it can cause the created temporary automata to have incompatible \
combinations of atomic propositions that will be eventually be removed. \
This relabeling is attempted after relabel-bool. By default, N=8. Setting \
this value to 0 will disable the rewriting.") },
{ DOC("rde", "Disable (0), or enable (1) the 'restrict-dead-end-edges' \
optimization. A dead-end-edge is one that move to a state that has only \
itself as successors. The label of such edges can be simplified in some \
situtation, reducing non-determinism slightly. By default (-1), this is \
enabled only in --high mode, or if both --medium and --deterministic are \
used.") },
{ DOC("wdba-minimize", "Set to 0 to disable WDBA-minimization, to 1 to \
always try it, or 2 to attempt it only on syntactic obligations or on automata \
that are weak and deterministic. The default is 1 in --high mode, else 2 in \
@ -197,7 +226,7 @@ or when det-max-states is set.") },
if the TGBA is not already deterministic. Doing so will degeneralize \
the automaton. This is disabled by default, unless sat-minimize is set.") },
{ DOC("dba-simul", "Set to 1 to enable simulation-based reduction after \
running the powerset determinization enabled by \"tba-det\". By default this \
running the powerset determinization enabled by \"tba-det\". By default, this \
is disabled at low level or if parameter \"simul\" is set to 0.") },
{ DOC("sat-minimize",
"Set to a value between 1 and 4 to enable SAT-based minimization \
@ -232,11 +261,11 @@ sets sat-minimize to 1 if not set differently.") },
{ DOC("state-based",
"Set to 1 to instruct the SAT-minimization procedure to produce \
an automaton where all outgoing transition of a state have the same acceptance \
sets. By default this is only enabled when options -B or -S are used.") },
sets. By default, this is only enabled when options -B or -S are used.") },
{ DOC("simul-method",
"Chose which simulation based reduction to use: 1 force the \
signature-based BDD implementation, 2 force matrix-based and 0, the default, \
is a heristic wich choose which implementation to use.") },
is a heuristic which chooses which implementation to use.") },
{ nullptr, 0, nullptr, 0, nullptr, 0 }
};

View file

@ -1,6 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013-2018 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) by the Spot authors, see the AUTHORS file for details.
//
// This file is part of Spot, a model checking library.
//
@ -24,7 +23,8 @@
#include <argp.h>
#include "common_setup.hh"
const char argp_program_doc[] ="Command-line tools installed by Spot.";
static const char argp_program_doc[] =
"Command-line tools installed by Spot.";
#define DOC(NAME, TXT) NAME, 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, TXT, 0
@ -37,6 +37,8 @@ static const argp_option options[] =
{ DOC("ltlgrind", "Mutate LTL or PSL formulas to generate similar but "
"simpler ones. Use this when looking for shorter formula to "
"reproduce a bug.") },
{ DOC("ltlmix",
"Combine LTL/PSL formulas taken randomly from some input set.") },
{ nullptr, 0, nullptr, 0, "Tools that output automata or circuits:", 0 },
{ DOC("randaut", "Generate random ω-automata.") },
{ DOC("genaut", "Generate ω-automata from scalable patterns.") },

View file

@ -2300,7 +2300,7 @@ RETURN {* The quantified BDD. *}
*/
BDD bdd_forall(BDD r, BDD var)
{
return quantify(r, var, bddop_and, 0, CACHEID_EXIST);
return quantify(r, var, bddop_and, 0, CACHEID_FORALL);
}
/*
@ -2315,7 +2315,7 @@ RETURN {* The quantified BDD. *}
*/
BDD bdd_forallcomp(BDD r, BDD var)
{
return quantify(r, var, bddop_and, 1, CACHEID_EXISTC);
return quantify(r, var, bddop_and, 1, CACHEID_FORALLC);
}

View file

@ -1,5 +1,5 @@
/*========================================================================
Copyright (C) 1996-2003, 2021 by Jorn Lind-Nielsen
Copyright (C) 1996-2003 by Jorn Lind-Nielsen
All rights reserved
Permission is hereby granted, without written agreement and without
@ -501,6 +501,8 @@ BUDDY_API_VAR const BDD bddtrue;
*************************************************************************/
#ifdef CPLUSPLUS
#include <iostream>
#include <memory>
#include <type_traits>
/*=== User BDD class ===================================================*/
@ -1092,6 +1094,11 @@ inline bddxfalse bdd_false(void)
{ return bddxfalse(); }
template<>
struct std::default_delete<bddPair> {
void operator()(bddPair *p) const { bdd_freepair(p); };
};
/*=== Iostream printing ================================================*/
class BUDDY_API bdd_ioformat
@ -1128,7 +1135,18 @@ public:
class minterm_iterator
{
public:
minterm_iterator(minterms_of* me)
typedef bdd value_type;
typedef value_type& reference;
typedef value_type* pointer;
typedef std::ptrdiff_t difference_type;
typedef std::forward_iterator_tag iterator_category;
explicit minterm_iterator() noexcept
: me_(nullptr)
{
}
minterm_iterator(minterms_of* me) noexcept
: me_(me)
{
}

View file

@ -210,7 +210,6 @@ static BddTree *reorder_win2ite(BddTree *t)
{
BddTree *this, *first=t;
int lastsize;
int c=1;
if (t == NULL)
return t;
@ -246,7 +245,6 @@ static BddTree *reorder_win2ite(BddTree *t)
if (verbose > 1)
printf(" %d nodes\n", reorder_nodenum());
c++;
}
while (reorder_nodenum() != lastsize);

View file

@ -1,9 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2022, Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
# Copyright (C) 2003-2007 Laboratoire d'Informatique de Paris 6
# (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
# Pierre et Marie Curie.
# Copyright (C) by the Spot authors, see the AUTHORS file for details.
#
# This file is part of Spot, a model checking library.
#
@ -21,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ([2.69])
AC_INIT([spot], [2.10.4.dev], [spot@lrde.epita.fr])
AC_INIT([spot], [2.12.2.dev], [spot@lrde.epita.fr])
AC_CONFIG_AUX_DIR([tools])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 gnu tar-ustar color-tests parallel-tests])
@ -53,6 +49,15 @@ AC_ARG_ENABLE([c++20],
[Compile in C++20 mode.])],
[enable_20=$enableval], [enable_20=no])
AC_ARG_ENABLE([pthread],
[AS_HELP_STRING([--enable-pthread],
[Allow libspot to use POSIX threads.])],
[enable_pthread=$enableval], [enable_pthread=no])
if test "$enable_pthread" = yes; then
AC_DEFINE([ENABLE_PTHREAD], [1], [Whether Spot is compiled with -pthread.])
AC_SUBST([LIBSPOT_PTHREAD], [-pthread])
fi
AC_ARG_ENABLE([doxygen],
[AS_HELP_STRING([--enable-doxygen],
[enable generation of Doxygen documentation (requires Doxygen)])],
@ -70,6 +75,7 @@ if test 0 -eq `expr $enable_max_accsets % $default_max_accsets`
then
AC_DEFINE_UNQUOTED([MAX_ACCSETS], [$enable_max_accsets],
[The maximal number of acceptance sets supported (also known as acceptance marks)])
AC_SUBST([MAX_ACCSETS], [$enable_max_accsets])
else
AC_MSG_ERROR([The argument of --enable-max-accsets must be a multiple of $default_max_accsets])
fi
@ -150,7 +156,7 @@ AX_CHECK_BUDDY
AC_CHECK_FUNCS([times kill alarm sigaction sched_getcpu])
oLIBS=$LIBS
LIBS="$LIBS -lpthread"
LIBS="$LIBS -pthread"
AC_CHECK_FUNCS([pthread_setaffinity_np])
LIBS=$oLIBS
@ -179,9 +185,14 @@ if test "x${enable_python:-yes}" = xyes; then
AC_MSG_NOTICE([You may configure with --disable-python ]dnl
[if you do not need Python bindings.])
adl_CHECK_PYTHON
AC_ARG_WITH([pythondir],
[AS_HELP_STRING([--with-pythondir], [override the computed pythondir])],
[pythondir=$withval pyexecdir=$withval], [])
fi
adl_ENABLE_DEBUG
ad_GCC_OPTIM
adl_NDEBUG
@ -202,14 +213,14 @@ AC_CHECK_PROG([LTL3BA], [ltl3ba], [ltl3ba])
AC_CHECK_PROG([PERL], [perl], [perl])
AC_CHECK_PROG([SPIN], [spin], [spin])
AC_CHECK_PROG([LBTT], [lbtt], [lbtt])
AC_CHECK_PROG([EMACS], [emacs], [emacs])
AM_MISSING_PROG([EMACS], [emacs])
AC_CHECK_PROGS([IPYTHON], [ipython3 ipython], [ipython])
AC_CHECK_PROGS([JUPYTER], [jupyter], [jupyter])
AC_CHECK_PROG([LBTT_TRANSLATE], [lbtt-translate], [lbtt-translate])
AX_CHECK_VALGRIND
# Debian used to reserve the name 'swig' for swig-2.0. So prefer
# swig4.0 (available in Debian bullseye) to swig3.0 (available in Debian buster)
# ti swig.
# to swig.
AC_CHECK_PROGS([SWIG], [swig4.0 swig3.0 swig], [swig])
AC_SUBST([CROSS_COMPILING], [$cross_compiling])
@ -280,3 +291,23 @@ case $VERSION:$enable_devel in
echo '==================================================================='
;;
esac
case $enable_python in
yes)
pd=$pythondir
eval pd=$pd
eval pd=$pd
$PYTHON -c "
import sys
if '$pd' in sys.path:
exit()
else:
print('\nWARNING: Python bindings will be installed in $pd')
print(' however this path is not searched by default by $PYTHON.')
print('\n$PYTHON\'s sys.path contains the following paths:\n',
'\n'.join(sys.path))
print('\nUse --with-pythondir=... if you wish '
'to change this installation path.')
"
;;
esac

2
debian/control vendored
View file

@ -2,7 +2,7 @@ Source: spot
Section: science
Priority: optional
Maintainer: Alexandre Duret-Lutz <adl@lrde.epita.fr>
Build-Depends: debhelper (>= 12), python3-all-dev, ipython3-notebook | python3-ipykernel, ipython3-notebook | python3-nbconvert, libltdl-dev, dh-python
Build-Depends: debhelper (>= 12), python3-all-dev, python3-ipykernel, python3-nbconvert, libltdl-dev, dh-python, graphviz, jupyter-nbconvert, doxygen, gdb
Standards-Version: 4.5.1
Homepage: http://spot.lrde.epita.fr/

7
debian/copyright vendored
View file

@ -1,10 +1,9 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: spot
Source: http://spot.lrde.epita.fr/dload/spot/
Source: http://www.lrde.epita.fr/dload/spot/
Files: *
Copyright: 2003-2007 Laboratoire d'Informatique de Paris 6 (LIP6)
2007-2022 Laboratoire de Recherche et Développement de l'Epita (LRDE)
Copyright: 2003-2025 the Spot authors
License: GPL-3+
Spot is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
@ -161,7 +160,7 @@ License: GPL-3+
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
Files: debian/*
Copyright: 2015-2018 Laboratoire de Recherche et Développement de l'Epita (LRDE)
Copyright: 2015-2023 the Spot authors
License: GPL-3+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

22
debian/rules vendored
View file

@ -20,20 +20,16 @@ include /usr/share/dpkg/default.mk
%:
dh $@ --with=python3
# Find the LTO plugin, which we need to pass to ar, nm, and ranlib.
LTOPLUG := $(shell gcc -v 2>&1 | \
sed -n 's:COLLECT_LTO_WRAPPER=\(/.*/\)[^/]*:\1:p')liblto_plugin.so
# ARFLAGS is for Automake
# AR_FLAGS is for Libtool
# These activate the LTO pluggin, but also remove the 'u' option
# from ar, since its now ignored with Debian's default to 'D'.
LTOSETUP = \
LDFLAGS='-fuse-linker-plugin' \
NM='nm --plugin $(LTOPLUG)' \
ARFLAGS='cr --plugin $(LTOPLUG)' \
AR_FLAGS='cr --plugin $(LTOPLUG)' \
RANLIB='ranlib --plugin $(LTOPLUG)' \
# AR_FLAGS is for Libtool, (but libtool 2.4.7 will now use ARFLAGS as well)
# The gcc-tools activate the LTO plugin.
LTOSETUP = \
LDFLAGS='-fuse-linker-plugin' \
NM='gcc-nm' \
AR='gcc-ar' \
ARFLAGS='cr' \
AR_FLAGS='cr' \
RANLIB='gcc-ranlib' \
VALGRIND=false
GCDADIR := $(shell pwd)/gcda

View file

@ -1,9 +1,5 @@
## -*- coding: utf-8 -*-
## Copyright (C) 2010-2011, 2013-2021 Laboratoire de Recherche et
## Développement de l'Epita (LRDE).
## Copyright (C) 2003-2005 Laboratoire d'Informatique de Paris 6
## (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
## Pierre et Marie Curie.
## Copyright (C) by the Spot authors, see the AUTHORS file for details.
##
## This file is part of Spot, a model checking library.
##
@ -108,6 +104,7 @@ ORG_FILES = \
org/ltldo.org \
org/ltlfilt.org \
org/ltlgrind.org \
org/ltlmix.org \
org/ltlsynt.org \
org/ltlsynt.tex \
org/oaut.org \
@ -127,6 +124,7 @@ ORG_FILES = \
org/tut22.org \
org/tut23.org \
org/tut24.org \
org/tut25.org \
org/tut30.org \
org/tut31.org \
org/tut40.org \

View file

@ -27,6 +27,9 @@
(setenv "SPOT_DOTEXTRA" "node[fontsize=12] fontsize=12 stylesheet=\"spot.css\" edge[arrowhead=vee, arrowsize=.7, fontsize=12]")
(setq org-babel-temporary-directory "@abs_top_builddir@/doc/org/tmp")
(make-directory org-babel-temporary-directory t)
; has to be set globally, not buffer-local
(setq ess-ask-for-ess-directory nil)
(setq ess-startup-directory 'default-directory)
(org-babel-do-load-languages 'org-babel-load-languages
`((,(if (version< org-version "8.3") 'sh 'shell) . t)
(python . t)
@ -39,7 +42,6 @@
(org-babel-python-command . "@PYTHON@")
(org-babel-C++-compiler . "./g++wrap")
(shell-file-name . "@SHELL@")
(ess-ask-for-ess-directory . nil)
(org-export-html-postamble . nil)
(org-html-table-header-tags
"<th scope=\"%s\"%s><div><span>" . "</span></div></th>")

1
doc/org/.gitignore vendored
View file

@ -19,3 +19,4 @@ g++wrap
*.fls
sitemap.org
plantuml.jar
toba.py

View file

@ -22,18 +22,19 @@
usedby/.style={->,ultra thick,>={Stealth[length=5mm,round]},gray!50!black}}
\node[cppbox=14.12cm] (libspot) {\texttt{libspot\strut}};
\node[shbox=3cm,above right=2mm and 0mm of libspot.north west,align=center] (shcmd) {
\href{https://spot.lrde.epita.fr/randltl.html}{\texttt{randltl}}\\
\href{https://spot.lrde.epita.fr/ltlfilt.html}{\texttt{ltlfilt}}\\
\href{https://spot.lrde.epita.fr/randaut.html}{\texttt{randaut}}\\
\href{https://spot.lrde.epita.fr/autfilt.html}{\texttt{autfilt}}\\
\href{https://spot.lrde.epita.fr/ltl2tgba.html}{\texttt{ltl2tgba}}\\
\href{https://spot.lrde.epita.fr/ltl2tgta.html}{\texttt{ltl2tgta}}\\
\href{https://spot.lrde.epita.fr/dstar2tgba.html}{\texttt{dstar2tgba}}\\
\href{https://spot.lrde.epita.fr/ltlcross.html}{\texttt{ltlcross}}\\
\href{https://spot.lrde.epita.fr/ltlgrind.html}{\texttt{ltlgrind}}\\
\href{https://spot.lrde.epita.fr/ltlsynt.html}{\texttt{ltlsynt}}\\
\href{https://spot.lrde.epita.fr/ltldo.html}{\texttt{ltldo}}\\
\href{https://spot.lrde.epita.fr/autcross.html}{\texttt{autcross}}
\href{https://spot.lre.epita.fr/randltl.html}{\texttt{randltl}}\\
\href{https://spot.lre.epita.fr/ltlmix.html}{\texttt{ltlmix}}\\
\href{https://spot.lre.epita.fr/ltlfilt.html}{\texttt{ltlfilt}}\\
\href{https://spot.lre.epita.fr/randaut.html}{\texttt{randaut}}\\
\href{https://spot.lre.epita.fr/autfilt.html}{\texttt{autfilt}}\\
\href{https://spot.lre.epita.fr/ltl2tgba.html}{\texttt{ltl2tgba}}\\
\href{https://spot.lre.epita.fr/ltl2tgta.html}{\texttt{ltl2tgta}}\\
\href{https://spot.lre.epita.fr/dstar2tgba.html}{\texttt{dstar2tgba}}\\
\href{https://spot.lre.epita.fr/ltlcross.html}{\texttt{ltlcross}}\\
\href{https://spot.lre.epita.fr/ltlgrind.html}{\texttt{ltlgrind}}\\
\href{https://spot.lre.epita.fr/ltlsynt.html}{\texttt{ltlsynt}}\\
\href{https://spot.lre.epita.fr/ltldo.html}{\texttt{ltldo}}\\
\href{https://spot.lre.epita.fr/autcross.html}{\texttt{autcross}}
};
\node[cppbox=4.7cm,above right=0mm and 2mm of shcmd.south east] (libgen) {\texttt{libspotgen\strut}};
\node[cppbox=2.5cm,above right=0mm and 2mm of libgen.south east] (buddy) {\texttt{libbddx\strut}};
@ -41,8 +42,8 @@
\node[cppbox=4cm,above right=0mm and 2mm of pyspot.south east] (libltsmin) {\texttt{libspotltsmin\strut}};
\node[shbox=1.5cm,above right=2mm and 0mm of libgen.north west,align=center] (genaut) {
\href{https://www.lrde.epita.fr/genaut.html}{\texttt{genaut\strut}}\\
\href{https://www.lrde.epita.fr/genltl.html}{\texttt{genltl}}
\href{https://www.lre.epita.fr/genaut.html}{\texttt{genaut\strut}}\\
\href{https://www.lre.epita.fr/genltl.html}{\texttt{genltl}}
};
\node[pybox=3cm,above left=2mm and 0mm of libgen.north east] (pygen) {\texttt{import spot.gen\strut}};

View file

@ -16,7 +16,7 @@ The core of =autcross= is a loop that does the following steps:
will be named =A0=, =A1=, and =A2=.
- Ensure that all produced automata are equivalent.
Statistics about the results of each tools can optionally be saved in
Statistics about the results of each tool can optionally be saved in
a CSV file. And in case only those statistics matters, it is also
possible to disable the equivalence checks.
@ -46,7 +46,7 @@ following character sequences:
: %O filename for the automaton output in HOA, never
: claim, LBTT, or ltl2dstar's format
For instance we can use =autfilt --complement %H >%O= to indicate that
For instance, we can use =autfilt --complement %H >%O= to indicate that
=autfilt= reads one file (=%H=) in the HOA format, and to redirect the
output in file so that =autcross= can find it. The output format is
automatically detected, so a generic =%O= is used for the output file
@ -203,7 +203,7 @@ time) will appear with empty columns at the end of the CSV line.
Those lines with missing data can be omitted with the =--omit-missing=
option.
However data for bogus automata are still included: as shown below
However, data for bogus automata are still included: as shown below
=autcross= will report inconsistencies between automata as errors, but
it does not try to guess who is incorrect.
@ -249,11 +249,11 @@ EOF
| -:95.1-140.7 | automaton 2 | 2 | 10 | 26 | 26 | 1 | 2 | 6 | 1 | 0 | AF | ok | 0 | 0.0211636 | 2 | 21 | 66 | 84 | 2 | 4 | 0 | 0 | 0 |
| -:95.1-140.7 | automaton 2 | 2 | 10 | 26 | 26 | 1 | 2 | 6 | 1 | 0 | L2D | ok | 0 | 0.0028508 | 2 | 24 | 74 | 96 | 2 | 4 | 0 | 0 | 0 |
* Language preserving transformation
* Transformation that preserve or complement languages
By default =autcross= assumes that for a given input the automata
produced by all tools should be equivalent. However it does not
assume that those language should be equivalent to the input (it is
By default, =autcross= assumes that for a given input the automata
produced by all tools should be equivalent. However, it does not
assume that those languages should be equivalent to the input (it is
clearly not the case in our complementation test above).
If the transformation being tested does preserve the language of an
@ -261,6 +261,13 @@ automaton, it is worth to pass the =--language-preserved= option to
=autfilt=. Doing so a bit like adding =cat %H>%O= as another tool: it
will also ensure that the output is equivalent to the input.
Similarly, if the tools being tested implement complementation
algorithm, adding the =--language-complemented= will additionally
compare the outputs using this own complementation algorithm. Using
this option is more efficient than passing =autfilt --complement= as a
tool, since =autcross= can save on complementation by using the input
automaton.
* Detecting problems
:PROPERTIES:
:CUSTOM_ID: checks
@ -270,19 +277,19 @@ If a translator exits with a non-zero status code, or fails to output
an automaton =autcross= can read, and error will be displayed and the
result of the tool will be discarded.
Otherwise =autcross= performs equivalence checks between each pair of
Otherwise, =autcross= performs equivalence checks between each pair of
automata. This is done in two steps. First, all produced automata
=A0=, =A1=, etc. are complemented: the complement automata are
named =Comp(A0)=, =Comp(A1)= etc. Second, =autcross= ensures
that =Ai*Comp(Aj)= is empty for all =i= and =j=.
If the =--language-preserved= option is passed, the =input= automaton
also participate to these equivalence checks.
also participates to these equivalence checks.
To simulate a problem, let's compare pretend we want verify that
=autfilt --complement= preserves the input language (clearly it does
not, since it actually complement the language of the automaton).
To simulate a problem, let's pretend we want to verify that =autfilt
--complement= preserves the input language (clearly it does not, since
it actually complements the language of the automaton).
#+BEGIN_SRC sh :prologue "exec 2>&1" :epilogue true
randaut -B -n 3 a b --name="automaton %L" |
@ -327,15 +334,15 @@ examples would not exit if the language was really preserved by the
tool.
Incoherence between the output of several tools (even with
=--language-preserved=) are reported in a similar way.
=--language-preserved=) are reported similarly.
* Miscellaneous options
** =--stop-on-error=
The =--stop-on-error= option will cause =autcross= to abort on the
first detected error. This include failure to start some tool,
read its output, or failure to passe the sanity checks. Timeouts are
first detected error. This includes failure to start some tool,
read its output, or failure to pass the sanity checks. Timeouts are
allowed unless =--fail-on-timeout= is also given.
One use for this option is when =autcross= is used in combination with
@ -465,7 +472,7 @@ Performing sanity checks and gathering statistics...
No problem detected.
#+end_example
However in practice you could also use the =name:= field of the input
However, in practice you could also use the =name:= field of the input
automaton, combined with =%M= in the tool specification, to designate
an alternate filename to load, or some key to look up somewhere.

View file

@ -29,7 +29,7 @@ process them in batch. (The only restriction is that inside a file an
automaton in LBTT's format may not follow an automaton in
=ltl2dstar='s format.)
By default the output uses the HOA format. This can be changed using
By default, the output uses the HOA format. This can be changed using
[[file:oaut.org][the common output options]] like =--spin=, =--lbtt=, =--dot=,
=--stats=...
@ -128,27 +128,30 @@ autfilt --stats='%s states, %e edges, %a acc-sets, %c SCCs, det=%d'
The following =%= sequences are available:
#+BEGIN_SRC sh :exports results
ltl2tgba --help | sed -n '/ sequences:/,/^$/p' | sed '1d;$d'
autfilt --help | sed -n '/ for output):/,/^$/p' | sed '1d;$d'
#+END_SRC
#+RESULTS:
#+begin_example
%< the part of the line before the formula if it
comes from a column extracted from a CSV file
%> the part of the line after the formula if it comes
from a column extracted from a CSV file
%% a single %
%a number of acceptance sets
%c, %[LETTERS]c number of SCCs; you may filter the SCCs to count
%< the part of the line before the automaton if it
comes from a column extracted from a CSV file
%> the part of the line after the automaton if it
comes from a column extracted from a CSV file
%A, %a number of acceptance sets
%C, %c, %[LETTERS]C, %[LETTERS]c
number of SCCs; you may filter the SCCs to count
using the following LETTERS, possibly
concatenated: (a) accepting, (r) rejecting, (c)
complete, (v) trivial, (t) terminal, (w) weak,
(iw) inherently weak. Use uppercase letters to
negate them.
%d 1 if the output is deterministic, 0 otherwise
%e number of reachable edges
%f the formula, in Spot's syntax
%D, %d 1 if the automaton is deterministic, 0 otherwise
%E, %e, %[LETTER]E, %[LETTER]e number of edges (add one LETTER to select
(r) reachable [default], (u) unreachable, (a)
all).
%F name of the input file
%g, %[LETTERS]g acceptance condition (in HOA syntax); add brackets
%G, %g, %[LETTERS]G, %[LETTERS]g
acceptance condition (in HOA syntax); add brackets
to print an acceptance name instead and LETTERS to
tweak the format: (0) no parameters, (a)
accentuated, (b) abbreviated, (d) style used in
@ -157,28 +160,32 @@ ltl2tgba --help | sed -n '/ sequences:/,/^$/p' | sed '1d;$d'
parameter, (p) no parity parameter, (o) name
unknown acceptance as 'other', (s) shorthand for
'lo0'.
%h the automaton in HOA format on a single line (use
%[opt]h to specify additional options as in
--hoa=opt)
%H, %h the automaton in HOA format on a single line (use
%[opt]H or %[opt]h to specify additional options
as in --hoa=opt)
%L location in the input file
%m name of the automaton
%n number of nondeterministic states in output
%p 1 if the output is complete, 0 otherwise
%l serial number of the output automaton (0-based)
%M, %m name of the automaton
%N, %n number of nondeterministic states
%P, %p 1 if the automaton is complete, 0 otherwise
%r wall-clock time elapsed in seconds (excluding
parsing)
%R, %[LETTERS]R CPU time (excluding parsing), in seconds; Add
LETTERS to restrict to(u) user time, (s) system
LETTERS to restrict to (u) user time, (s) system
time, (p) parent process, or (c) children
processes.
%s number of reachable states
%t number of reachable transitions
%u, %[e]u number of states (or [e]dges) with universal
branching
%u, %[LETTER]u 1 if the automaton contains some universal
%S, %s, %[LETTER]S, %[LETTER]s number of states (add one LETTER to select
(r) reachable [default], (u) unreachable, (a)
all).
%T, %t, %[LETTER]T, %[LETTER]t number of transitions (add one LETTER to
select (r) reachable [default], (u) unreachable,
(a) all).
%U, %u, %[LETTER]U, %[LETTER]u 1 if the automaton contains some universal
branching (or a number of [s]tates or [e]dges with
universal branching)
%w one word accepted by the output automaton
%x, %[LETTERS]x number of atomic propositions declared in the
%W, %w one word accepted by the automaton
%X, %x, %[LETTERS]X, %[LETTERS]x
number of atomic propositions declared in the
automaton; add LETTERS to list atomic
propositions with (n) no quoting, (s) occasional
double-quotes with C-style escape, (d)
@ -189,7 +196,7 @@ ltl2tgba --help | sed -n '/ sequences:/,/^$/p' | sed '1d;$d'
#+end_example
When a letter is available both as uppercase and lowercase, the
uppercase version refer to the input automaton, while the lowercase
uppercase version refers to the input automaton, while the lowercase
refer to the output automaton. Of course this distinction makes sense
only if =autfilt= was instructed to perform an operation on the input
automaton.
@ -230,7 +237,7 @@ autfilt --help | sed -n '/Filtering options.*:/,/^$/p' | sed '1d;$d'
inherently-weak SCCs is in RANGE. An accepting
SCC is inherently weak if it does not have a
rejecting cycle.
--intersect=FILENAME keep automata whose languages have an non-empty
--intersect=FILENAME keep automata whose languages have a non-empty
intersection with the automaton from FILENAME
--is-alternating keep only automata using universal branching
--is-colored keep colored automata (i.e., exactly one
@ -342,7 +349,7 @@ autfilt --help | sed -n '/Simplification level:/,/^$/p' | sed '1d;$d'
By default, =--any --low= is used, which cause all simplifications to
be skipped. However if any goal is given, than the simplification level
be skipped. However, if any goal is given, then the simplification level
defaults to =--high= (unless specified otherwise). If a simplification
level is given without specifying any goal, then the goal default to =--small=.
@ -363,7 +370,7 @@ depending on the constraints on the acceptance conditions:
in the output, but it may not always succeed and may output
non-deterministic automata. Note that if =autfilt --deterministic
--tgba= fails to output a deterministic automaton, it does not
necessarily implies that a deterministic TGBA does not exist: it
necessarily imply that a deterministic TGBA does not exist: it
just implies that =autfilt= could not find it.
@ -435,19 +442,27 @@ autfilt --help | sed -n '/Transformations:/,/^$/p' | sed '1d;$d'
generalized Rabin definition from the HOA format;
the "share-inf" option allows clauses to share Inf
sets, therefore reducing the number of sets
--generalized-streett[=unique-fin|share-fin], --gsa[=unique-fin|share-fin] rewrite the
acceptance condition as generalized Streett; the
"share-fin" option allows clauses to share Fin
sets, therefore reducing the number of sets; the
default "unique-fin" does not
--generalized-streett[=unique-fin|share-fin], --gsa[=unique-fin|share-fin]
rewrite the acceptance condition as generalized
Streett; the "share-fin" option allows clauses to
share Fin sets, therefore reducing the number of
sets; the default "unique-fin" does not
--instut[=1|2] allow more stuttering (two possible algorithms)
--keep-states=NUM[,NUM...] only keep specified states. The first state
will be the new initial state. Implies
--remove-unreachable-states.
--kill-states=NUM[,NUM...] mark the specified states as dead (no
successor), and remove them. Implies
--remove-dead-states.
--mask-acc=NUM[,NUM...] remove all transitions in specified acceptance
sets
--merge-transitions merge transitions with same destination and
acceptance
--partial-degeneralize[=NUM1,NUM2,...]
Degeneralize automata according to sets
NUM1,NUM2,... If no sets are given, partial
degeneralization is performed for all conjunctions
of Inf and disjunctions of Fin.
--product=FILENAME, --product-and=FILENAME
build the product with the automaton in FILENAME
to intersect languages
@ -460,8 +475,8 @@ autfilt --help | sed -n '/Transformations:/,/^$/p' | sed '1d;$d'
quantification, or by assigning them 0 or 1
--remove-dead-states remove states that are unreachable, or that cannot
belong to an infinite path
--remove-fin rewrite the automaton without using Fin acceptance
--remove-fin rewrite the automaton without using Fin
acceptance
--remove-unreachable-states
remove states that are unreachable from the
initial state
@ -498,6 +513,10 @@ autfilt --help | sed -n '/Transformations:/,/^$/p' | sed '1d;$d'
sum languages
--sum-and=FILENAME build the sum with the automaton in FILENAME to
intersect languages
--to-finite[=alive] Convert an automaton with "alive" and "!alive"
propositions into a Büchi automaton interpretable
as a finite automaton. States with a outgoing
"!alive" edge are marked as accepting.
#+end_example
* Decorations

Some files were not shown because too many files have changed in this diff Show more