Add -rD option to ltl2tgba, to display some caching statistics.

* src/ltlvisit/simplify.cc, src/ltlvisit/simplify.hh (print_stats):
New function.
* src/tgbatest/ltl2tgba.cc: Call it.
This commit is contained in:
Alexandre Duret-Lutz 2012-05-19 21:03:56 +02:00
parent babc024097
commit a80a5137fd
3 changed files with 44 additions and 0 deletions

View file

@ -121,6 +121,16 @@ namespace spot
opt.containment_checks |= opt.containment_checks_stronger;
}
void
print_stats(std::ostream& os) const
{
os << "simplified formulae: " << simplified_.size() << " entries\n"
<< "negative normal form: " << nenoform_.size() << " entries\n"
<< "syntactic implications: " << syntimpl_.size() << " entries\n"
<< "boolean to bdd: " << as_bdd_.size() << " entries\n"
<< "star normal form: " << snf_cache_.size() << " entries\n";
}
// Convert a Boolean formula into a BDD for easier comparison.
bdd
as_bdd(const formula* f)
@ -4249,5 +4259,12 @@ namespace spot
return cache_->dict;
}
void
ltl_simplifier::print_stats(std::ostream& os) const
{
cache_->print_stats(os);
}
}
}

View file

@ -24,6 +24,7 @@
#include "ltlast/formula.hh"
#include "bdd.h"
#include "tgba/bdddict.hh"
#include <iosfwd>
namespace spot
{
@ -136,6 +137,9 @@ namespace spot
/// Cached version of spot::ltl::star_normal_form().
const formula* star_normal_form(const formula* f);
/// Dump statistics about the caches.
void print_stats(std::ostream& os) const;
private:
ltl_simplifier_cache* cache_;
// Copy disallowed.