Commit graph

2989 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
2d13fd50ab python: get ipnbdoctest to work with ipython 3.0
With great help from the first two commits in
https://github.com/paulgb/runipy/pull/49/commits

* wrap/python/tests/ipnbdoctest.py: Update.
2015-03-11 22:47:18 +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
Alexandre Duret-Lutz
a6dbf5cf5e debian: harden version requirements
* debian/control: Make sure libspot-dev and spot have
the same versions.
2015-03-11 16:18:31 +01:00
Alexandre Duret-Lutz
787e3f9315 [buddy] fix undefined behavior
The bug was found while running Spot's src/tgbatest/randpsl.test
on Debian i386 with gcc-4.9.2.  The following call would crash:

./ltl2tgba -R3 -t '(!(F(({{{(p0) |
{[*0]}}:{{{(p1)}[*2]}[:*]}[*]:[*2]}[:*0..3]}[]-> (G(F(p1)))) &
(G((!(p1)) | ((!(p2)) W (G(!(p0)))))))))'

On amd64 the call does not crash, but valgrind nonetheless
report that uninitialized memory is being read by bdd_gbc()
during the second garbage collect.

* src/kernel.h (PUSHREF): Define as a function rather than a macro
to avoid undefined behavior.  See comments for details.
2015-03-10 15:44:08 +01:00
Alexandre Duret-Lutz
ffabbfb048 * debian/rules: Do not hard-code the path to the LTO plugin. 2015-03-09 18:08:37 +01:00
Alexandre Duret-Lutz
5adec9199b debian: build a python3 package
* debian/python3-spot.install: New file.
* Makefile.am: Ship it.
* debian/control, debian/rules, debian/spot.install: Adjust.
2015-03-08 21:22:15 +01:00
Alexandre Duret-Lutz
4ffb0cb98d randltl: some code cleanup
* src/ltlvisit/randomltl.cc, src/ltlvisit/randomltl.hh: Throw
invalid_argument exceptions consistently (not std::string), and use
forwarding constructors to avoid the construct() method.
* src/bin/randltl.cc: Catch the above exceptions.  Destroy
the opts variable right after its use, so that we don't need
explicit destructor calls.
* src/ltltest/rand.test: Add a test.
2015-03-08 13:50:12 +01:00
Alexandre Duret-Lutz
72c7ad9fcd * wrap/python/tests/ipnbdoctest.py: Skip if IPython is missing. 2015-03-08 10:50:17 +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
Alexandre Duret-Lutz
cb9867b7d4 org: fix -o example
* doc/org/oaut.org: Adjust the parameters of randaut so that we get a
mix of deterministic and nondeterministic automata.
2015-03-05 20:42:38 +01:00
Alexandre Duret-Lutz
a0ac8dc512 acc: add a to_cnf() function
* src/tgba/acc.cc, src/tgba/acc.hh (to_cnf, is_cnf): New functions.
* src/bin/autfilt.cc: Add a --cnf-acceptance option.
* src/tgbatest/acc2.test: Test it.
2015-03-05 09:18:46 +01:00
Alexandre Duret-Lutz
b71e6addd2 acc: fix is_dnf()
A Fin() terms with multiple sets should not appear under an And.

* src/tgba/acc.cc (is_dnf): Fix it.
* src/tgbatest/acc.cc, src/tgbatest/acc.test: Augment test case.
2015-03-05 09:18:38 +01:00
Alexandre Duret-Lutz
518de8d5eb acc: implement to_dnf() using BDDs
This way we have for instance
  (Inf(1) | Fin(2)) & (Fin(1) | Inf(3)) & Inf(0)
converted into just
  (Fin(1) & Fin(2) & Inf(0)) | (Inf(0)&Inf(1)&Inf(3))
while previously we would produce 4 terms:
  (Fin(2) & Fin(1) & Inf(0)) | (Fin(2) & (Inf(0)&Inf(3)))
  | (Fin(1) & (Inf(0)&Inf(1))) | (Inf(0)&Inf(1)&Inf(3))

* src/tgba/acc.cc (to_dnf): Recode it.
* src/tgbatest/acc2.test: Adjust.
2015-03-04 22:54:50 +01:00
Alexandre Duret-Lutz
ebe4ffc507 sccinfo: introduce is_rejecting()
Because scc_info does not perform a full emptiness check, it is not
always able to tell whether an SCC is accepting if the acceptance
condition use Fin primitives.  This introduce is_rejecting_scc() in
addition to to is_accepting_scc().  Only one of them may be true, but
they can both be false if scc_info has no idea whether the SCC is
accepting.

* src/tgbaalgos/sccinfo.cc, src/tgbaalgos/sccinfo.hh: Implement
is_rejecting_scc().
* src/bin/ltlcross.cc, src/tgba/acc.cc, src/tgba/acc.hh,
src/tgbaalgos/dtgbacomp.cc, src/tgbaalgos/isweakscc.cc,
src/tgbaalgos/remfin.cc, src/tgbaalgos/safety.cc,
src/tgbaalgos/sccfilter.cc: Use it.
* src/tgbaalgos/dotty.cc: Use is_rejecting_scc() and is_accepting_scc()
to color SCCs.
* doc/org/oaut.org: Document the colors used.
* src/tgbatest/neverclaimread.test, src/tgbatest/readsave.test: Adjust
tests.
* src/tgbatest/sccdot.test: New test case.
* src/tgbatest/Makefile.am: Add it.
2015-03-03 20:32:29 +01:00
Alexandre Duret-Lutz
8658441839 bin: use enums instead of #define for option codes
* src/bin/autfilt.cc, src/bin/common_aoutput.cc,
src/bin/common_finput.cc, src/bin/common_output.cc,
src/bin/common_post.cc, src/bin/common_setup.cc,
src/bin/common_trans.cc, src/bin/dstar2tgba.cc, src/bin/genltl.cc,
src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc, src/bin/ltlcross.cc,
src/bin/ltlfilt.cc, src/bin/ltlgrind.cc, src/bin/randaut.cc,
src/bin/randltl.cc: Here.
2015-03-02 16:55:56 +01:00
Alexandre Duret-Lutz
a530498fbd Fix a bug seen with link-time optimizations enabled.
* src/tgbaalgos/simulation.cc (direct_simulation): Do not store the
original_ automaton as a reference. Otherwise with LTO (+ probably NRVO)
we get a situation where the result automaton (that will be stored in
original_) copies the properties of itself.
2015-03-01 11:20:35 +01:00
Alexandre Duret-Lutz
9454584074 stutter.test: Fix for failure seen on arch linux.
* src/ltltest/stutter.test: Reverse the logic for the test for time, in
case the shell has a builtin version.
2015-03-01 10:48:37 +01:00
Alexandre Duret-Lutz
6bacbe1e92 * src/ltltest/stutter.test: Run time only if present. 2015-03-01 00:15:58 +01:00
Alexandre Duret-Lutz
176a7bf199 debian: include the number of git patches in the version
* configure.ac, debian/changelog.in: Adjust.
* debian/source/format: Distribute this.
* Makefile.am (deb): New target.
2015-02-28 18:24:43 +01:00
Alexandre Duret-Lutz
1f0bb428b0 add a stutter-invariant property to automata
... and show it in the HOA output.  Fixes #60.

* src/tgba/tgba.hh: Add is_stutter_invariant().
* src/tgbaalgos/hoa.cc: Print stutter-invariant
and inherently-weak.
* src/tgbaalgos/ltl2tgba_fm.cc: Set both.
* src/tgbaalgos/are_isomorphic.cc, src/tgbaalgos/complete.cc,
src/tgbaalgos/degen.cc, src/tgbaalgos/dtgbacomp.cc,
src/tgbaalgos/mask.cc, src/tgbaalgos/minimize.cc,
src/tgbaalgos/remfin.cc, src/tgbaalgos/sccfilter.cc,
src/tgbaalgos/simulation.cc, src/tgbaalgos/stutter.cc,
src/tgbatest/hoaparse.test, src/tgbatest/ltldo.test,
src/tgbatest/monitor.test, src/tgbatest/randomize.test,
src/tgbatest/remfin.test, src/tgbatest/sbacc.test: Adjust.
2015-02-28 16:44:06 +01:00
Alexandre Duret-Lutz
566118a5be hoa: add option to output implicit labels
Fixes #59.

* src/tgbaalgos/hoa.cc: Add option i.
* src/bin/common_aoutput.cc, src/bin/dstar2tgba.cc,
src/tgbaalgos/hoa.hh: Document it.
* src/tgbatest/hoaparse.test: Test it.
2015-02-28 12:50:33 +01:00
Alexandre Duret-Lutz
5749fe6f7c * src/tgbaalgos/isweakscc.cc (is_inherently_weak_scc): Allow Fin. 2015-02-28 00:06:17 +01:00
Alexandre Duret-Lutz
b396f373fa debian: First attempt at creating Debian packages
* debian/: New directory.
* Makefile.am, README: Add it.
* configure.ac: Generate debian/changelog.
2015-02-28 00:06:00 +01:00
Etienne Renault
e05ec12b37 Clang needs explicit copy-initialization for sets.
* src/tgba/acc.cc: here.
2015-02-27 14:50:57 +01:00
Etienne Renault
734bceff8e random: Get rid of uniform_distribution (non-portable).
* src/misc/random.cc, src/misc/random.hh,
src/tgbaalgos/randomgraph.cc, src/tgbatest/randaut.test,
src/tgbatest/randomize.test, src/tgbatest/readsave.test,
src/ltlvisit/simplify.cc, src/tgbaalgos/randomize.cc,
src/graph/graph.hh, src/tgbatest/randpsl.test: here.
2015-02-27 14:17:07 +01:00
Etienne Renault
5610d10ac3 simplify: resolve assertion failed.
* src/ltltest/reduc0.test, src/ltlvisit/simplify.cc: here.
2015-02-27 14:17:07 +01:00
Alexandre Duret-Lutz
58da54e79a * src/tgbaalgos/remfin.cc: Purge unreachable states. 2015-02-26 17:44:47 +01:00
Alexandre Duret-Lutz
f93fc98655 More files to ignore 2015-02-26 17:30:02 +01:00
Alexandre Duret-Lutz
7bac775ad4 Bump version to 1.99b to celebrate support for generic acceptance
* configure.ac: Bump version.
* NEWS: Update description of HOA support.
2015-02-26 17:30:02 +01:00
Alexandre Duret-Lutz
b321a410d5 org: more documentation
* doc/org/oaut.org: Mention --dot=a.
* doc/org/autfilt.org: Update list of transformations.
2015-02-26 17:30:02 +01:00
Alexandre Duret-Lutz
af1d05fd13 bin: better documentation for --hoaf=s
* src/bin/common_aoutput.cc, src/bin/dstar2tgba.cc: Here.
2015-02-26 17:30:02 +01:00
Alexandre Duret-Lutz
5b3034b605 dot: add an option to display the acceptance
* src/tgbaalgos/dotty.cc: Display the acceptance if "a" is used.
* src/bin/common_aoutput.cc, src/bin/dstar2tgba.cc,
src/tgbaalgos/dotty.hh: Document it.
* src/tgbatest/readsave.test: Test it.
2015-02-26 17:30:01 +01:00
Alexandre Duret-Lutz
095ac93b5b postproc: make sure WDBA have an acceptance set if BA is desired
* src/tgbaalgos/postproc.cc: Here.
* src/tgbatest/ltl2tgba.test: Make sure ltl2tgba -B 0 has one
acceptance set.
2015-02-26 17:30:01 +01:00
Alexandre Duret-Lutz
f0b1b9438f Prefix many algorithms with runtime_error for unexpected acceptance
* src/tgba/tgbagraph.cc (merge_transitions): Disable acceptance
merging if Fin acceptance is used.
* src/tgbaalgos/degen.cc, src/tgbaalgos/dtbasat.cc,
src/tgbaalgos/dtgbasat.cc, src/tgbaalgos/isweakscc.cc,
src/tgbaalgos/lbtt.cc, src/tgbaalgos/minimize.cc,
src/tgbaalgos/neverclaim.cc, src/tgbaalgos/safety.cc,
src/tgbaalgos/sccfilter.cc, src/tgbaalgos/simulation.cc: Throw an
exception if an unsupported type of acceptance is received.
2015-02-26 17:30:01 +01:00
Alexandre Duret-Lutz
da2ccdb2ed * src/tgbaalgos/hoa.cc: Use is_buchi() and is_true(). 2015-02-26 17:30:01 +01:00
Alexandre Duret-Lutz
5b2c7b55ed acc: refactor strip() routines
* src/tgba/acc.cc, src/tgba/acc.hh: Move the strip() routine from
acc_cond into acc_cond::mark_t, and the strip() routine from
cleanacc.cc into acc_cond::acc_code.  Introduce helper functions
to create inf()/fin()/t()/f() at the acc_code level.
* src/tgbaalgos/cleanacc.cc: Simplify, using the strip() function
from acc_code.
* src/tgbaalgos/mask.cc (mask_acc_sets): Use the strip() function
from acc_code so that it work on non-Buchi acceptance.
* src/tgbatest/maskacc.test: Add a test for the latter change.
* src/tgbaalgos/sccfilter.cc, src/tgbatest/acc.cc: Adjust the
use mark_t::strip().
2015-02-26 17:30:01 +01:00
Alexandre Duret-Lutz
717c857794 ltlcross: adjust to work with generic acceptance
* src/bin/ltlcross.cc: Remove Fin-acceptance before
doing checks.  More --verbose output.
* src/tgba/acc.cc, src/tgba/acc.hh: Add an eval_sets() function
to find the set of acceptance sets needed to satisfy the condition
in an accepting SCC.
* src/tgbaalgos/gtec/ce.cc: Use eval_sets() when computing
a counter example.
* src/tgbaalgos/gtec/gtec.cc: Raise an exception when called
on an acceptance that contains Fin.
* src/tgbatest/ltl2dstar3.test, src/tgbatest/ltlcrossce2.test:
New files.
* src/tgbatest/Makefile.am: Add them.
* src/tgba/tgba.cc (is_empty): Call remove_fin if needed.
* src/tgbaalgos/product.cc, src/tgbaalgos/dtgbacomp.cc: Adjust
to work with generic acceptance.
2015-02-26 17:30:01 +01:00
Alexandre Duret-Lutz
9ccbc34964 remfin: introduce less acceptance sets for interferences
Instead of adding one set per term in the DNF, reuse the
removed Fin(x) sets as Inf(x) sets.

