Commit graph

289 commits

Author SHA1 Message Date
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
Alexandre Duret-Lutz
ef106e2860 remove_alternation: fix serious typo
Fixes #382.

* spot/twaalgos/alternation.cc: Here.
* tests/python/alternation.ipynb: Add test case.
* NEWS: Mention it.
2019-03-22 22:16:02 +01:00
Alexandre Duret-Lutz
510a18b156 acc: introduce top_conjuncts() and top_disjuncts()
* spot/twa/acc.cc, spot/twa/acc.hh: Add the new functions.
* python/spot/impl.i: Add bindings.
* tests/python/acc_cond.ipynb: Add tests.
* NEWS: Mention it.
2019-03-22 13:50:05 +01:00
Alexandre Duret-Lutz
af67c04a67 genem: minor simplifications
* tests/python/genem.py: Use SPOT_ON_ACC explicitely.
* spot/twaalgos/genem.cc: Do not keep track of states.  Don't
check that the clauses of the disjuncts are Fin-less: they aren't
(this was discovered while discussing with Jan and Fanda).
2019-03-19 17:26:14 +01:00
Alexandre Duret-Lutz
a2d940ab74 * tests/python/twagraph-internals.ipynb: Fix a typo. 2019-02-27 10:46:36 +01:00
Alexandre Duret-Lutz
8959eabad6 simulation: try pulling marks instead of pushing them for sbacc input
Suggested by František Blahoudek.

* spot/twaalgos/simulation.cc: When doing forward simulation with
state-based acceptance as input but transition-based acceptance as
output, pull acceptance marks on incoming edges instead of pushing
them to outgoing edges.
* tests/core/dra2dba.test, tests/core/exclusive-tgba.test,
tests/core/ltlcrossce.test, tests/core/satmin3.test,
tests/core/sim3.test, tests/python/satmin.ipynb: Adjust test cases.
* NEWS: Mention the change.
2019-02-27 10:46:20 +01:00
Alexandre Duret-Lutz
eb02db85da python: improve kripke_graph bindings
Related to issue #376.

* spot/kripke/kripkegraph.hh: Avoid indirect type definitions for the
benefit of Swig.
* python/spot/impl.i: Add bindings for iterators over kripke_graph
states and edges.
* tests/python/kripke.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Update.
2019-02-21 22:02:31 +01:00
Alexandre Duret-Lutz
c25a67b00d polish previous two patches
* NEWS: Update.
* spot/twaalgos/genem.cc, spot/twaalgos/genem.hh, spot/twa/twa.cc:
Update copyright years.
* spot/twa/twa.hh: Update Doxygen documentation.
* spot/twaalgos/sccinfo.cc, spot/twaalgos/sccinfo.hh: Simplify data
structures, and fix failure of get_accepting_run() to compute
accepting runs in SCC that are accepting due to the self-loop
optimization of scc_info.
* tests/python/highlighting.ipynb: Add three test cases.
2019-02-21 15:36:19 +01:00
Clément Gillard
51ca5ecdb1 genem: Implement accepting cycle search
Implement an accepting run search in spot::sccinfo, use it with the
generic emptiness check.

* spot/twaalgos/sccinfo.cc, spot/twaalgos/sccinfo.hh: Here.
* spot/twaalgos/genem.cc, spot/twaalgos/genem.hh: Use it.
* tests/python/genem.py: Test it.
2019-02-14 16:25:25 +01:00
Clément Gillard
4ecd066c0e Several typos
* HACKING: Missing "to", extraneous 's'.
* spot/misc/timer.hh: Extraneous space.
* spot/twa/acc.hh: Extraneous 's', typos.
* spot/twaalgos/genem.hh: Typo.
* spot/twaalgos/sccinfo.cc: Fix indentation.
* spot/twaalgos/sccinfo.hh: Missing 's'.
* tests/python/acc_cond.ipynb: Extraneous 'e', missing comma.
* tests/python/decompose.ipynb: Extraneous 't'.
* tests/python/ltsmin-dve.ipynb: Extraneous verb.
2019-02-14 16:25:13 +01:00
Alexandre Duret-Lutz
f26dd904ff python: better support for explicit Kripke
Part of issue #376, reported by Hashim Ali.

* python/spot/impl.i: Add bindings for kripke_graph.
* python/spot/__init__.py (automaton): Add a want_kripke option.
* spot/kripke/kripkegraph.hh: Honnor the "state-names" property
when displaying states.
* spot/twaalgos/hoa.cc: Preserve names of Kripke states.
* tests/python/ltsmin-dve.ipynb: Illustrate all the above.
* NEWS: Mention those changes.
* THANKS: Add Hashim.
2019-02-13 17:47:53 +01:00
Alexandre Duret-Lutz
3908cc1bca python: improve bdd_dict bindings
Fixes #372.

* python/spot/impl.i: Refactor the handling of exceptions using a
Lippincott function.  Map out_of_range to IndexError.  Add
PyObject* version for bdd_dict's register and unregister functions
so we can use Python objects as well.
* tests/python/bdddict.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the changes.
2019-01-14 16:42:30 +01:00
Alexandre Duret-Lutz
98c8725d0c print_dot_psl: fix numbering of commutative operands
* spot/tl/dot.cc: Here.
* tests/python/formulas.ipynb: Add test case.
* NEWS: Mention the bug.
2018-12-17 17:09:56 +01:00
Alexandre Duret-Lutz
dc1f713391 * tests/python/stutter-inv.ipynb: Add link to on-line translator. 2018-12-13 11:22:35 +01:00
Alexandre Duret-Lutz
fd32ab5dd7 fix is_generalized_rabin and is_generalized_streett
* spot/twa/acc.cc: Recoginize the single-pair case.
* python/spot/impl.i: Return the vector instead of taking it
by reference.
* tests/python/setacc.py: Add test cases.
* NEWS: Mention those changes.
2018-11-08 11:35:15 +01:00
Alexandre Duret-Lutz
60296317c7 python: more conventional __repr__ for several types
* NEWS: Mention the change.
* python/spot/__init__.py: Add _repr_latex_ for twa_word, and
remove __repr__ and __str__ for atomic_prop_set.
* python/spot/impl.i: Implement __repr__ and __str__ for
atomic_prop_set.  Fix __repr__ for trival, acc_code, acc_cond,
mark_t.  Remove __repr__ for twa_run and twa_word.
* tests/python/acc_cond.ipynb, tests/python/accparse.ipynb,
tests/python/atva16-fig2a.ipynb, tests/python/automata.ipynb,
tests/python/bdditer.py, tests/python/contains.ipynb,
tests/python/gen.ipynb, tests/python/highlighting.ipynb,
tests/python/ltlsimple.py, tests/python/ltsmin-dve.ipynb,
tests/python/product.ipynb, tests/python/relabel.py,
tests/python/satmin.ipynb tests/python/stutter-inv.ipynb,
tests/python/word.ipynb: Adjust test cases.
* tests/python/formulas.ipynb: Add test for atomic_prop_set.
2018-11-03 07:53:26 +01:00
Alexandre Duret-Lutz
c3b7a691e4 python: add __repr__ for rs_pair
* spot/twa/acc.hh: Hide default constructors, so that we can have
keyword arguments on the main constructor.
* python/spot/impl.i: Add __repr__.
* tests/python/setacc.py: Test it.
2018-11-02 11:10:11 +01:00
Alexandre Duret-Lutz
5bb9c87d4c python: fix return of is_rabin_like() and is_streett_like()
* python/spot/impl.i: Fix instantiation of vector_rs_pairs.
* tests/python/setacc.py: Add test cases.
* NEWS: Mention the bugs.
2018-10-31 19:44:19 +01:00