Commit graph

842 commits

Author SHA1 Message Date
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
Alexandre Duret-Lutz
c3d7e942d3 ltlfilt, autfilt: add support for --nth
* bin/autfilt.cc, bin/ltlfilt.cc: Implement it.
* NEWS: Mention it.
* tests/core/genaut.test, tests/core/genltl.test: Add test cases.
2020-03-11 11:42:31 +01:00
Alexandre Duret-Lutz
4e99518da7 ltlcross: do not use remove_fin anymore
* bin/ltlcross.cc: Since is_empty() now works with arbitrary
acceptance conditions, calling remove_fin() is not necessary anymore.
* tests/core/ltlcrossce.test: Adjust.
* NEWS: Mention the change.
2020-03-09 17:51:44 +01:00
Alexandre Duret-Lutz
addaf7f5b0 ltlcross: detect write errors for --save-bogus, --grind, etc
* bin/ltlcross.cc: Explicitly close those file to check for
error conditions.
* tests/core/full.test: Add one test.
2020-03-08 09:15:06 +01:00
Alexandre Duret-Lutz
3805b63e24 ltlcross: add option --save-inclusion-products
* NEWS: Mention it.
* bin/ltlcross.cc: Implement it.
* tests/core/ltlcross3.test: Test it.
2020-03-08 09:15:06 +01:00
Alexandre Duret-Lutz
d8a0f307eb product: fix handling of operand with false acceptance
* NEWS: Mention the issue.
* spot/twaalgos/product.cc: Fix it.
* tests/python/prodexpt.py: Test it.
2020-03-08 09:15:06 +01:00
Alexandre Duret-Lutz
7f0ef7ad59 genem: improve the worst case
* spot/twaalgos/genem.cc, spot/twaalgos/genem.hh: Improve the worst
case by not recurring twice into each disjunct individually.  Keep
the previous two implementation available and add a function
generic_emptiness_check_select_version() so we can benchmark the
difference.
* tests/python/genem.py: Test the three versions.
2020-03-06 12:38:20 +01:00
Florian Renkin
6f3208a783 CAR: Correct the value of the max color of the acceptance condition
* spot/twaalgos/car.cc: Update the max_color in apply_to_Buchi.
* tests/python/car.py: Add some tests that showed this issue.
2020-02-26 15:40:52 +01:00
Florian Renkin
a62241376f Add mores cases in car.py
* tests/python/car.py: Add more combinaisons of options
when testing CAR.
2020-02-26 15:40:52 +01:00
Florian Renkin
96531f29f2 CAR: new algorithm for paritizing
* NEWS: Mention it.
* spot/twaalgos/car.cc, spot/twaalgos/car.hh, tests/python/car.py:
New files.
* spot/twaalgos/Makefile.am, tests/Makefile.am: Add them.
* python/spot/impl.i: Include CAR.
* spot/twa/acc.cc, spot/twa/acc.hh, spot/twa/twagraph.cc,
spot/twa/twagraph.hh: Add supporting methods.
2020-02-24 15:05:40 +01:00
Alexandre Duret-Lutz
8a4a4b9fff simplify_acceptance: fix erroneous simplification
Reported by Florian Renkin.

* spot/twaalgos/cleanacc.cc: Do not rewrite
...Fin(0)&(Fin(1)|(Fin(3)&Inf(4)))... as Fin(0)&f when it appears that
{1,3} cannot receive {0}, because {1} is used elsewhere in the
acceptance.
* tests/python/simplacc.py: Add test case.
2020-02-24 12:17:07 +01:00
Alexandre Duret-Lutz
5afa528df0 pdegen: fix another original-states related issue
* spot/twaalgos/degen.cc (keep_bottommost_copies): Fix intialisation
of bottommost_occurence.
* tests/python/pdegen.py: Add test case sent by Florian Renkin.
2020-02-16 20:02:48 +01:00
Alexandre Duret-Lutz
10f40041b1 pdegen: fix the place with original-states are composed
doing it too early breaks the "redirect all-accepting transitions"
optimization

* spot/twaalgos/degen.cc: move the original-states composition
code.
* tests/python/pdegen.py: Add test-case from Florian Renkin.
2020-02-16 16:38:31 +01:00
Alexandre Duret-Lutz
5b7961257d * tests/run.in: reset some envvars to avoid spurious failures. 2020-02-16 16:38:17 +01:00
Alexandre Duret-Lutz
b5e464e05a autfilt add support for --partial-degeneralize
* bin/autfilt.cc: Add a --partial-degeneralize option.
* NEWS: Mention it.
* spot/twaalgos/degen.cc: Do not restrict partial_degeneralize() to
deterministic automata.
* spot/twaalgos/degen.hh: Adjust documentation.
* tests/core/pdegen.test: New test case.
* tests/Makefile.am: Add it.
* tests/python/pdegen.py: Adjust.
2020-02-15 10:31:28 +01:00
Alexandre Duret-Lutz
bf42b19eff fix is_generalized_rabin() and is_generalized_streett()
* spot/twa/acc.cc: Fix detection of single-pairs gen-Rabin and
gen-Streett.
* tests/core/randaut.test: Add test case.
* NEWS: Mention this issue.
2020-02-15 10:05:27 +01:00
Alexandre Duret-Lutz
dd8c00fff0 partial_degeneralize: force purge_unreachable in some corner case
* spot/twaalgos/degen.cc: If an all-accepting transition has been
redirected, we need to force purge_unreachable_state() to be called,
otherwise we may have unreachable states.
* tests/python/pdegen.py: Add test case.
2020-02-10 14:08:05 +01:00
Alexandre Duret-Lutz
443f638b9c relabel: do not create automata with false labels
* spot/twaalgos/relabel.cc: Remove false transitions if
some of the propositions are equivalent to true or false.
* NEWS: Mention the bug.
* tests/core/ltl2tgba2.test: Test it.
2020-02-10 12:05:36 +01:00
Alexandre Duret-Lutz
09bb61db33 _postproc_translate_options: fix syntax error
* python/spot/__init__.py: Here.
* tests/python/except.py: Add test.
* NEWS: Mention the issue.
2020-02-10 11:37:58 +01:00
Alexandre Duret-Lutz
71f1f2fb96 partial_degeneralize: handle original-state correctly
Reported by Florian Renkin

* spot/twaalgos/degen.cc (partial_degeneralize): Update
original-state when partial_degeneralize is executed more
than once in a loop.
* tests/python/pdegen.py: Add test case.
2020-02-07 12:27:53 +01:00
Alexandre Duret-Lutz
febbe5c2e3 rabin_to_buchi_if_realizable: new function
* spot/twaalgos/remfin.cc, spot/twaalgos/remfin.hh: Implement it.
* tests/python/tra2tba.py: Test it.
* NEWS: Mention it.
2020-02-05 17:44:45 +01:00
Alexandre Duret-Lutz
bf4a0ccffd partial_degeneralize: add a version that takes no "todegen" argument
* spot/twaalgos/degen.cc,
spot/twaalgos/degen.hh (is_partially_degeneralizable): New function.
(partial_degeneralize): New version without todegen argument.
* tests/python/pdegen.py: Add test cases.
2020-02-04 17:31:12 +01:00
Alexandre Duret-Lutz
8df616ee0d partial_degeneralization: generalize to terms that contain todegen
* spot/twaalgos/degen.cc: Implement this.
* tests/python/pdegen.py: Add tests.
2020-02-04 13:47:44 +01:00
Alexandre Duret-Lutz
b733d486be fix degeneralize_tba after accepting transition
* spot/twaalgos/degen.cc (degeneralize_tba): Here.
* tests/python/pdegen.py, tests/python/simstate.py: Adjust expected
values.
* NEWS: Mention the bug.
2020-02-03 15:38:51 +01:00
Alexandre Duret-Lutz
f9e75de647 partial_degeneralize: a support for disjunction of Fin
* spot/twaalgos/degen.cc, spot/twaalgos/degen.hh: Implement this.
Also throw a runtime error in case were todegen does not match any
subformula.
* tests/python/pdegen.py: Add tests.
2020-02-03 11:08:20 +01:00
Alexandre Duret-Lutz
f1008c156b improve partial_degeneralize() on several cases
On these 4 cases, added to pdegen.py, and supplied by Florian Renkin,
partial_degeneralize() is now at least as good as degeneralize_tba(),
and sometimes better.  This is achieved as follows: (1) a
propagate_marks procedure is introduced to propagate marks as far as
possible on the automaton (e.g., common outgoing marks can be push
onto the incoming transitions and vice-versa), (2) the
degeneralization order is compute dynamically, and (3) whenever and
fully-accepting transition is taken in the original automaton, the
destination level is chosen to be the highest existing level.

* spot/twaalgos/degen.cc,
spot/twaalgos/degen.hh (propagate_marks_vector, propagate_marks_here):
New functions.
(partial_degeneralize): Improve, as described above.
* tests/python/pdegen.py: Add test cases.
2020-02-03 09:52:54 +01:00
Alexandre Duret-Lutz
50c0f880dc Inf(i)|Inf(j) -> Inf(k) and Fin(i)&Fin(j) -> Fin(k)
Implement those rules in simplify_acceptance_here().

