Commit graph

41 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
619b227eff * wrap/python/spot.py (automata): Use universal_newlines. 2015-10-21 14:42:52 +02:00
Alexandre Duret-Lutz
80a6a183e3 python: add a timeout argument to automaton() and automata()
* wrap/python/spot.py: Implement it.  Also report non-zero
exit using CalledProcessError.
* wrap/python/tests/automata-io.ipynb, wrap/python/tests/piperead.ipynb:
Adjust.
* NEWS: Mention the change.
2015-10-21 11:57:57 +02:00
Alexandre Duret-Lutz
0f3bc27d7b python: fix bindings for scc_filter as a method
* wrap/python/spot.py: Fix bindings for scc_filter.
* wrap/python/tests/remfin.py: Test them.
2015-10-20 14:54:06 +02:00
Alexandre Duret-Lutz
87cb58d0a1 python: introduce a spot.postprocess() function
This simplifies the use of the spot.postprocessor object.

* wrap/python/spot.py: Add it.
* wrap/python/tests/automata.ipynb: Use it.
* NEWS: Mention it.
2015-10-19 18:09:22 +02:00
Alexandre Duret-Lutz
176c9e2e17 tl: rename ltl_simplifier to tl_simplifier
* doc/org/tut01.org, doc/tl/tl.tex, src/bin/common_r.hh,
src/bin/ltlfilt.cc, src/tests/equalsf.cc, src/tests/ikwiad.cc,
src/tests/randtgba.cc, src/tests/reduc.cc, src/tests/syntimpl.cc,
src/tl/nenoform.cc, src/tl/randomltl.cc, src/tl/randomltl.hh,
src/tl/simplify.cc, src/tl/simplify.hh, src/twaalgos/ltl2tgba_fm.cc,
src/twaalgos/ltl2tgba_fm.hh, src/twaalgos/stutter.cc,
src/twaalgos/translate.cc, src/twaalgos/translate.hh,
wrap/python/ajax/spotcgi.in, wrap/python/spot.py,
wrap/python/tests/interdep.py: Rename ltl_simplifier to tl_simplifier.
* NEWS: Mention it.
2015-10-18 13:35:23 +02:00
Alexandre Duret-Lutz
9689c4ccfc python: update the formulaiterator bindings
* wrap/python/spot.py: Add the unabbreviate() method, and
remove unabbrivate_ltl() and get_literal().
* wrap/python/tests/randltl.ipynb: Demonstrate unabbreviate().
2015-10-18 11:54:51 +02:00
Alexandre Duret-Lutz
e8ce08a989 python: better way to extend existing classes
* wrap/python/spot.py: Use a decorator to extend classes.
* wrap/python/tests/formulas.ipynb: Adjust expected help text.
2015-10-08 08:54:50 +02:00
Alexandre Duret-Lutz
1f0258e9f7 python: docstrings cleanup
* wrap/python/spot.py: Better docstrings.
* wrap/python/tests/formulas.ipynb: Update.
2015-10-04 12:17:06 +02:00
Alexandre Duret-Lutz
67468acb18 * wrap/python/spot.py: Minor cleanups to follow PEP8. 2015-10-04 00:38:13 +02:00
Alexandre Duret-Lutz
5bfd0267e7 python: implement formula.__format__
Fixes #105.

* src/bin/common_trans.cc (quote_shell_string): Move ...
* src/misc/escape.cc, src/misc/escape.hh (quote_shell_string):
... here.
* wrap/python/spot_impl.i: Wrap escape.hh.
* wrap/python/spot.py: Implement formula.__format__.
* wrap/python/tests/ltlsimple.py: Test it.
* NEWS, doc/org/tut01.org, wrap/python/tests/formulas.ipynb: Document
it.
2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
6ff4fa9722 Work around weird Python 3.5 generator/iterator interaction
* wrap/python/spot.py: Python 3.5 reports some unexpected SystemError
messages when the stack of iterator(...(iterator(generator))) we build
for random LTL generation raises a StopIteration.  The messages are
attached either to delete_formula or delete_randltlgenerator, claiming
that these functions exit with an error; but I have checked that they
do not.  I've been unable to understand the cause of the issue.
Replacing the generator by an iterator at least fixes the problem in a
way that is transparent for our API.
* wrap/python/tests/randltl.ipynb: Adjust expected formulas.
2015-10-03 15:46:05 +02:00
Alexandre Duret-Lutz
3e10dba978 python: work around old swig version
Swig 3.0.2 (currently installed by Debian), install strongly typed
enumerator in the main namespace instead of in its own namespace.
This is fixed in latter versions of Swig.

* wrap/python/spot.py: If spot.op does not exists, populated it with all
operators from the spot namespace.
* wrap/python/tests/ltlsimple.py: Use operators from spot.op.
2015-09-28 15:24:52 +02:00
Alexandre Duret-Lutz
8b4ec5ded0 formula: rename the constants for consistency
False/True are problematic in Python, and I don't like that the
enum is op::False but the constructor formula::ff().  So let's
just use ff and tt everywhere, and also eword instead of EmptyWord.

* src/ltlast/formula.hh (False, True, EmptyWord, AP, is_false, is_true):
Rename to...
(ff, tt, eword, ap, is_ff, is_tt): ... these.
* iface/ltsmin/ltsmin.cc, src/ltlast/formula.cc,
src/ltlvisit/apcollect.cc, src/ltlvisit/dot.cc, src/ltlvisit/mark.cc,
src/ltlvisit/mutation.cc, src/ltlvisit/print.cc,
src/ltlvisit/relabel.cc, src/ltlvisit/simpfg.cc,
src/ltlvisit/simplify.cc, src/ltlvisit/snf.cc, src/ltlvisit/unabbrev.cc,
src/twa/acc.cc, src/twa/acc.hh, src/twa/formula2bdd.cc,
src/twaalgos/gtec/gtec.cc, src/twaalgos/hoa.cc, src/twaalgos/ltl2taa.cc,
src/twaalgos/ltl2tgba_fm.cc, src/twaalgos/neverclaim.cc,
src/twaalgos/product.cc, src/twaalgos/remfin.cc, src/twaalgos/safety.cc,
src/tests/parseerr.test, src/tests/utf8.test, wrap/python/spot.py:
Adjust.
2015-09-28 09:06:27 +02:00
Alexandre Duret-Lutz
fad05632a2 python: implement the map and transform functions for formulas
* wrap/python/spot.py: Implement them.
* wrap/python/tests/ltlsimple.py: New tests.
2015-09-28 08:31:53 +02:00
Alexandre Duret-Lutz
b77f7e24c3 revamp the formula hierarchy (montro-patch)
Flatten the formula ltl::formula hiearchy into a single ltl::vnode that
has an enumerator to distinguish the types of node, and a common
interface to access children, update reference counts, etc.  The
ltl::formula class is now a thin wrapper around an ltl::vnode pointer to
keep track of reference counts automatically.  Visitor are not used
anymore; we now have map() and traversor() methods that are more
concise.

This basically fixes #43, but should be followed by some fine tuning
that should now be localized to the formula.hh and formula.cc files.

Some statistics about this patch.  I started working on it on Sep 9, had
a first compiling version two weeks later on Sep 22, and it then took 5
days to fixes the ~70 distincts bugs that were introduced during the
conversion.  About 13200 lines were modified, and one third of those
were removed.

