Stable version of TGTA approach implementation (automaton + product)
* src/ta/tgta.hh, src/ta/tgta.cc, src/ta/tgtaexplicit.hh, src/ta/tgtaexplicit.hh, src/ta/tgtaproduct.hh, src/ta/tgtaproduct.cc, src/taalgos/minimize.cc, src/taalgos/minimize.hh, src/taalgos/emptinessta.hh, src/taalgos/emptinessta.hh, src/taalgos/emptinessta.cc, src/taalgos/tgba2ta.hh, src/taalgos/tgba2ta.cc: rename tgbta to tgta in this source files. * src/ta/tgbtaexplicit.hh, src/ta/tgbtaproduct.hh, src/ta/tgbta.cc, src/ta/tgbtaproduct.cc, src/ta/tgbta.hh, src/ta/tgbtaexplicit.cc: Rename as... * src/ta/taexplicit.cc, src/ta/taexplicit.hh, src/ta/taproduct.cc, src/ta/taproduct.hh, src/ta/tgtaexplicit.cc: ... these. * src/taalgos/sba2ta.hh, src/taalgos/sba2ta.cc: deleted because the implementation of all the transformations beteween TGBA and the different forms of TA are new implemented in src/taalgos/tgba2ta.hh and src/taalgos/tgba2ta.cc. * src/tgbatest/ltl2tgba.cc: rename the options of commands that build the different forms of TA. * src/ta/ta.hh: BUG Fix * src/ta/Makefile.am, src/tgbatest/ltl2ta.test: impacts of this renaming
This commit is contained in:
parent
c76e651bad
commit
5a706300b0
24 changed files with 1308 additions and 1580 deletions
|
|
@ -1,9 +1,6 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) 2009, 2010, 2011 Laboratoire de Recherche et Développement
|
||||
# Copyright (C) 2010, 2011 Laboratoire de Recherche et Développement
|
||||
# de l'Epita (LRDE).
|
||||
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
# et Marie Curie.
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
#
|
||||
|
|
@ -29,8 +26,22 @@ set -e
|
|||
|
||||
check ()
|
||||
{
|
||||
run 0 ../ltl2tgba -TA "$1"
|
||||
run 0 ../ltl2tgba -TM "$1"
|
||||
run 0 ../ltl2tgba -TA -ks "$1"
|
||||
run 0 ../ltl2tgba -TA -Rm -ks "$1"
|
||||
run 0 ../ltl2tgba -TA -lv -ks "$1"
|
||||
run 0 ../ltl2tgba -TA -sp -ks "$1"
|
||||
run 0 ../ltl2tgba -TA -Rm -lv "$1"
|
||||
run 0 ../ltl2tgba -TA -Rm -sp -ks "$1"
|
||||
run 0 ../ltl2tgba -TA -lv -sp -ks "$1"
|
||||
run 0 ../ltl2tgba -TA -DS -ks "$1"
|
||||
run 0 ../ltl2tgba -TA -Rm -DS -ks "$1"
|
||||
run 0 ../ltl2tgba -TA -lv -DS -ks "$1"
|
||||
run 0 ../ltl2tgba -TA -sp -DS -ks "$1"
|
||||
run 0 ../ltl2tgba -TA -Rm -sp -DS -ks "$1"
|
||||
run 0 ../ltl2tgba -TA -Rm -lv -DS -ks "$1"
|
||||
run 0 ../ltl2tgba -TA -Rm -sp -lv -DS -ks "$1"
|
||||
run 0 ../ltl2tgba -TGTA -ks "$1"
|
||||
run 0 ../ltl2tgba -TGTA -Rm -ks "$1"
|
||||
}
|
||||
|
||||
# We don't check the output, but just running these might be enough to
|
||||
|
|
@ -52,8 +63,6 @@ check '((Gp2)U(F(1)))&(p1 R(p2 R p0))'
|
|||
|
||||
|
||||
|
||||
# Make sure 'a U (b U c)' has 21 states and 144 transitions,
|
||||
# before and after degeneralization.
|
||||
for opt in -TA; do
|
||||
../ltl2tgba -ks $opt -in 'a U (b U c)' > stdout
|
||||
grep 'transitions: 144$' stdout
|
||||
|
|
@ -61,24 +70,23 @@ for opt in -TA; do
|
|||
done
|
||||
|
||||
|
||||
for opt in -TM; do
|
||||
../ltl2tgba -ks $opt -in -DS 'a U (b U c)' > stdout
|
||||
for opt in -TA; do
|
||||
../ltl2tgba -ks $opt -Rm -in -DS 'a U (b U c)' > stdout
|
||||
grep 'transitions: 69$' stdout
|
||||
grep 'states: 10$' stdout
|
||||
done
|
||||
|
||||
|
||||
|
||||
for opt in -TM; do
|
||||
../ltl2tgba -ks $opt -DS '!(Ga U b)' > stdout
|
||||
for opt in -TA; do
|
||||
../ltl2tgba -ks $opt -Rm -DS '!(Ga U b)' > stdout
|
||||
grep 'transitions: 15$' stdout
|
||||
grep 'states: 5$' stdout
|
||||
done
|
||||
|
||||
# Make sure 'Ga U b' has 6 states and 12 transitions,
|
||||
# before and after degeneralization.
|
||||
for opt in -TM; do
|
||||
../ltl2tgba -ks $opt -DS 'Ga U b' > stdout
|
||||
|
||||
for opt in -TA; do
|
||||
../ltl2tgba -ks $opt -Rm -DS 'Ga U b' > stdout
|
||||
grep 'transitions: 13$' stdout
|
||||
grep 'states: 6$' stdout
|
||||
done
|
||||
|
|
@ -92,26 +100,21 @@ f='(G (p -> F q)) && ((X (p) U q) || ! X (p U (p && q)))'
|
|||
grep 'transitions: 96$' stdout
|
||||
grep 'states: 21$' stdout
|
||||
|
||||
# Note: after minimization with -TM.
|
||||
# Note: after minimization with -TA -Rm.
|
||||
# has 20 states and 89 transitions, after minimization.
|
||||
../ltl2tgba -ks -TM -DS "$f" > stdout
|
||||
../ltl2tgba -ks -TA -Rm -DS "$f" > stdout
|
||||
grep 'transitions: 89$' stdout
|
||||
grep 'states: 20$' stdout
|
||||
|
||||
|
||||
# Make sure 'GFa & GFb & GFc & GFd & GFe & GFf'
|
||||
# has 448 states and 28224 transitions.
|
||||
f='GFa & GFb & GFc & GFd & GFe & GFg'
|
||||
../ltl2tgba -ks -TA -DS -x "$f" > stdout
|
||||
grep 'transitions: 28351$' stdout
|
||||
grep 'states: 449$' stdout
|
||||
|
||||
|
||||
# Make sure 'GFa & GFb & GFc & GFd & GFe & GFf'
|
||||
# has 290 states and 18527 transitions with artificial livelock state.
|
||||
|
||||
f='GFa & GFb & GFc & GFd & GFe & GFg'
|
||||
../ltl2tgba -ks -TM -x -lv -DS "$f" > stdout
|
||||
../ltl2tgba -ks -TA -Rm -x -lv -DS "$f" > stdout
|
||||
grep 'transitions: 18496$' stdout
|
||||
grep 'states: 290$' stdout
|
||||
|
||||
|
|
@ -121,61 +124,71 @@ run 0 ../ltl2tgba -ks -TA -lv -DS "Gq|Gr|(G(q|FGp)&G(r|FG!p))" >stdout
|
|||
grep 'transitions: 882$' stdout
|
||||
grep 'states: 78$' stdout
|
||||
|
||||
run 0 ../ltl2tgba -TM -ks -lv -DS "Gq|Gr|(G(q|FGp)&G(r|FG!p))" >stdout
|
||||
run 0 ../ltl2tgba -TA -Rm -ks -lv -DS "Gq|Gr|(G(q|FGp)&G(r|FG!p))" >stdout
|
||||
grep 'transitions: 440$' stdout
|
||||
grep 'states: 28$' stdout
|
||||
|
||||
run 0 ../ltl2tgba -TGTA -Rm -ks 'Gq|Gr|(G(q|FGp)&G(r|FG!p))' >stdout
|
||||
grep 'transitions: 294$' stdout
|
||||
grep 'states: 21$' stdout
|
||||
|
||||
|
||||
run 0 ../ltl2tgba -TM -ks -in -R3f -x -DS "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
run 0 ../ltl2tgba -TA -Rm -ks -in -R3f -x -DS "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
grep 'transitions: 521$' stdout
|
||||
grep 'states: 43$' stdout
|
||||
|
||||
|
||||
run 0 ../ltl2tgba -TM -ks -lv -R3f -x -DS "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
run 0 ../ltl2tgba -TA -Rm -ks -lv -R3f -x -DS "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
grep 'transitions: 636$' stdout
|
||||
grep 'states: 45$' stdout
|
||||
|
||||
|
||||
run 0 ../ltl2tgba -TM -ks -DS "G(F(GWaitLeft7 U Idle4) U (WaitLeft2 M IsEating2))" >stdout
|
||||
grep 'transitions: 2779$' stdout
|
||||
grep 'states: 127$' stdout
|
||||
|
||||
|
||||
run 0 ../ltl2tgba -TM -ks -lv -DS "G(F(GWaitLeft7 U Idle4) U (WaitLeft2 M IsEating2))" >stdout
|
||||
grep 'transitions: 2831$' stdout
|
||||
grep 'states: 128$' stdout
|
||||
|
||||
|
||||
|
||||
run 0 ../ltl2tgba -TM -ks "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
run 0 ../ltl2tgba -TA -Rm -ks "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
grep 'transitions: 498$' stdout
|
||||
grep 'states: 34$' stdout
|
||||
|
||||
|
||||
run 0 ../ltl2tgba -TM -ks -lv -in "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
run 0 ../ltl2tgba -TA -Rm -ks -sp -lv -in "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
grep 'transitions: 566$' stdout
|
||||
grep 'states: 35$' stdout
|
||||
|
||||
|
||||
run 0 ../ltl2tgba -TM -ks -in -R3 -x -DS "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
run 0 ../ltl2tgba -TA -Rm -ks -in -R3 -x -DS "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
grep 'transitions: 464$' stdout
|
||||
grep 'states: 36$' stdout
|
||||
|
||||
run 0 ../ltl2tgba -TM -ks -lv -R3 -x -DS "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
run 0 ../ltl2tgba -TA -Rm -ks -sp -lv -R3 -x -DS "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
grep 'transitions: 565$' stdout
|
||||
grep 'states: 38$' stdout
|
||||
|
||||
|
||||
run 0 ../ltl2tgba -TA -ks -lv -DS "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
run 0 ../ltl2tgba -TA -ks -sp -lv -DS "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
grep 'transitions: 831$' stdout
|
||||
grep 'states: 56$' stdout
|
||||
|
||||
|
||||
run 0 ../ltl2tgba -TM -ks -lv "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
run 0 ../ltl2tgba -TA -Rm -ks -sp -lv "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
grep 'transitions: 585$' stdout
|
||||
grep 'states: 36$' stdout
|
||||
|
||||
run 0 ../ltl2tgba -TGTA -Rm -ks "FG((WaitRight4 M (HasRight1 W GWaitLeft0)) M HasLeft4)" >stdout
|
||||
grep 'transitions: 598$' stdout
|
||||
grep 'states: 35$' stdout
|
||||
|
||||
|
||||
run 0 ../ltl2tgba -TA -Rm -ks -DS "G(F(GWaitLeft7 U Idle4) U (WaitLeft2 M IsEating2))" >stdout
|
||||
grep 'transitions: 2779$' stdout
|
||||
grep 'states: 127$' stdout
|
||||
|
||||
|
||||
run 0 ../ltl2tgba -TA -Rm -ks -sp "G(F(GWaitLeft7 U Idle4) U (WaitLeft2 M IsEating2))" >stdout
|
||||
grep 'transitions: 1219$' stdout
|
||||
grep 'states: 65$' stdout
|
||||
|
||||
run 0 ../ltl2tgba -TGTA -Rm -ks "G(F(GWaitLeft7 U Idle4) U (WaitLeft2 M IsEating2))" >stdout
|
||||
grep 'transitions: 1283$' stdout
|
||||
grep 'states: 65$' stdout
|
||||
|
||||
|
||||
|
||||
echo '.................. TESTs: OK'
|
||||
|
|
|
|||
|
|
@ -282,19 +282,20 @@ syntax(char* prog)
|
|||
|
||||
<< "Options for Testing Automata:"
|
||||
<< std::endl
|
||||
<< " -TA Translate an LTL formula into a Testing automata"
|
||||
<< " -TA Translate an LTL formula into a TA (Testing automata)"
|
||||
<< std::endl
|
||||
<< std::endl
|
||||
<< " -TM Translate an LTL formula into a minimal Testing automata"
|
||||
<< " -sp convert into a TA involving a single-pass emptiness check"
|
||||
<< std::endl << std::endl
|
||||
<< " -lv convert into a TA with an artificial livelock accepting"
|
||||
<< "state (single-pass emptiness check)"
|
||||
<< std::endl
|
||||
<< std::endl
|
||||
<< " -lv Translate an LTL formula into a Testing automata with an artificial livelock accepting state (Single-pass Testing Automata)"
|
||||
<< " -in convert into a TA without an artificial initial state"
|
||||
<< std::endl
|
||||
<< std::endl
|
||||
<< " -in Translate an LTL formula into a Testing automata without artificial initial state"
|
||||
<< std::endl
|
||||
<< std::endl
|
||||
<< " -STGTA Translate an LTL formula into a STGTA (Single-pass Transition-based Generalised Testing Automata)"
|
||||
<< " -TGTA Translate an LTL formula into a TGTA"
|
||||
<< "(Transition-based Generalised Testing Automata)"
|
||||
<< std::endl;
|
||||
|
||||
|
||||
|
|
@ -357,9 +358,10 @@ main(int argc, char** argv)
|
|||
bool reduction_dir_sim = false;
|
||||
spot::tgba* temp_dir_sim = 0;
|
||||
bool ta_opt = false;
|
||||
bool tgbta_opt = false;
|
||||
bool opt_with_artificial_livelock = false;
|
||||
bool tgta_opt = false;
|
||||
bool opt_with_artificial_initial_state = true;
|
||||
bool opt_single_pass_emptiness_check = false;
|
||||
bool opt_with_artificial_livelock = false;
|
||||
|
||||
|
||||
for (;;)
|
||||
|
|
@ -692,19 +694,18 @@ main(int argc, char** argv)
|
|||
{
|
||||
ta_opt = true;
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-TM"))
|
||||
else if (!strcmp(argv[formula_index], "-TGTA"))
|
||||
{
|
||||
ta_opt = true;
|
||||
opt_minimize = true;
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-STGTA"))
|
||||
{
|
||||
tgbta_opt = true;
|
||||
tgta_opt = true;
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-lv"))
|
||||
{
|
||||
opt_with_artificial_livelock = true;
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-sp"))
|
||||
{
|
||||
opt_single_pass_emptiness_check = true;
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-in"))
|
||||
{
|
||||
opt_with_artificial_initial_state = false;
|
||||
|
|
@ -1004,7 +1005,7 @@ main(int argc, char** argv)
|
|||
const spot::tgba* degeneralized = 0;
|
||||
|
||||
spot::tgba* minimized = 0;
|
||||
if (opt_minimize && !ta_opt)
|
||||
if (opt_minimize && !ta_opt && !tgta_opt)
|
||||
{
|
||||
tm.start("obligation minimization");
|
||||
minimized = minimize_obligation(a, f);
|
||||
|
|
@ -1113,24 +1114,14 @@ main(int argc, char** argv)
|
|||
|
||||
if (ta_opt)
|
||||
{
|
||||
// const spot::tgba_sba_proxy* degeneralized_new = 0;
|
||||
// const spot::tgba_sba_proxy* degeneralized =
|
||||
// dynamic_cast<const spot::tgba_sba_proxy*> (a);
|
||||
// if (degeneralized == 0)
|
||||
// degeneralized_new = degeneralized = new spot::tgba_sba_proxy(a);
|
||||
|
||||
|
||||
|
||||
spot::ta* testing_automata = 0;
|
||||
if (tgbta_opt)
|
||||
{
|
||||
testing_automata = (spot::ta_explicit *) tgba_to_tgbta(a, atomic_props_set_bdd);
|
||||
|
||||
}
|
||||
else {
|
||||
testing_automata = tgba_to_ta(a, atomic_props_set_bdd, opt_with_artificial_initial_state, opt_with_artificial_livelock, degeneralize_opt == DegenSBA);
|
||||
testing_automata
|
||||
= tgba_to_ta(a, atomic_props_set_bdd, degeneralize_opt
|
||||
== DegenSBA, opt_with_artificial_initial_state,
|
||||
opt_single_pass_emptiness_check,
|
||||
opt_with_artificial_livelock);
|
||||
|
||||
}
|
||||
spot::ta* testing_automata_nm = 0;
|
||||
if (opt_minimize) {
|
||||
testing_automata_nm = testing_automata;
|
||||
|
|
@ -1163,11 +1154,20 @@ main(int argc, char** argv)
|
|||
|
||||
aut_red = 0;
|
||||
output = -1;
|
||||
} else if (tgbta_opt)
|
||||
} else if (tgta_opt)
|
||||
{
|
||||
a = tgba_to_tgbta(a, atomic_props_set_bdd);
|
||||
to_free = a;
|
||||
spot::tgta* tgta = tgba_to_tgta(a, atomic_props_set_bdd);
|
||||
if (opt_minimize)
|
||||
{
|
||||
a = minimize_tgta(tgta);
|
||||
minimized = a;
|
||||
}
|
||||
else
|
||||
{
|
||||
a = tgta;
|
||||
}
|
||||
|
||||
to_free = tgta;
|
||||
}
|
||||
|
||||
spot::tgba* product_degeneralized = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue