Commit graph

791 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
1a7f471a02 * tests/python/ipnbdoctest.py: Ignore matplotlib font cache messages. 2020-08-03 09:25:03 +02:00
Alexandre Duret-Lutz
2c267cac40 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-08-03 09:23:48 +02:00
Alexandre Duret-Lutz
d5f488647b 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:20:04 +02:00
Alexandre Duret-Lutz
ac5a261aa5 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 15:47:39 +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
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
3368b4b99f * tests/sanity/80columns.test: Force LC_ALL. 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
Alexandre Duret-Lutz
822b749166 product: add product_xor() and product_xnor()
* spot/twaalgos/product.cc, spot/twaalgos/product.hh: Add those
functions.
* tests/python/_product_weak.ipynb, tests/python/except.py: Test them.
* NEWS: Mention them.
2020-07-13 16:30:29 +02:00
Alexandre Duret-Lutz
82d69241f1 ltlsynt: add a --csv=FILENAME option
* bin/ltlsynt.cc: Add a --csv option to record the
duration of the various phases.
* tests/core/ltlsynt.test: Test the new option.
* NEWS: Mention it.
2020-04-30 08:14:50 +02:00
Alexandre Duret-Lutz
a7051b32c8 dot: fix #393
* spot/twaalgos/dot.cc: Add support for option 'E', and default to
rectangle nodes for large labels.
* bin/common_aoutput.cc, NEWS: Document it.
* tests/core/alternating.test, tests/core/dstar.test,
tests/core/readsave.test, tests/core/sccdot.test,
tests/core/tgbagraph.test, tests/python/_product_weak.ipynb,
tests/python/alternation.ipynb, tests/python/atva16-fig2b.ipynb,
tests/python/automata.ipynb, tests/python/decompose.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/pdegen.py,
tests/python/satmin.ipynb, tests/python/stutter-inv.ipynb: Adjust all
test cases.
2020-04-29 21:14:36 +02:00
Alexandre Duret-Lutz
3ea63e9a75 dot: fix #392
* spot/twaalgos/dot.cc: Add tooltips to "..." states and edges.
* tests/core/readsave.test: Test this.
* tests/python/highlighting.ipynb: Adjust.
2020-04-29 12:28:17 +02:00
Alexandre Duret-Lutz
6706042019 postproc: fix issue #402
* spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh,
spot/twaalgos/translate.cc: Introduce a gen-reduce-parity option and
use it on sub-automata built by ltl-split.
* bin/spot-x.cc: Document it.
* tests/core/ltl2tgba2.test: Add test case reported by Juraj Major.
2020-04-25 20:08:45 +02:00
Alexandre Duret-Lutz
fe340ae8db ltlsynt: fix lar.old implementation
* bin/ltlsynt.cc: Make sure to_parity_old() receive a deterministic
automaton, for correctness.   Also call reduce_parity() afterward,
to match what was done in 2.8.7.
* tests/core/ltlsynt.test: Include lar.old in the comparison of all
results to make sure it give the same result as the other 3
algorithms.
2020-04-25 16:29:03 +02:00
Alexandre Duret-Lutz
c0e1b3e52a cleanacc: keep acceptance order when removing complementary colors
* spot/twaalgos/cleanacc.cc (remove_compl_rec): Rewrite to preserve
the original order of the acceptance condition while rewriting it.
* tests/core/sccdot.test, tests/python/merge.py,
tests/python/simplacc.py, tests/python/toparity.py: Adjust test cases.
2020-04-18 23:02:11 +02:00
Florian Renkin
262b24e6d7 unit_propagation: Correct result when multiple colors are possible
* spot/twa/acc.cc: Here.
* tests/core/acc.cc, tests/core/acc.test, tests/core/remfin.test:
Update tests.
2020-04-18 22:11:21 +02:00
Alexandre Duret-Lutz
fd0d752bc3 to_parity: only call reduce_parity() when prefix_parity is enabled
Calling reduce_parity() in to_parity() is confusing, because then
running to_parity() on one SCC does not necessarily produce the same
output as running to_parity() on the entire automaton.  However it is
necessary for the implementation of parity_prefix.  As a compromise,
disable reduce_parity() when parity_prefix is disabled, this way we
can use that to demonstrate how the algorithm works.

* spot/twaalgos/toparity.hh, spot/twaalgos/toparity.cc: Do not
call reduce_parity() when parity_prefix is disabled.
* tests/python/toparity.py: Adjust.
2020-04-17 22:04:32 +02:00
Alexandre Duret-Lutz
102ef04364 simplify_acc: loop over the simplifications
* spot/twaalgos/cleanacc.cc (simplify_acceptance_here): Run the
simplifications in a loop until the condition does not change anymore.
* tests/python/simplacc.py, tests/core/accsimpl.test,
tests/core/remfin.test, tests/python/merge.py,
tests/python/simplacc.py, tests/python/toparity.py: Update expected
results.
* tests/python/automata.ipynb: Update the failing example to a more
interesting one, matching the one in doc/org/autfilt.org.
2020-04-17 21:54:12 +02:00
Alexandre Duret-Lutz
b62e1bb13c simplify_acc: fix an infinite loop
* spot/twaalgos/cleanacc.cc (fuse_mark_here): Fix incorrect cancelling
of n-ary subterms, causing an invalid acceptance condition, and then
an infinite loop.
* tests/python/simplacc.py: Add test case.
2020-04-17 21:42:53 +02:00
Florian Renkin
68012e6a85 to_parity: Correct the expected number of states
* tests/python/toparity.py: here.
2020-04-17 16:47:02 +02:00
Florian Renkin
527b62c5ff to_parity: Remove merge_states
* spot/twaalgos/toparity.cc: Remove merge_states.
* tests/python/automata.ipynb, tests/python/toparity.py: Update tests.
2020-04-17 14:59:42 +02:00
Florian Renkin
142f1afab2 unit_propagation: Add a test with multiple unit clauses
* tests/core/acc.cc, tests/core/acc.test: here.
2020-04-17 13:38:46 +02:00
Florian Renkin
8c48003943 to_parity: Use merge_states
* spot/twaalgos/toparity.cc: Use merge_states at the end
of to_parity.
* tests/python/toparity.py: Update tests.
2020-04-16 22:10:40 +02:00
Alexandre Duret-Lutz
875846f51f toparity: false transitions are not a problem anymore
* spot/twaalgos/toparity.cc: Do not remove false transitions.
* tests/python/toparity.py: Add a test case with false transitions.
2020-04-16 21:12:30 +02:00
Alexandre Duret-Lutz
fe642bc9ad acc: make sure unit_propagate preserve the number of sets
* spot/twa/acc.hh: Here.
* tests/core/accsimpl.test, tests/core/ltl2tgba2.test: Add test cases.
2020-04-16 08:37:59 +02:00
Florian Renkin
0ba1097636 to_parity: Improve to_parity and update tests
* spot/twaalgos/toparity.cc: Use a better search of the
transitions when we search compatible states.
* spot/twaalgos/toparity.hh: Use less that 80 columns.
* tests/python/merge.py, tests/python/toparity.py: Update tests.
2020-04-12 19:44:58 +02:00
Florian Renkin
630b8333fe Impove simplify_acceptance
* spot/twaalgos/cleanacc.cc: Use cleanup_acceptance if
propagate_fin_inf was useful.
* spot/twa/acc.hh: Avoid to reverse the order of the condition in
propagate_fin_inf.
* tests/core/accsimpl.test, tests/core/remfin.test,
tests/python/merge.py, tests/python/automata.ipynb: Update tests.
* tests/python/toparity.py: Update tests and add tests to check the
number of states.
2020-04-12 18:31:28 +02:00
Alexandre Duret-Lutz
a1a5334d5e relabel_bse: improve handling of n-ary operators
* spot/tl/relabel.cc: Here.
* tests/core/ltlrel.test: Add test cases, and update existing ones.
* NEWS: Mention it.
2020-04-12 11:55:53 +02:00
Alexandre Duret-Lutz
33289f5166 relabel_bse: fix incorrect detection of common APs
Based on a report by Jean Kreber.

* spot/tl/relabel.cc (cut_points): Really connect children of Boolean
operators using undirected edges, not directed ones.
* tests/core/ltlrel.test: Add test cases.
* NEWS: Mention the bug.
2020-04-11 23:50:07 +02:00
Alexandre Duret-Lutz
0b25820211 ignore false edges in emptiness checks and scc_info
Based on reports by Florian Renkin and Jens Kreber.

* spot/twaalgos/bfssteps.cc, spot/twaalgos/couvreurnew.cc,
spot/twaalgos/gtec/gtec.cc, spot/twaalgos/gv04.cc,
spot/twaalgos/magic.cc, spot/twaalgos/sccinfo.cc
spot/twaalgos/se05.cc, spot/twaalgos/tau03.cc: Ignore bddfalse edges.
* spot/twaalgos/gtec/gtec.hh: Remove debugging function.
* tests/core/neverclaimread.test: Adjust.
* tests/python/ecfalse.py: New test file.
* tests/Makefile.am: Add it.
* NEWS: Mention the bug.
2020-04-11 11:24:55 +02:00
Alexandre Duret-Lutz
67fa19cb08 relabel: generalize 9365f8de1 to remove more false edges
* spot/twaalgos/relabel.cc: Detect false edges as they are created,
even as the result of multiple renamings.
* tests/core/ltl2tgba2.test: More test cases, reported by Jens Kreber.
* NEWS: Mention the bug.
* THANKS: Add Jens.
2020-04-10 10:52:40 +02:00
Alexandre Duret-Lutz
2b918d1c02 toparity: rename iar_old()/iar_maybe_old() to iar()/iar_maybe()
* spot/twaalgos/toparity.hh, spot/twaalgos/toparity.cc: Use the
original names, to minimize differences with spot 2.8.  Deprecate
them.
* tests/python/except.py: Adjust.
* NEWS: Mention the change.
2020-04-05 14:12:40 +02:00
Alexandre Duret-Lutz
1db319267f python: simplify to_parity() interface
* python/spot/__init__.py (to_parity): Iterate over the attributes
of spot.to_parity_options instead of naming each option explicitely,
also accept a to_parity_options() instance as argument.
* tests/python/toparity.py: Add tests for both styles of calls, and
reduce the number of random tests to lower the run time of this test.
2020-04-04 15:44:27 +02:00
Alexandre Duret-Lutz
1750c0fb6d to_parity: improve doc, and rename car_option into to_parity_options
* spot/twaalgos/toparity.hh: Improve doc, and rename car_option into
to_parity_options.
* doc/spot.bib: Add one reference.
* python/spot/__init__.py, spot/twaalgos/toparity.cc,
tests/python/toparity.py: Adjust.
2020-04-04 14:43:47 +02:00
Florian Renkin
75990063f0 Moved IAR and the new version of to_parity in toparity.cc
* python/spot/__init__.py: Use keyword arguments in to_parity()
* python/spot/impl.i: remove useless includes.
* spot/twaalgos/car.cc, spot/twaalgos/car.hh,
spot/twaalgos/rabin2parity.cc, spot/twaalgos/rabin2parity.hh,
tests/Makefile.am, spot/twaalgos/Makefile.am:
content moved to toparity.
* spot/twaalgos/postproc.cc: Use the new version of to_parity in
postprocessor::run.
* spot/twaalgos/toparity.cc, spot/twaalgos/toparity.hh: Add the
content of rabin2parity and car.
* tests/python/car.py, tests/python/toparity.py: Moved all tests
from car.py to toparity.py.
* tests/python/except.py: Change iar() to iar_old().
2020-03-24 15:41:02 +01:00
Florian Renkin
dddc7920e4 Add several options to CAR
* spot/twa/acc.hh: Remove useless comment.
* spot/twaalgos/car.cc: Rewrite the implementation to try
  multiple algorithms and choose the best, add the possibility
  to force the order of the colors/pairs in LAR and use
  propagate_marks_here.
* spot/twaalgos/car.hh, tests/python/car.py: Create a new system of
  options for CAR.
* spot/twaalgos/degen.cc, spot/twaalgos/degen.hh: Add the possibility
  to forbid some marks in is_partially_degeneralizable.
2020-03-24 15:41:02 +01:00
Alexandre Duret-Lutz
b5d688dc97 stutter: fix sl, sl2 to never accept on added self-loop
Fixes #401, reported by Victor Khomenko.

* spot/twaalgos/stutter.cc (sl, sl2): If {} is accepting, upgrade the
acceptance condition.
* tests/core/stutter-tgba.test, tests/python/stutter.py: Add test cases.
2020-03-12 21:54:13 +01:00
Alexandre Duret-Lutz
150f815c87 sccinfo: fix generation of self-loop accepting runs
Reported by Juraj Major.

* spot/twaalgos/sccinfo.cc (scc_info::get_accepting_run): Do not
assume TRACK_STATES is enabled.
* tests/core/autcross5.test: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the bug.
2020-03-12 17:06:03 +01:00
Alexandre Duret-Lutz
124de77925 autfilt: fix -u
Fixes #399.

* bin/autfilt.cc: Fix it.
* tests/core/isomorph.test: Add test case.
* NEWS: Mention the issue.
2020-03-11 23:05:15 +01:00