3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-09-12 20:51:27 +00:00

Extend spacer with callback events

Callback events allow the client of spacer to
get events during exection. The events include
new lemmas and unfolding.
This commit is contained in:
Matteo 2017-10-05 14:07:11 +02:00 committed by Arie Gurfinkel
parent b51251f394
commit 3c7165780c
12 changed files with 254 additions and 8 deletions

View file

@ -588,6 +588,14 @@ namespace datalog {
rel_context_base* get_rel_context() { ensure_engine(); return m_rel; }
void add_callback(void *state,
const datalog::t_new_lemma_eh new_lemma_eh,
const datalog::t_predecessor_eh predecessor_eh,
const datalog::t_unfold_eh unfold_eh) {
ensure_engine();
m_engine->add_callback(state, new_lemma_eh, predecessor_eh, unfold_eh);
}
private:
/**

View file

@ -36,6 +36,10 @@ namespace datalog {
LAST_ENGINE
};
typedef void (*t_new_lemma_eh)(void *state, expr *lemma, unsigned level);
typedef void (*t_predecessor_eh)(void *state);
typedef void (*t_unfold_eh)(void *state);
class engine_base {
ast_manager& m;
std::string m_name;
@ -102,6 +106,12 @@ namespace datalog {
virtual proof_ref get_proof() {
return proof_ref(m.mk_asserted(m.mk_true()), m);
}
virtual void add_callback(void *state,
const t_new_lemma_eh new_lemma_eh,
const t_predecessor_eh predecessor_eh,
const t_unfold_eh unfold_eh) {
throw default_exception(std::string("add_lemma_exchange_callbacks is not supported for ") + m_name);
}
virtual void updt_params() {}
virtual void cancel() {}
virtual void cleanup() {}

View file

@ -190,7 +190,9 @@ def_module_params('fixedpoint',
('spacer.simplify_pob', BOOL, False, 'simplify POBs by removing redundant constraints'),
('spacer.use_quant_generalizer', BOOL, False, 'use quantified lemma generalizer'),
('spacer.quic_gen_normalize', BOOL, True, 'normalize cube before quantified generalization'),
))
('spacer.share_lemmas', BOOL, False, "Share frame lemmas"),
('spacer.share_invariants', BOOL, False, "Share invariants lemmas"),
))