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.
* 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
* 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.
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.
* 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.
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.
* 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.
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.
* 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.
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.
* AUTHORS: Add Thibaud.
* NEWS: Mention ltlgrind and ltlcross --grind.
* src/ltlvisit/mutation.hh, src/ltlvisit/mutation.cc:
Use an enum instead of #define. Rename get_mutations()
into mutate(). Other minor cosmetic changes.
* src/bin/ltlgrind.cc: Adjust.
* src/bin/ltlcross.cc: Slight changes the the output
* doc/org/ltlcross.org, doc/org/ltlgrind.org: Minor
rewordings and fix for org-mode syntax.
* src/ltltest/ltlcrossgrind.test,
src/ltltest/ltlgrind.test: Fix copyright year.
Suggested by Joachim Klein.
When a bogus formula is found by ltlcross, the --grind=FILENAME option
tries to find a smaller formula for which the bug is still present, and
outputs it in FILENAME.
* src/bin/ltlcross.cc: Add the --grind option.
* doc/org/ltlcross.org: Document the --grind option.
* src/ltltest/ltlcrossgrind.test: Test it.
* src/ltltest/Makefile.am: Add test.
* src/bin/ltlgrind.cc: New file, command-line tool to get mutations of a
formula.
* src/bin/Makefile.am: Add it.
* src/ltlvisit/mutation.hh, src/ltlvisit/mutation.cc:
New files providing the get_mutations function.
* src/ltlvisit/Makefile.am: Add it.
* src/ltltest/ltlgrind.test: Test it.
* src/ltltest/Makefile.am: Add it.
* src/bin/man/ltlgrind.x: Document it.
* src/bin/man/Makefile.am: Add it.
* doc/org/ltlgrind.org: Document it.
* doc/org/tools.org: Add link to ltlgrind documentation page.
This was never actually used and we have a new implementation of
alternating automata coming.
* src/saba/, src/sabaalgos/, src/sabatest/: Remove.
* src/Makefile.am, configure.ac, README: Adjust.
* NEWS: Mention it.
This is a huge patch, that took over a month to complete. The bit sets
are currently restricted to what 'unsigned can store', but it should be
easy to extend it to 'uint64_t' should we need it.
* NEWS: Update.
* src/tgba/acc.hh: New file.
* src/tgbatest/acc.cc, src/tgbatest/acc.test: Test it.
* src/tgba/tgbakvcomplement.cc, src/tgba/tgbakvcomplement.hh,
src/tgba/tgbasgba.cc, src/tgba/tgbasgba.hh: Delete. The KV
complementation is too slow to be used in practice, and I somehow broke
it during the conversion to bitsets. The tgba->sgba conversion was only
used for the KV complementation, and should be better redone on
tgba_digraph_ptr should it be needed again.
* src/bin/ltlcross.cc, src/dstarparse/dra2ba.cc,
src/dstarparse/nsa2tgba.cc, src/graphtest/tgbagraph.cc,
src/graphtest/tgbagraph.test, src/kripke/fairkripke.cc,
src/kripke/fairkripke.hh, src/kripke/kripke.cc, src/kripke/kripke.hh,
src/kripke/kripkeexplicit.cc, src/kripke/kripkeexplicit.hh,
src/misc/hash.hh, src/neverparse/neverclaimparse.yy, src/priv/accmap.hh,
src/ta/ta.cc, src/ta/ta.hh, src/ta/taexplicit.cc, src/ta/taexplicit.hh,
src/ta/taproduct.cc, src/ta/taproduct.hh, src/ta/tgta.cc,
src/ta/tgta.hh, src/ta/tgtaexplicit.cc, src/ta/tgtaexplicit.hh,
src/ta/tgtaproduct.cc, src/ta/tgtaproduct.hh, src/taalgos/dotty.cc,
src/taalgos/emptinessta.cc, src/taalgos/minimize.cc,
src/taalgos/tgba2ta.cc, src/tgba/Makefile.am, src/tgba/fwd.hh,
src/tgba/taatgba.cc, src/tgba/taatgba.hh, src/tgba/tgba.cc,
src/tgba/tgba.hh, src/tgba/tgbagraph.cc, src/tgba/tgbagraph.hh,
src/tgba/tgbamask.cc, src/tgba/tgbamask.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/bfssteps.cc, src/tgbaalgos/complete.cc,
src/tgbaalgos/compsusp.cc, src/tgbaalgos/degen.cc,
src/tgbaalgos/dotty.cc, src/tgbaalgos/dtbasat.cc,
src/tgbaalgos/dtgbacomp.cc, src/tgbaalgos/dtgbasat.cc,
src/tgbaalgos/dupexp.cc, src/tgbaalgos/emptiness.cc,
src/tgbaalgos/emptiness.hh, src/tgbaalgos/gtec/ce.cc,
src/tgbaalgos/gtec/gtec.cc, src/tgbaalgos/gtec/gtec.hh,
src/tgbaalgos/gtec/sccstack.cc, src/tgbaalgos/gtec/sccstack.hh,
src/tgbaalgos/gv04.cc, src/tgbaalgos/hoaf.cc,
src/tgbaalgos/isweakscc.cc, src/tgbaalgos/lbtt.cc,
src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/magic.cc,
src/tgbaalgos/ndfs_result.hxx, src/tgbaalgos/neverclaim.cc,
src/tgbaalgos/postproc.cc, src/tgbaalgos/powerset.cc,
src/tgbaalgos/randomgraph.cc, src/tgbaalgos/randomgraph.hh,
src/tgbaalgos/reducerun.cc, src/tgbaalgos/replayrun.cc,
src/tgbaalgos/safety.cc, src/tgbaalgos/save.cc, src/tgbaalgos/scc.cc,
src/tgbaalgos/scc.hh, src/tgbaalgos/sccfilter.cc,
src/tgbaalgos/sccinfo.cc, src/tgbaalgos/sccinfo.hh,
src/tgbaalgos/se05.cc, src/tgbaalgos/simulation.cc,
src/tgbaalgos/simulation.hh, src/tgbaalgos/stats.cc,
src/tgbaalgos/stripacc.cc, src/tgbaalgos/tau03.cc,
src/tgbaalgos/tau03opt.cc, src/tgbaalgos/weight.cc,
src/tgbaalgos/weight.hh, src/tgbaparse/tgbaparse.yy,
src/tgbatest/Makefile.am, src/tgbatest/complementation.cc,
src/tgbatest/complementation.test, src/tgbatest/degenlskip.test,
src/tgbatest/det.test, src/tgbatest/dstar.test, src/tgbatest/emptchk.cc,
src/tgbatest/explpro2.test, src/tgbatest/explpro3.test,
src/tgbatest/explpro4.test, src/tgbatest/explprod.test,
src/tgbatest/ltl2tgba.cc, src/tgbatest/ltl2tgba.test,
src/tgbatest/maskacc.cc, src/tgbatest/maskacc.test,
src/tgbatest/neverclaimread.test, src/tgbatest/randtgba.cc,
src/tgbatest/readsave.test, src/tgbatest/sim.test,
src/tgbatest/sim2.test, src/tgbatest/spotlbtt.test,
src/tgbatest/tgbaread.test, src/tgbatest/tripprod.test,
iface/dve2/dve2.cc: Adjust or use to the new acceptance interface.
Reported by Joachim Klein.
* src/neverparse/neverclaimparse.yy: Store labels and the
location of their first definition in a global map to catch
redefinitions.
* src/tgbatest/neverclaimread.test: Test it.
* NEWS: Mention it.
The weak complementation is now implemented by dtgba_complement(), with
dispatch based on the automaton property.
* src/tgba/wdbacomp.cc, src/tgba/wdbacomp.hh: Remove.
* src/tgba/Makefile.am: Adjust.
* src/tgbaalgos/dtgbacomp.cc: Implement the weak version.
* src/tgbaalgos/dtgbacomp.hh: Document it.
* src/tgbaalgos/minimize.cc: Use dtgba_complement() instead.
They are not used in Spot, and their interface is really horrible. They
are used in SOG-ITS to implement the SLAP product from TACAS'11, so we
should support the functionality eventually, but maybe using the new
kind of properties that can be attached to automata. In the meantime,
these classes are making refactoring harder.
* src/tgba/futurecondcol.cc, src/tgba/futurecondcol.hh,
src/tgba/tgbascc.cc, src/tgba/tgbascc.hh: Delete.
* src/tgba/Makefile.am, src/tgbatest/ltl2tgba.cc,
src/tgbatest/checkpsl.cc, src/tgbatest/emptchk.cc: Adjust.
* src/ltlparse/public.hh, src/ltlparse/ltlparse.yy,
src/ltlparse/ltlscan.ll (parse_error): New class.
(parse_formula): New function that raises a parse_error
exception on error.
* src/ltlvisit/tostring.hh, src/ltlvisit/tostring.cc:
(to_sclatex_string): New method.
* wrap/python/spot.i: Catch the parser_error exception,
and use the to_sclatex_string for MathJax rendering.
* wrap/python/tests/run.in: Start ipython on demand.
Suggested by Joachim Klein.
* wrap/python/ajax/ltl2tgba.html: New option.
* wrap/python/ajax/protocol.txt, NEWS: Document it.
* wrap/python/ajax/spot.in: Implement it.
* wrap/python/spot.i: Export src/ltlvisit/lbt.hh.