mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
move common routines for quantifiers
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
5414030875
commit
e3d634807b
12 changed files with 130 additions and 120 deletions
|
@ -3,7 +3,6 @@ z3_add_component(smt
|
|||
arith_eq_adapter.cpp
|
||||
arith_eq_solver.cpp
|
||||
asserted_formulas.cpp
|
||||
cached_var_subst.cpp
|
||||
cost_evaluator.cpp
|
||||
dyn_ack.cpp
|
||||
expr_context_simplifier.cpp
|
||||
|
@ -45,7 +44,6 @@ z3_add_component(smt
|
|||
smt_model_generator.cpp
|
||||
smt_parallel.cpp
|
||||
smt_quantifier.cpp
|
||||
smt_quantifier_stat.cpp
|
||||
smt_quick_checker.cpp
|
||||
smt_relevancy.cpp
|
||||
smt_setup.cpp
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
/*++
|
||||
Copyright (c) 2006 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
cached_var_subst.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
<abstract>
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2009-01-23.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#include "smt/cached_var_subst.h"
|
||||
#include "ast/rewriter/rewriter_def.h"
|
||||
|
||||
bool cached_var_subst::key_eq_proc::operator()(cached_var_subst::key * k1, cached_var_subst::key * k2) const {
|
||||
if (k1->m_qa != k2->m_qa)
|
||||
return false;
|
||||
if (k1->m_num_bindings != k2->m_num_bindings)
|
||||
return false;
|
||||
for (unsigned i = 0; i < k1->m_num_bindings; i++)
|
||||
if (k1->m_bindings[i] != k2->m_bindings[i])
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
cached_var_subst::cached_var_subst(ast_manager & m):
|
||||
m_proc(m),
|
||||
m_refs(m) {
|
||||
}
|
||||
|
||||
void cached_var_subst::reset() {
|
||||
m_refs.reset();
|
||||
m_instances.reset();
|
||||
m_region.reset();
|
||||
m_new_keys.reset();
|
||||
}
|
||||
|
||||
void cached_var_subst::operator()(quantifier * qa, unsigned num_bindings, smt::enode * const * bindings, expr_ref & result) {
|
||||
m_new_keys.reserve(num_bindings+1, 0);
|
||||
key * new_key = m_new_keys[num_bindings];
|
||||
if (new_key == nullptr)
|
||||
new_key = static_cast<key*>(m_region.allocate(sizeof(key) + sizeof(expr*)*num_bindings));
|
||||
|
||||
new_key->m_qa = qa;
|
||||
new_key->m_num_bindings = num_bindings;
|
||||
for (unsigned i = 0; i < num_bindings; i++)
|
||||
new_key->m_bindings[i] = bindings[i]->get_owner();
|
||||
|
||||
auto* entry = m_instances.insert_if_not_there3(new_key, nullptr);
|
||||
if (entry->get_data().m_key != new_key) {
|
||||
SASSERT(entry->get_data().m_value != 0);
|
||||
// entry was already there
|
||||
m_new_keys[num_bindings] = new_key; // recycle key
|
||||
result = entry->get_data().m_value;
|
||||
SCTRACE("bindings", is_trace_enabled("coming_from_quant"),tout << "(cache)\n";
|
||||
for (unsigned i = 0; i < num_bindings; i++) {
|
||||
if (new_key->m_bindings[i]) {
|
||||
tout << i << ": " << mk_ismt2_pp(new_key->m_bindings[i], result.m()) << ";\n";
|
||||
}
|
||||
}
|
||||
tout.flush(););
|
||||
return;
|
||||
}
|
||||
|
||||
SASSERT(entry->get_data().m_value == 0);
|
||||
try {
|
||||
result = m_proc(qa->get_expr(), new_key->m_num_bindings, new_key->m_bindings);
|
||||
}
|
||||
catch (...) {
|
||||
// CMW: The var_subst reducer was interrupted and m_instances is
|
||||
// in an inconsistent state; we need to remove (new_key, 0).
|
||||
m_instances.remove(new_key);
|
||||
throw; // Throw on to smt::qi_queue/smt::solver.
|
||||
}
|
||||
|
||||
// cache result
|
||||
entry->get_data().m_value = result;
|
||||
|
||||
// remove key from cache
|
||||
m_new_keys[num_bindings] = 0;
|
||||
|
||||
// increment reference counters
|
||||
m_refs.push_back(qa);
|
||||
for (unsigned i = 0; i < new_key->m_num_bindings; i++)
|
||||
m_refs.push_back(new_key->m_bindings[i]);
|
||||
m_refs.push_back(result);
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
/*++
|
||||
Copyright (c) 2006 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
cached_var_subst.h
|
||||
|
||||
Abstract:
|
||||
|
||||
<abstract>
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2009-01-23.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#pragma once
|
||||
|
||||
#include "ast/rewriter/var_subst.h"
|
||||
#include "util/map.h"
|
||||
#include "smt/smt_enode.h"
|
||||
|
||||
class cached_var_subst {
|
||||
struct key {
|
||||
quantifier * m_qa;
|
||||
unsigned m_num_bindings;
|
||||
expr * m_bindings[0];
|
||||
};
|
||||
struct key_hash_proc {
|
||||
unsigned operator()(key * k) const {
|
||||
return string_hash(reinterpret_cast<char const *>(k->m_bindings), sizeof(expr *) * k->m_num_bindings, k->m_qa->get_id());
|
||||
}
|
||||
};
|
||||
struct key_eq_proc {
|
||||
bool operator()(key * k1, key * k2) const;
|
||||
};
|
||||
typedef map<key *, expr *, key_hash_proc, key_eq_proc> instances;
|
||||
var_subst m_proc;
|
||||
expr_ref_vector m_refs;
|
||||
instances m_instances;
|
||||
region m_region;
|
||||
ptr_vector<key> m_new_keys; // mapping from num_bindings -> next key
|
||||
public:
|
||||
cached_var_subst(ast_manager & m);
|
||||
void operator()(quantifier * qa, unsigned num_bindings, smt::enode * const * bindings, expr_ref & result);
|
||||
void reset();
|
||||
};
|
||||
|
||||
|
|
@ -98,8 +98,8 @@ namespace smt {
|
|||
m_parser.add_var("cs_factor");
|
||||
}
|
||||
|
||||
quantifier_stat * qi_queue::set_values(quantifier * q, app * pat, unsigned generation, unsigned min_top_generation, unsigned max_top_generation, float cost) {
|
||||
quantifier_stat * stat = m_qm.get_stat(q);
|
||||
q::quantifier_stat * qi_queue::set_values(quantifier * q, app * pat, unsigned generation, unsigned min_top_generation, unsigned max_top_generation, float cost) {
|
||||
q::quantifier_stat * stat = m_qm.get_stat(q);
|
||||
m_vals[COST] = cost;
|
||||
m_vals[MIN_TOP_GENERATION] = static_cast<float>(min_top_generation);
|
||||
m_vals[MAX_TOP_GENERATION] = static_cast<float>(max_top_generation);
|
||||
|
@ -120,7 +120,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
float qi_queue::get_cost(quantifier * q, app * pat, unsigned generation, unsigned min_top_generation, unsigned max_top_generation) {
|
||||
quantifier_stat * stat = set_values(q, pat, generation, min_top_generation, max_top_generation, 0);
|
||||
q::quantifier_stat * stat = set_values(q, pat, generation, min_top_generation, max_top_generation, 0);
|
||||
float r = m_evaluator(m_cost_function, m_vals.size(), m_vals.c_ptr());
|
||||
stat->update_max_cost(r);
|
||||
return r;
|
||||
|
@ -206,7 +206,7 @@ namespace smt {
|
|||
|
||||
TRACE("qi_queue_profile", tout << q->get_qid() << ", gen: " << generation << " " << *f << " cost: " << ent.m_cost << "\n";);
|
||||
|
||||
quantifier_stat * stat = m_qm.get_stat(q);
|
||||
q::quantifier_stat * stat = m_qm.get_stat(q);
|
||||
|
||||
if (m_checker.is_sat(q->get_expr(), num_bindings, bindings)) {
|
||||
TRACE("checker", tout << "instance already satisfied\n";);
|
||||
|
@ -221,8 +221,10 @@ namespace smt {
|
|||
|
||||
STRACE("instance", tout << "### " << static_cast<void*>(f) <<", " << q->get_qid() << "\n";);
|
||||
|
||||
expr_ref instance(m);
|
||||
m_subst(q, num_bindings, bindings, instance);
|
||||
auto* ebindings = m_subst(q, num_bindings);
|
||||
for (unsigned i = 0; i < num_bindings; ++i)
|
||||
ebindings[i] = bindings[i]->get_owner();
|
||||
expr_ref instance = m_subst();
|
||||
|
||||
TRACE("qi_queue", tout << "new instance:\n" << mk_pp(instance, m) << "\n";);
|
||||
TRACE("qi_queue_instance", tout << "new instance:\n" << mk_pp(instance, m) << "\n";);
|
||||
|
|
|
@ -19,14 +19,14 @@ Revision History:
|
|||
#pragma once
|
||||
|
||||
#include "ast/ast.h"
|
||||
#include "smt/smt_quantifier_stat.h"
|
||||
#include "ast/cached_var_subst.h"
|
||||
#include "ast/quantifier_stat.h"
|
||||
#include "smt/smt_checker.h"
|
||||
#include "smt/smt_quantifier.h"
|
||||
#include "smt/fingerprints.h"
|
||||
#include "smt/params/qi_params.h"
|
||||
#include "parsers/util/cost_parser.h"
|
||||
#include "smt/cost_evaluator.h"
|
||||
#include "smt/cached_var_subst.h"
|
||||
#include "util/statistics.h"
|
||||
|
||||
namespace smt {
|
||||
|
@ -71,7 +71,7 @@ namespace smt {
|
|||
svector<scope> m_scopes;
|
||||
|
||||
void init_parser_vars();
|
||||
quantifier_stat * set_values(quantifier * q, app * pat, unsigned generation, unsigned min_top_generation, unsigned max_top_generation, float cost);
|
||||
q::quantifier_stat * set_values(quantifier * q, app * pat, unsigned generation, unsigned min_top_generation, unsigned max_top_generation, float cost);
|
||||
float get_cost(quantifier * q, app * pat, unsigned generation, unsigned min_top_generation, unsigned max_top_generation);
|
||||
unsigned get_new_gen(quantifier * q, unsigned generation, float cost);
|
||||
void instantiate(entry & ent);
|
||||
|
|
|
@ -18,6 +18,7 @@ Revision History:
|
|||
--*/
|
||||
#pragma once
|
||||
|
||||
#include "ast/quantifier_stat.h"
|
||||
#include "smt/smt_clause.h"
|
||||
#include "smt/smt_setup.h"
|
||||
#include "smt/smt_enode.h"
|
||||
|
@ -29,7 +30,6 @@ Revision History:
|
|||
#include "smt/smt_clause_proof.h"
|
||||
#include "smt/smt_theory.h"
|
||||
#include "smt/smt_quantifier.h"
|
||||
#include "smt/smt_quantifier_stat.h"
|
||||
#include "smt/smt_statistics.h"
|
||||
#include "smt/smt_conflict_resolution.h"
|
||||
#include "smt/smt_relevancy.h"
|
||||
|
|
|
@ -18,9 +18,9 @@ Revision History:
|
|||
--*/
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/ast_ll_pp.h"
|
||||
#include "ast/quantifier_stat.h"
|
||||
#include "smt/smt_quantifier.h"
|
||||
#include "smt/smt_context.h"
|
||||
#include "smt/smt_quantifier_stat.h"
|
||||
#include "smt/smt_model_finder.h"
|
||||
#include "smt/smt_model_checker.h"
|
||||
#include "smt/smt_quick_checker.h"
|
||||
|
@ -129,8 +129,8 @@ namespace smt {
|
|||
context & m_context;
|
||||
smt_params & m_params;
|
||||
qi_queue m_qi_queue;
|
||||
obj_map<quantifier, quantifier_stat *> m_quantifier_stat;
|
||||
quantifier_stat_gen m_qstat_gen;
|
||||
obj_map<quantifier, q::quantifier_stat *> m_quantifier_stat;
|
||||
q::quantifier_stat_gen m_qstat_gen;
|
||||
ptr_vector<quantifier> m_quantifiers;
|
||||
scoped_ptr<quantifier_manager_plugin> m_plugin;
|
||||
unsigned m_num_instances;
|
||||
|
@ -150,7 +150,7 @@ namespace smt {
|
|||
bool has_trace_stream() const { return m().has_trace_stream(); }
|
||||
std::ostream & trace_stream() { return m().trace_stream(); }
|
||||
|
||||
quantifier_stat * get_stat(quantifier * q) const {
|
||||
q::quantifier_stat * get_stat(quantifier * q) const {
|
||||
return m_quantifier_stat.find(q);
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
void add(quantifier * q, unsigned generation) {
|
||||
quantifier_stat * stat = m_qstat_gen(q, generation);
|
||||
q::quantifier_stat * stat = m_qstat_gen(q, generation);
|
||||
m_quantifier_stat.insert(q, stat);
|
||||
m_quantifiers.push_back(q);
|
||||
m_plugin->add(q);
|
||||
|
@ -168,7 +168,7 @@ namespace smt {
|
|||
bool has_quantifiers() const { return !m_quantifiers.empty(); }
|
||||
|
||||
void display_stats(std::ostream & out, quantifier * q) {
|
||||
quantifier_stat * s = get_stat(q);
|
||||
q::quantifier_stat * s = get_stat(q);
|
||||
unsigned num_instances = s->get_num_instances();
|
||||
unsigned num_instances_simplify_true = s->get_num_instances_simplify_true();
|
||||
unsigned num_instances_checker_sat = s->get_num_instances_checker_sat();
|
||||
|
@ -460,7 +460,7 @@ namespace smt {
|
|||
return m_imp->is_shared(n);
|
||||
}
|
||||
|
||||
quantifier_stat * quantifier_manager::get_stat(quantifier * q) const {
|
||||
q::quantifier_stat * quantifier_manager::get_stat(quantifier * q) const {
|
||||
return m_imp->get_stat(q);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ Revision History:
|
|||
#pragma once
|
||||
|
||||
#include "ast/ast.h"
|
||||
#include "ast/quantifier_stat.h"
|
||||
#include "util/statistics.h"
|
||||
#include "util/params.h"
|
||||
#include "smt/smt_types.h"
|
||||
|
@ -50,7 +51,7 @@ namespace smt {
|
|||
|
||||
bool is_shared(enode * n) const;
|
||||
|
||||
quantifier_stat * get_stat(quantifier * q) const;
|
||||
q::quantifier_stat * get_stat(quantifier * q) const;
|
||||
unsigned get_generation(quantifier * q) const;
|
||||
|
||||
static void log_justification_to_root(std::ostream & log, enode *en, obj_hashtable<enode> &already_visited, context &ctx, ast_manager &m);
|
||||
|
|
|
@ -1,119 +0,0 @@
|
|||
/*++
|
||||
Copyright (c) 2006 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
smt_quantifier_stat.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
<abstract>
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2008-02-20.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#include "smt/smt_quantifier_stat.h"
|
||||
|
||||
namespace smt {
|
||||
|
||||
quantifier_stat::quantifier_stat(unsigned generation):
|
||||
m_size(0),
|
||||
m_depth(0),
|
||||
m_generation(generation),
|
||||
m_case_split_factor(1),
|
||||
m_num_nested_quantifiers(0),
|
||||
m_num_instances(0),
|
||||
m_num_instances_checker_sat(0),
|
||||
m_num_instances_simplify_true(0),
|
||||
m_num_instances_curr_search(0),
|
||||
m_num_instances_curr_branch(0),
|
||||
m_max_generation(0),
|
||||
m_max_cost(0.0f) {
|
||||
}
|
||||
|
||||
quantifier_stat_gen::quantifier_stat_gen(ast_manager & m, region & r):
|
||||
m_manager(m),
|
||||
m_region(r) {
|
||||
}
|
||||
|
||||
void quantifier_stat_gen::reset() {
|
||||
m_already_found.reset();
|
||||
m_todo.reset();
|
||||
m_case_split_factor = 1;
|
||||
}
|
||||
|
||||
quantifier_stat * quantifier_stat_gen::operator()(quantifier * q, unsigned generation) {
|
||||
reset();
|
||||
quantifier_stat * r = new (m_region) quantifier_stat(generation);
|
||||
m_todo.push_back(entry(q->get_expr()));
|
||||
while (!m_todo.empty()) {
|
||||
entry & e = m_todo.back();
|
||||
expr * n = e.m_expr;
|
||||
unsigned depth = e.m_depth;
|
||||
bool depth_only = e.m_depth_only;
|
||||
m_todo.pop_back();
|
||||
unsigned old_depth;
|
||||
if (m_already_found.find(n, old_depth)) {
|
||||
if (old_depth >= depth)
|
||||
continue;
|
||||
depth_only = true;
|
||||
}
|
||||
m_already_found.insert(n, depth);
|
||||
if (depth >= r->m_depth)
|
||||
r->m_depth = depth;
|
||||
if (!depth_only) {
|
||||
r->m_size++;
|
||||
if (is_quantifier(n))
|
||||
r->m_num_nested_quantifiers ++;
|
||||
if (is_app(n) && to_app(n)->get_family_id() == m_manager.get_basic_family_id()) {
|
||||
unsigned num_args = to_app(n)->get_num_args();
|
||||
// Remark: I'm approximating the case_split factor.
|
||||
// I'm also ignoring the case split factor due to theories.
|
||||
switch (to_app(n)->get_decl_kind()) {
|
||||
case OP_OR:
|
||||
if (depth == 0)
|
||||
m_case_split_factor *= num_args;
|
||||
else
|
||||
m_case_split_factor *= (num_args + 1);
|
||||
break;
|
||||
case OP_AND:
|
||||
if (depth > 0)
|
||||
m_case_split_factor *= (num_args + 1);
|
||||
break;
|
||||
case OP_EQ:
|
||||
if (m_manager.is_iff(n)) {
|
||||
if (depth == 0)
|
||||
m_case_split_factor *= 4;
|
||||
else
|
||||
m_case_split_factor *= 9;
|
||||
}
|
||||
break;
|
||||
case OP_ITE:
|
||||
if (depth == 0)
|
||||
m_case_split_factor *= 4;
|
||||
else
|
||||
m_case_split_factor *= 9;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_app(n)) {
|
||||
unsigned j = to_app(n)->get_num_args();
|
||||
while (j > 0) {
|
||||
--j;
|
||||
m_todo.push_back(entry(to_app(n)->get_arg(j), depth + 1, depth_only));
|
||||
}
|
||||
}
|
||||
}
|
||||
r->m_case_split_factor = m_case_split_factor.get_value();
|
||||
return r;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -1,154 +0,0 @@
|
|||
/*++
|
||||
Copyright (c) 2006 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
smt_quantifier_stat.h
|
||||
|
||||
Abstract:
|
||||
|
||||
<abstract>
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2008-02-20.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#pragma once
|
||||
|
||||
#include "ast/ast.h"
|
||||
#include "util/obj_hashtable.h"
|
||||
#include "util/approx_nat.h"
|
||||
#include "util/region.h"
|
||||
|
||||
namespace smt {
|
||||
|
||||
/**
|
||||
\brief Store statistics for quantifiers. This information is
|
||||
used to implement heuristics for quantifier instantiation.
|
||||
*/
|
||||
class quantifier_stat {
|
||||
unsigned m_size;
|
||||
unsigned m_depth;
|
||||
unsigned m_generation;
|
||||
unsigned m_case_split_factor; //!< the product of the size of the clauses created by this quantifier.
|
||||
unsigned m_num_nested_quantifiers;
|
||||
unsigned m_num_instances;
|
||||
unsigned m_num_instances_checker_sat;
|
||||
unsigned m_num_instances_simplify_true;
|
||||
unsigned m_num_instances_curr_search;
|
||||
unsigned m_num_instances_curr_branch; //!< only updated if QI_TRACK_INSTANCES is true
|
||||
unsigned m_max_generation; //!< max. generation of an instance
|
||||
float m_max_cost;
|
||||
|
||||
friend class quantifier_stat_gen;
|
||||
|
||||
quantifier_stat(unsigned generation);
|
||||
public:
|
||||
|
||||
unsigned get_size() const {
|
||||
return m_size;
|
||||
}
|
||||
|
||||
unsigned get_depth() const {
|
||||
return m_depth;
|
||||
}
|
||||
|
||||
unsigned get_generation() const {
|
||||
return m_generation;
|
||||
}
|
||||
|
||||
unsigned get_case_split_factor() const {
|
||||
return m_case_split_factor;
|
||||
}
|
||||
|
||||
unsigned get_num_nested_quantifiers() const {
|
||||
return m_num_nested_quantifiers;
|
||||
}
|
||||
|
||||
unsigned get_num_instances() const {
|
||||
return m_num_instances;
|
||||
}
|
||||
unsigned get_num_instances_simplify_true() const {
|
||||
return m_num_instances_simplify_true;
|
||||
}
|
||||
unsigned get_num_instances_checker_sat() const {
|
||||
return m_num_instances_checker_sat;
|
||||
}
|
||||
|
||||
unsigned get_num_instances_curr_search() const {
|
||||
return m_num_instances_curr_search;
|
||||
}
|
||||
|
||||
unsigned & get_num_instances_curr_branch() {
|
||||
return m_num_instances_curr_branch;
|
||||
}
|
||||
|
||||
void inc_num_instances_simplify_true() {
|
||||
m_num_instances_simplify_true++;
|
||||
}
|
||||
|
||||
void inc_num_instances_checker_sat() {
|
||||
m_num_instances_checker_sat++;
|
||||
}
|
||||
|
||||
void inc_num_instances() {
|
||||
m_num_instances++;
|
||||
m_num_instances_curr_search++;
|
||||
}
|
||||
|
||||
void inc_num_instances_curr_branch() {
|
||||
m_num_instances_curr_branch++;
|
||||
}
|
||||
|
||||
void reset_num_instances_curr_search() {
|
||||
m_num_instances_curr_search = 0;
|
||||
}
|
||||
|
||||
void update_max_generation(unsigned g) {
|
||||
if (m_max_generation < g)
|
||||
m_max_generation = g;
|
||||
}
|
||||
|
||||
unsigned get_max_generation() const {
|
||||
return m_max_generation;
|
||||
}
|
||||
|
||||
void update_max_cost(float c) {
|
||||
if (m_max_cost < c)
|
||||
m_max_cost = c;
|
||||
}
|
||||
|
||||
float get_max_cost() const {
|
||||
return m_max_cost;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
\brief Functor used to generate quantifier statistics.
|
||||
*/
|
||||
class quantifier_stat_gen {
|
||||
struct entry {
|
||||
expr * m_expr;
|
||||
unsigned m_depth:31;
|
||||
bool m_depth_only:1; //!< track only the depth of this entry.
|
||||
entry():m_expr(nullptr), m_depth(0), m_depth_only(false) {}
|
||||
entry(expr * n, unsigned depth = 0, bool depth_only = false):m_expr(n), m_depth(depth), m_depth_only(depth_only) {}
|
||||
};
|
||||
ast_manager & m_manager;
|
||||
region & m_region;
|
||||
obj_map<expr, unsigned> m_already_found; // expression to the max. depth it was reached.
|
||||
svector<entry> m_todo;
|
||||
approx_nat m_case_split_factor;
|
||||
void reset();
|
||||
|
||||
public:
|
||||
quantifier_stat_gen(ast_manager & m, region & r);
|
||||
quantifier_stat * operator()(quantifier * q, unsigned generation);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue