3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-23 19:47:52 +00:00
Commit graph

269 commits

Author SHA1 Message Date
Clemens Eisenhofer
002d166f72
Xor (#6448)
* Added function to select the next variable to split on

* Fixed typo

* Small fixes

* uint -> int

* Fixed missing assignment for binary clauses

* Memory leak in .NET user-propagator
The user-propagator object has to be manually disposed (IDisposable), otherwise it stays in memory forever, as it cannot be garbage collected automatically

* Throw an exception if variable passed to decide is already assigned instead of running in an assertion violation

* Update (not compiling yet)

* #6429

* remove ternary clause optimization

Removing ternary clause optimization from sat_solver simplifies special case handling of ternary clauses throughout the sat solver and dependent solvers (pb_solver). Benchmarking on QF_BV suggests the ternary clause optimization does not have any effect. While removing ternary clause optimization two bugs in unit propagation were also uncovered: it missed propagations when the only a single undef literal remained in the non-watched literals and it did not update blocked literals in cases where it could in the watch list. These performance bugs were for general clauses, ternary clause propagation did not miss propagations (and don't use blocked literals), but fixing these issues for general clauses appear to have made ternary clause optimization irrelevant based on what was measured.

* Update: Missing data-structures (still not compiling)

* Nearly compiling

* Some missing arguments

* Polishing

* Only conflicts/propagations/justifications are missing for making it compile

* Added propagation (justifications for them are still missing)

* Use the right deallocation

* Use Z3's memory allocation system

* Ported "seen"

* Polishing

* Added 64-bit "1" counting

* More polishing

* minor fixes

- ensure mk_extract performs simplification to distribute over extract and removing extract if the range is the entire bit-vector
- ensure bool_rewriter simplifeis disjunctions when applicable.

* adding simplifiers layer

simplifiers layer is a common substrate for global non-incremental and incremental processing.
The first two layers are new, but others are to be ported form tactics.

- bv::slice - rewrites equations to cut-dice-slice bit-vector extractions until they align. It creates opportunities for rewriting portions of bit-vectors to common sub-expressions, including values.
- euf::completion - generalizes the KB simplifcation from asserted formulas to use the E-graph to establish a global and order-independent canonization.

The interface dependent_expr_simplifier is amenable to forming tactics. Plugins for asserted-formulas is also possible but not yet realized.

* Create bv_slice_tactic.cpp

missing file

* adding virtual destructor

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

* Added 64-bit "1" counting (#6434)

* Memory leak in .NET user-propagator
The user-propagator object has to be manually disposed (IDisposable), otherwise it stays in memory forever, as it cannot be garbage collected automatically

* Throw an exception if variable passed to decide is already assigned instead of running in an assertion violation

* Added 64-bit "1" counting

* remove incorrect assertion

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

* Added limit to "visit" to allow detecting multiple visits (#6435)

* Memory leak in .NET user-propagator
The user-propagator object has to be manually disposed (IDisposable), otherwise it stays in memory forever, as it cannot be garbage collected automatically

* Throw an exception if variable passed to decide is already assigned instead of running in an assertion violation

* Added limit to "visit" to allow detecting multiple visits

* Putting visit in a separate class
(Reason: We will probably need two of them in the sat::solver)

* Bugfix

* init solve_eqs

* working on solve_eqs

* Update .gitignore

* wip - converting the equation solver as a simplifier

* make visited_helper independent of literals

re-introduce shorthands in sat::solver for visited and have them convert literals to unsigned.

* build fix

* move model and proof converters to self-contained module

* Create solve_eqs2_tactic.h

* add converters module to python build

* move tactic_params to params

* move more converters

* move horn_subsume_model_converter to ast/converters

* add initial stubs for model reconstruction trail

* fixing build

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

* fixes #6439 #6436

* It's compiling (However, two important functions are commented out)

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-10 09:05:17 -08:00
Nikolaj Bjorner
1fae3aa152 rename set-flat to set-flat-and-or to allow to differentiate parameters 2022-10-27 11:22:57 -07:00
Nikolaj Bjorner
4a1baa7d2d fix #6165 2022-07-30 17:10:01 +02:00
Bruce Mitchener
5d0dea05aa
Remove empty leaf destructors. (#6211) 2022-07-30 10:07:03 +01:00
Nikolaj Bjorner
6d71d9e816 update coding style to C++11
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-29 23:30:33 +02:00
Nuno Lopes
73a24ca0a9 remove '#include <iostream>' from headers and from unneeded places
It's harmful to have iostream everywhere as it injects functions in the compiled files
2022-06-17 14:10:19 +01:00
Nikolaj Bjorner
34272152bb add stubs to control memory usage 2022-04-02 17:52:54 -07:00
Nikolaj Bjorner
4b495e4b96 nits 2022-04-02 17:50:45 -07:00
Nikolaj Bjorner
d0ef5948aa nits 2022-04-02 17:49:03 -07:00
Nikolaj Bjorner
25feb0ebed #5938 catch also rewriter_exception that can be raised on cancelation and memory pressure 2022-04-02 17:43:12 -07:00
Nikolaj Bjorner
f3fc6a50f3 formatting 2022-01-31 11:57:42 -08:00
Nikolaj Bjorner
d02235fe08 #5778
not really specific to euf.true, but about rem(x,0) semantics that should align with mod semantics. It also reproduces without sat.euf=true.
2022-01-22 16:16:48 +01: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
Nikolaj Bjorner
2891ac7dec merge
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-08-03 19:47:38 -07:00
Nikolaj Bjorner
40f5270ae2 fix #5452
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-08-03 17:23:41 -07:00
Nikolaj Bjorner
50f5cafb50 fix #5446
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-08-01 05:09:58 -07:00
Nikolaj Bjorner
7af2309fae #5331 2021-07-19 16:09:13 -07:00
Nikolaj Bjorner
29a2838bc9 #5338 #5349 2021-06-16 16:01:42 -05:00
Nikolaj Bjorner
f95d0b7216 #5349 #5338 2021-06-16 16:01:42 -05:00
Nikolaj Bjorner
83e2e7200c fix #5316 2021-05-30 11:28:31 -07:00
Nuno Lopes
f1e0d5dc8a remove a hundred implicit constructors/destructors 2021-05-23 14:25:01 +01:00
Nikolaj Bjorner
c230d89a3a fix #5294
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-22 09:59:50 -07:00
Nikolaj Bjorner
28328e63fd fix #5255
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-09 20:48:11 -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
180015a529 fix #5035 2021-02-18 16:47:36 -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
96ab9edbfd fix #4923 2021-01-09 01:21:50 -08:00
Nikolaj Bjorner
ffd57bef24 #4923 - eq2bv
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-01-08 16:38:07 -08:00
Nikolaj Bjorner
690bc51b7f fix #4927 2021-01-08 15:40:15 -08:00
Nikolaj Bjorner
0ef8ebe89f fix #4895 2020-12-14 15:05:51 -08:00
Nikolaj Bjorner
89fb55a864 fix #4890
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-12-12 12:20:53 -08:00
Nikolaj Bjorner
0e1def5bd6 fix #4736 2020-10-30 01:54:42 -07:00
Nikolaj Bjorner
d3d05e2e99 add side-constraints in pb2bv-tactic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-09-20 07:03:06 -07:00
Nikolaj Bjorner
6f63f8761c
optimizations to bv-solver and euf-egraph (#4698)
* additional bit-vector propagators

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

* rename restrict (not a keyword, but well) #4694, tune euf

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

* merge

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

* add pb rewriting to pb2bv #4697

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-09-20 06:47:27 -07:00
Nikolaj Bjorner
dbe2c9b305 encoding options #4665
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-30 10:24:42 -07:00
Nikolaj Bjorner
d0e20e44ff booyah
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-04 15:56:30 -07:00
Nikolaj Bjorner
47fa6ba7a6 fix #4191 2020-05-02 11:15:11 -07:00
Nikolaj Bjorner
0e77074e84 another revision of purify_arith, fix #4144 2020-04-29 12:07:02 -07:00
Nikolaj Bjorner
38e0968845 fix #4128 2020-04-27 17:10:48 -07:00
Nikolaj Bjorner
3a63c3751e fix #4127 2020-04-27 13:27:00 -07:00
Nikolaj Bjorner
4938ea7be6 fix #4123
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-27 11:44:25 -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
5e0c34cae2 fix #3953
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-14 09:43:03 -07:00
Nikolaj Bjorner
dea922ba25 fix #3909
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-11 13:56:07 -07:00
Nikolaj Bjorner
addbe55823 fix #3846, another bug in eq2bv-tactic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-09 19:55:40 -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
c70e9af09d fix #3734
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-04 12:53:24 -07:00
Nikolaj Bjorner
6f65051f2c silence some build warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-03 17:11:34 -07:00