* src/ltlast/formula.cc, src/ltlast/formula.hh: Complete rewrite,
including what was in separate nearby files.
* src/ltlast/allnodes.hh, src/ltlast/atomic_prop.cc,
src/ltlast/atomic_prop.hh, src/ltlast/binop.cc, src/ltlast/binop.hh,
src/ltlast/bunop.cc, src/ltlast/bunop.hh, src/ltlast/constant.cc,
src/ltlast/constant.hh, src/ltlast/multop.cc, src/ltlast/multop.hh,
src/ltlast/unop.cc, src/ltlast/unop.hh, src/ltlvisit/dump.cc,
src/ltlvisit/dump.hh, src/ltlast/predecl.hh: Delete these files.  Their
feature have been merged in formula.hh and formula.cc.
* src/ltlast/visitor.hh, src/ltlvisit/clone.cc, src/ltlvisit/clone.hh,
src/ltlvisit/dump.hh, src/ltlvisit/postfix.cc, src/ltlvisit/postfix.hh:
Delete these files, as we do not use visitors anymore.
* bench/stutter/stutter_invariance_formulas.cc,
bench/stutter/stutter_invariance_randomgraph.cc, doc/org/tut01.org,
doc/org/tut02.org, doc/org/tut10.org, doc/org/tut22.org,
iface/ltsmin/ltsmin.cc, iface/ltsmin/ltsmin.hh,
iface/ltsmin/modelcheck.cc, src/bin/autfilt.cc,
src/bin/common_aoutput.cc, src/bin/common_aoutput.hh,
src/bin/common_finput.cc, src/bin/common_finput.hh,
src/bin/common_output.cc, src/bin/common_output.hh,
src/bin/common_trans.cc, src/bin/common_trans.hh, src/bin/dstar2tgba.cc,
src/bin/genltl.cc, src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc,
src/bin/ltlcross.cc, src/bin/ltldo.cc, src/bin/ltlfilt.cc,
src/bin/ltlgrind.cc, src/bin/randaut.cc, src/bin/randltl.cc,
src/kripke/kripkeexplicit.cc, src/kripke/kripkeexplicit.hh,
src/kripkeparse/kripkeparse.yy, src/ltlast/Makefile.am,
src/ltlenv/declenv.cc, src/ltlenv/declenv.hh, src/ltlenv/defaultenv.cc,
src/ltlenv/defaultenv.hh, src/ltlenv/environment.hh,
src/ltlparse/ltlparse.yy, src/ltlparse/public.hh,
src/ltlvisit/Makefile.am, src/ltlvisit/apcollect.cc,
src/ltlvisit/apcollect.hh, src/ltlvisit/contain.cc,
src/ltlvisit/contain.hh, src/ltlvisit/dot.cc, src/ltlvisit/dot.hh,
src/ltlvisit/exclusive.cc, src/ltlvisit/exclusive.hh,
src/ltlvisit/length.cc, src/ltlvisit/length.hh, src/ltlvisit/mark.cc,
src/ltlvisit/mark.hh, src/ltlvisit/mutation.cc,
src/ltlvisit/mutation.hh, src/ltlvisit/nenoform.cc,
src/ltlvisit/nenoform.hh, src/ltlvisit/print.cc, src/ltlvisit/print.hh,
src/ltlvisit/randomltl.cc, src/ltlvisit/randomltl.hh,
src/ltlvisit/relabel.cc, src/ltlvisit/relabel.hh,
src/ltlvisit/remove_x.cc, src/ltlvisit/remove_x.hh,
src/ltlvisit/simpfg.cc, src/ltlvisit/simpfg.hh,
src/ltlvisit/simplify.cc, src/ltlvisit/simplify.hh, src/ltlvisit/snf.cc,
src/ltlvisit/snf.hh, src/ltlvisit/unabbrev.cc, src/ltlvisit/unabbrev.hh,
src/parseaut/parseaut.yy, src/ta/taexplicit.cc, src/ta/tgtaexplicit.cc,
src/taalgos/minimize.cc, src/taalgos/tgba2ta.cc, src/tests/bare.test,
src/tests/checkpsl.cc, src/tests/checkta.cc,
src/tests/complementation.cc, src/tests/consterm.cc,
src/tests/emptchk.cc, src/tests/equalsf.cc, src/tests/ikwiad.cc,
src/tests/isop.test, src/tests/kind.cc, src/tests/length.cc,
src/tests/ltldo.test, src/tests/ltlfilt.test, src/tests/ltlgrind.test,
src/tests/ltlprod.cc, src/tests/ltlrel.cc,
src/tests/parse_print_test.cc, src/tests/parseaut.test,
src/tests/parseerr.test, src/tests/randtgba.cc, src/tests/readltl.cc,
src/tests/reduc.cc, src/tests/syntimpl.cc, src/tests/taatgba.cc,
src/tests/tostring.cc, src/tests/twagraph.cc, src/tests/utf8.test,
src/twa/acc.cc, src/twa/bdddict.cc, src/twa/bdddict.hh,
src/twa/bddprint.cc, src/twa/formula2bdd.cc, src/twa/formula2bdd.hh,
src/twa/taatgba.cc, src/twa/taatgba.hh, src/twa/twa.cc, src/twa/twa.hh
src/twa/twagraph.cc, src/twa/twagraph.hh, src/twa/twasafracomplement.cc,
src/twaalgos/compsusp.cc, src/twaalgos/compsusp.hh,
src/twaalgos/dtgbasat.cc, src/twaalgos/hoa.cc, src/twaalgos/lbtt.cc,
src/twaalgos/ltl2taa.cc, src/twaalgos/ltl2taa.hh,
src/twaalgos/ltl2tgba_fm.cc, src/twaalgos/ltl2tgba_fm.hh,
src/twaalgos/minimize.cc, src/twaalgos/minimize.hh,
src/twaalgos/neverclaim.cc, src/twaalgos/postproc.cc,
src/twaalgos/postproc.hh, src/twaalgos/powerset.cc,
src/twaalgos/powerset.hh, src/twaalgos/randomgraph.cc,
src/twaalgos/remprop.cc, src/twaalgos/remprop.hh, src/twaalgos/stats.cc,
src/twaalgos/stats.hh, src/twaalgos/stutter.cc, src/twaalgos/stutter.hh,
src/twaalgos/translate.cc, src/twaalgos/translate.hh,
wrap/python/ajax/spotcgi.in, wrap/python/spot.py,
wrap/python/spot_impl.i, wrap/python/Makefile.am,
wrap/python/tests/automata-io.ipynb, wrap/python/tests/formulas.ipynb,
wrap/python/tests/ltl2tgba.py, wrap/python/tests/ltlparse.py,
wrap/python/tests/ltlsimple.py, wrap/python/tests/randltl.ipynb: Adjust
to use the new interface.
* src/sanity/style.test: Accept more C++11 patterns.
* NEWS: Mention the change.
2015-09-26 15:12:24 +02:00
Alexandre Duret-Lutz
0b8c418c94 * wrap/python/spot.py: Typo. 2015-08-21 11:23:11 +02:00
Alexandre Duret-Lutz
a86391ab77 hoaparse: rename to parseaut
Because this parser is not specific to HOA anymore.

