Commit graph

537 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
0a21a4c87e ltsmin: catch exceptions by reference
* spot/ltsmin/ltsmin.cc, tests/ltsmin/modelcheck.cc: Here.
2017-06-20 17:29:48 +02:00
Alexandre Duret-Lutz
05abed6d2f translate: use relabel_bse() to speed translations with a lot of APs
Fixes #268, reported by Yann Thierry-Mieg.

* spot/twaalgos/translate.cc, spot/twaalgos/translate.hh: Call
relabel_bse() + relabel_here().
* tests/core/format.test: Add a test case.
* bin/spot-x.cc, NEWS: Document the change.
2017-06-20 15:19:00 +02:00
Alexandre Duret-Lutz
0bc1dd4446 relabel_here: make it compatible with relabel_bse
* spot/twaalgos/relabel.cc: Deal with the cases where the substitution
value is a Boolean formula.
* spot/twaalgos/relabel.hh: Improve documentation.
* tests/python/relabel.py: Add more tests.
* python/spot/impl.i: Add bindings for are_isomorphic for the above
test.
* NEWS: Mention the news.
2017-06-20 15:19:00 +02:00
Alexandre Duret-Lutz
413d2d6a6c stats: fix slow %s and inappropriate %S output
Fixes #269.

* spot/twaalgos/stats.cc: Use twa_statistics instead of
twa_sub_statistics when %t is not used.
* bin/common_aoutput.cc: Likewise, also fix %S to use twa_statistics
instead of num_states(), and document that %s,%t,%e all return
statistics about the reachable part of the automaton.
* tests/core/format.test: Add more tests.
* NEWS: Document the issue.
2017-06-19 17:53:03 +02:00
Thomas Medioni
7b5b8f34f0 streett_to_generalized_buchi() now works on Streett-like
* NEWS: Mention the modification.
* spot/twaalgos/remfin.cc: Adapt to avoid infinite recursion.
* spot/twaalgos/totgba.cc: Work on Streett-like.
* tests/Makefile.am, tests/python/streett_totgba.py: Tests the
  modification.
* tests/core/remfin.test: Fix one test case that is now handled by
  the modification.
2017-06-08 10:49:09 +02:00
Thomas Medioni
a12d676bdc introduce spot::simplify_acceptance()
Simplify some automata where some marks are identical,
or complementary to another. Fixes #216.

* NEWS: mention the new function.
* spot/twaalgos/cleanacc.cc, spot/twaalgos/cleanacc.hh: Implement
  the function.
* tests/Makefile.am, tests/python/merge.py: Test this implementation.
2017-06-08 10:46:29 +02:00
Thomas Medioni
22620e185c style: allow the use of initializer-lists in if
* tests/sanity/style.test: Allow initializer-lists in ifs.
2017-06-08 10:46:29 +02:00
Alexandre Duret-Lutz
1042a8dae1 libtool: surrender to Debian's castrated libtool
The libtool version distributed by Debian is patched to *not* propagate
dependencies (i.e., if libA depends on libB, then linking against libA
will not automatically link against libB, it has to be explicit),
contrary to what the Libtool manual document.  So now we explicitly
link against both libA and libB in such case.

* configure.ac: Remove the workaround that does not work for
MinGW.
* doc/org/compile.org: Mention the issue.
* bin/Makefile.am, tests/Makefile.am, spot/ltsmin/Makefile.am,
spot/gen/Makefile.am, doc/org/g++wrap.in: Make the dependencies
explicit.
2017-06-07 20:34:05 +02:00
Etienne Renault
4de44b42de ikwiad: fix accepting run printing
* tests/core/ikwiad.cc: here.
2017-06-07 17:05:25 +02:00
Maximilien Colange
4f8a8f7305 Properly handle "simulated-states" property in twagraph::defrag_states.
* spot/twa/twagraph.cc: Implement the change.
* spot/twaalgos/simulation.hh: Improve documentation.
* tests/python/simstate.py: Improve the test.
* doc/org/concepts.org: Typo.
2017-06-05 15:48:36 +02:00
Alexandre Duret-Lutz
acbb51062a * tests/core/ltlcross4.test: Ignore space diff in pandas' output. 2017-06-03 12:21:24 +02:00
Alexandre Duret-Lutz
dbcde8e346 work around change in pandas 0.20
* tests/core/ltlcross4.test: Replace describe() by agg() to work
around a backward incompatible change in pandas 0.20.
2017-06-02 19:07:34 +02:00
Alexandre Duret-Lutz
9ab4b840fd simulation: do not depend on bdd numbers for ordering classes
Fixes #262 again.  Reported by Maximilien Colange.

* spot/twaalgos/simulation.cc: Use state numbers to order classes, not
their signatures.  The problem was that even if two simulation of the
same automaton assign the same signature, the BDD identifier used for
that signature might be different, and therefore the ordering obtained
by using BDDs as keys in a map can be different.  A side-effect of
this change is that the order of states in automata produced by
simulation-based reduction may change; many tests had to be updated.
* tests/core/ltl2tgba.test: Add a new test case based on Maximilien's
report.
* tests/core/complement.test, tests/core/det.test,
tests/core/parseaut.test, tests/core/prodor.test, tests/core/scc.test,
tests/python/atva16-fig2a.ipynb, tests/python/automata.ipynb,
tests/python/decompose.ipynb, tests/python/decompose_scc.py,
tests/python/highlighting.ipynb, tests/python/piperead.ipynb,
tests/python/sccinfo.py, tests/python/simstate.py,
tests/python/testingaut.ipynb, tests/python/word.ipynb: Update
test case for new order of states.
2017-06-02 14:10:34 +02:00
Alexandre Duret-Lutz
101c2533f1 sanity: ensure that all environment variables are documented
* tests/sanity/getenv.test: New file.
* tests/Makefile.am: Add it.
* bin/man/spot-x.x: Document SPOT_STUTTER_CHECK and SPOT_DEBUG_PARSER.
2017-05-31 20:32:56 +02:00
Alexandre Duret-Lutz
93969758ee sanity: catch undocumented named properties
* tests/sanity/namedprop.test: New file.
* tests/Makefile.am: Add it.
* doc/org/concepts.org: Add documentation for degen-levels and
simulated-states.
2017-05-31 20:32:53 +02:00
Alexandre Duret-Lutz
97f3efabe3 dot: fix printing of alternating automata
Related to #208.

* spot/twaalgos/dot.cc: Fix missing definitions of universal nodes,
and inclusion of universal nodes inside of SCC when none of the
destination comes back to the SCC.
* tests/python/_altscc.ipynb: Adjust and add more test cases.
* tests/core/alternating.test, tests/core/neverclaimread.test,
tests/core/readsave.test, tests/core/sccdot.test,
tests/python/decompose.ipynb: Adjust test cases.
* NEWS: Mention the bug.
2017-05-31 17:55:15 +02:00
Alexandre Duret-Lutz
617a7187b3 scc_info: keep track of common acceptance sets
* spot/twaalgos/sccinfo.hh, spot/twaalgos/sccinfo.cc: Do it.
* tests/core/sccdot.test: Add a test case.
* NEWS: Mention it.
2017-05-31 17:18:03 +02:00
Alexandre Duret-Lutz
78add1d44b acc: add a maybe_accepting() method
* spot/twa/acc.cc, spot/twa/acc.hh: Implement the new method, and
use it to implement inf_accepting().
* tests/python/accparse2.py: Add some tests.
2017-05-31 17:18:03 +02:00
Maximilien Colange
f7d14ab526 Degeneralization keeps track of levels.
* NEWS: Document this.
* spot/twa/twagraph.cc: `copy_state_names_from` handles this new info.
* spot/twaalgos/degen.hh, spot/twaalgos/degen.cc: Implement it.
* tests/python/origstate.py, tests/python/simstate.py: Update tests to
  reflect the change.
2017-05-31 13:28:42 +02:00
Maximilien Colange
7b5ab54530 Simulation keeps track of simulated states in the input automaton.
* NEWS: Document the change.
* spot/twaalgos/simulation.cc: Implement the change.
* spot/twa/twagraph.cc: `copy_state_names_from` uses simulated states
  info if present.
* spot/twaalgos/determinize.cc: Pretty-print in determinization follows
  simulated states, avoiding possible confusion.
* tests/Makefile.am, tests/python/simstate.py: Add a test.
2017-05-31 13:28:41 +02:00
Alexandre Duret-Lutz
425620150a scc_info: make it possible to ignore or cut edges
* spot/twaalgos/sccinfo.hh, spot/twaalgos/sccinfo.cc: Take
a filter function as optional argument.
* tests/core/sccif.cc, tests/core/sccif.test: New files.
* tests/Makefile.am, tests/core/.gitignore: Adjust.
* NEWS: Mention the new feature.
2017-05-30 15:40:28 +02:00
Thomas Medioni
4da6a5cde1 rs_like: fix bug to accept Fin | Fin , Inf & Inf
co-Büchi is now recognized as Streett-like, Büchi as Rabin-like.
Also recognized Inf & Inf & Inf... as Streett-like and
Fin | Fin | Fin... as Rabin-like.

* spot/twa/acc.cc: Fix the bug
* tests/python/rs_like.py: Add some test case
2017-05-29 11:45:02 +02:00
Alexandre Duret-Lutz
acdaaac4f0 bin: release all subformulas between runs
Fixes #262, reported by Maximilien Colange.

* bin/common_output.cc, bin/common_aoutput.cc, bin/common_aoutput.hh:
Clear the set of atomic propositions if --stats=%[...]x was used.
* spot/twa/bdddict.cc: Release any formula associated to a BDD when it
is unregistered, do not wait for the dictionary's destruction.  This
was the main culprit for #262.
* tests/core/ltl2tgba.test: Add test cases.
* NEWS: Mention the bug.
2017-05-18 18:24:49 +02:00
Alexandre Duret-Lutz
f07fbbae79 ltl2tgba: clear simplification cache between translations
The cache used in formula simplification will keep atomic propositions
defined between several translations, and may impact variable order.
Reported by Maximilien Colange.

* spot/tl/simplify.hh, spot/tl/simplify.cc,
spot/twaalgos/translate.cc, spot/twaalgos/translate.hh (clear_cache):
New method.
* bin/ltl2tgba.cc, bin/ltl2tgta.cc: Call it.
* spot/twaalgos/stats.cc: Do not keep a point to the formula after
printing statistics.
* tests/core/ltl2tgba.test: Add a test case.
* tests/core/readsave.test: Adjust one formula.
* NEWS: Mention the issue.
2017-05-10 16:18:37 +02:00
Alexandre Duret-Lutz
8e19d3f47e scc_info: introduce edges_of() and inner_edges_of()
This is motivated by some upcoming patch by Heňo.

* spot/twaalgos/sccinfo.hh (edges_of, inner_edges_of): New methods.
* spot/twaalgos/sccinfo.cc, spot/twaalgos/strength.cc: Use them.
* spot/twa/twagraph.hh (edge_number): Add an overload.
* python/spot/impl.i: Bind the new methods.
* tests/python/sccinfo.py: Add tests.
* NEWS: Mention the changes.
2017-05-09 22:12:42 +02:00
Alexandre Duret-Lutz
845958834f simplify: fix related to event_univ handling
Fixes #260.  Reported by František Blahoudek.

The simplification F(f)|q = F(f|q), where q designates an event_univ
formula, was not always applied because of a couple of issue: (1) the
mospliter was ignoring event_univ unless favor_event_univ was set, (2)
when processing formulas from res_EventUniv they were not put back
into res_F or res_G to be subject to the F/G rules.

* spot/tl/simplify.cc: Improve handling of the above points.
* tests/core/reduccmp.test: Adjust and add test case.
* tests/core/ltl2tgba2.test, tests/python/atva16-fig2a.ipynb: Adjust.
2017-05-08 11:52:41 +02:00
Alexandre Duret-Lutz
19aae6f9cf introduce spot::split_edges()
Fixes #255.

* spot/twaalgos/split.cc, spot/twaalgos/split.hh,
tests/core/split.test: New files.
* spot/twaalgos/Makefile.am, tests/Makefile.am: Add them.
* bin/autfilt.cc (--split-edges): New option.
* python/spot/impl.i: Process split.hh.
* tests/python/alternating.py: Test split_edges() on
an alternating automaton.
2017-05-05 22:25:12 +02:00
Alexandre Duret-Lutz
679b6cff78 degen: consider incoming edges to select initial levels
Fixes #257.

* spot/twaalgos/degen.cc: Implement this optimization.
* tests/core/degendet.test: Add a few test cases.
* tests/core/ltl2tgba2.test: Adjust expected sizes.
* NEWS: Mention the change.
2017-05-05 16:50:04 +02:00
Alexandre Duret-Lutz
e1c14eb90a twa_graph: honor state-names & product-states in format_state()
* spot/twa/twagraph.cc, spot/twa/twagraph.hh (format_state): Honor
the state-names and product-states properties.
* tests/python/highlighting.ipynb: Adjust.
2017-05-05 14:44:06 +02:00
Alexandre Duret-Lutz
46d8aaaae1 twa_graph: introduce copy_state_names_from()
* spot/twa/twagraph.cc, spot/twa/twagraph.hh: Here.  Also
make sure "original-states" survives defrag_states().
* NEWS: Mention it.
* tests/python/origstate.py: New file.
* tests/Makefile.am: Add it.
2017-05-05 14:44:06 +02:00
Alexandre Duret-Lutz
b6808115b9 bin: remove temporary files even on errors
Fixes #259.

