3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-05 23:06:12 +00:00
z3/src/sat/smt/q_queue.h
davedets 6ac3075022
Remove unnecessary semicolons (Attempt 2) (#10020)
This is another PR towards the goal of getting Z3 to compile cleanly
when included via FetchContents into clang-tidy, which uses a pretty
strict set of warnings.

This is a second version of https://github.com/Z3Prover/z3/pull/9957. I
address @NikolajBjorner 's comments about not changing the semicolons
after macro invocations, because some editors work better with them
present. It now, to the best of my ability, only deletes semis:

* after the closing brace of namespace decl.
* after the closing brace of an extern "C" decl.
* after a function definition.

This PR is very large, but it consists entirely of deletions of
semicolons in these situations.

(If there was a way to update the previous PR, which had been closed,
and that is preferable, please let me know. I couldn't figure it out.)
2026-07-02 12:47:29 -07:00

87 lines
2.1 KiB
C++

/*++
Copyright (c) 2020 Microsoft Corporation
Module Name:
q_queue.h
Abstract:
Instantiation queue for quantifiers
Author:
Nikolaj Bjorner (nbjorner) 2021-01-24
--*/
#pragma once
#include "ast/quantifier_stat.h"
#include "ast/cost_evaluator.h"
#include "ast/rewriter/cached_var_subst.h"
#include "parsers/util/cost_parser.h"
#include "sat/smt/q_clause.h"
namespace euf {
class solver;
}
namespace q {
class ematch;
class queue {
struct stats {
unsigned m_num_instances, m_num_lazy_instances;
void reset() { memset(this, 0, sizeof(*this)); }
stats() { reset(); }
};
ematch& em;
euf::solver& ctx;
ast_manager & m;
qi_params const & m_params;
stats m_stats;
expr_ref m_cost_function;
expr_ref m_new_gen_function;
cost_parser m_parser;
cost_evaluator m_evaluator;
cached_var_subst m_subst;
svector<float> m_vals;
double m_eager_cost_threshold = 0;
struct entry {
binding * m_qb;
float m_cost;
bool m_instantiated = false;
entry(binding * f, float c):m_qb(f), m_cost(c) {}
};
struct reset_new_entries;
struct reset_instantiated;
svector<entry> m_new_entries;
svector<entry> m_delayed_entries;
float get_cost(binding& f);
void set_values(binding& f, float cost);
void init_parser_vars();
void setup();
unsigned get_new_gen(binding& f, float cost);
void instantiate(entry& e);
public:
queue(ematch& em, euf::solver& ctx);
void insert(binding* f);
bool propagate();
bool lazy_propagate();
void collect_statistics(::statistics & st) const;
};
}