Commit graph

964 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
da0dd4c534 autfilt: fix incorrect diagnostic
* bin/autfilt.cc (OPT_KEEP_STATES): Mention the correct option.
* tests/core/maskkeep.test: Test for it.
* NEWS: Mention the bug.
2021-02-19 16:01:07 +01:00
Alexandre Duret-Lutz
c06e15e085 fix eventual/universal properties for ->/<->/xor
* spot/tl/formula.cc: Correctly set eventual and universal properties
for ->, <->, and xor.  This wasn't really relevant before, but there
are now situation where those are not rewritten.
* tests/core/kind.test: Adjust expected output.
* tests/core/ltl2tgba2.test: New test case, reported by Florian
Renkin.
* NEWS: Mention the bug.
2021-02-03 12:23:34 +01:00
Alexandre Duret-Lutz
93d8f43285 translate: speed up some -G -D cases
When gf-guarentee works and produce a deterministic automaton, use it
right away without comparing it with the automaton produced by the
regular translation.  This used to be the case for all -D scenarios
except -G -D.

Reported by Florian Renkin.

* spot/twaalgos/translate.cc: Use the result of
gf_guarantee_to_ba_maybe() or fg_safety_to_dca_maybe() whenever -D is
used.
* spot/twaalgos/postproc.cc: Call remove_unused_ap() in finalize(), to
iron out some slight output differences.
* tests/core/ltl2tgba2.test, tests/python/toparity.py: Lower expected
results in the test cases.
* tests/python/automata.ipynb, tests/core/prodor.test: Adjust to new
order.
2021-01-27 13:26:49 +01:00
Alexandre Duret-Lutz
2072151499 twa_graph: swap the two passes of merge_edges()
This improves the determinism in a few cases.

* spot/twa/twagraph.cc (merge_edges): Encapsulate the two
passes into lambdas so that they are very easy to swap.
* spot/twa/twagraph.hh (merge_edges): Adjust documentation.
* tests/python/mergedge.py: Add test case.
* tests/core/alternating.test, tests/python/alternation.ipynb:
Determinism was improved.
* tests/core/parity2.test, tests/core/readsave.test,
tests/core/sbacc.test, tests/python/_product_susp.ipynb,
tests/python/atva16-fig2a.ipynb, tests/python/decompose.ipynb,
tests/python/highlighting.ipynb, tests/python/satmin.ipynb,
tests/python/simstate.py: Adjust expected order of edges.
* NEWS: Mention the change.
2021-01-20 00:16:12 +01:00
Alexandre Duret-Lutz
44c074bbad python: fix incorrect assertions on temporary objects
* tests/python/stutter.py: Do not call acc() on a temporary
object, and fix the last two asserts.
2021-01-17 20:48:56 +01:00
Alexandre Duret-Lutz
a8ee291abe * tests/python/ipnbdoctest.py: Work around failures on Fedora. 2021-01-16 16:33:30 +01:00
Alexandre Duret-Lutz
8785f5a74b bin: add support for -b/--buchi
* bin/common_post.cc, bin/randaut.cc: Implement -b/--buchi.
Also add --sba as alias for -B, and --gba as alias for --tgba.
* NEWS: Document those changes.
* doc/org/ltl2tgba.org, doc/org/oaut.org: Adjust documentation.
* tests/core/ltl2tgba2.test, tests/core/ltlcross2.test,
tests/core/randaut.test: Add more tests.
* tests/core/sbacc.test: --sbacc cannot be abbreviated as --sba
anymore.
2020-12-18 12:24:08 +01:00
Alexandre Duret-Lutz
7e2f091839 determinize: do not copy the "incomplete" property
Mentioned in issue #298.

* spot/twaalgos/determinize.cc: Do not copy prop_complete of
the input if it is false.
* tests/python/298.py: Test it.
* NEWS: Mention the bug.
2020-12-15 10:47:25 +01:00
Alexandre Duret-Lutz
f6be083050 determinize: don't emit colors for temporary braces
Related to issue #298.

* spot/twaalgos/determinize.cc: Recognize braces that are temporary
to avoid emitting colors when they become empty.
* tests/python/298.py: New file, showing a reduction of colors.
* tests/Makefile.am: Add it.
* tests/core/ltlsynt.test: Adjust expected output (now smaller).
* tests/core/genltl.test: Adjust one expected output (now larger).
* NEWS: Mention the issue.
2020-12-15 07:58:42 +01:00
Alexandre Duret-Lutz
142460628c translate: add support for -x exprop
This helped confirming a behavior observed in #298.

* spot/twaalgos/translate.cc, spot/twaalgos/translate.hh: Add support
for -x exprop.
* bin/spot-x.cc, NEWS: Document it.
* tests/core/ltl2tgba2.test: Test it.
2020-12-14 17:46:03 +01:00
Alexandre Duret-Lutz
9a17f5676c game: rewrite, document, and rename solve_reachability_game
* spot/twaalgos/game.hh, spot/twaalgos/game.cc: Rename
solve_reachability_game() as solve_safety_game(), rewrite it (the old
implementation incorrectly marked dead states as winning for their
owner).
* tests/python/paritygame.ipynb: Rename as...
* tests/python/games.ipynb: ... this, and illustrate
solve_safety_game().
* tests/Makefile.am, NEWS, doc/org/tut.org: Adjust.
* tests/python/except.py: Add more tests.
2020-12-10 15:04:07 +01:00
Alexandre Duret-Lutz
2d6c7ac045 minimize_wdba: improve handling of terminal automata
Part of #444.

* spot/twaalgos/minimize.cc (minimize_wdba): Terminal automata do not
need a product to decide which states are accepting in the DBA.  This
is faster, and also determinize more formulas of #443.
* tests/core/ltl2tgba2.test: Adjust the expected iteration where
determinization will be aborted.
2020-12-08 22:36:51 +01:00
Alexandre Duret-Lutz
48edfd80c2 powerset: deal with accepting sinks more effectively
Part of #444.

* spot/twaalgos/powerset.cc, spot/twaalgos/powerset.hh: Implement
accepting sink handling.
* spot/twaalgos/minimize.cc (minimize_wdba): Pass sinks to
tgba_powerset.
* spot/misc/bitvect.hh: Add an interesects method.
* tests/core/ltl2tgba2.test: More tests.
* NEWS: Mention this new feature.
2020-12-08 17:55:50 +01:00
Alexandre Duret-Lutz
eeaed5592f fix ignored aborter in WDBA-minimization
Fixes #443, reported by Roei Nahum.  (However the fix
only works for the development version, where wdba-det-max
was introduced to work around that kind of problem.)

* spot/twaalgos/minimize.cc: Avoid aborter being implicitly
converted to Boolean.
* tests/core/ltl2tgba2.test: Add test case.
* THANKS: Add Roei Nahum.
2020-12-08 12:03:30 +01:00
Alexandre Duret-Lutz
fb224d3f63 twagraph: fix merge_edges() ignoring the first edge
This fixes #441, reported by Jérôme Dubois.

* tests/python/mergedge.py: New file.
* tests/Makefile.am: Add it.
* spot/twa/twagraph.cc (merge_edges): Fix initialization of second
loop.
* NEWS: Mention the bug.
2020-11-24 16:08:21 +01:00
Etienne Renault
43bd39f13f revert a7842ac for building static modelcheck
* configure.ac, tests/Makefile.am: Here.
2020-10-09 11:33:40 +02:00
Alexandre Duret-Lutz
9cc1bdf10f postprocess, translate: add support for Büchi (not state-based)
spot/twaalgos/postproc.hh: Introduce options Buchi and
GeneralizedBuchi.  The latter is similar to TGBA but the former differs
from BA in that it does not imply state-based acceptance, since that
can be specified separately.  Also all other acceptance types are not
abbreviated, so those new names make more sense.
* NEWS: Mention that.
* spot/twaalgos/postproc.cc, spot/twaalgos/translate.cc: Adjust
to support Buchi and GeneralizedBuchi without breaking BA and TGBA.
* bin/autfilt.cc, bin/common_aoutput.cc, bin/common_post.cc,
bin/ltl2tgta.cc, doc/org/tut10.org, doc/org/tut12.org,
doc/org/tut30.org, python/spot/__init__.py,
tests/python/automata.ipynb, tests/python/langmap.py,
tests/python/misc-ec.py, tests/python/satmin.ipynb,
tests/python/satmin.py, tests/python/toweak.py: Use the new names.
* tests/Makefile.am: Add missing langmap.py.
2020-10-06 17:46:34 +02:00
philipp
29055c8109 Improving split and reorganizing
* spot/twaalgos/synthesis.cc, spot/twaalgos/synthesis.hh: New files
regrouping the functionnalities split and apply_strategy for synthesis
* python/spot/impl.i, spot/twaalgos/Makefile.am: Add them.
* spot/twaalgos/split.cc, spot/twaalgos/split.hh: No longer contains
the splits necessary for for synthesis, moved to
spot/twaalgos/synthesis.cc, spot/twaalgos/split.hh Split is now faster
and reduces the number of intermediate states, reducing the overall
size of the arena
* spot/misc/game.cc, spot/misc/game.hh: Renaming propagate_players to
alternate_players.
* tests/core/ltlsynt.test, tests/python/split.py: Update tests.
* bin/ltlsynt.cc: Adjust to new split. Swap order of split and
to_parity for lar.
2020-09-24 16:29:31 +02:00
Alexandre Duret-Lutz
392c1a0ec3 game: fix handling of useless SCCs
This is a bug I introduced while merging Philipp's patch.

* spot/misc/game.cc (parity_game::solve): Set the strategy for player
0 in useless SCCs.
(parity_game::fix_scc): Do not use sub_game_ to detect edges exiting
the SCC.
* tests/python/game.py: New file.
* tests/Makefile.am: Add it.
2020-09-24 12:18:14 +02:00
Alexandre Duret-Lutz
7b2e32e291 tests: do not override DYLD_LIBRARY_PATH
* tests/run.in: Here.
2020-09-23 13:32:20 +02:00
Alexandre Duret-Lutz
2a7bbb1cdc tests: fix import of libspotgen on Darwin
Fixes #426, reported by Étienne Renault.

* tests/run.in: Augment modpath.
2020-09-23 13:13:28 +02:00
Alexandre Duret-Lutz
b43f378db5 tests: fix non-portable use of sed
Fixes #428, reported by Etienne Renault.

* tests/core/genltl.test: Do use \? with sed.
2020-09-23 11:33:18 +02:00
Alexandre Duret-Lutz
b0730852bf tests: use $PERL instead of perl
* tests/core/ltl2tgba2.test, tests/core/ltldo.test,
tests/core/ltlfilt.test, tests/core/neverclaimread.test,
tests/core/parseaut.test, tests/sanity/bin.test: Here.
2020-09-23 11:33:15 +02:00
Alexandre Duret-Lutz
3a6d967872 tests: replace non-portable use of sed by $PERL
This fixes one failure reported in #428 by Étienne Renault.

* tests/core/lbt.test: Here.
* tests/run.in: Export PERL.
2020-09-23 11:33:11 +02:00
philipp
133896d584 game: reimplement parity game solving
* spot/misc/game.cc, spot/misc/game.hh: More efficient implementation
of Zielonka's algorithm to solve parity games.  Now supports SCC
decomposition and efficient handling of certain special cases.
* doc/org/concepts.org: Document "strategy" and "state-winner"
properties.
* bin/ltlsynt.cc, tests/python/paritygame.ipynb: Adjust.
* tests/core/ltlsynt.test: Add more tests.
2020-09-22 23:15:30 +02:00
philipp
0d43bedacb game: reimplement print_aiger
* spot/twaalgos/aiger.cc, spot/twaalgos/aiger.hh: Reimplement
print_aiger for speed gain, also heuristics to minimize the number
of gates as well as different encoding types have been added.
* bin/ltlsynt.cc: Make the new options for print-aiger available.
* tests/core/ltlsynt.test: Adjust tests.
2020-09-19 18:41:52 +02:00
Alexandre Duret-Lutz
f5965966e9 translator: add tls-max-states option
This restricts the time spent in translating sub-formulas for
implication tests by limiting the associated automata to 64 states by
default.  Doing so this does worsen any test case, and actually remove
all calls the BuDDy's GC in bdd.test.

* spot/twaalgos/translate.cc, spot/twaalgos/translate.hh,
spot/tl/simplify.cc, spot/tl/simplify.hh, spot/tl/contain.hh,
spot/tl/contain.cc, spot/twaalgos/ltl2tgba_fm.cc,
spot/twaalgos/ltl2tgba_fm.hh: Add support for the option or
its constraint via an output_aborter.
* bin/spot-x.cc, NEWS: Document it.
* tests/core/bdd.test: Adjust and augment test case.
2020-09-18 09:41:29 +02:00
Alexandre Duret-Lutz
9d7e6386e4 python: reduce automata width to prevent overflows with Jupyter
* python/spot/__init__.py (setup): Reduce the default maximal width of
automata so that Jupyter output does not add an horizontal scroll bar
for a few pixels.
* tests/python/automata-io.ipynb: Adjust.
2020-09-17 11:21:06 +02:00
Alexandre Duret-Lutz
69c821154c postproc: add simul-max and wdba-det-max options
* NEWS, bin/spot-x.cc: Document them.
* spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh: Implement
them.
* tests/python/stutter-inv.ipynb: Adjust result.
* tests/core/minusx.test: Add test case.
2020-09-16 20:40:16 +02:00
Jerome Dubois
229be9a5db python: add check for panda
* tests/python/ipnbdoctest.py: Skip test if panda is not installed.
2020-09-16 10:22:39 +02:00
Jerome Dubois
ae7d4504cd game: Add set_state_player() and get_state_player()
Fixes #424.

* python/spot/impl.i: Add implicit convertion for vector<bool>.
* spot/misc/game.cc, spot/misc/game.hh: Add set_state_player()
  and get_state_player().
* tests/python/parity.py: Test them.
2020-09-16 10:22:09 +02:00
Alexandre Duret-Lutz
760bde093b python: add some parity-game bindings
* python/spot/impl.i: Process game.hh.
* spot/misc/game.cc, spot/misc/game.hh: Make the output of
parity_game_solve() a solved_game object for easier manipulation in
Python.
* bin/ltlsynt.cc: Adjust usage.
* tests/python/paritygame.ipynb: New file.
* tests/Makefile.am, doc/org/tut.org: Add it.
* NEWS: Mention these bindings.
2020-09-09 15:32:44 +02:00
Alexandre Duret-Lutz
9e8a842975 game: make a propagate_players() function public
* bin/ltlsynt.cc (complete_env): Replace this function by...
* spot/misc/game.hh, spot/misc/game.cc (propagate_players): ... this
new one, hiding the "state-player" business from ltlsynt.  Also do not
create a sink states unless necessary.
* tests/core/ltlsynt.test: Adjust expected number of states.
2020-09-08 22:30:40 +02:00
Alexandre Duret-Lutz
41d088ea95 dot: add support for two-player games
* spot/twaalgos/dot.cc: Honor the "state-player" property and draw
player 1 states using diamonds.
* doc/org/hoa.org: Show an example.
* tests/core/gamehoa.test: Make sure diamond is output.
* NEWS: Mention this.
2020-09-08 20:20:48 +02:00
Alexandre Duret-Lutz
ea9384dd4b extend HOA I/O to preserve the state-player property
* spot/parseaut/parseaut.yy, spot/parseaut/scanaut.ll,
spot/twaalgos/hoa.cc: Add input and output support.
* doc/org/hoa.org: Document the HOA extension.
* bin/ltlsynt.cc: Add a --print-game-hoa option to
produce such format.
* tests/core/gamehoa.test: New file to test this.
* tests/Makefile.am: Add it.
* NEWS: Mention this new feature.
2020-09-08 20:20:48 +02:00
Alexandre Duret-Lutz
a375089e52 simplify_acceptance: generalize the complementary mark rewriting
Fixes #403.

* spot/twaalgos/cleanacc.cc (simplify_complementary_marks_here):
Assume that two colors are complementary in a broad sense, i.e., on is
present if (but not only if) the other is missing before applying
those rewritings.  Technically, this is usually not necessary, because
the changes done in #418 will cause such "covering-the-full-automaton"
pair of colors to be disjoint so complementary in a strict sense.  It
might make a difference (this is not tested) in presence of reused
colors which #418 cannot remove.  In any case, it's simply less code
to implement the broad sense.
* tests/python/toparity.py: Add test case from #403, which is
reduced to two states with recent optimizations.
2020-07-29 15:01:55 +02:00
Alexandre Duret-Lutz
0c4b701630 improve acceptance simplifications using useless colors
This fixes issue #418.

* spot/twa/acc.cc,
spot/twa/acc.hh (acc_cond::acc_code::useless_colors_patterns): New
method to detect patterns of colors allowing other colors to be added
or removed at will.
* spot/twaalgos/cleanacc.cc (simplify_acceptance_here): Use the above
patterns to remove some useless colors from transitions and hope that
this can help simplify the acceptance condition.
* spot/twaalgos/degen.cc (propagate_marks_vector): Use the pattern to
add more colors.
* tests/core/ltl2tgba2.test: Add the test case from issue #418.
* tests/core/ltl2dstar4.test, tests/core/satmin3.test,
tests/core/sccdot.test, tests/core/sim3.test,
tests/python/automata.ipynb, tests/python/decompose.ipynb,
tests/python/merge.py, tests/python/pdegen.py, tests/python/remfin.py,
tests/python/toparity.py, tests/python/tra2tba.py: Adjust all test
cases.
* NEWS: Mention this new feature.
2020-07-28 22:26:28 +02:00
Alexandre Duret-Lutz
3220da6605 tra_to_tba: finish 05e6e0885
* spot/twaalgos/remfin.cc: Actually use propmarks.
* tests/core/det.test, tests/core/remfin.test,
tests/python/automata.ipynb, tests/python/remfin.py,
tests/python/tra2tba.py: Adjust test cases.
2020-07-27 14:43:27 +02:00
Alexandre Duret-Lutz
ff3a3f8144 * tests/python/ipnbdoctest.py: Ignore matplotlib font cache messages. 2020-07-27 14:43:27 +02:00
Florian Renkin
5ec9d55fea simplify_acceptance: Use color inclusions to simplify a condition
This fixes #406.

