mirror of
https://github.com/Z3Prover/z3
synced 2025-04-07 01:54:08 +00:00
C API cleanup. Mainly removal of ML-specific macros that are not used anymore and inline documentation fixes.
This commit is contained in:
parent
2c6645ef2d
commit
00271e5531
|
@ -84,9 +84,12 @@ try:
|
|||
os.remove('website-adj.dox')
|
||||
shutil.copyfile('../src/api/python/z3.py', 'tmp/z3py.py')
|
||||
cleanup_API('../src/api/z3_api.h', 'tmp/z3_api.h')
|
||||
cleanup_API('../src/api/z3_ast_containers.h', 'tmp/z3_ast_containers.h')
|
||||
cleanup_API('../src/api/z3_algebraic.h', 'tmp/z3_algebraic.h')
|
||||
cleanup_API('../src/api/z3_polynomial.h', 'tmp/z3_polynomial.h')
|
||||
cleanup_API('../src/api/z3_rcf.h', 'tmp/z3_rcf.h')
|
||||
cleanup_API('../src/api/z3_fixedpoint.h', 'tmp/z3_fixedpoint.h')
|
||||
cleanup_API('../src/api/z3_optimization.h', 'tmp/z3_optimization.h')
|
||||
cleanup_API('../src/api/z3_interp.h', 'tmp/z3_interp.h')
|
||||
cleanup_API('../src/api/z3_fpa.h', 'tmp/z3_fpa.h')
|
||||
|
||||
|
@ -100,12 +103,16 @@ try:
|
|||
exit(1)
|
||||
print("Generated C and .NET API documentation.")
|
||||
os.remove('tmp/z3_api.h')
|
||||
os.remove('tmp/z3_ast_containers.h')
|
||||
os.remove('tmp/z3_algebraic.h')
|
||||
os.remove('tmp/z3_polynomial.h')
|
||||
os.remove('tmp/z3_rcf.h')
|
||||
os.remove('tmp/z3_fixedpoint.h')
|
||||
os.remove('tmp/z3_optimization.h')
|
||||
os.remove('tmp/z3_interp.h')
|
||||
os.remove('tmp/z3_fpa.h')
|
||||
print("Removed temporary file z3_api.h.")
|
||||
print("Removed temporary file header files.")
|
||||
|
||||
os.remove('tmp/website.dox')
|
||||
print("Removed temporary file website.dox")
|
||||
os.remove('tmp/z3py.py')
|
||||
|
@ -126,5 +133,6 @@ try:
|
|||
|
||||
print("Documentation was successfully generated at subdirectory './api/html'.")
|
||||
except:
|
||||
print("ERROR: failed to generate documentation")
|
||||
exctype, value = sys.exc_info()[:2]
|
||||
print("ERROR: failed to generate documentation: %s" % value)
|
||||
exit(1)
|
||||
|
|
|
@ -214,11 +214,6 @@ ALIASES = "beginfaq=<ul>" \
|
|||
"emph{1}=<em>\1</em>" \
|
||||
"extdoc{2}=<a class=\"el\" href=\"\1\">\2</a>" \
|
||||
"nicebox{1}=<div class=\"fragment\"><pre class=\"fragment\">\1</pre></div>" \
|
||||
"mlonly=\if Ocaml" \
|
||||
"endmlonly=\endif" \
|
||||
"mlh=\if Ocaml" \
|
||||
"endmlh=\endif" \
|
||||
"conly=" \
|
||||
"ccode{1}=<tt>\1</tt>" \
|
||||
"zframe=<iframe allowtransparency=\"true\" frameborder=\"0\" style=\"width:600px;height:600px\" src=\"http://rise4fun.com/z3?frame=1&menu=0\"> </iframe>"
|
||||
|
||||
|
|
|
@ -64,11 +64,6 @@ ALIASES = "beginfaq=<ul>" \
|
|||
"emph{1}=<em>\1</em>" \
|
||||
"extdoc{2}=<a class=\"el\" href=\"\1\">\2</a>" \
|
||||
"nicebox{1}=<div class=\"fragment\"><pre class=\"fragment\">\1</pre></div>" \
|
||||
"mlonly=\if Ocaml" \
|
||||
"endmlonly=\endif" \
|
||||
"mlh=\if Ocaml" \
|
||||
"endmlh=\endif" \
|
||||
"conly=" \
|
||||
"ccode{1}=<tt>\1</tt>" \
|
||||
"zframe=<iframe allowtransparency=\"true\" frameborder=\"0\" style=\"width:600px;height:600px\" src=\"http://rise4fun.com/z3?frame=1&menu=0\"> </iframe>"
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ def init_project_def():
|
|||
add_lib('portfolio', ['smtlogic_tactics', 'sat_solver', 'ufbv_tactic', 'fpa_tactics', 'aig_tactic', 'fp', 'qe','sls_tactic', 'subpaving_tactic'], 'tactic/portfolio')
|
||||
add_lib('smtparser', ['portfolio'], 'parsers/smt')
|
||||
add_lib('opt', ['smt', 'smtlogic_tactics', 'sls_tactic', 'sat_solver'], 'opt')
|
||||
API_files = ['z3_api.h', 'z3_algebraic.h', 'z3_polynomial.h', 'z3_rcf.h', 'z3_interp.h', 'z3_fpa.h']
|
||||
API_files = ['z3_api.h', 'z3_ast_containers.h', 'z3_algebraic.h', 'z3_polynomial.h', 'z3_rcf.h', 'z3_fixedpoint.h', 'z3_optimization.h', 'z3_interp.h', 'z3_fpa.h']
|
||||
add_lib('api', ['portfolio', 'smtparser', 'realclosure', 'interp', 'opt'],
|
||||
includes2install=['z3.h', 'z3_v1.h', 'z3_macros.h'] + API_files)
|
||||
add_exe('shell', ['api', 'sat', 'extra_cmds','opt'], exe_name='z3')
|
||||
|
|
|
@ -151,8 +151,7 @@ Z3_ast Z3_API NAME(Z3_context c, unsigned i, Z3_ast n) { \
|
|||
}
|
||||
|
||||
/**
|
||||
\brief \mlh mk_bvmsb c s \endmlh
|
||||
Create a bit-vector of sort \s with 1 in the most significant bit position.
|
||||
\brief Create a bit-vector of sort \s with 1 in the most significant bit position.
|
||||
|
||||
The sort \s must be a bit-vector sort.
|
||||
|
||||
|
|
|
@ -201,10 +201,11 @@ public class Model extends Z3Object
|
|||
* Remarks: This function may fail if {@code t} contains
|
||||
* quantifiers, is partial (MODEL_PARTIAL enabled), or if {@code t} is not well-sorted. In this case a
|
||||
* {@code ModelEvaluationFailedException} is thrown.
|
||||
* @param t An expression {@code completion} When this flag
|
||||
* @param t the expression to evaluate
|
||||
* @param completion An expression {@code completion} When this flag
|
||||
* is enabled, a model value will be assigned to any constant or function
|
||||
* that does not have an interpretation in the model.
|
||||
*
|
||||
|
||||
* @return The evaluation of {@code t} in the model.
|
||||
* @throws Z3Exception
|
||||
**/
|
||||
|
|
|
@ -24,9 +24,12 @@ Notes:
|
|||
#include<stdio.h>
|
||||
#include"z3_macros.h"
|
||||
#include"z3_api.h"
|
||||
#include"z3_ast_containers.h"
|
||||
#include"z3_algebraic.h"
|
||||
#include"z3_polynomial.h"
|
||||
#include"z3_rcf.h"
|
||||
#include"z3_fixedpoint.h"
|
||||
#include"z3_optimization.h"
|
||||
#include"z3_interp.h"
|
||||
#include"z3_fpa.h"
|
||||
|
||||
|
|
|
@ -25,18 +25,11 @@ Notes:
|
|||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/**
|
||||
\defgroup capi C API
|
||||
|
||||
*/
|
||||
|
||||
/** \defgroup capi C API */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
@name Algebraic Numbers API
|
||||
*/
|
||||
/** @name Algebraic Numbers */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
\brief Return Z3_TRUE if \c can be used as value in the Z3 real algebraic
|
||||
number package.
|
||||
|
|
1896
src/api/z3_api.h
1896
src/api/z3_api.h
File diff suppressed because it is too large
Load diff
200
src/api/z3_ast_containers.h
Normal file
200
src/api/z3_ast_containers.h
Normal file
|
@ -0,0 +1,200 @@
|
|||
/*++
|
||||
Copyright (c) 2015 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
z3_ast_containers.h
|
||||
|
||||
Abstract:
|
||||
|
||||
AST Containers
|
||||
|
||||
Author:
|
||||
|
||||
Christoph M. Wintersteiger (cwinter) 2015-12-03
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef Z3_AST_CONTAINERS_H_
|
||||
#define Z3_AST_CONTAINERS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/** \defgroup capi C API */
|
||||
/*@{*/
|
||||
|
||||
/** @name AST vectors */
|
||||
/*@{*/
|
||||
/**
|
||||
\brief Return an empty AST vector.
|
||||
|
||||
\remark Reference counting must be used to manage AST vectors, even when the Z3_context was
|
||||
created using #Z3_mk_context instead of #Z3_mk_context_rc.
|
||||
|
||||
def_API('Z3_mk_ast_vector', AST_VECTOR, (_in(CONTEXT),))
|
||||
*/
|
||||
Z3_ast_vector Z3_API Z3_mk_ast_vector(Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Increment the reference counter of the given AST vector.
|
||||
|
||||
def_API('Z3_ast_vector_inc_ref', VOID, (_in(CONTEXT), _in(AST_VECTOR)))
|
||||
*/
|
||||
void Z3_API Z3_ast_vector_inc_ref(Z3_context c, Z3_ast_vector v);
|
||||
|
||||
/**
|
||||
\brief Decrement the reference counter of the given AST vector.
|
||||
|
||||
def_API('Z3_ast_vector_dec_ref', VOID, (_in(CONTEXT), _in(AST_VECTOR)))
|
||||
*/
|
||||
void Z3_API Z3_ast_vector_dec_ref(Z3_context c, Z3_ast_vector v);
|
||||
|
||||
/**
|
||||
\brief Return the size of the given AST vector.
|
||||
|
||||
def_API('Z3_ast_vector_size', UINT, (_in(CONTEXT), _in(AST_VECTOR)))
|
||||
*/
|
||||
unsigned Z3_API Z3_ast_vector_size(Z3_context c, Z3_ast_vector v);
|
||||
|
||||
/**
|
||||
\brief Return the AST at position \c i in the AST vector \c v.
|
||||
|
||||
\pre i < Z3_ast_vector_size(c, v)
|
||||
|
||||
def_API('Z3_ast_vector_get', AST, (_in(CONTEXT), _in(AST_VECTOR), _in(UINT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_ast_vector_get(Z3_context c, Z3_ast_vector v, unsigned i);
|
||||
|
||||
/**
|
||||
\brief Update position \c i of the AST vector \c v with the AST \c a.
|
||||
|
||||
\pre i < Z3_ast_vector_size(c, v)
|
||||
|
||||
def_API('Z3_ast_vector_set', VOID, (_in(CONTEXT), _in(AST_VECTOR), _in(UINT), _in(AST)))
|
||||
*/
|
||||
void Z3_API Z3_ast_vector_set(Z3_context c, Z3_ast_vector v, unsigned i, Z3_ast a);
|
||||
|
||||
/**
|
||||
\brief Resize the AST vector \c v.
|
||||
|
||||
def_API('Z3_ast_vector_resize', VOID, (_in(CONTEXT), _in(AST_VECTOR), _in(UINT)))
|
||||
*/
|
||||
void Z3_API Z3_ast_vector_resize(Z3_context c, Z3_ast_vector v, unsigned n);
|
||||
|
||||
/**
|
||||
\brief Add the AST \c a in the end of the AST vector \c v. The size of \c v is increased by one.
|
||||
|
||||
def_API('Z3_ast_vector_push', VOID, (_in(CONTEXT), _in(AST_VECTOR), _in(AST)))
|
||||
*/
|
||||
void Z3_API Z3_ast_vector_push(Z3_context c, Z3_ast_vector v, Z3_ast a);
|
||||
|
||||
/**
|
||||
\brief Translate the AST vector \c v from context \c s into an AST vector in context \c t.
|
||||
|
||||
def_API('Z3_ast_vector_translate', AST_VECTOR, (_in(CONTEXT), _in(AST_VECTOR), _in(CONTEXT)))
|
||||
*/
|
||||
Z3_ast_vector Z3_API Z3_ast_vector_translate(Z3_context s, Z3_ast_vector v, Z3_context t);
|
||||
|
||||
/**
|
||||
\brief Convert AST vector into a string.
|
||||
|
||||
def_API('Z3_ast_vector_to_string', STRING, (_in(CONTEXT), _in(AST_VECTOR)))
|
||||
*/
|
||||
Z3_string Z3_API Z3_ast_vector_to_string(Z3_context c, Z3_ast_vector v);
|
||||
|
||||
/*@}*/
|
||||
|
||||
/** @name AST maps */
|
||||
/*@{*/
|
||||
/**
|
||||
\brief Return an empty mapping from AST to AST
|
||||
|
||||
\remark Reference counting must be used to manage AST maps, even when the Z3_context was
|
||||
created using #Z3_mk_context instead of #Z3_mk_context_rc.
|
||||
|
||||
def_API('Z3_mk_ast_map', AST_MAP, (_in(CONTEXT),) )
|
||||
*/
|
||||
Z3_ast_map Z3_API Z3_mk_ast_map(Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Increment the reference counter of the given AST map.
|
||||
|
||||
def_API('Z3_ast_map_inc_ref', VOID, (_in(CONTEXT), _in(AST_MAP)))
|
||||
*/
|
||||
void Z3_API Z3_ast_map_inc_ref(Z3_context c, Z3_ast_map m);
|
||||
|
||||
/**
|
||||
\brief Decrement the reference counter of the given AST map.
|
||||
|
||||
def_API('Z3_ast_map_dec_ref', VOID, (_in(CONTEXT), _in(AST_MAP)))
|
||||
*/
|
||||
void Z3_API Z3_ast_map_dec_ref(Z3_context c, Z3_ast_map m);
|
||||
|
||||
/**
|
||||
\brief Return true if the map \c m contains the AST key \c k.
|
||||
|
||||
def_API('Z3_ast_map_contains', BOOL, (_in(CONTEXT), _in(AST_MAP), _in(AST)))
|
||||
*/
|
||||
Z3_bool Z3_API Z3_ast_map_contains(Z3_context c, Z3_ast_map m, Z3_ast k);
|
||||
|
||||
/**
|
||||
\brief Return the value associated with the key \c k.
|
||||
|
||||
The procedure invokes the error handler if \c k is not in the map.
|
||||
|
||||
def_API('Z3_ast_map_find', AST, (_in(CONTEXT), _in(AST_MAP), _in(AST)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_ast_map_find(Z3_context c, Z3_ast_map m, Z3_ast k);
|
||||
|
||||
/**
|
||||
\brief Store/Replace a new key, value pair in the given map.
|
||||
|
||||
def_API('Z3_ast_map_insert', VOID, (_in(CONTEXT), _in(AST_MAP), _in(AST), _in(AST)))
|
||||
*/
|
||||
void Z3_API Z3_ast_map_insert(Z3_context c, Z3_ast_map m, Z3_ast k, Z3_ast v);
|
||||
|
||||
/**
|
||||
\brief Erase a key from the map.
|
||||
|
||||
def_API('Z3_ast_map_erase', VOID, (_in(CONTEXT), _in(AST_MAP), _in(AST)))
|
||||
*/
|
||||
void Z3_API Z3_ast_map_erase(Z3_context c, Z3_ast_map m, Z3_ast k);
|
||||
|
||||
/**
|
||||
\brief Remove all keys from the given map.
|
||||
|
||||
def_API('Z3_ast_map_reset', VOID, (_in(CONTEXT), _in(AST_MAP)))
|
||||
*/
|
||||
void Z3_API Z3_ast_map_reset(Z3_context c, Z3_ast_map m);
|
||||
|
||||
/**
|
||||
\brief Return the size of the given map.
|
||||
|
||||
def_API('Z3_ast_map_size', UINT, (_in(CONTEXT), _in(AST_MAP)))
|
||||
*/
|
||||
unsigned Z3_API Z3_ast_map_size(Z3_context c, Z3_ast_map m);
|
||||
|
||||
/**
|
||||
\brief Return the keys stored in the given map.
|
||||
|
||||
def_API('Z3_ast_map_keys', AST_VECTOR, (_in(CONTEXT), _in(AST_MAP)))
|
||||
*/
|
||||
Z3_ast_vector Z3_API Z3_ast_map_keys(Z3_context c, Z3_ast_map m);
|
||||
|
||||
/**
|
||||
\brief Convert the given map into a string.
|
||||
|
||||
def_API('Z3_ast_map_to_string', STRING, (_in(CONTEXT), _in(AST_MAP)))
|
||||
*/
|
||||
Z3_string Z3_API Z3_ast_map_to_string(Z3_context c, Z3_ast_map m);
|
||||
/*@}*/
|
||||
/*@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
377
src/api/z3_fixedpoint.h
Normal file
377
src/api/z3_fixedpoint.h
Normal file
|
@ -0,0 +1,377 @@
|
|||
/*++
|
||||
Copyright (c) 2015 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
z3_fixedpoint.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Fixedpoint API
|
||||
|
||||
Author:
|
||||
|
||||
Christoph M. Wintersteiger (cwinter) 2015-12-03
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef Z3_FIXEDPOINT_H_
|
||||
#define Z3_FIXEDPOINT_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/** \defgroup capi C API */
|
||||
/*@{*/
|
||||
|
||||
/** @name Fixedpoint facilities */
|
||||
/*@{*/
|
||||
/**
|
||||
\brief Create a new fixedpoint context.
|
||||
|
||||
\remark User must use #Z3_fixedpoint_inc_ref and #Z3_fixedpoint_dec_ref to manage fixedpoint objects.
|
||||
Even if the context was created using #Z3_mk_context instead of #Z3_mk_context_rc.
|
||||
|
||||
def_API('Z3_mk_fixedpoint', FIXEDPOINT, (_in(CONTEXT), ))
|
||||
*/
|
||||
Z3_fixedpoint Z3_API Z3_mk_fixedpoint(Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Increment the reference counter of the given fixedpoint context
|
||||
|
||||
def_API('Z3_fixedpoint_inc_ref', VOID, (_in(CONTEXT), _in(FIXEDPOINT)))
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_inc_ref(Z3_context c, Z3_fixedpoint d);
|
||||
|
||||
/**
|
||||
\brief Decrement the reference counter of the given fixedpoint context.
|
||||
|
||||
def_API('Z3_fixedpoint_dec_ref', VOID, (_in(CONTEXT), _in(FIXEDPOINT)))
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_dec_ref(Z3_context c, Z3_fixedpoint d);
|
||||
|
||||
/**
|
||||
\brief Add a universal Horn clause as a named rule.
|
||||
The \c horn_rule should be of the form:
|
||||
|
||||
\code
|
||||
horn_rule ::= (forall (bound-vars) horn_rule)
|
||||
| (=> atoms horn_rule)
|
||||
| atom
|
||||
\endcode
|
||||
|
||||
def_API('Z3_fixedpoint_add_rule', VOID, (_in(CONTEXT), _in(FIXEDPOINT), _in(AST), _in(SYMBOL)))
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_add_rule(Z3_context c, Z3_fixedpoint d, Z3_ast rule, Z3_symbol name);
|
||||
|
||||
/**
|
||||
\brief Add a Database fact.
|
||||
|
||||
\param c - context
|
||||
\param d - fixed point context
|
||||
\param r - relation signature for the row.
|
||||
\param num_args - number of columns for the given row.
|
||||
\param args - array of the row elements.
|
||||
|
||||
The number of arguments \c num_args should be equal to the number
|
||||
of sorts in the domain of \c r. Each sort in the domain should be an integral
|
||||
(bit-vector, Boolean or or finite domain sort).
|
||||
|
||||
The call has the same effect as adding a rule where \c r is applied to the arguments.
|
||||
|
||||
def_API('Z3_fixedpoint_add_fact', VOID, (_in(CONTEXT), _in(FIXEDPOINT), _in(FUNC_DECL), _in(UINT), _in_array(3, UINT)))
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_add_fact(Z3_context c, Z3_fixedpoint d,
|
||||
Z3_func_decl r,
|
||||
unsigned num_args, unsigned args[]);
|
||||
|
||||
/**
|
||||
\brief Assert a constraint to the fixedpoint context.
|
||||
|
||||
The constraints are used as background axioms when the fixedpoint engine uses the PDR mode.
|
||||
They are ignored for standard Datalog mode.
|
||||
|
||||
def_API('Z3_fixedpoint_assert', VOID, (_in(CONTEXT), _in(FIXEDPOINT), _in(AST)))
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_assert(Z3_context c, Z3_fixedpoint d, Z3_ast axiom);
|
||||
|
||||
/**
|
||||
\brief Pose a query against the asserted rules.
|
||||
|
||||
\code
|
||||
query ::= (exists (bound-vars) query)
|
||||
| literals
|
||||
\endcode
|
||||
|
||||
query returns
|
||||
- Z3_L_FALSE if the query is unsatisfiable.
|
||||
- Z3_L_TRUE if the query is satisfiable. Obtain the answer by calling #Z3_fixedpoint_get_answer.
|
||||
- Z3_L_UNDEF if the query was interrupted, timed out or otherwise failed.
|
||||
|
||||
def_API('Z3_fixedpoint_query', INT, (_in(CONTEXT), _in(FIXEDPOINT), _in(AST)))
|
||||
*/
|
||||
Z3_lbool Z3_API Z3_fixedpoint_query(Z3_context c, Z3_fixedpoint d, Z3_ast query);
|
||||
|
||||
/**
|
||||
\brief Pose multiple queries against the asserted rules.
|
||||
|
||||
The queries are encoded as relations (function declarations).
|
||||
|
||||
query returns
|
||||
- Z3_L_FALSE if the query is unsatisfiable.
|
||||
- Z3_L_TRUE if the query is satisfiable. Obtain the answer by calling #Z3_fixedpoint_get_answer.
|
||||
- Z3_L_UNDEF if the query was interrupted, timed out or otherwise failed.
|
||||
|
||||
def_API('Z3_fixedpoint_query_relations', INT, (_in(CONTEXT), _in(FIXEDPOINT), _in(UINT), _in_array(2, FUNC_DECL)))
|
||||
*/
|
||||
Z3_lbool Z3_API Z3_fixedpoint_query_relations(
|
||||
Z3_context c, Z3_fixedpoint d,
|
||||
unsigned num_relations, Z3_func_decl const relations[]);
|
||||
|
||||
/**
|
||||
\brief Retrieve a formula that encodes satisfying answers to the query.
|
||||
|
||||
|
||||
When used in Datalog mode, the returned answer is a disjunction of conjuncts.
|
||||
Each conjunct encodes values of the bound variables of the query that are satisfied.
|
||||
In PDR mode, the returned answer is a single conjunction.
|
||||
|
||||
When used in Datalog mode the previous call to Z3_fixedpoint_query must have returned Z3_L_TRUE.
|
||||
When used with the PDR engine, the previous call must have been either Z3_L_TRUE or Z3_L_FALSE.
|
||||
|
||||
def_API('Z3_fixedpoint_get_answer', AST, (_in(CONTEXT), _in(FIXEDPOINT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_fixedpoint_get_answer(Z3_context c, Z3_fixedpoint d);
|
||||
|
||||
/**
|
||||
\brief Retrieve a string that describes the last status returned by #Z3_fixedpoint_query.
|
||||
|
||||
Use this method when #Z3_fixedpoint_query returns Z3_L_UNDEF.
|
||||
|
||||
def_API('Z3_fixedpoint_get_reason_unknown', STRING, (_in(CONTEXT), _in(FIXEDPOINT) ))
|
||||
*/
|
||||
Z3_string Z3_API Z3_fixedpoint_get_reason_unknown(Z3_context c, Z3_fixedpoint d);
|
||||
|
||||
/**
|
||||
\brief Update a named rule.
|
||||
A rule with the same name must have been previously created.
|
||||
|
||||
def_API('Z3_fixedpoint_update_rule', VOID, (_in(CONTEXT), _in(FIXEDPOINT), _in(AST), _in(SYMBOL)))
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_update_rule(Z3_context c, Z3_fixedpoint d, Z3_ast a, Z3_symbol name);
|
||||
|
||||
/**
|
||||
\brief Query the PDR engine for the maximal levels properties are known about predicate.
|
||||
|
||||
This call retrieves the maximal number of relevant unfoldings
|
||||
of \c pred with respect to the current exploration state.
|
||||
Note: this functionality is PDR specific.
|
||||
|
||||
def_API('Z3_fixedpoint_get_num_levels', UINT, (_in(CONTEXT), _in(FIXEDPOINT), _in(FUNC_DECL)))
|
||||
*/
|
||||
unsigned Z3_API Z3_fixedpoint_get_num_levels(Z3_context c, Z3_fixedpoint d, Z3_func_decl pred);
|
||||
|
||||
/**
|
||||
Retrieve the current cover of \c pred up to \c level unfoldings.
|
||||
Return just the delta that is known at \c level. To
|
||||
obtain the full set of properties of \c pred one should query
|
||||
at \c level+1 , \c level+2 etc, and include \c level=-1.
|
||||
|
||||
Note: this functionality is PDR specific.
|
||||
|
||||
def_API('Z3_fixedpoint_get_cover_delta', AST, (_in(CONTEXT), _in(FIXEDPOINT), _in(INT), _in(FUNC_DECL)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_fixedpoint_get_cover_delta(Z3_context c, Z3_fixedpoint d, int level, Z3_func_decl pred);
|
||||
|
||||
/**
|
||||
\brief Add property about the predicate \c pred.
|
||||
Add a property of predicate \c pred at \c level.
|
||||
It gets pushed forward when possible.
|
||||
|
||||
Note: level = -1 is treated as the fixedpoint. So passing -1 for the \c level
|
||||
means that the property is true of the fixed-point unfolding with respect to \c pred.
|
||||
|
||||
Note: this functionality is PDR specific.
|
||||
|
||||
def_API('Z3_fixedpoint_add_cover', VOID, (_in(CONTEXT), _in(FIXEDPOINT), _in(INT), _in(FUNC_DECL), _in(AST)))
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_add_cover(Z3_context c, Z3_fixedpoint d, int level, Z3_func_decl pred, Z3_ast property);
|
||||
|
||||
/**
|
||||
\brief Retrieve statistics information from the last call to #Z3_fixedpoint_query.
|
||||
|
||||
def_API('Z3_fixedpoint_get_statistics', STATS, (_in(CONTEXT), _in(FIXEDPOINT)))
|
||||
*/
|
||||
Z3_stats Z3_API Z3_fixedpoint_get_statistics(Z3_context c, Z3_fixedpoint d);
|
||||
|
||||
/**
|
||||
\brief Register relation as Fixedpoint defined.
|
||||
Fixedpoint defined relations have least-fixedpoint semantics.
|
||||
For example, the relation is empty if it does not occur
|
||||
in a head or a fact.
|
||||
|
||||
def_API('Z3_fixedpoint_register_relation', VOID, (_in(CONTEXT), _in(FIXEDPOINT), _in(FUNC_DECL)))
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_register_relation(Z3_context c, Z3_fixedpoint d, Z3_func_decl f);
|
||||
|
||||
/**
|
||||
\brief Configure the predicate representation.
|
||||
|
||||
It sets the predicate to use a set of domains given by the list of symbols.
|
||||
The domains given by the list of symbols must belong to a set
|
||||
of built-in domains.
|
||||
|
||||
def_API('Z3_fixedpoint_set_predicate_representation', VOID, (_in(CONTEXT), _in(FIXEDPOINT), _in(FUNC_DECL), _in(UINT), _in_array(3, SYMBOL)))
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_set_predicate_representation(
|
||||
Z3_context c,
|
||||
Z3_fixedpoint d,
|
||||
Z3_func_decl f,
|
||||
unsigned num_relations,
|
||||
Z3_symbol const relation_kinds[]);
|
||||
|
||||
/**
|
||||
\brief Retrieve set of rules from fixedpoint context.
|
||||
|
||||
def_API('Z3_fixedpoint_get_rules', AST_VECTOR, (_in(CONTEXT),_in(FIXEDPOINT)))
|
||||
*/
|
||||
Z3_ast_vector Z3_API Z3_fixedpoint_get_rules(
|
||||
Z3_context c,
|
||||
Z3_fixedpoint f);
|
||||
|
||||
/**
|
||||
\brief Retrieve set of background assertions from fixedpoint context.
|
||||
|
||||
def_API('Z3_fixedpoint_get_assertions', AST_VECTOR, (_in(CONTEXT),_in(FIXEDPOINT)))
|
||||
*/
|
||||
Z3_ast_vector Z3_API Z3_fixedpoint_get_assertions(
|
||||
Z3_context c,
|
||||
Z3_fixedpoint f);
|
||||
|
||||
/**
|
||||
\brief Set parameters on fixedpoint context.
|
||||
|
||||
def_API('Z3_fixedpoint_set_params', VOID, (_in(CONTEXT), _in(FIXEDPOINT), _in(PARAMS)))
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_set_params(Z3_context c, Z3_fixedpoint f, Z3_params p);
|
||||
|
||||
/**
|
||||
\brief Return a string describing all fixedpoint available parameters.
|
||||
|
||||
def_API('Z3_fixedpoint_get_help', STRING, (_in(CONTEXT), _in(FIXEDPOINT)))
|
||||
*/
|
||||
Z3_string Z3_API Z3_fixedpoint_get_help(Z3_context c, Z3_fixedpoint f);
|
||||
|
||||
/**
|
||||
\brief Return the parameter description set for the given fixedpoint object.
|
||||
|
||||
def_API('Z3_fixedpoint_get_param_descrs', PARAM_DESCRS, (_in(CONTEXT), _in(FIXEDPOINT)))
|
||||
*/
|
||||
Z3_param_descrs Z3_API Z3_fixedpoint_get_param_descrs(Z3_context c, Z3_fixedpoint f);
|
||||
|
||||
/**
|
||||
\brief Print the current rules and background axioms as a string.
|
||||
\param c - context.
|
||||
\param f - fixedpoint context.
|
||||
\param num_queries - number of additional queries to print.
|
||||
\param queries - additional queries.
|
||||
|
||||
def_API('Z3_fixedpoint_to_string', STRING, (_in(CONTEXT), _in(FIXEDPOINT), _in(UINT), _in_array(2, AST)))
|
||||
*/
|
||||
Z3_string Z3_API Z3_fixedpoint_to_string(
|
||||
Z3_context c,
|
||||
Z3_fixedpoint f,
|
||||
unsigned num_queries,
|
||||
Z3_ast queries[]);
|
||||
|
||||
/**
|
||||
\brief Parse an SMT-LIB2 string with fixedpoint rules.
|
||||
Add the rules to the current fixedpoint context.
|
||||
Return the set of queries in the string.
|
||||
|
||||
\param c - context.
|
||||
\param f - fixedpoint context.
|
||||
\param s - string containing SMT2 specification.
|
||||
|
||||
def_API('Z3_fixedpoint_from_string', AST_VECTOR, (_in(CONTEXT), _in(FIXEDPOINT), _in(STRING)))
|
||||
*/
|
||||
Z3_ast_vector Z3_API Z3_fixedpoint_from_string(Z3_context c,
|
||||
Z3_fixedpoint f,
|
||||
Z3_string s);
|
||||
|
||||
/**
|
||||
\brief Parse an SMT-LIB2 file with fixedpoint rules.
|
||||
Add the rules to the current fixedpoint context.
|
||||
Return the set of queries in the file.
|
||||
|
||||
\param c - context.
|
||||
\param f - fixedpoint context.
|
||||
\param s - string containing SMT2 specification.
|
||||
|
||||
def_API('Z3_fixedpoint_from_file', AST_VECTOR, (_in(CONTEXT), _in(FIXEDPOINT), _in(STRING)))
|
||||
*/
|
||||
Z3_ast_vector Z3_API Z3_fixedpoint_from_file(Z3_context c,
|
||||
Z3_fixedpoint f,
|
||||
Z3_string s);
|
||||
|
||||
/**
|
||||
\brief Create a backtracking point.
|
||||
|
||||
The fixedpoint solver contains a set of rules, added facts and assertions.
|
||||
The set of rules, facts and assertions are restored upon calling #Z3_fixedpoint_pop.
|
||||
|
||||
\sa Z3_fixedpoint_pop
|
||||
|
||||
def_API('Z3_fixedpoint_push', VOID, (_in(CONTEXT), _in(FIXEDPOINT)))
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_push(Z3_context c, Z3_fixedpoint d);
|
||||
|
||||
/**
|
||||
\brief Backtrack one backtracking point.
|
||||
|
||||
\sa Z3_fixedpoint_push
|
||||
|
||||
\pre The number of calls to pop cannot exceed calls to push.
|
||||
|
||||
def_API('Z3_fixedpoint_pop', VOID, (_in(CONTEXT), _in(FIXEDPOINT)))
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_pop(Z3_context c, Z3_fixedpoint d);
|
||||
|
||||
/** \brief The following utilities allows adding user-defined domains. */
|
||||
|
||||
typedef void Z3_fixedpoint_reduce_assign_callback_fptr(
|
||||
void*, Z3_func_decl,
|
||||
unsigned, Z3_ast const [],
|
||||
unsigned, Z3_ast const []);
|
||||
|
||||
typedef void Z3_fixedpoint_reduce_app_callback_fptr(
|
||||
void*, Z3_func_decl,
|
||||
unsigned, Z3_ast const [],
|
||||
Z3_ast*);
|
||||
|
||||
|
||||
/** \brief Initialize the context with a user-defined state. */
|
||||
void Z3_API Z3_fixedpoint_init(Z3_context c, Z3_fixedpoint d, void* state);
|
||||
|
||||
/**
|
||||
\brief Register a callback to destructive updates.
|
||||
|
||||
Registers are identified with terms encoded as fresh constants,
|
||||
*/
|
||||
void Z3_API Z3_fixedpoint_set_reduce_assign_callback(
|
||||
Z3_context c ,Z3_fixedpoint d, Z3_fixedpoint_reduce_assign_callback_fptr cb);
|
||||
|
||||
/** \brief Register a callback for buildling terms based on the relational operators. */
|
||||
void Z3_API Z3_fixedpoint_set_reduce_app_callback(
|
||||
Z3_context c, Z3_fixedpoint d, Z3_fixedpoint_reduce_app_callback_fptr cb);
|
||||
|
||||
/*@}*/
|
||||
/*@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
|
@ -23,18 +23,11 @@ Notes:
|
|||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/**
|
||||
\defgroup capi C API
|
||||
|
||||
*/
|
||||
|
||||
/** \defgroup capi C API */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
@name Floating-Point API
|
||||
*/
|
||||
/** @name Floating-Point Arithmetic */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
\brief Create the RoundingMode sort.
|
||||
|
||||
|
@ -258,7 +251,7 @@ extern "C" {
|
|||
/**
|
||||
\brief Create an expression of FloatingPoint sort from three bit-vector expressions.
|
||||
|
||||
This is the operator named `fp' in the SMT FP theory definition.
|
||||
This is the operator named `fp' in the SMT FP theory definition.
|
||||
Note that \c sign is required to be a bit-vector of size 1. Significand and exponent
|
||||
are required to be greater than 1 and 2 respectively. The FloatingPoint sort
|
||||
of the resulting expression is automatically determined from the bit-vector sizes
|
||||
|
@ -765,7 +758,7 @@ extern "C" {
|
|||
|
||||
Produces a term that represents the conversion of the floating-poiunt term t into a
|
||||
bit-vector term of size sz in unsigned 2's complement format. If necessary, the result
|
||||
will be rounded according to rounding mode rm.
|
||||
will be rounded according to rounding mode rm.
|
||||
|
||||
\param c logical context
|
||||
\param rm term of RoundingMode sort
|
||||
|
@ -781,7 +774,7 @@ extern "C" {
|
|||
|
||||
Produces a term that represents the conversion of the floating-poiunt term t into a
|
||||
bit-vector term of size sz in signed 2's complement format. If necessary, the result
|
||||
will be rounded according to rounding mode rm.
|
||||
will be rounded according to rounding mode rm.
|
||||
|
||||
\param c logical context
|
||||
\param rm term of RoundingMode sort
|
||||
|
@ -807,15 +800,12 @@ extern "C" {
|
|||
Z3_ast Z3_API Z3_mk_fpa_to_real(Z3_context c, Z3_ast t);
|
||||
|
||||
|
||||
/**
|
||||
@name Z3-specific floating-point extensions
|
||||
*/
|
||||
/** @name Z3-specific floating-point extensions */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
\brief Retrieves the number of bits reserved for the exponent in a FloatingPoint sort.
|
||||
|
||||
\param c logical context
|
||||
\param c logical context
|
||||
\param s FloatingPoint sort
|
||||
|
||||
def_API('Z3_fpa_get_ebits', UINT, (_in(CONTEXT),_in(SORT)))
|
||||
|
@ -825,7 +815,7 @@ extern "C" {
|
|||
/**
|
||||
\brief Retrieves the number of bits reserved for the significand in a FloatingPoint sort.
|
||||
|
||||
\param c logical context
|
||||
\param c logical context
|
||||
\param s FloatingPoint sort
|
||||
|
||||
def_API('Z3_fpa_get_sbits', UINT, (_in(CONTEXT),_in(SORT)))
|
||||
|
@ -835,9 +825,9 @@ extern "C" {
|
|||
/**
|
||||
\brief Retrieves the sign of a floating-point literal.
|
||||
|
||||
\param c logical context
|
||||
\param c logical context
|
||||
\param t a floating-point numeral
|
||||
\param sgn sign
|
||||
\param sgn sign
|
||||
|
||||
Remarks: sets \c sgn to 0 if the literal is NaN or positive and to 1 otherwise.
|
||||
|
||||
|
@ -848,7 +838,7 @@ extern "C" {
|
|||
/**
|
||||
\brief Return the significand value of a floating-point numeral as a string.
|
||||
|
||||
\param c logical context
|
||||
\param c logical context
|
||||
\param t a floating-point numeral
|
||||
|
||||
Remarks: The significand s is always 0 < s < 2.0; the resulting string is long
|
||||
|
@ -863,6 +853,7 @@ extern "C" {
|
|||
|
||||
\param c logical context
|
||||
\param t a floating-point numeral
|
||||
\param n pointer to output uint64
|
||||
|
||||
Remarks: This function extracts the significand bits in `t`, without the
|
||||
hidden bit or normalization. Sets the Z3_INVALID_ARG error code if the
|
||||
|
@ -875,7 +866,7 @@ extern "C" {
|
|||
/**
|
||||
\brief Return the exponent value of a floating-point numeral as a string
|
||||
|
||||
\param c logical context
|
||||
\param c logical context
|
||||
\param t a floating-point numeral
|
||||
|
||||
def_API('Z3_fpa_get_numeral_exponent_string', STRING, (_in(CONTEXT), _in(AST)))
|
||||
|
@ -887,7 +878,7 @@ extern "C" {
|
|||
|
||||
\param c logical context
|
||||
\param t a floating-point numeral
|
||||
\param n exponent
|
||||
\param n exponent
|
||||
|
||||
def_API('Z3_fpa_get_numeral_exponent_int64', BOOL, (_in(CONTEXT), _in(AST), _out(INT64)))
|
||||
*/
|
||||
|
@ -928,9 +919,7 @@ extern "C" {
|
|||
def_API('Z3_mk_fpa_to_fp_int_real', AST, (_in(CONTEXT),_in(AST),_in(AST),_in(AST),_in(SORT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_mk_fpa_to_fp_int_real(Z3_context c, Z3_ast rm, Z3_ast exp, Z3_ast sig, Z3_sort s);
|
||||
|
||||
/*@}*/
|
||||
|
||||
/*@}*/
|
||||
/*@}*/
|
||||
|
||||
|
|
|
@ -23,21 +23,13 @@ Notes:
|
|||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/**
|
||||
\defgroup capi C API
|
||||
|
||||
*/
|
||||
|
||||
/** \defgroup capi C API */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
@name Interpolation API
|
||||
*/
|
||||
/** @name Interpolation facilities */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
\brief \mlh mk_interp c a \endmlh
|
||||
Create an AST node marking a formula position for interpolation.
|
||||
\brief Create an AST node marking a formula position for interpolation.
|
||||
|
||||
The node \c a must have Boolean sort.
|
||||
|
||||
|
@ -112,7 +104,7 @@ extern "C" {
|
|||
|
||||
Currently, the only SMT solver that is supported is the legacy
|
||||
SMT solver. Such a solver is available as the default solver in
|
||||
#Z3_context objects produced by #Z3_mk_interpolation_context.
|
||||
\c Z3_context objects produced by #Z3_mk_interpolation_context.
|
||||
Currently, the theories supported are equality with
|
||||
uninterpreted functions, linear integer arithmetic, and the
|
||||
theory of arrays (in SMT-LIB terms, this is AUFLIA).
|
||||
|
@ -282,7 +274,6 @@ extern "C" {
|
|||
Z3_string filename,
|
||||
unsigned num_theory,
|
||||
Z3_ast theory[]);
|
||||
|
||||
/*@}*/
|
||||
/*@}*/
|
||||
|
||||
|
|
|
@ -23,10 +23,3 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
#ifndef DEFINE_VOID
|
||||
#define DEFINE_VOID(T) typedef void* T
|
||||
#endif
|
||||
|
||||
#ifndef BEGIN_MLAPI_EXCLUDE
|
||||
#define BEGIN_MLAPI_EXCLUDE
|
||||
#endif
|
||||
#ifndef END_MLAPI_EXCLUDE
|
||||
#define END_MLAPI_EXCLUDE
|
||||
#endif
|
||||
|
|
223
src/api/z3_optimization.h
Normal file
223
src/api/z3_optimization.h
Normal file
|
@ -0,0 +1,223 @@
|
|||
/*++
|
||||
Copyright (c) 2015 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
z3_optimization.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Optimization facilities
|
||||
|
||||
Author:
|
||||
|
||||
Christoph M. Wintersteiger (cwinter) 2015-12-03
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#ifndef Z3_OPTIMIZATION_H_
|
||||
#define Z3_OPTIMIZATION_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/** \defgroup capi C API */
|
||||
/*@{*/
|
||||
|
||||
/** @name Optimization facilities */
|
||||
/*@{*/
|
||||
/**
|
||||
\brief Create a new optimize context.
|
||||
|
||||
\remark User must use #Z3_optimize_inc_ref and #Z3_optimize_dec_ref to manage optimize objects.
|
||||
Even if the context was created using #Z3_mk_context instead of #Z3_mk_context_rc.
|
||||
|
||||
def_API('Z3_mk_optimize', OPTIMIZE, (_in(CONTEXT), ))
|
||||
*/
|
||||
Z3_optimize Z3_API Z3_mk_optimize(Z3_context c);
|
||||
|
||||
/**
|
||||
\brief Increment the reference counter of the given optimize context
|
||||
|
||||
def_API('Z3_optimize_inc_ref', VOID, (_in(CONTEXT), _in(OPTIMIZE)))
|
||||
*/
|
||||
void Z3_API Z3_optimize_inc_ref(Z3_context c,Z3_optimize d);
|
||||
|
||||
/**
|
||||
\brief Decrement the reference counter of the given optimize context.
|
||||
|
||||
def_API('Z3_optimize_dec_ref', VOID, (_in(CONTEXT), _in(OPTIMIZE)))
|
||||
*/
|
||||
void Z3_API Z3_optimize_dec_ref(Z3_context c,Z3_optimize d);
|
||||
|
||||
/**
|
||||
\brief Assert hard constraint to the optimization context.
|
||||
|
||||
def_API('Z3_optimize_assert', VOID, (_in(CONTEXT), _in(OPTIMIZE), _in(AST)))
|
||||
*/
|
||||
void Z3_API Z3_optimize_assert(Z3_context c, Z3_optimize o, Z3_ast a);
|
||||
|
||||
/**
|
||||
\brief Assert soft constraint to the optimization context.
|
||||
\param c - context
|
||||
\param o - optimization context
|
||||
\param a - formula
|
||||
\param weight - a positive weight, penalty for violating soft constraint
|
||||
\param id - optional identifier to group soft constraints
|
||||
|
||||
def_API('Z3_optimize_assert_soft', UINT, (_in(CONTEXT), _in(OPTIMIZE), _in(AST), _in(STRING), _in(SYMBOL)))
|
||||
*/
|
||||
unsigned Z3_API Z3_optimize_assert_soft(Z3_context c, Z3_optimize o, Z3_ast a, Z3_string weight, Z3_symbol id);
|
||||
|
||||
|
||||
/**
|
||||
\brief Add a maximization constraint.
|
||||
\param c - context
|
||||
\param o - optimization context
|
||||
\param a - arithmetical term
|
||||
def_API('Z3_optimize_maximize', UINT, (_in(CONTEXT), _in(OPTIMIZE), _in(AST)))
|
||||
*/
|
||||
unsigned Z3_API Z3_optimize_maximize(Z3_context c, Z3_optimize o, Z3_ast t);
|
||||
|
||||
/**
|
||||
\brief Add a minimization constraint.
|
||||
\param c - context
|
||||
\param o - optimization context
|
||||
\param a - arithmetical term
|
||||
|
||||
def_API('Z3_optimize_minimize', UINT, (_in(CONTEXT), _in(OPTIMIZE), _in(AST)))
|
||||
*/
|
||||
unsigned Z3_API Z3_optimize_minimize(Z3_context c, Z3_optimize o, Z3_ast t);
|
||||
|
||||
|
||||
/**
|
||||
\brief Create a backtracking point.
|
||||
|
||||
The optimize solver contains a set of rules, added facts and assertions.
|
||||
The set of rules, facts and assertions are restored upon calling #Z3_optimize_pop.
|
||||
|
||||
\sa Z3_optimize_pop
|
||||
|
||||
def_API('Z3_optimize_push', VOID, (_in(CONTEXT), _in(OPTIMIZE)))
|
||||
*/
|
||||
void Z3_API Z3_optimize_push(Z3_context c,Z3_optimize d);
|
||||
|
||||
/**
|
||||
\brief Backtrack one level.
|
||||
|
||||
\sa Z3_optimize_push
|
||||
|
||||
\pre The number of calls to pop cannot exceed calls to push.
|
||||
|
||||
def_API('Z3_optimize_pop', VOID, (_in(CONTEXT), _in(OPTIMIZE)))
|
||||
*/
|
||||
void Z3_API Z3_optimize_pop(Z3_context c,Z3_optimize d);
|
||||
|
||||
/**
|
||||
\brief Check consistency and produce optimal values.
|
||||
\param c - context
|
||||
\param o - optimization context
|
||||
|
||||
def_API('Z3_optimize_check', INT, (_in(CONTEXT), _in(OPTIMIZE)))
|
||||
*/
|
||||
Z3_lbool Z3_API Z3_optimize_check(Z3_context c, Z3_optimize o);
|
||||
|
||||
|
||||
/**
|
||||
\brief Retrieve a string that describes the last status returned by #Z3_optimize_check.
|
||||
|
||||
Use this method when #Z3_optimize_check returns Z3_L_UNDEF.
|
||||
|
||||
def_API('Z3_optimize_get_reason_unknown', STRING, (_in(CONTEXT), _in(OPTIMIZE) ))
|
||||
*/
|
||||
Z3_string Z3_API Z3_optimize_get_reason_unknown(Z3_context c,Z3_optimize d);
|
||||
|
||||
/**
|
||||
\brief Retrieve the model for the last #Z3_optimize_check
|
||||
|
||||
The error handler is invoked if a model is not available because
|
||||
the commands above were not invoked for the given optimization
|
||||
solver, or if the result was \c Z3_L_FALSE.
|
||||
|
||||
def_API('Z3_optimize_get_model', MODEL, (_in(CONTEXT), _in(OPTIMIZE)))
|
||||
*/
|
||||
Z3_model Z3_API Z3_optimize_get_model(Z3_context c, Z3_optimize o);
|
||||
|
||||
/**
|
||||
\brief Set parameters on optimization context.
|
||||
|
||||
\param c - context
|
||||
\param o - optimization context
|
||||
\param p - parameters
|
||||
|
||||
def_API('Z3_optimize_set_params', VOID, (_in(CONTEXT), _in(OPTIMIZE), _in(PARAMS)))
|
||||
*/
|
||||
void Z3_API Z3_optimize_set_params(Z3_context c, Z3_optimize o, Z3_params p);
|
||||
|
||||
/**
|
||||
\brief Return the parameter description set for the given optimize object.
|
||||
|
||||
\param c - context
|
||||
\param o - optimization context
|
||||
|
||||
def_API('Z3_optimize_get_param_descrs', PARAM_DESCRS, (_in(CONTEXT), _in(OPTIMIZE)))
|
||||
*/
|
||||
Z3_param_descrs Z3_API Z3_optimize_get_param_descrs(Z3_context c, Z3_optimize o);
|
||||
|
||||
/**
|
||||
\brief Retrieve lower bound value or approximation for the i'th optimization objective.
|
||||
|
||||
\param c - context
|
||||
\param o - optimization context
|
||||
\param idx - index of optimization objective
|
||||
|
||||
def_API('Z3_optimize_get_lower', AST, (_in(CONTEXT), _in(OPTIMIZE), _in(UINT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_optimize_get_lower(Z3_context c, Z3_optimize o, unsigned idx);
|
||||
|
||||
/**
|
||||
\brief Retrieve upper bound value or approximation for the i'th optimization objective.
|
||||
|
||||
\param c - context
|
||||
\param o - optimization context
|
||||
\param idx - index of optimization objective
|
||||
|
||||
def_API('Z3_optimize_get_upper', AST, (_in(CONTEXT), _in(OPTIMIZE), _in(UINT)))
|
||||
*/
|
||||
Z3_ast Z3_API Z3_optimize_get_upper(Z3_context c, Z3_optimize o, unsigned idx);
|
||||
|
||||
/**
|
||||
\brief Print the current context as a string.
|
||||
\param c - context.
|
||||
\param o - optimization context.
|
||||
|
||||
def_API('Z3_optimize_to_string', STRING, (_in(CONTEXT), _in(OPTIMIZE)))
|
||||
*/
|
||||
Z3_string Z3_API Z3_optimize_to_string(
|
||||
Z3_context c,
|
||||
Z3_optimize o);
|
||||
|
||||
|
||||
/**
|
||||
\brief Return a string containing a description of parameters accepted by optimize.
|
||||
|
||||
def_API('Z3_optimize_get_help', STRING, (_in(CONTEXT), _in(OPTIMIZE)))
|
||||
*/
|
||||
Z3_string Z3_API Z3_optimize_get_help(Z3_context c, Z3_optimize t);
|
||||
|
||||
/**
|
||||
\brief Retrieve statistics information from the last call to #Z3_optimize_check
|
||||
|
||||
def_API('Z3_optimize_get_statistics', STATS, (_in(CONTEXT), _in(OPTIMIZE)))
|
||||
*/
|
||||
Z3_stats Z3_API Z3_optimize_get_statistics(Z3_context c,Z3_optimize d);
|
||||
/*@}*/
|
||||
/*@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
|
@ -24,17 +24,11 @@ Notes:
|
|||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/**
|
||||
\defgroup capi C API
|
||||
|
||||
*/
|
||||
|
||||
/** \defgroup capi C API */
|
||||
/*@{*/
|
||||
|
||||
|
||||
/**
|
||||
@name Polynomials API
|
||||
*/
|
||||
/** @name Polynomials */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,24 +25,15 @@ Notes:
|
|||
#ifndef Z3_PRIVATE_H_
|
||||
#define Z3_PRIVATE_H_
|
||||
|
||||
|
||||
#ifndef CAMLIDL
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
#else
|
||||
[pointer_default(ref)] interface Z3 {
|
||||
#endif // CAMLIDL
|
||||
|
||||
Z3_bool Z3_API Z3_get_numeral_rational(Z3_context c, Z3_ast a, rational& r);
|
||||
|
||||
#ifndef CAMLIDL
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif // __cplusplus
|
||||
#else
|
||||
}
|
||||
#endif // CAMLIDL
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -26,18 +26,11 @@ Notes:
|
|||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/**
|
||||
\defgroup capi C API
|
||||
|
||||
*/
|
||||
|
||||
/** \defgroup capi C API */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
@name Real Closed Fields API
|
||||
*/
|
||||
/** @name Real Closed Fields */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
\brief Delete a RCF numeral created using the RCF API.
|
||||
|
||||
|
|
Loading…
Reference in a new issue