mirror of
https://github.com/Z3Prover/z3
synced 2025-04-26 18:45:33 +00:00
remove deprecated user-theory plugins and other unused functionality from API
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e96d93ee42
commit
665af3d8b9
11 changed files with 2 additions and 2090 deletions
391
src/api/z3_api.h
391
src/api/z3_api.h
|
@ -24,7 +24,6 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
#ifdef CorML3
|
||||
DEFINE_TYPE(Z3_symbol);
|
||||
DEFINE_TYPE(Z3_literals);
|
||||
DEFINE_TYPE(Z3_theory);
|
||||
DEFINE_TYPE(Z3_config);
|
||||
DEFINE_TYPE(Z3_context);
|
||||
DEFINE_TYPE(Z3_sort);
|
||||
|
@ -55,7 +54,6 @@ DEFINE_TYPE(Z3_func_entry);
|
|||
DEFINE_TYPE(Z3_fixedpoint);
|
||||
DEFINE_TYPE(Z3_optimize);
|
||||
DEFINE_TYPE(Z3_rcf_num);
|
||||
DEFINE_VOID(Z3_theory_data);
|
||||
#endif
|
||||
|
||||
#ifndef __int64
|
||||
|
@ -1250,7 +1248,7 @@ typedef enum {
|
|||
Z3_PK_INVALID
|
||||
} Z3_param_kind;
|
||||
|
||||
#ifdef CorML3
|
||||
#if 0
|
||||
/**
|
||||
\mlonly {!search_failure} \endmlonly \conly \brief
|
||||
The different kinds of search failure types.
|
||||
|
@ -1345,8 +1343,6 @@ typedef enum
|
|||
def_Type('LITERALS', 'Z3_literals', 'Literals')
|
||||
def_Type('CONSTRUCTOR', 'Z3_constructor', 'Constructor')
|
||||
def_Type('CONSTRUCTOR_LIST', 'Z3_constructor_list', 'ConstructorList')
|
||||
def_Type('THEORY', 'Z3_theory', 'ctypes.c_void_p')
|
||||
def_Type('THEORY_DATA', 'Z3_theory_data', 'ctypes.c_void_p')
|
||||
def_Type('SOLVER', 'Z3_solver', 'SolverObj')
|
||||
def_Type('GOAL', 'Z3_goal', 'GoalObj')
|
||||
def_Type('TACTIC', 'Z3_tactic', 'TacticObj')
|
||||
|
@ -5389,391 +5385,6 @@ END_MLAPI_EXCLUDE
|
|||
|
||||
/*@}*/
|
||||
|
||||
#ifdef CorML3
|
||||
/**
|
||||
@name External Theory Plugins
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
#ifdef Conly
|
||||
|
||||
//
|
||||
// callbacks and void* don't work with CAMLIDL.
|
||||
//
|
||||
typedef Z3_bool Z3_reduce_eq_callback_fptr(Z3_theory t, Z3_ast a, Z3_ast b, Z3_ast * r);
|
||||
|
||||
typedef Z3_bool Z3_reduce_app_callback_fptr(Z3_theory, Z3_func_decl, unsigned, Z3_ast const [], Z3_ast *);
|
||||
|
||||
typedef Z3_bool Z3_reduce_distinct_callback_fptr(Z3_theory, unsigned, Z3_ast const [], Z3_ast *);
|
||||
|
||||
typedef void Z3_theory_callback_fptr(Z3_theory t);
|
||||
|
||||
typedef Z3_bool Z3_theory_final_check_callback_fptr(Z3_theory);
|
||||
|
||||
typedef void Z3_theory_ast_callback_fptr(Z3_theory, Z3_ast);
|
||||
|
||||
typedef void Z3_theory_ast_bool_callback_fptr(Z3_theory, Z3_ast, Z3_bool);
|
||||
|
||||
typedef void Z3_theory_ast_ast_callback_fptr(Z3_theory, Z3_ast, Z3_ast);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef Conly
|
||||
/**
|
||||
\brief Create a new user defined theory. The new theory will be identified by the name \c th_name.
|
||||
A theory must be created before asserting any assertion to the given context.
|
||||
\conly Return \c NULL in case of failure.
|
||||
|
||||
\conly \c data is a pointer to an external data-structure that may be used to store
|
||||
\conly theory specific additional data.
|
||||
*/
|
||||
Z3_theory Z3_API Z3_mk_theory(Z3_context c, Z3_string th_name, Z3_theory_data data);
|
||||
|
||||
/**
|
||||
\brief Return a pointer to the external data-structure supplied to the function #Z3_mk_theory.
|
||||
|
||||
\see Z3_mk_theory
|
||||
*/
|
||||
Z3_theory_data Z3_API Z3_theory_get_ext_data(Z3_theory t);
|
||||
#endif
|
||||
|
||||
/**
|
||||
\brief Create an interpreted theory sort.
|
||||
*/
|
||||
Z3_sort Z3_API Z3_theory_mk_sort(Z3_context c, Z3_theory t, Z3_symbol s);
|
||||
|
||||
/**
|
||||
\brief Create an interpreted theory constant value. Values are assumed to be different from each other.
|
||||
*/
|
||||
Z3_ast Z3_API Z3_theory_mk_value(Z3_context c, Z3_theory t, Z3_symbol n, Z3_sort s);
|
||||
|
||||
/**
|
||||
\brief Create an interpreted constant for the given theory.
|
||||
*/
|
||||
Z3_ast Z3_API Z3_theory_mk_constant(Z3_context c, Z3_theory t, Z3_symbol n, Z3_sort s);
|
||||
|
||||
/**
|
||||
\brief Create an interpreted function declaration for the given theory.
|
||||
*/
|
||||
Z3_func_decl Z3_API Z3_theory_mk_func_decl(Z3_context c, Z3_theory t, Z3_symbol n,
|
||||
unsigned domain_size, Z3_sort const domain[],
|
||||
Z3_sort range);
|
||||
|
||||
/**
|
||||
\brief Return the context where the given theory is installed.
|
||||
*/
|
||||
Z3_context Z3_API Z3_theory_get_context(Z3_theory t);
|
||||
|
||||
|
||||
#ifdef Conly
|
||||
/**
|
||||
\brief Set a callback that is invoked when theory \c t is deleted.
|
||||
This callback should be used to delete external data-structures associated with the given theory.
|
||||
|
||||
\conly The callback has the form <tt>f(t)</tt>, where
|
||||
\conly - \c t is the given theory
|
||||
|
||||
\see Z3_mk_theory
|
||||
\conly \see Z3_theory_get_ext_data
|
||||
*/
|
||||
void Z3_API Z3_set_delete_callback(Z3_theory t, Z3_theory_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback for simplifying operators of the given theory.
|
||||
The callback \c f is invoked by Z3's simplifier.
|
||||
|
||||
\conly It is of the form <tt>f(t, d, n, args, r)</tt>, where:
|
||||
\conly - \c t is the given theory
|
||||
\conly - \c d is the declaration of the theory operator
|
||||
\conly - \c n is the number of arguments in the array \c args
|
||||
\conly - \c args are arguments for the theory operator
|
||||
\conly - \c r should contain the result: an expression equivalent to <tt>d(args[0], ..., args[n-1])</tt>.
|
||||
|
||||
\conly If <tt>f(t, d, n, args, r)</tt> returns false, then \c r is ignored, and Z3 assumes that no simplification was performed.
|
||||
*/
|
||||
void Z3_API Z3_set_reduce_app_callback(Z3_theory t, Z3_reduce_app_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback for simplifying the atom <tt>s_1 = s_2</tt>, when the
|
||||
sort of \c s_1 and \c s_2 is an interpreted sort of the given theory.
|
||||
The callback \c f is invoked by Z3's simplifier.
|
||||
|
||||
\conly It has the form <tt>f(t, s_1, s_2, r)</tt>, where:
|
||||
\conly - \c t is the given theory
|
||||
\conly - \c s_1 is the left-hand-side
|
||||
\conly - \c s_2 is the right-hand-side
|
||||
\conly - \c r should contain the result: an expression equivalent to <tt>s_1 = s_2</tt>.
|
||||
|
||||
\conly If <tt>f(t, s_1, s_2, r)</tt> returns false, then \c r is ignored, and Z3 assumes that no simplification was performed.
|
||||
*/
|
||||
void Z3_API Z3_set_reduce_eq_callback(Z3_theory t, Z3_reduce_eq_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback for simplifying the atom <tt>distinct(s_1, ..., s_n)</tt>, when the
|
||||
sort of \c s_1, ..., \c s_n is an interpreted sort of the given theory.
|
||||
The callback \c f is invoked by Z3's simplifier.
|
||||
|
||||
\conly It has the form <tt>f(t, n, args, r)</tt>, where:
|
||||
\conly - \c t is the given theory
|
||||
\conly - \c n is the number of arguments in the array \c args
|
||||
\conly - \c args are arguments for distinct.
|
||||
\conly - \c r should contain the result: an expression equivalent to <tt>distinct(s_1, ..., s_n)</tt>.
|
||||
|
||||
\conly If <tt>f(t, n, args, r)</tt> returns false, then \c r is ignored, and Z3 assumes that no simplification was performed.
|
||||
*/
|
||||
void Z3_API Z3_set_reduce_distinct_callback(Z3_theory t, Z3_reduce_distinct_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback that is invoked when a theory application
|
||||
is finally added into the logical context. Note that, not every
|
||||
application contained in an asserted expression is actually
|
||||
added into the logical context because it may be simplified
|
||||
during a preprocessing step.
|
||||
|
||||
\conly The callback has the form <tt>f(t, n)</tt>, where
|
||||
\conly - \c t is the given theory
|
||||
|
||||
\conly - \c n is a theory application, that is, an expression of the form <tt>g(...)</tt> where \c g is a theory operator.
|
||||
|
||||
\remark An expression \c n added to the logical context at search level \c n,
|
||||
will remain in the logical context until this level is backtracked.
|
||||
*/
|
||||
void Z3_API Z3_set_new_app_callback(Z3_theory t, Z3_theory_ast_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback that is invoked when an expression of
|
||||
sort \c s, where \c s is an interpreted sort of the theory \c
|
||||
t, is finally added into the logical context. Note that, not
|
||||
every expression contained in an asserted expression is
|
||||
actually added into the logical context because it may be
|
||||
simplified during a preprocessing step.
|
||||
|
||||
\conly The callback has the form <tt>f(t, n)</tt>, where
|
||||
\conly - \c t is the given theory
|
||||
|
||||
\conly - \c n is an expression of sort \c s, where \c s is an interpreted sort of \c t.
|
||||
|
||||
\remark An expression \c n added to the logical context at search level \c n,
|
||||
will remain in the logical context until this level is backtracked.
|
||||
*/
|
||||
void Z3_API Z3_set_new_elem_callback(Z3_theory t, Z3_theory_ast_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback that is invoked when Z3 starts searching for a
|
||||
satisfying assignment.
|
||||
|
||||
\conly The callback has the form <tt>f(t)</tt>, where
|
||||
\conly - \c t is the given theory
|
||||
*/
|
||||
void Z3_API Z3_set_init_search_callback(Z3_theory t, Z3_theory_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback that is invoked when Z3 creates a
|
||||
case-split (aka backtracking point).
|
||||
|
||||
When a case-split is created we say the search level is increased.
|
||||
|
||||
\conly The callback has the form <tt>f(t)</tt>, where
|
||||
\conly - \c t is the given theory
|
||||
*/
|
||||
void Z3_API Z3_set_push_callback(Z3_theory t, Z3_theory_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback that is invoked when Z3 backtracks a
|
||||
case-split.
|
||||
|
||||
When a case-split is backtracked we say the search level is decreased.
|
||||
|
||||
\conly The callback has the form <tt>f(t)</tt>, where
|
||||
\conly - \c t is the given theory
|
||||
*/
|
||||
void Z3_API Z3_set_pop_callback(Z3_theory t, Z3_theory_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback that is invoked when Z3 restarts the
|
||||
search for a satisfying assignment.
|
||||
|
||||
\conly The callback has the form <tt>f(t)</tt>, where
|
||||
\conly - \c t is the given theory
|
||||
*/
|
||||
void Z3_API Z3_set_restart_callback(Z3_theory t, Z3_theory_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback that is invoked when the logical context
|
||||
is reset by the user. This callback is useful for reseting any
|
||||
data-structure maintained by the user theory solver.
|
||||
|
||||
\conly The callback has the form <tt>f(t)</tt>, where
|
||||
\conly - \c t is the given theory
|
||||
*/
|
||||
void Z3_API Z3_set_reset_callback(Z3_theory t, Z3_theory_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback that is invoked before Z3 starts building a model.
|
||||
A theory may use this callback to perform expensive operations.
|
||||
|
||||
\conly The callback has the form <tt>f(t)</tt>, where
|
||||
\conly - \c t is the given theory
|
||||
|
||||
If the theory returns \mlonly \c false, \endmlonly \conly \c Z3_false,
|
||||
Z3 will assume that theory is giving up,
|
||||
and it will assume that it was not possible to decide if the asserted constraints
|
||||
are satisfiable or not.
|
||||
*/
|
||||
void Z3_API Z3_set_final_check_callback(Z3_theory t, Z3_theory_final_check_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback that is invoked when an equality <tt>s_1 = s_2</tt>
|
||||
is found by the logical context.
|
||||
|
||||
\conly The callback has the form <tt>f(t, s_1, s_2)</tt>, where:
|
||||
\conly - \c t is the given theory
|
||||
\conly - \c s_1 is the left-hand-side
|
||||
\conly - \c s_2 is the right-hand-side
|
||||
*/
|
||||
void Z3_API Z3_set_new_eq_callback(Z3_theory t, Z3_theory_ast_ast_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback that is invoked when a disequality <tt>s_1 != s_2</tt>
|
||||
is found by the logical context.
|
||||
|
||||
\conly The callback has the form <tt>f(t, s_1, s_2)</tt>, where:
|
||||
\conly - \c t is the given theory
|
||||
\conly - \c s_1 is the left-hand-side
|
||||
\conly - \c s_2 is the right-hand-side
|
||||
*/
|
||||
void Z3_API Z3_set_new_diseq_callback(Z3_theory t, Z3_theory_ast_ast_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback that is invoked when a theory predicate is assigned to true/false by Z3.
|
||||
|
||||
\conly The callback has the form <tt>f(t, p, v)</tt>, where:
|
||||
\conly - \c t is the given theory
|
||||
\conly - \c p is the assigned predicate.
|
||||
\conly - \c v is the value (true/false) assigned to \c p.
|
||||
*/
|
||||
void Z3_API Z3_set_new_assignment_callback(Z3_theory t, Z3_theory_ast_bool_callback_fptr f);
|
||||
|
||||
/**
|
||||
\brief Set a callback that is invoked when an expression is
|
||||
marked as relevant during the search. This callback is only
|
||||
invoked when relevancy propagation is enabled.
|
||||
|
||||
\conly The callback has the form <tt>f(t, n)</tt>, where:
|
||||
\conly - \c t is the given theory
|
||||
\conly - \c n is the relevant expression
|
||||
*/
|
||||
void Z3_API Z3_set_new_relevant_callback(Z3_theory t, Z3_theory_ast_callback_fptr f);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
\brief Assert a theory axiom/lemmas during the search.
|
||||
|
||||
An axiom added at search level \c n will remain in the logical context until
|
||||
level \c n is backtracked.
|
||||
|
||||
The callbacks for push (#Z3_set_push_callback) and pop
|
||||
(#Z3_set_pop_callback) can be used to track when the search
|
||||
level is increased (i.e., new case-split) and decreased (i.e.,
|
||||
case-split is backtracked).
|
||||
|
||||
Z3 tracks the theory axioms asserted. So, multiple assertions of the same axiom are
|
||||
ignored.
|
||||
*/
|
||||
void Z3_API Z3_theory_assert_axiom(Z3_theory t, Z3_ast ax);
|
||||
|
||||
/**
|
||||
\brief Inform to the logical context that \c lhs and \c rhs have the same interpretation
|
||||
in the model being built by theory \c t. If lhs = rhs is inconsistent with other theories,
|
||||
then the logical context will backtrack.
|
||||
|
||||
For more information, see the paper "Model-Based Theory Combination" in the Z3 website.
|
||||
*/
|
||||
void Z3_API Z3_theory_assume_eq(Z3_theory t, Z3_ast lhs, Z3_ast rhs);
|
||||
|
||||
/**
|
||||
\brief Enable/disable the simplification of theory axioms asserted using #Z3_theory_assert_axiom.
|
||||
By default, the simplification of theory specific operators is disabled.
|
||||
That is, the reduce theory callbacks are not invoked for theory axioms.
|
||||
The default behavior is useful when asserting axioms stating properties of theory operators.
|
||||
*/
|
||||
void Z3_API Z3_theory_enable_axiom_simplification(Z3_theory t, Z3_bool flag);
|
||||
|
||||
/**
|
||||
\brief Return the root of the equivalence class containing \c n.
|
||||
*/
|
||||
Z3_ast Z3_API Z3_theory_get_eqc_root(Z3_theory t, Z3_ast n);
|
||||
|
||||
/**
|
||||
\brief Return the next element in the equivalence class containing \c n.
|
||||
|
||||
The elements in an equivalence class are organized in a circular list.
|
||||
You can traverse the list by calling this function multiple times
|
||||
using the result from the previous call. This is illustrated in the
|
||||
code snippet below.
|
||||
\code
|
||||
Z3_ast curr = n;
|
||||
do
|
||||
curr = Z3_theory_get_eqc_next(theory, curr);
|
||||
while (curr != n);
|
||||
\endcode
|
||||
*/
|
||||
Z3_ast Z3_API Z3_theory_get_eqc_next(Z3_theory t, Z3_ast n);
|
||||
|
||||
/**
|
||||
\brief Return the number of parents of \c n that are operators of the given theory.
|
||||
*/
|
||||
unsigned Z3_API Z3_theory_get_num_parents(Z3_theory t, Z3_ast n);
|
||||
|
||||
/**
|
||||
\brief Return the i-th parent of \c n.
|
||||
See #Z3_theory_get_num_parents.
|
||||
*/
|
||||
Z3_ast Z3_API Z3_theory_get_parent(Z3_theory t, Z3_ast n, unsigned i);
|
||||
|
||||
/**
|
||||
\brief Return \c Z3_TRUE if \c n is an interpreted theory value.
|
||||
*/
|
||||
Z3_bool Z3_API Z3_theory_is_value(Z3_theory t, Z3_ast n);
|
||||
|
||||
/**
|
||||
\brief Return \c Z3_TRUE if \c d is an interpreted theory declaration.
|
||||
*/
|
||||
Z3_bool Z3_API Z3_theory_is_decl(Z3_theory t, Z3_func_decl d);
|
||||
|
||||
/**
|
||||
\brief Return the number of expressions of the given theory in
|
||||
the logical context. These are the expressions notified using the
|
||||
callback #Z3_set_new_elem_callback.
|
||||
*/
|
||||
unsigned Z3_API Z3_theory_get_num_elems(Z3_theory t);
|
||||
|
||||
/**
|
||||
\brief Return the i-th elem of the given theory in the logical context.
|
||||
|
||||
\see Z3_theory_get_num_elems
|
||||
*/
|
||||
Z3_ast Z3_API Z3_theory_get_elem(Z3_theory t, unsigned i);
|
||||
|
||||
/**
|
||||
\brief Return the number of theory applications in the logical
|
||||
context. These are the expressions notified using the callback
|
||||
#Z3_set_new_app_callback.
|
||||
*/
|
||||
unsigned Z3_API Z3_theory_get_num_apps(Z3_theory t);
|
||||
|
||||
/**
|
||||
\brief Return the i-th application of the given theory in the logical context.
|
||||
|
||||
\see Z3_theory_get_num_apps
|
||||
*/
|
||||
Z3_ast Z3_API Z3_theory_get_app(Z3_theory t, unsigned i);
|
||||
|
||||
/*@}*/
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CorML4
|
||||
/**
|
||||
@name Fixedpoint facilities
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue