3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 00:55:31 +00:00

Merge branch 'master' into polysat

This commit is contained in:
Jakob Rath 2022-08-01 11:27:49 +02:00
commit 220a63e8bd
223 changed files with 508 additions and 505 deletions

View file

@ -29,8 +29,6 @@ public:
updt_params(p);
}
~ackermannize_bv_tactic() override { }
char const* name() const override { return "ackermannize_bv"; }
void operator()(goal_ref const & g, goal_ref_buffer & result) override {

View file

@ -40,8 +40,6 @@ public:
fixed_model(false)
{ }
~ackr_model_converter() override { }
void get_units(obj_map<expr, bool>& units) override { units.reset(); }
void operator()(model_ref & md) override {

View file

@ -28,8 +28,6 @@ public:
, model_constructor(lmc)
{ }
~lackr_model_converter_lazy() override { }
void operator()(model_ref & md) override {
SASSERT(md.get() == 0 || (!md->get_num_constants() && !md->get_num_functions()));
SASSERT(model_constructor.get());

View file

@ -344,7 +344,6 @@ extern "C" {
scoped_anum_vector const & m_as;
public:
vector_var2anum(scoped_anum_vector & as):m_as(as) {}
virtual ~vector_var2anum() {}
algebraic_numbers::manager & m() const override { return m_as.m(); }
bool contains(polynomial::var x) const override { return static_cast<unsigned>(x) < m_as.size(); }
algebraic_numbers::anum const & operator()(polynomial::var x) const override { return m_as.get(x); }

View file

@ -26,7 +26,6 @@ namespace api {
struct Z3_ast_vector_ref : public api::object {
ast_ref_vector m_ast_vector;
Z3_ast_vector_ref(api::context& c, ast_manager & m): api::object(c), m_ast_vector(m) {}
~Z3_ast_vector_ref() override {}
};
inline Z3_ast_vector_ref * to_ast_vector(Z3_ast_vector v) { return reinterpret_cast<Z3_ast_vector_ref *>(v); }

View file

@ -47,7 +47,7 @@ extern "C" {
env_params::updt_params();
}
Z3_bool Z3_API Z3_global_param_get(Z3_string param_id, Z3_string_ptr param_value) {
bool Z3_API Z3_global_param_get(Z3_string param_id, Z3_string_ptr param_value) {
memory::initialize(UINT_MAX);
LOG_Z3_global_param_get(param_id, param_value);
*param_value = nullptr;

View file

@ -58,7 +58,7 @@ namespace api {
solver_ref s;
public:
seq_expr_solver(ast_manager& m, params_ref const& p): m(m), p(p) {}
lbool check_sat(expr* e) {
lbool check_sat(expr* e) override {
if (!s) {
s = mk_smt_solver(m, p, symbol("ALL"));
}

View file

@ -52,7 +52,6 @@ namespace api {
m_context(m, m_register_engine, p),
m_trail(m) {}
~fixedpoint_context() override {}
family_id get_family_id() const override { return const_cast<datalog::context&>(m_context).get_decl_util().get_family_id(); }
void set_state(void* state) {
SASSERT(!m_state);

View file

@ -23,7 +23,6 @@ Revision History:
struct Z3_goal_ref : public api::object {
goal_ref m_goal;
Z3_goal_ref(api::context& c) : api::object(c) {}
~Z3_goal_ref() override {}
};
inline Z3_goal_ref * to_goal(Z3_goal g) { return reinterpret_cast<Z3_goal_ref *>(g); }

View file

@ -23,7 +23,6 @@ Revision History:
struct Z3_model_ref : public api::object {
model_ref m_model;
Z3_model_ref(api::context& c): api::object(c) {}
~Z3_model_ref() override {}
};
inline Z3_model_ref * to_model(Z3_model s) { return reinterpret_cast<Z3_model_ref *>(s); }
@ -34,7 +33,6 @@ struct Z3_func_interp_ref : public api::object {
model_ref m_model; // must have it to prevent reference to m_func_interp to be killed.
func_interp * m_func_interp;
Z3_func_interp_ref(api::context& c, model * m): api::object(c), m_model(m), m_func_interp(nullptr) {}
~Z3_func_interp_ref() override {}
};
inline Z3_func_interp_ref * to_func_interp(Z3_func_interp s) { return reinterpret_cast<Z3_func_interp_ref *>(s); }
@ -46,7 +44,6 @@ struct Z3_func_entry_ref : public api::object {
func_interp * m_func_interp;
func_entry const * m_func_entry;
Z3_func_entry_ref(api::context& c, model * m):api::object(c), m_model(m), m_func_interp(nullptr), m_func_entry(nullptr) {}
~Z3_func_entry_ref() override {}
};
inline Z3_func_entry_ref * to_func_entry(Z3_func_entry s) { return reinterpret_cast<Z3_func_entry_ref *>(s); }

View file

@ -459,4 +459,33 @@ extern "C" {
Z3_CATCH_RETURN(nullptr);
}
#if 0
Z3_ast Z3_API Z3_mk_mpz_numeral(Z3_context c, bool sign, unsigned n, unsigned const nums[], Z3_sort* srt) {
LOG_TRY;
LOG_Z3_mk_mpz_numeral(c, sign, n, nums, srt);
RESET_ERROR_CODE();
rational z;
// todo fill in z
if (!z.size())
z.neg();
arith_util & a = mk_c(c)->autil();
auto* a = mk_c(c)->mk_numeral_core(r, a.mk_int_sort());
Z3_CATCH_RETURN(nullptr);
}
Z3_ast Z3_API Z3_mk_mpq_numeral1(Z3_context c, bool sign, unsigned n, unsigned const nums[], unsigned d, unsigned const dens[]) {
LOG_TRY;
LOG_Z3_mk_mpq_numeral(c, sign, n, nums, d, dens);
RESET_ERROR_CODE();
rational q;
if (!sign)
q.neg();
Z3_CATCH_RETURN(nullptr);
}
#endif
};

View file

@ -47,8 +47,6 @@ extern "C" {
ctx->register_plist();
ctx->set_ignore_check(true);
}
~Z3_parser_context_ref() override {}
};
inline Z3_parser_context_ref * to_parser_context(Z3_parser_context pc) { return reinterpret_cast<Z3_parser_context_ref*>(pc); }

View file

@ -51,7 +51,6 @@ struct Z3_solver_ref : public api::object {
Z3_solver_ref(api::context& c, solver_factory * f):
api::object(c), m_solver_factory(f), m_solver(nullptr), m_logic(symbol::null), m_eh(nullptr) {}
~Z3_solver_ref() override {}
void assert_expr(expr* e);
void assert_expr(expr* e, expr* t);

View file

@ -23,7 +23,6 @@ Revision History:
struct Z3_stats_ref : public api::object {
statistics m_stats;
Z3_stats_ref(api::context& c): api::object(c) {}
~Z3_stats_ref() override {}
};
inline Z3_stats_ref * to_stats(Z3_stats s) { return reinterpret_cast<Z3_stats_ref *>(s); }

View file

@ -28,13 +28,11 @@ namespace api {
struct Z3_tactic_ref : public api::object {
tactic_ref m_tactic;
Z3_tactic_ref(api::context& c): api::object(c) {}
~Z3_tactic_ref() override {}
};
struct Z3_probe_ref : public api::object {
probe_ref m_probe;
Z3_probe_ref(api::context& c):api::object(c) {}
~Z3_probe_ref() override {}
};
inline Z3_tactic_ref * to_tactic(Z3_tactic g) { return reinterpret_cast<Z3_tactic_ref *>(g); }
@ -50,7 +48,6 @@ struct Z3_apply_result_ref : public api::object {
model_converter_ref m_mc;
proof_converter_ref m_pc;
Z3_apply_result_ref(api::context& c, ast_manager & m);
~Z3_apply_result_ref() override {}
};
inline Z3_apply_result_ref * to_apply_result(Z3_apply_result g) { return reinterpret_cast<Z3_apply_result_ref *>(g); }

View file

@ -3414,7 +3414,7 @@ namespace z3 {
}
};
constructor_list::constructor_list(constructors const& cs): ctx(cs.ctx) {
inline constructor_list::constructor_list(constructors const& cs): ctx(cs.ctx) {
array<Z3_constructor> cons(cs.size());
for (unsigned i = 0; i < cs.size(); ++i)
cons[i] = cs[i];

View file

@ -938,6 +938,15 @@ namespace Microsoft.Z3
return new BoolExpr(this, Native.Z3_mk_distinct(nCtx, (uint)args.Length, AST.ArrayToNative(args)));
}
/// <summary>
/// Creates a <c>distinct</c> term.
/// </summary>
public BoolExpr MkDistinct(IEnumerable<Expr> args)
{
Debug.Assert(args != null);
return MkDistinct(args.ToArray());
}
/// <summary>
/// Mk an expression representing <c>not(a)</c>.
/// </summary>

View file

@ -103,7 +103,7 @@ function rcf_get_numerator_denominator(c: Z3_context, a: Z3_rcf_num): { n: Z3_rc
When there is only a single out parameter, and the return value is not otherwise of interest, the parameter is not wrapped. For example, the C declaration
```c
Z3_bool Z3_model_eval(Z3_context c, Z3_model m, Z3_ast t, bool model_completion, Z3_ast * v);
bool Z3_model_eval(Z3_context c, Z3_model m, Z3_ast t, bool model_completion, Z3_ast * v);
```
is represented in the TS bindings as

View file

@ -16,7 +16,6 @@ const files = [
const aliases = {
__proto__: null,
Z3_bool: 'boolean',
Z3_string: 'string',
bool: 'boolean',
signed: 'int',

View file

@ -498,6 +498,15 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
return result;
}
///////////////////////////////
// expression simplification //
///////////////////////////////
async function simplify(e : Expr<Name>) {
const result = await Z3.simplify(contextPtr, e.ast)
return _toExpr(check(result));
}
/////////////
// Objects //
/////////////
@ -1050,6 +1059,10 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
return check(Z3.model_to_string(contextPtr, this.ptr));
}
toString() {
return this.sexpr();
}
eval(expr: Bool<Name>, modelCompletion?: boolean): Bool<Name>;
eval(expr: Arith<Name>, modelCompletion?: boolean): Arith<Name>;
eval(expr: Expr<Name>, modelCompletion: boolean = false) {

View file

@ -133,7 +133,7 @@ def _configure_z3():
# Allow command-line arguments to add and override Z3_ options
for i in range(len(sys.argv) - 1):
key = sys.argv[i]
if key.starts_with("Z3_"):
if key.startswith("Z3_"):
val = sys.argv[i + 1].upper()
if val == "TRUE" or val == "FALSE":
cmake_options[key] = val

View file

@ -204,12 +204,13 @@ class Context:
Z3_set_param_value(conf, str(prev), _to_param_value(a))
prev = None
self.ctx = Z3_mk_context_rc(conf)
self.owner = True
self.eh = Z3_set_error_handler(self.ctx, z3_error_handler)
Z3_set_ast_print_mode(self.ctx, Z3_PRINT_SMTLIB2_COMPLIANT)
Z3_del_config(conf)
def __del__(self):
if Z3_del_context is not None:
if Z3_del_context is not None and self.owner:
Z3_del_context(self.ctx)
self.ctx = None
self.eh = None
@ -11363,16 +11364,18 @@ def to_ContextObj(ptr,):
return ctx
def user_prop_fresh(ctx, new_ctx):
def user_prop_fresh(ctx, _new_ctx):
_prop_closures.set_threaded()
prop = _prop_closures.get(ctx)
nctx = Context()
new_ctx = to_ContextObj(new_ctx)
Z3_del_context(nctx.ctx)
new_ctx = to_ContextObj(_new_ctx)
nctx.ctx = new_ctx
nctx.eh = Z3_set_error_handler(new_ctx, z3_error_handler)
nctx.owner = False
new_prop = prop.fresh(nctx)
_prop_closures.set(new_prop.id, new_prop)
return ctypes.c_void_p(new_prop.id)
return new_prop.id
def to_Ast(ptr,):
ast = Ast(ptr)
@ -11387,6 +11390,13 @@ def user_prop_fixed(ctx, cb, id, value):
prop.fixed(id, value)
prop.cb = None
def user_prop_created(ctx, cb, id):
prop = _prop_closures.get(ctx)
prop.cb = cb
id = _to_expr_ref(to_Ast(id), prop.ctx())
prop.created(id)
prop.cb = None
def user_prop_final(ctx, cb):
prop = _prop_closures.get(ctx)
prop.cb = cb
@ -11409,15 +11419,50 @@ def user_prop_diseq(ctx, cb, x, y):
prop.diseq(x, y)
prop.cb = None
# TODO The decision callback is not fully implemented.
# It needs to handle the ast*, unsigned* idx, and Z3_lbool*
def user_prop_decide(ctx, cb, t_ref, idx_ref, phase_ref):
prop = _prop_closures.get(ctx)
prop.cb = cb
t = _to_expr_ref(to_Ast(t_ref), prop.ctx())
t, idx, phase = prop.decide(t, idx, phase)
t_ref = t
idx_ref = idx
phase_ref = phase
prop.cb = None
_user_prop_push = Z3_push_eh(user_prop_push)
_user_prop_pop = Z3_pop_eh(user_prop_pop)
_user_prop_fresh = Z3_fresh_eh(user_prop_fresh)
_user_prop_fixed = Z3_fixed_eh(user_prop_fixed)
_user_prop_created = Z3_created_eh(user_prop_created)
_user_prop_final = Z3_final_eh(user_prop_final)
_user_prop_eq = Z3_eq_eh(user_prop_eq)
_user_prop_diseq = Z3_eq_eh(user_prop_diseq)
_user_prop_decide = Z3_decide_eh(user_prop_decide)
def PropagateFunction(name, *sig):
"""Create a function that gets tracked by user propagator.
Every term headed by this function symbol is tracked.
If a term is fixed and the fixed callback is registered a
callback is invoked that the term headed by this function is fixed.
"""
sig = _get_args(sig)
if z3_debug():
_z3_assert(len(sig) > 0, "At least two arguments expected")
arity = len(sig) - 1
rng = sig[arity]
if z3_debug():
_z3_assert(is_sort(rng), "Z3 sort expected")
dom = (Sort * arity)()
for i in range(arity):
if z3_debug():
_z3_assert(is_sort(sig[i]), "Z3 sort expected")
dom[i] = sig[i].ast
ctx = rng.ctx
return FuncDeclRef(Z3_solver_propagate_declare(ctx.ref(), to_symbol(name, ctx), arity, dom, rng.ast), ctx)
class UserPropagateBase:
@ -11440,6 +11485,7 @@ class UserPropagateBase:
self.final = None
self.eq = None
self.diseq = None
self.created = None
if ctx:
self.fresh_ctx = ctx
if s:
@ -11470,6 +11516,13 @@ class UserPropagateBase:
Z3_solver_propagate_fixed(self.ctx_ref(), self.solver.solver, _user_prop_fixed)
self.fixed = fixed
def add_created(self, created):
assert not self.created
assert not self._ctx
if self.solver:
Z3_solver_propagate_created(self.ctx_ref(), self.solver.solver, _user_prop_created)
self.created = created
def add_final(self, final):
assert not self.final
assert not self._ctx
@ -11491,6 +11544,13 @@ class UserPropagateBase:
Z3_solver_propagate_diseq(self.ctx_ref(), self.solver.solver, _user_prop_diseq)
self.diseq = diseq
def add_decide(self, decide):
assert not self.decide
assert not self._ctx
if self.solver:
Z3_solver_propagate_decide(self.ctx_ref(), self.solver.solver, _user_prop_decide)
self.decide = decide
def push(self):
raise Z3Exception("push needs to be overwritten")
@ -11501,10 +11561,20 @@ class UserPropagateBase:
raise Z3Exception("fresh needs to be overwritten")
def add(self, e):
assert self.solver
assert not self._ctx
Z3_solver_propagate_register(self.ctx_ref(), self.solver.solver, e.ast)
if self.solver:
Z3_solver_propagate_register(self.ctx_ref(), self.solver.solver, e.ast)
else:
Z3_solver_propagate_register_cb(self.ctx_ref(), ctypes.c_void_p(self.cb), e.ast)
#
# Tell the solver to perform the next split on a given term
# If the term is a bit-vector the index idx specifies the index of the Boolean variable being
# split on. A phase of true = 1/false = -1/undef = 0 = let solver decide is the last argument.
#
def next_split(self, t, idx, phase):
Z3_solver_next_split(self.ctx_ref(), ctypes.c_void_p(self.cb), t.ast, idx, phase)
#
# Propagation can only be invoked as during a fixed or final callback.
#
@ -11516,5 +11586,5 @@ class UserPropagateBase:
Z3_solver_propagate_consequence(e.ctx.ref(), ctypes.c_void_p(
self.cb), num_fixed, _ids, num_eqs, _lhs, _rhs, e.ast)
def conflict(self, deps):
self.propagate(BoolVal(False, self.ctx()), deps, eqs=[])
def conflict(self, deps = [], eqs = []):
self.propagate(BoolVal(False, self.ctx()), deps, eqs)

View file

@ -1528,7 +1528,7 @@ extern "C" {
def_API('Z3_global_param_get', BOOL, (_in(STRING), _out(STRING)))
*/
Z3_bool Z3_API Z3_global_param_get(Z3_string param_id, Z3_string_ptr param_value);
bool Z3_API Z3_global_param_get(Z3_string param_id, Z3_string_ptr param_value);
/**@}*/
@ -3387,6 +3387,39 @@ extern "C" {
*/
Z3_ast Z3_API Z3_mk_numeral(Z3_context c, Z3_string numeral, Z3_sort ty);
#if 0
/**
\brief Create an integer numeral from a vector of unsigned numerals.
\param c - context
\param sign - true if positive, false if negative
\param n - length of array of numerals
\param nums - array of numerals
\param s - sort of numeral (int, real, bit-vector).
future_('Z3_mk_mpz_numeral', AST, (_in(CONTEXT), _in(BOOL), _in(UINT), _in_array(2, UINT), _in(SORT)))
*/
Z3_ast Z3_mk_mpz_numeral(Z3_context c, bool sign, unsigned n, unsigned const nums[], Z3_sort s);
/**
\brief Create a rational numeral from a vector of unsigned numerals.
\param c - context
\param sign - true if positive, false if negative
\param n - length of array of nominator numerals
\param nums - array of numerator numerals
\param d - length of array of denominator numerals
\param dens - array of denominator numerals
The sort of returned numeral is Real.
future_('Z3_mk_mpq_numeral', AST, (_in(CONTEXT), _in(BOOL), _in(UINT), _in_array(2, UINT), _in(UINT), _in_array(4, UINT)))
*/
Z3_ast Z3_mk_mpq_numeral(Z3_context c, bool sign, unsigned n, unsigned const nums[], unsigned d, unsigned const dens[]);
#endif
/**
\brief Create a real from a fraction.
@ -4407,7 +4440,7 @@ extern "C" {
def_API('Z3_get_finite_domain_sort_size', BOOL, (_in(CONTEXT), _in(SORT), _out(UINT64)))
*/
Z3_bool Z3_API Z3_get_finite_domain_sort_size(Z3_context c, Z3_sort s, uint64_t* r);
bool Z3_API Z3_get_finite_domain_sort_size(Z3_context c, Z3_sort s, uint64_t* r);
/**
\brief Return the domain of the given array sort.
@ -4822,6 +4855,8 @@ extern "C" {
\brief Return the number of argument of an application. If \c t
is an constant, then the number of arguments is 0.
\sa Z3_get_app_arg
def_API('Z3_get_app_num_args', UINT, (_in(CONTEXT), _in(APP)))
*/
unsigned Z3_API Z3_get_app_num_args(Z3_context c, Z3_app a);
@ -4831,6 +4866,8 @@ extern "C" {
\pre i < Z3_get_app_num_args(c, a)
\sa Z3_get_app_num_args
def_API('Z3_get_app_arg', AST, (_in(CONTEXT), _in(APP), _in(UINT)))
*/
Z3_ast Z3_API Z3_get_app_arg(Z3_context c, Z3_app a, unsigned i);
@ -5376,7 +5413,7 @@ extern "C" {
def_API('Z3_model_eval', BOOL, (_in(CONTEXT), _in(MODEL), _in(AST), _in(BOOL), _out(AST)))
*/
Z3_bool Z3_API Z3_model_eval(Z3_context c, Z3_model m, Z3_ast t, bool model_completion, Z3_ast * v);
bool Z3_API Z3_model_eval(Z3_context c, Z3_model m, Z3_ast t, bool model_completion, Z3_ast * v);
/**
\brief Return the interpretation (i.e., assignment) of constant \c a in the model \c m.
@ -5425,6 +5462,7 @@ extern "C" {
\pre i < Z3_model_get_num_consts(c, m)
\sa Z3_model_eval
\sa Z3_model_get_num_consts
def_API('Z3_model_get_const_decl', FUNC_DECL, (_in(CONTEXT), _in(MODEL), _in(UINT)))
*/
@ -5436,6 +5474,8 @@ extern "C" {
A function interpretation is represented as a finite map and an 'else' value.
Each entry in the finite map represents the value of a function given a set of arguments.
\sa Z3_model_get_func_decl
def_API('Z3_model_get_num_funcs', UINT, (_in(CONTEXT), _in(MODEL)))
*/
unsigned Z3_API Z3_model_get_num_funcs(Z3_context c, Z3_model m);
@ -5561,6 +5601,8 @@ extern "C" {
Each entry in the finite map represents the value of a function given a set of arguments.
This procedure return the number of element in the finite map of \c f.
\sa Z3_func_interp_get_entry
def_API('Z3_func_interp_get_num_entries', UINT, (_in(CONTEXT), _in(FUNC_INTERP)))
*/
unsigned Z3_API Z3_func_interp_get_num_entries(Z3_context c, Z3_func_interp f);
@ -5649,6 +5691,7 @@ extern "C" {
/**
\brief Return the number of arguments in a \c Z3_func_entry object.
\sa Z3_func_entry_get_arg
\sa Z3_func_interp_get_entry
def_API('Z3_func_entry_get_num_args', UINT, (_in(CONTEXT), _in(FUNC_ENTRY)))
@ -5660,6 +5703,7 @@ extern "C" {
\pre i < Z3_func_entry_get_num_args(c, e)
\sa Z3_func_entry_get_num_args
\sa Z3_func_interp_get_entry
def_API('Z3_func_entry_get_arg', AST, (_in(CONTEXT), _in(FUNC_ENTRY), _in(UINT)))
@ -5672,6 +5716,9 @@ extern "C" {
/**
\brief Log interaction to a file.
\sa Z3_append_log
\sa Z3_close_log
extra_API('Z3_open_log', INT, (_in(STRING),))
*/
bool Z3_API Z3_open_log(Z3_string filename);
@ -5679,10 +5726,13 @@ extern "C" {
/**
\brief Append user-defined string to interaction log.
The interaction log is opened using Z3_open_log.
The interaction log is opened using #Z3_open_log.
It contains the formulas that are checked using Z3.
You can use this command to append comments, for instance.
\sa Z3_open_log
\sa Z3_close_log
extra_API('Z3_append_log', VOID, (_in(STRING),))
*/
void Z3_API Z3_append_log(Z3_string string);
@ -5690,6 +5740,9 @@ extern "C" {
/**
\brief Close interaction log.
\sa Z3_open_log
\sa Z3_append_log
extra_API('Z3_close_log', VOID, ())
*/
void Z3_API Z3_close_log(void);
@ -6388,6 +6441,8 @@ extern "C" {
/**
\brief Return the number of builtin tactics available in Z3.
\sa Z3_get_tactic_name
def_API('Z3_get_num_tactics', UINT, (_in(CONTEXT),))
*/
unsigned Z3_API Z3_get_num_tactics(Z3_context c);
@ -6397,6 +6452,8 @@ extern "C" {
\pre i < Z3_get_num_tactics(c)
\sa Z3_get_num_tactics
def_API('Z3_get_tactic_name', STRING, (_in(CONTEXT), _in(UINT)))
*/
Z3_string Z3_API Z3_get_tactic_name(Z3_context c, unsigned i);
@ -6404,6 +6461,8 @@ extern "C" {
/**
\brief Return the number of builtin probes available in Z3.
\sa Z3_get_probe_name
def_API('Z3_get_num_probes', UINT, (_in(CONTEXT),))
*/
unsigned Z3_API Z3_get_num_probes(Z3_context c);
@ -6413,6 +6472,8 @@ extern "C" {
\pre i < Z3_get_num_probes(c)
\sa Z3_get_num_probes
def_API('Z3_get_probe_name', STRING, (_in(CONTEXT), _in(UINT)))
*/
Z3_string Z3_API Z3_get_probe_name(Z3_context c, unsigned i);
@ -6456,6 +6517,8 @@ extern "C" {
/**
\brief Apply tactic \c t to the goal \c g.
\sa Z3_tactic_apply_ex
def_API('Z3_tactic_apply', APPLY_RESULT, (_in(CONTEXT), _in(TACTIC), _in(GOAL)))
*/
Z3_apply_result Z3_API Z3_tactic_apply(Z3_context c, Z3_tactic t, Z3_goal g);
@ -6463,6 +6526,8 @@ extern "C" {
/**
\brief Apply tactic \c t to the goal \c g using the parameter set \c p.
\sa Z3_tactic_apply
def_API('Z3_tactic_apply_ex', APPLY_RESULT, (_in(CONTEXT), _in(TACTIC), _in(GOAL), _in(PARAMS)))
*/
Z3_apply_result Z3_API Z3_tactic_apply_ex(Z3_context c, Z3_tactic t, Z3_goal g, Z3_params p);
@ -6491,6 +6556,8 @@ extern "C" {
/**
\brief Return the number of subgoals in the \c Z3_apply_result object returned by #Z3_tactic_apply.
\sa Z3_apply_result_get_subgoal
def_API('Z3_apply_result_get_num_subgoals', UINT, (_in(CONTEXT), _in(APPLY_RESULT)))
*/
unsigned Z3_API Z3_apply_result_get_num_subgoals(Z3_context c, Z3_apply_result r);
@ -6500,6 +6567,8 @@ extern "C" {
\pre i < Z3_apply_result_get_num_subgoals(c, r)
\sa Z3_apply_result_get_num_subgoals
def_API('Z3_apply_result_get_subgoal', GOAL, (_in(CONTEXT), _in(APPLY_RESULT), _in(UINT)))
*/
Z3_goal Z3_API Z3_apply_result_get_subgoal(Z3_context c, Z3_apply_result r, unsigned i);
@ -6542,6 +6611,10 @@ extern "C" {
\remark User must use #Z3_solver_inc_ref and #Z3_solver_dec_ref to manage solver objects.
Even if the context was created using #Z3_mk_context instead of #Z3_mk_context_rc.
\sa Z3_mk_simple_solver
\sa Z3_mk_solver_for_logic
\sa Z3_mk_solver_from_tactic
def_API('Z3_mk_solver', SOLVER, (_in(CONTEXT),))
*/
Z3_solver Z3_API Z3_mk_solver(Z3_context c);
@ -6569,6 +6642,10 @@ extern "C" {
\remark User must use #Z3_solver_inc_ref and #Z3_solver_dec_ref to manage solver objects.
Even if the context was created using #Z3_mk_context instead of #Z3_mk_context_rc.
\sa Z3_mk_solver
\sa Z3_mk_solver_for_logic
\sa Z3_mk_solver_from_tactic
def_API('Z3_mk_simple_solver', SOLVER, (_in(CONTEXT),))
*/
Z3_solver Z3_API Z3_mk_simple_solver(Z3_context c);
@ -6580,6 +6657,10 @@ extern "C" {
\remark User must use #Z3_solver_inc_ref and #Z3_solver_dec_ref to manage solver objects.
Even if the context was created using #Z3_mk_context instead of #Z3_mk_context_rc.
\sa Z3_mk_solver
\sa Z3_mk_simple_solver
\sa Z3_mk_solver_from_tactic
def_API('Z3_mk_solver_for_logic', SOLVER, (_in(CONTEXT), _in(SYMBOL)))
*/
Z3_solver Z3_API Z3_mk_solver_for_logic(Z3_context c, Z3_symbol logic);
@ -6592,6 +6673,10 @@ extern "C" {
\remark User must use #Z3_solver_inc_ref and #Z3_solver_dec_ref to manage solver objects.
Even if the context was created using #Z3_mk_context instead of #Z3_mk_context_rc.
\sa Z3_mk_solver
\sa Z3_mk_simple_solver
\sa Z3_mk_solver_for_logic
def_API('Z3_mk_solver_from_tactic', SOLVER, (_in(CONTEXT), _in(TACTIC)))
*/
Z3_solver Z3_API Z3_mk_solver_from_tactic(Z3_context c, Z3_tactic t);
@ -6899,7 +6984,7 @@ extern "C" {
/**
Create uninterpreted function declaration for the user propagator.
When expressions using the function are created by the solver invoke a callback
to \ref \Z3_solver_propagate_created with arguments
to \ref Z3_solver_propagate_created with arguments
1. context and callback solve
2. declared_expr: expression using function that was used as the top-level symbol
3. declared_id: a unique identifier (unique within the current scope) to track the expression.

View file

@ -16,6 +16,8 @@ Author:
Notes:
--*/
#pragma once
#include "util/symbol.h"
void R();

View file

@ -3,7 +3,7 @@
Copyright (c) 2015 Microsoft Corporation
--*/
#pragma once
#ifndef Z3_API
# ifdef __GNUC__

View file

@ -107,7 +107,6 @@ class array_decl_plugin : public decl_plugin {
bool is_array_sort(sort* s) const;
public:
array_decl_plugin();
~array_decl_plugin() override {}
decl_plugin * mk_fresh() override {
return alloc(array_decl_plugin);

View file

@ -1429,7 +1429,7 @@ ast_manager::~ast_manager() {
}
m_plugins.reset();
while (!m_ast_table.empty()) {
DEBUG_CODE(IF_VERBOSE(0, verbose_stream() << "ast_manager LEAKED: " << m_ast_table.size() << std::endl););
DEBUG_CODE(IF_VERBOSE(1, verbose_stream() << "ast_manager LEAKED: " << m_ast_table.size() << std::endl););
ptr_vector<ast> roots;
ast_mark mark;
for (ast * n : m_ast_table) {
@ -1465,22 +1465,21 @@ ast_manager::~ast_manager() {
break;
}
}
for (ast * n : m_ast_table) {
if (!mark.is_marked(n)) {
for (ast * n : m_ast_table)
if (!mark.is_marked(n))
roots.push_back(n);
}
}
SASSERT(!roots.empty());
for (unsigned i = 0; i < roots.size(); ++i) {
ast* a = roots[i];
DEBUG_CODE(
std::cout << "Leaked: ";
if (is_sort(a)) {
std::cout << to_sort(a)->get_name() << "\n";
}
else {
std::cout << mk_ll_pp(a, *this, false) << "id: " << a->get_id() << "\n";
});
IF_VERBOSE(1,
verbose_stream() << "Leaked: ";
if (is_sort(a))
verbose_stream() << to_sort(a)->get_name() << "\n";
else
verbose_stream() << mk_ll_pp(a, *this, false) << "id: " << a->get_id() << "\n";
););
a->m_ref_count = 0;
delete_node(a);
}

View file

@ -26,7 +26,6 @@ class simple_ast_printer_context : public ast_printer_context {
smt2_pp_environment_dbg & env() const { return *(m_env.get()); }
public:
simple_ast_printer_context(ast_manager & m):m_manager(m) { m_env = alloc(smt2_pp_environment_dbg, m); }
~simple_ast_printer_context() override {}
ast_manager & m() const { return m_manager; }
ast_manager & get_ast_manager() override { return m_manager; }
void display(std::ostream & out, sort * s, unsigned indent = 0) const override { out << mk_ismt2_pp(s, m(), indent); }

View file

@ -45,7 +45,6 @@ public:
class ast_printer_context : public ast_printer {
public:
~ast_printer_context() override {}
virtual ast_manager & get_ast_manager() = 0;
virtual std::ostream & regular_stream();
virtual std::ostream & diagnostic_stream();

View file

@ -241,7 +241,6 @@ protected:
public:
bv_decl_plugin();
~bv_decl_plugin() override {}
void finalize() override;
decl_plugin * mk_fresh() override { return alloc(bv_decl_plugin); }

View file

@ -101,7 +101,6 @@ namespace datalog {
public:
dl_decl_plugin();
~dl_decl_plugin() override {}
decl_plugin * mk_fresh() override { return alloc(dl_decl_plugin); }

View file

@ -52,8 +52,6 @@ namespace format_ns {
m_line_break_ext("cr++") {
}
~format_decl_plugin() override {}
void finalize() override {
if (m_format_sort)
m_manager->dec_ref(m_format_sort);

View file

@ -239,7 +239,6 @@ class fpa2bv_converter_wrapped : public fpa2bv_converter {
fpa2bv_converter_wrapped(ast_manager & m, th_rewriter& rw) :
fpa2bv_converter(m),
m_rw(rw) {}
virtual ~fpa2bv_converter_wrapped() {}
void mk_const(func_decl * f, expr_ref & result) override;
void mk_rm_const(func_decl * f, expr_ref & result) override;
app_ref wrap(expr * e);

View file

@ -77,9 +77,6 @@ public:
m_rw(m, m.proofs_enabled(), m_cfg) {
}
~name_exprs_core() override {
}
void operator()(expr * n, expr_ref_vector & new_defs, proof_ref_vector & new_def_proofs, expr_ref & r, proof_ref & p) override {
m_cfg.m_def_exprs = &new_defs;
m_cfg.m_def_proofs = &new_def_proofs;
@ -113,9 +110,6 @@ public:
name_exprs_core(m, n, m_pred),
m_pred(m) {
}
~name_quantifier_labels() override {
}
};
name_exprs * mk_quantifier_label_namer(ast_manager & m, defined_names & n) {
@ -145,9 +139,6 @@ public:
m_pred(m) {
}
~name_nested_formulas() override {
}
void operator()(expr * n, expr_ref_vector & new_defs, proof_ref_vector & new_def_proofs, expr_ref & r, proof_ref & p) override {
m_pred.m_root = n;
TRACE("name_exprs", tout << "operator()\n";);

View file

@ -52,7 +52,6 @@ class pb_decl_plugin : public decl_plugin {
func_decl * mk_eq(unsigned arity, rational const* coeffs, int k);
public:
pb_decl_plugin();
~pb_decl_plugin() override {}
sort * mk_sort(decl_kind k, unsigned num_parameters, parameter const * parameters) override {
UNREACHABLE();

View file

@ -52,8 +52,6 @@ class proof_checker {
public:
hyp_decl_plugin();
~hyp_decl_plugin() override {}
void finalize() override;
decl_plugin * mk_fresh() override { return alloc(hyp_decl_plugin); }

View file

@ -16,6 +16,8 @@ Author:
Revision History:
--*/
#pragma once
#include "util/rational.h"
#include "util/common_msgs.h"
#include "ast/rewriter/bit_blaster/bit_blaster_tpl.h"

View file

@ -68,8 +68,6 @@ public:
rewriter_tpl<elim_bounds_cfg>(m, m.proofs_enabled(), m_cfg),
m_cfg(m)
{}
~elim_bounds_rw() override {}
};

View file

@ -129,8 +129,6 @@ public:
m_r(m, p) {
}
~th_rewriter2expr_replacer() override {}
ast_manager & m() const override { return m_r.m(); }
void set_substitution(expr_substitution * s) override { m_r.set_substitution(s); }

View file

@ -16,6 +16,7 @@ Author:
Notes:
--*/
#pragma once
#include "util/container_util.h"
#include "ast/rewriter/poly_rewriter.h"

View file

@ -49,7 +49,6 @@ protected:
bool is_target(func_decl * decl, unsigned num_args, expr * const * args) override;
public:
ng_push_app_ite_cfg(ast_manager& m): push_app_ite_cfg(m) {}
virtual ~ng_push_app_ite_cfg() {}
};
struct push_app_ite_rw : public rewriter_tpl<push_app_ite_cfg> {

View file

@ -32,7 +32,6 @@ class recfun_replace : public recfun::replace {
expr_safe_replace m_replace;
public:
recfun_replace(ast_manager& m): m(m), m_replace(m) {}
~recfun_replace() override {}
void reset() override { m_replace.reset(); }
void insert(expr* s, expr* t) override { m_replace.insert(s, t); }
expr_ref operator()(expr* e) override { expr_ref r(m); m_replace(e, r); return r; }

View file

@ -16,6 +16,8 @@ Author:
Notes:
--*/
#pragma once
#include "ast/rewriter/rewriter.h"
#include "ast/ast_smt2_pp.h"
#include "ast/ast_ll_pp.h"

View file

@ -1107,6 +1107,31 @@ unsigned seq_util::rex::max_length(expr* r) const {
return UINT_MAX;
}
/**
\brief determine if \c n is a range regular expression where the lower and upper bounds
are given by single characters.
Range expressions where lower and upper bounds are not single characters are either
the empty language (when a bound is a string but not a single character) or symbolic
(when both bounds are not ground strings). The general is_range can be used to process
range expressions for these cases, but they don't correspond to mainstream regex usage.
*/
bool seq_util::rex::is_range(expr const* n, unsigned& lo, unsigned& hi) const {
expr* _lo, *_hi;
zstring los, his;
if (!is_range(n, _lo, _hi))
return false;
if (!u.str.is_string(_lo, los))
return false;
if (!u.str.is_string(_hi, his))
return false;
if (los.length() != 1 || his.length() != 1)
return false;
lo = los[0];
hi = his[0];
return true;
}
sort* seq_util::rex::to_seq(sort* re) {
(void)u;
SASSERT(u.is_re(re));

View file

@ -545,6 +545,7 @@ public:
bool is_plus(expr const* n) const { return is_app_of(n, m_fid, OP_RE_PLUS); }
bool is_opt(expr const* n) const { return is_app_of(n, m_fid, OP_RE_OPTION); }
bool is_range(expr const* n) const { return is_app_of(n, m_fid, OP_RE_RANGE); }
bool is_range(expr const* n, unsigned& lo, unsigned& hi) const;
bool is_loop(expr const* n) const { return is_app_of(n, m_fid, OP_RE_LOOP); }
bool is_empty(expr const* n) const { return is_app_of(n, m_fid, OP_RE_EMPTY_SET); }
bool is_full_char(expr const* n) const { return is_app_of(n, m_fid, OP_RE_FULL_CHAR_SET); }

View file

@ -40,8 +40,6 @@ class special_relations_decl_plugin : public decl_plugin {
public:
special_relations_decl_plugin();
~special_relations_decl_plugin() override {}
decl_plugin * mk_fresh() override {
return alloc(special_relations_decl_plugin);
}

View file

@ -99,7 +99,7 @@ public:
datatype_value_generator(value_generator& g, ast_manager& m):
m(m), g(g), dt(m), m_sorts(m) {}
~datatype_value_generator() {
~datatype_value_generator() override {
for (auto& kv : m_values) dealloc(kv.m_value);
}

View file

@ -379,8 +379,6 @@ public:
m_int_real_coercions(":int-real-coercions"),
m_reproducible_resource_limit(":reproducible-resource-limit") {
}
~set_get_option_cmd() override {}
};
class set_option_cmd : public set_get_option_cmd {

View file

@ -493,7 +493,6 @@ protected:
public:
pp_env(cmd_context & o):m_owner(o), m_autil(o.m()), m_bvutil(o.m()), m_arutil(o.m()), m_futil(o.m()), m_sutil(o.m()), m_dtutil(o.m()), m_dlutil(o.m()) {}
~pp_env() override {}
ast_manager & get_manager() const override { return m_owner.m(); }
arith_util & get_autil() override { return m_autil; }
bv_util & get_bvutil() override { return m_bvutil; }

View file

@ -15,6 +15,7 @@ Author:
Notes:
--*/
#pragma once
class cmd_context;

View file

@ -147,7 +147,6 @@ class psort_sort : public psort {
sort * get_sort() const { return m_sort; }
sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s) override { return m_sort; }
public:
~psort_sort() override {}
bool is_sort_wrapper() const override { return true; }
char const * hcons_kind() const override { return "psort_sort"; }
unsigned hcons_hash() const override { return m_sort->get_id(); }
@ -171,7 +170,6 @@ class psort_var : public psort {
}
size_t obj_size() const override { return sizeof(psort_var); }
public:
~psort_var() override {}
char const * hcons_kind() const override { return "psort_var"; }
unsigned hcons_hash() const override { return hash_u_u(m_num_params, m_idx); }
bool hcons_eq(psort const * other) const override {
@ -233,7 +231,6 @@ class psort_app : public psort {
}
public:
~psort_app() override {}
char const * hcons_kind() const override { return "psort_app"; }
unsigned hcons_hash() const override {
return get_composite_hash<psort_app*, khasher, chasher>(const_cast<psort_app*>(this), m_args.size());
@ -800,8 +797,6 @@ struct pdecl_manager::app_sort_info : public pdecl_manager::sort_info {
m.m().inc_array_ref(n, s);
}
~app_sort_info() override {}
unsigned obj_size() const override { return sizeof(app_sort_info); }
void finalize(pdecl_manager & m) override {
@ -843,8 +838,6 @@ struct pdecl_manager::indexed_sort_info : public pdecl_manager::sort_info {
m_indices(n, s) {
}
~indexed_sort_info() override {}
unsigned obj_size() const override { return sizeof(indexed_sort_info); }
void display(std::ostream & out, pdecl_manager const & m) const override {

View file

@ -66,7 +66,6 @@ protected:
psort(unsigned id, unsigned num_params):pdecl(id, num_params), m_inst_cache(nullptr) {}
bool is_psort() const override { return true; }
void finalize(pdecl_manager & m) override;
~psort() override {}
virtual void cache(pdecl_manager & m, sort * const * s, sort * r);
virtual sort * find(sort * const * s) const;
public:
@ -98,7 +97,6 @@ protected:
sort * find(sort * const * s);
psort_decl(unsigned id, unsigned num_params, pdecl_manager & m, symbol const & n);
void finalize(pdecl_manager & m) override;
~psort_decl() override {}
public:
virtual sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s) = 0;
virtual sort * instantiate(pdecl_manager & m, unsigned n, unsigned const * s) { return nullptr; }
@ -120,7 +118,6 @@ protected:
psort_user_decl(unsigned id, unsigned num_params, pdecl_manager & m, symbol const & n, psort * p);
size_t obj_size() const override { return sizeof(psort_user_decl); }
void finalize(pdecl_manager & m) override;
~psort_user_decl() override {}
public:
sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s) override;
std::ostream& display(std::ostream & out) const override;
@ -133,7 +130,6 @@ protected:
decl_kind m_kind;
psort_builtin_decl(unsigned id, pdecl_manager & m, symbol const & n, family_id fid, decl_kind k);
size_t obj_size() const override { return sizeof(psort_builtin_decl); }
~psort_builtin_decl() override {}
public:
sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s) override;
sort * instantiate(pdecl_manager & m, unsigned n, unsigned const * s) override;
@ -145,7 +141,6 @@ protected:
friend class pdecl_manager;
psort_dt_decl(unsigned id, unsigned num_params, pdecl_manager & m, symbol const & n);
size_t obj_size() const override { return sizeof(psort_dt_decl); }
~psort_dt_decl() override {}
public:
sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s) override;
std::ostream& display(std::ostream & out) const override;
@ -196,7 +191,6 @@ class paccessor_decl : public pdecl {
accessor_decl * instantiate_decl(pdecl_manager & m, unsigned n, sort * const * s);
symbol const & get_name() const { return m_name; }
ptype const & get_type() const { return m_type; }
~paccessor_decl() override {}
public:
std::ostream& display(std::ostream & out) const override { pdecl::display(out); return out; }
void display(std::ostream & out, pdatatype_decl const * const * dts) const;
@ -217,7 +211,6 @@ class pconstructor_decl : public pdecl {
symbol const & get_name() const { return m_name; }
symbol const & get_recognizer_name() const { return m_recogniser_name; }
constructor_decl * instantiate_decl(pdecl_manager & m, unsigned n, sort * const * s);
~pconstructor_decl() override {}
public:
std::ostream& display(std::ostream & out) const override { pdecl::display(out); return out; }
void display(std::ostream & out, pdatatype_decl const * const * dts) const;
@ -234,7 +227,6 @@ class pdatatype_decl : public psort_decl {
size_t obj_size() const override { return sizeof(pdatatype_decl); }
bool fix_missing_refs(dictionary<int> const & symbol2idx, symbol & missing);
datatype_decl * instantiate_decl(pdecl_manager & m, unsigned n, sort * const * s);
~pdatatype_decl() override {}
public:
sort * instantiate(pdecl_manager & m, unsigned n, sort * const * s) override;
std::ostream& display(std::ostream & out) const override;
@ -255,7 +247,6 @@ class pdatatypes_decl : public pdecl {
size_t obj_size() const override { return sizeof(pdatatypes_decl); }
bool fix_missing_refs(symbol & missing);
bool instantiate(pdecl_manager & m, sort * const * s);
~pdatatypes_decl() override {}
public:
pdatatype_decl const * const * children() const { return m_datatypes.data(); }
pdatatype_decl * const * begin() const { return m_datatypes.begin(); }

View file

@ -46,10 +46,7 @@ public:
p.insert("print_proofs", CPK_BOOL, "(default: false) print a proof showing the original term is equal to the resultant one.");
p.insert("print_statistics", CPK_BOOL, "(default: false) print statistics.");
}
~simplify_cmd() override {
}
void prepare(cmd_context & ctx) override {
parametric_cmd::prepare(ctx);
m_target = nullptr;

View file

@ -38,7 +38,6 @@ public:
template<class T>
class boolean_algebra : public positive_boolean_algebra<T> {
public:
~boolean_algebra() override {}
virtual T mk_not(T x) = 0;
};

View file

@ -17,6 +17,8 @@ Author:
Revision History:
--*/
#pragma once
#include "math/dd/dd_pdd.h"
namespace dd {

View file

@ -17,6 +17,8 @@ Author:
Revision History:
--*/
#pragma once
#include "math/dd/dd_pdd.h"
#include "math/interval/dep_intervals.h"

View file

@ -80,7 +80,6 @@ class heap_trie {
Value m_value;
public:
leaf(): node(leaf_t) {}
~leaf() override {}
Value const& get_value() const { return m_value; }
void set_value(Value const& v) { m_value = v; }
void display(std::ostream& out, unsigned indent) const override {
@ -98,9 +97,6 @@ class heap_trie {
public:
trie(): node(trie_t) {}
~trie() override {
}
node* find_or_insert(Key k, node* n) {
for (unsigned i = 0; i < m_nodes.size(); ++i) {
if (m_nodes[i].first == k) {

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include "util/vector.h"
#include "math/lp/binary_heap_priority_queue.h"
namespace lp {

View file

@ -17,6 +17,7 @@ Revision History:
--*/
#pragma once
#include <set>
#include "math/lp/lp_utils.h"

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include <limits>
#include <string>
#include <algorithm>

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include "math/lp/lp_settings.h"
#ifdef Z3DEBUG
#include "util/vector.h"

View file

@ -28,8 +28,8 @@ namespace nla {
const monic& m_rm;
factorization_factory_imp(const monic& rm, const core& s);
bool find_canonical_monic_of_vars(const svector<lpvar>& vars, unsigned & i) const;
virtual bool canonize_sign(const monic& m) const;
virtual bool canonize_sign(const factorization& m) const;
bool find_canonical_monic_of_vars(const svector<lpvar>& vars, unsigned & i) const override;
bool canonize_sign(const monic& m) const override;
bool canonize_sign(const factorization& m) const override;
};
}

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include "util/vector.h"
#include "math/lp/indexed_vector.h"
#include "math/lp/lp_settings.h"

View file

@ -9,6 +9,8 @@ Revision History:
--*/
#pragma once
#include <string>
#include "util/vector.h"
#include "math/lp/lar_core_solver.h"

View file

@ -543,7 +543,7 @@ public:
void get_model(std::unordered_map<var_index, mpq> & variable_values) const;
void get_rid_of_inf_eps();
void get_model_do_not_care_about_diff_vars(std::unordered_map<var_index, mpq> & variable_values) const;
std::string get_variable_name(var_index vi) const;
std::string get_variable_name(var_index vi) const override;
void set_variable_name(var_index vi, std::string);
inline unsigned number_of_vars() const { return m_var_register.size(); }
inline bool is_base(unsigned j) const { return m_mpq_lar_core_solver.m_r_heading[j] >= 0; }
@ -651,7 +651,7 @@ public:
lar_solver();
void set_track_pivoted_rows(bool v);
bool get_track_pivoted_rows() const;
virtual ~lar_solver();
~lar_solver() override;
const vector<impq>& r_x() const { return m_mpq_lar_core_solver.m_r_x; }
bool column_is_int(unsigned j) const;
inline bool column_value_is_int(unsigned j) const { return m_mpq_lar_core_solver.m_r_x[j].is_int(); }

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include <set>
#include <string>
#include "util/vector.h"

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include <algorithm>
#include <string>
#include "util/vector.h"

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include "math/lp/lp_dual_simplex.h"
namespace lp{

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include <list>
#include "util/vector.h"
#include <fstream>

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
// this is a part of lp_primal_core_solver that deals with the tableau
#include "math/lp/lp_primal_core_solver.h"
namespace lp {

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include <string>
#include "util/vector.h"
#include "math/lp/lp_primal_simplex.h"

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include <cmath>
#include <string>
#include "util/vector.h"

View file

@ -149,7 +149,7 @@ public:
}
virtual ~lp_solver();
~lp_solver() override;
void flip_costs();

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include <string>
#include <algorithm>
#include "util/vector.h"

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include <string>
#include <algorithm>
#include <set>

View file

@ -17,6 +17,7 @@ Revision History:
--*/
#pragma once
#include <cmath>
#include <string>

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include "util/vector.h"
#include "math/lp/permutation_matrix.h"
namespace lp {

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include "math/lp/random_updater.h"
#include "math/lp/static_matrix.h"
#include "math/lp/lar_solver.h"

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include "util/vector.h"
#include "math/lp/row_eta_matrix.h"
namespace lp {

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include <algorithm>
#include "math/lp/scaler.h"
#include "math/lp/numeric_pair.h"

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include "util/vector.h"
#include "math/lp/square_dense_submatrix.h"
namespace lp {

View file

@ -17,6 +17,7 @@ Revision History:
--*/
#pragma once
#include "util/vector.h"
#include "math/lp/square_sparse_matrix.h"

View file

@ -17,6 +17,8 @@ Revision History:
--*/
#pragma once
#include "util/vector.h"
#include <utility>
#include <set>

View file

@ -38,7 +38,6 @@ namespace subpaving {
CTX m_ctx;
public:
context_wrapper(reslimit& lim, typename CTX::numeral_manager & m, params_ref const & p, small_object_allocator * a):m_ctx(lim, m, p, a) {}
~context_wrapper() override {}
unsigned num_vars() const override { return m_ctx.num_vars(); }
var mk_var(bool is_int) override { return m_ctx.mk_var(is_int); }
bool is_int(var x) const override { return m_ctx.is_int(x); }
@ -66,8 +65,6 @@ namespace subpaving {
m_as(m)
{}
~context_mpq_wrapper() override {}
unsynch_mpq_manager & qm() const override { return m_ctx.nm(); }
var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) override {
@ -108,8 +105,6 @@ namespace subpaving {
m_q2(m_qm) {
}
~context_mpf_wrapper() override {}
unsynch_mpq_manager & qm() const override { return m_qm; }
var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) override {
@ -165,8 +160,6 @@ namespace subpaving {
m_qm(qm) {
}
~context_hwf_wrapper() override {}
unsynch_mpq_manager & qm() const override { return m_qm; }
var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) override {
@ -223,8 +216,6 @@ namespace subpaving {
m_z2(m_qm) {
}
~context_fpoint_wrapper() override {}
unsynch_mpq_manager & qm() const override { return m_qm; }
var mk_sum(mpz const & c, unsigned sz, mpz const * as, var const * xs) override {

View file

@ -16,6 +16,8 @@ Author:
Revision History:
--*/
#pragma once
#include "math/subpaving/subpaving_t.h"
#include "math/interval/interval_def.h"
#include "util/buffer.h"

View file

@ -37,8 +37,6 @@ class subpaving_tactic : public tactic {
e2v.mk_inv(m_inv);
}
virtual ~display_var_proc() {}
ast_manager & m() const { return m_inv.get_manager(); }
void operator()(std::ostream & out, subpaving::var x) const override {

View file

@ -32,8 +32,6 @@ class array_factory : public struct_factory {
public:
array_factory(ast_manager & m, model_core & md);
~array_factory() override {}
expr * get_some_value(sort * s) override;
bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override;

View file

@ -32,7 +32,6 @@ class datatype_factory : public struct_factory {
public:
datatype_factory(ast_manager & m, model_core & md);
~datatype_factory() override {}
expr * get_some_value(sort * s) override;
expr * get_fresh_value(sort * s) override;
};

View file

@ -34,8 +34,6 @@ class fpa_value_factory : public value_factory {
value_factory(m, fid),
m_util(m) {}
~fpa_value_factory() override {}
expr * get_some_value(sort * s) override {
mpf_manager & mpfm = m_util.fm();

View file

@ -25,7 +25,6 @@ Revision History:
class numeral_factory : public simple_factory<rational> {
public:
numeral_factory(ast_manager & m, family_id fid):simple_factory<rational>(m, fid) {}
~numeral_factory() override {}
};
class arith_factory : public numeral_factory {

View file

@ -230,7 +230,6 @@ class user_sort_factory : public simple_factory<unsigned> {
app * mk_value_core(unsigned const & val, sort * s) override;
public:
user_sort_factory(ast_manager & m);
~user_sort_factory() override {}
/**
\brief Make the universe of \c s finite, by preventing new

View file

@ -3,6 +3,7 @@
Copyright (c) 2015 Microsoft Corporation
--*/
#pragma once
/**

View file

@ -159,8 +159,6 @@ namespace datalog {
public:
restore_rules(context& ctx, rule_set& r): ctx(ctx), m_old_rules(alloc(rule_set, r)) {}
~restore_rules() override {}
void undo() override {
ctx.replace_rules(*m_old_rules);
reset();
@ -173,7 +171,6 @@ namespace datalog {
unsigned m_old_size;
public:
restore_vec_size_trail(Vec& v): m_vector(v), m_old_size(v.size()) {}
~restore_vec_size_trail() override {}
void undo() override { m_vector.shrink(m_old_size); }
};

View file

@ -105,7 +105,6 @@ namespace datalog {
class rel_context_base : public engine_base {
public:
rel_context_base(ast_manager& m, char const* name): engine_base(m, name) {}
~rel_context_base() override {}
virtual relation_manager & get_rmanager() = 0;
virtual const relation_manager & get_rmanager() const = 0;
virtual relation_base & get_relation(func_decl * pred) = 0;
@ -141,7 +140,6 @@ namespace datalog {
context const& ctx;
public:
contains_pred(context& ctx): ctx(ctx) {}
~contains_pred() override {}
bool operator()(expr* e) override {
return ctx.is_predicate(e);

View file

@ -190,7 +190,6 @@ namespace datalog {
const unsigned * cols1, const unsigned * cols2)
: convenient_join_fn(o1_sig, o2_sig, col_cnt, cols1, cols2), m_join(j)
{}
~join_fn() override {}
relation_base * operator()(const relation_base & r1, const relation_base & r2) override {
check_relation const& t1 = get(r1);
check_relation const& t2 = get(r2);
@ -219,7 +218,6 @@ namespace datalog {
: convenient_join_project_fn(o1_sig, o2_sig, col_cnt, cols1, cols2,
removed_col_cnt, removed_cols), m_join(j)
{}
~join_project_fn() override {}
relation_base * operator()(const relation_base & r1, const relation_base & r2) override {
check_relation const& t1 = get(r1);
check_relation const& t2 = get(r2);
@ -527,8 +525,6 @@ namespace datalog {
m_filter(f) {
}
~filter_identical_fn() override {}
void operator()(relation_base & _r) override {
check_relation& r = get(_r);
check_relation_plugin& p = r.get_plugin();
@ -563,8 +559,6 @@ namespace datalog {
m_condition(condition) {
}
~filter_interpreted_fn() override {}
void operator()(relation_base & tb) override {
check_relation& r = get(tb);
check_relation_plugin& p = r.get_plugin();
@ -590,8 +584,6 @@ namespace datalog {
m_project(p) {
}
~project_fn() override {}
relation_base * operator()(const relation_base & tb) override {
check_relation const& t = get(tb);
check_relation_plugin& p = t.get_plugin();
@ -618,8 +610,6 @@ namespace datalog {
m_permute(permute) {
}
~rename_fn() override {}
relation_base * operator()(const relation_base & _t) override {
check_relation const& t = get(_t);
check_relation_plugin& p = t.get_plugin();
@ -647,7 +637,6 @@ namespace datalog {
m_val(val),
m_col(col)
{}
~filter_equal_fn() override { }
void operator()(relation_base & tb) override {
check_relation & t = get(tb);
check_relation_plugin& p = t.get_plugin();
@ -760,8 +749,6 @@ namespace datalog {
m_cond(cond),
m_xform(xform)
{}
~filter_proj_fn() override {}
relation_base* operator()(const relation_base & tb) override {
check_relation const & t = get(tb);

View file

@ -799,7 +799,6 @@ namespace datalog {
protected:
relation_base(relation_plugin & plugin, const relation_signature & s)
: base_ancestor(plugin, s) {}
~relation_base() override {}
public:
virtual relation_base * complement(func_decl* p) const = 0;
@ -1040,7 +1039,6 @@ namespace datalog {
protected:
table_base(table_plugin & plugin, const table_signature & s)
: base_ancestor(plugin, s) {}
~table_base() override {}
public:
table_base * clone() const override;
virtual table_base * complement(func_decl* p, const table_element * func_columns = nullptr) const;

View file

@ -794,8 +794,6 @@ namespace datalog {
m_delta_indexes(delta_indexes),
m_delta_rels(delta_rels) {}
~union_mapper() override {}
bool operator()(table_element * func_columns) override {
relation_base & otgt_orig = m_tgt.get_inner_rel(func_columns[0]);
const relation_base & osrc = m_src.get_inner_rel(func_columns[1]);

View file

@ -128,8 +128,6 @@ namespace datalog {
m_ref(t)
{}
~lazy_table() override {}
lazy_table_plugin& get_lplugin() const {
return dynamic_cast<lazy_table_plugin&>(table_base::get_plugin());
}
@ -164,7 +162,6 @@ namespace datalog {
m_table = table;
// SASSERT(&p.m_plugin == &table->get_lplugin());
}
~lazy_table_base() override {}
lazy_table_kind kind() const override { return LAZY_TABLE_BASE; }
table_base* force() override { return m_table.get(); }
};
@ -183,7 +180,6 @@ namespace datalog {
m_cols2(col_cnt, cols2),
m_t1(t1.get_ref()),
m_t2(t2.get_ref()) { }
~lazy_table_join() override {}
lazy_table_kind kind() const override { return LAZY_TABLE_JOIN; }
unsigned_vector const& cols1() const { return m_cols1; }
unsigned_vector const& cols2() const { return m_cols2; }
@ -201,7 +197,6 @@ namespace datalog {
: lazy_table_ref(src.get_lplugin(), sig),
m_cols(col_cnt, cols),
m_src(src.get_ref()) {}
~lazy_table_project() override {}
lazy_table_kind kind() const override { return LAZY_TABLE_PROJECT; }
unsigned_vector const& cols() const { return m_cols; }
@ -217,8 +212,7 @@ namespace datalog {
: lazy_table_ref(src.get_lplugin(), sig),
m_cols(col_cnt, cols),
m_src(src.get_ref()) {}
~lazy_table_rename() override {}
lazy_table_kind kind() const override { return LAZY_TABLE_RENAME; }
unsigned_vector const& cols() const { return m_cols; }
lazy_table_ref* src() const { return m_src.get(); }
@ -231,8 +225,7 @@ namespace datalog {
public:
lazy_table_filter_identical(unsigned col_cnt, const unsigned * cols, lazy_table const& src)
: lazy_table_ref(src.get_lplugin(), src.get_signature()), m_cols(col_cnt, cols), m_src(src.get_ref()) {}
~lazy_table_filter_identical() override {}
lazy_table_kind kind() const override { return LAZY_TABLE_FILTER_IDENTICAL; }
unsigned_vector const& cols() const { return m_cols; }
lazy_table_ref* src() const { return m_src.get(); }
@ -249,8 +242,7 @@ namespace datalog {
m_col(col),
m_value(value),
m_src(src.get_ref()) {}
~lazy_table_filter_equal() override {}
lazy_table_kind kind() const override { return LAZY_TABLE_FILTER_EQUAL; }
unsigned col() const { return m_col; }
table_element value() const { return m_value; }
@ -265,8 +257,7 @@ namespace datalog {
lazy_table_filter_interpreted(lazy_table const& src, app* condition)
: lazy_table_ref(src.get_lplugin(), src.get_signature()),
m_condition(condition, src.get_lplugin().get_ast_manager()), m_src(src.get_ref()) {}
~lazy_table_filter_interpreted() override {}
lazy_table_kind kind() const override { return LAZY_TABLE_FILTER_INTERPRETED; }
app* condition() const { return m_condition; }
lazy_table_ref* src() const { return m_src.get(); }
@ -287,7 +278,6 @@ namespace datalog {
m_src(src.get_ref()),
m_cols1(c1),
m_cols2(c2) {}
~lazy_table_filter_by_negation() override {}
lazy_table_kind kind() const override { return LAZY_TABLE_FILTER_BY_NEGATION; }
lazy_table_ref* tgt() const { return m_tgt.get(); }
lazy_table_ref* src() const { return m_src.get(); }

View file

@ -1589,8 +1589,6 @@ namespace datalog {
m_union_fn = plugin.mk_union_fn(t, *m_aux_table, static_cast<table_base *>(nullptr));
}
~default_table_map_fn() override {}
void operator()(table_base & t) override {
SASSERT(t.get_signature()==m_aux_table->get_signature());
if(!m_aux_table->empty()) {
@ -1644,8 +1642,6 @@ namespace datalog {
m_former_row.resize(get_result_signature().size());
}
~default_table_project_with_reduce_fn() override {}
virtual void modify_fact(table_fact & f) const {
unsigned ofs=1;
unsigned r_i=1;

View file

@ -406,8 +406,6 @@ namespace datalog {
m_key_fact.resize(t.get_signature().size());
}
~full_signature_key_indexer() override {}
query_result get_matching_offsets(const key_value & key) const override {
unsigned key_len = m_key_cols.size();
for (unsigned i=0; i<key_len; i++) {

Some files were not shown because too many files have changed in this diff Show more