ltl2tgba: Add a --stats option.

* src/bin/ltl2tgba.cc (--stats): New option.
* src/tgbaalgos/stats.cc, src/tgbaalgos/stats.hh (stat_printer): New
class.
This commit is contained in:
Alexandre Duret-Lutz 2012-09-19 00:28:23 +02:00
parent f4381d59ce
commit 26ad32d561
3 changed files with 212 additions and 8 deletions

View file

@ -1,5 +1,5 @@
// Copyright (C) 2008, 2011 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2008, 2011, 2012 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
@ -55,6 +55,29 @@ namespace spot
/// \brief Compute subended statistics for an automaton.
tgba_sub_statistics sub_stats_reachable(const tgba* g);
/// \brief prints various statistics about a TGBA
///
/// This object can be configured to display various statistics
/// about a TGBA. Some %-sequence of characters are interpreted in
/// the format string, and replaced by the corresponding statistics.
class stat_printer
{
public:
stat_printer(std::ostream& os, const char* format);
/// \brief print the configured statistics.
///
/// The \a f argument is not needed if the Formula does not need
/// to be output.
std::ostream&
print(const tgba* aut, const ltl::formula* f = 0);
private:
std::ostream& os_;
const char* format_;
unsigned needed_;
};
/// @}
}