* src/hoaparse/Makefile.am, src/hoaparse/fmterror.cc,
src/hoaparse/hoaparse.yy, src/hoaparse/parsedecl.hh,
src/parseaut/public.hh, src/hoaparse/hoascan.ll,
src/tests/hoaparse.test: Rename to...
* src/parseaut/Makefile.am, src/parseaut/fmterror.cc,
src/parseaut/parseaut.yy, src/parseaut/parsedecl.hh,
src/hoaparse/public.hh, src/parseaut/scanaut.ll,
src/tests/parseaut.test: ... these, and also adjust the name internally.
For instance hoa_aut_ptr is now parsed_aut_ptr; hoa_stream_parser is now
automaton_stream_parser, and hoa_parse() has become parse_aut().
* NEWS, README, configure.ac, doc/org/tut20.org, src/Makefile.am,
src/bin/autfilt.cc, src/bin/common_aoutput.cc,
src/bin/common_aoutput.hh, src/bin/common_conv.cc,
src/bin/ltlcross.cc, src/bin/ltldo.cc, src/tests/Makefile.am,
src/tests/complementation.cc, src/tests/ltl2tgba.cc,
src/tests/readsave.test, wrap/python/ajax/spot.in,
wrap/python/spot.py, wrap/python/spot_impl.i,
wrap/python/tests/automata-io.ipynb, wrap/python/tests/parsetgba.py:
Adjust.
2015-06-11 13:31:13 +02:00
Alexandre Duret-Lutz
9f32021e0f lbtt: take options as a string like other print functions
* src/twaalgos/lbtt.hh (print_lbtt): Take a const char* opt argument.
* src/twaalgos/lbtt.cc: Use it, select state-based
vs. transition-based using automaton property, and implement output
for generalized state-based acceptance.
* src/bin/common_aoutput.cc, src/bin/common_aoutput.hh,
src/bin/dstar2tgba.cc: Adjust usage.  We do not need to handle
--lbtt=t as a special case anymore.
* src/tests/lbttparse.test, wrap/python/spot.py,
wrap/python/tests/automata-io.ipynb, wrap/python/tests/piperead.ipynb:
Adjust.
2015-06-10 23:29:41 +02:00
Alexandre Duret-Lutz
b229bfc224 rename hoa_reachable as print_hoa
As actually claimed (but not done) by
738f939ff8.

* src/twaalgos/hoa.hh, src/twaalgos/hoa.cc: Rename it.
* src/bin/common_aoutput.cc, src/bin/dstar2tgba.cc,
src/bin/ltlcross.cc, src/tests/complementation.cc,
src/tests/ltl2tgba.cc, src/tests/randtgba.cc, src/twaalgos/hoa.cc,
wrap/python/spot.py: Adjust.
2015-06-10 00:10:22 +02:00
Alexandre Duret-Lutz
e7f5af6c6a org: add example of LTL->BA translation
This addresses one item in #14.

* doc/org/tut10.org: New file.
* doc/Makefile.am: Add it.
* src/twaalgos/translate.hh: Fix inclusion of types from
postprocessor.
* wrap/python/spot.py (translate): Fix typo in doc string.
2015-06-07 16:51:33 +02:00
Alexandre Duret-Lutz
738f939ff8 adjust names for automata printers
The following renamings are made:

  never_claim_reachable -> print_never_claim
  hoa_reachable   -> print_hoa
  lbtt_reachable  -> print_lbtt
  dotty_reachable -> print_dot
  ltl::dotty      -> print_dot_psl