* src/tgbaalgos/remfin.cc: Here.
* src/tgbatest/remfin.test: Additional test.
2015-02-26 17:30:01 +01:00
Alexandre Duret-Lutz
83dfb4a971 remfin: cleanup acceptance
* src/tgbaalgos/remfin.cc: Call cleanup_acceptance().
* src/tgbatest/remfin.test: Adjust.
2015-02-26 17:30:01 +01:00
Alexandre Duret-Lutz
d597050f6d Make it easy to complement an acceptance condition
* src/tgba/acc.cc, src/tgba/acc.hh (complement): New method.
* src/bin/autfilt.cc: Add a --complement-acceptance option.
* src/tgbatest/acc2.test: Test it.
2015-02-26 17:30:01 +01:00
Alexandre Duret-Lutz
659107a000 Add a cleanup_acceptance() algorithm
* src/tgbaalgos/cleanacc.cc, src/tgbaalgos/cleanacc.hh: New file.
* src/tgbaalgos/Makefile.am: Add them.
* src/tgba/acc.hh, src/tgba/tgba.hh (get_acceptance): Return a
reference.
* src/bin/autfilt.cc: Add a --cleanup-acceptance option.
* src/tgbatest/hoaparse.test: Test it.
2015-02-26 17:30:01 +01:00
Alexandre Duret-Lutz
85508a0ea6 Add a remove_fin() algorithm
* src/bin/autfilt.cc: Add remove_fin().
* src/tgba/acc.cc, src/tgba/acc.hh: Add is_dnf() and simplify eval().
* src/tgbaalgos/remfin.cc, src/tgbaalgos/remfin.hh: New files.
* src/tgbaalgos/Makefile.am: Add them.
* src/tgbatest/remfin.test: New file.
* src/tgbatest/Makefile.am: Add it.
2015-02-26 17:30:01 +01:00
Alexandre Duret-Lutz
1441c4fe34 acc: add a to_dnf() method
* src/tgba/acc.cc, src/tgba/acc.hh: Implement a to_dnf()
method.
* src/bin/autfilt.cc: Add option --dnf-acceptance.
* src/tgbatest/acc2.test: Test it.
2015-02-24 15:32:15 +01:00
Alexandre Duret-Lutz
de586dd2f0 stats: use %g to print the (generic) acceptance condition
* src/tgbaalgos/stats.cc, src/tgbaalgos/stats.hh: Implement %g.
* src/bin/common_aoutput.cc, src/bin/common_aoutput.hh:
Document it, and also implement %G.
* src/tgbatest/acc2.test: New file.
* src/tgbatest/Makefile.am: Add it.
2015-02-23 17:12:12 +01:00
Alexandre Duret-Lutz
33c496a4bb acc: Add operators == and != for acc_code
and make sure are_isomorphic does not look only at the number of
acceptance sets