* NEWS: Mention the change.
* spot/twa/acc.cc,
spot/twa/acc.hh (acc_cond::acc_code::used_once_sets): New method.
* spot/twaalgos/cleanacc.cc, spot/twaalgos/cleanacc.hh:
Implement the above rule.
* tests/core/remfin.test: Adjust expected results.
* tests/python/simplacc.py: New file.
* tests/Makefile.am: Add it.
2020-01-28 09:37:28 +01:00
Alexandre Duret-Lutz
5dc6da0b20 ipnbdoctest: attempt to restart when the kernel dies
* tests/python/ipnbdoctest.py: Catch kernel deaths, wait a random
number of seconds, and try again up to three times.
2020-01-04 18:05:45 +01:00
Alexandre Duret-Lutz
9d70eeef97 ltlcross: display short names when supplied
Suggested by František Blahoudek.

* bin/ltlcross.cc: Implement this.
* NEWS, doc/org/ltlcross.org: Document it.
* tests/core/ltlcross4.test: Test it.
2020-01-04 15:54:18 +01:00
Alexandre Duret-Lutz
5e6de9dad4 ipnbdoctest: attempt to deal with buildfarm timeouts
* tests/python/ipnbdoctest.py: Use shorter timeouts, and flush the
shell messages without expecting them.
2020-01-03 15:22:05 +01:00
Alexandre Duret-Lutz
d1ef380d32 twagraph: merge_edge() can determinize automata
Reported by František Blahoudek.

* spot/twa/twagraph.cc: Reset prop_universal() if edges are merged in
a non-deterministic automaton.
* tests/core/det.test: Add test case.
* NEWS: Mention the issue.
2019-12-31 22:34:39 +01:00
Alexandre Duret-Lutz
cfe3ed707a fix ltl2tgba -B not always returning Inf(0)
Reported by František Blahoudek.

* spot/twaalgos/postproc.cc: Turn "t" into "Inf(0)" for BA.
* tests/core/ltl2tgba.test: Add test case.
* NEWS: Mention the bug.
2019-12-26 23:05:58 +01:00
Alexandre Duret-Lutz
d2ba554507 tmpfile: improve error message
* spot/misc/tmpfile.cc: Display strerror(errno) plus some suggestions
that depend on the error.  Based on a report from Shengping Shaw.
* THANKS: Add reporter.
* tests/core/ltlcross5.test: New file.
* tests/Makefile.am: Add it.
2019-12-15 17:44:54 +01:00
Alexandre Duret-Lutz
bf7ccfe7e6 new partial_degeneralize() algorithm
* spot/twaalgos/degen.hh, spot/twaalgos/degen.cc: Implement it.
* tests/python/pdegen.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the new function.
2019-12-11 17:09:55 +01:00
Alexandre Duret-Lutz
935c412df0 remfin: simplify tra_to_tba using generic emptiness check
* spot/twaalgos/remfin.cc (tra_to_tba): Remove the SCC-emptiness
check that was done by creating a temporary automaton.  Use the
scc_info::check_scc_emptiness() function instead.
* spot/twaalgos/sccinfo.cc,
spot/twaalgos/sccinfo.hh (scc_info::check_scc_emptiness): Mark
this function as const.
(scc_and_mark_filter): Make sure we only combine with a lower filter
of the same type.
* spot/twaalgos/genem.cc: Remove one stray debugging statement.
* tests/python/genem.py: Remove a duplicate test.
2019-12-07 12:51:59 +01:00
Alexandre Duret-Lutz
c36b1588fc remfin: fix tra_to_tba
This fixes a complementation bug reported by Juraj Major and Tereza
Šťastná.

* spot/twaalgos/remfin.cc (is_scc_tba_type): Fix the condition for
handling Fin-alone pairs.
* tests/core/complement.test: Add Juraj & Tereza's test case.
* NEWS: Mention it.
2019-12-05 22:44:15 +01:00
Alexandre Duret-Lutz
e778965730 python: define our own SVG DisplayObject
This is to workaround differences in minidom's pretty-printing that
occurred between Python 3.7 and 3.8.