Fixes #89.

* src/ltlvisit/dotty.cc, src/ltlvisit/dotty.hh, src/taalgos/dotty.cc,
src/taalgos/dotty.hh src/twaalgos/dotty.cc, src/twaalgos/dotty.hh:
Rename...
* src/ltlvisit/dot.cc, src/ltlvisit/dot.hh src/taalgos/dot.cc,
src/taalgos/dot.hh src/twaalgos/dot.cc, src/twaalgos/dot.hh:
... those.
* bench/stutter/stutter_invariance_randomgraph.cc,
iface/ltsmin/modelcheck.cc, src/bin/common_aoutput.cc,
src/bin/dstar2tgba.cc, src/bin/ltl2tgta.cc, src/dstarparse/dra2ba.cc,
src/ltlvisit/Makefile.am, src/taalgos/Makefile.am,
src/tests/checkpsl.cc, src/tests/checkta.cc,
src/tests/complementation.cc, src/tests/emptchk.cc,
src/tests/ltl2tgba.cc, src/tests/ltlprod.cc, src/tests/randtgba.cc,
src/tests/readltl.cc, src/tests/taatgba.cc, src/tests/twagraph.cc,
src/twa/twa.hh, src/twa/twasafracomplement.cc,
src/twaalgos/Makefile.am, src/twaalgos/dtbasat.cc,
src/twaalgos/dtgbasat.cc, src/twaalgos/dupexp.cc,
src/twaalgos/lbtt.cc, src/twaalgos/lbtt.hh,
src/twaalgos/ltl2tgba_fm.cc, src/twaalgos/neverclaim.cc,
src/twaalgos/neverclaim.hh, wrap/python/ajax/spot.in,
wrap/python/spot.py, wrap/python/spot_impl.i,
wrap/python/tests/ltl2tgba.py, wrap/python/tests/parsetgba.py: Adjust.
2015-06-05 21:42:29 +02:00
Alexandre Duret-Lutz
8fb7b279f7 ltlvisit: rename tostring.hh as print.hh and rename printer functions
This actually performs three related changes, but separating them
would be quite inconvenient.

1) rename tostring.hh to print.hh a welcome side-effect is that
I could fix several files that included this file for not reason.

2) de-overload some of the to_string functions, and rename them
as follow:

  to_string -> print_psl, print_sere, str_psl, str_sere
  to_utf8_string -> print_utf8_psl, print_utf8_sere,
                    str_utf8_psl, str_utf8_sere
  to_spin_string -> print_spin_ltl, str_spin_ltl
  to_wring_string -> print_wring_ltl, str_wing_ltl
  to_lbt_string -> print_lbt_ltl, str_lbt_ltl
  to_latex_string -> print_latex_psl, str_latex_psl
  to_sclatex_string -> print_sclatex_psl, str_sclatex_psl

Now it is clearer what these functions do, and their restrictions.

3) all those print_* functions now take the stream to write onto
as their first argument.  This fixes #88.

* src/ltlvisit/tostring.cc, src/ltlvisit/tostring.hh: Rename into...
* src/ltlvisit/print.cc, src/ltlvisit/print.hh: ... those, and make
the changes listed above.
* doc/org/tut01.org, src/bin/common_output.cc,
src/bin/common_trans.cc, src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc,
src/bin/ltlcross.cc, src/bin/ltldo.cc, src/bin/ltlfilt.cc,
src/bin/randltl.cc, src/ltlparse/ltlparse.yy,
src/ltlvisit/Makefile.am, src/ltlvisit/mark.cc,
src/ltlvisit/relabel.cc, src/ltlvisit/simplify.cc,
src/ltlvisit/snf.cc, src/ta/taexplicit.cc, src/ta/tgtaexplicit.cc,
src/taalgos/tgba2ta.cc, src/tests/equalsf.cc, src/tests/ltl2tgba.cc,
src/tests/ltlrel.cc, src/tests/randtgba.cc, src/tests/reduc.cc,
src/tests/syntimpl.cc, src/tests/tostring.cc, src/twa/bdddict.cc,
src/twa/bddprint.cc, src/twa/taatgba.cc, src/twa/taatgba.hh,
src/twa/twagraph.cc, src/twaalgos/compsusp.cc, src/twaalgos/lbtt.cc,
src/twaalgos/ltl2taa.cc, src/twaalgos/ltl2tgba_fm.cc,
src/twaalgos/neverclaim.cc, src/twaalgos/remprop.cc,
src/twaalgos/stats.cc, wrap/python/ajax/spot.in, wrap/python/spot.py,
wrap/python/spot_impl.i: Adjust.
2015-06-04 22:56:57 +02:00
Alexandre Duret-Lutz
8de524adb0 org: add a first code example
The difficulty is not the example, but setting up org-mode to allow
Python and C++ example that use the local libraries, not those
installed system-wide.