* spot/twaalgos/cleanacc.cc: Add the simplification.
* tests/core/remfin.test, tests/python/automata.ipynb,
tests/python/remfin.py: Update tests.
* tests/python/simplacc.py: Update and add tests.
2020-07-25 19:15:17 +02:00
Alexandre Duret-Lutz
05e6e08859 tra_to_tba: remove more useless edges
* spot/twaalgos/remfin.cc (tra_to_tba): Implement the same
optimization has in the generic remove_fin transformation.
* tests/python/tra2tba.py: Adjust.
2020-07-24 16:32:00 +02:00
Alexandre Duret-Lutz
7fbf4e0e3c remove_fin: ignore more useless transitions
Do not clone transitions that are necessarily part of on accepting
cycle in the main copy of the automaton.

* spot/twaalgos/remfin.cc: Use propagate_marks_vector to ignore more
edges.
* tests/core/remfin.test, tests/python/remfin.py,
tests/python/automata.ipynb: Adjust.
* tests/sanity/style.test: Do not choke on C++17 if statements with
initializer.
2020-07-24 15:38:42 +02:00
Alexandre Duret-Lutz
b17376879d translate: add a quick syntactic simplification before relabeling
This fixes #412.

* spot/twaalgos/translate.cc: Add the quick syntactic simplification.
* spot/twaalgos/relabel.cc: Do not register old unused APs.
* tests/core/ltl2tgba2.test: Add test case.
* tests/core/bdd.test, tests/python/automata.ipynb: Adjust.
* NEWS: Mention this.
2020-07-22 17:02:47 +02:00
Alexandre Duret-Lutz
1c5468a93a simplify: fix handling of keep_top_xor
Under that option, !(a ^ b) was converted
to (!a <=> !b) instead of simply (a <=> b).

* spot/tl/simplify.cc (equiv_or_xor): Improve
rewriting.
* tests/core/ltl2tgba2.test, tests/python/simstate.py: Adjust test
cases.
2020-07-22 17:02:22 +02:00
Alexandre Duret-Lutz
457e130e24 ltlcross: completely fix #420
Reported by Salomon Sickert.

* bin/ltlcross.cc: Also call determinize_unknown_acceptance() for
positive automata.
* tests/core/ltlcross3.test: Add another test case.
* NEWS: Mention the fix.
2020-07-21 22:18:00 +02:00
Alexandre Duret-Lutz
33b28c8151 ltlcross: fix cross-checks for automata using Fin acceptance
Fixes #420 reported by Salomon Sickert.

* bin/ltlcross.cc: Call determine_unknown_acceptance().
* spot/twaalgos/sccinfo.cc, spot/twaalgos/sccinfo.hh: Document
that one_accepting_scc()==-1 can mean "don't know", and update
determine_unknown_acceptance() to set one_acc_scc_.
* tests/core/ltlcross3.test: Add test case.
* NEWS: Mention the fixes.
2020-07-20 13:38:47 +02:00
Alexandre Duret-Lutz
1513a9d996 Merge branch 'master' into next 2020-07-15 14:06:23 +02:00
Alexandre Duret-Lutz
b214fd75d6 scc_info: honor filters in edges_of() and inner_edges_of()
* spot/twaalgos/sccinfo.hh: Honor filters in edges_of() and
inner_edges_of().
* tests/core/sccif.test: Adjust expected output.
* NEWS: Mention the bug.
2020-07-15 11:31:56 +02:00
Alexandre Duret-Lutz
1fa048fe8a ltlcross: diagnose complementations requiring too many colors
Fixes #411 reported by Frantiček Blahoudek.

* bin/ltlcross.cc: Catch the issue.
* tests/core/ltlcross6.test: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention it.
2020-07-14 22:39:44 +02:00
Alexandre Duret-Lutz
f2403c91dc run: fix reduce on automata with Fin
Reported by Florian Renkin.

* spot/twaalgos/emptiness.cc (reduce): If the automaton uses Fin
acceptance, check the reduced cycle and revert to the original cycle
if necessary.
* tests/python/intrun.py: New file.
* tests/Makefile.am: Add it.
* spot/twaalgos/emptiness.hh: Improve documentation.
2020-07-13 16:30:29 +02:00