3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-09 00:35:47 +00:00

Simplify RCF C API. Add Z3_rcf_mk_roots (C API) and MkRoots (Python API). Implement basic root isolation support.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-01-07 12:25:28 -08:00
parent 3c1f1a3b65
commit 09b5724d82
6 changed files with 216 additions and 118 deletions

View file

@ -27,18 +27,11 @@ extern "C" {
#endif // __cplusplus
/**
\brief Increment the reference counter of a RCF numeral.
def_API('Z3_rcf_inc_ref', VOID, (_in(CONTEXT), _in(RCF_NUM)))
*/
void Z3_API Z3_rcf_inc_ref(__in Z3_context c, __in Z3_rcf_num a);
\brief Delete a RCF numeral created using the RCF API.
/**
\brief Decrement the reference counter of a RCF numeral.
def_API('Z3_rcf_dec_ref', VOID, (_in(CONTEXT), _in(RCF_NUM)))
def_API('Z3_rcf_del', VOID, (_in(CONTEXT), _in(RCF_NUM)))
*/
void Z3_API Z3_rcf_dec_ref(__in Z3_context c, __in Z3_rcf_num a);
void Z3_API Z3_rcf_del(__in Z3_context c, __in Z3_rcf_num a);
/**
\brief Return a RCF rational using the given string.
@ -75,6 +68,17 @@ extern "C" {
*/
Z3_rcf_num Z3_API Z3_rcf_mk_infinitesimal(__in Z3_context c, __in Z3_string name);
/**
\brief Store in roots the roots of the polynomial <tt>a[n-1]*x^{n-1} + ... + a[0]</tt>.
The output vector \c roots must have size \c n.
It returns the number of roots of the polynomial.
\pre The input polynomial is not the zero polynomial.
def_API('Z3_rcf_mk_roots', UINT, (_in(CONTEXT), _in(UINT), _in_array(1, RCF_NUM), _out_array(1, RCF_NUM)))
*/
unsigned Z3_API Z3_rcf_mk_roots(__in Z3_context c, __in unsigned n, __in_ecount(n) Z3_rcf_num const a[], __out_ecount(n) Z3_rcf_num roots[]);
/**
\brief Return the value a + b.