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:
parent
f7c4ca816b
commit
4a91fccc33
18 changed files with 96 additions and 97 deletions
|
|
@ -785,9 +785,8 @@ namespace spot
|
|||
out << target_state_number << ',';
|
||||
if (res)
|
||||
{
|
||||
tgba_sub_statistics st = sub_stats_reachable(res);
|
||||
out << st.states << ',' << st.transitions
|
||||
<< ',' << st.sub_transitions;
|
||||
twa_sub_statistics st = sub_stats_reachable(res);
|
||||
out << st.states << ',' << st.edges << ',' << st.transitions;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1170,9 +1170,8 @@ namespace spot
|
|||
out << target_state_number << ',';
|
||||
if (res)
|
||||
{
|
||||
tgba_sub_statistics st = sub_stats_reachable(res);
|
||||
out << st.states << ',' << st.transitions
|
||||
<< ',' << st.sub_transitions;
|
||||
twa_sub_statistics st = sub_stats_reachable(res);
|
||||
out << st.states << ',' << st.edges << ',' << st.transitions;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ namespace spot
|
|||
class stats_bfs: public tgba_reachable_iterator_breadth_first
|
||||
{
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
|
@ -51,17 +51,17 @@ namespace spot
|
|||
process_link(const state*, int, const state*, int,
|
||||
const twa_succ_iterator*)
|
||||
{
|
||||
++s_.transitions;
|
||||
++s_.edges;
|
||||
}
|
||||
|
||||
private:
|
||||
tgba_statistics& s_;
|
||||
twa_statistics& s_;
|
||||
};
|
||||
|
||||
class sub_stats_bfs: public stats_bfs
|
||||
{
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ namespace spot
|
|||
process_link(const state*, int, const state*, int,
|
||||
const twa_succ_iterator* it)
|
||||
{
|
||||
++s_.transitions;
|
||||
++s_.edges;
|
||||
|
||||
bdd cond = it->current_condition();
|
||||
bdd newvars = bdd_exist(bdd_support(cond), seen_);
|
||||
|
|
@ -87,49 +87,49 @@ namespace spot
|
|||
// transitions we counted so far are actually double
|
||||
// subtransitions. If we have two new variables, they where
|
||||
// quadruple transitions, etc.
|
||||
s_.sub_transitions <<= count;
|
||||
s_.transitions <<= count;
|
||||
}
|
||||
while (cond != bddfalse)
|
||||
{
|
||||
cond -= bdd_satoneset(cond, seen_, bddtrue);
|
||||
++s_.sub_transitions;
|
||||
++s_.transitions;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
tgba_sub_statistics& s_;
|
||||
twa_sub_statistics& s_;
|
||||
bdd seen_;
|
||||
};
|
||||
} // anonymous
|
||||
|
||||
|
||||
std::ostream& tgba_statistics::dump(std::ostream& out) const
|
||||
std::ostream& twa_statistics::dump(std::ostream& out) const
|
||||
{
|
||||
out << "transitions: " << transitions << std::endl;
|
||||
out << "states: " << states << std::endl;
|
||||
out << "edges: " << edges << '\n';
|
||||
out << "states: " << states << '\n';
|
||||
return out;
|
||||
}
|
||||
|
||||
std::ostream& tgba_sub_statistics::dump(std::ostream& out) const
|
||||
std::ostream& twa_sub_statistics::dump(std::ostream& out) const
|
||||
{
|
||||
out << "sub trans.: " << sub_transitions << std::endl;
|
||||
this->tgba_statistics::dump(out);
|
||||
out << "transitions: " << transitions << '\n';
|
||||
this->twa_statistics::dump(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
tgba_statistics
|
||||
twa_statistics
|
||||
stats_reachable(const const_twa_ptr& g)
|
||||
{
|
||||
tgba_statistics s;
|
||||
twa_statistics s;
|
||||
stats_bfs d(g, s);
|
||||
d.run();
|
||||
return s;
|
||||
}
|
||||
|
||||
tgba_sub_statistics
|
||||
twa_sub_statistics
|
||||
sub_stats_reachable(const const_twa_ptr& g)
|
||||
{
|
||||
tgba_sub_statistics s;
|
||||
twa_sub_statistics s;
|
||||
sub_stats_bfs d(g, s);
|
||||
d.run();
|
||||
return s;
|
||||
|
|
@ -169,16 +169,16 @@ namespace spot
|
|||
|
||||
if (has('t'))
|
||||
{
|
||||
tgba_sub_statistics s = sub_stats_reachable(aut);
|
||||
twa_sub_statistics s = sub_stats_reachable(aut);
|
||||
states_ = s.states;
|
||||
edges_ = s.transitions;
|
||||
trans_ = s.sub_transitions;
|
||||
edges_ = s.edges;
|
||||
trans_ = s.transitions;
|
||||
}
|
||||
else if (has('s') || has('e'))
|
||||
{
|
||||
tgba_sub_statistics s = sub_stats_reachable(aut);
|
||||
twa_sub_statistics s = sub_stats_reachable(aut);
|
||||
states_ = s.states;
|
||||
edges_ = s.transitions;
|
||||
edges_ = s.edges;
|
||||
}
|
||||
|
||||
if (has('a'))
|
||||
|
|
|
|||
|
|
@ -32,27 +32,27 @@ namespace spot
|
|||
/// \addtogroup twa_misc
|
||||
/// @{
|
||||
|
||||
struct SPOT_API tgba_statistics
|
||||
struct SPOT_API twa_statistics
|
||||
{
|
||||
unsigned transitions;
|
||||
unsigned edges;
|
||||
unsigned states;
|
||||
|
||||
tgba_statistics() { transitions = 0; states = 0; }
|
||||
twa_statistics() { edges = 0; states = 0; }
|
||||
std::ostream& dump(std::ostream& out) const;
|
||||
};
|
||||
|
||||
struct SPOT_API tgba_sub_statistics: public tgba_statistics
|
||||
struct SPOT_API twa_sub_statistics: public twa_statistics
|
||||
{
|
||||
unsigned sub_transitions;
|
||||
unsigned transitions;
|
||||
|
||||
tgba_sub_statistics() { sub_transitions = 0; }
|
||||
twa_sub_statistics() { transitions = 0; }
|
||||
std::ostream& dump(std::ostream& out) const;
|
||||
};
|
||||
|
||||
/// \brief Compute statistics for an automaton.
|
||||
SPOT_API tgba_statistics stats_reachable(const const_twa_ptr& g);
|
||||
SPOT_API twa_statistics stats_reachable(const const_twa_ptr& g);
|
||||
/// \brief Compute sub statistics for an automaton.
|
||||
SPOT_API tgba_sub_statistics sub_stats_reachable(const const_twa_ptr& g);
|
||||
SPOT_API twa_sub_statistics sub_stats_reachable(const const_twa_ptr& g);
|
||||
|
||||
|
||||
class SPOT_API printable_formula: public printable_value<formula>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue