Commit graph

151 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
43520a3e87 ltlcross, ltldo: add a --relabel option
* bin/common_trans.cc, bin/common_trans.hh: Add the --relabel option.
* bin/ltlcross.cc, bin/ltldo.cc: Implement it.
* doc/org/ltldo.org, NEWS: Document it.
* tests/core/ltl3ba.test: Test it.
2017-01-13 22:12:43 +01:00
Alexandre Duret-Lutz
b0ba6190b7 ltlcross: relabel unsupported atomic propisitions in %s
* bin/ltlcross.cc: Do it.
* bin/common_trans.cc: Adjust documentation.
* tests/core/ltl3ba.test: Test it.
* NEWS: Document it.
2017-01-13 22:12:43 +01:00
Alexandre Duret-Lutz
c9918f6407 minimize_wdba: fix handling of input with useless SCCs
* spot/twaalgos/minimize.cc (minimize_wdba): Diminish the color of
terminal SCCs that are incomplete, as if they had a non-accepting
sink as successor.
* spot/twaalgos/strength.hh, spot/twaalgos/strength.cc
(is_terminal_automaton): Add an option to ignore trivial SCC as we did
before, since it matters for deciding membership to the guarantee
class.
(is_safety_mwdba): Rewrite as ...
(is_safety_automaton): ... generalizating to any acceptance, and
ignoring trivial SCCs.
* bin/ltlfilt.cc, python/ajax/spotcgi.in, spot/tl/hierarchy.cc,
tests/core/ikwiad.cc: Adjust usage of is_terminal_automaton and
is_safety_automaton().
* tests/core/hierarchy.test: Add a problematic formula as test-case.
* NEWS: Mention the bug.
2017-01-12 21:02:56 +01:00
Alexandre Duret-Lutz
7d9ce0d6fc tl: mp_class() and --format=%[vw]h
Tools for deciding the class of a formula.

* spot/tl/hierarchy.cc, spot/tl/hierarchy.hh: New files.
* spot/tl/Makefile.am: Add them.
* bin/common_output.cc, bin/common_output.hh: Implement --format=%h.
* tests/core/hierarchy.test: More tests.
* NEWS: Update.
2017-01-10 22:41:11 +01:00
Alexandre Duret-Lutz
de8a248fb2 ltlfilt: add --recurrence and --persistence
* spot/twaalgos/remfin.cc, spot/twaalgos/remfin.hh
(rabin_to_buchi_maybe): Make this function public.
* bin/ltlfilt.cc: Implement the two options.
* tests/core/hierarchy.test: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the new options.
2017-01-10 16:11:11 +01:00
Alexandre Duret-Lutz
12ecb3febf twagraph: fix purge_dead_states on alternating automata
* tests/core/alternating.test: Run some of the test through
valgrind to exhibit the bug.
* spot/twa/twagraph.cc: Fix it.
2017-01-10 10:29:32 +01:00
Alexandre GBAGUIDI AISSE
ef2355a542 twaalgos: Set 'dicho' algo as default for SAT-based minimization
* python/spot/__init__.py: Handle options.
* spot/twaalgos/dtwasat.cc: Handle options.
* spot/twaalgos/postproc.cc: Handle options.
* spot/twaalgos/postproc.hh: Handle options.
* tests/core/satmin.test: Update tests.
Now use 'sat-minimize=4' to use the naive algo.
* tests/core/satmin2.test: Update tests.
Now use --sat-minimize='naive' to use the naive algo.
* tests/python/satmin.py: Update tests.
Now use 'naive=True' to use the naive algo.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
67e3a4f28e spot: Add 'langmap' option with dichotomy (it helps to choose min val)
* python/spot/__init__.py: Handle 'dicho' option in 'sat_minimize'.
* spot/priv/satcommon.cc: Implement get_number_of_distinct_vals.
* spot/priv/satcommon.hh: Declare get_number_of_distinct_vals.
* spot/twaalgos/dtbasat.cc: Use get_number_of_distinct_vals.
* spot/twaalgos/dtbasat.hh: Change dichotomy function's prototype.
* spot/twaalgos/dtwasat.cc: Use get_number_of_distinct_vals.
* spot/twaalgos/dtwasat.hh: Change dichotomy function's prototype.
Handle options.
* spot/twaalgos/postproc.cc: Handle options.
* spot/twaalgos/postproc.hh: Add dicho_langmap_ var for options.
* tests/core/satmin2.test: Add tests for dichotomy.
* tests/core/satmin.test: Add tests for dichotomy.
* tests/python/satmin.py: Replace 'dichotomy' with 'dicho' option.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
7046a49622 bin/autfilt.cc: Add '--highlight-languages' option
* bin/autfilt.cc: Add that option.
* tests/core/highlightstate.test: Add test.
* NEWS: Update.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
9a204b770f spot: Implement dt*a_sat_minimize_assume(...) methods
* python/spot/__init__.py: Add 'assume' option.
* spot/misc/satsolver.cc: Add function to handle assumptions.
* spot/misc/satsolver.hh: Declare assumption function.
* spot/twaalgos/dtbasat.cc: Implement dtba_sat_minimize_assume.
* spot/twaalgos/dtbasat.hh: Declare it.
* spot/twaalgos/dtwasat.cc: Implement dtwa_sat_minimize_assume and
handle options.
* spot/twaalgos/dtwasat.hh: Declare it.
* spot/twaalgos/postproc.cc: Handle options.
* spot/twaalgos/postproc.hh: Use param_ var for incr and assume.
* tests/core/satmin.test: Add tests for the new function.
* tests/core/satmin2.test: Add tests for the new function.
* tests/python/satmin.py: Add tests for the new function.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
ee17c2dee4 twaalgos: Implement dt*a_sat_minimize_incr(...) functions
* python/spot/__init__.py: Add 'incr' boolean argument.
* spot/twaalgos/dtbasat.cc: Implement dtba_sat_minimize_incr(...).
* spot/twaalgos/dtbasat.hh: Declare it.
* spot/twaalgos/dtwasat.cc: Implement dtwa_sat_minimize_incr(...) and
deal with options.
* spot/twaalgos/dtwasat.hh: Declare it.
* spot/twaalgos/postproc.cc: Add option --sat-minimize=incr.
* spot/twaalgos/postproc.hh: Add incr parameter.
* tests/core/satmin.test: Add tests for incremental version.
Update expected result.
* tests/core/satmin2.test: Add tests for incremental version.
* tests/python/satmin.py: Add tests for incremental version.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
9acd7370b2 twaalgos: Improve data storage in SAT-minimization
* spot/misc/satsolver.hh: Make solver return vector<bool> instead of
vector<int>.
* spot/misc/satsolver.cc: Update code.
* spot/priv/Makefile.am: Add satcommon.*
* spot/priv/satcommon.hh: Declare helper class and factorize some
duplicate code of dt*asat.cc
* spot/priv/satcommon.cc: Implement helper class and factorize some
duplicate code of dt*asat.cc
* spot/twaalgos/dtbasat.cc: Declare helper, implement some functions
in dict struct and update code.
* spot/twaalgos/dtwasat.cc: Declare helper, implement some functions
in dict struct and update code.
* tests/core/readsat.cc: Update tests.
* tests/core/satmin.test: Typo.
* tests/core/satmin2.test: Update an expected result.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
dfd500a559 tests: Improve tests related to SAT-minimization
* tests/core/satmin.test: Delete check for SPOT_SATSOLVER env
variable and add state numbers verification.
* tests/core/satmin2.test: Delete check for SPOT_SATSOLVER
env variable.
* tests/python/satmin.py: Delete check for SPOT_SATSOLVER
env variable.
2017-01-06 19:53:21 +01:00
Alexandre Duret-Lutz
ada8185361 simulation: does not preserve !unambiguous, !semi-deterministic
* spot/twaalgos/simulation.cc: Reset those to maybe.
* tests/core/semidet.test: Add some tests.
2016-12-30 09:58:56 +01:00
Alexandre Duret-Lutz
4b01387817 support for semi-deterministic property
* spot/twa/twa.hh (prop_semi_deterministic): New methods.
* spot/parseaut/parseaut.yy, spot/twaalgos/hoa.cc: Add support for the
semi-deterministic property.
* doc/org/concepts.org, doc/org/hoa.org: Document it.
* spot/twaalgos/isdet.cc,
spot/twaalgos/isdet.hh (is_semi_deterministic): New function.
* bin/autfilt.cc: Add --is-semi-deterministic.
* bin/common_aoutput.cc: Add --check=semi-deterministic.
* tests/core/semidet.test: New file.
* tests/Makefile.am: Add it.
* tests/core/parseaut.test, tests/core/readsave.test: Adjust.
2016-12-29 16:37:43 +01:00
Alexandre Duret-Lutz
db5d9780f1 twa_graph: support alternation in remove_dead/unreachable_states
* spot/graph/graph.hh (internal::univ_dest_mapper): New helper class.
* spot/twa/twagraph.cc (merge_univ_dests): Simplify using
univ_dest_mapper.
(purge_unreachable_states, purge_dead_states): Add support for
alternation.
* tests/core/alternating.test: More tests.
2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
096c78a3f8 autfilt: handle alternation with --equivalent-to and friends
* bin/autfilt.cc (ensure_deterministic): Remove alternation on demand.
(process_automaton): Prefer twa::intersects() over
product()/is_empty().
* spot/twa/twa.cc (remove_fin_maybe): Also remove alternation.
* tests/core/alternating.test: More tests.
2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
77ce4170dc autfilt: add --is-alternating
* bin/autfilt.cc: Implement --is-alternating.
* tests/core/complete.test: Test it.
* NEWS: Mention it.
2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
6a11e149b7 autfilt: add --is-very-weak
* bin/autfilt.cc: Implement --is-very-weak.
* tests/core/strength.test: Test it.
* NEWS: Mention it.
2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
12f6c8cf10 twa_graph: add a merge_univ_dests() method
and call it after parsing

