Commit graph

2953 commits

Author SHA1 Message Date
Alexandre Duret-Lutz
71d21b378b hoa: support Inf(!x)
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: More tests.
* src/tgba/acc.hh (operator^=): New method.
2014-11-21 16:07:11 +01:00
Alexandre Duret-Lutz
7a03228880 hoa: add alias support
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: Test it.
2014-11-21 11:05:24 +01:00
Alexandre Duret-Lutz
691ab05926 hoa: catch redefinition of states
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: More test.
2014-11-21 10:49:58 +01:00
Alexandre Duret-Lutz
69678152b6 hoa: add support for unlabeled transitions
* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/hoaparse.test: Add tests.
2014-11-20 19:44:56 +01:00
Alexandre Duret-Lutz
1d962f79ac hoa: make the parser more resilient to errors
* src/hoaparse/hoaparse.yy: Improve error recovery,
and fix location tracking in streams.
* src/hoaparse/public.hh: Store the last location so
that the next parse start at the correct position.
* src/bin/autfilt.cc: Stop parsing a stream on irrecoverable errors.
* src/tgbatest/hoaparse.test: Adjust tests.
2014-11-20 12:29:18 +01:00
Alexandre Duret-Lutz
392c527d31 monitor: add a few tests
* src/tgbatest/monitor.test: New file.
* src/tgbatest/Makefile.am: Add it.
* src/tgbaalgos/minimize.cc (minimize_monitor): Mark
the output automaton as state-based.
* src/tgba/tgbagraph.hh: Assume automata with 0 acceptance sets are also
state-based.
2014-11-20 10:59:56 +01:00
Alexandre Duret-Lutz
6eeb74e15f autfilt, dstar2tgba: fix --help
* src/bin/autfilt.cc, src/bin/dstar2tgba.cc: Do not reference the
formula in --help.
2014-11-20 10:02:29 +01:00
Alexandre Duret-Lutz
131299d03e hoa: make it possible to read a stream of automata
* src/bin/autfilt.cc: Loop over all automata in a file.
* src/hoaparse/public.hh: Turn the parser into an object.
* src/hoaparse/hoaparse.yy: Adjust.
2014-11-19 23:24:09 +01:00
Alexandre Duret-Lutz
5aff262844 autfilt: first stub
* src/bin/autfilt.cc, src/bin/man/autfilt.x: New files.
* src/bin/Makefile.am, src/bin/man/Makefile.am: Add them.
* src/bin/common_post.cc, src/bin/common_post.hh: Adjust.
2014-11-19 23:24:09 +01:00
Alexandre Duret-Lutz
fb0849f43b * src/bin/dstar2tgba.cc: Remove a useless include. 2014-11-19 19:29:29 +01:00
Alexandre Duret-Lutz
622fe08f00 ltlcross: add support for reading TGBA as HOA
* src/bin/ltlcross.cc: Add a %H modifier.
* src/tgbatest/ltlcross2.test: Exercise it.
2014-11-19 19:29:29 +01:00
Alexandre Duret-Lutz
e55bcd95aa hoa: preliminary implementation of a parser
* src/hoaparse/Makefile.am, src/hoaparse/fmterror.cc,
src/hoaparse/hoaparse.yy, src/hoaparse/hoascan.ll,
src/hoaparse/parsedecl.hh, src/hoaparse/public.hh: New files.
* src/Makefile.am, configure.ac, README: Adjust.
* src/tgbatest/ltl2tgba.cc: Add a -XH option.
* src/tgbatest/hoaparse.test: New file.
* src/tgbatest/Makefile.am: Adjust.
* buddy/src/bddx.h: Add a bdd_from_int() function.
2014-11-19 19:29:29 +01:00
Alexandre Duret-Lutz
e1d4522ca9 hoa: fix output
* src/tgbaalgos/hoaf.cc: Do not initialize acc_cond::mark_t with -1U.
2014-11-18 18:53:10 +01:00
Alexandre Duret-Lutz
f8cf2aa9b3 fix line number tracking in files with DOS newlines
* src/dstarparse/dstarscan.ll, src/kripkeparse/kripkescan.ll,
src/neverparse/neverclaimscan.ll, src/tgbaparse/tgbascan.ll:
Distinguish between 1-sized EOL and 2-sized EOL.
* src/kripketest/bad_parsing.test, src/tgbatest/neverclaimread.test,
src/tgbatest/readsave.test: Add more tests.
* NEWS: Mention it.
* src/kripkeparse/scankripke.ll: Remove this unused file.
2014-11-18 11:59:49 +01:00
Alexandre Duret-Lutz
45e9b96b66 fix line number tracking in files with DOS newlines
* src/dstarparse/dstarscan.ll, src/kripkeparse/kripkescan.ll,
src/neverparse/neverclaimscan.ll, src/tgbaparse/tgbascan.ll:
Distinguish between 1-sized EOL and 2-sized EOL.
* src/kripketest/bad_parsing.test, src/tgbatest/neverclaimread.test,
src/tgbatest/readsave.test: Add more tests.
* NEWS: Mention it.
* src/kripkeparse/scankripke.ll: Remove this unused file.
2014-11-18 11:07:02 +01:00
Alexandre Duret-Lutz
881afd67ba * NEWS: Mention the new stutter invariance check 2014-11-14 13:23:30 +01:00
Alexandre Duret-Lutz
d92ca23da3 * src/ltltest/remove_x.test: More tests. 2014-11-14 11:11:39 +01:00
Alexandre Duret-Lutz
9effca6907 Remove the stutter test from tgbatest/.
Because src/ltltest/stutter.test is stronger.

