mirror of
https://github.com/Z3Prover/z3
synced 2025-06-20 12:53:38 +00:00
add API methods for creating and modifying models, #1223
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
3bfc3437f1
commit
ce8443581d
3 changed files with 137 additions and 0 deletions
|
@ -4680,6 +4680,14 @@ extern "C" {
|
|||
|
||||
/** @name Models */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
\brief Create a fresh model object. It has reference count 0.
|
||||
|
||||
def_API('Z3_mk_model', MODEL, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_model Z3_API Z3_mk_model(Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Increment the reference counter of the given model.
|
||||
|
||||
|
@ -4850,6 +4858,26 @@ extern "C" {
|
|||
*/
|
||||
Z3_func_decl Z3_API Z3_get_as_array_func_decl(Z3_context c, Z3_ast a);
|
||||
|
||||
/**
|
||||
\brief Create a fresh func_interp object, add it to a model for a specified function.
|
||||
It has reference count 0.
|
||||
|
||||
\param c context
|
||||
\param m model
|
||||
\param f function declaration
|
||||
\param default_value default value for function interpretation
|
||||
|
||||
def_API('Z3_add_func_interp', FUNC_INTERP, (_in(CONTEXT), _in(MODEL), _in(FUNC_DECL), _in(AST)))
|
||||
*/
|
||||
Z3_func_interp Z3_API Z3_add_func_interp(Z3_context c, Z3_model m, Z3_func_decl f, Z3_ast default_value);
|
||||
|
||||
/**
|
||||
\brief Add a constant interpretation.
|
||||
|
||||
def_API('Z3_add_const_interp', VOID, (_in(CONTEXT), _in(MODEL), _in(FUNC_DECL), _in(AST)))
|
||||
*/
|
||||
void Z3_API Z3_add_const_interp(Z3_context c, Z3_model m, Z3_func_decl f, Z3_ast a);
|
||||
|
||||
/**
|
||||
\brief Increment the reference counter of the given Z3_func_interp object.
|
||||
|
||||
|
@ -4897,6 +4925,16 @@ extern "C" {
|
|||
*/
|
||||
Z3_ast Z3_API Z3_func_interp_get_else(Z3_context c, Z3_func_interp f);
|
||||
|
||||
/**
|
||||
\brief Return the 'else' value of the given function interpretation.
|
||||
|
||||
A function interpretation is represented as a finite map and an 'else' value.
|
||||
This procedure can be used to update the 'else' value.
|
||||
|
||||
def_API('Z3_func_interp_set_else', VOID, (_in(CONTEXT), _in(FUNC_INTERP), _in(AST)))
|
||||
*/
|
||||
void Z3_API Z3_func_interp_set_else(Z3_context c, Z3_func_interp f, Z3_ast else_value);
|
||||
|
||||
/**
|
||||
\brief Return the arity (number of arguments) of the given function interpretation.
|
||||
|
||||
|
@ -4904,6 +4942,22 @@ extern "C" {
|
|||
*/
|
||||
unsigned Z3_API Z3_func_interp_get_arity(Z3_context c, Z3_func_interp f);
|
||||
|
||||
/**
|
||||
\brief add a function entry to a function interpretation.
|
||||
|
||||
\param c logical context
|
||||
\param fi a function interpregation to be updated.
|
||||
\param args list of arguments. They should be constant values (such as integers) and be of the same types as the domain of the function.
|
||||
\param value value of the function when the parameters match args.
|
||||
|
||||
It is assumed that entries added to a function cover disjoint arguments.
|
||||
If an two entries are added with the same arguments, only the second insertion survives and the
|
||||
first inserted entry is removed.
|
||||
|
||||
def_API('Z3_add_func_entry', VOID, (_in(CONTEXT), _in(FUNC_INTERP), _in(AST_VECTOR), _in(AST)))
|
||||
*/
|
||||
void Z3_API Z3_add_func_entry(Z3_context c, Z3_func_interp fi, Z3_ast_vector args, Z3_ast value);
|
||||
|
||||
/**
|
||||
\brief Increment the reference counter of the given Z3_func_entry object.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue