3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +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

@ -603,7 +603,22 @@ extern "C" {
Z3_CATCH;
}
void Z3_API Z3_fixedpoint_add_callback(Z3_context c, Z3_fixedpoint d,
void *state,
Z3_fixedpoint_new_lemma_eh new_lemma_eh,
Z3_fixedpoint_predecessor_eh predecessor_eh,
Z3_fixedpoint_unfold_eh unfold_eh){
Z3_TRY;
// not logged
to_fixedpoint_ref(d)->ctx().add_callback(state,
reinterpret_cast<datalog::t_new_lemma_eh>(new_lemma_eh),
reinterpret_cast<datalog::t_predecessor_eh>(predecessor_eh),
reinterpret_cast<datalog::t_unfold_eh>(unfold_eh));
Z3_CATCH;
}
#include "api_datalog_spacer.inc"
};

View file

@ -367,6 +367,16 @@ extern "C" {
void Z3_API Z3_fixedpoint_set_reduce_app_callback(
Z3_context c, Z3_fixedpoint d, Z3_fixedpoint_reduce_app_callback_fptr cb);
typedef void (*Z3_fixedpoint_new_lemma_eh)(void *state, Z3_ast *lemma, unsigned level);
typedef void (*Z3_fixedpoint_predecessor_eh)(void *state);
typedef void (*Z3_fixedpoint_unfold_eh)(void *state);
/** \brief set export callback for lemmas */
void Z3_API Z3_fixedpoint_add_callback(Z3_context ctx, Z3_fixedpoint f, void *state,
Z3_fixedpoint_new_lemma_eh new_lemma_eh,
Z3_fixedpoint_predecessor_eh predecessor_eh,
Z3_fixedpoint_unfold_eh unfold_eh);
/*@}*/
/*@}*/