4 #include <carl-formula/formula/functions/CNF.h>
6 #include "../settings.h"
14 FormulaT cnf = carl::to_cnf(f,
false);
16 std::size_t num_clauses = 0;
17 std::size_t max_clause_size = 0;
18 std::size_t min_clause_size = 0;
19 std::size_t sum_clause_size = 0;
23 max_clause_size = cnf.size();
24 min_clause_size = cnf.size();
25 sum_clause_size = cnf.size();
28 num_clauses = cnf.size();
29 for (
const auto& sub: cnf) {
30 sum_clause_size += sub.size();
31 if (sub.size() > max_clause_size) max_clause_size = sub.size();
32 if (sub.size() < min_clause_size || min_clause_size == 0) min_clause_size = sub.size();
36 stats.
add(
"num_clauses", num_clauses);
37 stats.
add(
"max_clause_size", max_clause_size);
38 stats.
add(
"min_clause_size", min_clause_size);
39 stats.
add(
"sum_clause_size", sum_clause_size);
40 stats.
add(
"avg_clause_size",
static_cast<float>(sum_clause_size)/
static_cast<float>(num_clauses));
void analyze_cnf(const FormulaT &f, AnalyzerStatistics &stats)
carl::Formula< Poly > FormulaT
const auto & settings_analyzer()
void add(const std::string &key, const T &value)