* src/tgbatest/stutter_invariant.test: Remove.
* src/tgbatest/Makefile.am: Adjust.
2014-11-14 11:11:39 +01:00
Alexandre Duret-Lutz
f412fee6f3 stutter check: cleanup and add test cases
* src/ltltest/ltlfilt.test: Add more tests.
* src/ltltest/stutter.test: New test.
* src/ltltest/Makefile.am: Adjust.
* src/bin/ltlfilt.cc: Catch std::runtime_error.
* src/tgba/tgbasl.hh (make_tgbasl): New function.
* src/tgba/tgbagraph.hh (make_tgba_graph): Add another overload.
* src/tgbaalgos/stutter_invariance.cc,
src/tgbaalgos/stutter_invariance.hh: Take the algorithm version as an
optional integer, and call getenv() only once.
* bench/stutter/stutter_invariance_randomgraph.cc,
bench/stutter/stutter_invariance_formulas.cc: Simplify using the
above functions.
2014-11-14 11:11:39 +01:00
Thibaud Michaud
fcf6e25132 Optimizing closure and sl.
* src/tgbaalgos/closure.cc, src/tgbaalgos/closure.hh: Using vectors
instead of sets and unordered maps, adding an overload to handle rvalue
references.
* src/tgbaalgos/stutterize.cc, src/tgbaalgos/stutterize.hh: Adding
an overload to handle rvalue references.
* bench/stutter/stutter_invariance_formulas.cc,
bench/stutter/stutter_invariance_randomgraph.cc: Automata are modified
in-place by is_stutter_invariant so they have to be copied before being
processed.
* src/tgbaalgos/stutter_invariance.cc,
src/tgbaalgos/stutter_invariance.hh: Use the in-place version of
closure and sl.
2014-11-14 11:11:39 +01:00
Thibaud Michaud
5817a3c11b Remove const qualifier in translator::run return type
* src/tgbaalgos/translate.cc, src/tgbaalgos/translate.hh: Remove const
qualifier in translator::run return type.
2014-11-14 11:11:39 +01:00
Thibaud Michaud
37bcb5d959 Adding tgba-based stutter-invariance checking
* src/tgbaalgos/closure.cc, src/tgbaalgos/closure.hh:
Add closure function.
* src/tgbaalgos/stutterize.cc, src/tgbaalgos/stutterize.hh:
Add two implementations of "self-loopize" function.
* src/tgbaalgos/Makefile.am: Add them.
* src/tgba/tgbasl.cc, src/tgba/tgbasl.hh: On-the-fly implementation of
self-loopize.
* src/tgba/Makefile.am: Add it.
* src/tgbatest/ltl2tgba.cc, src/tgbatest/stutter_invariant.test: Test
closure and sl.
* src/tgbatest/Makefile.am: Adjust.
* src/bin/ltlfilt.cc: Modify stutter-invariant option to use
automaton-based checking rather than syntactic-based checking.
* src/ltlvisit/remove_x.cc, src/ltlvisit/remove_x.hh:
Remove is_stutter_insensitive function.
* src/tgbaalgos/stutter_invariance.cc,
src/tgbaalgos/stutter_invariance.hh: Check if a formula is
stutter-invariant using closure and sl.
* wrap/python/spot.i: Add closure and sl bindings.
* bench/stutter/stutter_invariance_formulas.cc: Generate benchmarks from
given formulas.
* bench/stutter/stutter_invariance_randomgraph.cc: Generate benchmarks
from random automata.
* bench/stutter/Makefile.am: Add them.
* configure.ac: Add bench/stutter/Makefile.
* bench/Makefile.am: Add stutter subdirectory.
* README: Document bench/stutter directory.
2014-11-14 11:11:39 +01:00
Thibaud Michaud
beafcf4e3d Adding trans_storage methods to tgbagraph.hh
* src/tgba/tgbagraph.hh: Adding trans_storage methods to access
the underlying trans_storage_t struct.
2014-11-14 11:11:39 +01:00
Thibaud Michaud
c9618f9137 random_graph: add option to generate complete deterministic automaton
* src/tgbaalgos/randomgraph.cc, src/tgbaalgos/randomgraph.hh:
Add option to generate a complete deterministic automaton.
* src/tgbatest/randtgba.cc: Test it.
2014-11-14 11:11:39 +01:00
Thibaud Michaud
24d60edc84 Adding option to filter by number of atomic propositions in ltlfilt.
* src/bin/ltlfilt.cc: Add --ap=N option.
2014-11-14 11:11:39 +01:00
Alexandre Duret-Lutz
b012621357 * NEWS: Mention the std::set assignment workaround. 2014-11-14 11:04:28 +01:00
Alexandre Duret-Lutz
11aa708a81 ltl2tgba_fm: fix non-deterministic output
The ltl_to_tgba_fm() translation function was using a hash_map of
maps (ugh!) to merge transitions on output.  However recent libstd++
changed the implementation of hash_map (a.k.a. unordered_map) causing
transitions to be output in a different order.  This
implementation-dependent order caused the ltl2ta.test to fail because
the BA->TA transformation can produce TA of different sizes if you
simply change the order of transitions in the input BA! This does not
sound like a nice property for the BA->TA transformation, but Ala Eddine
isn't sure how to fix it yet.  In the meantime, this patch makes sure
ltl_to_tgba_fm() will return the same output regardless of the
implementation of hash_map.

