stats: rename structures and attribute for concistency

* src/taalgos/stats.cc, src/taalgos/stats.hh
(tgba_statistics::transitions, tgba_sub_statistics::sub_transitions):
Rename ...
(twa_statistics::edges, twa_sub_statistics::transitions): ... to
these.
* NEWS: Mention it.
* src/bin/common_aoutput.hh, src/bin/ltlcross.cc,
src/tests/checkta.cc, src/tests/complementation.cc,
src/tests/ikwiad.cc, src/tests/ltl2tgba.test,
src/tests/neverclaimread.test, src/tests/randtgba.cc,
src/tests/renault.test, src/tests/wdba2.test, src/twaalgos/dtbasat.cc,
src/twaalgos/dtgbasat.cc, src/twaalgos/stats.cc,
src/twaalgos/stats.hh, wrap/python/ajax/spotcgi.in: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2015-10-24 17:03:56 +02:00
parent f7c4ca816b
commit 4a91fccc33
18 changed files with 96 additions and 97 deletions

View file

@ -47,7 +47,7 @@ stats(std::string title, const spot::ta_ptr& ta)
std::cout << std::left << std::setw(20) << title << " | "
<< std::right << std::setw(6) << s.states << " | "
<< std::setw(6) << s.transitions << " | "
<< std::setw(6) << s.edges << " | "
<< std::setw(6) << s.acceptance_states << '\n';
}
@ -58,7 +58,7 @@ stats(std::string title, const spot::twa_ptr& tg)
std::cout << std::left << std::setw(20) << title << " | "
<< std::right << std::setw(6) << s.states << " | "
<< std::setw(6) << s.transitions << " | "
<< std::setw(6) << s.edges << " | "
<< std::setw(6) << "XXX" << '\n';
}

View file

@ -186,10 +186,10 @@ int main(int argc, char* argv[])
auto safra_complement = spot::make_safra_complement(a);
spot::tgba_statistics a_size = spot::stats_reachable(a);
spot::twa_statistics a_size = spot::stats_reachable(a);
std::cout << "Original: "
<< a_size.states << ", "
<< a_size.transitions << ", "
<< a_size.edges << ", "
<< a->acc().num_sets()
<< std::endl;
@ -200,20 +200,20 @@ int main(int argc, char* argv[])
<< buchi->acc().num_sets()
<< std::endl;
spot::tgba_statistics b_size = spot::stats_reachable(safra_complement);
spot::twa_statistics b_size = spot::stats_reachable(safra_complement);
std::cout << "Safra Complement: "
<< b_size.states << ", "
<< b_size.transitions << ", "
<< b_size.edges << ", "
<< safra_complement->acc().num_sets()
<< std::endl;
if (formula)
{
auto a2 = spot::ltl_to_tgba_fm(spot::formula::Not(f1), dict);
spot::tgba_statistics a_size = spot::stats_reachable(a2);
spot::twa_statistics a_size = spot::stats_reachable(a2);
std::cout << "Not Formula: "
<< a_size.states << ", "
<< a_size.transitions << ", "
<< a_size.edges << ", "
<< a2->acc().num_sets()
<< std::endl;
}
@ -233,11 +233,11 @@ int main(int argc, char* argv[])
auto nAnf = spot::make_safra_complement(Anf);
auto ec = spot::couvreur99(spot::otf_product(nAf, nAnf));
auto res = ec->check();
spot::tgba_statistics a_size = spot::stats_reachable(ec->automaton());
spot::twa_statistics a_size = spot::stats_reachable(ec->automaton());
std::cout << "States: "
<< a_size.states << std::endl
<< "Transitions: "
<< a_size.transitions << std::endl
<< a_size.edges << std::endl
<< "Acc Cond: "
<< ec->automaton()->acc().num_sets()
<< std::endl;

View file

@ -1516,12 +1516,12 @@ checked_main(int argc, char** argv)
std::ios::fmtflags old = std::cout.flags();
std::cout << std::left << std::setw(25)
<< echeck_algo << ", ";
spot::tgba_statistics a_size =
spot::twa_statistics a_size =
spot::stats_reachable(ec->automaton());
std::cout << std::right << std::setw(10)
<< a_size.states << ", "
<< std::right << std::setw(10)
<< a_size.transitions << ", ";
<< a_size.edges << ", ";
std::cout << ec->automaton()->acc().num_sets()
<< ", ";
auto ecs = ec->emptiness_check_statistics();

View file

@ -109,7 +109,7 @@ run 0 ../ikwiad -e -R3 '(G!{(b;1)*;a} && ({1;1[*3]*}[]->{(b&!a)[*2];!b&!a}))'
# before and after degeneralization.
for opt in '' -DT -DS; do
../ikwiad -ks -f -R3 $opt 'a U (b U c)' > stdout
grep 'transitions: 6$' stdout
grep 'edges: 6$' stdout
grep 'states: 3$' stdout
done
@ -117,8 +117,8 @@ done
# before and after degeneralization.
for opt in '' -DT -DS; do
../ikwiad -kt -f -R3 $opt '!(Ga U b)' > stdout
grep 'sub trans.: 11$' stdout
grep 'transitions: 6$' stdout
grep 'transitions: 11$' stdout
grep 'edges: 6$' stdout
grep 'states: 3$' stdout
done
@ -126,8 +126,8 @@ done
# before and after degeneralization.
for opt in '' -DT -DS; do
../ikwiad -kt -f -R3 $opt 'Ga U b' > stdout
grep 'sub trans.: 12$' stdout
grep 'transitions: 6$' stdout
grep 'transitions: 12$' stdout
grep 'edges: 6$' stdout
grep 'states: 4$' stdout
done
@ -136,10 +136,10 @@ done
f='(G (p -> F q)) && ((X (p) U q) || ! X (p U (p && q)))'
for opt in '' -DT -DS; do
../ikwiad -ks -f -R3 $opt "$f" > stdout
grep 'transitions: 15$' stdout
grep 'edges: 15$' stdout
grep 'states: 6$' stdout
../ikwiad -ks -f -R3f $opt "$f" > stdout
grep 'transitions: 15$' stdout
grep 'edges: 15$' stdout
grep 'states: 6$' stdout
done
@ -147,16 +147,16 @@ done
# has 7 states and 34 transitions after degeneralization.
f='GFa & GFb & GFc & GFd & GFe & GFg'
../ikwiad -ks -DS -x -f "$f" > stdout
grep 'transitions: 34$' stdout
grep 'edges: 34$' stdout
grep 'states: 7$' stdout
# Make sure 'Ga & XXXX!a' is minimized to one state.
f='Ga & XXXX!a'
../ikwiad -ks -f "$f" > stdout
grep 'transitions: 4$' stdout
grep 'edges: 4$' stdout
grep 'states: 5$' stdout
../ikwiad -ks -Rm -f "$f" > stdout
grep 'transitions: 0$' stdout
grep 'edges: 0$' stdout
grep 'states: 1$' stdout
# Make sure a monitor for F(a & F(b)) accepts everything.
@ -169,12 +169,12 @@ cmp stdout expected
# This formula caused a segfault with Spot 0.7.
run 0 ../ikwiad -Rm -ks -f "Gq|Gr|(G(q|FGp)&G(r|FG!p))" >stdout
grep 'transitions: 5$' stdout
grep 'edges: 5$' stdout
grep 'states: 3$' stdout
# Adding -R3 used to make it work...
run 0 ../ikwiad -R3 -Rm -ks -f "Gq|Gr|(G(q|FGp)&G(r|FG!p))" >stdout
grep 'transitions: 5$' stdout
grep 'edges: 5$' stdout
grep 'states: 3$' stdout
# Make sure FGa|GFb has the same number of states/transitions when
@ -189,7 +189,7 @@ cmp count.never count.hoa
# The following automaton should have only 4 states.
run 0 ../ikwiad -R3 -ks -f '(p&XF!p)|(!p&XFp)|X(Fp&F!p)' >stdout
grep 'transitions: 7$' stdout
grep 'edges: 7$' stdout
grep 'states: 4$' stdout
# A bug in the translation of !{xxx} when xxx reduces to false caused

View file

@ -205,7 +205,7 @@ accept_T3:
}
EOF
cat >expected<<EOF
transitions: 6
edges: 6
states: 4
EOF

View file

@ -248,14 +248,14 @@ id(const char*, unsigned x)
return static_cast<T>(x);
}
spot::tgba_statistics prod_stats;
spot::twa_statistics prod_stats;
static float
prod_conv(const char* name, unsigned x)
{
float y = static_cast<float>(x);
if (!strcmp(name, "transitions"))
return y / prod_stats.transitions * 100.0;
return y / prod_stats.edges * 100.0;
return y / prod_stats.states * 100.0;
}
@ -958,7 +958,7 @@ main(int argc, char** argv)
{
// To trigger a division by 0 if used erroneously.
prod_stats.states = 0;
prod_stats.transitions = 0;
prod_stats.edges = 0;
}
if (opt_z && ecs)

View file

@ -65,7 +65,7 @@ State: 9
EOF
cat >outexp <<EOF
transitions: 12
edges: 12
states: 6
EOF

View file

@ -23,8 +23,8 @@
set -e
cat >expected <<EOF
sub trans.: 16
transitions: 8
transitions: 16
edges: 8
states: 4
nondeterministic states: 0
EOF