* python/spot/jupyter.py (SVG): New class.
* python/spot/__init__.py: Use it.
* tests/python/_altscc.ipynb, tests/python/alternation.ipynb,
tests/python/automata.ipynb, tests/python/formulas.ipynb,
tests/python/gen.ipynb, tests/python/highlighting.ipynb,
tests/python/ltsmin-dve.ipynb, tests/python/ltsmin-pml.ipynb,
tests/python/product.ipynb, tests/python/randaut.ipynb,
tests/python/testingaut.ipynb, tests/python/twagraph-internals.ipynb,
tests/python/word.ipynb: Adjust.
2019-12-05 08:01:07 +01:00
Alexandre Duret-Lutz
44df3c0837 add a --check=stutter-sensitive-example option
* spot/twaalgos/stutter.cc,
spot/twaalgos/stutter.hh (check_stutter_invariance): Add a
find_counterexamples argument.
* spot/twaalgos/hoa.cc: Output accepted-word and rejected-word examples.
* bin/common_aoutput.cc: Handle --check=stutter-sensitive-example.
* NEWS: Mention it.
* tests/core/stutter-tgba.test: Test it.
* doc/org/concepts.org, doc/org/hoa.org: Document accepted-word and
rejected-word named properties.
* bin/man/spot-x.x: Mention that --check=stutter-sensitive-example
ignores SPOT_STUTTER_CHECK.
2019-12-05 08:00:47 +01:00
Alexandre Duret-Lutz
cc9659bca0 acc: improve diagnostics for algorithms that use too many colors
* spot/twa/acc.hh (acc_cond::mark_t): Diagnose mark_t with set numbers
that are too larges.
* tests/python/except.py: Adjust.
* tests/core/acc.cc: Remove most of asserts, as those can be disabled,
and adjust expected exception.
2019-10-18 17:01:07 +02:00
Etienne Renault
896925ae1c core: random_shuffle is deprecated and not portable
* tests/core/parity.cc: Here.
2019-10-17 16:45:25 +02:00
Alexandre Duret-Lutz
f0b52ce218 determinize: various micro optimizations
* spot/twaalgos/determinize.cc: Implement various micro
optimizations.  Use robin-hood hashing in a few places.
* spot/priv/robin_hood.hh: New file.
* spot/priv/Makefile.am: Add it.
* tests/sanity/80columns.test, tests/sanity/includes.test,
tests/sanity/style.test: Adjust to skip robin_hood.hh.
2019-10-17 09:45:43 +02:00
Alexandre Duret-Lutz
566a43dd17 improve readability of parity(false, true, 5)
* spot/twa/acc.hh: Introduce parity_min_odd(n) and friends.
* spot/twaalgos/determinize.cc, spot/twaalgos/rabin2parity.cc,
spot/twaalgos/toparity.cc: Use them.
* tests/python/parity.py: Call each function exhaustively.
* NEWS: Mention the new functions.
2019-10-08 15:18:48 +02:00
Alexandre Duret-Lutz
b2539e8399 improve to_parity() LAR implementation using SCCs
* spot/twaalgos/toparity.cc (lar_generator): Use scc_info to reset
permutations of edges leaving SCCs.
* tests/python/toparity.py: Add a test case.
2019-10-08 11:27:22 +02:00
Alexandre Duret-Lutz
fdd2eec331 Merge branch 'master' into next 2019-09-27 20:50:43 +02:00
Alexandre Duret-Lutz
34cf0491eb * tests/python/_product_weak.ipynb: Work around jupyter timeouts. 2019-09-27 20:43:07 +02:00
Alexandre Duret-Lutz
ce93cdca21 aiger: simplify output code, and fix some function call order
* spot/twaalgos/aiger.cc: Simplify some bit operatitions.  Force the
ordering of operations in aig_and, that was causing a test case to
fail on ARM, and greatly simplify the code and data structures used in
remove_unused().
* tests/core/ltlsynt.test: Adjust expected output.
2019-09-26 15:19:57 +02:00
Alexandre Duret-Lutz
4c0e7bf865 aiger: simplify output code, and fix some function call order
* spot/twaalgos/aiger.cc: Simplify some bit operatitions.  Force the
ordering of operations in aig_and, that was causing a test case to
fail on ARM, and greatly simplify the code and data structures used in
remove_unused().
* tests/core/ltlsynt.test: Adjust expected output.
2019-09-26 15:18:40 +02:00
Alexandre Duret-Lutz
4378745458 from-ltlf: never output strong_X
* spot/tl/ltlf.cc: Here.
* tests/core/ltlfilt.test: Adjust test case.
2019-09-24 10:47:23 +02:00
Alexandre Duret-Lutz
cfd888076c ltl2tgba, ltldo: add a --negate option
Suggested by Victor Khomenko.

* bin/ltl2tgba.cc, bin/ltldo.cc: Implement it.
* doc/org/hierarchy.org: Use it.
* tests/core/ltldo2.test: Test it.
* bin/common_output.cc: Typo.
* NEWS: Mention the new option.
2019-09-24 10:03:35 +02:00
Alexandre Duret-Lutz
7f21d3ff29 ltl2tgba, ltldo: add a --negate option
Suggested by Victor Khomenko.

* bin/ltl2tgba.cc, bin/ltldo.cc: Implement it.
* doc/org/hierarchy.org: Use it.
* tests/core/ltldo2.test: Test it.
* bin/common_output.cc: Typo.
* NEWS: Mention the new option.
2019-09-23 17:02:06 +02:00