Commit a80a5137 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

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.
parent babc0240
......@@ -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);
}
}
}
......@@ -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.
......
......@@ -177,6 +177,7 @@ syntax(char* prog)
<< " -r6 reduce formula using tau03+" << std::endl
<< " -r7 reduce formula using tau03+ and -r4" << std::endl
<< " -rd display the reduced formula" << std::endl
<< " -rD dump statistics about the simplifier cache" << std::endl
<< " -rL disable basic rewritings producing larger formulas"
<< std::endl << std::endl
......@@ -305,6 +306,7 @@ main(int argc, char** argv)
bool simpltl = false;
spot::ltl::ltl_simplifier_options redopt(false, false, false, false,
false, false, false);
bool simpcache_stats = false;
bool scc_filter_all = false;
bool symbolic_scc_pruning = false;
bool display_reduced_form = false;
......@@ -619,6 +621,10 @@ main(int argc, char** argv)
{
display_reduced_form = true;
}
else if (!strcmp(argv[formula_index], "-rD"))
{
simpcache_stats = true;
}
else if (!strcmp(argv[formula_index], "-RDS"))
{
reduction_dir_sim = true;
......@@ -879,6 +885,23 @@ main(int argc, char** argv)
tm.stop("translating formula");
to_free = a;
if (simp && simpcache_stats)
{
simp->print_stats(std::cerr);
bddStat s;
bdd_stats(&s);
std::cerr << "BDD produced: " << s.produced
<< "\n nodenum: " << s.nodenum
<< "\n maxnodenum: " << s.maxnodenum
<< "\n freenodes: " << s.freenodes
<< "\n minfreenodes: " << s.minfreenodes
<< "\n varnum: " << s.varnum
<< "\n cachesize: " << s.cachesize
<< "\n gbcnum: " << s.gbcnum
<< std::endl;
bdd_fprintstat(stderr);
dict->dump(std::cerr);
}
delete simp;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment