Fixes #539. * AUTHORS: Update by indicating the status of each contributor. * Makefile.am, bench/Makefile.am, bench/dtgbasat/Makefile.am, bench/dtgbasat/gen.py, bench/emptchk/Makefile.am, bench/emptchk/defs.in, bench/ltl2tgba/Makefile.am, bench/ltl2tgba/defs.in, bench/ltl2tgba/sum.py, bench/ltlclasses/Makefile.am, bench/ltlcounter/Makefile.am, bench/spin13/Makefile.am, bench/stutter/Makefile.am, bench/stutter/stutter_invariance_formulas.cc, bench/stutter/stutter_invariance_randomgraph.cc, bench/wdba/Makefile.am, bin/Makefile.am, bin/autcross.cc, bin/autfilt.cc, bin/common_aoutput.cc, bin/common_aoutput.hh, bin/common_color.cc, bin/common_color.hh, bin/common_conv.cc, bin/common_conv.hh, bin/common_cout.cc, bin/common_cout.hh, bin/common_file.cc, bin/common_file.hh, bin/common_finput.cc, bin/common_finput.hh, bin/common_hoaread.cc, bin/common_hoaread.hh, bin/common_output.cc, bin/common_output.hh, bin/common_post.cc, bin/common_post.hh, bin/common_r.cc, bin/common_r.hh, bin/common_range.cc, bin/common_range.hh, bin/common_setup.cc, bin/common_setup.hh, bin/common_sys.hh, bin/common_trans.cc, bin/common_trans.hh, bin/dstar2tgba.cc, bin/genaut.cc, bin/genltl.cc, bin/ltl2tgba.cc, bin/ltl2tgta.cc, bin/ltlcross.cc, bin/ltldo.cc, bin/ltlfilt.cc, bin/ltlgrind.cc, bin/ltlsynt.cc, bin/man/Makefile.am, bin/options.py, bin/randaut.cc, bin/randltl.cc, bin/spot-x.cc, bin/spot.cc, configure.ac, debian/copyright, doc/Makefile.am, doc/tl/Makefile.am, elisp/Makefile.am, python/Makefile.am, python/buddy.i, python/spot/__init__.py, python/spot/aux_.py, python/spot/gen.i, python/spot/impl.i, python/spot/jupyter.py, python/spot/ltsmin.i, spot/Makefile.am, spot/gen/Makefile.am, spot/gen/automata.cc, spot/gen/automata.hh, spot/gen/formulas.cc, spot/gen/formulas.hh, spot/graph/Makefile.am, spot/graph/graph.hh, spot/graph/ngraph.hh, spot/kripke/Makefile.am, spot/kripke/fairkripke.cc, spot/kripke/fairkripke.hh, spot/kripke/fwd.hh, spot/kripke/kripke.cc, spot/kripke/kripke.hh, spot/kripke/kripkegraph.hh, spot/ltsmin/Makefile.am, spot/ltsmin/ltsmin.cc, spot/ltsmin/ltsmin.hh, spot/ltsmin/spins_interface.cc, spot/ltsmin/spins_interface.hh, spot/ltsmin/spins_kripke.hh, spot/ltsmin/spins_kripke.hxx, spot/mc/Makefile.am, spot/mc/bloemen.hh, spot/mc/bloemen_ec.hh, spot/mc/cndfs.hh, spot/mc/deadlock.hh, spot/mc/intersect.hh, spot/mc/lpar13.hh, spot/mc/mc.hh, spot/mc/mc_instanciator.hh, spot/mc/unionfind.cc, spot/mc/unionfind.hh, spot/mc/utils.hh, spot/misc/Makefile.am, spot/misc/bareword.cc, spot/misc/bareword.hh, spot/misc/bddlt.hh, spot/misc/bitset.cc, spot/misc/bitset.hh, spot/misc/bitvect.cc, spot/misc/bitvect.hh, spot/misc/casts.hh, spot/misc/clz.hh, spot/misc/common.hh, spot/misc/escape.cc, spot/misc/escape.hh, spot/misc/fixpool.hh, spot/misc/formater.cc, spot/misc/formater.hh, spot/misc/hash.hh, spot/misc/hashfunc.hh, spot/misc/intvcmp2.cc, spot/misc/intvcmp2.hh, spot/misc/intvcomp.cc, spot/misc/intvcomp.hh, spot/misc/ltstr.hh, spot/misc/memusage.cc, spot/misc/memusage.hh, spot/misc/minato.cc, spot/misc/minato.hh, spot/misc/mspool.hh, spot/misc/optionmap.cc, spot/misc/optionmap.hh, spot/misc/random.cc, spot/misc/random.hh, spot/misc/satsolver.cc, spot/misc/satsolver.hh, spot/misc/timer.cc, spot/misc/timer.hh, spot/misc/tmpfile.cc, spot/misc/tmpfile.hh, spot/misc/trival.hh, spot/misc/version.cc, spot/misc/version.hh, spot/parseaut/Makefile.am, spot/parseaut/fmterror.cc, spot/parseaut/parseaut.yy, spot/parseaut/parsedecl.hh, spot/parseaut/public.hh, spot/parseaut/scanaut.ll, spot/parsetl/Makefile.am, spot/parsetl/fmterror.cc, spot/parsetl/parsedecl.hh, spot/parsetl/parsetl.yy, spot/parsetl/scantl.ll, spot/priv/Makefile.am, spot/priv/accmap.hh, spot/priv/bddalloc.cc, spot/priv/bddalloc.hh, spot/priv/freelist.cc, spot/priv/freelist.hh, spot/priv/partitioned_relabel.cc, spot/priv/partitioned_relabel.hh, spot/priv/satcommon.cc, spot/priv/satcommon.hh, spot/priv/trim.cc, spot/priv/trim.hh, spot/priv/weight.cc, spot/priv/weight.hh, spot/ta/Makefile.am, spot/ta/ta.cc, spot/ta/ta.hh, spot/ta/taexplicit.cc, spot/ta/taexplicit.hh, spot/ta/taproduct.cc, spot/ta/taproduct.hh, spot/ta/tgta.hh, spot/ta/tgtaexplicit.cc, spot/ta/tgtaexplicit.hh, spot/ta/tgtaproduct.cc, spot/ta/tgtaproduct.hh, spot/taalgos/Makefile.am, spot/taalgos/dot.cc, spot/taalgos/dot.hh, spot/taalgos/emptinessta.cc, spot/taalgos/emptinessta.hh, spot/taalgos/minimize.cc, spot/taalgos/minimize.hh, spot/taalgos/reachiter.cc, spot/taalgos/reachiter.hh, spot/taalgos/statessetbuilder.cc, spot/taalgos/statessetbuilder.hh, spot/taalgos/stats.cc, spot/taalgos/stats.hh, spot/taalgos/tgba2ta.cc, spot/taalgos/tgba2ta.hh, spot/tl/Makefile.am, spot/tl/apcollect.cc, spot/tl/apcollect.hh, spot/tl/contain.cc, spot/tl/contain.hh, spot/tl/declenv.cc, spot/tl/declenv.hh, spot/tl/defaultenv.cc, spot/tl/defaultenv.hh, spot/tl/dot.cc, spot/tl/dot.hh, spot/tl/environment.hh, spot/tl/exclusive.cc, spot/tl/exclusive.hh, spot/tl/formula.cc, spot/tl/formula.hh, spot/tl/hierarchy.cc, spot/tl/hierarchy.hh, spot/tl/length.cc, spot/tl/length.hh, spot/tl/ltlf.cc, spot/tl/ltlf.hh, spot/tl/mark.cc, spot/tl/mark.hh, spot/tl/mutation.cc, spot/tl/mutation.hh, spot/tl/nenoform.cc, spot/tl/nenoform.hh, spot/tl/parse.hh, spot/tl/print.cc, spot/tl/print.hh, spot/tl/randomltl.cc, spot/tl/randomltl.hh, spot/tl/relabel.cc, spot/tl/relabel.hh, spot/tl/remove_x.cc, spot/tl/remove_x.hh, spot/tl/simplify.cc, spot/tl/simplify.hh, spot/tl/snf.cc, spot/tl/snf.hh, spot/tl/sonf.cc, spot/tl/sonf.hh, spot/tl/unabbrev.cc, spot/tl/unabbrev.hh, spot/twa/Makefile.am, spot/twa/acc.cc, spot/twa/acc.hh, spot/twa/bdddict.cc, spot/twa/bdddict.hh, spot/twa/bddprint.cc, spot/twa/bddprint.hh, spot/twa/formula2bdd.cc, spot/twa/formula2bdd.hh, spot/twa/fwd.hh, spot/twa/taatgba.cc, spot/twa/taatgba.hh, spot/twa/twa.cc, spot/twa/twa.hh, spot/twa/twagraph.cc, spot/twa/twagraph.hh, spot/twa/twaproduct.cc, spot/twa/twaproduct.hh, spot/twaalgos/Makefile.am, spot/twaalgos/aiger.cc, spot/twaalgos/aiger.hh, spot/twaalgos/alternation.cc, spot/twaalgos/alternation.hh, spot/twaalgos/are_isomorphic.cc, spot/twaalgos/are_isomorphic.hh, spot/twaalgos/bfssteps.cc, spot/twaalgos/bfssteps.hh, spot/twaalgos/canonicalize.cc, spot/twaalgos/canonicalize.hh, spot/twaalgos/cleanacc.cc, spot/twaalgos/cleanacc.hh, spot/twaalgos/cobuchi.cc, spot/twaalgos/cobuchi.hh, spot/twaalgos/complement.cc, spot/twaalgos/complement.hh, spot/twaalgos/complete.cc, spot/twaalgos/complete.hh, spot/twaalgos/compsusp.cc, spot/twaalgos/compsusp.hh, spot/twaalgos/contains.cc, spot/twaalgos/contains.hh, spot/twaalgos/copy.hh, spot/twaalgos/couvreurnew.cc, spot/twaalgos/couvreurnew.hh, spot/twaalgos/cycles.cc, spot/twaalgos/cycles.hh, spot/twaalgos/dbranch.cc, spot/twaalgos/dbranch.hh, spot/twaalgos/degen.cc, spot/twaalgos/degen.hh, spot/twaalgos/determinize.cc, spot/twaalgos/determinize.hh, spot/twaalgos/dot.cc, spot/twaalgos/dot.hh, spot/twaalgos/dtbasat.cc, spot/twaalgos/dtbasat.hh, spot/twaalgos/dtwasat.cc, spot/twaalgos/dtwasat.hh, spot/twaalgos/dualize.cc, spot/twaalgos/dualize.hh, spot/twaalgos/emptiness.cc, spot/twaalgos/emptiness.hh, spot/twaalgos/emptiness_stats.hh, spot/twaalgos/forq_contains.cc, spot/twaalgos/forq_contains.hh, spot/twaalgos/game.cc, spot/twaalgos/game.hh, spot/twaalgos/genem.cc, spot/twaalgos/genem.hh, spot/twaalgos/gfguarantee.cc, spot/twaalgos/gfguarantee.hh, spot/twaalgos/gtec/Makefile.am, spot/twaalgos/gtec/ce.cc, spot/twaalgos/gtec/ce.hh, spot/twaalgos/gtec/gtec.cc, spot/twaalgos/gtec/gtec.hh, spot/twaalgos/gtec/sccstack.cc, spot/twaalgos/gtec/sccstack.hh, spot/twaalgos/gtec/status.cc, spot/twaalgos/gtec/status.hh, spot/twaalgos/gv04.cc, spot/twaalgos/gv04.hh, spot/twaalgos/hoa.cc, spot/twaalgos/hoa.hh, spot/twaalgos/iscolored.cc, spot/twaalgos/iscolored.hh, spot/twaalgos/isdet.cc, spot/twaalgos/isdet.hh, spot/twaalgos/isunamb.cc, spot/twaalgos/isunamb.hh, spot/twaalgos/isweakscc.cc, spot/twaalgos/isweakscc.hh, spot/twaalgos/langmap.cc, spot/twaalgos/langmap.hh, spot/twaalgos/lbtt.cc, spot/twaalgos/lbtt.hh, spot/twaalgos/ltl2taa.cc, spot/twaalgos/ltl2taa.hh, spot/twaalgos/ltl2tgba_fm.cc, spot/twaalgos/ltl2tgba_fm.hh, spot/twaalgos/magic.cc, spot/twaalgos/magic.hh, spot/twaalgos/mask.cc, spot/twaalgos/mask.hh, spot/twaalgos/mealy_machine.cc, spot/twaalgos/mealy_machine.hh, spot/twaalgos/minimize.cc, spot/twaalgos/minimize.hh, spot/twaalgos/ndfs_result.hxx, spot/twaalgos/neverclaim.cc, spot/twaalgos/neverclaim.hh, spot/twaalgos/parity.cc, spot/twaalgos/parity.hh, spot/twaalgos/postproc.cc, spot/twaalgos/postproc.hh, spot/twaalgos/powerset.cc, spot/twaalgos/powerset.hh, spot/twaalgos/product.cc, spot/twaalgos/product.hh, spot/twaalgos/randomgraph.cc, spot/twaalgos/randomgraph.hh, spot/twaalgos/randomize.cc, spot/twaalgos/randomize.hh, spot/twaalgos/reachiter.cc, spot/twaalgos/reachiter.hh, spot/twaalgos/relabel.cc, spot/twaalgos/relabel.hh, spot/twaalgos/remfin.cc, spot/twaalgos/remfin.hh, spot/twaalgos/remprop.cc, spot/twaalgos/remprop.hh, spot/twaalgos/sbacc.cc, spot/twaalgos/sbacc.hh, spot/twaalgos/sccfilter.cc, spot/twaalgos/sccfilter.hh, spot/twaalgos/sccinfo.cc, spot/twaalgos/sccinfo.hh, spot/twaalgos/se05.cc, spot/twaalgos/se05.hh, spot/twaalgos/sepsets.cc, spot/twaalgos/sepsets.hh, spot/twaalgos/simulation.cc, spot/twaalgos/simulation.hh, spot/twaalgos/split.cc, spot/twaalgos/split.hh, spot/twaalgos/stats.cc, spot/twaalgos/stats.hh, spot/twaalgos/strength.cc, spot/twaalgos/strength.hh, spot/twaalgos/stripacc.cc, spot/twaalgos/stripacc.hh, spot/twaalgos/stutter.cc, spot/twaalgos/stutter.hh, spot/twaalgos/sum.cc, spot/twaalgos/sum.hh, spot/twaalgos/synthesis.cc, spot/twaalgos/synthesis.hh, spot/twaalgos/tau03.cc, spot/twaalgos/tau03.hh, spot/twaalgos/tau03opt.cc, spot/twaalgos/tau03opt.hh, spot/twaalgos/toparity.cc, spot/twaalgos/toparity.hh, spot/twaalgos/totgba.cc, spot/twaalgos/totgba.hh, spot/twaalgos/toweak.cc, spot/twaalgos/toweak.hh, spot/twaalgos/translate.cc, spot/twaalgos/translate.hh, spot/twaalgos/word.cc, spot/twaalgos/word.hh, spot/twaalgos/zlktree.cc, spot/twaalgos/zlktree.hh, spot/twacube/Makefile.am, spot/twacube/cube.cc, spot/twacube/cube.hh, spot/twacube/fwd.hh, spot/twacube/twacube.cc, spot/twacube/twacube.hh, spot/twacube_algos/Makefile.am, spot/twacube_algos/convert.cc, spot/twacube_algos/convert.hh, tests/Makefile.am, tests/core/385.test, tests/core/500.test, tests/core/521.test, tests/core/522.test, tests/core/acc.cc, tests/core/acc.test, tests/core/acc2.test, tests/core/acc_word.test, tests/core/accsimpl.test, tests/core/alternating.test, tests/core/autcross.test, tests/core/autcross2.test, tests/core/autcross3.test, tests/core/autcross4.test, tests/core/autcross5.test, tests/core/babiak.test, tests/core/bare.test, tests/core/basimul.test, tests/core/bdd.test, tests/core/bdddict.cc, tests/core/bdddict.test, tests/core/bitvect.cc, tests/core/bitvect.test, tests/core/bricks.cc, tests/core/bricks.test, tests/core/checkpsl.cc, tests/core/checkta.cc, tests/core/complement.test, tests/core/complementation.test, tests/core/complete.test, tests/core/consterm.cc, tests/core/consterm.test, tests/core/cube.cc, tests/core/cube.test, tests/core/cycles.test, tests/core/dbacomp.test, tests/core/dca.test, tests/core/dca2.test, tests/core/defs.in, tests/core/degendet.test, tests/core/degenid.test, tests/core/degenlskip.test, tests/core/degenscc.test, tests/core/det.test, tests/core/dfs.test, tests/core/dnfstreett.test, tests/core/dot2tex.test, tests/core/dra2dba.test, tests/core/dstar.test, tests/core/dualize.test, tests/core/dupexp.test, tests/core/emptchk.cc, tests/core/emptchk.test, tests/core/emptchke.test, tests/core/emptchkr.test, tests/core/equals.test, tests/core/equalsf.cc, tests/core/eventuniv.test, tests/core/exclusive-ltl.test, tests/core/exclusive-tgba.test, tests/core/explpro2.test, tests/core/explpro3.test, tests/core/explpro4.test, tests/core/explprod.test, tests/core/explsum.test, tests/core/format.test, tests/core/full.test, tests/core/gamehoa.test, tests/core/genaut.test, tests/core/genltl.test, tests/core/gragsa.test, tests/core/graph.cc, tests/core/graph.test, tests/core/hierarchy.test, tests/core/highlightstate.test, tests/core/ikwiad.cc, tests/core/included.test, tests/core/intvcmp2.cc, tests/core/intvcomp.cc, tests/core/intvcomp.test, tests/core/isomorph.test, tests/core/isop.test, tests/core/kind.cc, tests/core/kind.test, tests/core/kripke.test, tests/core/kripkecat.cc, tests/core/latex.test, tests/core/lbt.test, tests/core/lbttparse.test, tests/core/length.cc, tests/core/length.test, tests/core/lenient.test, tests/core/ltl2dstar.test, tests/core/ltl2dstar2.test, tests/core/ltl2dstar3.test, tests/core/ltl2dstar4.test, tests/core/ltl2neverclaim-lbtt.test, tests/core/ltl2neverclaim.test, tests/core/ltl2ta.test, tests/core/ltl2ta2.test, tests/core/ltl2tgba.test, tests/core/ltl2tgba2.test, tests/core/ltl3ba.test, tests/core/ltl3dra.test, tests/core/ltlcounter.test, tests/core/ltlcross.test, tests/core/ltlcross2.test, tests/core/ltlcross3.test, tests/core/ltlcross4.test, tests/core/ltlcross5.test, tests/core/ltlcross6.test, tests/core/ltlcrossce.test, tests/core/ltlcrossce2.test, tests/core/ltlcrossgrind.test, tests/core/ltldo.test, tests/core/ltldo2.test, tests/core/ltlf.test, tests/core/ltlfilt.test, tests/core/ltlgrind.test, tests/core/ltlrel.cc, tests/core/ltlrel.test, tests/core/ltlsynt-pgame.test, tests/core/ltlsynt.test, tests/core/ltlsynt2.test, tests/core/lunabbrev.test, tests/core/maskacc.test, tests/core/maskkeep.test, tests/core/mempool.cc, tests/core/mempool.test, tests/core/minterm.cc, tests/core/minterm.test, tests/core/minusx.test, tests/core/monitor.test, tests/core/nenoform.test, tests/core/neverclaimread.test, tests/core/ngraph.cc, tests/core/ngraph.test, tests/core/nondet.test, tests/core/obligation.test, tests/core/optba.test, tests/core/parity.cc, tests/core/parity.test, tests/core/parity2.test, tests/core/parse.test, tests/core/parseaut.test, tests/core/parseerr.test, tests/core/pdegen.test, tests/core/pgsolver.test, tests/core/prodchain.test, tests/core/prodor.test, tests/core/rabin2parity.test, tests/core/rand.test, tests/core/randaut.test, tests/core/randomize.test, tests/core/randpsl.test, tests/core/randtgba.cc, tests/core/randtgba.test, tests/core/readltl.cc, tests/core/readsave.test, tests/core/reduc.cc, tests/core/reduc.test, tests/core/reduc0.test, tests/core/reduccmp.test, tests/core/reducpsl.test, tests/core/remfin.test, tests/core/remove_x.test, tests/core/remprop.test, tests/core/renault.test, tests/core/safra.cc, tests/core/safra.test, tests/core/satmin.test, tests/core/satmin2.test, tests/core/satmin3.test, tests/core/sbacc.test, tests/core/scc.test, tests/core/sccdot.test, tests/core/sccif.cc, tests/core/sccif.test, tests/core/sccsimpl.test, tests/core/semidet.test, tests/core/sepsets.test, tests/core/serial.test, tests/core/sim2.test, tests/core/sim3.test, tests/core/sonf.test, tests/core/split.test, tests/core/spotlbtt.test, tests/core/spotlbtt2.test, tests/core/streett.test, tests/core/strength.test, tests/core/stutter-ltl.test, tests/core/stutter-tgba.test, tests/core/sugar.test, tests/core/syfco.test, tests/core/syntimpl.cc, tests/core/syntimpl.test, tests/core/taatgba.cc, tests/core/taatgba.test, tests/core/tgbagraph.test, tests/core/tostring.cc, tests/core/tostring.test, tests/core/tripprod.test, tests/core/trival.cc, tests/core/trival.test, tests/core/tunabbrev.test, tests/core/tunenoform.test, tests/core/twacube.cc, tests/core/twacube.test, tests/core/twagraph.cc, tests/core/unabbrevwm.test, tests/core/unambig.test, tests/core/unambig2.test, tests/core/uniq.test, tests/core/utf8.test, tests/core/uwrm.test, tests/core/wdba.test, tests/core/wdba2.test, tests/ltsmin/check.test, tests/ltsmin/check2.test, tests/ltsmin/check3.test, tests/ltsmin/finite.test, tests/ltsmin/finite2.test, tests/ltsmin/finite3.test, tests/ltsmin/kripke.test, tests/ltsmin/modelcheck.cc, tests/ltsmin/testconvert.cc, tests/ltsmin/testconvert.test, tests/python/298.py, tests/python/341.py, tests/python/471.py, tests/python/acc.py, tests/python/accparse2.py, tests/python/aiger.py, tests/python/alarm.py, tests/python/aliases.py, tests/python/alternating.py, tests/python/bdddict.py, tests/python/bdditer.py, tests/python/bddnqueen.py, tests/python/bugdet.py, tests/python/complement_semidet.py, tests/python/dbranch.py, tests/python/declenv.py, tests/python/decompose_scc.py, tests/python/det.py, tests/python/dualize.py, tests/python/ecfalse.py, tests/python/except.py, tests/python/forq_contains.py, tests/python/game.py, tests/python/gen.py, tests/python/genem.py, tests/python/implies.py, tests/python/interdep.py, tests/python/intrun.py, tests/python/kripke.py, tests/python/langmap.py, tests/python/ltl2tgba.py, tests/python/ltl2tgba.test, tests/python/ltlf.py, tests/python/ltlparse.py, tests/python/ltlsimple.py, tests/python/mealy.py, tests/python/merge.py, tests/python/mergedge.py, tests/python/minato.py, tests/python/misc-ec.py, tests/python/optionmap.py, tests/python/origstate.py, tests/python/otfcrash.py, tests/python/parity.py, tests/python/parsetgba.py, tests/python/pdegen.py, tests/python/powerset.py, tests/python/prodexpt.py, tests/python/randgen.py, tests/python/relabel.py, tests/python/remfin.py, tests/python/removeap.py, tests/python/rs_like.py, tests/python/satmin.py, tests/python/sbacc.py, tests/python/sccfilter.py, tests/python/sccinfo.py, tests/python/sccsplit.py, tests/python/semidet.py, tests/python/setacc.py, tests/python/setxor.py, tests/python/simplacc.py, tests/python/simstate.py, tests/python/sonf.py, tests/python/split.py, tests/python/splitedge.py, tests/python/streett_totgba.py, tests/python/streett_totgba2.py, tests/python/stutter.py, tests/python/sum.py, tests/python/synthesis.py, tests/python/toparity.py, tests/python/toweak.py, tests/python/tra2tba.py, tests/python/trival.py, tests/python/twagraph.py, tests/python/zlktree.py, tests/run.in, tests/sanity/80columns.test, tests/sanity/bin.test, tests/sanity/getenv.test, tests/sanity/includes.test, tests/sanity/ipynb.pl, tests/sanity/namedprop.test, tests/sanity/private.test, tests/sanity/readme.pl, tests/sanity/style.test, tools/man2html.pl: Update all copyright headers.
897 lines
28 KiB
Python
Executable file
897 lines
28 KiB
Python
Executable file
#!/usr/bin/env python3
|
|
# Copyright (C) by the Spot authors, see the AUTHORS file for details.
|
|
#
|
|
# This file is part of Spot, a model checking library.
|
|
#
|
|
# Spot is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# Spot is distributed in the hope that it will be useful, but WITHOUT
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
# License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
import argparse
|
|
import csv
|
|
import re
|
|
from collections import namedtuple
|
|
|
|
# Pylatex Imports
|
|
from pylatex import Document, Package, Tabular, MultiColumn
|
|
from pylatex.utils import bold, NoEscape
|
|
from pylatex.base_classes import CommandBase, Arguments
|
|
from pylatex.base_classes.command import Parameters
|
|
|
|
|
|
# ---------------------------------------------------------PARSE_CONFIG
|
|
Bench = namedtuple('Bench', ['name', 'code', 'xoptions'])
|
|
|
|
|
|
class BenchConfig(object):
|
|
"""
|
|
A class used to parse the 'bench.config' file.
|
|
"""
|
|
def __init__(self, filename):
|
|
"""
|
|
Any BenchConfig object file will have the following arguments:
|
|
|
|
-self.l which represents the list of all bench in the config file.
|
|
Each bench having three variables: name, code & xoptions.
|
|
|
|
-self.sh which contains shell codes that must be executed before
|
|
each bench.
|
|
"""
|
|
self.l = []
|
|
self.sh = []
|
|
with open(filename, 'r') as inputfile:
|
|
lines = inputfile.readlines()
|
|
for line in lines:
|
|
if line[0] == '#' or line.isspace():
|
|
continue
|
|
elif line[0:2] == "sh":
|
|
sh = re.search('sh (.+)$', line).group(1)
|
|
continue
|
|
else:
|
|
name = re.search('(.+?):', line).group(1)
|
|
code = re.search(':(.+?)>', line).group(1)
|
|
xoptions = re.search('>(.+)$', line).group(1)
|
|
b = Bench(name=name, code=code, xoptions=xoptions)
|
|
self.l.append(b)
|
|
self.sh.append(sh)
|
|
sh = ""
|
|
# ---------------------------------------------------------PARSE_CONFIG
|
|
|
|
|
|
# --------------------------------------------------------------PYLATEX
|
|
class ColorArgument(Parameters):
|
|
"""
|
|
A class implementing custom arguments formating for LaTeX command.
|
|
"""
|
|
def dumps(self):
|
|
params = self._list_args_kwargs()
|
|
if len(params) <= 0 or len(params) > 2:
|
|
return ''
|
|
string = '{' + params[0] + '} ' + params[1]
|
|
return string
|
|
|
|
|
|
class SetColor(CommandBase):
|
|
"""
|
|
A class representing a LaTeX command used to colorize table's cells.
|
|
"""
|
|
_latex_name = 'cellcolor'
|
|
|
|
def dumps(self):
|
|
arguments = self.arguments.dumps()
|
|
res = '\\' + self._latex_name + arguments[1:-1]
|
|
return res
|
|
|
|
|
|
class DefineColor(CommandBase):
|
|
"""
|
|
A class representing a LaTeX command used to define a color.
|
|
"""
|
|
_latex_name = 'definecolor'
|
|
|
|
|
|
def ne(string):
|
|
"""
|
|
A wrapper around pylatex class NoEscape. It helps to tell pylatex to
|
|
not escape a string.
|
|
|
|
Be careful:
|
|
ne(string) + ne(string) = ne(string)
|
|
but
|
|
ne(string) + simple_string = simple_string
|
|
"""
|
|
return NoEscape(string)
|
|
# --------------------------------------------------------------PYLATEX
|
|
|
|
|
|
# --------------------------------------------------------------SUMMARY
|
|
def add_winner(res, winner, loser):
|
|
"""
|
|
Each time this function is called, it increments the scrore
|
|
of one method against another one.
|
|
"""
|
|
res_length = len(res)
|
|
header_length = len(res[0])
|
|
for i in range(1, res_length): # except the first row (header)
|
|
if winner in res[i]:
|
|
for j in range(1, header_length):
|
|
if loser in res[0][j]:
|
|
if type(res[i][j]) is str:
|
|
res[i][j] = 1
|
|
else:
|
|
res[i][j] = res[i][j] + 1
|
|
break
|
|
|
|
|
|
def is_better(to_be_compared, val):
|
|
"""
|
|
Check that two to_be_compared is higher than val (5% tolerance).
|
|
"""
|
|
if val == 0:
|
|
return to_be_compared == 0
|
|
else:
|
|
return to_be_compared / val < 0.95
|
|
|
|
|
|
def cmp_to_others(id_cmp, instance_cmp, what_cmp, line, config, res):
|
|
"""
|
|
Function used to compare a time of one method to others method.
|
|
"""
|
|
len_l = len(config.l)
|
|
for i in range(0, len_l):
|
|
index = get_st_index_of('min' + what_cmp + '.' + config.l[i].code,
|
|
line)
|
|
if index == id_cmp:
|
|
continue
|
|
if '-' not in line[index] and '!' not in line[index]:
|
|
val_cmp = float(line[id_cmp + 7])
|
|
other = float(line[index + 7])
|
|
if is_better(val_cmp, other):
|
|
add_winner(res, instance_cmp, config.l[i].code)
|
|
else:
|
|
add_winner(res, instance_cmp, config.l[i].code)
|
|
|
|
|
|
def get_summary(config, test):
|
|
"""
|
|
Function used to get the summary of 'test' that can be either DBA,
|
|
or DTGBA.
|
|
"""
|
|
res = []
|
|
len_l = len(config.l)
|
|
|
|
# Header
|
|
header = ['']
|
|
for i in range(0, len_l):
|
|
header.append(config.l[i].code)
|
|
header.append('total')
|
|
res.append(header)
|
|
|
|
# Prepare Body (fill with '-')
|
|
for i in range(0, len_l):
|
|
row = [config.l[i].code]
|
|
for j in range(0, len_l):
|
|
row.append('-')
|
|
row.append('')
|
|
res.append(row)
|
|
|
|
# Body
|
|
ifile = open('all.csv', 'r')
|
|
lines = ifile.readlines()
|
|
length = len(lines)
|
|
for i in range(0, length):
|
|
lines[i] = lines[i].split(',')
|
|
|
|
for i in range(0, length):
|
|
for j in range(0, len_l):
|
|
pattern = 'min' + test + '.' + config.l[j].code
|
|
|
|
st_id = get_st_index_of(pattern, lines[i])
|
|
if '-' not in lines[i][st_id] and \
|
|
'!' not in lines[i][st_id]:
|
|
cmp_to_others(st_id, config.l[j].code, test,
|
|
lines[i], config, res)
|
|
|
|
for row in res[1:]:
|
|
row[-1] = sum(x for x in row[1:-1] if type(x) is not str)
|
|
return res
|
|
|
|
|
|
def write_summary(table2, config):
|
|
"""
|
|
Function that writes all the bench's summary.
|
|
"""
|
|
dba_summary = get_summary(config, 'DBA')
|
|
dtgba_summary = get_summary(config, 'DTGBA')
|
|
len_l = len(config.l)
|
|
table2.add_hline()
|
|
table2.add_row(
|
|
(MultiColumn(len_l + 2, align='|c|', data='DBA'),))
|
|
table2.add_hline()
|
|
for i in range(0, len(dba_summary)):
|
|
table2.add_row(tuple(dba_summary[i]))
|
|
table2.add_hline()
|
|
table2.add_row((MultiColumn(len_l + 2),))
|
|
table2.add_hline()
|
|
table2.add_row((MultiColumn(len_l + 2, align='|c|', data='DTGBA'),))
|
|
table2.add_hline()
|
|
for line in dtgba_summary:
|
|
table2.add_row(tuple(line))
|
|
table2.add_hline()
|
|
# --------------------------------------------------------------SUMMARY
|
|
|
|
|
|
# --------------------------------------------------------------RESULTS
|
|
def get_st_index_of(pattern, line):
|
|
"""
|
|
A function used to get the first column of each benchmarked tool.
|
|
"""
|
|
size = len(line)
|
|
for i in range(0, size):
|
|
if pattern in line[i]:
|
|
return i + 1
|
|
raise ValueError('\'' + pattern + '\' is not found in log files')
|
|
|
|
|
|
def dba_st_cmp_dtgba_st(pattern, line):
|
|
"""
|
|
Function that checks if minDTGBA.st * (minDTGBA.acc + 1) < minDBA.st.
|
|
It should not be the case normally!
|
|
"""
|
|
dba_st_id = get_st_index_of(pattern, line)
|
|
dba_st = line[dba_st_id]
|
|
dtgba_v = 0
|
|
dtgba_acc = 0
|
|
dba_v = 0
|
|
if '-' not in dba_st and '!' not in dba_st:
|
|
dba_v = int(dba_st)
|
|
if '-' not in line[dba_st_id + 10] \
|
|
and '!' not in line[dba_st_id + 10]:
|
|
dtgba_v = int(line[dba_st_id + 10])
|
|
dtgba_acc = int(line[dba_st_id + 13])
|
|
return dtgba_v * (dtgba_acc + 1) < dba_v
|
|
return False
|
|
|
|
|
|
def get_last_successful(n, category, pattern):
|
|
"""
|
|
A function used to get the last automaton size from satlog file.
|
|
"""
|
|
try:
|
|
log = open(str(n) + '.' + category + '.' + pattern
|
|
+ '.satlog', 'r')
|
|
log_csv = csv.reader(log)
|
|
for line in log_csv:
|
|
min_val = line[2]
|
|
return '$\\le$' + min_val
|
|
except Exception:
|
|
return ''
|
|
|
|
|
|
def check_all_st_are_eq(line, pattern):
|
|
"""
|
|
A function that:
|
|
- retrieve all column values that are just after any column containing
|
|
the pattern.
|
|
- check that all those values are exactly the same.
|
|
"""
|
|
size = len(line)
|
|
l = []
|
|
for i in range(0, size):
|
|
if pattern in line[i]:
|
|
if '-' not in line[i + 1] and '!' not in line[i + 1] \
|
|
and 'n/a' not in line[i + 1]:
|
|
try:
|
|
int(i + 1)
|
|
except Exception as e:
|
|
print(e)
|
|
exit()
|
|
l.append(line[i + 1])
|
|
|
|
return all(x == l[0] for x in l)
|
|
|
|
|
|
def add_other_cols(row, line, config):
|
|
"""
|
|
A function used to add all columns that dynamically depend on the
|
|
config.bench file.
|
|
"""
|
|
n = int(line[-1])
|
|
category = ['DBA', 'DTGBA']
|
|
|
|
dba_t = []
|
|
dtgba_t = []
|
|
dba_st = int(line[13])
|
|
|
|
all_dba_st_eq = check_all_st_are_eq(line, 'minDBA')
|
|
all_dtgba_st_eq = check_all_st_are_eq(line, 'minDTGBA')
|
|
|
|
len_l = len(config.l)
|
|
for i in range(0, len_l):
|
|
for elt in category:
|
|
if 'DBA' in elt:
|
|
width = 3
|
|
elif 'DTGBA' in elt:
|
|
width = 4
|
|
st_id = get_st_index_of('min' + elt + '.' + config.l[i].code, line)
|
|
if '-' in line[st_id]:
|
|
s = ne(get_last_successful(n, elt, config.l[i].code))
|
|
row.append(MultiColumn(width, align='c|',
|
|
data=ne('(killed') + s + ne(')')))
|
|
elif '!' in line[st_id]:
|
|
s = ne(get_last_successful(n, elt, config.l[i].code))
|
|
row.append(MultiColumn(width, align='c|',
|
|
data=ne('(intmax') + s + ne(')')))
|
|
else:
|
|
cur_st = int(line[st_id])
|
|
|
|
if 'DBA' in elt and \
|
|
dba_st_cmp_dtgba_st('min' + elt + '.'
|
|
+ config.l[i].code, line):
|
|
row.append(SetColor(
|
|
arguments=ColorArgument('Purpl', str(cur_st))))
|
|
elif ((not all_dba_st_eq) and 'DBA' in elt) \
|
|
or ((not all_dtgba_st_eq) and 'DTGBA' in elt) \
|
|
or cur_st > dba_st:
|
|
row.append(SetColor(
|
|
arguments=ColorArgument('Red', str(cur_st))))
|
|
elif cur_st < dba_st:
|
|
row.append(SetColor(
|
|
arguments=ColorArgument('Gray', str(cur_st))))
|
|
else:
|
|
row.append(str(cur_st))
|
|
|
|
row.append(line[st_id + 2]) # st + 2 = trans
|
|
time = '%.2f' % round(float(line[st_id + 7]), 2)
|
|
if width > 3:
|
|
row.append(line[st_id + 3])
|
|
dtgba_t.append(time)
|
|
else:
|
|
dba_t.append(time)
|
|
row.append(time)
|
|
|
|
try:
|
|
dba = min(float(x) for x in dba_t)
|
|
except ValueError:
|
|
dba = -1
|
|
try:
|
|
dtgba = min(float(x) for x in dtgba_t)
|
|
except ValueError:
|
|
dtgba = -1
|
|
return dba, dtgba
|
|
|
|
|
|
def get_dra_st(line, c):
|
|
"""
|
|
Get state of DRA.
|
|
"""
|
|
for i in range(0, len(line)):
|
|
if 'DRA' in line[i]:
|
|
if 'n/a' in line[i + 1]:
|
|
return ''
|
|
else:
|
|
return str(int(line[i + 1]) - 1 + int(c))
|
|
|
|
|
|
def get_type(type_f):
|
|
"""
|
|
A function used to categorized each formula.
|
|
"""
|
|
tmp = ''
|
|
if 'trad' in type_f:
|
|
tmp = 'T'
|
|
elif 'TCONG' in type_f:
|
|
tmp = 'P'
|
|
elif 'DRA' in type_f:
|
|
tmp = 'R'
|
|
elif 'WDBA' in type_f:
|
|
tmp = 'W'
|
|
else:
|
|
tmp = type_f
|
|
return tmp
|
|
|
|
|
|
def val(line, v):
|
|
"""
|
|
A function used to retrieve any integer located at line[v].
|
|
"""
|
|
try:
|
|
res = int(line[v])
|
|
except Exception as e:
|
|
if '-' in line[v]:
|
|
return 1
|
|
else:
|
|
print(e)
|
|
exit()
|
|
return res
|
|
|
|
|
|
def all_aut_are_det(line, config):
|
|
"""
|
|
A function that check that all automaton produced are determinist.
|
|
"""
|
|
if val(line, 8) == 0 or val(line, 18) == 0:
|
|
return False
|
|
size = len(config.l)
|
|
for i in range(1, size + 1):
|
|
if val(line, 18 + 10 * i) == 0:
|
|
return False
|
|
return True
|
|
|
|
|
|
def clean_formula(f):
|
|
"""
|
|
A function used to clean any formula.
|
|
"""
|
|
res = '$'
|
|
f_iter = iter(f)
|
|
for it in f_iter:
|
|
if it == '&':
|
|
res += '\\land '
|
|
elif it == '|':
|
|
res += '\\lor '
|
|
elif it == '!':
|
|
res += '\\bar '
|
|
elif it == '-' and next(f_iter, it) == '>':
|
|
res += '\\rightarrow '
|
|
elif it == '<' and next(f_iter, it) == '-' and next(f_iter, it) == '>':
|
|
res += '\\leftrightarrow '
|
|
else:
|
|
res += it
|
|
return ne(res + '$')
|
|
|
|
|
|
def add_static_cols(row, line, config):
|
|
"""
|
|
A function used to add the 14 first static columns. Those columns don't
|
|
depend on the config.bench file.
|
|
"""
|
|
f = clean_formula(line[0]) # TODO: define math operators for formula
|
|
m = line[1]
|
|
f_type = line[2]
|
|
c = line[9]
|
|
if all_aut_are_det(line, config):
|
|
c_str = line[9]
|
|
else:
|
|
c_str = SetColor(arguments=ColorArgument('Red', line[9]))
|
|
dtgba_st = line[3]
|
|
dtgba_tr = line[5]
|
|
dtgba_acc = line[6]
|
|
dtgba_time = '%.2f' % round(float(line[10]), 2)
|
|
dba_st = line[13]
|
|
dba_tr = line[15]
|
|
dba_time = line[20]
|
|
|
|
row.append(f) # formula
|
|
row.append(m)
|
|
row.append(get_type(f_type)) # trad -> T, TCONG -> P, DRA -> R, WDBA -> W
|
|
row.append(c_str) # is complete or not
|
|
row.append(get_dra_st(line, c))
|
|
row.append(dtgba_st)
|
|
row.append(dtgba_tr)
|
|
row.append(dtgba_acc)
|
|
row.append(dtgba_time)
|
|
row.append(dba_st)
|
|
row.append(dba_tr)
|
|
if '-' in dba_time or '!' in dba_time:
|
|
row.append(dba_time)
|
|
else:
|
|
row.append('%.2f' % round(float(dba_time), 2))
|
|
|
|
# DBAminimizer
|
|
length = len(line)
|
|
for i in range(0, length):
|
|
if 'dbaminimizer' in line[i]:
|
|
if '-' in line[i + 1]:
|
|
row.append(MultiColumn(2, align='|c', data='(killed)'))
|
|
elif 'n/a' in line[i + 1]:
|
|
row.append('')
|
|
row.append('')
|
|
else:
|
|
minimizer_st = int(line[i + 1]) - 1 + int(c)
|
|
if minimizer_st < int(dba_st):
|
|
row.append(SetColor(
|
|
arguments=ColorArgument('Gray', str(minimizer_st))))
|
|
elif minimizer_st > int(dba_st):
|
|
row.append(SetColor(
|
|
arguments=ColorArgument('Red', str(minimizer_st))))
|
|
else:
|
|
row.append(minimizer_st)
|
|
row.append('%.2f' % round(float(line[i + 2]), 2))
|
|
|
|
|
|
def next_bench_considering_all(line, index):
|
|
"""
|
|
A function used to get the index of the next benchmark. It takes into
|
|
account '(killed)' MultiColumns...
|
|
"""
|
|
try:
|
|
line[index + 7]
|
|
except:
|
|
return index + 7
|
|
|
|
if is_not_MultiColumn(line, index):
|
|
if is_not_MultiColumn(line, index + 3):
|
|
return index + 7
|
|
else:
|
|
return index + 4
|
|
else:
|
|
if is_not_MultiColumn(line, index + 1):
|
|
return index + 5
|
|
else:
|
|
return index + 2
|
|
|
|
|
|
def is_eq(to_be_compared, val):
|
|
"""
|
|
Check that two values are almost equal (5% tolerance).
|
|
"""
|
|
try:
|
|
return to_be_compared / val <= 1.05 # to_... is always >= val
|
|
except ZeroDivisionError:
|
|
return is_eq(to_be_compared + 1, val + 1)
|
|
|
|
|
|
def is_not_MultiColumn(line, index):
|
|
"""
|
|
Check that the type(line[index]) is not MultiColumn.
|
|
"""
|
|
try:
|
|
return type(line[index]) is not MultiColumn
|
|
except IndexError as e:
|
|
print(e)
|
|
exit()
|
|
|
|
|
|
def get_first_mindba(line):
|
|
"""
|
|
A function used to get the index of the first benchmark (just after
|
|
the static columns).
|
|
"""
|
|
if type(line[12]) is MultiColumn:
|
|
return 13
|
|
return 14
|
|
|
|
|
|
def get_lines(config):
|
|
"""
|
|
Entry point for parsing the csv file. It returns all lines that will
|
|
be displayed. After this function, no more treatment are done on datas.
|
|
"""
|
|
all_l = []
|
|
best_dba_l = []
|
|
best_dtgba_l = []
|
|
ifile = open('all.csv', 'r')
|
|
reader = csv.reader(ifile)
|
|
for line in reader:
|
|
row = []
|
|
add_static_cols(row, line, config) # 14 first columns
|
|
dba_t, dtgba_t = add_other_cols(row, line, config) # All the rest
|
|
all_l.append(row)
|
|
best_dba_l.append(dba_t)
|
|
best_dtgba_l.append(dtgba_t)
|
|
|
|
all_lines_length = len(all_l)
|
|
for i in range(0, all_lines_length):
|
|
index = get_first_mindba(all_l[i])
|
|
size = len(all_l[i])
|
|
while index < size:
|
|
if best_dba_l[i] != -1:
|
|
if is_not_MultiColumn(all_l[i], index):
|
|
if is_eq(float(all_l[i][index + 2]), best_dba_l[i]):
|
|
all_l[i][index + 2] = SetColor(
|
|
arguments=ColorArgument('Green',
|
|
str(best_dba_l[i])))
|
|
|
|
if best_dtgba_l[i] != -1:
|
|
if is_not_MultiColumn(all_l[i], index):
|
|
if is_not_MultiColumn(all_l[i], index + 3)\
|
|
and is_eq(float(all_l[i][index + 6]),
|
|
best_dtgba_l[i]):
|
|
all_l[i][index + 6] = SetColor(
|
|
arguments=ColorArgument('Yelw',
|
|
str(best_dtgba_l[i])))
|
|
else:
|
|
if is_not_MultiColumn(all_l[i], index + 1)\
|
|
and is_eq(float(all_l[i][index + 4]),
|
|
best_dtgba_l[i]):
|
|
all_l[i][index + 4] = SetColor(
|
|
arguments=ColorArgument('Yelw',
|
|
str(best_dtgba_l[i])))
|
|
|
|
index = next_bench_considering_all(all_l[i], index)
|
|
return all_l, best_dba_l, best_dtgba_l
|
|
|
|
|
|
def write_header(table, config):
|
|
"""
|
|
Function that write the first lines of the document.
|
|
"""
|
|
# Static datas
|
|
data_row1 = ne('Column ') + bold('type') + \
|
|
ne(' shows how the initial det. aut. was obtained: T = translation'
|
|
' produces DTGBA; W = WDBA minimization works; P = powerset '
|
|
'construction transforms TBA to DTBA; R = DRA to DBA.')
|
|
data_row2 = ne('Column ') + bold('C.') + \
|
|
ne(' tells whether the output automaton is complete: rejecting '
|
|
'sink states are always omitted (add 1 state when C=0 if you '
|
|
'want the size of the complete automaton).')
|
|
row3 = [MultiColumn(14)]
|
|
row4 = ['', '', '', '', 'DRA',
|
|
MultiColumn(4, align='|c', data='DTGBA'),
|
|
MultiColumn(3, align='|c', data='DBA'),
|
|
MultiColumn(2, align='|c',
|
|
data=ne('DBA\\footnotesize minimizer'))]
|
|
row5 = ['formula', 'm', 'type', 'C.', 'st.', 'st.', 'tr.',
|
|
'acc.', 'time', 'st.', 'tr.', 'time', 'st.', 'time']
|
|
|
|
# Datas that depends on the configuration file
|
|
len_l = len(config.l)
|
|
for i in range(0, len_l):
|
|
row3.append(MultiColumn(7, align='|c', data=config.l[i].name))
|
|
row4.append(MultiColumn(3, align='|c', data='minDBA'))
|
|
row4.append(MultiColumn(4, align='|c', data='minDTGBA'))
|
|
row5.extend(['st.', 'tr.', 'time', 'st.', 'tr.', 'acc.', 'time'])
|
|
|
|
# Add the first 5 lines of the document.
|
|
n = 14 + len_l * 7
|
|
table.add_row((MultiColumn(n, align='c', data=data_row1),))
|
|
table.add_row((MultiColumn(n, align='c', data=data_row2),))
|
|
table.add_row((MultiColumn(n, align='l', data=''),)) # add empty line
|
|
table.add_row(tuple(row3))
|
|
table.add_row(tuple(row4))
|
|
table.add_row(tuple(row5))
|
|
table.add_hline()
|
|
|
|
|
|
def write_results(table, config):
|
|
"""
|
|
Function that writes all the bench's result.
|
|
"""
|
|
# Write header (first 5 lines)
|
|
write_header(table, config)
|
|
|
|
# Write all results
|
|
lines, best_dba_l, best_dtgba_l = get_lines(config)
|
|
for line in lines:
|
|
table.add_row(tuple(line))
|
|
# --------------------------------------------------------------RESULTS
|
|
|
|
|
|
def add_fmt(nfields, doc):
|
|
"""
|
|
Function used to define the table's format depending on config.bench
|
|
file.
|
|
"""
|
|
if doc:
|
|
tmp = '|lrcr|r|rrrr|rrr|rr|'
|
|
for i in range(0, nfields):
|
|
tmp += 'rrr|rrrr|'
|
|
return tmp
|
|
else:
|
|
tmp = '|c|c|'
|
|
for i in range(0, nfields):
|
|
tmp += 'c|'
|
|
return tmp
|
|
|
|
|
|
def generate_docs(config):
|
|
"""
|
|
Function used to generate two pdf:
|
|
|
|
-results.pdf: which shows all statistics about each formula with each
|
|
benchmarked method.
|
|
|
|
-summary.pdf: which count the number of times that each method is
|
|
better than another.
|
|
"""
|
|
# Let's create the documents (result & summary)
|
|
doc = Document(documentclass='standalone')
|
|
doc.packages.append(Package('amsmath'))
|
|
doc.packages.append(Package('color'))
|
|
doc.packages.append(Package('colortbl'))
|
|
doc2 = Document(documentclass='standalone')
|
|
|
|
# Declare colors in result document
|
|
doc.append(DefineColor(
|
|
arguments=Arguments('Gray', 'rgb', '0.7, 0.7, 0.7')))
|
|
doc.append(DefineColor(arguments=Arguments('Green', 'rgb', '0.4, 1, 0.4')))
|
|
doc.append(DefineColor(arguments=Arguments('Red', 'rgb', '0.8, 0, 0')))
|
|
doc.append(DefineColor(arguments=Arguments('Yelw', 'rgb', '1, 0.98, 0.4')))
|
|
doc.append(DefineColor(arguments=Arguments('Purpl', 'rgb', '1, 0.6, 1')))
|
|
|
|
# Create Table with format : True is result format, False is summary format
|
|
table = Tabular(add_fmt(len(config.l), True))
|
|
table2 = Tabular(add_fmt(len(config.l), False))
|
|
|
|
# Write everything
|
|
write_results(table, config)
|
|
write_summary(table2, config)
|
|
|
|
# Output PDF
|
|
doc.append(table)
|
|
doc2.append(table2)
|
|
doc.generate_pdf('results')
|
|
doc2.generate_pdf('summary')
|
|
|
|
|
|
def generate_bench(config, args):
|
|
"""
|
|
A function used to generate a complete benchmark. It outputs a shell
|
|
script.
|
|
"""
|
|
echo = ""
|
|
with open('stat-gen.sh', 'w') as script:
|
|
# Header.
|
|
script.write('''#!/bin/sh
|
|
|
|
ltlfilt=../../bin/ltlfilt
|
|
ltl2tgba=../../bin/ltl2tgba
|
|
dstar2tgba=../../bin/dstar2tgba
|
|
timeout='timeout -sKILL {}'
|
|
stats=--stats=\"%s, %e, %t, %a, %c, %d, %p, %r, %R\"
|
|
empty='-, -, -, -, -, -, -, -, -'
|
|
tomany='!, !, !, !, !, !, !, !, !'
|
|
dbamin=${}
|
|
|
|
'''.format(str(args.timeout) + args.unit, '{DBA_MINIMIZER}'))
|
|
|
|
script.write('''get_stats()
|
|
{
|
|
type=$1
|
|
shift
|
|
SPOT_SATLOG=$n.$type.satlog $timeout \"$@\" \"$stats\"> stdin.$$ 2>stderr.$$
|
|
if grep -q 'INT_MAX' stderr.$$; then
|
|
# Too many SAT-clause?
|
|
echo \"tomany\"
|
|
else
|
|
tmp=`cat stdin.$$`
|
|
echo ${tmp:-$empty}
|
|
fi
|
|
rm -f stdin.$$ stderr.$$
|
|
}
|
|
|
|
get_dbamin_stats()
|
|
{
|
|
tmp=`./rundbamin.pl $timeout $dbamin \"$@\"`
|
|
mye='-, -'
|
|
echo ${tmp:-$mye}
|
|
}
|
|
|
|
n=$1
|
|
f=$2
|
|
type=$3
|
|
accmax=$4
|
|
|
|
case $type in
|
|
*WDBA*)
|
|
exit 0
|
|
;;
|
|
*TCONG*|*trad*) # Not in WDBA
|
|
echo \"$f, $accmax, $type...\" 1>&2
|
|
input=`get_stats TBA $ltl2tgba \"$f\" -D -x '!wdba-minimize,tba-det'`
|
|
echo \"$f, $accmax, $type, $input, DBA, ...\" 1>&2\n
|
|
dba=`get_stats BA $ltl2tgba \"$f\" -BD -x '!wdba-minimize,tba-det'`
|
|
|
|
''')
|
|
|
|
# Body.
|
|
echo = "$f, $accmax, $type, $input, DBA, $dba"
|
|
for i in range(0, len(config.l)):
|
|
script.write(" # " + config.l[i].name + "\n")
|
|
if config.sh[i]:
|
|
script.write(" " + config.sh[i] + "\n")
|
|
script.write(" echo \"" + echo + ", minDBA." + config.l[i].code
|
|
+ "...\" 1>&2\n")
|
|
script.write(" mindba_" + config.l[i].code + "=`get_stats DBA."
|
|
+ config.l[i].code + " $ltl2tgba \"$f\" -BD -x"
|
|
" '!wdba-minimize," + config.l[i].xoptions + "'`\n")
|
|
echo += ", minDBA." + config.l[i].code + ", $mindba_" \
|
|
+ config.l[i].code
|
|
script.write(" echo \"" + echo + ", minDTGBA." + config.l[i].code
|
|
+ "...\" 1>&2\n")
|
|
script.write(" mindtgba_" + config.l[i].code +
|
|
"=`get_stats DTGBA." + config.l[i].code +
|
|
" $ltl2tgba \"$f\" -D -x '!wdba-minimize," +
|
|
config.l[i].xoptions + "'`\n\n")
|
|
echo += ", minDTGBA." + config.l[i].code + ", $mindtgba_" \
|
|
+ config.l[i].code
|
|
script.write(''' # Dbaminimizer
|
|
echo \"{}, dbaminimizer...\" 1>&2
|
|
case $type in
|
|
*TCONG*) dbamin=\"n/a, n/a\" dra=\"n/a\";;
|
|
*trad*)
|
|
$ltlfilt --remove-wm -f \"$f\" -l |
|
|
ltl2dstar --ltl2nba=spin:$ltl2tgba@-Ds - dra.$$
|
|
dbamin=`get_dbamin_stats dra.$$`
|
|
dra=`sed -n 's/States: \\(.*\\)/\\1/p' dra.$$`
|
|
rm dra.$$
|
|
;;
|
|
esac
|
|
;;
|
|
*DRA*)
|
|
echo \"$f, $accmax, $type...\" 1>&2
|
|
$ltlfilt --remove-wm -f \"$f\" -l |
|
|
ltl2dstar --ltl2nba=spin:$ltl2tgba@-Ds - dra.$$
|
|
input=`get_stats TBA $dstar2tgba dra.$$ -D -x '!wdba-minimize'`
|
|
echo \"$f, $accmax, $type, $input, DBA, ...\" 1>&2
|
|
dba=`get_stats BA $dstar2tgba dra.$$ -BD -x '!wdba-minimize'`
|
|
|
|
'''.format(echo))
|
|
|
|
echo = "$f, $accmax, $type, $input, DBA, $dba"
|
|
for i in range(0, len(config.l)):
|
|
script.write(" # " + config.l[i].name + "\n")
|
|
if config.sh[i]:
|
|
script.write(" " + config.sh[i] + "\n")
|
|
script.write(" echo \"" + echo + ", minDBA." + config.l[i].code
|
|
+ "...\" 1>&2\n")
|
|
script.write(" mindba_" + config.l[i].code + "=`get_stats DBA."
|
|
+ config.l[i].code + " $dstar2tgba dra.$$ -BD -x"
|
|
" '!wdba-minimize," + config.l[i].xoptions + "'`\n")
|
|
echo += ", minDBA." + config.l[i].code + ", $mindba_" \
|
|
+ config.l[i].code
|
|
script.write(" echo \"" + echo + ", minDTGBA." + config.l[i].code
|
|
+ "...\" 1>&2\n")
|
|
script.write(" mindtgba_" + config.l[i].code +
|
|
"=`get_stats DTGBA." + config.l[i].code +
|
|
" $dstar2tgba dra.$$ -D -x '!wdba-minimize," +
|
|
config.l[i].xoptions + "'`\n\n")
|
|
echo += ", minDTGBA." + config.l[i].code + ", $mindtgba_" \
|
|
+ config.l[i].code
|
|
|
|
script.write(''' # Dbaminimizer
|
|
echo \"{}, dbaminimizer...\" 1>&2
|
|
dbamin=`get_dbamin_stats dra.$$`
|
|
dra=`sed -n 's/States: \\(.*\\)/\\1/p' dra.$$`
|
|
rm -f dra.$$
|
|
;;
|
|
*not*)
|
|
exit 0
|
|
;;
|
|
*)
|
|
echo \"SHOULD NOT HAPPEND\"
|
|
exit 2
|
|
;;
|
|
esac
|
|
|
|
'''.format(echo))
|
|
echo += ", dbaminimizer, $dbamin, DRA, $dra, $n"
|
|
script.write("echo \"{}\" 1>&2\n".format(echo))
|
|
script.write("echo \"{}\"\n".format(echo))
|
|
print("Now run chmod +x stat-gen.sh")
|
|
|
|
|
|
def parse_args():
|
|
"""
|
|
Function that parse the command-line arguments and options.
|
|
"""
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument('action', choices=['script', 'results'])
|
|
parser.add_argument('--timeout', type=int, help="Timeout (0-9)+")
|
|
parser.add_argument('--unit', type=str, help="Time unit (h|m|s)",
|
|
choices=['h', 'm', 's'])
|
|
args = parser.parse_args()
|
|
|
|
config = BenchConfig('config.bench')
|
|
if args.action == 'script':
|
|
if not args.timeout:
|
|
parser.error('bench requires --timeout')
|
|
if not args.unit:
|
|
parser.error('bench requires --unit')
|
|
generate_bench(config, args)
|
|
elif args.action == 'results':
|
|
generate_docs(config)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
parse_args()
|