* spot/twa/twagraph.cc, spot/twa/twagraph.hh
(twa_graph::merge_univ_dests): New method.
* spot/parseaut/parseaut.yy: Call it.
* spot/twaalgos/dot.cc: Improve output, now that
several edges can use the same universal destination.
* tests/core/alternating.test, tests/core/complete.test,
tests/core/parseaut.test, tests/python/_altscc.ipynb,
tests/python/alternating.py, tests/python/alternation.ipynb: Adjust
test case.
* doc/org/tut24.org: Adjust example.
2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
f5b261d80e remfin: call remove_alternation if needed
* spot/twaalgos/remfin.cc: Here.
* tests/core/alternating.test: Add a test case.
2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
071d819c49 complete: add support for alternating autamata
* spot/twaalgos/complete.cc: Do not use the initial
state as a sink if it is universal.
* tests/core/complete.test: Add a test case.
2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
f1b8d5f1d4 postproc: preliminary support for alternating automata
* spot/twaalgos/postproc.cc: Call remove_alternation().
* tests/core/alternating.test: Additional test.
2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
87c9d6f039 ltlcross: add support for alternating automata
* bin/ltlcross.cc: Add an alternation-removal pass, and
adjust CSV output.
* doc/org/ltlcross.org: Update.
* tests/core/ltl3dra.test, tests/core/ltl3ba.test: Add more tests.
* tests/Makefile.am: Add tests/core/ltl3ba.test.
* NEWS: Mention it.
2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
582d455c23 twa: add support for very-weak property
* spot/twa/twa.hh: Implement the property.
* spot/parseaut/parseaut.yy, spot/twaalgos/hoa.cc: Add input
and output for it.
* spot/twaalgos/strength.cc,
spot/twaalgos/strength.hh (is_very_weak_automaton): New function.
* tests/core/alternating.test: Add a test for --check=strength
on an alternating automaton.
* tests/core/strength.test, tests/core/parseaut.test: Adjust expected
output.
* NEWS, doc/org/hoa.org, doc/org/concepts.org: Document it.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
a4ce999402 sccinfo: adjust to work with alternating automata
* spot/twaalgos/sccinfo.cc: Consider universal edges as if they were
existential edges.
* spot/twaalgos/sccinfo.hh: Document that.
* spot/twaalgos/dot.cc: Allow option 's' again, for easy testing.
* tests/core/alternating.test: Adjust tests.
* tests/python/_altscc.ipynb: New file (more tests).
* tests/Makefile.am: Add it.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
d2f471da06 parseaut: handle alternating automata with many universal init states
* spot/parseaut/parseaut.yy (fix_initial_state): Use
spot::internal::outgoing_edge_group to reduce all initial states to a
single one.
* tests/core/parseaut.test: Add more tests.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
48c812a595 twa_graph: add support for universal initial states
The only missing point is that the HOA parser cannot deal with multiple
universal initial states, as seen in parseaut.test.

* spot/graph/graph.hh (new_univ_dests): New function, extracted from...
(new_univ_edge): ... this one.
* spot/twa/twagraph.hh (set_univ_init_state): Implement using
new_univ_dests.
* spot/twaalgos/dot.cc, spot/twaalgos/hoa.cc, python/spot/impl.i:
Add support for universal initial states.
* spot/parseaut/parseaut.yy: Add preliminary support for
universal initial states.  Multiple universal initial states
are still not supported.
* tests/core/alternating.test, tests/core/parseaut.test,
tests/python/alternating.py: Adjust tests and exercise this new feature.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
d5c9c34514 dot: add support for alternating automata
* spot/twaalgos/dot.cc: Handle universal destinations.
Ignore option 's' for alternating automata.
* tests/core/alternating.test: New file.
* tests/Makefile.am: Add it.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
e620368696 parseaut: preliminary support for reading alternating automata
Currently this only reads universal branches.  The parser (and the
automaton code) do not support universal initial states.

* spot/parseaut/parseaut.yy: Read universal branches.  Deal with
the no-univ-branch/!univ-branch change in HOA 1.1.
* tests/python/alternating.py: Read the output of print_hoa.
* tests/core/parseaut.test: Adjust test output, and add more tests.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
4903f086e3 graph: replace the existing "alternating" interface
* spot/graph/graph.hh: Use the sign bit of destination state X to
designate a universal edge.  Store the destinations of such an edge in a
separate array, at index ~X.
* spot/graph/ngraph.hh, tests/core/graph.cc, tests/core/graph.test,
tests/core/ngraph.cc: Adjust test case to the new interface.
2016-12-27 12:36:38 +01:00
Maximilien Colange
1a08eca840 Add a new, parameterized, version of the Couvreur emptiness check.
This version has optimization for explicit twa, and also for weak and
terminal (depending on whether an accepting run is requested) automata.

* spot/twaalgos/couvreurnew.hh, spot/twaalgos/couvreurnew.cc,
  spot/twaalgos/Makefile.am: New files for the new algorithm.
* spot/twaalgos/emptiness.cc, tests/core/randtgba.cc:
  Register new algorithm.
2016-12-13 16:18:31 +01:00
Alexandre Duret-Lutz
413eab1d32 ltlf: ensure alive holds initially
Reported by Shufang Zhu.

* spot/tl/ltlf.cc, spot/tl/ltlf.hh: Fix the transltion
and update the comments.
* tests/core/ltlfilt.test: Adjust test cases.
* NEWS: Mention the fix.
* THANKS: Add Shufang Zhu.
2016-12-09 21:37:15 +01:00
Alexandre Duret-Lutz
3d726fccb2 parseaut: diagnose invalid acceptance terms
* spot/parseaut/parseaut.yy: Add a diagnostic.
* tests/core/parseaut.test: Test it.
* NEWS: Document it.
2016-12-01 18:34:44 +01:00
Maximilien Colange
9a1e411502 Properly time computations of accepting runs in randtgba.
* tests/core/randtgba.cc: do not time statistics.
2016-12-01 10:54:42 +01:00
Alexandre Duret-Lutz
5ca1281e36 tests: speed up recuc.test and reducpsl.test
... by calling valgrind less often.

* tests/core/reduc.test, tests/core/reducpsl.test: Call
valgrind only on 1 of the 12 calls to randltl, and
2 of the 7 calls to reduc.
2016-11-29 15:54:08 +01:00
Alexandre Duret-Lutz
7e5b336f16 tests: divide the run time of parse.test by 20
* tests/core/readltl.cc: Process many formulas from a
file instead of one arg at a time.
* tests/core/parse.test, tests/core/parseerr.test, tests/core/utf8.test:
Adjust to supply a file as input.
2016-11-29 14:46:23 +01:00
Alexandre Duret-Lutz
ad51525608 tests: divide the run time of tostring.test by 40
* tests/core/tostring.test: Move all the input formulas into...
* tests/core/tostring.cc: ... the code, and do the loop there.
2016-11-29 14:46:22 +01:00
Alexandre Duret-Lutz
9bc978a90f strength: fix is_terminal()
Fix #198.  Reported by Maximilien Colange.

* spot/twaalgos/strength.cc (is_terminal): Test that no accepting
transition lead to a rejecting SCC.
* tests/core/strength.test: Add test case.
* spot/twaalgos/strength.hh, spot/twa/twa.hh, doc/org/concepts.org:
Adjust documentation.
* NEWS: Mention the fix.
2016-11-28 18:02:28 +01:00
Etienne Renault
ec83e60bb9 bitvec: remove useless methods
* spot/misc/bitvect.hh, tests/core/bitvect.cc,
tests/core/bitvect.test: here.
2016-11-23 09:39:58 +01:00
Etienne Renault
43ec36cda7 Prefer emplace_back to push_back
* spot/graph/ngraph.hh, spot/ltsmin/ltsmin.cc,
spot/misc/bitvect.hh, spot/misc/intvcomp.cc,
spot/misc/satsolver.cc, spot/priv/weight.cc,
spot/ta/taexplicit.cc, spot/taalgos/minimize.cc,
spot/taalgos/reachiter.cc, spot/tl/exclusive.cc,
spot/tl/formula.cc, spot/tl/formula.hh,
spot/tl/mark.cc, spot/tl/mutation.cc,
spot/tl/relabel.cc, spot/tl/remove_x.cc,
spot/tl/simplify.cc, spot/twa/acc.cc,
spot/twa/acc.hh, spot/twa/formula2bdd.cc,
spot/twa/taatgba.cc, spot/twa/taatgba.hh,
spot/twa/twa.hh, spot/twa/twagraph.cc,
spot/twaalgos/bfssteps.cc, spot/twaalgos/canonicalize.cc,
spot/twaalgos/compsusp.cc, spot/twaalgos/copy.cc,
spot/twaalgos/cycles.cc, spot/twaalgos/degen.cc,
spot/twaalgos/determinize.cc, spot/twaalgos/dtwasat.cc,
spot/twaalgos/emptiness.cc, spot/twaalgos/gv04.cc,
spot/twaalgos/hoa.cc, spot/twaalgos/ltl2taa.cc,
spot/twaalgos/ltl2tgba_fm.cc, spot/twaalgos/magic.cc,
spot/twaalgos/mask.hh, spot/twaalgos/minimize.cc,
spot/twaalgos/powerset.cc, spot/twaalgos/product.cc,
spot/twaalgos/randomgraph.cc, spot/twaalgos/reachiter.cc,
spot/twaalgos/relabel.cc, spot/twaalgos/remfin.cc,
spot/twaalgos/sccfilter.cc, spot/twaalgos/se05.cc,
spot/twaalgos/simulation.cc, spot/twaalgos/stutter.cc,
spot/twaalgos/tau03opt.cc, spot/twaalgos/totgba.cc,
spot/twaalgos/word.cc, tests/core/bitvect.cc: here.
2016-11-23 09:39:58 +01:00
Alexandre Duret-Lutz
4e1c8dfd74 add test-case for bdd_noderesize
* tests/core/ltl2tgba.test: Add new test-case,
reported by Tomáš Babiak.
* NEWS: Mention the bug fixed by previous patch.
2016-11-19 16:46:14 +01:00
Alexandre Duret-Lutz
a70589fe13 remfin: fix handling of weak automata
* spot/twaalgos/remfin.cc: Do not add a sink states to deterministic
weak automata, and actually apply the "weak" Fin-removal to any weak
automaton.
* tests/core/explprod.test: Add a test case for the previous patch,
but that used to fail because of this bug.
* NEWS: Mention the bug.
2016-11-11 14:10:24 +01:00
Alexandre Duret-Lutz
278b41f4bb ltldo: rename %R as %#
Fixes #189.

* bin/ltldo.cc: Here.
* tests/core/ltldo.test: Adjust and add test-case for %R.
* NEWS: Mention the change.
2016-11-08 18:58:04 +01:00
Alexandre Duret-Lutz
2e69e04583 from_ltlf: new LTL transformation.
Fixes #187.

* spot/tl/ltlf.cc, spot/tl/ltlf.hh: New files.
* spot/tl/Makefile.am: Add them.
* bin/ltlfilt.cc: Add a new option.
* bin/man/ltlfilt.x: Add bibliographic reference.
* tests/core/ltlfilt.test: Add more tests.
* tests/python/ltlf.py: New file.
* tests/Makefile.am: Add it.
* python/spot/impl.i: Python bindings.
* NEWS: Mention it.
2016-11-05 22:59:02 +01:00
Alexandre Duret-Lutz
40ed12050b parsetl: fix crash in debug-mode
Fixes #193, reported by Etienne Renault.

* spot/parsetl/parsetl.yy: Clone printed formulas.
* tests/core/parse.test: Add test case.
* NEWS: Mention the issue.
2016-10-29 13:13:09 +02:00
Alexandre Duret-Lutz
56f768f5a6 remove_fin: improve behavior on unclean acceptance
Related to #188.  This is a third fix that independently
makes `'utfilt --is-unambiguous -q smaller.hoa' instantaneous.

* spot/twaalgos/remfin.cc: Clean the received automaton if
necessary.
* bin/autfilt.cc: No need to call cleanup_acceptance_here() before
remove_fin() anymore.
* tests/core/remfin.test: Add an additional test.
* NEWS: Mention the change.
2016-10-19 11:00:15 +02:00
Alexandre Duret-Lutz
5384a3b89a is_unambiguous: rewrite more efficiently
Avoid calling scc_info::determine_unknown_acceptance on the product, as
suggested in #188.

* spot/twaalgos/isunamb.cc (is_unambiguous): Rewrite.
* tests/core/unambig.test: Add the automaton from #188.
* NEWS: Mention the improved function.
* spot/twaalgos/mask.cc,
spot/twaalgos/mask.hh (mask_keep_accessible_states): New function.
2016-10-19 10:51:38 +02:00
Alexandre Duret-Lutz
3b5fa22a3b ltlcross: add option --strength and --ambiguous
Suggested by František Blahoudek.

* bin/ltlcross.cc: Implement the two options.
* doc/org/ltlcross.org, NEWS: Document them.
* tests/core/complementation.test: Adjust test case.
* tests/core/ltlcross3.test, tests/core/unambig.test: More tests.
2016-10-13 15:41:49 +02:00
Alexandre Duret-Lutz
cc1191cd66 ltlcross: fix --verbose --no-check crash
Report from František Blahoudek.

* bin/ltlcross.cc: Do not display stats for automata
that do not exist.
* tests/core/ltlcross3.test: Test it.
* NEWS: Mention the fix.
2016-10-13 13:53:42 +02:00