* doc/org/.dir-locals.el: Rename as...
* doc/org/.dir-locals.el.in: ... this, so we can easily define
PYTHONPATH and other environment variables.
* doc/org/init.el.in: Enable C++, and make sure but Python
and C++ use the local libraries.
* doc/org/g++wrap.in, doc/org/tut01.org: New files.
* doc/Makefile.am, configure.ac: Adjust.
* wrap/python/spot.py (to_str): Take a parenth argument.
2015-06-03 08:07:23 +02:00
Alexandre Duret-Lutz
19a273929c python: rewrite translate() to deal with unambiguous and sbacc
and make it easier to extend and use.

* src/twaalgos/postproc.hh, src/twaalgos/translate.cc,
src/twaalgos/translate.hh: Incorporate the Unambiguous option
with the other preferences.  It's cleaner this way, and the
previous setup did not work well with Python.
* src/bin/ltl2tgba.cc: Adjust to this change.
* wrap/python/spot.py (translate): Rewrite.
* wrap/python/tests/automata.ipynb: Adjust existing cases, and
add more as well as some comments.
2015-05-15 23:50:19 +02:00
Alexandre Duret-Lutz
a4b63e8e7f dot: heuristic to switch between circles and ellipses
* src/twaalgos/dotty.cc: Add an option (e) to force elliptic shape, and
a heuristic to choose between circle and ellipse by default.
* src/bin/common_aoutput.cc, src/bin/dstar2tgba.cc: Document 'e'.
* src/taalgos/dotty.cc: Ignore 'e'.
* wrap/python/spot.py (setup): Do not force circular states.  The
default should be fine.
* src/tests/det.test, src/tests/dstar.test, src/tests/monitor.test,
src/tests/neverclaimread.test, src/tests/readsave.test,
src/tests/sccdot.test, src/tests/tgbagraph.test: Adjust expected
results.
* NEWS: Adjust.
2015-04-28 18:25:37 +02:00
Alexandre Duret-Lutz
8aa88c2951 dot: --dot=B to use bullets for all automata but Büchi and co-Büchi
* src/twaalgos/dotty.cc: Add option 'B'.
* src/taalgos/dotty.cc: Ignore it.
* src/bin/common_aoutput.cc, src/bin/dstar2tgba.cc: Document it.
* wrap/python/spot.py (setup): Use it by default, and rewrite
the function to be a bit more flexible.
* wrap/python/tests/automata-io.ipynb, wrap/python/tests/automata.ipynb,
wrap/python/tests/piperead.ipynb, wrap/python/tests/randaut.ipynb,
wrap/python/tests/testingaut.ipynb: Use setup() everywhere.
2015-04-28 18:25:10 +02:00
Alexandre Duret-Lutz
5bfed246f9 hoaparse: make it possible to read from a string
* src/hoaparse/public.hh, src/hoaparse/parsedecl.hh,
src/hoaparse/hoascan.ll, src/hoaparse/hoaparse.yy: Implement this new
interface.
* wrap/python/spot.py (automata): Use it when the argument contains
a newline.
* wrap/python/tests/automata-io.ipynb: Test it.
2015-04-27 00:11:29 +02:00
Alexandre Duret-Lutz
c2ae99e779 rename the spot::tgba class as spot::twa
Now that we support any type of omega-accetpance, not just "Generalized
Büchi", it is time to move away from GB and replace it by "ω", written
just w in ASCII.

This just change the name of the tgba class.  This part has to be done
by hand because the word "tgba" occurs in many contexts and a mass
replacement would be wrong.

This will be followed by some automatic renaming of all the derived
types and more.