* bin/common_setup.cc: Register a cleanup_tmpfiles() via atexit.
* tests/core/ltldo.test: Add a test case.
* NEWS: Mention the bug.
2017-05-04 15:35:17 +02:00
Alexandre Duret-Lutz
172bee495a minimize_dfa: use the twa_graph interface
Fixes #233, although more cleanup would be welcome.

* spot/twaalgos/minimize.cc: Replace the uses of twa methods by
twa_graph methods, and simplify some data structures.
* tests/core/acc_word.test, tests/core/readsave.test,
tests/python/automata.ipynb: Adjust changed output due
to different data structures.
2017-05-01 22:10:29 +02:00
Alexandre Duret-Lutz
469d8067e0 gen: another automaton family
* spot/gen/automata.hh, spot/gen/automata.cc,
bin/genaut.cc: Introduce L_DSA.
* tests/core/genaut.test: Add quick test.
2017-04-28 13:32:48 +02:00
Alexandre Duret-Lutz
ae78e1d2b2 gen: set more properties in automata
* spot/gen/automata.cc: Set more properties.
* tests/python/gen.py: Check that they are set.
2017-04-28 13:32:48 +02:00
Alexandre Duret-Lutz
ec51f976f8 gen: introduce a new automaton family
* spot/gen/automata.cc, spot/gen/automata.hh: Define AUT_L_NBA.
* bin/genaut.cc (--l-nba): New option.
* bin/man/genaut.x, doc/org/genaut.org, NEWS: Document it.
* tests/python/gen.py, tests/core/genaut.test: Test it.
2017-04-28 13:32:42 +02:00
Alexandre Duret-Lutz
649793df75 gen: pass the bdd_dict to aut_pattern()
* spot/gen/automata.hh (aut_pattern): Add the dict argument.
* spot/gen/automata.cc, python/spot/gen.i: Adjust.
* tests/python/gen.py: Make sure two automata built without
specifying any dictionary share the same one.
2017-04-28 13:32:03 +02:00
Alexandre Duret-Lutz
11ca2803c9 gen: hide ks_cobuchi(), introduce aut_pattern()
* spot/gen/automata.hh, spot/gen/automata.cc: Hide ks_cobuchi() behind
introduce aut_pattern(), as we have already done for the formulas.
* bin/genaut.cc: Simplify using this interface.
* python/spot/gen.i: Introduce aut_patterns().
* tests/python/gen.ipynb, tests/python/gen.py: Adjust.
2017-04-28 13:32:03 +02:00
Alexandre Duret-Lutz
ca7f72bb4b gen: prefix ltl_pattern identifiers with LTL_
This helps with autocompletion in IPython, and it will prevent us from
mixing LTL patterns with automata patterns (once we have more than one
automata generator).

* spot/gen/formulas.hh: Here.
* spot/gen/formulas.cc, bin/genltl.cc, tests/python/gen.ipynb,
tests/python/gen.py: Adjust.
2017-04-28 13:32:03 +02:00
Alexandre Duret-Lutz
540b971355 gen: rename genltl() to ltl_pattern() and introduce ltl_patterns()
* spot/gen/formulas.hh, spot/gen/formulas.cc (genltl): Rename as...
(ltl_pattern): This.
(ltl_pattern_max): New function.
* bin/genltl.cc: Adjust names, and simplify using ltl_pattern_max().
* python/spot/gen.i (ltl_patterns): New function.
* tests/python/gen.py: Test it.
* tests/python/gen.ipynb: New file to document the spot.gen package.
* tests/Makefile.am, doc/org/tut.org: Add gen.ipynb.
2017-04-26 15:06:02 +02:00
Alexandre Duret-Lutz
8939e0dd50 genltl: move all formula generation code to spot/gen/
Fixes #254.

