3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-13 12:28:44 +00:00
Commit graph

178 commits

Author SHA1 Message Date
Lev Nachmanson 401ec04ec3
code cleaning around m_touched_rows of lar_solver (#6814) 2023-07-14 20:19:13 -07:00
Lev Nachmanson e091a2e775 remove the line with clang-format off 2023-07-10 12:05:59 -07:00
Lev Nachmanson 0fceb80e0f edit tracing, add lar_solver::column_is_feasible() 2023-07-07 11:48:21 -07:00
Lev Nachmanson ff875c936f add TRACE stmts, more efficient remove from inf_heap
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-07-06 16:45:22 -07:00
Lev Nachmanson 4e327babda remove dead code 2023-07-06 15:07:26 -07:00
Lev Nachmanson e360de6d71 improve tracing and a small fix in
lp_core_solver_base::make_column_feasible
2023-07-04 13:23:56 -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 30a2ced9aa
patching merge (#6780)
* patching merge

* fix the format and some warnings

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

* a fix in the delta calculation

* test patching

* try a new version of get_patching_deltas

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

* remove dead code from lp_tst and try optimizing patching

* add comments, replace VERIFY with lp_assert

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

* cleanup

---------

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-06-27 17:53:27 -07:00
Lev Nachmanson 32ec02778e
use heap to track infeasible columns. (#6771)
* use heap to track infeasible columns

* fix the formatting

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

---------

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-06-19 13:50:14 -07:00
Lev Nachmanson 1006955215
get cached tv value (#6756) 2023-06-08 19:46:38 -07:00
Nikolaj Bjorner c48dc69050 adding stubs to find fixed variables
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-04-26 19:39:42 -07:00
Nikolaj Bjorner ef943347ee ensure assume-eqs is invoked after check-lia statically
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-04-26 11:16:15 -07:00
Nikolaj Bjorner 8fb4515872 remove redundant function, add checker function to test missed propagations 2023-04-26 10:04:59 -07:00
Lev Nachmanson 3efe91c3e3 more dead code 2023-03-08 10:27:05 -08:00
Lev Nachmanson 11eab94321 more dead code 2023-03-08 10:27:05 -08:00
Lev Nachmanson 748c75275f more dead code removal 2023-03-08 10:27:05 -08:00
Lev Nachmanson e430f28813 remove dead code
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-03-08 10:27:05 -08:00
Lev Nachmanson f351eb3ab2 remove many methods dealing with double
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-03-08 10:27:05 -08:00
Lev Nachmanson 9ec82632a3 rp precise 2023-03-08 10:27:05 -08:00
Lev Nachmanson 0fb65dea3f rm square_sparse_matrix 2023-03-08 10:27:05 -08:00
Lev Nachmanson 178135486c rm scaler 2023-03-08 10:27:05 -08:00
Lev Nachmanson bfe73c01a6 rm lu
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-03-08 10:27:05 -08:00
Lev Nachmanson 25f103db1a rm_lp
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-03-08 10:27:05 -08:00
Lev Nachmanson 527f0d1242 rm lu
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-03-08 10:27:05 -08:00
Lev Nachmanson 97c1ba4641 rm get_column_in_lu_mode 2023-03-08 10:27:05 -08:00
Nikolaj Bjorner b758d5b2b1 wip - proof checking, add support for distinct, other fixes 2022-10-17 17:51:10 -07:00
Bruce Mitchener 6ba9ada1e2
Fix typos. (#6291) 2022-08-21 12:40:07 -07:00
Bruce Mitchener 1eb84fe4b9
Mark override methods appropriately. (#6207) 2022-07-29 23:29:15 +02:00
Nikolaj Bjorner b68af0c1e5 working on reconciling perf for arithmetic solvers
this update integrates inferences to smt.arith.solver=6 related to grobner basis computation and handling of div/mod axioms to reconcile performance with smt.arith.solver=2.

The default of smt.arth.nl.grobner_subs_fixed is changed to 1 to make comparison with solver=2 more direct.

The selection of cluster equalities for solver=6 was reconciled with how it is done for solver=2.
2022-07-11 07:38:51 -07:00
Nikolaj Bjorner 6d836e7e2f expose model update 2022-03-19 09:23:08 -07:00
Lev Nachmanson 7758b519bc
Handle correctly cancelled run (#5695)
* remove the bound on total iterations in simplex

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

* remove unncesseray checks in  get_freedom_interval_for_column()

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

* fix the build of test-z3

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

* Revert "remove unncesseray checks in  get_freedom_interval_for_column()"

This reverts commit 6770ed85e3.

* optimize get_freedom_interval_for_column() for feasible case

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

* add function lar_solver::status_feasible

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

* rename status_is_feasible() to is_feasible()

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

* fix the linux build

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2021-12-05 18:38:37 -08:00
Nikolaj Bjorner 1618c970df adding checks
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-03 13:17:48 -08:00
Nikolaj Bjorner 87d4ce2659 working on #5614
there are some different sources for the performance regression illustrated by the example. The mitigations will be enabled separately:
- m_bv_to_propagate is too expensive
- lp_bound_propagator misses equalities in two different ways:
   - it resets row checks after backtracking even though they could still propagate
   - it misses equalities for fixed rows when the fixed constant value does not correspond to a fixed variable.

FYI @levnach
2021-11-02 14:55:39 -07:00
Lev Nachmanson 179988e161
support recursive terms (#5246)
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2021-05-05 12:53:20 -07:00
Nikolaj Bjorner ff0de59a70 more streamlined diagnostics to prepare for #5106 2021-03-15 16:23:35 -07:00
Nikolaj Bjorner 8412ecbdbf fixes to new solver, add mode for using nlsat solver eagerly from nla_core 2021-03-14 13:57:04 -07:00
Nikolaj Bjorner f29a596070 deal with compiler warnings, from MacOS CI build 2021-03-08 17:14:09 -08:00
Nikolaj Bjorner 3ed490d4ed tune backtracking 2021-01-18 16:51:01 -08:00
Lev Nachmanson b90143cc0e set the defalt for cheap_eqs=False, do not run
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-12-06 18:26:26 -08:00
Nikolaj Bjorner 89ffb45c4f fixes to bv/dual-solver, 2020-11-08 17:18:18 -08:00
Nikolaj Bjorner d0d06c288a rename
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-11-03 12:13:23 -08:00
Nikolaj Bjorner ee12e3fb52 add init_model, global m_delta, get_value, get_ivalue to push model maintainance into lar_solver #4740
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-11-02 19:21:15 -08:00
Nikolaj Bjorner 44679d8f5b
arith_solver (#4733)
* porting arithmetic solver

* integrating arithmetic

* lp

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>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-10-16 10:49:46 -07:00
Lev Nachmanson 25724401cf
Perf branch (#4710)
* avoid creating rows with  all but one fixed columns

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

* pb

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

* once in a while flip bounds of boxed variables during move_nbasic_to_bounds

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

* flip rarely

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

* flip rarely

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

* flip rarely

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

* return an empty model when lar_solver is not ready

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

* randomly change bounded base var on demand only

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

* randomly change bounded base var on demand only

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-09-25 17:47:29 -07:00
Nikolaj Bjorner 43db7df2b5
user solver (#4709)
* user solver

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>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-09-24 04:55:34 -07:00
Nikolaj Bjorner 4039352837 add ability to touch variables for bound propagation 2020-07-30 10:20:17 -07:00
Nuno Lopes b7caabbd0f fix crashes with MSVC 2019 2020-07-14 13:14:44 +01:00
Lev Nachmanson b996bc1f02 remove cheap equalities with the table
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-07-04 09:33:45 -07:00
Lev Nachmanson 3b00b34c6f cheap_eqs
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-20 11:31:22 -07:00
Lev Nachmanson 431bb36cf5 cheap_eqs tree
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-20 11:31:22 -07:00
Lev Nachmanson f7f9c15676 cheap_eqs tree
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-20 11:31:22 -07:00
Lev Nachmanson d13e584706 simplify the fixed var table
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-15 13:30:45 -07:00
Lev Nachmanson 06826adec3 fix the race in add_var_bound and add_def_constraint
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-12 22:11:11 -07:00
Lev Nachmanson fe0e042e40 move m_fixed_var_table to lar_solver
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-12 22:11:11 -07:00
Lev Nachmanson 1587497562 cheap equalities
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-12 22:11:11 -07:00
Lev Nachmanson b3bdce7837 make lp_bound_propagator a field of theory_lra::imp
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-12 22:11:11 -07:00
Lev Nachmanson 6a678fd5be rename in lar_solver and memory corruption bug in cheap_eq
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-12 22:11:11 -07:00
Lev Nachmanson 54921d08dc cheap_eq debug
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-12 22:11:11 -07:00
Lev Nachmanson 62bd19242e replace graph by a tree in cheap_eqs
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-12 22:11:11 -07:00
Lev Nachmanson 1e4e887221 propagate cheap eqs
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-12 22:11:11 -07:00
Lev Nachmanson 742be83503
Lpbounds (#4492)
* remove inheritance from bound propagation

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

* less inheritance

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

* less inheritance

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

* fix the build

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-02 01:00:06 -07:00
Lev Nachmanson c967b4aead more efficient patching
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson c355ee025a fix bugs in patching
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson e7bb8e57cb fixes in patch blocking
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson 4728a1fb0c fix in cautious remove_basis
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson a6040a1f3d cautious remove_basis
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson 91d9b0319e toward full patching in nl
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson c58bd3105b adding more aggressive patching in nl
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson 6a5579341d add restore_patched_values
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson 47d5515b78 change try_patch to a template
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson a53ed5bddd change try_patch to a template
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson 2de79be31b change try_patch to a template
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson b84585beeb more aggressive patching
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson 2710afbea1 change try_patch to a template
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson caa384f6c9 make m_inf_set private and cosmetic improvements in nla patching
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-26 12:44:47 -07:00
Lev Nachmanson ba40a5752f better branching with usage_in_terms()
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-28 15:27:49 -07:00
Lev Nachmanson 530f77281c fixes in branching
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-26 16:13:47 -07:00
Lev Nachmanson 8921ed56b5 fix a bug in Horner heuristic
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-23 15:58:53 -07:00
Lev Nachmanson 1f23ae8aae fix the test build
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-16 12:58:39 -07:00
Lev Nachmanson 5208b64a6b expose only necessary methods of lar_solver
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-16 12:58:39 -07:00
Lev Nachmanson 7caae3f5d2 small improvements in tableau in rows and bound propagation
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-13 16:04:25 -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
Lev Nachmanson 5c9fd90031 work on random_updates
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-07 19:50:50 -07:00
Nikolaj Bjorner c2e5cd78c8 change lar_terms to use column indices
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-06 12:13:59 -07:00
Nikolaj Bjorner 080dbb13b0 tv alignment, code review comments
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-05 03:35:19 -07:00
Nikolaj Bjorner fddbac0f52 use tv for interfacing on get_term
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-05 02:42:00 -07:00
Nikolaj Bjorner 0735491557 path fix #3747, this patches incoherent behavior of terms / ival from lar_solver. The variables occurring in terms are mapped to columns and not as original variables/terms. theory_lra has to interact with the column_corresponds_to_term test instead of relying on the terms themselves carrying the relevant information
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-04 14:27:56 -07:00
Nikolaj Bjorner 031b3a55ef fix #3733 persist uninterpreted atoms across calls to incremental sat solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-04 13:11:39 -07:00
Nikolaj Bjorner c6b4641050 fix #3649
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-01 10:56:27 -07:00
Lev Nachmanson cf0952c232 roll back in maximize_term if the integrality is broken
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-30 17:59:45 -07:00
Lev Nachmanson 7936df8e0b pass std::function as const aliases
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-30 12:20:47 -07:00
Lev Nachmanson 7a950dd667 patch reals
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-29 15:03:46 -07:00
Lev Nachmanson f5b62015fc change the return type of ival.var() to tv
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00
Lev Nachmanson 09467ba677 restore some class names by replacing u_set to int_set
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00
Lev Nachmanson ea964e5c3b rename int_set to u_set
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00
Lev Nachmanson 316f2194e0 rename
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00
Nikolaj Bjorner e50082b484 add tv
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-25 19:43:55 -07:00
Lev Nachmanson 8af245a410 use a simpler encoding for term indices
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00
Lev Nachmanson 31937f0b91 round the bound for columns and terms when it can be deduced that they are integral
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00
Lev Nachmanson 906d52ca1c accept term indices as columns in some lar_solver queries
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00