* src/bin/autfilt.cc, src/bin/randaut.cc, src/kripke/fairkripke.hh,
src/ta/tgta.cc, src/ta/tgta.hh, src/tgba/fwd.hh, src/tgba/taatgba.cc,
src/tgba/taatgba.hh, src/tgba/tgba.cc, src/tgba/tgba.hh,
src/tgba/tgbagraph.hh, src/tgba/tgbaproduct.cc, src/tgba/tgbaproduct.hh,
src/tgba/tgbaproxy.cc, src/tgba/tgbaproxy.hh,
src/tgba/tgbasafracomplement.cc, src/tgba/tgbasafracomplement.hh,
src/tgbaalgos/are_isomorphic.cc, src/tgbaalgos/cleanacc.cc,
src/tgbaalgos/dotty.cc, src/tgbaalgos/dupexp.cc,
src/tgbaalgos/dupexp.hh, src/tgbaalgos/hoa.cc,
src/tgbaalgos/neverclaim.cc, src/tgbaalgos/simulation.cc,
src/tgbaalgos/stutter.cc, src/tgbatest/checkpsl.cc,
src/tgbatest/emptchk.cc, src/tgbatest/ltl2tgba.cc, wrap/python/spot.py,
wrap/python/spot_impl.i: Rename the tgba class into twa.
2015-04-22 16:53:52 +02:00
Etienne Renault
f067dd7871 Add setup method for spot.
* wrap/python/spot.py: here.
* wrap/python/tests/automata.ipynb: tests here.
2015-04-20 13:05:58 +02:00
Etienne Renault
d55c15baf2 Use bdd dictionnary during translation.
* wrap/python/spot.py: here
* wrap/python/tests/automata.ipynb: tests here.
2015-04-20 13:05:58 +02:00
Alexandre Duret-Lutz
39b92a6dea python: fix non-determinism in the test suite.
Some tests calling spot.automaton('non-existing|') where failing either
with a "process returned 127", or, under heavier load, with "failed to
read from...".  The latter occur if we poll() the exit status before the
children has had the tame to finish.

* wrap/python/spot.py: Make sure we wait for the child process if we
reach EOF, so that we can report the error status.
* wrap/python/tests/automata-io.ipynb, wrap/python/tests/piperead.ipynb:
Update.
2015-04-14 17:57:06 +02:00
Alexandre Duret-Lutz
ab7ee2c460 python: fix error handling while reading automata
* wrap/python/tests/run.in: Make it easier to run python with gdb.
* wrap/python/tests/automata-io.ipynb: Add test case.
* wrap/python/spot.py (spot.automata): Make sure p is defined in all
cases.
* src/hoaparse/hoascan.ll: Make sure we do not close a file that
hasn't been opened.
2015-04-13 16:45:05 +02:00
Alexandre Duret-Lutz
16204e8e61 python: better bindings for testing automata
* src/taalgos/dotty.cc, src/taalgos/dotty.hh: Add an interface
similar to that of tgba/dotty.hh, even if we have to ignore
most options.
* src/taalgos/tgba2ta.cc, src/taalgos/tgba2ta.hh: Add an option
to display the intermediate automaton with explicit stuttering
transitions, for the purpose of making demonstrations.
* src/tgba/tgbagraph.hh: Tweak the file so that SWIG can
read it.
* wrap/python/spot.py: Add wrappers for testing automata.
* wrap/python/spot_impl.i: Fix support for
atomic_prop_collect_as_bdd, and include a few more files.
* wrap/python/tests/testingaut.ipynb: New file.
* wrap/python/tests/Makefile.am: Add it.
2015-04-02 18:33:16 +02:00
Alexandre Duret-Lutz
54a8ce502d python: LRU cache for the dot->svg conversion
* wrap/python/spot.py: Here.
2015-04-01 14:44:10 +02:00
Alexandre Duret-Lutz
961d005b84 python: read automata from pipes
* src/hoaparse/hoaparse.yy, src/hoaparse/hoascan.ll,
src/hoaparse/parsedecl.hh, src/hoaparse/public.hh:
Add a way to read automata from a file descriptor.
* wrap/python/spot.py: Add machinery to read from
pipes.
* wrap/python/tests/piperead.ipynb: New file.
* wrap/python/tests/Makefile.am: Add it.
* wrap/python/tests/run.in: Setup PATH.
2015-03-30 21:57:04 +02:00
Alexandre Duret-Lutz
25de479e12 python: add a spot.automata(filename) interface, yielding automata
* src/hoaparse/fmterror.cc, src/hoaparse/public.hh,
src/hoaparse/hoaparse.yy (hoa_stream_parser::parse_strict): New method
that raises an exception whenever a syntax error is encountered.
* src/ltlparse/public.hh (parse_error): Move ...
* src/misc/common.hh: ... here.
* wrap/python/spot_impl.i: Wrap the hoa output.
* wrap/python/spot.py: Implement spot.automata.
* wrap/python/tests/automata-io.ipynb: New test.
* wrap/python/tests/Makefile.am: Add it.
2015-03-27 17:27:12 +01:00
Alexandre Duret-Lutz
838bfb2ae3 dotty: colored acceptance sets
This implement several new options for --dot in order to
allow emptiness sets to be output as colored ⓿ or ❶...
Also add a SPOT_DOTDEFAULT environment variable.

