In some cases, Z3_algebraic_get_i() returned 0. For example, in the following
Python snippet, the last assert would fail:
import z3
x = z3.Real('x')
s = z3.Solver()
s.add( (x * x) - 2 == 0, x <= 0)
s.check()
val_x = s.model().get_interp(x)
assert val_x.index() == 1
The problem was that `algebraic_numbers::manager:👿:get_i()` did not
check whether the root index was properly initialized.
This commit fixes this issue by checking whether root index is initialized
the same way various other routines do.
Fixes issue #5807.
Signed-off-by: Jan Vrany <jan.vrany@labware.com>
* 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 commit 5aab9f9240.
* Revert "Update azure-pipelines.yml for Azure Pipelines"
This reverts commit cfccd7ca2c.
* Revert "Update azure-pipelines.yml for Azure Pipelines"
This reverts commit f24740c595.
* Revert "Update azure-pipelines.yml for Azure Pipelines"
This reverts commit 592499eaa0.
* 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
Exceptions caught by value incur needless cost in C++, most of them can
be caught by const-reference, especially as nearly none are actually
used. This could allow compiler generate a slightly more efficient code.