The ltl2ta.test failure has been observed with g++ 4.9.2 on Arch Linux,
and with gcc-snapshot (5.0.0 20141016) on Debian.

* src/tgbaalgos/ltl2tgba_fm.cc: Rewrite the transition merging
using a std::vector and std::sort instead of nested maps tables.
* src/tgbatest/ltl2ta.test: Adjust sizes to the new order.
* NEWS: Mention the fix.
2014-11-14 11:03:30 +01:00
Alexandre Duret-Lutz
becfcbcf79 * NEWS: Mention the std::set assignment workaround. 2014-11-14 08:38:16 +01:00
Alexandre Duret-Lutz
6e2151dc18 futurecondcol: avoid gcc-snapshot bug
* src/tgba/futurecondcol.cc: Use swap instead of assignement.  It is
more efficient, and it avoid the bug of gcc-snapshot mentionned two
commits below.
2014-11-13 23:41:07 +01:00
Alexandre Duret-Lutz
4ea63f8404 ltl2tgba_fm: fix non-deterministic output
The ltl_to_tgba_fm() translation function was using a hash_map of
maps (ugh!) to merge transitions on output.  However recent libstd++
changed the implementation of hash_map (a.k.a. unordered_map) causing
transitions to be output in a different order.  This
implementation-dependent order caused the ltl2ta.test to fail because
the BA->TA transformation can produce TA of different sizes if you
simply change the order of transitions in the input BA! This does not
sound like a nice property for the BA->TA transformation, but Ala Eddine
isn't sure how to fix it yet.  In the meantime, this patch makes sure
ltl_to_tgba_fm() will return the same output regardless of the
implementation of hash_map.

The ltl2ta.test failure has been observed with g++ 4.9.2 on Arch Linux,
and with gcc-snapshot (5.0.0 20141016) on Debian.

* src/tgbaalgos/ltl2tgba_fm.cc: Rewrite the transition merging
using a std::vector and std::sort instead of nested maps tables.
* NEWS: Mention the fix.
2014-11-13 21:11:00 +01:00
Alexandre Duret-Lutz
2745381097 tgbasafracomplement: avoid some std::set copies
* src/tgba/tgbasafracomplement.cc: Here.  Beside being more efficient,
the use of std::swap instead of an assignment also protects us from a
bug recently introduced in the development version of G++.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
2014-11-10 13:37:38 +01:00
Alexandre Duret-Lutz
63da386a66 ltl: use "final" and "override" in the AST classes
* src/ltlast/atomic_prop.hh, src/ltlast/binop.hh, src/ltlast/bunop.hh,
src/ltlast/constant.hh, src/ltlast/unop.hh: Here.
* src/misc/common.hh: Disable final for swig3.0.
2014-11-07 17:30:11 +01:00
Alexandre Duret-Lutz
6f572ebcc8 * configure.ac: Prefer swig-3.0 when available. 2014-11-07 17:30:11 +01:00
Alexandre Duret-Lutz
b8a792248a tgbasafracomplement: avoid some std::set copies
* src/tgba/tgbasafracomplement.cc: Here.  Beside being more efficient,
the use of std::swap instead of an assignment also protects us from a
bug recently introduced in the development version of G++.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63698
2014-10-31 11:47:03 +01:00
Alexandre Duret-Lutz
ad8d24222a buddy: rename libbdd to libbddx
* buddy/src/bdd.h, buddy/src/bvec.h, buddy/src/fdd.h: Rename as...
* buddy/src/bddx.h, buddy/src/bvecx.h, buddy/src/fddx.h: ... these.
* buddy/src/Makefile.am: Build libbddx.la instead of libbdd.la.
* buddy/examples/Makefile.def: Use it.
* Makefile.am, buddy/src/bddtest.cxx, buddy/src/bvec.c,
buddy/src/cppext.cxx, buddy/src/fdd.c, buddy/src/imatrix.h,
buddy/src/kernel.h, buddy/examples/adder/adder.cxx,
buddy/examples/bddcalc/parser_.h, buddy/examples/bddtest/bddtest.cxx,
buddy/examples/cmilner/cmilner.c, buddy/examples/fdd/fdd.cxx,
buddy/examples/milner/milner.cxx, buddy/examples/money/money.cxx,
buddy/examples/queen/queen.cxx, buddy/examples/solitare/solitare.cxx,
m4/buddy.m4, src/ltlvisit/apcollect.hh, src/ltlvisit/simplify.hh,
src/misc/bddlt.hh, src/misc/bddop.hh, src/misc/minato.hh,
src/priv/acccompl.hh, src/priv/accconv.hh, src/priv/accmap.hh,
src/priv/bddalloc.cc, src/tgba/bdddict.hh, src/tgba/bddprint.hh,
src/tgba/tgbamask.hh, src/tgba/tgbasafracomplement.cc,
src/tgbaalgos/emptiness.hh, src/tgbaalgos/gtec/sccstack.hh,
src/tgbaalgos/neverclaim.cc, src/tgbaalgos/powerset.cc,
src/tgbaalgos/sccfilter.hh, src/tgbaalgos/sccinfo.hh,
src/tgbaalgos/weight.hh, wrap/python/buddy.i: Adjust.
* NEWS, README: Document it.
2014-10-30 20:58:10 +01:00
Alexandre Duret-Lutz
f35be908c8 tgba_digraph: speedup purge_unreachable_states slightly
* src/tgba/tgbagraph.cc (purge_unreachable_states): Rewrite using
only one vector.
2014-10-30 16:05:28 +01:00
Alexandre Duret-Lutz
f0fd654c1f misc: define SPOT_LIKELY and SPOT_UNLIKELY
* src/misc/common.hh: Here.
* src/misc/intvcmp2.cc, src/misc/intvcomp.cc: Adjust to use them.
2014-10-30 16:05:28 +01:00
Alexandre Duret-Lutz
923785f76a tgba_digraph: add a copy constructor, and obsolete dupexp
* src/tgba/tgbagraph.hh, src/tgba/tgbagraph.cc: Add a copy constructor,
and some method to purge unreachable states.
* src/graph/graph.hh (defrag_states): Erase transition of removed
states.
* src/tgbaalgos/complete.cc, src/tgbaalgos/compsusp.cc,
src/tgbaalgos/dtgbacomp.cc, src/tgbaalgos/simulation.cc,
src/tgbatest/checkpsl.cc, src/tgbatest/emptchk.cc,
src/tgbatest/ltl2tgba.cc: Adjust to use make_tgba_digraph() instead
of tgba_dupexp_dfs() or tgba_dupexp_bfs().
* src/tgbaalgos/dupexp.cc, src/tgbaalgos/dupexp.hh: Use
make_tgba_digraph() when possible.
* src/tgbatest/det.test, src/tgbatest/sim.test: Adjust expected results.
2014-10-28 19:38:13 +01:00
Alexandre Duret-Lutz
971788fdbe [buddy] pack cache entry on 16 bytes, not 20.
The double result is never used with a triple keys,
so we can pack the cache entry more tightly.

* src/cache.h: Reorganize the cache entry the structure.
* src/cache.c: Cleanup the code while we are at it.
* src/bddop.c: Adjust to accesses to cache entries.
2014-10-28 13:13:05 +01:00
Alexandre Duret-Lutz
c189875daf ltl: get rid of formula_ptr_hash
* src/ltlast/formula.hh: Specialize std::hash<>.
* src/ltlvisit/contain.hh, src/ltlvisit/relabel.cc,
src/tgba/taatgba.hh, src/tgbaalgos/ltl2tgba_fm.cc: Do
not pass formula_ptr_hash to unordered_map.
2014-10-26 22:17:19 +01:00
Alexandre Duret-Lutz
3d9ffaec83 fix compilation with clang++-3.6 -Wdocumentation
* src/tgba/tgbasafracomplement.cc: Remove documentation of inexisting
argument.
* src/tgbaalgos/hoaf.hh: Fix typo in documentation.
2014-10-26 20:50:38 +01:00
Alexandre Duret-Lutz
15710e7b1d lib: remove the gethrxtime module
Since we are now using std::chrono from C++11.

* lib/gethrxtime.c, lib/gethrxtime.h, lib/gettime.c, lib/timespec.c,
lib/timespec.h, lib/xtime.c, lib/xtime.h, m4/clock_time.m4,
m4/gethrxtime.m4, m4/gettime.m4, m4/timespec.m4: Delete these files.
* lib/Makefile.am, m4/gnulib-cache.m4, m4/gnulib-comp.m4: Adjust.
2014-10-26 13:58:29 +01:00
Alexandre Duret-Lutz
a4f951facc timer: add a stopwatch for timing a simple operation
* src/misc/timer.hh (stopwatch): New class, implemented on top
of C++11's std::chrono::high_resolution_clock.
* src/bin/dstar2tgba.cc, src/bin/ltl2tgba.cc, src/bin/ltlcross.cc:
Use it in lieu of gethrxtime(), so we do not need to distribute
gethrxtime anymore.
2014-10-26 13:44:47 +01:00
Alexandre Duret-Lutz
8d947a8782 ltl: get rid of ltl::ref_formula
Instead, manage all reference counting from ltl::formula.
It ridance of virtual calls to clone() and destroy() easily compensate
the extra test in destroy() to not delete constant nodes.

