Commit graph

6635 commits

Author SHA1 Message Date
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