3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 05:18:44 +00:00
Commit graph

4345 commits

Author SHA1 Message Date
Nikolaj Bjorner c0bdc7cdd6 enable concurrent sls with new solver core
allow using sls engine (for bit-vectors) with the new core.

Examples

z3 sat.smt=true tactic.default_tactic=smt /v:1 smt.sls.enable=true smt.bv.solver=0 /st C:\QF_BV_SAT\bench_10.smt2
z3 sat.smt=true tactic.default_tactic=smt /v:1 smt.sls.enable=true smt.bv.solver=2 /st C:\QF_BV_SAT\bench_10.smt2
z3 C:\QF_BV_SAT\bench_11100.smt2 sat.smt=true tactic.default_tactic=smt /v:1 smt.sls.enable=true smt.bv.solver=2 /st
2024-04-11 10:49:30 +02:00
Bruce Mitchener 155dfb10c4
Fix some typos in identifiers. (#7118) 2024-02-14 09:25:32 +07:00
Bruce Mitchener 53f89a81c1
Fix some typos. (#7115) 2024-02-07 23:06:43 -08:00
Nikolaj Bjorner 3cec3fc63d bypass replaying new clause within propagation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-02-04 15:26:17 -08:00
Nikolaj Bjorner 3b90816025 add option to persist clauses #7109
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-02-04 11:15:59 -08:00
Nikolaj Bjorner 5cac9b84e4 fix build warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-02-01 09:36:52 -08:00
Nikolaj Bjorner e820701f9d fix #7107
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-01-31 15:38:10 -08:00
Nikolaj Bjorner 50deece29e fix #7098 2024-01-30 20:38:01 -08:00
Nikolaj Bjorner 2b683941b7 fix #7103 2024-01-27 17:46:23 -08:00
Nikolaj Bjorner bdb9106f99
Api (#7097)
* rename ul_pair to column

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* t

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* simple test passed

* remove an assert

* relax an assertion

* remove an obsolete function

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* access a term by the term column

* remove the column index from colunm.h

* remove an unused method

* remove debug code

* fix the build of lp_tst

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

---------

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
Co-authored-by: Lev Nachmanson <levnach@hotmail.com>
2024-01-24 16:05:18 -08:00
Nikolaj Bjorner 69f118e77f use assignment
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-01-22 15:48:45 -08:00
Nikolaj Bjorner 2c55aa5466 remove unused code
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-01-17 18:04:08 -08:00
Nikolaj Bjorner fef1596c81 pin expression passed to validate_eq
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-01-17 15:11:06 -08:00
Nikolaj Bjorner ddf2eb57d6 deleted parameter
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-01-12 10:42:08 -08:00
Nikolaj Bjorner 3381fd2b52 spell check from https://github.com/microsoft/z3guide/pull/165
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-01-12 09:57:46 -08:00
Nikolaj Bjorner 75005d9077 add validation option for debugging regressions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-01-09 09:18:29 -08:00
Lev Nachmanson 2934618c50 remove simplify_inequality from gomory.cpp 2024-01-04 11:40:57 -10:00
Bruce Mitchener d66df2616f
Fix some typos. (#7075) 2023-12-29 15:20:06 +00:00
Lev Nachmanson 0728b81e9e add parameter lp_settings.m_gomory_simplify 2023-12-28 06:00:57 -10:00
Lev Nachmanson e9fa7db96c revert smt_enode
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-12-20 14:03:27 -10:00
Nuno Lopes c4fa719751 revert last two commits; MSVC doesn't like to statically allocate flexible arrays 2023-12-20 19:10:05 +00:00
Nuno Lopes 6246c6517d fix debug build 2023-12-20 18:30:53 +00:00
Nuno Lopes c9c53b7c65 tmp_enode: don't heap allocate an app. store it inline instead.
Saves heap allocations and double indirections
2023-12-20 18:19:20 +00:00
Nuno Lopes b2d5c24c1d remove a few string copies 2023-12-20 16:55:09 +00:00
Bruce Mitchener 50e0fd3ba6
Use noexcept more. (#7058) 2023-12-16 12:14:53 +00:00
Nikolaj Bjorner 4778f27b46 revert to standard solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-12-15 14:33:23 -08:00
Nikolaj Bjorner 9293923b8a Add intblast solver 2023-12-15 13:50:38 -08:00
Nikolaj Bjorner b40e3015ef fix #7053 2023-12-13 19:25:18 -08:00
Nikolaj Bjorner 84a7a79e90 fix #7037 2023-12-04 17:08:01 -08:00
Nikolaj Bjorner bd8bed1759 handle ac-op in legacy special relations procedure by adding warning
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-12-03 12:55:37 -08:00
Nikolaj Bjorner faf14012ba Regressions reported by Guido 2023-12-01 13:32:13 -08:00
Nikolaj Bjorner 41a3196c89 fix #7024 2023-11-29 13:35:30 -08:00
Nikolaj Bjorner 8179f8b5d7 fix #7017 2023-11-28 14:32:56 -08:00
Nikolaj Bjorner 5bec982cc5 chores in theory_lra 2023-11-18 10:05:26 -08:00
Nikolaj Bjorner e40b8a2d13 household chores in legacy arithmetic solver 2023-11-18 09:56:06 -08:00
Nikolaj Bjorner 5ab1afe5c2 expose enode pp convenciences 2023-11-18 09:53:20 -08:00
Nikolaj Bjorner 1710fe4927 use iterator shortcut 2023-11-18 09:52:58 -08:00
Christoph M. Wintersteiger 3baaba5edd
Revert unsound NaN constraints in theory_fpa (#6993) 2023-11-14 14:28:30 -08:00
Nikolaj Bjorner ad2107f079 fix #6978 2023-11-14 08:45:22 -08:00
Nikolaj Bjorner 3de5af3cb0 fix bug in bound simplification in Gomory for mixed integer linear cuts, enable fixed variable redution after bugfix, add notes that rewriting bounds does not work
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-11-10 16:39:04 +01:00
Nikolaj Bjorner 0556059bdf change to expr_ref to allow trying simplification 2023-11-08 13:50:48 +01:00
Nikolaj Bjorner 3d99ed9dd4 Gomory cut / branch and bound improvements
Improve fairness of cut generation by switching to find_infeasible_int_var with cascading priorities, allow stronger cuts by inlining terms.
2023-11-07 19:59:02 +01:00
Nikolaj Bjorner 2d1f4d5d93 remove verbose logging 2023-11-07 19:57:49 +01:00
Nikolaj Bjorner e86eae27e6 #6523 and other heap-use-after-free error 2023-11-07 19:57:49 +01:00
Nikolaj Bjorner eed02b6d86 improved logging, use C++11 for loops instead of iterators 2023-11-07 19:57:49 +01:00
Lev Nachmanson ca6cb0af95 add changes in lp with validate_bound and maximize_term
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-11-02 09:59:03 -07:00
Nikolaj Bjorner 49a071988c remove temporary algebraic numbers from upper layers, move to owner module 2023-11-01 03:52:20 -07:00
Nikolaj Bjorner ea915e5b37 #6971
clear m_a1, m_a2 before calls that may affect model.
2023-11-01 03:36:01 -07:00
Nikolaj Bjorner f97dd34028 tests
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-10-30 14:54:04 -07:00
Nikolaj Bjorner 938a89e197 prepare for local version of Gomory cuts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-10-29 19:45:14 -07:00
Nikolaj Bjorner a957a5673d remove experiment with theory lemmas
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-10-29 18:48:48 -07:00
Nikolaj Bjorner 3726960969 fix #6969
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-10-29 17:44:00 -07:00
Nikolaj Bjorner 589024aa1c fix #6969
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-10-29 17:44:00 -07:00
Christoph M. Wintersteiger 9d57bdd2ef
Assorted fixes for floats (#6968)
* Improve 4be26eb543

* Add-on to 0f4f32c5d0

* Fix mk_numeral

* Fix corner-case in fp.div

* Fixes for corner-cases in mk_to_fp_(un)signed

* Fix out-of-range results in mpf_manager::fma

* Further adjustments for fp.to_fp_(un)signed

* fp.to_fp from real can't be NaN

* fp.to_fp from reals: add bounds

* Fix NaN encodings in theory_fpa.

* Fix fp.fma rounding with tiny floats

* Fix literal creation order in theory_fpa
2023-10-29 17:29:42 -07:00
Nikolaj Bjorner bd8e5eee4b add simplification experiment (disabled) for tracking, some reshuffling of equation/fixed_equation structs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-10-29 10:21:31 -07:00
Clemens Eisenhofer e7c17e68b8
Fixed next_split call in pop (#6966)
* Give users ability to see if propagation failed

* Skip propagations in the new core if they are already satisfied

* Fix registration in final

* Don't make it too complicated...

* Fixed next_split when called in pop
Made delay_units available even without quantifiers

* Missing push calls before "decide"-callback
2023-10-28 12:46:43 -07:00
Nikolaj Bjorner 20c54048f7 use cone of influence reduction before calling nlsat. 2023-10-25 16:19:23 -07:00
Nikolaj Bjorner e2db2b864b add hook for in-processing simplification for NLA
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-10-25 15:09:21 -07:00
Nikolaj Bjorner 97058b0d5d allow for propagations the trigger make-feasible check 2023-10-19 16:08:44 -07:00
Nikolaj Bjorner 11ab583232 fix #6956 2023-10-19 10:34:31 -07:00
Nikolaj Bjorner bdac86501d add facility to check for missing propagations 2023-10-15 20:33:48 -07:00
Nikolaj Bjorner 891ab8bac5 #6523
fixup looping
2023-10-15 12:37:14 -07:00
Nikolaj Bjorner 6553382ec8 remove extra assume-eqs 2023-10-15 12:30:24 -07:00
Nikolaj Bjorner 41b1f47d77 #6523
deal with memory leak when there is an exception
2023-10-15 12:15:28 -07:00
Nikolaj Bjorner d44d78f9d1 remove temporary configuration parameter used for testing
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-10-14 01:33:05 -07:00
Nikolaj Bjorner 08af965b56 updates to monomial bounds 2023-10-14 01:33:05 -07:00
Nuno Lopes fcb03aa56c minor code simplification 2023-10-11 01:38:03 +01:00
Nikolaj Bjorner d04807e8c3 merge
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-10-10 13:43:38 -07:00
Nikolaj Bjorner 338d7b3283 remove unused variables 2023-10-10 13:42:21 -07:00
Nikolaj Bjorner adbee0cd3f fix #6937 2023-10-10 16:02:59 +09:00
Lev Nachmanson b61f4ac51f merge changes from master
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-10-05 07:50:13 -07:00
Lev Nachmanson 45c0ed126e remove unnecessery call
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-10-04 17:39:22 -07:00
Lev Nachmanson edd1761ff3 restore the scheme of m_columns_with_changed_bounds
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-10-04 11:06:24 -07:00
Lev Nachmanson a88aa7ffa5 debug new propagation scheme
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-10-03 16:25:49 -07:00
Nikolaj Bjorner 00ba064cd3 ensure bounds propagation on changed columns after nla propagation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-10-03 14:28:59 +09:00
Lev Nachmanson 7de06c4350 merging master to unit_prop_on_monomials 2023-10-02 16:42:59 -07:00
Lev Nachmanson a297a2b25c fixes in lar_solver around nl unit propagation
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-10-01 11:39:58 -07:00
Lev Nachmanson 702322a6e9 change the order of lp and nlp propagation 2023-09-29 15:31:32 -07:00
Nikolaj Bjorner 94eb101873
Merge branch 'master' into unit_prop_on_monomials 2023-09-26 20:15:58 -07:00
Nikolaj Bjorner 36566d6193 port over moving m_nla_lemmas into nla_core from the linear monomial propagation branch
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-26 20:15:22 -07:00
Nikolaj Bjorner e4e1d6148c port over moving m_nla_lemmas into nla_core from the linear monomial propagation branch
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-26 20:14:42 -07:00
Nikolaj Bjorner e8fcc876c9
Merge branch 'master' into unit_prop_on_monomials 2023-09-26 20:14:06 -07:00
Nikolaj Bjorner ec2937e2de port over moving m_nla_lemmas into nla_core from the linear monomial propagation branch
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-26 20:08:30 -07:00
Nikolaj Bjorner 8d2b65b20b add options to allow testing the effect of non-linear hammers
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-26 19:18:44 -07:00
Lev Nachmanson 6ff4856e38 throttle monomial unit prop and and nl params 2023-09-25 16:47:34 -07:00
Lev Nachmanson 896aba31f8 move monomial propagation from theory_lra to nla_solver
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-09-25 14:20:24 -07:00
Nikolaj Bjorner 0a1ade6f95 move m_nla_lemma_vector to be internal to nla_core
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-25 12:40:52 -07:00
Lev Nachmanson 26a9b776c6 clean m_nla_lemma_vector in nla_solver
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-09-25 12:10:59 -07:00
Nuno Lopes 029d726eb8 minor code simplification 2023-09-25 15:33:40 +01:00
Nikolaj Bjorner 3433366bef Merge branch 'unit_prop_on_monomials' of https://github.com/z3prover/z3 into unit_prop_on_monomials 2023-09-23 17:20:08 -07:00
Nikolaj Bjorner 85eacf9bb1 merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-23 17:20:00 -07:00
Nikolaj Bjorner 61319ffd85 cache is_shared information in the enode
observed perf overhead for QF_NIA is that assume_eqs in theory_lra incurs significant overhead when calling is_relevant_and_shared. The call to context::is_shared and the loop checking for beta redexes is a main bottleneck. The bottleneck is avoided by caching the result if is_shared inside the enode. It is invalidated for every merge/unmerge.
2023-09-23 17:19:06 -07:00
Nikolaj Bjorner a3e2e68d93
Update theory_lra.cpp 2023-09-23 16:26:31 -07:00
Nikolaj Bjorner acad9fa62c
Update smt_context.cpp 2023-09-23 16:25:46 -07:00
Nikolaj Bjorner eea9c0bec6 fix #6914 2023-09-23 11:22:25 -07:00
Nikolaj Bjorner 30d1800c31 #6916
short circuiting equality consequence appears to have the wrong sign
2023-09-23 10:32:51 -07:00
Nikolaj Bjorner 421fe94607 rmove debug out
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-22 17:59:07 -07:00
Nikolaj Bjorner eac54ba084 indentation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-22 16:54:12 -07:00
Nikolaj Bjorner 940775d12d indentation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-22 16:48:40 -07:00
Lev Nachmanson caa929f01f do not use lemmase in monomial propagation 2023-09-22 14:27:26 -07:00
Lev Nachmanson f423642e9b try the lemma scheme 2023-09-21 12:18:21 -07:00
Lev Nachmanson e31cecf5db transfer propagate monomial bounds to nla_solver 2023-09-21 11:27:53 -07:00
Lev Nachmanson 536930b4a1 make m_ibounds inside of lp_bound_propagator
a reference
2023-09-20 17:13:25 -07:00
Nikolaj Bjorner 7a74b099ba remove experimental code
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-20 15:04:24 -07:00
Nikolaj Bjorner 4d742001ab formatting of else
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-19 14:36:21 -07:00
Lev Nachmanson c5cfd62e0a remove dead code related to nla unit propagation
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-09-19 10:56:09 -07:00
Lev Nachmanson b621c9fa1c remove an extrac check in bound_is_interesting 2023-09-15 17:42:18 -07:00
Lev Nachmanson 762ade2a79 check m_unassigned_bounds in bound_is_interesting 2023-09-15 06:15:22 -07:00
Lev Nachmanson c309d52283 runs a simple test 2023-09-13 08:12:00 -07:00
Lev Nachmanson c050af922f fixing the bugs 2023-09-07 15:59:20 -07:00
Lev Nachmanson 41f59cb1ed propagate monomial is nla 2023-09-05 18:49:59 -07:00
Lev Nachmanson 5509b468e9 handle monomial_bounds::unit_propagate() 2023-08-31 17:35:41 -07:00
Nikolaj Bjorner 38b131386d add stubs for monomial unit propagation 2023-08-30 17:21:48 -07:00
Lev Nachmanson 9aeaed8f53
Merge branch 'master' into nl_branches 2023-08-21 16:15:20 -07:00
Nikolaj Bjorner 37ddaaef69 make destructors virtual
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-20 15:30:57 -07:00
Nuno Lopes dda0c8ff42 array theory: use expr_ref for mk_default() so it doesnt leak if internalize throws
like on timeout/memout
2023-08-20 22:28:57 +01:00
Nuno Lopes a694d27557 revert removal of virtual destructor of relevancy_eh since clang doesnt play along 2023-08-20 14:20:20 +01:00
Nuno Lopes c469c6e1d5 attempt to fix clang buildbots 2023-08-20 13:39:15 +01:00
Nuno Lopes 28884b398c remove unneeded virtual destructor (optimization) 2023-08-20 12:57:47 +01:00
Nuno Lopes 3b546b2348 smt_context: we can't assert that the resource limits were exceeded on cancel_exception
It happens sometimes that e.g. the internalizer goes above the soft memory limit
But since it's only by a small amount, when the exception propagates back to the context, some stuff
has been freed already and we are not longer above the memory threshold
Just delete these asserts
2023-08-20 10:34:28 +01:00
Nuno Lopes 5d33805c8b optimize ~relevancy_propagator_imp() so it just dec refs the exprs in the trail
It avoid doing all the funky watch stuff
One extreme Alive2 test case goes from 40s to 28s :)
2023-08-20 10:07:56 +01:00
Nikolaj Bjorner 5e3df9ee77
Arith min max (#6864)
* prepare for dependencies

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

* snapshot

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

* more refactoring

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

* more refactoring

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

* build

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

* pass in u_dependency_manager

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

* address NYIs

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

* more refactoring names

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

* eq_explanation update

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

* add outline of bounds improvement functionality

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

* fix unit tests

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

* remove unused structs

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

* more bounds

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

* more bounds

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

* convert more internals to use u_dependency instead of constraint_index

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

* convert more internals to use u_dependency instead of constraint_index

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

* remember to push/pop scopes

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

* use the main function for updating bounds

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

* na

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

* na

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

* remove reset of shared dep manager

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

* disable improve-bounds, add statistics

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

---------

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-19 17:44:09 -07:00
Lev Nachmanson 610313946d split free vars in nla 2023-08-18 12:36:14 -07:00
Nikolaj Bjorner 73724f9cab lines that go away
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-17 18:45:49 -07:00
Lev Nachmanson 252a30e727
use param_ref in nla_solver (#6862)
* use param_ref in nla_solver

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* add parameters

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

* add parameters

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

* replace nla_setting by command line parameters

* delete nla_setting.h

---------

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-17 18:44:27 -07:00
Nikolaj Bjorner 125787c458 remove dead code 2023-08-07 11:22:34 -07:00
Nikolaj Bjorner 84520d53ea remove out
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-04 11:33:39 -07:00
Nikolaj Bjorner b0055df4ab revert arithmetic final check to original order
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-04 10:48:44 -07:00
Lev Nachmanson f58b703ac5
u_set replaced by indexed_uint_set (#6841)
* replace u_set by indexed_uint_set

* replace u_set by indexed_uint_set

* create insert-fresh and insert for indexed_uint_set to make use cases with non-fresh inserts easier

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

* update nightly to pull arm

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

* update nightly to pull arm

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

* fixing the build of lp_tst

* update nightly to pull arm

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

* replace u_set by indexed_uint_set

* replace u_set by indexed_uint_set

* fixing the build of lp_tst

* remove unnecessery call to contains() before
insert to indexed_uint_set

* formatting, no check for contains()
 in indexed_uint_set, always init m_touched_rows to nullptr

---------

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-03 16:01:27 -07:00
Nikolaj Bjorner 4637339091 update model validate to include arithmetic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-03 15:51:29 -07:00
Arie Gurfinkel 51d3c279d0
QEL: Fast Approximated Quantifier Elimination (#6820)
* qe_lite: cleanup and comment

no change to code

* mbp_arrays: refactor out partial equality (peq)

Partial array equality, PEQ, is used as an intermediate
expression during MBP for arrays. We need to factor it out
so that it can be shared between MBP-QEL and existing MBP.

Partial array equality (peq) is used in MBP for arrays.
Factoring this out to be used by multiple MBP implementations.

* rewriter: new rewrite rules

These rules are specializes for terms that are created in QEL.
QEL commit is comming later

* datatype_rw: new rewrite rule for ADTs

The rule handles this special case:

    (cons (head x) (tail x)) --> x

* array_rewriter rules for rewriting PEQs

Special rules to simplify PEQs

* th_rewriter: wire PEQ simplifications

* spacer_iuc: avoid terms with default in IUC

Spacer prfers to not have a term representing default value of an array.
This guides IUC from picking such terms in interpolation

* mbp_term_graph: replace root with repr

* mbp_term_graph: formatting

* mbp_term_graph: class_props, getters, setters

Class properties allow to keep information for an equivalence class.

Getters and setters for terms allow accessing information

* mbp_term_graph: auxiliary methods for qel

QEL commit is comming later in the history

* mbp_term_graph: bug fix

* mbp_term_graph: pick, refine repr, compute cgrnd

* mbp_term_graph: internalize deq

* mbp_term_graph: constructor

* mbp_term_graph: optionally internalize equalities

Reperesent equalities explicitly by nodes in the term_graph

* qel

* formatting

* comments on term_lt

* get terms and other api for mbp_qel

* plugins for mbp_qel

* mbp_qel_util: utilities for mbp_qel

* qe_mbp: QEL-based mbp

* qel: expose QEL API

* spacer: replace qe_lite in qe_project_spacer by qel

This changes the default projection engine that spacer uses.

* cmd_context: debug commands for qel and mbp_qel

New commands are

  mbp-qel -- MBP with term graphs
  qel     -- QEL with term graphs
  qe-lite -- older qelite

* qe_mbp: model-based rewriters for arrays

* qe_mbp: QEL-based projection functions

* qsat: wire in QEL-based mbp

* qsat: debug code

* qsat: maybe a bug fix

Changed the code to follow the paper by adding all predicates above a given
level, not just predicates of immediately preceding level.

* chore: use new api to create solver in qsat

* mbp_term_graph use all_of idiom

* feat: solver for integer multiplication

* array_peq: formatting, no change to code

* mbp_qel_util: block comment + format

* mbt_term_graph: clang-format

* bug fix. Move dt rewrite to qe_mbp

* array_peq: add header

* run clang format on mbp plugins

* clang format on mul solver

* format do-while

* format

* format do-while

* update release notes

---------

Co-authored-by: hgvk94 <hgvk94@gmail.com>
Co-authored-by: Isabel Garcia <igarciac@uwaterloo.ca>
2023-08-02 09:34:06 -07:00
Nikolaj Bjorner adad468cd7 allow copy within a user scope #6827
this will allow copying the solver state within a scope.
The new solver state has its state at level 0. It is not possible to pop scopes from the new solver (you can still pop scopes from the original solver). The reason for this semantics is the relative difficulty of implementing (getting it right) of a state copy that preserves scopes.
2023-07-31 19:46:08 -07:00
Nikolaj Bjorner 3d8f75b3d8 enable on-clause with dependencies
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-18 16:59:02 -07:00
Lev Nachmanson 401ec04ec3
code cleaning around m_touched_rows of lar_solver (#6814) 2023-07-14 20:19:13 -07:00
Nikolaj Bjorner 4a9c4ca2ce initialize poly solver in incremental mode
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-13 14:12:29 -07:00
Nikolaj Bjorner 08599177d0 fix #6808
remove bv_eq_axioms as an external option to toggle.
Diseqalities have to be enforced for extensionality.
There are no internal code paths where the option is set to false.
2023-07-13 10:47:55 -07:00
Nikolaj Bjorner 939bf1c725 wip - alpha support for polymorphism
An initial update to support polymorphism from SMTLIB3 and the API (so far C, Python).

The WIP SMTLIB3 format is assumed to be supporting the following declaration

```
(declare-type-var A)
```
Whenever A is used in a type signature of a function/constant or bound quantified variable, it is taken to mean that all instantiations of A are included in the signature and assertions.
For example, if the function f is declared with signature A -> A, then there is a version of f for all instances of A.
The semantics of polymorphism appears to follow previous proposals: the instances are effectively different functions.
This may clash with some other notions, such as the type signature forall 'a . 'a -> 'a would be inhabited by a unique function (the identity), while this is not enforced in this version (and hopefully never because it is more busy work).

The C API has the function 'Z3_mk_type_variable' to create a type variable and applying functions modulo polymorphic type signatures is possible.
The kind Z3_TYPE_VAR is added to sort discriminators.

This version is considered as early alpha. It passes a first rudimentary unit test involving quantified axioms, declare-fun, define-fun, and define-fun-rec.
2023-07-12 18:09:02 -07:00
Lev Nachmanson e091a2e775 remove the line with clang-format off 2023-07-10 12:05:59 -07:00
Clemens Eisenhofer 4cb158a79b
User Propagator: Return if propagated lemma is redundant (#6791)
* Give users ability to see if propagation failed

* Skip propagations in the new core if they are already satisfied
2023-07-07 09:58:41 -07:00
Nikolaj Bjorner f450bc4ae0 Merge branch 'master' of https://github.com/z3prover/z3 2023-07-07 09:29:49 -07:00
Nikolaj Bjorner 8c7525c97f revert log addition
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-07 09:29:38 -07:00
Nikolaj Bjorner 0ab102cbec fix coefficient extraction and passing in Farkas lemmas, thanks to H. F. Bryant
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-07 09:28:47 -07:00
Lev Nachmanson 4e327babda remove dead code 2023-07-06 15:07:26 -07:00
Lev Nachmanson 5ed2a82893
set clang format off for lp files (#6795)
* adding // clang-format off

* set clang-format off at the beginning of  lp files

* set clang-format off

* remove dead code
2023-07-03 17:35:16 -07:00
Lev Nachmanson f5d9ffaca1 clean up and add clang-format off
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-06-30 11:57:42 -07:00
Nikolaj Bjorner b451735aa0 fix #6778
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-25 21:08:13 -07:00
Nikolaj Bjorner eb1caee18a compile constants into different variables instead of reusing a single variable 1 and coefficients. It delays introducing large coefficients and allows more efficient bounds propagation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-20 16:09:34 -07:00
Nikolaj Bjorner df77541aae #6758
check-assumptions with compound formulas create fresh proxy variables both during compilation to internal format and for the assumptions. These fresh variables may occur in lemmas that are created during search. The lemmas are garbage for future check-sats, but the solver needs to be allowed to invoke GC. Adding a GC call before a check-sat with assumptions allows removing some lemmas every time a new assumptions are used. Eager GC when using assumptions is used elsewhere, for example in cube&conquer scenarios where lemmas learned from one set of assumptions are less likely to be useful for other assumptions.

With the GC invocation memory grows at a lesser pace. However, it is not entirely free of memory increases. To avoid memory bloat, have the solver pre-compile the assumptions by defining them as propositional variables, add assertions that the propositional variables are equivalent to the compound formulas and use the propositional variables as assumptions. The same propositional variables come with no extra overhead when invoking check-assumptions. The lemmas are then over the same fixed vocabulary. It is generally a good idea to recycle useful lemmas during the enumeration pass.
2023-06-18 16:21:41 -07:00
Nikolaj Bjorner cc4ac0e65a add guard for eq adapter 2023-06-13 16:39:53 -07:00
Nikolaj Bjorner 1d62964c58 avoid name clash for multiple special relations #6743 2023-06-07 17:55:11 -07:00