Commit graph

267 commits

Author SHA1 Message Date
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
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
Alexandre Duret-Lutz
55eae0d8bc * spot/twa/twa.hh (twa_succ_iterable): Mark move ctor as noexcept. 2016-12-15 11:11:59 +01:00
Maximilien Colange
114f7f1200 Default emptiness check is the new version of Couvreur.
* spot/twa/twa.cc: is_empty() and accepting_run() now call the new
version of the Couvreur algorithm.
2016-12-13 16:18:31 +01:00
Maximilien Colange
1a08eca840 Add a new, parameterized, version of the Couvreur emptiness check.
This version has optimization for explicit twa, and also for weak and
terminal (depending on whether an accepting run is requested) automata.

* spot/twaalgos/couvreurnew.hh, spot/twaalgos/couvreurnew.cc,
  spot/twaalgos/Makefile.am: New files for the new algorithm.
* spot/twaalgos/emptiness.cc, tests/core/randtgba.cc:
  Register new algorithm.
2016-12-13 16:18:31 +01:00
Alexandre Duret-Lutz
f0416b3f3c ltsmin: workaround spurious gcc-snapshot warning
* spot/ltsmin/ltsmin.cc: Add an assert.
2016-12-10 21:56:25 +01:00
Alexandre Duret-Lutz
413eab1d32 ltlf: ensure alive holds initially
Reported by Shufang Zhu.

* spot/tl/ltlf.cc, spot/tl/ltlf.hh: Fix the transltion
and update the comments.
* tests/core/ltlfilt.test: Adjust test cases.
* NEWS: Mention the fix.
* THANKS: Add Shufang Zhu.
2016-12-09 21:37:15 +01:00
Alexandre Duret-Lutz
0ab8dc06c4 install back the safety check of includes.test
Compilation of each header file alone, as a safety check, was removed
when introducing "#pragma once" because we did not have to check for
possible double inclusion.  However we still need to compile each
header to make sure they are self-contained.

* tests/sanity/includes.test: Compile each header.
* tests/run.in: Export various compiler and directory flags.
* spot/twaalgos/emptiness_stats.hh, spot/misc/mspool.hh,
spot/misc/fixpool.hh: Include <spot/misc/common.hh>.
* spot/misc/common.hh: Include <cassert>.
* NEWS: Mention the fixed headers.
2016-12-02 15:03:43 +01:00
Alexandre Duret-Lutz
3d726fccb2 parseaut: diagnose invalid acceptance terms
* spot/parseaut/parseaut.yy: Add a diagnostic.
* tests/core/parseaut.test: Test it.
* NEWS: Document it.
2016-12-01 18:34:44 +01:00
Alexandre Duret-Lutz
2b07326217 twa_graph: simplify two precondition checks
* spot/twa/twagraph.hh (state_acc_sets, state_is_accepting): Do not
check num_sets()==0 since this would imply prop_state_acc().
2016-11-30 14:26:30 +01:00
Alexandre Duret-Lutz
034620c521 graph: fix internal iterator constness
* spot/graph/graph.hh: Use only const variants of begin()/end(), since
they do not modify the iterator.
2016-11-30 14:26:30 +01:00
Alexandre Duret-Lutz
5841af026a sccinfo: simplify initial code
* spot/twaalgos/sccinfo.cc: We do not need to care
about 0 states anymore.
2016-11-30 14:26:30 +01:00
Maximilien Colange
b3ee68310f Automata with no state are no longer allowed.
* NEWS, spot/twa/twa.hh: Document the change.
* spot/twa/twagraph.hh, spot/kripke/kripkegraph.hh:
  Add an exception in get_init_state_number().
  get_init_state() now calls get_init_state_number().
* spot/twa/twagraph.cc, spot/twaalgos/simulation.cc,
  spot/twaalgos/powerset.cc, spot/twaalgos/complete.cc,
  spot/twaalgos/sccfilter.cc: Remove now useless tests.
* spot/twaalgos/hoa.cc: Remove now useless comment.
* spot/twaalgos/minimize.cc: Never return an automaton with no state.
2016-11-29 10:34:03 +01:00
Alexandre Duret-Lutz
b1f9081761 ltsmin: use any installed libltdl
This should solve issue with the Debian package.

* spot/ltsmin/Makefile.am: Use the LTDLINC, LTDLDEPS and LIBLTDL as
documented.
* NEWS: Mention the fix.
2016-11-28 18:17:48 +01:00
Alexandre Duret-Lutz
9bc978a90f strength: fix is_terminal()
Fix #198.  Reported by Maximilien Colange.

* spot/twaalgos/strength.cc (is_terminal): Test that no accepting
transition lead to a rejecting SCC.
* tests/core/strength.test: Add test case.
* spot/twaalgos/strength.hh, spot/twa/twa.hh, doc/org/concepts.org:
Adjust documentation.
* NEWS: Mention the fix.
2016-11-28 18:02:28 +01:00
Maximilien Colange
2fbc75f439 New macro to downcast shared pointers.
* spot/misc/casts.hh: Add a macro down_pointer_cast.
2016-11-28 14:51:55 +01:00
Maximilien Colange
5952392494 Use the [[deprecated]] standard attribute when possible.
* spot/misc/common.hh: Change SPOT_DEPRECATED definition.
2016-11-25 13:53:36 +01:00
Alexandre Duret-Lutz
dc4a477172 lts-min: fix loading of spins models
This fixes c9aabcdd.

* spot/ltsmin/ltsmin.cc: Update the extension after compiling
the model.  Do not duplicate the symbol lookups for DVE and gal2C.
Also, improve error reporting in case of missing symbol.
* tests/ltsmin/check.test: Remove stray character.
2016-11-24 10:44:11 +01:00
Alexandre Duret-Lutz
e2b0b9d989 scc_filter: remove left-over print
Reported by František Blahoudek.

* spot/twaalgos/sccfilter.cc: Remove extra print statement.
* NEWS: Mention it.
2016-11-24 07:31:32 +01:00
Maximilien Colange
fd2f79200f Improve error messages when loading compiled models.
* spot/ltsmin/ltsmin.cc: Improve error messages.
2016-11-23 11:03:30 +01:00
Maximilien Colange
c9aabcddab Add support to load GAL models.
* spot/ltsmin/ltsmin.cc: Handle GAL models.
* tests/Makefile.am: Test the new feature.
* tests/ltsmin/check.test: Also check GAL.
* tests/ltsmin/beem-peterson.4.gal: A new GAL model for tests.
* tests/ltsmin/finite.gal: A new GAL model for tests.
* tests/ltsmin/finite3.test: A new test for GAL.
2016-11-23 11:03:30 +01:00
Etienne Renault
ec83e60bb9 bitvec: remove useless methods
* spot/misc/bitvect.hh, tests/core/bitvect.cc,
tests/core/bitvect.test: here.
2016-11-23 09:39:58 +01:00
Etienne Renault
43ec36cda7 Prefer emplace_back to push_back
* spot/graph/ngraph.hh, spot/ltsmin/ltsmin.cc,
spot/misc/bitvect.hh, spot/misc/intvcomp.cc,
spot/misc/satsolver.cc, spot/priv/weight.cc,
spot/ta/taexplicit.cc, spot/taalgos/minimize.cc,
spot/taalgos/reachiter.cc, spot/tl/exclusive.cc,
spot/tl/formula.cc, spot/tl/formula.hh,
spot/tl/mark.cc, spot/tl/mutation.cc,
spot/tl/relabel.cc, spot/tl/remove_x.cc,
spot/tl/simplify.cc, spot/twa/acc.cc,
spot/twa/acc.hh, spot/twa/formula2bdd.cc,
spot/twa/taatgba.cc, spot/twa/taatgba.hh,
spot/twa/twa.hh, spot/twa/twagraph.cc,
spot/twaalgos/bfssteps.cc, spot/twaalgos/canonicalize.cc,
spot/twaalgos/compsusp.cc, spot/twaalgos/copy.cc,
spot/twaalgos/cycles.cc, spot/twaalgos/degen.cc,
spot/twaalgos/determinize.cc, spot/twaalgos/dtwasat.cc,
spot/twaalgos/emptiness.cc, spot/twaalgos/gv04.cc,
spot/twaalgos/hoa.cc, spot/twaalgos/ltl2taa.cc,
spot/twaalgos/ltl2tgba_fm.cc, spot/twaalgos/magic.cc,
spot/twaalgos/mask.hh, spot/twaalgos/minimize.cc,
spot/twaalgos/powerset.cc, spot/twaalgos/product.cc,
spot/twaalgos/randomgraph.cc, spot/twaalgos/reachiter.cc,
spot/twaalgos/relabel.cc, spot/twaalgos/remfin.cc,
spot/twaalgos/sccfilter.cc, spot/twaalgos/se05.cc,
spot/twaalgos/simulation.cc, spot/twaalgos/stutter.cc,
spot/twaalgos/tau03opt.cc, spot/twaalgos/totgba.cc,
spot/twaalgos/word.cc, tests/core/bitvect.cc: here.
2016-11-23 09:39:58 +01:00
Alexandre Duret-Lutz
c225747749 twa: introduce intersects() and friends
* spot/twa/twa.hh, spot/twa/twa.cc (intersects, intersecting_run,
intersecting_word): New functions.
* NEWS: Mention them.
* doc/org/tut51.org, tests/python/bugdet.py: Use them.
2016-11-13 11:23:12 +01:00
Alexandre Duret-Lutz
bdad288c70 * spot/twa/twa.hh: Typos. 2016-11-13 09:36:06 +01:00
Alexandre Duret-Lutz
dce83a649b improve doc for purge_unreachable_states and purge_dead_states
* spot/twa/twagraph.hh: Here.
2016-11-11 15:38:25 +01:00
Alexandre Duret-Lutz
85f6e0e158 scc_filter: preserve state names and highlighted states
Suggested by Juraj Major.

