Commit 4a91fccc authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

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.
parent f7c4ca81
...@@ -48,7 +48,10 @@ New in spot 1.99.4a (not yet released) ...@@ -48,7 +48,10 @@ New in spot 1.99.4a (not yet released)
"trust_hoa": when true (the default) supported properties declared "trust_hoa": when true (the default) supported properties declared
in HOA files are trusted even if they cannot be easily be verified. in HOA files are trusted even if they cannot be easily be verified.
* ltl_simplifier renamed to tl_simplifier. * renamings:
ltl_simplifier -> tl_simplifier
tgba_statistics::transitions -> twa_statistics::edges
tgba_sub_statistics::sub_transitions -> twa_sub_statistics::transitions
Python: Python:
......
...@@ -128,16 +128,16 @@ public: ...@@ -128,16 +128,16 @@ public:
if (has('T')) if (has('T'))
{ {
spot::tgba_sub_statistics s = sub_stats_reachable(haut->aut); spot::twa_sub_statistics s = sub_stats_reachable(haut->aut);
haut_states_ = s.states; haut_states_ = s.states;
haut_edges_ = s.transitions; haut_edges_ = s.edges;
haut_trans_ = s.sub_transitions; haut_trans_ = s.transitions;
} }
else if (has('E')) else if (has('E'))
{ {
spot::tgba_sub_statistics s = sub_stats_reachable(haut->aut); spot::twa_sub_statistics s = sub_stats_reachable(haut->aut);
haut_states_ = s.states; haut_states_ = s.states;
haut_edges_ = s.transitions; haut_edges_ = s.edges;
} }
if (has('M')) if (has('M'))
{ {
......
...@@ -601,10 +601,10 @@ namespace ...@@ -601,10 +601,10 @@ namespace
if (verbose) if (verbose)
std::cerr << "info: getting statistics\n"; std::cerr << "info: getting statistics\n";
st->ok = true; st->ok = true;
spot::tgba_sub_statistics s = sub_stats_reachable(res); spot::twa_sub_statistics s = sub_stats_reachable(res);
st->states = s.states; st->states = s.states;
st->edges = s.transitions; st->edges = s.edges;
st->transitions = s.sub_transitions; st->transitions = s.transitions;
st->acc = res->acc().num_sets(); st->acc = res->acc().num_sets();
spot::scc_info m(res); spot::scc_info m(res);
unsigned c = m.scc_count(); unsigned c = m.scc_count();
...@@ -927,9 +927,9 @@ namespace ...@@ -927,9 +927,9 @@ namespace
if (sm) if (sm)
{ {
(*stats)[i].product_scc.push_back(sm->scc_count()); (*stats)[i].product_scc.push_back(sm->scc_count());
spot::tgba_statistics s = spot::stats_reachable(sm->get_aut()); spot::twa_statistics s = spot::stats_reachable(sm->get_aut());
(*stats)[i].product_states.push_back(s.states); (*stats)[i].product_states.push_back(s.states);
(*stats)[i].product_transitions.push_back(s.transitions); (*stats)[i].product_transitions.push_back(s.edges);
} }
else else
{ {
......
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2008, 2014 Laboratoire de Recherche et Développement // Copyright (C) 2008, 2014, 2015 Laboratoire de Recherche et
// de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
...@@ -49,7 +49,7 @@ namespace spot ...@@ -49,7 +49,7 @@ namespace spot
void void
process_link(int, int, const ta_succ_iterator*) process_link(int, int, const ta_succ_iterator*)
{ {
++s_.transitions; ++s_.edges;
} }
private: private:
...@@ -61,7 +61,7 @@ namespace spot ...@@ -61,7 +61,7 @@ namespace spot
std::ostream& std::ostream&
ta_statistics::dump(std::ostream& out) const ta_statistics::dump(std::ostream& out) const
{ {
out << "transitions: " << transitions << std::endl; out << "edges: " << edges << std::endl;
out << "states: " << states << std::endl; out << "states: " << states << std::endl;
return out; return out;
} }
......
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2013, 2014 Laboratoire de Recherche et Développement // Copyright (C) 2011, 2013, 2014, 2015 Laboratoire de Recherche et
// de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
...@@ -30,7 +30,7 @@ namespace spot ...@@ -30,7 +30,7 @@ namespace spot
struct SPOT_API ta_statistics struct SPOT_API ta_statistics
{ {
unsigned transitions; unsigned edges;
unsigned states; unsigned states;
unsigned acceptance_states; unsigned acceptance_states;
......
...@@ -47,7 +47,7 @@ stats(std::string title, const spot::ta_ptr& ta) ...@@ -47,7 +47,7 @@ stats(std::string title, const spot::ta_ptr& ta)
std::cout << std::left << std::setw(20) << title << " | " std::cout << std::left << std::setw(20) << title << " | "
<< std::right << std::setw(6) << s.states << " | " << std::right << std::setw(6) << s.states << " | "
<< std::setw(6) << s.transitions << " | " << std::setw(6) << s.edges << " | "
<< std::setw(6) << s.acceptance_states << '\n'; << std::setw(6) << s.acceptance_states << '\n';
} }
...@@ -58,7 +58,7 @@ stats(std::string title, const spot::twa_ptr& tg) ...@@ -58,7 +58,7 @@ stats(std::string title, const spot::twa_ptr& tg)
std::cout << std::left << std::setw(20) << title << " | " std::cout << std::left << std::setw(20) << title << " | "
<< std::right << std::setw(6) << s.states << " | " << std::right << std::setw(6) << s.states << " | "
<< std::setw(6) << s.transitions << " | " << std::setw(6) << s.edges << " | "
<< std::setw(6) << "XXX" << '\n'; << std::setw(6) << "XXX" << '\n';
} }
......
...@@ -186,10 +186,10 @@ int main(int argc, char* argv[]) ...@@ -186,10 +186,10 @@ int main(int argc, char* argv[])
auto safra_complement = spot::make_safra_complement(a); 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: " std::cout << "Original: "
<< a_size.states << ", " << a_size.states << ", "
<< a_size.transitions << ", " << a_size.edges << ", "
<< a->acc().num_sets() << a->acc().num_sets()
<< std::endl; << std::endl;
...@@ -200,20 +200,20 @@ int main(int argc, char* argv[]) ...@@ -200,20 +200,20 @@ int main(int argc, char* argv[])
<< buchi->acc().num_sets() << buchi->acc().num_sets()
<< std::endl; << 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: " std::cout << "Safra Complement: "
<< b_size.states << ", " << b_size.states << ", "
<< b_size.transitions << ", " << b_size.edges << ", "
<< safra_complement->acc().num_sets() << safra_complement->acc().num_sets()
<< std::endl; << std::endl;
if (formula) if (formula)
{ {
auto a2 = spot::ltl_to_tgba_fm(spot::formula::Not(f1), dict); 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: " std::cout << "Not Formula: "
<< a_size.states << ", " << a_size.states << ", "
<< a_size.transitions << ", " << a_size.edges << ", "
<< a2->acc().num_sets() << a2->acc().num_sets()
<< std::endl; << std::endl;
} }
...@@ -233,11 +233,11 @@ int main(int argc, char* argv[]) ...@@ -233,11 +233,11 @@ int main(int argc, char* argv[])
auto nAnf = spot::make_safra_complement(Anf); auto nAnf = spot::make_safra_complement(Anf);
auto ec = spot::couvreur99(spot::otf_product(nAf, nAnf)); auto ec = spot::couvreur99(spot::otf_product(nAf, nAnf));
auto res = ec->check(); 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: " std::cout << "States: "
<< a_size.states << std::endl << a_size.states << std::endl
<< "Transitions: " << "Transitions: "
<< a_size.transitions << std::endl << a_size.edges << std::endl
<< "Acc Cond: " << "Acc Cond: "
<< ec->automaton()->acc().num_sets() << ec->automaton()->acc().num_sets()
<< std::endl; << std::endl;
......
...@@ -1516,12 +1516,12 @@ checked_main(int argc, char** argv) ...@@ -1516,12 +1516,12 @@ checked_main(int argc, char** argv)
std::ios::fmtflags old = std::cout.flags(); std::ios::fmtflags old = std::cout.flags();
std::cout << std::left << std::setw(25) std::cout << std::left << std::setw(25)
<< echeck_algo << ", "; << echeck_algo << ", ";
spot::tgba_statistics a_size = spot::twa_statistics a_size =
spot::stats_reachable(ec->automaton()); spot::stats_reachable(ec->automaton());
std::cout << std::right << std::setw(10) std::cout << std::right << std::setw(10)
<< a_size.states << ", " << a_size.states << ", "
<< std::right << std::setw(10) << std::right << std::setw(10)
<< a_size.transitions << ", "; << a_size.edges << ", ";
std::cout << ec->automaton()->acc().num_sets() std::cout << ec->automaton()->acc().num_sets()
<< ", "; << ", ";
auto ecs = ec->emptiness_check_statistics(); auto ecs = ec->emptiness_check_statistics();
......
...@@ -109,7 +109,7 @@ run 0 ../ikwiad -e -R3 '(G!{(b;1)*;a} && ({1;1[*3]*}[]->{(b&!a)[*2];!b&!a}))' ...@@ -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. # before and after degeneralization.
for opt in '' -DT -DS; do for opt in '' -DT -DS; do
../ikwiad -ks -f -R3 $opt 'a U (b U c)' > stdout ../ikwiad -ks -f -R3 $opt 'a U (b U c)' > stdout
grep 'transitions: 6$' stdout grep 'edges: 6$' stdout
grep 'states: 3$' stdout grep 'states: 3$' stdout
done done
...@@ -117,8 +117,8 @@ done ...@@ -117,8 +117,8 @@ done
# before and after degeneralization. # before and after degeneralization.
for opt in '' -DT -DS; do for opt in '' -DT -DS; do
../ikwiad -kt -f -R3 $opt '!(Ga U b)' > stdout ../ikwiad -kt -f -R3 $opt '!(Ga U b)' > stdout
grep 'sub trans.: 11$' stdout grep 'transitions: 11$' stdout
grep 'transitions: 6$' stdout grep 'edges: 6$' stdout
grep 'states: 3$' stdout grep 'states: 3$' stdout
done done
...@@ -126,8 +126,8 @@ done ...@@ -126,8 +126,8 @@ done
# before and after degeneralization. # before and after degeneralization.
for opt in '' -DT -DS; do for opt in '' -DT -DS; do
../ikwiad -kt -f -R3 $opt 'Ga U b' > stdout ../ikwiad -kt -f -R3 $opt 'Ga U b' > stdout
grep 'sub trans.: 12$' stdout grep 'transitions: 12$' stdout
grep 'transitions: 6$' stdout grep 'edges: 6$' stdout
grep 'states: 4$' stdout grep 'states: 4$' stdout
done done
...@@ -136,10 +136,10 @@ done ...@@ -136,10 +136,10 @@ done
f='(G (p -> F q)) && ((X (p) U q) || ! X (p U (p && q)))' f='(G (p -> F q)) && ((X (p) U q) || ! X (p U (p && q)))'
for opt in '' -DT -DS; do for opt in '' -DT -DS; do
../ikwiad -ks -f -R3 $opt "$f" > stdout ../ikwiad -ks -f -R3 $opt "$f" > stdout
grep 'transitions: 15$' stdout grep 'edges: 15$' stdout
grep 'states: 6$' stdout grep 'states: 6$' stdout
../ikwiad -ks -f -R3f $opt "$f" > stdout ../ikwiad -ks -f -R3f $opt "$f" > stdout
grep 'transitions: 15$' stdout grep 'edges: 15$' stdout
grep 'states: 6$' stdout grep 'states: 6$' stdout
done done
...@@ -147,16 +147,16 @@ done ...@@ -147,16 +147,16 @@ done
# has 7 states and 34 transitions after degeneralization. # has 7 states and 34 transitions after degeneralization.
f='GFa & GFb & GFc & GFd & GFe & GFg' f='GFa & GFb & GFc & GFd & GFe & GFg'
../ikwiad -ks -DS -x -f "$f" > stdout ../ikwiad -ks -DS -x -f "$f" > stdout
grep 'transitions: 34$' stdout grep 'edges: 34$' stdout
grep 'states: 7$' stdout grep 'states: 7$' stdout
# Make sure 'Ga & XXXX!a' is minimized to one state. # Make sure 'Ga & XXXX!a' is minimized to one state.
f='Ga & XXXX!a' f='Ga & XXXX!a'
../ikwiad -ks -f "$f" > stdout ../ikwiad -ks -f "$f" > stdout
grep 'transitions: 4$' stdout grep 'edges: 4$' stdout
grep 'states: 5$' stdout grep 'states: 5$' stdout
../ikwiad -ks -Rm -f "$f" > stdout ../ikwiad -ks -Rm -f "$f" > stdout
grep 'transitions: 0$' stdout grep 'edges: 0$' stdout
grep 'states: 1$' stdout grep 'states: 1$' stdout
# Make sure a monitor for F(a & F(b)) accepts everything. # Make sure a monitor for F(a & F(b)) accepts everything.
...@@ -169,12 +169,12 @@ cmp stdout expected ...@@ -169,12 +169,12 @@ cmp stdout expected
# This formula caused a segfault with Spot 0.7. # 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 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 grep 'states: 3$' stdout
# Adding -R3 used to make it work... # Adding -R3 used to make it work...
run 0 ../ikwiad -R3 -Rm -ks -f "Gq|Gr|(G(q|FGp)&G(r|FG!p))" >stdout 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 grep 'states: 3$' stdout
# Make sure FGa|GFb has the same number of states/transitions when # Make sure FGa|GFb has the same number of states/transitions when
...@@ -189,7 +189,7 @@ cmp count.never count.hoa ...@@ -189,7 +189,7 @@ cmp count.never count.hoa
# The following automaton should have only 4 states. # The following automaton should have only 4 states.
run 0 ../ikwiad -R3 -ks -f '(p&XF!p)|(!p&XFp)|X(Fp&F!p)' >stdout 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 grep 'states: 4$' stdout
# A bug in the translation of !{xxx} when xxx reduces to false caused # A bug in the translation of !{xxx} when xxx reduces to false caused
......
...@@ -205,7 +205,7 @@ accept_T3: ...@@ -205,7 +205,7 @@ accept_T3:
} }
EOF EOF
cat >expected<<EOF cat >expected<<EOF
transitions: 6 edges: 6
states: 4 states: 4
EOF EOF
......
...@@ -248,14 +248,14 @@ id(const char*, unsigned x) ...@@ -248,14 +248,14 @@ id(const char*, unsigned x)
return static_cast<T>(x); return static_cast<T>(x);
} }
spot::tgba_statistics prod_stats; spot::twa_statistics prod_stats;
static float static float
prod_conv(const char* name, unsigned x) prod_conv(const char* name, unsigned x)
{ {
float y = static_cast<float>(x); float y = static_cast<float>(x);
if (!strcmp(name, "transitions")) 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; return y / prod_stats.states * 100.0;
} }
...@@ -958,7 +958,7 @@ main(int argc, char** argv) ...@@ -958,7 +958,7 @@ main(int argc, char** argv)
{ {
// To trigger a division by 0 if used erroneously. // To trigger a division by 0 if used erroneously.
prod_stats.states = 0; prod_stats.states = 0;
prod_stats.transitions = 0; prod_stats.edges = 0;
} }
if (opt_z && ecs) if (opt_z && ecs)
......
...@@ -65,7 +65,7 @@ State: 9 ...@@ -65,7 +65,7 @@ State: 9
EOF EOF
cat >outexp <<EOF cat >outexp <<EOF
transitions: 12 edges: 12
states: 6 states: 6
EOF EOF
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
set -e set -e
cat >expected <<EOF cat >expected <<EOF
sub trans.: 16 transitions: 16
transitions: 8 edges: 8
states: 4 states: 4
nondeterministic states: 0 nondeterministic states: 0
EOF EOF
......
...@@ -785,9 +785,8 @@ namespace spot ...@@ -785,9 +785,8 @@ namespace spot
out << target_state_number << ','; out << target_state_number << ',';
if (res) if (res)
{ {
tgba_sub_statistics st = sub_stats_reachable(res); twa_sub_statistics st = sub_stats_reachable(res);
out << st.states << ',' << st.transitions out << st.states << ',' << st.edges << ',' << st.transitions;
<< ',' << st.sub_transitions;
} }
else else
{ {
......
...@@ -1170,9 +1170,8 @@ namespace spot ...@@ -1170,9 +1170,8 @@ namespace spot
out << target_state_number << ','; out << target_state_number << ',';
if (res) if (res)
{ {
tgba_sub_statistics st = sub_stats_reachable(res); twa_sub_statistics st = sub_stats_reachable(res);
out << st.states << ',' << st.transitions out << st.states << ',' << st.edges << ',' << st.transitions;
<< ',' << st.sub_transitions;
} }
else else
{ {
......
...@@ -36,7 +36,7 @@ namespace spot ...@@ -36,7 +36,7 @@ namespace spot
class stats_bfs: public tgba_reachable_iterator_breadth_first class stats_bfs: public tgba_reachable_iterator_breadth_first
{ {
public: public:
stats_bfs(const const_twa_ptr& a, tgba_statistics& s) stats_bfs(const const_twa_ptr& a, twa_statistics& s)
: tgba_reachable_iterator_breadth_first(a), s_(s) : tgba_reachable_iterator_breadth_first(a), s_(s)
{ {
} }
...@@ -51,17 +51,17 @@ namespace spot ...@@ -51,17 +51,17 @@ namespace spot
process_link(const state*, int, const state*, int, process_link(const state*, int, const state*, int,
const twa_succ_iterator*) const twa_succ_iterator*)
{ {
++s_.transitions; ++s_.edges;
} }
private: private:
tgba_statistics& s_; twa_statistics& s_;
}; };
class sub_stats_bfs: public stats_bfs class sub_stats_bfs: public stats_bfs
{ {
public: public:
sub_stats_bfs(const const_twa_ptr& a, tgba_sub_statistics& s) sub_stats_bfs(const const_twa_ptr& a, twa_sub_statistics& s)
: stats_bfs(a, s), s_(s), seen_(bddtrue) : stats_bfs(a, s), s_(s), seen_(bddtrue)
{ {
} }
...@@ -70,7 +70,7 @@ namespace spot ...@@ -70,7 +70,7 @@ namespace spot
process_link(const state*, int, const state*, int, process_link(const state*, int, const state*, int,
const twa_succ_iterator* it) const twa_succ_iterator* it)
{ {
++s_.transitions; ++s_.edges;
bdd cond = it->current_condition(); bdd cond = it->current_condition();
bdd newvars = bdd_exist(bdd_support(cond), seen_); bdd newvars = bdd_exist(bdd_support(cond), seen_);
...@@ -87,49 +87,49 @@ namespace spot ...@@ -87,49 +87,49 @@ namespace spot
// transitions we counted so far are actually double // transitions we counted so far are actually double
// subtransitions. If we have two new variables, they where // subtransitions. If we have two new variables, they where
// quadruple transitions, etc. // quadruple transitions, etc.
s_.sub_transitions <<= count; s_.transitions <<= count;
} }
while (cond != bddfalse) while (cond != bddfalse)
{ {
cond -= bdd_satoneset(cond, seen_, bddtrue); cond -= bdd_satoneset(cond, seen_, bddtrue);
++s_.sub_transitions; ++s_.transitions;
} }
} }
private: private: