mirror of
https://github.com/Z3Prover/z3
synced 2025-04-25 01:55:32 +00:00
introducing base namespace for user propagator
This commit is contained in:
parent
c083aa82ee
commit
5857236f2f
14 changed files with 189 additions and 172 deletions
|
@ -18,6 +18,7 @@ Notes:
|
|||
--*/
|
||||
#pragma once
|
||||
|
||||
#include "tactic/user_propagator_base.h"
|
||||
#include "solver/check_sat_result.h"
|
||||
#include "solver/progress_callback.h"
|
||||
#include "util/params.h"
|
||||
|
@ -47,7 +48,7 @@ solver* mk_smt2_solver(ast_manager& m, params_ref const& p);
|
|||
- statistics
|
||||
- results based on check_sat_result API
|
||||
*/
|
||||
class solver : public check_sat_result {
|
||||
class solver : public check_sat_result, public user_propagator::base{
|
||||
params_ref m_params;
|
||||
symbol m_cancel_backup_file;
|
||||
public:
|
||||
|
@ -239,52 +240,6 @@ public:
|
|||
virtual expr_ref_vector cube(expr_ref_vector& vars, unsigned backtrack_level) = 0;
|
||||
|
||||
|
||||
class propagate_callback {
|
||||
public:
|
||||
virtual ~propagate_callback() = default;
|
||||
virtual void propagate_cb(unsigned num_fixed, unsigned const* fixed_ids, unsigned num_eqs, unsigned const* eq_lhs, unsigned const* eq_rhs, expr* conseq) = 0;
|
||||
};
|
||||
class context_obj {
|
||||
public:
|
||||
virtual ~context_obj() {}
|
||||
};
|
||||
typedef std::function<void(void*, solver::propagate_callback*)> final_eh_t;
|
||||
typedef std::function<void(void*, solver::propagate_callback*, unsigned, expr*)> fixed_eh_t;
|
||||
typedef std::function<void(void*, solver::propagate_callback*, unsigned, unsigned)> eq_eh_t;
|
||||
typedef std::function<void*(void*, ast_manager&, solver::context_obj*&)> fresh_eh_t;
|
||||
typedef std::function<void(void*)> push_eh_t;
|
||||
typedef std::function<void(void*,unsigned)> pop_eh_t;
|
||||
|
||||
virtual void user_propagate_init(
|
||||
void* ctx,
|
||||
push_eh_t& push_eh,
|
||||
pop_eh_t& pop_eh,
|
||||
fresh_eh_t& fresh_eh) {
|
||||
throw default_exception("user-propagators are only supported on the SMT solver");
|
||||
}
|
||||
|
||||
|
||||
virtual void user_propagate_register_fixed(fixed_eh_t& fixed_eh) {
|
||||
throw default_exception("user-propagators are only supported on the SMT solver");
|
||||
}
|
||||
|
||||
virtual void user_propagate_register_final(final_eh_t& final_eh) {
|
||||
throw default_exception("user-propagators are only supported on the SMT solver");
|
||||
}
|
||||
|
||||
virtual void user_propagate_register_eq(eq_eh_t& eq_eh) {
|
||||
throw default_exception("user-propagators are only supported on the SMT solver");
|
||||
}
|
||||
|
||||
virtual void user_propagate_register_diseq(eq_eh_t& diseq_eh) {
|
||||
throw default_exception("user-propagators are only supported on the SMT solver");
|
||||
}
|
||||
|
||||
virtual unsigned user_propagate_register(expr* e) {
|
||||
throw default_exception("user-propagators are only supported on the SMT solver");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Display the content of this solver.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue