Commit graph

306 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
be389c5c25 introduce op::strong_X
This was prompted by reports by Andrew Wells and Yong Li.

* NEWS, doc/tl/tl.tex: Document the changes.
* THANKS: Add Andrew.
* bin/ltlfilt.cc: Match --ltl before --from-ltlf if needed.
* spot/parsetl/parsedecl.hh, spot/parsetl/parsetl.yy,
spot/parsetl/scantl.ll: Parse X[!].
* spot/tl/formula.cc, spot/tl/formula.hh: Declare the new operator.
* spot/tl/ltlf.cc: Adjust to handle op::X and op::strong_X correctly.
* spot/tl/dot.cc, spot/tl/mark.cc, spot/tl/mutation.cc,
spot/tl/print.cc, spot/tl/simplify.cc, spot/tl/snf.cc,
spot/tl/unabbrev.cc, spot/twa/formula2bdd.cc,
spot/twaalgos/ltl2taa.cc, spot/twaalgos/ltl2tgba_fm.cc,
tests/core/ltlgrind.test, tests/core/rand.test,
tests/core/sugar.test, tests/python/randltl.ipynb: Adjust.
* tests/core/ltlfilt.test, tests/core/sugar.test,
tests/core/utf8.test: More tests.
2019-09-23 17:01:28 +02:00
Alexandre Duret-Lutz
e52aa8f9eb * tests/python/sum.py: Simplify code. 2019-07-30 16:26:58 +02:00
Alexandre Duret-Lutz
8ec6ea838d twa_graph: fix precondition on set_init_state
Fixes #391.

* spot/twa/twagraph.hh: Here.
* tests/core/dualize.test, tests/python/except.py: New tests.
* NEWS: Mention the bug.
2019-07-30 15:35:12 +02:00
Alexandre Duret-Lutz
1d7ad07c83 product: fix handling of output_aborter
* spot/twaalgos/product.cc: The res pointer should be
passed by reference since we reset it to nullptr when
output_aborter says "too large".
* python/spot/impl.i: Add binding for powerset.hh,
so we can use output_aborter in Python.
* tests/python/prodexpt.py: Test it.
2019-07-09 16:09:20 +02:00
Alexandre Duret-Lutz
0d9cc29b46 tl: eight new simplification rules
* NEWS, doc/tl/tl.tex: Document the rules.
* spot/tl/simplify.cc: Implement them.
* tests/core/reduccmp.test: Test them.
* tests/core/det.test, tests/core/ltl2tgba2.test,
tests/python/stutter-inv.ipynb, tests/core/385.test: Adjust.
2019-07-09 16:09:15 +02:00
Alexandre Duret-Lutz
822fe77891 python: cleanup with autopep8
* tests/python/341.py, tests/python/alarm.py, tests/python/bdddict.py,
tests/python/bddnqueen.py, tests/python/bugdet.py,
tests/python/dualize.py, tests/python/except.py, tests/python/gen.py,
tests/python/genem.py, tests/python/implies.py,
tests/python/interdep.py, tests/python/ipnbdoctest.py,
tests/python/kripke.py, tests/python/ltl2tgba.py,
tests/python/ltlf.py, tests/python/ltlparse.py,
tests/python/ltlsimple.py, tests/python/relabel.py,
tests/python/rs_like.py, tests/python/sccsplit.py,
tests/python/semidet.py, tests/python/setacc.py,
tests/python/setxor.py, tests/python/split.py,
tests/python/streett_totgba.py, tests/python/stutter.py,
tests/python/sum.py, tests/python/toparity.py, tests/python/toweak.py,
tests/python/trival.py, python/spot/__init__.py, python/spot/aux.py,
python/spot/jupyter.py: Reformat with autopep8.

fixup! * spot/tl/simplify.cc: Fix typos in tracing code.
2019-07-05 21:22:29 +02:00
Alexandre Duret-Lutz
f3e57901a4 simulation: improve merging of transiant-SCCs
* spot/twaalgos/simulation.cc: Code this.
* tests/core/det.test, tests/core/dra2dba.test,
tests/core/satmin.test, tests/core/sim3.test,
tests/python/decompose.ipynb, tests/python/dualize.py: Adjust test
cases.
* NEWS: Mention the optimization.
2019-06-20 13:25:26 +02:00
Alexandre Duret-Lutz
c66b3d88d0 toparity: revert symmetry-based optimization of LAR
Fixes #390.

* spot/twaalgos/toparity.cc: Revert the relevant part of 516e9536.
* tests/python/toparity.py: Add test case.
* NEWS: Mention the issue.
2019-06-18 19:12:42 +02:00
Alexandre Duret-Lutz
ed52f3c48c re-enable tests incorrectly disabled
These were disabled by mistake in f6575d2ec.

