3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 11:25:51 +00:00
Commit graph

39 commits

Author SHA1 Message Date
Nikolaj Bjorner
35986f3979 fix #6084
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-07 11:29:57 -07:00
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
Nikolaj Bjorner
b1ff4bc24a no normalize
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-20 19:21:19 +01:00
Nikolaj Bjorner
75a81af426 fix #5786
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-20 19:18:23 +01:00
Nikolaj Bjorner
4a6083836a call it data instead of c_ptr for approaching C++11 std::vector convention. 2021-04-13 18:17:35 -07:00
Nikolaj Bjorner
7d60d8462d patch for Sturm sequence bug #4961 2021-01-24 12:58:25 -08:00
Nikolaj Bjorner
c7704ef9af pass algebraic manager to arith-plugin mk-numeral because rational check may overwrite the argument using the current manager deals with crash as part of #4532
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-26 17:52:28 -07:00
Nikolaj Bjorner
dc852a6f83 fix #4110 2020-04-26 14:13:58 -07:00
Nikolaj Bjorner
0fc8ebc8cc fix #3683
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-04 18:56:10 -07:00
Nikolaj Bjorner
69783db5e8 print roots as part of test
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-24 15:28:51 -07:00
Nikolaj Bjorner
af51d98a32 avoid unintialized value build warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-24 15:02:31 -07:00
Nikolaj Bjorner
a557913307 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-24 12:45:16 -07:00
Nikolaj Bjorner
a4f668eef0 add unit test for #2867
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-24 11:52:41 -07:00
Nikolaj Bjorner
55ebb236db add self-contained check for triangle inequality for #2867
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-17 15:39:30 -07:00
ahumenberger
de9bc930e9
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 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
2020-03-17 09:09:02 -07:00
Nikolaj Bjorner
9179deb746 add get-interpolant command
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-01-20 16:22:38 -06:00
Nikolaj Bjorner
d3b105f9f8 move out sign
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-01-20 16:22:38 -06:00
Nikolaj Bjorner
d0cf1458e3 fix #2630
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-10-12 04:12:06 -07:00
Nikolaj Bjorner
7c10fb83a0 fix #2615
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-10-06 19:00:14 -07:00
Nikolaj Bjorner
39edf73e78 fix #2613 fix #2612
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-10-05 16:57:51 -07:00
Nikolaj Bjorner
e0d8cefde4 remove cooperate
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-06-12 20:15:46 -07:00
Nikolaj Bjorner
0acc042bf7 fix #2120 fix #2122
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-02-03 17:15:38 +01:00
Florian Pigorsch
326bf401b9 Fix some spelling errors (mostly in comments). 2018-10-20 17:07:41 +02:00
Michał Janiszewski
cfd0486582 Catch exceptions by const-reference
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.
2018-10-16 19:16:07 +02:00
Nuno Lopes
009708ed07 remove unneeded creation of tmp mpz_manager 2018-07-09 10:52:27 +01:00
Bruce Mitchener
76eb7b9ede Use nullptr. 2018-02-12 14:05:55 +07:00
Bruce Mitchener
7167fda1dc Use override rather than virtual. 2018-02-10 09:56:33 +07:00
Nuno Lopes
9b54b4e784 fix vector<> to support non-POD types
adjust code to std::move and avoid unnecessary/illegal
2017-10-16 00:54:29 +01:00
Nikolaj Bjorner
2b82fd5d0c updated include directives
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-08-01 10:51:47 -07:00
Nikolaj Bjorner
b19f94ae5b make include paths uniformly use path relative to src. #534
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-07-31 13:24:11 -07:00
Nikolaj Bjorner
5b497b6249 reduce set of mainly verbose warnings raised by -Wmaybe-uninitialized and unused variable warnings from release mode builds
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-06-22 20:25:47 -07:00
Nikolaj Bjorner
f175f864ec merge useful utilities from qsat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-03-19 12:01:44 -07:00
Christoph M. Wintersteiger
4e37821dde "canceled" -> Z3_CANCELED_MSG
Relates to #431
2016-02-04 13:52:43 +00:00
Nikolaj Bjorner
baee4225a7 reworking cancellation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-11 16:21:24 -08:00
Nikolaj Bjorner
981f8226fe moving to resource managed cancellation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-11 13:36:47 -08:00
Leonardo de Moura
607fab486c Fix incorrect uses of set_cancel()
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-12-17 18:48:10 -08:00
Leonardo de Moura
1871bef6e1 cleaned algebraic params
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-12-02 12:47:20 -08:00
Leonardo de Moura
cf28cbab0a saved params work
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-11-29 17:19:12 -08:00
Leonardo de Moura
9e299b88c4 reorganizing the code
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-10-23 21:53:34 -07:00
Renamed from src/polynomial/algebraic_numbers.cpp (Browse further)