* spot/twaalgos/sccfilter.cc: Here.
* tests/python/sccfilter.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Mention the news.
2016-11-11 15:21:17 +01:00
Alexandre Duret-Lutz
dd706d7847 twa: do not set prop_state_acc in set_acceptance
Reported by Juraj Major.

* spot/twa/twa.hh: check num_sets() in prop_state_acc() so we do not
have to set it in set_acceptance(), causing trouble if set_acceptance()
is called multiple times.
* tests/python/setacc.py: New test case.
* tests/Makefile.am: Add it.
* THANKS: Add Juraj.
* NEWS: Mention the bug.
2016-11-11 15:20:56 +01:00
Alexandre Duret-Lutz
a70589fe13 remfin: fix handling of weak automata
* spot/twaalgos/remfin.cc: Do not add a sink states to deterministic
weak automata, and actually apply the "weak" Fin-removal to any weak
automaton.
* tests/core/explprod.test: Add a test case for the previous patch,
but that used to fail because of this bug.
* NEWS: Mention the bug.
2016-11-11 14:10:24 +01:00
Alexandre Duret-Lutz
49266dee7f parseaut: do not close fd or stdin
* spot/parseaut/public.hh, spot/parseaut/scanaut.ll: When parsing
automata read from some given FD, do not close the file descriptor, as
the caller is likely to already close it, and closing FDs twice is very
bad.  This seems to have be the root of some issue we had with recent
jupyter versions, were 0MQ would crash with "Bad file descriptor"
messages.  Also do not close stdin while we are at it.
* NEWS: Mention the bug.
2016-11-11 14:10:03 +01:00
Alexandre Duret-Lutz
2e6297c26a ltl2tgba_fm: simplify three bdd operations
* spot/twaalgos/ltl2tgba_fm.cc: Replace bdd_exists(a & b, c) by
bdd_appex(a, b, bddop_and, c).
2016-11-09 10:29:00 +01:00
Alexandre GBAGUIDI AISSE
6ed380709d spot: Add %R, %[..]R common option.
For #189.

* NEWS: Update.
* bin/autfilt.cc: Replace stopwatch with process_timer.
* bin/dstar2tgba.cc: Replace stopwatch with process_timer.
* bin/ltl2tgba.cc: Replace stopwatch with process_timer.
* bin/ltlcross.cc: Replace stopwatch with process_timer.
* bin/ltldo.cc: Replace stopwatch with process_timer.
* bin/randaut.cc: Replace stopwatch with process_timer.
* bin/common_aoutput.hh: Implement process_timer, integrate it.
* bin/common_aoutput.cc: Integrate process_timer and implement new
print method.
* spot/misc/timer.hh: Modify timer class and timeinfo struct
i.e. add cutime (children_utime) and cstime (children_stime).
* spot/misc/timer.cc: Help code to behave as before all this.
* spot/twaalgos/dtbasat.cc: Help print_log to behave as before
all this.
* spot/twaalgos/dtwasat.cc: Help print_log to behave as before
all this.
* spot/misc/formater.hh: Add operator<< for spot::timer.
2016-11-08 18:57:50 +01:00
Alexandre Duret-Lutz
0b7b03c7d2 parsetl: flush the errors
This fixes an issue in the on-line translator, where error message would
not be output in the correct <div>.

* spot/parsetl/fmterror.cc (format_parse_errors): Flush the stream.
2016-11-05 22:59:02 +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
Alexandre Duret-Lutz
3f64e9723f determinize: call bdd_implies less often
* spot/twaalgos/determinize.cc (safra_state::merge_redundant_states):
Test is_connected before called bdd_implies.
2016-11-01 09:29:55 +01:00
Alexandre Duret-Lutz
d919b78c89 simulation: do not purge unreachable states when recording implications
This fixes the incorrect output of tgba_determinize() reported yesterday
by Reuben Rowe.