* src/ltlast/refformula.cc, src/ltlast/refformula.hh: Delete.
* src/ltlast/Makefile.am, wrap/python/spot.i: Adjust.
* 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/formula.cc, src/ltlast/formula.hh,
src/ltlast/multop.cc, src/ltlast/multop.hh, src/ltlast/unop.cc,
src/ltlast/unop.hh: Ajust the reference counting code.
2014-10-25 17:06:45 +02:00
Alexandre Duret-Lutz
d79da2e941 ltl: rename formula::count_ as formula::serial_.
* src/ltlast/formula.hh, src/ltlast/formula.cc: Here.
2014-10-25 01:11:26 +02:00
Alexandre Duret-Lutz
2553c29ca7 tgba_digraph: add a purge_dead_states() method
* src/tgba/tgbagraph.hh, src/tgba/tgbagraph.cc (purge_dead_states): New.
* src/graph/graph.hh (defrag_states): New methods.
* src/tgbaalgos/dtgbacomp.cc: Use it.
* src/tgbatest/det.test: Fix state number.
2014-10-24 11:53:28 +02:00
Alexandre Duret-Lutz
09242d3f78 org: compatibility with org 8
* doc/org/init.el.in: Add compatibility with org 8.
* NEWS: Mention it.
2014-10-24 11:52:40 +02:00
Alexandre Duret-Lutz
63708ddcc7 org: compatibility with org 8
* doc/org/init.el.in: Add compatibility with org 8.
* NEWS: Mention it.
2014-10-24 10:57:45 +02:00
Alexandre Duret-Lutz
2fb436a174 Replace most uses of scc_map by scc_info.
This involves reimplementing some algorithms using tgba_digraph, and
implementing an explicit product that takes two tgba_digraphs and
produces a tgba_digraph.

* src/tgbaalgos/product.cc, src/tgbaalgos/product.hh: New files.
* src/tgbaalgos/Makefile.am: Adjust.
* src/bin/ltlcross.cc, src/tgba/tgba.cc, src/tgba/tgba.hh,
src/tgba/tgbasafracomplement.cc, src/tgba/tgbasafracomplement.hh,
src/tgbaalgos/cycles.cc, src/tgbaalgos/cycles.hh,
src/tgbaalgos/degen.cc, src/tgbaalgos/degen.hh,
src/tgbaalgos/isweakscc.cc, src/tgbaalgos/isweakscc.hh,
src/tgbaalgos/minimize.cc, src/tgbaalgos/minimize.hh,
src/tgbaalgos/powerset.cc, src/tgbaalgos/powerset.hh,
src/tgbaalgos/safety.cc, src/tgbaalgos/safety.hh,
src/tgbaalgos/sccinfo.cc, src/tgbaalgos/sccinfo.hh,
src/tgbatest/complementation.cc, src/tgbatest/emptchk.cc,
src/tgbatest/ltl2ta.test, src/tgbatest/ltl2tgba.cc,
src/tgbatest/randtgba.cc: Update to use scc_info and/or tgba_digraph.
2014-10-08 17:33:14 +02:00
Alexandre Duret-Lutz
b6745482af * src/tgba/tgbagraph.cc: Improve comment. 2014-10-08 17:33:14 +02:00