Commit graph

548 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
2a38328a5c replace bdd_satoneset(x,y,bddtrue) loops by minterms_of(x,y)
Because the loops iterate in the opposite order, multiple
test cases need to be adjusted.

* spot/taalgos/tgba2ta.cc, spot/twaalgos/alternation.cc,
spot/twaalgos/dualize.cc, spot/twaalgos/ltl2tgba_fm.cc,
spot/twaalgos/simulation.cc, spot/twaalgos/stutter.cc,
spot/twaalgos/toweak.cc: Replace loops based on
bdd_satonest(x,y,bddtrue) by loops based on minterms_of(x,y).
* tests/core/degenscc.test, tests/core/dualize.test,
tests/core/genltl.test, tests/core/readsave.test,
tests/python/alternation.ipynb, tests/python/automata.ipynb,
tests/python/decompose.ipynb, tests/python/decompose_scc.py,
tests/python/dualize.py, tests/python/sccinfo.py,
tests/python/simstate.py, tests/python/testingaut.ipynb,
tests/python/word.ipynb: Adjust expected test cases.  The
only regression is in genltl.test, but the worsened case
should eventually be fixed as discussed in issue #425 anyway.
2021-04-14 17:31:45 +02:00
Alexandre Duret-Lutz
c58aa678ec test minterms_of enumerator
* tests/core/minterm.cc, tests/core/minterm.test: New files.
* tests/core/.gitignore, tests/Makefile.am: Add them.
2021-04-12 17:54:12 +02:00
Alexandre Duret-Lutz
535d4555e5 bricks: fix the test-suite
Fixes #446 using a fix from Étienne Renault.

* tests/core/bricks.cc: Pass the hash table by reference while
instantiating the threads.
2021-03-24 10:04:38 +01:00
Alexandre Duret-Lutz
caa960d857 twagraph: new kill_state method
This proceeds from a discussion with Michaël Cadilhac.
http://lists.lrde.epita.fr/pipermail/spot/2021q1/000356.html

* bin/autfilt.cc (--kill-states): New option.
* NEWS: Mention those.
* spot/twa/twagraph.hh, spot/twa/twagraph.cc: Add a kill_state()
method.
* tests/core/maskkeep.test: Test it.
2021-02-19 16:42:55 +01:00
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
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
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
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
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
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
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
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
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
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
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
4cfa253830 ltldo: improve error messages
Use ltldo:... instead of error:... and warning:... and also improve
the diagnostic displayed after a translation failure to mention the
tool and formula.

Incidentally, this fixes a spurious test case failure observed by
Philipp Schlehuber on CentOS7.7 where glibc 2.17 is installed.  With
this system, when posix_spawn() starts a binary that does not exist,
it returns success and let the child die with exit code 127.  On more
recent glibc, posix_spawn() manages to return execve()'s errno, as if
the child had not been created.  We handle those two different ways to
fail, but before this patch one used to print "error:..." and the
other "ltldo:...".

* bin/ltldo.cc: Display the program_name in error message.  Display
the command name and formula on translation failure.
* tests/core/ltldo.test: Adjust test case.
* NEWS: Mention the fix.
2020-07-13 16:30:29 +02:00
Alexandre Duret-Lutz
37d0b0d045 ltlsynt: use wdba-minimize=2 and ba-simul=0
* bin/ltlsynt.cc: Here.
* tests/core/ltlsynt.test: Add extra test case.
* NEWS: Mention ltlsynt -x and related defaults.
2020-07-13 16:30:29 +02:00
Florian Renkin
56c8d690ba ltlsynt: Change default options
* bin/ltlsynt.cc: Change default options.
* tests/core/ltlsynt.test: Add test.
2020-07-13 16:30:29 +02:00
Alexandre Duret-Lutz
e06f8a3ece work around diagnostic changes in Bison 3.6
Bison <3.6 used to complain about "$undefined", while Bison >=3.6 now
write "invalid token".

* tests/core/parseaut.test, tests/core/parseerr.test,
tests/core/sugar.test: Adjust expected diagnostics to match Bison pre
and post 3.6.
2020-07-13 16:30:29 +02:00
Alexandre Duret-Lutz
16540869d4 ltlsynt: add --algo=ps
* bin/ltlsynt.cc: Implement this.
* tests/core/ltlsynt.test: Add a test case.
* NEWS: Mention it.
2020-07-13 16:30:29 +02:00
Alexandre Duret-Lutz
b762f54228 remfin: do not clone transitions that are accepting in main
* spot/twaalgos/remfin.cc (default_strategy): Detect transitions
from the main copy that are completely accepting and that do not
need to be repeated in the clones.
* tests/python/remfin.py: Add a test case.
* tests/core/ltl2dstar4.test: Improve expected results.
* NEWS: Mention the change.
2020-07-13 16:30:29 +02:00
Alexandre Duret-Lutz
c005041e53 improve fuse_marks_here by detecting more patterns
This remove some restrictions that prevented fuse_marks_here from
simplifying certain patterns, as noted in the first comment of
issue #405.

* spot/twaalgos/cleanacc.cc (find_interm_rec, find_fusable): Remove
some unnecessary restrictions to singleton marks, and replace the hack
put one non-singleton mark at the beginning of the singleton list by a
sort.
* tests/python/simplacc.py: Add two test cases.
* tests/python/automata.ipynb, tests/core/remfin.test: Improve
expected results.
* NEWS: Mention the bug.
2020-07-13 16:30:29 +02:00
Alexandre Duret-Lutz
64aee87d76 postproc: option to wdba-minimize only when sure
Fixes #15.

* spot/twaalgos/minimize.hh, spot/twaalgos/minimize.cc
(minimize_obligation_garanteed_to_work): New function.
* spot/twaalgos/postproc.hh, spot/twaalgos/postproc.cc: Use it if
wdba-minimize=1.  Handle new default for wdba-minimize.
* NEWS, bin/spot-x.cc: Document those changes.
* tests/core/ltl2tgba2.test: Add some test cases.
* tests/core/genltl.test: Improve expected results.
2020-07-13 16:30:29 +02:00
Alexandre Duret-Lutz
d25fcb23eb stats: speed up the computation of transitions
Juraj Major reported a case with 32 APs where ltlcross would take
forever to gather statistics.  It turns out that for each edge,
twa_sub_statistics was enumerating all compatible assignments of 32
APs.  This uses bdd_satcountset() instead, and also store the result
in a long long to avoid overflows.

* spot/twaalgos/stats.cc (twa_sub_statistics): Improve the code for
counting transitions.
* bin/common_aoutput.hh, bin/ltlcross.cc, spot/twaalgos/stats.hh:
Store transition counts are long long.
* tests/core/readsave.test: Add test case.
* NEWS: Mention the bug.
2020-07-13 16:30:29 +02:00
Alexandre Duret-Lutz
fc1c17b91c ltlsynt: make sure the previous Xor optimization actually works
* spot/tl/simplify.hh, spot/tl/simplify.cc,
spot/twaalgos/translate.cc: Update the tl_simplification
options after all preferences have been given.
* bin/ltlsynt.cc: Display the size of the translation output.
* tests/core/ltlsynt.test: Add test case.
2020-07-13 16:30:29 +02:00
Alexandre Duret-Lutz
6ec6150462 translate: improve handling of Xor and Equiv at top-level for -G -D
* spot/tl/formula.hh: Add variant of formula::is that support 4
arguments.
* spot/tl/simplify.hh, spot/tl/simplify.cc: Add option keep_top_xor
to preserve Xor and Equiv at the top-level.
* spot/twaalgos/translate.cc: Adjust ltl-split to deal with Xor and
Equiv for the -D -G case.
* NEWS: Mention that.
* tests/core/ltl2tgba2.test: Add test case.
* tests/python/simstate.py: Adjust expected result.
2020-07-13 16:30:29 +02:00
Etienne Renault
b3c7994a1d bricks: rework tests
On some architectures this test fails due to several
reasons:
    - missing headers
    - use of valueAt instead of count in ConCS. Indeed,
    valueAt acts similarly to count but avoids some validity
    check that are required when the hashmap is growing.

This patch also:
     - removes inaccurate comments from bricks.test.
     - test more features for hashset.

* spot/bricks/brick-hashset,
tests/core/bricks.cc,
tests/core/bricks.test: Here.
2020-06-11 08:56:56 +02:00
Etienne Renault
47b31bd9eb bricks: include tests in test-suite
* tests/Makefile.am,
tests/core/bricks.cc,
tests/core/bricks.test: Here.
2020-06-10 10:07:06 +02:00
Etienne Renault
c61b721a48 cube: more tests
* tests/core/cube.cc, tests/core/cube.test: Here.
2020-06-09 16:20:59 +02:00