3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +00:00
Commit graph

61 commits

Author SHA1 Message Date
Nikolaj Bjorner
cd0af999a8 fix #6302
crash due to not checking for dead rows.
non-termination due to solving div and mod separately.
To ensure termination one needs to at least process them simultaneously, otherwise the metric of number-of-terms x under number of mod/div does not decrease. Substituting in K*y + z under either a mod or div increases the number of terms under a mod/div when eliminating only one of the kinds.
Currently handling divides constraints separately because pre-existing solution uses the model to determine z as a constant between 0 and K-1. The treatment of mod/div is supposed to be more general and use a variable while at the same time reducing the mod/div terms where the eliminated variable is used (the variable z is not added under the mod/div terms, but instead the model is used to determine cut-offs to calculate mod/div directly.
2022-08-29 14:32:13 -07:00
Nikolaj Bjorner
f6e151a49c assert 2022-08-24 17:16:47 -07:00
Nikolaj Bjorner
d975886cdc fix #6300
several boundary cases with repeated rows being retired twice and non-termination for K = 1 where decomposition is just identity.
2022-08-24 17:16:47 -07:00
Nikolaj Bjorner
540e36e6cb roll version number
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-18 15:47:08 -07:00
Nikolaj Bjorner
cb272bd7a8 fix missing removal of x in solve_mod 2022-08-17 07:31:26 -07:00
Nikolaj Bjorner
b169292743 add parameter descriptions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-16 08:26:53 -07:00
Nikolaj Bjorner
1d87592b13 fixes to mod/div elimination
elimination of mod/div should be applied to all occurrences of x under mod/div at the same time. It affects performance and termination to perform elimination on each occurrence since substituting in two new variables for eliminated x doubles the number of variables under other occurrences.

Also generalize inequality resolution to use div.

The new features are still disabled.
2022-08-14 11:34:03 -07:00
Nikolaj Bjorner
f014e30d46 disable case1
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-13 08:53:19 -07:00
Nikolaj Bjorner
d80e2fb61d fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-13 08:49:07 -07:00
Nikolaj Bjorner
5669cf65bc bug fixes to mod/div quantifier elimination features 2022-08-13 06:18:13 -07:00
Nikolaj Bjorner
550d6914b1 updates to div/mod handling in quantifier projection
note: the new code remains disabled at this point.
2022-08-12 14:39:33 -04:00
Nikolaj Bjorner
d272becade fixes for division 2022-08-12 11:54:26 -04:00
Nikolaj Bjorner
03385bf78d improve quantifier elimination for arithmetic
This update changes the handling of mod and adds support for nested div terms.

Simple use cases that are handled using small results are given below.

```
(declare-const x Int)
(declare-const y Int)
(declare-const z Int)
(assert (exists ((x Int)) (and (<= y (* 10 x)) (<= (* 10 x) z))))
(apply qe2)
(reset)

(declare-const y Int)
(assert (exists ((x Int)) (and (> x 0) (= (div x 41) y))))
(apply qe2)
(reset)

(declare-const y Int)
(assert (exists ((x Int)) (= (mod x 41) y)))
(apply qe2)
(reset)
```

The main idea is to introduce definition rows for mod/div terms.
Elimination of variables under mod/div is defined by rewriting the variable to multiples of the mod/divisior and remainder.

The functionality is disabled in this push.
2022-08-12 10:20:43 -04:00
Arie Gurfinkel
aa0719abae model_based_opt: fix enabling complete resolution
a bug prevented an optimization to be enabled
2022-08-05 18:11:23 +03:00
Nikolaj Bjorner
6deb4dee37 disable normalize
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-11 13:30:50 -07:00
Nikolaj Bjorner
5aec9b32bd check zero
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-11 10:13:07 -07:00
Nikolaj Bjorner
860d904699 check zero
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-11 10:11:17 -07:00
Nikolaj Bjorner
361155685c ensure abs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-11 09:09:00 -07:00
Nikolaj Bjorner
cbaa16df57 lcm normalization
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-11 09:03:57 -07:00
Nikolaj Bjorner
da60abd84b #5445 2021-08-03 11:19:42 -07:00
Nikolaj Bjorner
202ed79a24 #5445 2021-08-03 11:17:23 -07:00
Nikolaj Bjorner
a4cc9e7895 #5429 #5445 2021-08-01 12:49:36 -07:00
Nikolaj Bjorner
16413b4f9a #5429 2021-07-27 17:18:22 -07:00
Nikolaj Bjorner
005d35f9c9 #5422 2021-07-21 07:39:39 -07:00
Nikolaj Bjorner
ca8f914dd8 #5422 2021-07-21 07:22:05 -07:00
Nikolaj Bjorner
b0a22105d6 na 2021-07-19 13:28:20 -07:00
Nikolaj Bjorner
188a478214 #5417
strict inequality (over reals) require solving for least-upper/greatest-lower bounds that may coincide with non-strict inequalities (be epsilon stronger). Instead of using the coefficient 'a' to turn the inequality into an equality, add the slack value as a constant.
2021-07-19 13:19:03 -07:00
Nikolaj Bjorner
cab1076514 #5336 2021-07-11 21:00:58 +02:00
Nikolaj Bjorner
c1ab7987f6 #5324 2021-06-07 11:41:35 -07:00
Nikolaj Bjorner
9afc59d5b4 #5324 2021-06-06 15:39:23 -07:00
Nikolaj Bjorner
7cd901019f #5324 2021-06-05 17:14:51 -07: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
b66360d0b5 fix #3809
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-07 11:15:34 -07:00
Nikolaj Bjorner
67497ba897 fix #3131
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-04 09:38:36 -08:00
Bruce Mitchener
a3281a02db mk_coeffs_without was inadvertently copying src.
Pass it via ref.
2018-11-28 20:12:47 +07:00
Nikolaj Bjorner
fc4627a24f force the new arithmetic solver for QF_LIA
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-07-09 16:33:48 -07:00
Nikolaj Bjorner
de454db58c guard expensive ite rewrites under configuration
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-07-09 14:17:39 -07:00
Nikolaj Bjorner
20fc573d5b add laxer check for oeq_quant_intro
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-27 11:24:56 -07:00
Nikolaj Bjorner
bf4edef761 fix mbi arithmetic solver for lower bounds
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-26 06:37:47 -07:00
Nikolaj Bjorner
baa96909cc mb-skolem for arithmetic with model repair
The contract is that users of mb-skolem ensure that
interface equalities are preserved (by adding a
sufficient set of disequalities, such as a chain
x1 < x2 < x3 .., to force that solutions for
x_i does not clash).

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-14 17:26:04 -07:00
Nikolaj Bjorner
1902360361 debugging mbi
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-14 16:08:52 -07:00
Nikolaj Bjorner
49279d7047 debugging mbi
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-14 16:08:52 -07:00
Nikolaj Bjorner
b62d73f209 first round for combined mbi
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-14 16:08:52 -07:00
Nikolaj Bjorner
0ae246ad2b add defs to arith solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-14 16:08:52 -07:00
Nikolaj Bjorner
fee7828b51 fix solve bug
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-14 16:08:51 -07:00
Nikolaj Bjorner
6558999cef fixes #1171
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-07-27 08:46:20 -07:00
Nikolaj Bjorner
1a07c6c188 address ASAN bug report #1160
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-07-26 20:48:49 -07:00
Nikolaj Bjorner
64674386de fix ubuntu build failure
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-07-15 13:39:50 -07:00
Nikolaj Bjorner
84aec95eda fix up use-list in 3x3 resolution case. Regression RND_3_24.smt2
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-06-28 11:41:57 -07:00
Nikolaj Bjorner
b66d457b19 move arithmetical mbp functionality to model_based_opt
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-06-26 16:12:14 -07:00