* spot/twaalgos/simulation.cc: Do not purge unreachable states when
recording implications.
* tests/python/bugdet.py: New test case.
* tests/Makefile.am: Add it.
* THANKS: Add Reuben.
* NEWS: Mention the bug.
2016-11-01 09:29:55 +01:00
Alexandre Duret-Lutz
adc40fdcb6 ltlsmin: revert part of 630e90b9
* spot/ltsmin/ltsmin.cc (compile_model): It does need to modify its
first argument.
2016-10-30 08:13:37 +01:00
Alexandre Duret-Lutz
40ed12050b parsetl: fix crash in debug-mode
Fixes #193, reported by Etienne Renault.

* spot/parsetl/parsetl.yy: Clone printed formulas.
* tests/core/parse.test: Add test case.
* NEWS: Mention the issue.
2016-10-29 13:13:09 +02:00
Alexandre Duret-Lutz
a5fb5784f6 print: fix str_sere() and str_utf8_sere(), as found by PVS-Studio
These were not actually printing in "SERE" mode due to a copy/paste
error.  PVS-Studio seems really good at finding those.  For #192.

* spot/tl/print.cc: Fix it.
* NEWS: Mention the bug.
2016-10-29 12:37:35 +02:00
Alexandre Duret-Lutz
24d19a6703 bitvect: do not leak on realloc failure, flagged by PVS-Studio
For #192.

* spot/misc/bitvect.hh: Here.
2016-10-29 12:37:35 +02:00
Alexandre Duret-Lutz
288f6ead9f randomltl: fix initialization of the simplifier, caught by PVS-Studio
For #192.

* spot/tl/randomltl.cc: Here.
2016-10-29 12:37:35 +02:00
Alexandre Duret-Lutz
c31ba658bf optionmap: remove superfluous code
This was noticed while looking at a false-positive in the report for
PVS-Studio, in #192.

* spot/misc/optionmap.cc: Do not remove the option from unused_ twice..
2016-10-29 12:37:35 +02:00
Alexandre Duret-Lutz
65955b44d9 rearrange some code to trigger less warning from PVS-Studio
For #192.

* spot/tl/formula.cc: Avoid calling twice the same function.
* spot/twaalgos/gtec/gtec.cc: Do not shadow a member variable.
2016-10-29 12:37:35 +02:00
Alexandre Duret-Lutz
835b5ee1cf improve some conditions, as hinted by PVS-Studio
For #192.

* spot/twaalgos/ltl2tgba_fm.cc, spot/twaalgos/are_isomorphic.cc,
spot/taalgos/tgba2ta.cc: Here.
2016-10-29 12:37:35 +02:00
Alexandre Duret-Lutz
40b8bab890 remove some dead code discovered while studying PVS-Studio's report
For #192.

* spot/misc/timer.hh, spot/twa/bdddict.cc, spot/twa/bdddict.hh,
spot/twaalgos/sbacc.cc: Here.
2016-10-29 12:37:35 +02:00
Alexandre Duret-Lutz
279bfa00bd fix some implicit promotion from bool, as suggested by PVS-Studio
For #192.

* spot/parseaut/parseaut.yy, spot/parseaut/scanaut.ll,
spot/tl/randomltl.cc, spot/twa/acc.cc, spot/twaalgos/postproc.hh: Here.
2016-10-29 12:37:35 +02:00
Alexandre Duret-Lutz
630e90b9cc ltsmin: fix constness of arguments as suggested by PVS-Studio
For #192.

* spot/ltsmin/ltsmin.cc (compile_model): Here.  As remove some unused
variable.
2016-10-29 12:37:35 +02:00
Alexandre Duret-Lutz
26e94b774f taproduct: fix incorrect assert() flagged by PVS-Studio
For #192.

* spot/ta/taproduct.cc: Check the output of down_cast, not its input.
2016-10-29 12:37:35 +02:00
Alexandre Duret-Lutz
d0112a7b8a fix unpaired copy-ctor/op= reported by PVS-Stydio
For #192.

* bin/common_trans.cc, bin/common_trans.hh, spot/twa/acc.hh:
Add an operator= in addition to the copy constructor.
* spot/twaalgos/ltl2tgba_fm.cc: Use the default constructor.
* spot/ta/taproduct.cc, spot/ta/taproduct.hh: Delete an unused copy
constructor.
2016-10-29 12:37:21 +02:00