Commit graph

111 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
289b2383ad scc_info: add Python bindings
Related to #172, where we discussed that scc_info bindings were
missing.

* spot/twaalgos/sccinfo.hh (spot::scc_info::scc_node): Move...
(spot::scc_info_node): ... here to help Swig.
* python/spot/impl.i: Add bindings for scc_info.
* tests/python/sccinfo.py: New file.
* tests/Makefile.am: Add it.
2017-02-20 14:31:16 +01:00
Alexandre Duret-Lutz
ff4c4a7231 python: render the M&P hierarchy in SVG
* python/spot/__init__.py (show_mp_hierarchy, mp_hierarchy_svg): New
functions.
* tests/python/formulas.ipynb: Illustrate show_mp_hierarchy.
* python/ajax/spotcgi.in: Use mp_hierarchy_svg.
* python/ajax/css/trans.css: Adjust for possible overflows.
* NEWS: Mention this new feature.
2017-01-18 20:58:20 +01:00
Alexandre Duret-Lutz
ebdb198b64 hierarchy: expose mp_class to python
* bin/common_output.cc: Move some of the printing code...
* spot/tl/hierarchy.cc, spot/tl/hierarchy.hh: ... here, as new
  variants of mp_class...
* python/spot/impl.i: ... that we can now call from Python.
* python/ajax/spotcgi.in: Use those to simplify and extend
the code printing class membership.
2017-01-14 23:43:01 +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 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
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 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
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
cd34827510 spotcgi: correctly kill ltl3ba on timeout
* python/spot/__init__.py (automata): Do not create a session for
every command, this is only needed if automata() is run with a timeout
parameter.
* python/ajax/spotcgi.in: Adjust exclude the main process from
the process group, so that only children are killed on SIGALRM.
* NEWS: Mention the bug.
2016-12-15 21:57:11 +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
Etienne Renault
8a8fcf2ac1 spot.ltsmin: fix errors on Darwin
* NEWS, python/spot/ltsmin.i: here.
2016-10-10 20:11:40 +02:00
Alexandre Duret-Lutz
d271dfd592 python: make it possible to modify edges during iteration
Reported by Laurent Xu.

* python/spot/impl.i: Fix the iterator to return pointers instead of
references.  Because references are ultimately copied.
* tests/python/automata.ipynb: Add test cases.
* NEWS: Mention it.
2016-07-29 16:09:54 +02:00
Alexandre Duret-Lutz
e37f62dc75 python: have %%dve and %%pml honor SPOT_TMPDIR and TMPDIR
* python/spot/aux.py (tmpdir): New context manager.
* python/spot/ltsmin.i: Use it for the two magics.
* NEWS: Mention this.
2016-07-19 14:23:27 +02:00
Alexandre Duret-Lutz
29a1e3a299 python: add missing bindings for randomize()
* python/spot/impl.i: Here.
* NEWS: Mention it.
* tests/python/highlighting.ipynb: Add test case.
2016-07-19 02:55:07 +02:00
Alexandre Duret-Lutz
e4134af15f ajax: fix GTA construction
* python/ajax/spotcgi.in: Here.
* NEWS: Mention it.
2016-07-06 15:03:22 +02:00
Alexandre Duret-Lutz
8dee359e5a ajax: get rid of the logos
* python/ajax/logos/lip6sys64.png, python/ajax/logos/lrde64.png: Delete.
* python/ajax/css/trans.css, python/ajax/trans.html,
python/ajax/Makefile.am: Adjust.
2016-07-06 15:03:16 +02:00
Alexandre Duret-Lutz
272daf62fc python: add a %%pml magic
Fixes #162.