* src/tgba/acc.hh: Here.
* src/tgbaalgos/are_isomorphic.cc: Use it to ensure two automata
have the same acceptance condition.
* src/tgbatest/explpro4.test: Test product between Büchi and co-Büchi,
and make sure the isomorphic check look at the acceptance condition.
2015-02-23 17:12:12 +01:00
Alexandre Duret-Lutz
039274b238 sbacc: Make sure it also work for non-TGBA
* src/tgbatest/sbacc.test: Adjust test case.
2015-02-23 17:12:11 +01:00
Alexandre Duret-Lutz
f325cddc1c acc: avoid superfluous parentheses when printing acceptance
* src/tgba/acc.cc: Do not output (Inf(x)) or (Fin(x)).
* src/tgbatest/acc.test: Adjust.
2015-02-23 17:12:11 +01:00
Alexandre Duret-Lutz
76c676dba0 rename set_acceptance_conditions as set_generalized_buchi
* src/hoaparse/hoaparse.yy, src/tgba/tgbagraph.hh,
src/tgbaalgos/compsusp.cc, src/tgbaalgos/dtgbasat.cc,
src/tgbaalgos/mask.cc, src/tgbaalgos/randomgraph.cc,
src/tgbaalgos/sccfilter.cc, src/tgbaalgos/simulation.cc,
src/tgbaalgos/stripacc.cc, src/tgba/tgba.hh: Here.
2015-02-23 17:12:11 +01:00
Alexandre Duret-Lutz
fd1f6c4d61 Preliminirary support for generic acceptance.
* src/tgba/acc.hh: Add creation and printing of generic acceptance
code.
* src/tgba/acc.cc: New file.
* src/tgba/Makefile.am: Add it.
* src/tgbatest/acc.cc: More tests.
* src/tgbatest/acc.test: Update.
* src/tgba/tgba.hh (set_acceptance, get_acceptance): New methods.
* src/tgba/tgbagraph.hh: Store acceptance code.
* src/hoaparse/hoaparse.yy: Read any acceptance.
* src/dstarparse/nsa2tgba.cc, src/ta/taexplicit.cc,
src/tgba/tgbaproduct.cc, src/tgba/tgbasafracomplement.cc,
src/tgbaalgos/degen.cc, src/tgbaalgos/hoa.cc,
src/tgbaalgos/ltl2taa.cc, src/tgbaalgos/ltl2tgba_fm.cc,
src/tgbaalgos/product.cc, src/tgbaalgos/stutter.cc,
src/tgbatest/hoaparse.test: Adjust.
2015-02-23 17:12:11 +01:00
Alexandre Lewkowicz
c61f053e2d transform: copy and accessible versions
* src/tgbaalgos/mask.cc, src/tgbaalgos/mask.hh: Rename transform_mask
to accessible_mask. Add Copy version and use it in mask_keep_states().
* src/tgbatest/maskkeep.test: Update.
2015-02-19 23:47:04 +01:00