Commit graph

4084 commits

Author SHA1 Message Date
Alexandre GBAGUIDI AISSE
823dc56e6b Update NEWS and documentations
* NEWS: Update.
* doc/org/satmin.org: Update satmin page.
* bin/man/spot-x.x: Document SPOT_XCNF and edit SPOT_SATSOLVER.
* bin/spot-x.cc: Update satmin options.
* bin/autfilt.cc: Update satmin related documentations.
* bin/man/autfilt.x: Update autfilt options.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
bd37625e49 misc: Add 'SPOT_XCNF' environment variable
* spot/misc/satsolver.cc: Handle xcnf writing.
* spot/misc/satsolver.hh: Handle xcnf writing.
2017-01-06 19:53:21 +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
8a0eed6cef twaalgos: Implement language_map algo
* python/spot/impl.i: Add python bindings.
* spot/twaalgos/langmap.cc: Implement algo.
* spot/twaalgos/langmap.hh: Declare algo.
* spot/twaalgos/Makefile.am: Add new files.
* tests/python/langmap.py: Add tests.
* 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
79f4c8e0d7 twaalgos: Help sat_build to ignore unuseful transitions
* spot/twaalgos/dtbasat.cc: Fix static sat_build.
* spot/twaalgos/dtwasat.cc: Fix static sat_build.
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 GBAGUIDI AISSE
32f040fa45 spot: Add Picosat to Spot library & Update satsolver class
* Makefile.am: Add picosat to subdirs.
* configure.ac: Add picosat/Makefile to AC_CONFIG_FILES.
* README: Add picosat/ in the list of directories.
* debian/copyright: Add picosat licence and details.
* picosat/Makefile.am: Implement Makefile.am in picosat directory.
* spot/Makefile.am: Tell the compiler to add libpico.la into libspot.la.
* picosat/LICENSE: Add picosat licence.
* picosat/NEWS: Add picosat NEWS.
* picosat/VERSION: Add picosat VERSION.
* picosat/picosat.c: Add picosat c file.
* picosat/picosat.h: Add picosat header file.
* spot/misc/satsolver.cc: Update functions.
* spot/misc/satsolver.hh: Add documentation, clean code, change
some functions visibility and separate templates functions.
* spot/twaalgos/dtbasat.cc: Update dtba_to_sat function.
* spot/twaalgos/dtwasat.cc: Update dtwa_to_sat function.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
596bdec910 spot: Abstract cnf writing in SAT-based minimisation
* spot/misc/satsolver.hh: Declare all functions needed.
* spot/misc/satsolver.cc: Implement them.
* spot/twaalgos/dtbasat.cc: Abstract writing.
* spot/twaalgos/dtwasat.cc: Abstract writing.
2017-01-06 19:53:21 +01:00
Alexandre GBAGUIDI AISSE
f2e091b9cd .gitignore: Fix typo
* .gitignore: Fix typo dt*a instead of dt*ba.
2017-01-06 19:53:21 +01:00
Alexandre Duret-Lutz
32086f7c83 tests: update ipnbdoctest to graphviz 2.40 and Python 3.6
This fix recent failures observed on arch linux because
it uses newer versions of graphviz and Python.

* tests/python/ipnbdoctest.py (sanitize): More substitutions.
2017-01-06 17:20:55 +01:00
Alexandre Duret-Lutz
c090c4205f bin: bump copyright year
* bin/common_setup.cc: Here.
2017-01-01 10:31:31 +01:00
Alexandre Duret-Lutz
684c9c47c4 twa: add prop_set::improve_det
Algorithms that remove transitions can turn a non-deterministic
automaton into a deterministic one, so we need to be able to specify
that determinism can be improved (as opposed to preserved).