* tests/python/parity.py: Uncomment test cases.
2019-06-18 19:12:42 +02:00
Alexandre Duret-Lutz
8df5f5137e gfguarantee: fix #357 again
The previous patch triggered this issue again, failing
core/ltl2tgba2.test.

* spot/twaalgos/gfguarantee.cc: Separate the replaying of history from
the modification of the automaton.
* NEWS: Mention the bug.
* tests/python/twagraph-internals.ipynb, tests/python/automata.ipynb:
Adjust.
2019-06-18 19:12:36 +02:00
Alexandre Duret-Lutz
da5d23f0a2 simplify: GF(f)=GF(dnf(f)) FG(f)=FG(cnf(f))
These rules come from Delag's paper, and help some cases
in issue #385.

* spot/tl/simplify.cc: Implement the simplification.
* doc/tl/tl.tex, NEWS: Document it.
* tests/core/385.test: New file.
* tests/Makefile.am: Add it.
* tests/core/reduccmp.test: More tests.
* tests/core/ltl2tgba2.test: Adjust one improved case.
* tests/python/automata.ipynb, tests/python/twagraph-internals.ipynb:
Adjust expected output, as the cnf/dnf reorder some subformulas.
2019-06-18 10:03:56 +02:00
Alexandre Duret-Lutz
eb7b68ad58 use reduce_parity in translator and posprocessor
* spot/twaalgos/postproc.cc, spot/twaalgos/translate.cc: Here.
* tests/core/genltl.test, tests/core/parity2.test,
tests/core/sccsimpl.test, tests/python/twagraph-internals.ipynb:
Adjust test cases.
* NEWS: Mention it.
2019-06-12 22:05:04 +02:00
Alexandre Duret-Lutz
ebfa3a377a parity: introduce reduce_parity()
* spot/twaalgos/parity.cc, spot/twaalgos/parity.hh: Here.
* tests/core/parity.cc: Add test case.
* tests/python/parity.ipynb, NEWS: More documentation.
2019-06-12 22:05:02 +02:00
Alexandre Duret-Lutz
f6575d2ec5 improve cleanup_parity() and colorize_parity()
Fixes #384.

* spot/twaalgos/parity.cc: Here.
* tests/core/parity2.test, tests/python/highlighting.ipynb,
tests/python/parity.py: Adjust test cases.
* tests/python/parity.ipynb: Improve the presentation.
* NEWS: Mention the change.
2019-06-11 21:24:55 +02:00
Alexandre Duret-Lutz
58389bdb80 tl: extend F[n:m] and G[n:m] to the case of m=$
Suggested by Victor Khomenko.

* spot/tl/formula.cc, spot/tl/formula.hh, spot/parsetl/parsetl.yy:
Implement this.
* NEWS, doc/tl/tl.tex: Document it.
* tests/core/sugar.test, tests/python/ltlparse.py: Add some tests.
2019-06-02 14:39:21 +02:00
Alexandre Duret-Lutz
74786324f4 remprop: reset no-terminal property
Reported by Yong Li.

* spot/twaalgos/remprop.cc: Here.
* tests/python/removeap.py: New test case.
* tests/Makefile.am: Add it.
* NEWS: Document the issue.
* THANKS: Add Yong Li.
2019-06-02 09:00:08 +02:00
Alexandre Duret-Lutz
03b8db0fed tests: add missing copyright blobs
* tests/python/remfin.py, tests/python/tra2tba.py: Here.
2019-06-02 08:33:13 +02:00
Alexandre Duret-Lutz
a85045091b introduce output_aborter, and use it in ltlcross
* spot/twaalgos/alternation.cc, spot/twaalgos/alternation.hh,
spot/twaalgos/complement.cc, spot/twaalgos/complement.hh,
spot/twaalgos/determinize.cc, spot/twaalgos/determinize.hh,
spot/twaalgos/minimize.cc, spot/twaalgos/minimize.hh,
spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh,
spot/twaalgos/powerset.cc, spot/twaalgos/powerset.hh,
spot/twaalgos/product.cc, spot/twaalgos/product.hh: Use an
output_aborter argument to abort if the output is too large.
* bin/ltlcross.cc: Use complement() with an output_aborter
so that ltlcross will not attempt to build complement larger
than 500 states or 5000 edges.  Add --determinize-max-states
and --determinize-max-edges options.
* tests/core/ltlcross3.test, tests/core/ltlcrossce2.test,
tests/core/sccsimpl.test, tests/core/wdba2.test,
tests/python/stutter-inv.ipynb: Adjust test cases.
* NEWS: Document this.
* bin/spot-x.cc: Add documentation for postprocessor's
det-max-states and det-max-edges arguments.
* doc/org/ltlcross.org: Update description.
2019-05-28 14:27:30 +02:00
Alexandre Duret-Lutz
5c3a33f720 test: add missing copyright boilerplate
* tests/python/genem.py: Here.
2019-05-24 23:26:49 +02:00
Alexandre Duret-Lutz
36d20696bf word: introduce use_all_aps()
This allows fixing issue #388 reported by Victor Khomenko.

* spot/twaalgos/word.cc, spot/twaalgos/word.hh (use_all_aps): New
method.
* tests/python/stutter-inv.ipynb: Use it.
* tests/python/stutter.py: New file, with Victor's test case.
* tests/Makefile.am: Add python/stutter.py.
2019-05-24 23:26:43 +02:00
Alexandre Duret-Lutz
066133b829 tl: implement relabel_apply()
* spot/tl/relabel.hh, spot/tl/relabel.cc: Here.
* NEWS: Mention it.
* tests/python/relabel.py: Use it.
2019-05-18 11:22:52 +02:00
Alexandre Duret-Lutz
6fac026454 implement SVA's first_match operator
* NEWS, doc/tl/tl.tex, doc/tl/tl.bib: Document it.
* spot/parsetl/parsetl.yy, spot/parsetl/scantl.ll: Parse it.
* spot/tl/formula.cc, spot/tl/formula.hh, spot/tl/dot.cc,
spot/tl/mutation.cc, spot/tl/print.cc, spot/tl/randomltl.cc,
spot/twaalgos/ltl2tgba_fm.cc: Adjust to support first_match.
* spot/tl/mark.cc, spot/tl/simplify.cc, spot/tl/snf.cc,
spot/tl/unabbrev.cc, spot/twa/formula2bdd.cc,
spot/twaalgos/ltl2taa.cc: Ignore it.
* tests/core/acc_word.test, tests/core/randpsl.test: Add more tests.
* tests/core/rand.test, tests/core/unambig.test,
tests/python/randltl.ipynb: Adjust.
* tests/python/formulas.ipynb: Show first_match.
2019-05-06 15:11:30 +02:00
Alexandre Duret-Lutz
84fa824f7e twa: make sure intersection_run and intersection_word use genem
* spot/twa/twa.cc (accepting_word, intersecting_run,
intersecting_word): Refactor.
* tests/python/contains.ipynb: Adjust.
2019-04-25 21:06:30 +02:00
Alexandre Duret-Lutz
e6c8c09fd5 tests: fix some examples
Reported by František Blahoudek.

* tests/python/parity.ipynb: Fix examples and improve some text.
2019-04-18 14:41:03 +02:00
Alexandre Duret-Lutz
0c8e6a38a8 tests: try to work around some frequent time outs in our checks
* tests/python/ipnbdoctest.py: Augment time limits.
2019-04-14 22:58:25 +02:00
Alexandre Duret-Lutz
0623965b43 genem: improve handling of co-Büchi
* spot/twaalgos/sccinfo.cc, spot/twaalgos/sccinfo.hh: Make sure
scc_and_mark_filter does not install a filter if there is nothing
to filter.
* tests/python/genem.py, spot/twaalgos/genem.cc,
python/spot/impl.i: Adjust.
2019-04-12 23:14:29 +02:00
Alexandre Duret-Lutz
2178684528 sccinfo: rename scc_info(x,opt) into scc_info_with_options(x,opt)
* spot/twaalgos/sccinfo.hh, python/spot/impl.i: Here.  This avoid
ambiguities where options (integer in Python) are interpreted as
initial states.
* tests/python/genem.py: Adjust.
2019-04-11 18:06:00 +02:00
Alexandre Duret-Lutz
55db24e00e scc_info: introduce scc_and_mark_filter
* spot/twaalgos/sccinfo.hh, spot/twaalgos/sccinfo.cc: Here.
* spot/twaalgos/genem.cc: Use it.
* python/spot/impl.i, python/spot/__init__.py: Add bindings.
* tests/python/genem.py: Test it.
* NEWS: Mention it.
2019-03-30 12:09:32 +01:00
Alexandre Duret-Lutz
0d9c81a6d9 acc: extend top_disjuncts and top_conjuncts to acc_cond as well
* spot/twa/acc.hh, spot/twa/acc.cc: Implement the new methods.
* python/spot/impl.i: Add bindings for vectors of acc_cond.
* tests/python/acc_cond.ipynb: Test the two methods.
* NEWS: Adjust.
2019-03-29 11:41:52 +01:00