3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-18 06:39:02 +00:00
Commit graph

467 commits

Author SHA1 Message Date
Nikolaj Bjorner 64e0e785e7 #5953 2022-08-21 18:28:07 -07:00
Nikolaj Bjorner 09ab575d29 parens 2022-08-21 18:27:14 -07:00
Nikolaj Bjorner c3d635cf77 handle build warning
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-18 12:50:30 -07:00
Nikolaj Bjorner 1a5503c87b enable new code path for mod handling 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 583dae2e27 enable nested division
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-15 16:11:00 -07:00
Nikolaj Bjorner 138f0d269c fix regression found by fuzzers fix #6271 2022-08-14 12:26:33 -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 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 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
Bruce Mitchener 5014b1a34d Use = default for virtual constructors. 2022-08-05 18:11:46 +03:00
Bruce Mitchener 5d0dea05aa
Remove empty leaf destructors. (#6211) 2022-07-30 10:07:03 +01:00
Nikolaj Bjorner 32614722ef fix #6176
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-20 21:19:20 -07:00
Nuno Lopes d9fcfdab34 fix debug build 2022-06-17 14:35:33 +01:00
Nikolaj Bjorner 51ed13f96a update topological sort to use arrays instead of hash tables, expose Context over Z3Object for programmability
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-08 06:28:24 -07:00
Nikolaj Bjorner 5154295202 #5932 2022-03-31 23:18:03 -07:00
Nikolaj Bjorner 4b6679e8e0 #5753 2022-01-13 12:19:54 -08:00
Nikolaj Bjorner 56d3718cde add simplification with qe-lite as an option #5767
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-12 03:41:21 -08:00
Nikolaj Bjorner 08294d62e5 separate dependencies for qe_lite 2022-01-12 03:26:22 -08:00
Nadav Rotem 9f9543ef69
Fix unused variable warnings. (#5760)
This commit fixes a few cases of unused variables in release builds.
The commit uses the (void)xxx; syntax which is used in other parts of
the code.
2022-01-08 18:18:30 -08:00
Nikolaj Bjorner d0fb3cba15 #5641 - projection that skips interpreted functions can violate model evaluation. 2022-01-02 17:45:43 -08:00
Nikolaj Bjorner fc77345bec breaking change. Enforce append semantics everywhere for parameter updates #5744
Replace semantics doesn't work with assumptions made elsewhere in code.
The remedy is to apply append (override) semantics for parameter changes.
2021-12-30 19:11:14 -08:00
Nikolaj Bjorner 9f2b18cac5 add tactic name
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-07 13:37:57 -08:00
Henrich Lauko 96671cfc73
Add and fix a few general compiler warnings. (#5628)
* rewriter: fix unused variable warnings

* cmake: make missing non-virtual dtors error

* treewide: add missing virtual destructors

* cmake: add a few more checks

* api: add missing virtual destructor to user_propagator_base

* examples: compile cpp example with compiler warnings

* model: fix unused variable warnings

* rewriter: fix logical-op-parentheses warnings

* sat: fix unused variable warnings

* smt: fix unused variable warnings
2021-10-29 15:42:32 +02:00
Alexander Traud 1d45a33163
fix one typo and two misunderstandings for doxygen (#5633) 2021-10-29 15:35:05 +02:00
Nikolaj Bjorner 6f31d83633 fix #5541 2021-09-20 10:10:28 -07:00
Nikolaj Bjorner fea14245a0 #5454 2021-08-11 19:43:42 -07:00
Nikolaj Bjorner a4cc9e7895 #5429 #5445 2021-08-01 12:49:36 -07:00
Nikolaj Bjorner 2f49094d49 change debug output 2021-07-26 19:36:16 -07:00
Nikolaj Bjorner e5e7c510d5 #5422 2021-07-21 07:14:54 -07:00
Nikolaj Bjorner 2ccfb1937d na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-07-11 23:20:19 +02:00
Nikolaj Bjorner cab1076514 #5336 2021-07-11 21:00:58 +02:00
Nikolaj Bjorner 45228bf8fb #5323 heap use after free
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-06-20 09:25:19 -07:00
Nikolaj Bjorner c6f0afa008 #5324 2021-06-08 12:29:16 -07:00
Nikolaj Bjorner d450fd4227 #5215 2021-05-19 10:03:49 -07:00
Nikolaj Bjorner 55f8ad068f fix #5262 2021-05-17 15:51:03 -07:00
Nikolaj Bjorner cd82205b06 nit 2021-05-10 19:14:18 -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 1d12b72bbc log classificaiton
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-02-11 14:43:05 -08:00
Nikolaj Bjorner 25f53c0467 deal with warnings reported in https://launchpadlibrarian.net/522361319/buildlog_ubuntu-groovy-s390x.z3_4.8.10-1ubuntu4ppa1_BUILDING.txt.gz
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-02-11 13:49:47 -08:00
Nikolaj Bjorner a152bb1e80 remove template Context dependency in every trail object 2021-02-08 15:41:57 -08:00
Nikolaj Bjorner 8f577d3943 remove ast_manager get_sort method entirely 2021-02-02 13:57:01 -08:00
Nikolaj Bjorner 937b61fc88 fix build, refactor 2021-02-02 05:26:57 -08:00
Nikolaj Bjorner 3ae4c6e9de refactor get_sort 2021-02-02 04:45:54 -08:00
Nikolaj Bjorner 4455f6caf8 move to get_sort as method, add opt_lns pass, disable xor simplification unless configured, fix perf bug in model converter update trail 2021-02-02 03:58:19 -08:00
Nikolaj Bjorner fa4869e400 fix #4949 - and/or get rewritten depending on parameters for rewriter
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-01-20 01:08:54 -08:00
Nikolaj Bjorner 4ca6d6951f use updated C++ features 2021-01-07 17:32:05 -08:00
Nikolaj Bjorner 0643e7c0fc fix #4886
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-12-12 12:40:14 -08:00
Nikolaj Bjorner 2e684d58d2 redo purification
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-10-29 11:06:31 -07:00
Nikolaj Bjorner e2fbd05fe7 adding argument restriction to mbqi, fix tracking of m_src/m_dst for expr_safe_replace and avoid resetting the cache. 2020-10-27 11:41:52 -07:00
Nikolaj Bjorner 1ee2ba2a9b mbqi
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-10-26 11:06:40 -07:00
Nikolaj Bjorner c9900720f8 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-10-22 11:31:47 -07:00
Nikolaj Bjorner 72d407a49f
mbp (#4741)
* adding dt-solver

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* dt

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* move mbp to self-contained module

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* files

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* Create CMakeLists.txt

* dt

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* rename to bool_var2expr to indicate type class

* mbp

* na

* add projection

* na

* na

* na

* na

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* deps

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* testing arith/q

* na

* newline for model printing

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-10-21 15:48:40 -07:00
Nikolaj Bjorner 2f756da294
adding dt-solver (#4739)
* adding dt-solver

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* dt

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* move mbp to self-contained module

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* files

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* Create CMakeLists.txt

* dt

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* rename to bool_var2expr to indicate type class

* mbp

* na
2020-10-18 15:28:21 -07: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
Nuno Lopes bb26f219fe remove unneeded constructors (last round) 2020-07-12 17:41:57 +01:00
Nuno Lopes 23e6adcad3 fix a couple hundred deref-after-free bugs due to .c_str() on a temporary string 2020-07-11 20:24:45 +01:00
Nikolaj Bjorner d0e20e44ff booyah
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-04 15:56:30 -07:00
Nikolaj Bjorner 6a54c0bc04 fix issues reported in #4525
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-21 17:43:05 -07:00
Nikolaj Bjorner d09e6eccf0 re-enable proofs for qe-lite #3153
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-15 12:03:15 -07:00
Nuno Lopes ec1e733ef2 fix crash in qe_array ref counting due to wrong assignment operator of ptr_vector being called
thanks to Arie Gurfinkel for reporting this
2020-06-09 10:02:27 +01:00
Nikolaj Bjorner 57086edc42 close #4432
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-04 03:06:58 -07:00
Nikolaj Bjorner 9ca5b3f304 fix #4449
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-03 21:10:07 -07:00
Nuno Lopes e844aef896 remove a few more copy constructors, though still not enough to enable the assertion in vector
I give up for now; there are too many copies left for little return..
2020-06-03 20:32:13 +01:00
Nikolaj Bjorner 3a7df2c6ef fix various nullability checks in seq_regex
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-03 12:28:32 -07:00
Andrew V. Jones a23ca1792b
Ensure that Z3 uses the correct SMT-LIB2 syntax for push and pop (#4495)
* When pretty-printing SMTLIB2, ensure that Z3 uses the correct syntax for 'push'

Signed-off-by: Andrew V. Jones <andrew.jones@vector.com>

* When pretty-printing SMTLIB2, ensure that Z3 uses the correct syntax for 'pop'

Signed-off-by: Andrew V. Jones <andrew.jones@vector.com>
2020-06-03 09:35:14 -07:00
Nikolaj Bjorner 04829e6b7a fix #4437, not really interesting bug as debug assertion is really for non-interrupted flow
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-02 18:41:26 -07:00
Nikolaj Bjorner 4ef480e2a5 add op cache
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-02 12:52:42 -07:00
Nikolaj Bjorner 1c2aa1076b fix #4125 2020-04-27 11:31:02 -07:00
Nikolaj Bjorner f1193986c9 fix #4102
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-26 21:24:54 -07:00
Nikolaj Bjorner decd69ac73 move to util
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-26 21:22:14 -07:00
Nikolaj Bjorner 6d4bd37e15 fix #4104
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-26 21:04:28 -07:00
Nikolaj Bjorner fc1321f8b3 fix #4104
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-26 21:04:28 -07:00
Nikolaj Bjorner c2e0491456 fix #4113
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-26 21:04:28 -07:00
Nikolaj Bjorner a884201d62 remove using insert_if_not_there2
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-25 15:08:51 -07:00
Nikolaj Bjorner a3844af94b fix #4081
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-24 10:44:20 -07:00
Nikolaj Bjorner 25252af1fc fix #3975
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-15 08:06:43 -07:00
Nikolaj Bjorner 21a31fcd26 add missing fixed propagations on negated integer inequalities
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-11 02:28:38 -07:00
Nikolaj Bjorner 61fb134653 fix #3782
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-10 11:22:12 -07:00
Nikolaj Bjorner 56358a6b94 fix #3867
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-08 18:06:37 -07:00
Nikolaj Bjorner dde0c9bd0d fix #3833
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-08 04:34:36 -07:00
Nikolaj Bjorner 16be6b9162 fix #3789
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-06 13:57:38 -07:00
Nikolaj Bjorner bffe7a2215 fix #3783
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-06 12:19:34 -07:00
Nikolaj Bjorner b889b110ee bool_vector, some spacer tidy
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-05 12:59:04 -07:00
Nikolaj Bjorner fadc3761bd fix #3731 - abuse of parameter combinations, trying to use qsat on arrays, but disabling array equality expansion during model evaluation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-04 17:06:43 -07:00
Nikolaj Bjorner 426e4cc75c fix #3557
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-03 16:37:59 -07:00
Nikolaj Bjorner 50624723af fix #3704
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-03 10:38:31 -07:00
Nikolaj Bjorner 896a1b2048 fix #3679
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-02 15:04:56 -07:00
Arie Gurfinkel 5673ec046b qe_term_graph fix for #3526 2020-03-26 16:45:06 -04:00
Nikolaj Bjorner f158ab8395 fix #3426
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-22 20:48:31 -07:00
Nikolaj Bjorner 9f1530fdc0 fix #3428
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-22 14:34:17 -07:00
Nikolaj Bjorner 70a1786061 scoping th solver to avoid memory leak during cancellation exposed by #3431
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-22 14:14:45 -07:00
Nikolaj Bjorner d1f6470805 fix #3431
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-22 13:50:33 -07:00
Nikolaj Bjorner 8717c7d7ff fix #3450, remove deprecated qe-sat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-21 18:11:40 -07:00
Nikolaj Bjorner 37bc4a4407 fix #3420
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-19 17:50:23 -07:00
Nikolaj Bjorner cd434d8bd5 fix #3420
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-19 17:49:48 -07:00
Nikolaj Bjorner 2ad1cc95c1 fix #3409 - force model completion so that variables simplified away during pre-rpocessing are evaluated nevertheless
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-19 11:17:59 -07:00
Nikolaj Bjorner 65e1d08457 disabling linearization when canceled, #3412
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-19 10:23:55 -07:00
Nikolaj Bjorner 7cb6f41d0a fix #3390
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-18 11:15:15 -07:00
Nikolaj Bjorner 31164c2eaf fix #3386
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-18 10:40:34 -07:00