Commit graph

6701 commits

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