* python/spot/ltsmin.i: Implement the magic.
* NEWS: Mention it.
* tests/python/ltsmin-pml.ipynb: New file.
* tests/Makefile.am, doc/org/tut.org: Add it.
* tests/python/ipnbdoctest.py: Adjust.
2016-06-12 12:53:55 +02:00
Alexandre Duret-Lutz
b408827110 add binding for language_containment_checker and document them
* spot/tl/contain.cc, spot/tl/contain.hh: Simplify the
use of language_containment_checker by adding default argument.
* python/spot/__init__.py, python/spot/impl.i: Bind it in Python.
* doc/org/tut04.org: New file to illustrate it.
* doc/org/tut.org, doc/Makefile.am: Add it.
* NEWS: Mention those changes.
2016-05-25 15:12:45 +02:00
Alexandre Duret-Lutz
0e9ccabbe8 ajax: add <h1> title
Final part of #176.

* python/ajax/trans.html: Here.
2016-05-10 10:44:38 +02:00
Alexandre Duret-Lutz
e91c6ba2f1 python: support operator rewriting in __format__
Fixes #168.

* python/spot/__init__.py: Implement it.
* tests/python/formulas.ipynb: Test it.
* NEWS: Mention it.
2016-05-01 21:05:49 +02:00
Alexandre Duret-Lutz
33391798a3 python: export tgba_determinize
* python/spot/impl.i: Here.
* tests/python/automata.ipynb: Use it.
* NEWS: Mention it.
2016-04-22 18:50:51 +02:00
Alexandre Duret-Lutz
5e47d4df38 update some URLs to skip permanent redirections
* doc/org/concepts.org, doc/org/ltlcross.org, doc/org/ltldo.org,
python/ajax/trans.html, tools/man2html.pl: Update URLs.
2016-04-10 12:16:28 +02:00
Alexandre Duret-Lutz
901f287032 python: add prints for atomic_prop_set
Fixes #159.

* python/spot/ltsmin.i: Here.
* python/spot/impl.i: Disable duplicate instantiation.
* tests/python/ltsmin.ipynb: Test it.
2016-04-08 23:01:07 +02:00
Alexandre Duret-Lutz
8814f16637 * python/ajax/spotcgi.in: Fix error message. 2016-03-13 15:10:04 +01:00
Laurent XU
81333df2c3 * python/Makefile.am: Fix Makefile's targets in separated folder. 2016-03-10 17:40:46 +01:00
Laurent XU
1eee12b8b4 python: add wrapper on twa_graph::edges()
* spot/twa/twagraph.hh (edges): Do not hide from SWIG.
* spot/graph/graph.hh: Hide stuff that SWIG do not understand.
* python/spot/impl.i: Add some typemaps and fragment to
iterate over the result of twa_graph::edges().
2016-03-10 17:12:21 +01:00
Amaury Fauchille
1fd76ee918 word: implement twa word parsing
* spot/twaalgos/word.hh: add parse_word method and a new constructor
* spot/twaalgos/word.cc: implement word parsing
* python/spot/__init__.py: add parse_word method binding
* tests/python/word.ipynb: add word parsing tests
2016-03-07 20:17:00 +01:00
Alexandre Duret-Lutz
ad08a585af rename two confusing methods of emptiness_check_instantiator
* spot/twaalgos/emptiness.hh (emptiness_check_instantiator): rename
min_acceptance_conditions and max_acceptance_conditions to
min_sets and max_sets.
* spot/twaalgos/emptiness.cc, python/ajax/spotcgi.in,
tests/core/ikwiad.cc, tests/core/emptchk.cc, tests/core/randtgba.cc:
Adjust.
* doc/org/upgrade2.org, NEWS: Mention the change.
2016-03-03 18:18:39 +01:00
Alexandre Duret-Lutz
5ec2f8b7b0 * python/buddy.i: Add a hash function for BDDs. 2016-03-01 10:10:01 +01:00
Alexandre Duret-Lutz
f59042fc9f * python/ajax/spotcgi.in: Thinko. 2016-02-18 09:08:31 +01:00
Alexandre Duret-Lutz
22f442f758 parsetl: change the interface to return a parsed_formula
This gets the interface of all the functions parsing formula in line
with the interface of the automaton parser: both return a "parsed_*"
object (parsed_formula or parsed_automaton) that contains the said
object and its list of errors.  Doing so avoid having to declare the
parse_error_list in advance.

* spot/tl/parse.hh, spot/parsetl/parsetl.yy: Do the change.
* spot/parsetl/fmterror.cc: Adjust the error printer.
* NEWS: Document it.
* bin/common_finput.cc, bin/common_finput.hh, bin/ltlcross.cc,
bin/ltldo.cc, bin/ltlfilt.cc, doc/org/tut01.org, doc/org/tut02.org,
doc/org/tut10.org, doc/org/tut20.org, python/ajax/spotcgi.in,
python/spot/impl.i, spot/parseaut/parseaut.yy, tests/core/checkpsl.cc,
tests/core/checkta.cc, tests/core/consterm.cc, tests/core/emptchk.cc,
tests/core/equalsf.cc, tests/core/ikwiad.cc, tests/core/kind.cc,
tests/core/length.cc, tests/core/ltlprod.cc, tests/core/ltlrel.cc,
tests/core/randtgba.cc, tests/core/readltl.cc, tests/core/reduc.cc,
tests/core/safra.cc, tests/core/syntimpl.cc, tests/core/tostring.cc,
tests/ltsmin/modelcheck.cc, tests/python/alarm.py,
tests/python/interdep.py, tests/python/ltl2tgba.py,
tests/python/ltlparse.py: Adjust all uses.
2016-02-17 20:31:58 +01:00
Etienne Renault
cf4f58c34b Update paths to please Darwin
Fixes #144.

* doc/org/.dir-locals.el.in,
doc/org/init.el.in,
python/ajax/spotcgi.in,
tests/run.in: Here.
2016-02-17 15:02:41 +01:00
Alexandre Duret-Lutz
9692d734a9 cleanup ltsmin bindings
* python/spot/aux.py (rm_f): new function.
* python/spot/ltsmin.i: Replace the %require magic by a simple function.
Rewrite the %%dve magic.
* tests/python/otfcrash.py: Simplify using spot.ltsmin.require()
* tests/python/ltsmin.ipynb: Likewise, also add more text for the
documentation.
* NEWS: Adjust.
2016-02-16 19:08:28 +01:00
Alexandre Duret-Lutz
22af7aefdf python: report dot errors
* python/spot/aux.py: Catch errors from dot and signal them.
* tests/python/_aux.ipynb: New file.
* tests/Makefile.am: Add it.
* tests/sanity/ipynb.pl: Support the convention that tests starting with
'_' should not be published on the web site.
2016-02-16 14:34:57 +01:00
Alexandre Duret-Lutz
c093b7b78f python: move auxiliary functions in a separate module
* python/spot/aux.py: New file, with function extracted from...
* python/spot/__init__.py: ... here.
* python/.gitignore, python/Makefile.am: Adjust.
2016-02-16 12:56:20 +01:00
Etienne Renault
091251b5b7 Provide support for %dve and %require
* NEWS, python/spot/ltsmin.i,
tests/python/ltsmin.ipynb: Here.
2016-02-15 09:08:37 +01:00
Alexandre Duret-Lutz
6a662a6d8e get read of twa_safra_complement
* spot/twa/twasafracomplement.cc, spot/twa/twasafracomplement.hh,
tests/core/complementation.cc: Delete.
* tests/Makefile.am, spot/twa/Makefile.am: Adjust.
* tests/core/complementation.test: Rewrite using the new determinization
code.
* python/spot/impl.i: Do not mention twa_safra_complement anymore.
* NEWS: Mention the removal.
2016-02-12 15:09:37 +01:00
Alexandre Duret-Lutz
0d9019ea39 python: fix translate's doc string
* python/spot/__init__.py (translate): Mention 'generic' in doc string.
2016-02-12 14:07:28 +01:00
Alexandre Duret-Lutz
064ccd5c05 fix paths mentioning buddy/src/.libs
Those had been incorrectly renamed to buddy/spot/.libs when we rename
the main src/ directory into spot/.  This only affected the setting of
DYLD_LIBRARY_PATH, that used to be needed on Darwin.