* NEWS, src/bin/man/spot-x.x, src/bin/common_aoutput.cc,
src/bin/dstar2tgba.cc: Document the new options.
* doc/org/.dir-locals.el, doc/org/init.el.in: Setup
SPOT_DOTEXTRA and SPOT_DOTDEFAULT for all documents.
* doc/org/autfilt.org, doc/org/dstar2tgba.org, doc/org/ltl2tgba.org,
doc/org/ltldo.org, doc/org/oaut.org, doc/org/randaut.org,
doc/org/satmin.org: Adjust to this new setup.
* src/misc/escape.cc, src/misc/escape.hh (escape_html): New function.
* src/tgba/acc.cc, src/tgba/acc.hh (to_text, to_html): New method.
* src/tgbaalgos/dotty.cc: Implement the new options.
* src/tgbatest/readsave.test, wrap/python/tests/automata.ipynb: More
tests.
* wrap/python/spot.py: Make sure the default argument for
dotty_reachable is None, so that SPOT_DOTDEFAULT is honored.
2015-03-17 19:28:34 +01:00
Alexandre Duret-Lutz
b6762b7dc9 * wrap/python/spot.py: Typo. 2015-03-16 17:36:49 +01:00
Alexandre Duret-Lutz
3c38780d50 python: some bindings for translating formulas and diplaying automata
* wrap/python/spot.py: Introduce spot.translate (and
spot.formula.translate) as well, as a wrapper around the
spot.translator class.  Also implement spot.tgba.show()
to allow passing argument to dotty_reachable() before
the result is converted to SVG.
* wrap/python/tests/automata.ipynb: New test file.
* wrap/python/tests/Makefile.am: Add it.
2015-03-15 19:50:40 +01:00
Alexandre Duret-Lutz
2362b9ab68 python: improve handling of formulas
* src/misc/escape.hh, src/misc/escape.cc (escape_latex): New function.
* src/ltlvisit/tostring.cc: Escape atomic proposition in LaTeX output.
* wrap/python/spot.py: Make it easy to output formulas in different
syntaxes.  Also allow the AST to be shown.
* wrap/python/spot_impl.i: Catch std::runtime_error.
* wrap/python/tests/formulas.ipynb: New file.
* wrap/python/tests/Makefile.am: Add it.
2015-03-11 21:09:12 +01:00
Thibaud Michaud
3bf3d2c8a1 Adding python functions to mirror the functionalities found in src/bin
* wrap/python/spot.i: Rename to...
* wrap/python/spot_impl.i: ...this, and import spot_impl from spot.py so
that it is not needed to recompile everything when modifying python
code.
* wrap/python/spot.py: Adding python functions to mirror the
functionalities found in src/bin.
* src/bin/common_r.cc: Move simplification level...
* src/ltlvisit/simplify.hh: ... here as a constructor of
ltl_simplifier_options, to make it available in wrap/python.
* src/bin/ltlfilt.cc: Set simplification level using the new
ltl_simplifier_options constructor.
* src/bin/randltl.cc: Move most of the code...
* src/ltlvisit/randomltl.cc, src/ltlvisit/randomltl.hh: ... here, as a
class named randltlgenerator.
* wrap/python/tests/bddnqueen.py, wrap/python/tests/minato.py: Avoid
calling bdd_init twice by moving 'import spot' after bdd initialization.
* wrap/python/Makefile.am: Rename spot to spot_impl
* wrap/python/tests/Makefile.am: Add ipnbdoctest.py.
* wrap/python/.gitignore: Rename spot.py to spot_impl.py
* src/ltlvisit/tostring.cc: \ttrue and \ffalse should be \top and \bot.
* wrap/python/tests/ipnbdoctest.py: Run code cells of a python notebook
and compare the output to the actual content of the notebook.
* wrap/python/tests/randltl.ipynb: Document and test randltl.
* wrap/python/tests/run.in: Call ipnbdoctest.py to run ipython
notebooks.
2015-03-08 00:07:25 +01:00