mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
Extract defining components of algebraic number via C and C++ API (#3321)
* First steps toward adding Julia bindings * Simplifications * Streamlining * Friends of tactic and probe * Add missing functions * Update azure-pipelines.yml for Azure Pipelines * Update azure-pipelines.yml for Azure Pipelines * Update azure-pipelines.yml for Azure Pipelines * Update azure-pipelines.yml for Azure Pipelines * Changes for CxxWrap v0.9.0 * Wrap enumeration and tuple sort * Wrap z3::fixedpoint * Wrap z3::optimize * Wrap missing functions * Fix aux types * Add some missing functions * Revert "Update azure-pipelines.yml for Azure Pipelines" This reverts commit5aab9f9240
. * Revert "Update azure-pipelines.yml for Azure Pipelines" This reverts commitcfccd7ca2c
. * Revert "Update azure-pipelines.yml for Azure Pipelines" This reverts commitf24740c595
. * Revert "Update azure-pipelines.yml for Azure Pipelines" This reverts commit592499eaa0
. * Checkout current version of pipeline * Build Julia bindings on macOS * Extract components of algebraic number * Add type to C API function name * Remove blank line * Typo in doc * Return Z3_ast_vector containing coefficients
This commit is contained in:
parent
1c5283f3a4
commit
de9bc930e9
6 changed files with 160 additions and 72 deletions
|
@ -1951,6 +1951,19 @@ namespace algebraic_numbers {
|
|||
}
|
||||
}
|
||||
|
||||
unsigned get_i(numeral const & a) {
|
||||
if (a.is_basic()) {
|
||||
if (is_zero(a)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
algebraic_cell * c = a.to_algebraic();
|
||||
return c->m_i;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
\brief "Optimistic" mapping: it assumes all variables are mapped to
|
||||
basic_values (rationals). Throws an exception if that is not the case.
|
||||
|
@ -3000,6 +3013,10 @@ namespace algebraic_numbers {
|
|||
m_imp->get_polynomial(a, r);
|
||||
}
|
||||
|
||||
unsigned manager::get_i(numeral const & a) {
|
||||
return m_imp->get_i(a);
|
||||
}
|
||||
|
||||
void manager::get_lower(numeral const & a, mpbq & l) {
|
||||
SASSERT(!is_rational(a));
|
||||
bqm().set(l, a.to_algebraic()->m_interval.lower());
|
||||
|
|
|
@ -307,6 +307,7 @@ namespace algebraic_numbers {
|
|||
sign eval_sign_at(polynomial_ref const & p, polynomial::var2anum const & x2v);
|
||||
|
||||
void get_polynomial(numeral const & a, svector<mpz> & r);
|
||||
unsigned get_i(numeral const & a);
|
||||
|
||||
// Procedures for getting lower and upper bounds for irrational numbers
|
||||
void get_lower(numeral const & a, mpbq & l);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue