3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-26 18:45:33 +00:00
Commit graph

122 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
07dd1065db added API to monitor clause inferences
See RELEASE_NOTES for more information
examples pending.
2022-10-19 08:34:55 -07:00
Clemens Eisenhofer
95c3dd9224
Added missing decide-callback for tactics (#6166)
* Added function to select the next variable to split on

* Fixed typo

* Small fixes

* uint -> int

* Fixed missing assignment for binary clauses

* Added missing decide-callback for tactics
2022-07-17 10:07:52 -07:00
Clemens Eisenhofer
e11496bc65
Added decide-callback to user-propagator (#5978)
* Fixed registering expressions in push/pop

* Reused existing function

* Reverted reusing can_propagate

* Added decide-callback to user-propagator

* Refactoring

* Fixed index
2022-04-15 20:07:17 +02:00
Nikolaj Bjorner
2e00f2f32d
Propagator (#5845)
* user propagator without ids

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

* user propagator without ids

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

* fix signature

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

* references #5818

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

* fix c++ build

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

* switch to vs 2022

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

* switch 2022

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

* Update propagator example (I) (#5835)

* fix #5829

* na

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

* switch to vs 2022

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

* Adapted the example to the changes in the propagator

Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* context goes out of scope in stack allocation, so can't used scoped context when passing objects around

* parameter check

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

* add rewriter

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

* Fixed bug in user-propagator "created" (#5843)

Co-authored-by: Clemens Eisenhofer <56730610+CEisenhofer@users.noreply.github.com>
2022-02-17 09:21:41 +02:00
Nikolaj Bjorner
9294b2ceb2 created
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-25 16:33:23 +01:00
Nikolaj Bjorner
3de9d37772 fix overrides for created_eh
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-25 16:24:08 +01:00
Nikolaj Bjorner
ea6827505e add missing callback to m_created_eh
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-25 10:13:09 +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
f0740bdf60 move user propagte declare to context level
declaration of user propagate functions are declared at context level instead of at solver scope.
2021-12-18 10:56:42 -08:00
Nikolaj Bjorner
4856581b68 na 2021-12-17 16:40:19 -08:00
Nikolaj Bjorner
9c8800bdde adding a new toy for Clemens
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-17 10:45:59 -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
1e95fb44d1 add ability to register expressions during callback 2021-12-07 09:47:05 -08:00
Nikolaj Bjorner
658a334ecf clear tactic user propagate state on solver destructor 2021-12-07 03:14:50 -08:00
Nikolaj Bjorner
f0e9363e78 fix bug in smt_tactic_core for translating user-ids 2021-12-05 11:13:27 -08:00
Nikolaj Bjorner
c845b22c15 fix translation for equality propagation 2021-12-04 11:55:36 -08:00
Nikolaj Bjorner
1b0ac4940b prevent stale user-propagators from being used on the same tactic after it was applied. 2021-12-04 11:51:00 -08:00
Nikolaj Bjorner
da765355e8 don't rely on cleanup 2021-12-04 11:48:41 -08:00
Nikolaj Bjorner
3d528c8ef6 typo 2021-12-04 11:19:49 -08:00
Nikolaj Bjorner
eae567ac3d indirection for user ids 2021-12-04 11:04:32 -08:00
Nikolaj Bjorner
68b072e7f1 only use setup_and_check if there is no user propagator set. 2021-12-04 09:22:25 -08:00
Nikolaj Bjorner
0077ddf33c try delay init for user propagator in smt_tactic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-03 09:45:07 -08:00
Nikolaj Bjorner
bfd61fec00 enable user propagation on tactics
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-02 08:28:52 -08:00
Nikolaj Bjorner
9031b5b949 fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-18 11:46:46 -07:00
Nikolaj Bjorner
30974968af fix #5256
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-17 17:41:34 -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
0ce1c34d81 fix #5065 - regression solving str.from_int equations now that it isn't injective any longer
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-03-02 12:59:48 -08:00
Nikolaj Bjorner
3ae4c6e9de refactor get_sort 2021-02-02 04:45:54 -08:00
Nikolaj Bjorner
f519c58ace Add groovy R.U.Stan option to retrieve models even when they don't exist #4924
Usage:
z3 4924.smt2 smt.candidate_models=true
2020-12-30 14:38:41 -08:00
Nikolaj Bjorner
d0e20e44ff booyah
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-04 15:56:30 -07:00
Nikolaj Bjorner
cbf089e10d fix #4448
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-03 19:41:25 -07:00
Nikolaj Bjorner
ae2f0ca85b fix #4448
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-03 19:40:26 -07:00
Nikolaj Bjorner
3fc001baea simplifications noticed by trying #4147
The change masks possible bugs in smt.threads and arrays.
2020-04-29 12:07:01 -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
b686bb61fe fix #3673
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-01 18:18:44 -07:00
Nikolaj Bjorner
06a64669a2 heap issue of #3655 ?
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-01 11:52:32 -07:00
Nikolaj Bjorner
5c2a381eb0 fix #3654
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-01 11:46:37 -07:00
Nikolaj Bjorner
e160320e8a fix #3659
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-01 11:31:12 -07:00
Nikolaj Bjorner
f98e6a62fe fix #3648
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-01 03:49:48 -07:00
Nikolaj Bjorner
fe267803d1 fix #3634
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-31 20:33:42 -07:00
Nikolaj Bjorner
a1f68a619d fix #3612
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-31 15:09:12 -07:00
Nikolaj Bjorner
8a961a5ce9 fix #3554
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-30 15:02:55 -07:00
Nikolaj Bjorner
ba4765f16f debugging #3511
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-30 11:00:02 -07:00
Nikolaj Bjorner
51e459d02b fix #3294
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-14 10:46:03 -07:00
Nikolaj Bjorner
d229efabfc na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-09 17:12:34 +01:00
Nikolaj Bjorner
bbcfd79bf6 fix #3129
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-09 08:13:05 +01:00
Lev Nachmanson
26eb23c05b move lp_params to smt_params_helper
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-02-10 11:25:54 -08:00
Nikolaj Bjorner
b0a28160f7 fix #2921
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-02-02 10:35:06 -08:00
Lev Nachmanson
33cbd29ed0 mv util/lp to math/lp
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00