* spot/gen/formulas.cc, spot/gen/formulas.hh: New files.
* spot/gen/Makefile.am: Add them.
* spot/Makefile.am: Fix build order.
* bin/genltl.cc: Move most code to the above files and adjust.
* bin/Makefile.am: Link genltl with libspotgen.
* doc/org/arch.tex: Adjust picture to show that genltl uses
libspotgen.
* python/spot/gen.i: Include formulas.hh.
* tests/python/gen.py: Make sure genltl() and ltl_pattern_name()
can be called.
2017-04-25 18:14:15 +02:00
Maximilien Colange
17bbef6cce Check that automata produced by ks_cobuchi are state-based.
* tests/python/gen.py: implement the check.
2017-04-24 14:03:04 +02:00
Alexandre Duret-Lutz
f185aabf44 python: add wrapper for libspotgen
For #254.

* python/spot/gen.i, tests/python/gen.py: New files.
* python/Makefile.am, tests/Makefile.am: Adjust.
* NEWS: Mention the spot.gen python package.
2017-04-23 17:24:23 +02:00
Alexandre Duret-Lutz
d25cdd4c6c ks_cobuchi: forbid n=0
* spot/gen/automata.hh: State the precondition.
* spot/gen/automata.cc: Catch n==0.
* tests/core/genaut.test: Test it.
2017-04-22 21:19:00 +02:00
Alexandre Duret-Lutz
586f0cce7b sanity: ensure all binaries are documented
* tests/sanity/bin.test: New file.
* tests/Makefile.am: Run it.
2017-04-22 14:19:59 +02:00
Alexandre Duret-Lutz
e4a5bf8192 genaut: minor fixes and add test case
* bin/genaut.cc: Use RANGE instead of N, and document it.
Output the FORMAT documentation, and fix handling of %F and %L.
* tests/core/genaut.test: New file.
* tests/Makefile.am: Add it.
2017-04-22 11:00:50 +02:00
Thomas Medioni
b428ed31ec Implements is_streett_like() and streett_like_pairs(), is_rabin_like...
Adds the method spot::acc_cond::is_streett_like() that behaves like
spot::acc_cond::is_streett() except that it works on a wider range
of acceptance conditions, called Streett-like. Also adds
spot::acc_cond::streett_like_pairs() that returns a boolean assessing
whether the acceptance condition is Streett-like and also returns all
the Streett_like pairs.
Defines the new struct type spot::acc_cond::rs_pair.
Similarily, Adds the methods spot::acc_cond::is_rabin_like() and
spot::acc_cond::rabin_like_pairs().

* NEWS: Mention this modification
* python/spot/impl.i: Declares the new struct to SWIG, and defines
the streett_like_pairs() vector as an output parameter, which makes
the python code return a tuple (boolean, vector) rather than a
pass-by-reference vector.
* spot/twa/acc.cc, spot/twa/acc.hh: Declares an implements the new
methods and the new nested struct.
* tests/Makefile.am: Add new tests to the suite
* tests/python/rs_like.py: Tests the new methods and
the SWIG bindings.
2017-04-21 16:24:08 +02:00
Alexandre Duret-Lutz
07c2dd3b64 introduce original-states
* spot/twaalgos/degen.cc, spot/twaalgos/degen.hh,
spot/twaalgos/mask.hh: Store original states in "original-states"
properties.
* spot/twaalgos/dot.cc: Add support for option 'd'.
* bin/common_aoutput.cc: Document it.
* doc/org/concepts.org, NEWS: Document "original-states".
* tests/core/readsave.test: Add some tests.
2017-04-20 20:07:30 +02:00
Thomas Medioni
cc3bdfcd2e mark_t: sets() no longer returns a vector
spot::mark_t::sets() was modified so that it now returns an iterable
object rather than an std::vector<unsigned>.

* NEWS: Mention the modification.
* python/spot/impl.i: Declares mark_container as iterable to SWIG.
* spot/parseaut/parseaut.yy: Adapts to the modification.
* spot/twa/acc.hh: Implement the modification.
* tests/python/acc_cond.ipynb: Adapts to the modification.
2017-04-20 14:06:57 +02:00
Alexandre Duret-Lutz
9377db2e5e sbacc: fix a serious bug
Reported by Thibaud Michaud

* spot/twaalgos/sbacc.cc: Do not label rejecting SCCs with the empty
mark, as it might be accepting.
* tests/core/sbacc.test: Add test cases.
* NEWS: Mention the bug.
2017-04-19 18:46:35 +02:00
Thomas Medioni
0d884d4a93 autfilt: Add --dualize option
* NEWS: Mention this addition.
* bin/autfilt.cc: Add dualize option
* tests/Makefile.am: Add dualize option test file to the suite.
* tests/core/dualize.test: Test the dualize option.
2017-04-07 17:15:39 +02:00