3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-16 22:05:36 +00:00
z3/src/math
Jan Vraný bdf7de1703
Care for root index being undefine while calling Z3_algebraic_get_i() (#5888)
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>
2022-03-16 19:28:03 -07:00
..
automata call it data instead of c_ptr for approaching C++11 std::vector convention. 2021-04-13 18:17:35 -07:00
dd remove a hundred implicit constructors/destructors 2021-05-23 14:25:01 +01:00
grobner remove a hundred implicit constructors/destructors 2021-05-23 14:25:01 +01:00
hilbert Add and fix a few general compiler warnings. (#5628) 2021-10-29 15:42:32 +02:00
interval booyah 2020-07-04 15:56:30 -07:00
lp na 2021-12-08 09:04:13 -08:00
polynomial Care for root index being undefine while calling Z3_algebraic_get_i() (#5888) 2022-03-16 19:28:03 -07:00
realclosure Add and fix a few general compiler warnings. (#5628) 2021-10-29 15:42:32 +02:00
simplex support threading for TRACE mode 2021-10-25 13:35:32 +02:00
subpaving breaking change. Enforce append semantics everywhere for parameter updates #5744 2021-12-30 19:11:14 -08:00