* spot/twa/twa.hh (twa::prop_set::improve_det): New attribute.
(twa::prop_keep, twa::prop_copy): Honor it.
* spot/tl/exclusive.cc, spot/twaalgos/alternation.cc,
spot/twaalgos/complete.cc, spot/twaalgos/degen.cc,
spot/twaalgos/determinize.cc, spot/twaalgos/mask.cc,
spot/twaalgos/minimize.cc, spot/twaalgos/remfin.cc,
spot/twaalgos/remprop.cc, spot/twaalgos/sbacc.cc,
spot/twaalgos/sccfilter.cc, spot/twaalgos/simulation.cc,
spot/twaalgos/strength.cc, spot/twaalgos/stutter.cc,
spot/twaalgos/totgba.cc: Adjust calls to prop_keep() and
prop_copy().
2016-12-30 10:56:04 +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
bedd96a7ba * spot/twaalgos/isdet.cc: Remove debug statement. 2016-12-30 09:09:05 +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
3d0a971aa8 org: examples with alternating automata
* doc/org/tut23.org, doc/org/tut24.org, doc/org/tut31.org: New files.
* doc/Makefile.am, doc/org/tut.org: Add them.
* doc/org/hoa.org, doc/org/concepts.org: Adjust for alternation support.
* NEWS: Add links.
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
9f6924ccfb twaalgos: add many guards against alternation
* spot/twa/twagraph.hh, spot/twaalgos/are_isomorphic.cc,
spot/twaalgos/canonicalize.cc, spot/twaalgos/couvreurnew.cc,
spot/twaalgos/cycles.cc, spot/twaalgos/degen.cc,
spot/twaalgos/determinize.cc, spot/twaalgos/isunamb.cc,
spot/twaalgos/isweakscc.cc, spot/twaalgos/mask.hh,
spot/twaalgos/minimize.cc, spot/twaalgos/product.cc,
spot/twaalgos/randomize.cc, spot/twaalgos/sbacc.cc,
spot/twaalgos/sccfilter.cc, spot/twaalgos/simulation.cc:
Throw a runtime_error if the input is alternating.
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
543e0db9a0 stats: add a variant for twa_graph_ptr
This is faster than using the abstract interface, and it also supports
alternating automata.  (This will be tested in the tests for
ltlcross's support for alternating automata.)

* spot/twaalgos/stats.cc (stats_reachable, sub_stats_reachable):
Add code specific to twa_graph_ptr.
2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
64fa6c0026 remfin: ignore unreachable states in remove_fin_weak()
* spot/twaalgos/remfin.cc (remove_fin_weak): Ignore unreachable
states.  This caused crashes in the test cases for the
upcoming alternation support in ltlcross.
2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
326431fd28 * NEWS: Describe experimental alternation support. 2016-12-29 12:57:53 +01:00
Alexandre Duret-Lutz
fa06cfa303 alternation: implement remove_alternation() for weak alt automata
This mixes the subset construction (for 1-state rejecting SCCs) and
the breakpoint construction (for larger rejecting SCCs).  The
algorithm should probably be rewritten in a cleaner and more efficient
way, but that should do for a first version.  It should be easy to
extend it to support Büchi acceptance (since the breakpoint
construction works for this) when we need it.

* spot/twaalgos/alternation.hh,
spot/twaalgos/alternation.cc (remove_alternation): New function.
* tests/python/alternation.ipynb: New file.
* tests/Makefile.am, doc/org/tut.org: Add it.
2016-12-29 12:57:16 +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
27ab631cdc alternation: add a states_and algorithm
This should will come handy to implement the convertion from LTL to
alternating automata, and to handle automata with multiple initial
states.

* spot/twaalgos/alternation.hh, spot/twaalgos/alternation.cc: New files.
* spot/twaalgos/Makefile.am: Add them.
* python/spot/impl.i: Add bindings.
* tests/python/alternating.py: Test states_and.
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
56df459c75 print_hoa: add support for universal branches
* spot/twaalgos/hoa.cc: Implement it.
* tests/python/alternating.py: Test it.
2016-12-27 12:36:38 +01:00
Alexandre Duret-Lutz
6aad559c29 twa_graph: add basic support for alternation
This only allows creating universal edges, and reading the associated
destinations.

* spot/twa/twagraph.hh (new_univ_edges, univ_dests, is_alternating): New
function.
* python/spot/impl.i: Add Python bindings.
* tests/python/alternating.py: New file.
* tests/Makefile.am: Add it.
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
Alexandre Duret-Lutz
dcd21aaabf org: call set_init_state() in tut22
* doc/org/tut22.org: Here.
2016-12-25 12:27:17 +01:00
Alexandre Duret-Lutz
34ac6f08cc org: ltlcross supports any acceptance condition
* doc/org/ltlcross.org: Also fix the documentation of terminal and
weak SCCs.
2016-12-24 21:08:01 +01:00
Alexandre Duret-Lutz
8e8c6a8cea org: support org >= 8.3
* doc/org/.dir-locals.el.in, doc/org/init.el.in: Load "shell" instead
of "sh" for recent org-mode version.
2016-12-24 21:08:01 +01:00
Alexandre Duret-Lutz
2f02911e1a copy: improve documentation
* spot/twaalgos/copy.hh: Make a reference to make_twa_graph().
2016-12-24 21:08:00 +01:00
Alexandre Duret-Lutz
f5a76baa33 strength: improve doc
* spot/twaalgos/strength.hh: Add a verb to the descriptions.
Suggested by Alexandre Gbaguidi Aïsse.
2016-12-16 13:48:28 +01:00