* doc/org/.dir-locals.el.in, doc/org/init.el.in, python/ajax/spotcgi.in,
tests/run.in: Fix the PATH.
2016-02-12 14:02:47 +01:00
Alexandre Duret-Lutz
77b0b5b3fe dot: add option C(COLOR)
This fixes the output gliches visible in the previous patches,
where highlighting a state would remove its fill color.

* spot/twaalgos/dot.cc, spot/taalgos/dot.cc: Implement option C(COLOR).
* bin/common_aoutput.cc, doc/org/oaut.org: Document it.
* doc/org/.dir-locals.el.in, doc/org/init.el.in,
python/spot/__init__.py: Use it.
* tests/python/automata-io.ipynb, tests/python/automata.ipynb,
tests/python/highlighting.ipynb: Test it.
* tests/core/readsave.test: Adjust.
* NEWS: Mention recent changes.
2016-02-05 19:26:38 +01:00
Alexandre Duret-Lutz
23c2cbf46a python: highlighting functions for edges and states
* python/spot/impl.i (highlight_state, highlight_edge): New function.
* python/spot/__init__.py (highlight_states, highlight_edges): New
functions.
* spot/twaalgos/dot.cc: Add a '#' option.
* spot/taalgos/dot.cc: Ignore '#'.
* tests/python/highlighting.ipynb: New file to illustrate everything.
* tests/Makefile.am, doc/org/tut.org: Add it.
2016-02-05 17:29:30 +01:00
Alexandre Duret-Lutz
5a5f83f468 python: add missing bindings for twa_word and twa_run
Fixes #133.

* python/spot/impl.i: Add bindings for twa_word.  Add a __repr__
for twa_run, and instantiate templates for twa_run's members.
* tests/python/word.ipynb: New file with examples.
* tests/Makefile.am, doc/org/tut.org: Add it.
2016-01-31 21:05:44 +01:00
Alexandre Duret-Lutz
b11c07b351 dot: add a <N option
* spot/twaalgos/dot.cc: Implement it.
* spot/taalgos/dot.cc: Ignore it.
* spot/twaalgos/copy.cc, spot/twaalgos/copy.hh: Add option
to limit the number of states.
* tests/python/ltsmin.ipynb: Improve test case.
* tests/Makefile.am: Cleanup the files generated by ltsmin.ipynb.
* python/spot/__init__.py (setup): Add a max_states argument
that default to 50.
* bin/common_aoutput.cc: Mention the <INT option.
* NEWS: Likewise.
2016-01-29 09:09:05 +01:00
Alexandre Duret-Lutz
6230f320bf python: fix installation
* python/Makefile.am: Use nobase_ for installing python files.  This
required removing the $(srcdir) prefix used almost everywhere in this
file, which in turn enabled the use of subdir-objects to remove
an Automake warning.  The downside is that the Makefile probably won't
support VPATH builds with some inferior implementations of Make.
2016-01-28 10:46:55 +01:00
Alexandre Duret-Lutz
db1e842a67 ltsmin: add accessors for variable names and types
* spot/ltsmin/ltsmin.hh, spot/ltsmin/ltsmin.cc: Expose more of the
ltsmin interface.
* python/spot/ltsmin.i: Add some helper functions on top of this
new interface.
* tests/python/ltsmin.ipynb: Test them.
* NEWS: Mention it.
2016-01-26 19:21:35 +01:00
Alexandre Duret-Lutz
907b72fbfb ltsmin: implement a two-step loading
* spot/ltsmin/ltsmin.cc, spot/ltsmin/ltsmin.hh: Split load_ltsmin() into
ltsmin_model::load() and ltsmin_model::kripke().  Report errors using
exceptions instead of on std::cerr.
* python/spot/ltsmin.i: Deal with exceptions.
* tests/ltsmin/modelcheck.cc, tests/python/ltsmin.ipynb: Adjust.
2016-01-26 19:21:35 +01:00