3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-09 02:41:52 +00:00
Commit graph

16416 commits

Author SHA1 Message Date
Nikolaj Bjorner 5c2a9d9936 fix pickup of new constraints 2025-01-28 15:04:13 -08:00
Nikolaj Bjorner 1676378be9 skip last power 2025-01-28 15:03:01 -08:00
Nikolaj Bjorner 8a7d971264 Update sls_bv_lookahead.h 2025-01-28 15:02:45 -08:00
Nikolaj Bjorner 2ebc647079 skip update stack items that are not Bool/bv 2025-01-28 15:02:33 -08:00
Nikolaj Bjorner 632e2b56e4 fix initialization of mod terms 2025-01-28 15:01:50 -08:00
Nikolaj Bjorner a8279dd9d5 reset kv map consistently with egraph
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-27 17:09:38 -08:00
Nikolaj Bjorner 57a5474ab4 revert flat default
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-27 16:56:12 -08:00
Nikolaj Bjorner 72ae161307 compress store array before model-eval rewriter sees it
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-27 16:55:07 -08:00
Nikolaj Bjorner fe1622b592 sls fixes for ABV. Axiomatization required as saturation can produce conflicts by congruence closure
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-27 15:16:13 -08:00
Jonáš Fiala 2050fc3b35
Preserve fingerprint in trace (#7534) 2025-01-27 13:09:48 -08:00
Can Cebeci 2d8f024680
Mark fixed_eq literals as relevant (#7533) 2025-01-27 11:10:46 -08:00
Nikolaj Bjorner 63f9fdaf3e fix build 2025-01-27 10:52:21 -08:00
Nikolaj Bjorner 15ee879602 fix #7532 2025-01-27 10:51:12 -08:00
Nikolaj Bjorner b6e7b80704 updates to handle bugs exposed by qf-abv for local search
- ctx.is_true(e) - changed to work with expressions that are not literals, but come from top-level assertions
- set fixed in sls_bv_fixed to work with non-zero low order bits
- array plugin to deal with cases where e-graph is inconsistent after a merge.
2025-01-27 10:35:29 -08:00
Nikolaj Bjorner 7ffed8613a fix bug with handling theory symbols of bit-vector type. Happens for data-type accessors. Reported by Clemens Eisenhofer
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-27 08:22:33 -08:00
Nikolaj Bjorner 09e84e0448 fix crash when accessing bool-info vars, reported by Clemens Eisenhofer
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-27 07:28:20 -08:00
Hari Govind V K f574950237
fix #7521 (#7531) 2025-01-26 17:52:06 -08:00
Nikolaj Bjorner 5634dc5875 fix model construction bug: ignore non-relevant expressions when building model
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-26 17:50:15 -08:00
Nikolaj Bjorner d3bf25ce85 throttle value smt -> sls 2025-01-26 14:16:43 -08:00
Nikolaj Bjorner d4100fc472 fixes to update propagation.
rename update and update_args_value to
update_checked
update_unchecked

ensure upward propagation so that local values are consistent when entering lookahead solvers.
2025-01-26 12:55:03 -08:00
Nikolaj Bjorner 04d0e9492b set log level of revert repair down to 3
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-26 11:56:59 -08:00
Nikolaj Bjorner 55fc57b5c7 relax out of range restrictions to handle large intervals 2025-01-26 11:24:26 -08:00
Nikolaj Bjorner 4f2272dbb2 increase log level for 'set value failed'
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-25 23:43:53 -08:00
Nikolaj Bjorner 7fb6497ce1 fix return value when in external mode bool-flip
return null_bool_var instead of false (= 0).
2025-01-25 22:57:58 -08:00
Nikolaj Bjorner d4f2de734b add smt_params dependency to sls in cmakelists 2025-01-25 22:38:32 -08:00
Nikolaj Bjorner 12e8082d86 consolidate functionality 2025-01-25 22:34:58 -08:00
Nikolaj Bjorner a7010574c8 align use_list with number of variables during flatten, push clause and bool_vars_of addition into clause and atom creation time. 2025-01-25 20:47:57 -08:00
Nikolaj Bjorner 7fc59b65ad add recursive updates to lookahead 2025-01-25 16:10:00 -08:00
Nikolaj Bjorner 57cb988461 fix gcc build 2025-01-25 15:51:58 -08:00
Nikolaj Bjorner 60fb53ad34 fix debug build 2025-01-25 15:50:07 -08:00
Nikolaj Bjorner ecc302bdc8 fix trace build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-25 11:38:58 -08:00
Nikolaj Bjorner d805322dfb create separate file for expression based lookahead solver 2025-01-25 11:19:40 -08:00
Nikolaj Bjorner f6e7dcff47 Fix crash exposed in QF_UFNIA 2025-01-24 15:31:10 -08:00
Nikolaj Bjorner 9e8dd68ee6 disable lookahead on compound values (fixes bug reported by Clemens), bail to rationals when there are reals. 2025-01-24 11:01:18 -08:00
Nikolaj Bjorner 053349cd36 remove incorrect calls to VERIFY in array solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-24 09:54:21 -08:00
Nikolaj Bjorner 0e8969ce60 deal with compiler warnings and include value exchange prior to final check. 2025-01-24 09:40:33 -08:00
Nikolaj Bjorner ce615ee116 avoid repeated clauses during scoring function 2025-01-23 10:51:12 -08:00
Nikolaj Bjorner b149d1f803 count every lookahead as activity 2025-01-22 22:57:43 -08:00
Nikolaj Bjorner 4d33f442b9 enable value import in parallel mode
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-22 22:45:01 -08:00
Nikolaj Bjorner e32f685f14 disable backoff on smt->sls value export
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-22 22:15:10 -08:00
Nikolaj Bjorner beb9d2e553 update restart next
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-22 21:40:35 -08:00
Nikolaj Bjorner ec3915218d modify backoff mechanisms and theory exchange 2025-01-22 20:32:30 -08:00
Nikolaj Bjorner 3a3e176dce fix build for tests 2025-01-22 13:30:12 -08:00
Nikolaj Bjorner 6893e782ed add cases for new parameters for ts build 2025-01-22 11:59:36 -08:00
Nikolaj Bjorner bd566f16b1 Expose PARAMETER_INTERNAL and PARAMETER_ZSTRING in case API users access these #7522 2025-01-22 11:46:11 -08:00
Nikolaj Bjorner ef275ab1a0 fix #7523 2025-01-22 11:46:11 -08:00
Nikolaj Bjorner 4fce314bf2 improve diagnostics for flips 2025-01-22 11:46:10 -08:00
Nikolaj Bjorner 72c7a9cf6a fix re-entrancy bug between ddfw and theory solvers.
Flips triggered from external sources should not trigger callbacks.
2025-01-22 11:46:10 -08:00
Nikolaj Bjorner 071c9abd69 Update macro_finder.cpp
move to justified_expr
2025-01-22 11:46:10 -08:00
Nikolaj Bjorner decaee83f3 move from justified_expr to dependent_expr by aligning datatypes 2025-01-22 11:46:10 -08:00
Michał Górny fc9ff946b7
use cmake from PyPI only when system executable is not available (#7514)
Rather than pulling `cmake` from PyPI unconditionally, add it to build
dependencies only if the system `cmake` executable cannot be found.
This eliminates an unnecessary dependency on systems featuring CMake,
and ensures that whenever possible, a downstream patched CMake version
is used that is more compatible with the system in question.
2025-01-21 14:39:19 -08:00
Nikolaj Bjorner d944779e18 move away from sets and into vectors for data associated with Boolean variables 2025-01-21 14:30:11 -08:00
Nikolaj Bjorner 92ad285951 use vector instead of indexed uint set for Boolean var occurrences
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-21 13:35:48 -08:00
Nikolaj Bjorner eebff13f8b don't store full use list of clauses to avoid space overhead
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-21 13:23:13 -08:00
Nikolaj Bjorner fb0eb029a8 use lifted bool 2025-01-21 09:13:38 -08:00
Clemens Eisenhofer 1553bae20c
Performance improvements for seq-sls (#7519)
* Improve length repair

* Fixed arguments

* Special case regex membership with constant string

* Trying hybrid eq-repair strategy

* Different heuristic

* Fixed stoi
2025-01-21 08:01:59 -08:00
Nikolaj Bjorner 3cdcd831b1 fix build breaks 2025-01-20 20:36:26 -08:00
Nikolaj Bjorner a3f7541719 fix #7517 2025-01-20 19:04:36 -08:00
Nikolaj Bjorner fb5834268e fix unit tests, add subsampling mode for false literals 2025-01-20 17:34:59 -08:00
Nikolaj Bjorner 22e4054674 add clausal lookahead to arithmetic solver as part of portfolio
have legacy qfbv-sls solver use nnf pre-processing. It relies on it for correctness of the score updates.
2025-01-20 16:16:46 -08:00
Nikolaj Bjorner a941f5ae84 reset m_conflict indicator on sls model 2025-01-15 20:56:44 -08:00
Nikolaj Bjorner 557c01a0e5 fix #7499 - add another way to avoid adding user-defined functions to models if user don't want it
- you can already do model.user_functions=false
- now you can also specify smtlib2_compliant (globally) and get smtlib2 behavior
2025-01-15 19:52:04 -08:00
Nikolaj Bjorner a5e1e7f5d2 set lookahead mode to default
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-15 19:10:25 -08:00
Nikolaj Bjorner 158dea575b add case for ite
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-15 19:07:18 -08:00
Nikolaj Bjorner eed3fa6d49 add case for ite
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-15 18:54:50 -08:00
Nikolaj Bjorner f422e26b3c add case for ite
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-15 18:53:26 -08:00
Nikolaj Bjorner 5365952796 fix #7510 2025-01-15 13:12:20 -08:00
Nikolaj Bjorner a84130e844 prepare update stack for Boolean lookaheads
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-15 12:33:31 -08:00
Nikolaj Bjorner 498c9a686b throw exceptions where sls lacks support
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-15 11:20:03 -08:00
Nikolaj Bjorner 5fec07a57e fix unit test
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-15 08:38:14 -08:00
Nikolaj Bjorner 878fd48819 fix compiler warning 2025-01-14 16:38:22 -08:00
Nikolaj Bjorner 11909cfdff allow a plateau mode 2025-01-14 16:38:12 -08:00
Nikolaj Bjorner 076d3dbf13 fix assertion violation in the code path where the simplifier throws a memout exception 2025-01-14 16:37:53 -08:00
Nikolaj Bjorner 31d4ba0009 re-introduce option to dump arithmetic lemmas to std-out 2025-01-14 13:54:56 -08:00
Nikolaj Bjorner 8515cebd19 add plateau option 2025-01-14 13:54:20 -08:00
Nikolaj Bjorner 648cf9602e fix uninitialized variable warnings 2025-01-14 13:54:05 -08:00
Lev Nachmanson 27cc928631 try m_fixed_var_eh
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-01-14 07:11:53 -10:00
Nikolaj Bjorner 8c5abdf818 Can's fix to relevancy propagation 2025-01-14 08:14:53 -08:00
Nikolaj Bjorner 89ed4d6c8b use monomial variable, not the fixed variable 2025-01-14 07:27:59 -08:00
Nikolaj Bjorner a08a3ee32b align reslimit with ddfw 2025-01-13 18:19:35 -08:00
Nikolaj Bjorner 3c5b8bd03d Update parray.h
deal with compiler warnings by initializing m_elem
2025-01-13 18:19:12 -08:00
Nikolaj Bjorner c01336553e move fixed variable propagation to nla_core/monomial_bounds 2025-01-13 18:18:53 -08:00
Nikolaj Bjorner f3e7c8c9df include QF_SNIA 2025-01-13 08:13:39 -08:00
Nikolaj Bjorner 943d881340 fixes to hybrid mode 2025-01-12 16:59:27 -08:00
Nikolaj Bjorner 9770c00592 adjust heuristic in random-inc-dec for finite domains
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-12 14:23:18 -08:00
Nikolaj Bjorner 97acf71d2d fixup registration with new terms during internalization
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-12 14:12:02 -08:00
Nikolaj Bjorner d3183fafc7 remove binspr experiment 2025-01-12 13:39:26 -08:00
Nikolaj Bjorner 8d2b9b41fd fix compiler warnings 2025-01-12 13:39:13 -08:00
Nikolaj Bjorner 85356c5548 enable propagation when there are changed columns
- to fix bug reported by Nikhil Swamy/F*
- deal with some compiler warnings by adding annotations
2025-01-12 13:30:31 -08:00
Nikolaj Bjorner 558758fcf1 another stab at fixing substring interval extraction combinatorics
- i is the offset into val_other. The valid offsets are 0... |val_other|-1.
- j is the length of the substring. It only makes sense to extract strings of length 1,... |val_other|-i
2025-01-12 11:14:17 -08:00
Nikolaj Bjorner fa22b646aa address some build warnings. 2025-01-12 10:18:11 -08:00
Nikolaj Bjorner b780b54574 optimization of sls-arith and fix build warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-12 09:49:48 -08:00
Nikolaj Bjorner 49dba337f7 fix ubuntu clang build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-11 20:02:31 -08:00
Nikolaj Bjorner c6f58c8bf7 updates to some_string_in_re per code review comments
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-11 17:47:27 -08:00
Clemens Eisenhofer c572fc2e4f
Regex membership (#7506)
* Make finding a word in the regex iterative

* Fixed gc problem
2025-01-11 17:41:37 -08:00
Nikolaj Bjorner 9a237d55ca fix misc build warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-11 17:41:24 -08:00
Nikolaj Bjorner d97bd48669 adding lookahead mode to arithmetic sls solver 2025-01-11 15:47:17 -08:00
Nikolaj Bjorner 847278fba8 adding global lookahead variant to sls arith solver 2025-01-09 16:47:33 -08:00
Nikolaj Bjorner f9ce41bd2b Update theory_lra.cpp 2025-01-08 15:41:08 -08:00
Nikolaj Bjorner 270c127407 sketch fixed variable callback mechanism 2025-01-08 12:50:46 -08:00
Nikolaj Bjorner c1a62d346c add missing return 2025-01-07 21:02:02 -08:00
Nikolaj Bjorner 1cb126f3dd remove assertion that doesn't build 2025-01-07 17:16:33 -08:00
Nikolaj Bjorner 2dd4faf598 sketch expr_inverter approach for eliminating unconstrained regex containment. 2025-01-07 16:53:57 -08:00
Nikolaj Bjorner ab9ea4e6e7 Add outline of elimination for regex membership constraints 2025-01-07 14:17:28 -08:00
Clemens Eisenhofer 5c60c6662c
Small seq-sls fixes (#7503)
* Calculation based on wrong update list

* Fixed regex problem
2025-01-07 09:26:00 -08:00
Nikolaj Bjorner e133a297ba change score for comparisons to use hamming distance
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-07 03:58:44 -08:00
Nikolaj Bjorner f77f259542 fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-06 18:12:12 -08:00
Nikolaj Bjorner b6f45bcd9f limit lookahead count to 20
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-06 18:06:00 -08:00
Nikolaj Bjorner aed0ad3505 limit lookahead count to 10
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-06 17:40:17 -08:00
Nikolaj Bjorner 59fad2b10a shave off bv test
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-06 17:25:30 -08:00
Nikolaj Bjorner e3e650a249 optimzie
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-06 15:36:20 -08:00
Nikolaj Bjorner 6787d87623 hoist update stack creation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-06 13:16:07 -08:00
Nikolaj Bjorner 5a5570ef4e remove type check in insert_update
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-06 11:12:08 -08:00
Nikolaj Bjorner 67827bfe56 restore nyi trace
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-06 08:37:14 -08:00
Nikolaj Bjorner a8b88b1850 fish for nyi
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-06 07:30:16 -08:00
Nikolaj Bjorner e45f186e67 make ite evaluation sensitive to using temporary Boolean assignment 2025-01-05 20:59:14 -08:00
Nikolaj Bjorner be5a16cc4d fixup scoring function for sle and ule
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-05 19:05:33 -08:00
Nikolaj Bjorner b3e410b5e4 fixup tabu checks to revised representation 2025-01-05 14:24:41 -08:00
Nikolaj Bjorner 71a4801c1d add shortcuts to convert to python objects in cases of numerals and strings 2025-01-05 12:17:38 -08:00
Nikolaj Bjorner cd41b21fa2 fix #7501 2025-01-05 11:59:59 -08:00
Nikolaj Bjorner f6e3c5ae79 re-enable fixed tabu
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-05 11:49:12 -08:00
Nikolaj Bjorner 6b17862886 bug-fixes to root-literal sls 2025-01-05 11:31:12 -08:00
Nikolaj Bjorner bed085934f bugfixes to bv-sls
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-04 20:57:17 -08:00
Nikolaj Bjorner 710f757495 fixup parameter handling for enabling bv-lookahead
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-04 15:57:02 -08:00
Nikolaj Bjorner 05f166f736 add py_value to selected classes in python bindings, add mode for input-assertion based lookahead solving 2025-01-04 13:40:49 -08:00
Nikolaj Bjorner 7e4681d836 enable rotation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-03 11:49:39 -08:00
Nikolaj Bjorner 5a57636cd8 use native sdiv
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-03 10:56:15 -08:00
Nikolaj Bjorner bfcd75595e update test file
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-02 21:03:50 -08:00
Nikolaj Bjorner 1131d8dbe6 update test file
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-02 20:59:40 -08:00
Nikolaj Bjorner e9c656701d throttle costly flips by reset and random
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-02 20:39:41 -08:00
Nikolaj Bjorner 70f7feabc8 flip tabu on predicate being repaired, add model rotation code 2025-01-02 14:39:36 -08:00
Nikolaj Bjorner f67e1b8b8b only allow flip if it doesn't increase unsat score
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-02 08:39:43 -08:00
Nikolaj Bjorner 814d7f4d0a block flips to units 2025-01-01 16:01:58 -08:00
Nikolaj Bjorner cb61af0496 fix restart counters
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-01-01 14:34:09 -08:00
Nikolaj Bjorner 0128a1e067 check for bit-vector 2025-01-01 13:04:15 -08:00
Nikolaj Bjorner b12e72eaad extend lookhaead to work over nested terms with predicates 2025-01-01 12:37:39 -08:00
Nikolaj Bjorner 234bd402d3 take 1 on flip conditions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-31 12:16:54 -08:00
Nikolaj Bjorner b415b82625 take 1 on flip conditions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-31 11:44:38 -08:00
Nikolaj Bjorner a511b8bcf0 disable unit tests relying on changed functionality 2024-12-31 09:24:41 -08:00
Nikolaj Bjorner 3433b14dfa separate fixed from bits to allow updates that break tabu
- range and fixed restrictions on terms are based on constraints and can be violated temporarily.
- bv_eval currently does not allow updating over fixed bits which leads to non-termination. TODO
- lookahead only considers tabu when setting values of variables.
2024-12-30 17:47:18 -08:00
Nikolaj Bjorner 983763213b temper verbose output on tabu updates
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-30 12:36:47 -08:00
Nikolaj Bjorner 81678923a1 take into account for empty vars
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-30 12:15:27 -08:00
Clemens Eisenhofer 27cb81e7e6
Several changes to make sls terminate more often with length/extract operations (#7498)
* Fixed range regex

* Fix sls for str.at

* Added case for str.at

* Pad/Truncate string in sls extract/length to fit length constraints

* Guarded index check

* Added missing progressing cases in extraction

* Add padding if required

* Commented out debug output
2024-12-30 10:53:27 -08:00
Nikolaj Bjorner 4773bec975 check for null before debug assertions 2024-12-30 09:44:23 -08:00
Nikolaj Bjorner d8741b4aec have apply-update check can_set instead of caller 2024-12-30 08:56:09 -08:00
Nikolaj Bjorner bcf66f214f code cleanup, add comments 2024-12-30 08:51:49 -08:00
Nuno Lopes 322dcec531
Add 2 new API functions to get depth & groundness of exprs (#7479)
* Update api_ast.cpp

* Update z3_api.h
2024-12-30 08:49:43 -08:00
Dmitri f99e1ee581
Support BitVectors in the TypeScript Optimize API (#7480)
This is just a change in type declarations to allow calling minimize/maximize with BitVectors.
2024-12-30 08:49:30 -08:00
Clemens Eisenhofer 19c95f8561
Add new string repair heuristic (#7496)
* Fixed spurious counterexamples in seq-sls. Updates might not be identity mapping

* Removed debug code

* One check was missing

* Trying different update generation function

* Renamed function

* Added parameter to select string update function
2024-12-30 08:49:07 -08:00
Clemens Eisenhofer e002c57aa2
Fixed range regex (#7497) 2024-12-30 08:48:09 -08:00
Nikolaj Bjorner d81de1a67e align updated version of lookahead with legacy heuristics 2024-12-29 21:22:32 -08:00
Nikolaj Bjorner 6ea68310c9 fix stack overflow regression in bool_rewriter
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-28 18:21:59 -08:00
Nikolaj Bjorner 3526d03cca remove VERIFY output
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-28 18:01:32 -08:00
Nikolaj Bjorner f41134d1b6 h
- avoid more platform specific behavior when using m_mk_extract,
- rename mk_eq in bool_rewriter to mk_eq_plain to distinguish it from mk_eq_rw
- rework bv_lookahead to be more closely based on sls_engine, which has much better heuristic behavior than attempt 1.
2024-12-28 17:40:25 -08:00
Nikolaj Bjorner a5bc5ed813 try uneven lookahead skew
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-28 17:40:25 -08:00
Nuno Lopes bd8c870bbe api: avoid some string copies when using mk_external_string 2024-12-28 09:42:54 +00:00
Nikolaj Bjorner 0b9ed925d6 try dual phase lookahead
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-27 13:34:48 -08:00
Nikolaj Bjorner 1f55ec5cef fix random update to a legal one
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-27 13:01:47 -08:00
Nikolaj Bjorner c82518ca36 include cmath to define std::pow
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-27 12:29:44 -08:00
Nikolaj Bjorner b0eee16109 fix double override bug in bv_lookahead, integrate with bv_eval 2024-12-27 12:26:18 -08:00
Clemens Eisenhofer 8de0005ab3
Bugfix seq-eq sls (#7495)
* Fixed spurious counterexamples in seq-sls. Updates might not be identity mapping

* Removed debug code

* One check was missing
2024-12-27 08:40:34 -08:00
Nikolaj Bjorner 5eb71c3be6 integrate lookahead v1 into repair loop
this ports some functionality from lookahead solver for qfbv-sls into sls-smt.
2024-12-26 17:49:30 -08:00
Nikolaj Bjorner c58171478f remove dead code 2024-12-26 13:48:55 -08:00
Nikolaj Bjorner d3a6521185 rely on is_sat fallback for failed repair-up, add separate file for WIP on lookahead. 2024-12-26 13:06:28 -08:00
Nikolaj Bjorner 13dcfd26dd remove debug out 2024-12-25 15:23:47 -08:00
Nikolaj Bjorner c9cae77304 update regex membership to be slightly better tuned 2024-12-25 10:56:16 -08:00
Nikolaj Bjorner f4ed432244 try a basic heuristic that finds some string that belongs to re. 2024-12-25 10:10:59 -08:00
Nikolaj Bjorner 09825edcd8 remove compute depth in favor of already existing get_depth 2024-12-23 18:49:54 -08:00
Nikolaj Bjorner e332904fb2 cosmetic updates 2024-12-23 18:49:38 -08:00
Nikolaj Bjorner 85d3041a80 avoid platform non-reproducibility due to argument evaluation ordering 2024-12-23 17:13:51 -08:00
Nikolaj Bjorner 23c4728d68 remove some platform specific behavior 2024-12-23 16:28:10 -08:00
Nikolaj Bjorner 554191885e remove platform dependent print 2024-12-23 16:13:36 -08:00
Nikolaj Bjorner 4f4cafbc98 start update with expr-inverter to handle PB 2024-12-22 18:17:42 -08:00
Nikolaj Bjorner b592ce4707 reserve space in heap to avoid debug check in elim_unconstrained 2024-12-22 18:17:40 -08:00
Nuno Lopes 97c70ba501 remove some uneeded constructors 2024-12-22 15:06:58 +00:00
Nikolaj Bjorner fb5bbb8074 read laziness parameter modulo relvancy to avoid race conditions with setting relevancy = 0 2024-12-22 14:07:29 +01:00
Nikolaj Bjorner a214dc32e8 add some comments, fix nyis 2024-12-22 13:52:19 +01:00
Nikolaj Bjorner 65b678dd42 use bail_out instead of early return to ensure marks are cleared 2024-12-22 06:14:38 +01:00
Nikolaj Bjorner 78ce6c1c6c revert relevancy override 2024-12-21 18:10:10 +01:00
Nikolaj Bjorner 3b2315d771 remove verbose output 2024-12-21 15:52:57 +01:00
Nikolaj Bjorner 578804acf4 fix #7460 2024-12-21 14:42:23 +01:00
Nikolaj Bjorner 2044fb460d fix #7490 2024-12-21 14:32:02 +01:00
Nikolaj Bjorner 8dec84110b add lia2card tactic as default #7483 2024-12-21 13:11:22 +01:00
Nikolaj Bjorner 07b1ee5dcc mask regression on fpa by not auto-setting relevancy=0 2024-12-21 12:41:04 +01:00
Nikolaj Bjorner da6a5facca revert change to setup_context that delays it until there are assertions 2024-12-21 11:53:46 +01:00
Nikolaj Bjorner db9f45dfec set relevancy = 0 in auto-config mode when there are bit-vectors and no quantifiers, #7484
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-20 18:10:46 +01:00
Nikolaj Bjorner 114cae50a5 update gcm script
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-20 17:27:21 +01:00
Nikolaj Bjorner 87f7a20e14 Add (updated and general) solve_for functionality for arithmetic, add congruence_explain to API to retrieve explanation for why two terms are congruent Tweak handling of smt.qi.max_instantations
Add API solve_for(vars).
It takes a list of variables and returns a triangular solved form for the variables.
Currently for arithmetic. The solved form is a list with elements of the form (var, term, guard).
Variables solved in the tail of the list do not occur before in the list.
For example it can return a solution [(x, z, True), (y, x + z, True)] because first x was solved to be z,
then y was solved to be x + z which is the same as 2z.

Add congruent_explain that retuns an explanation for congruent terms.
Terms congruent in the final state after calling SimpleSolver().check() can be queried for
an explanation, i.e., a list of literals that collectively entail the equality under congruence closure.
The literals are asserted in the final state of search.

Adjust smt_context cancellation for the smt.qi.max_instantiations parameter.
It gets checked when qi-queue elements are consumed.
Prior it was checked on insertion time, which didn't allow for processing as many
instantations as there were in the queue. Moreover, it would not cancel the solver.
So it would keep adding instantations to the queue when it was full / depleted the
configuration limit.
2024-12-19 23:27:57 +01:00
Nuno Lopes e4ab2944fe
Optimize expr_safe_replace for quantifiers when all source patterns are vars (#7481)
* Update expr_safe_replace.cpp

* Update expr_safe_replace.cpp

* Update expr_safe_replace.cpp
2024-12-19 23:05:13 +01:00
Nuno Lopes c33bc2c8be expr_abstract: save 1 hashtable lookup per app argument
when we already know that the app is missing one arg to rewrite
2024-12-18 09:50:50 +00:00
Nuno Lopes 2f5c0a6985 remove 2 unneeded lambda captures 2024-12-17 16:02:24 +00:00
Nuno Lopes 6f24123f0c reduce hash table lookups in expr_abstract in half 2024-12-16 11:00:55 +00:00
Nikolaj Bjorner b529a58b91 add unit test for incremental equation edit distance with repair 2024-12-15 05:53:28 -08:00
Nikolaj Bjorner 31ee56c1ca wip - incremental edit distance algorithm 2024-12-13 09:30:49 -08:00
Nikolaj Bjorner 538f74d64c extract stats with finalize for parallel mode 2024-12-13 09:30:49 -08:00
Oskar Haarklou Veileborg b4295620b3
Add __enter__ and __exit__ methods on Optimize class (#7477)
This enables the use of the with statement for the Optimize class to
concisely call push() and pop(). This works similarly to the Solver
class.
2024-12-13 09:19:04 -08:00
Nikolaj Bjorner 1e5c59a06f add repair step for str.replace 2024-12-12 09:15:36 -08:00
Nikolaj Bjorner e8c2360043 fix #7461
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-09 16:57:17 -08:00
Nikolaj Bjorner 8f5658b77d add another baseline heuristic for string equalities, add cases for array axioms.
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-09 15:55:19 -08:00
Kevin Gibbons e5f8327483
Update emscripten (#7473)
* fixes for newer emscripten thread handling behavior

* fix return type for async wrapper functions

* update prettier

* update typescript and fix errors

* update emscripten version in CI

* update js readme about tests
2024-12-06 18:11:14 -08:00
Nikolaj Bjorner 4fbf54afd0 fixes to regex membership and edit updates
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-06 09:50:30 -08:00
Nikolaj Bjorner 1ab0962d43 partial fix to make computed term integer well-formed for solve_for functionality 2024-12-05 17:10:52 -08:00
Nikolaj Bjorner bcb61ee12c v0 of edit distance repair 2024-12-05 14:14:27 -08:00
Yuantian Ding 4be4067f75
Typescript high-level api for Sets (#7471) 2024-12-05 07:00:11 -08:00
Nikolaj Bjorner a17d4e68eb bugfix to elim_uncnstr to ensure nodes are created. Prepare smt_internalizer to replay unit literals
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-04 15:32:15 -08:00
Nikolaj Bjorner aec867586a updates to equality solving search
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-12-02 13:41:18 -08:00
Nikolaj Bjorner e6feb8423a sls: fix bug where unsat remains empty after a literal is flipped. The new satisfiable subset should be checked
refined interface between solvers to expose fixed variables for tabu objectives
2024-12-01 18:35:56 -08:00
Nikolaj Bjorner 24c3cd38d1 add v0 of equality solver 2024-11-30 17:25:49 -08:00
Nikolaj Bjorner 05e053247d add facility to solve for a linear term over API 2024-11-30 09:34:27 -08:00
Nikolaj Bjorner d2411567b5 add projection with witnesses
expose model based projection with witness creation
2024-11-27 10:26:34 -08:00
Nikolaj Bjorner b7b611d84b inherit from std::exception
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-27 10:26:34 -08:00
Nuno Lopes ab1be5c06e internalize the reduce_args_tactic to reduce the number of heap allocations 2024-11-27 12:35:40 +00:00
Nuno Lopes 1ccfba6a91 remove unreachble code 2024-11-27 12:09:16 +00:00
Nikolaj Bjorner 1e62029413 use ztring
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-25 17:36:42 -08:00
Nikolaj Bjorner fce377e1d7 add basic regex functions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-25 17:34:49 -08:00
Nikolaj Bjorner b143a954c5 add notes and additional functions to sls-seq
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-25 13:46:16 -08:00
Nikolaj Bjorner aed3279d7d add missing new_value_eh when repaired up
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-24 19:57:40 -08:00
Nikolaj Bjorner 1e839e5ac2 add missing new_value_eh when repaired up
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-24 19:42:13 -08:00
Nikolaj Bjorner 7ed185aa9e add comments
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-24 19:09:50 -08:00
Nikolaj Bjorner 4559b23caf add local search functionality to sls_seq_plugin
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-24 11:24:17 -08:00
Nikolaj Bjorner b4e768cfb0 adding plugin for local search strings 2024-11-22 13:56:03 -08:00
Nikolaj Bjorner 36725758eb fix typos POLING -> POLLING in setup.py and remove unused CFLAGS
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-21 11:32:38 -08:00
Nikolaj Bjorner 71bad7159b #7418 - circumvent use of timer threads to make WASM integration of z3 easier
The scoped_timer uses a std::therad. Spawning this thread fails in cases of WASM.
Instead of adapting builds and using async features at the level of WASM and the client, we expose a specialized version of z3 that doesn't use threads at all, neither for solvers nor for timers.
The tradeoff is that the periodic poll that checks for timeout directly queries the global clock each time.
We characterize it as based on polling.
2024-11-21 11:20:05 -08:00
Nikolaj Bjorner 8965123c0d fix type in setup.py
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-19 19:08:29 -08:00
Nikolaj Bjorner 10d9c81957 adapt for pyodide built
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-19 18:51:04 -08:00
Nikolaj Bjorner 012fc1b72b more detailed tracing of where unmaterialized exceptions happen
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-19 18:15:50 -08:00
Nikolaj Bjorner e855a50d9b add exception handling to easier diagnose #7418
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-19 11:46:54 -08:00
Nikolaj Bjorner 5168a13efa track exceptions in reason-unknown
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-19 09:29:23 -08:00
Nikolaj Bjorner 4b72e517b7 SLS: log clause , allow more frequent export of SLS state to SMT 2024-11-17 20:13:02 -08:00
Nikolaj Bjorner 84447b7031 remove incremental mode from EUF, include statistics about restart vs propagation calls to sls 2024-11-17 16:58:18 -08:00
Nikolaj Bjorner c7ea4964f2 bug fixes to sls 2024-11-17 13:07:38 -08:00
Nikolaj Bjorner 2310514e02 fix #7454 2024-11-16 18:20:06 -08:00
Nikolaj Bjorner 5fd1231ec0 incorporate ls during propagation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-16 15:28:28 -08:00
Nikolaj Bjorner 750dd68a14 enable par_then and par_or even if single threaded - fall back to sequential mode 2024-11-16 12:29:22 -08:00
Nikolaj Bjorner f64d077d2a fix re-entrancy bug during flip in arith_base 2024-11-16 12:29:03 -08:00
Nikolaj Bjorner b929996941 update to set single threaded
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-16 09:11:44 -08:00
Nikolaj Bjorner f39198d9a8 move build-env setting to correct place
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-16 08:32:47 -08:00
Nikolaj Bjorner 197951cad4 fixes to sls 2024-11-16 08:28:24 -08:00
Nikolaj Bjorner 7c5ff7c623 moving compile time flags to setup for pyodide 2024-11-16 08:28:24 -08:00
Nikolaj Bjorner ccbe6c33ae fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-15 09:29:30 -08:00
Nikolaj Bjorner ea590def47 remove breaking experiment
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-15 08:03:57 -08:00
Nikolaj Bjorner 1d8a904e99 build fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-14 22:10:59 -08:00
Nikolaj Bjorner 77eacef2ae build fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-14 22:08:13 -08:00
Nikolaj Bjorner 3f407982f3 build fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-14 21:55:44 -08:00
Nikolaj Bjorner 8e3b9f6686 add sequential option for SLS, fixes to import/export methods SLS<->SMT 2024-11-14 21:43:40 -08:00
Nikolaj Bjorner 6a9d5910cb add method for resetting limit 2024-11-14 21:43:40 -08:00
Nikolaj Bjorner 6eae3f0863 add cases for unconstrained sequences and strings 2024-11-14 21:43:40 -08:00
Nikolaj Bjorner 62db7642ec refine rewriting depth for lt constraints 2024-11-14 21:43:40 -08:00
Linus d3009dabfc
Proposed fix for #7451 (#7452) 2024-11-13 09:11:40 -08:00
Nikolaj Bjorner c0e748a51a fix #7446, by adding rewrite simplification
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-11 19:16:11 -08:00