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

196 commits

Author SHA1 Message Date
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 e689dea99c basic formatting updates 2023-04-26 10:04:59 -07:00
Lev Nachmanson 130400d76e
Remove non feasible costs (#6653)
* before rm lu

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

* rm get_column_in_lu_mode

* rm lu

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

* rm lu

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

* rm_lp

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

* rm_lu

* rm lu

* rm lu

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

* rm lu

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

* rm lu

* rm lu

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

* rm lu

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

* rm lu

* cleanup

* rm breakpoints

* rm dealing with doubles

* Revert "rm dealing with doubles"

This reverts commit 547254abe7.

* rm lu

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

* rm lu

* rm lu

* rm scaler

* rm square_sparse_matrix

* more cleanup

* rm dead code

* rp precise

* remove many methods dealing with double

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

* rm lu related fields from lp_core_solver_base.h

* remove dead code

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

* more dead code removal

* remove more dead code

* more dead code

* rm dead code

* more dead code

* fix lp_tst

* more dead code

* replace lp_assert(false) with UNREACHABLE

* rm non feas costs

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

* fix the build

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

---------

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-03-28 08:55:52 -07:00
Lev Nachmanson 8b0aa22631 replace lp_assert(false) with UNREACHABLE 2023-03-08 10:27:05 -08:00
Lev Nachmanson 3efe91c3e3 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 e04e726f45 rm lu 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 c251151d66 rm_lu 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 a38be43264 rm lu
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-03-08 10:27:05 -08:00
Nikolaj Bjorner 5974a2dc58 remove m_b from lar_core_solver
the column vector is pure overhead for the way the lar solver uses lp.
Some other solver modules use column vectors b and integrate with the lp_core_solver_base. The interaction model should be reviewed.
Unused solvers should be removed to make it easier to maintain this code.
2023-02-28 17:40:08 -08:00
Nikolaj Bjorner 0f86a00229 use setter method to easier track updates to settings. 2023-02-01 10:18:14 -08: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 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
Nikolaj Bjorner 8ba0fb5b58 rounding mode sort removed for incompatibility
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-21 16:18:43 -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 0c6722f48b na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-03 11:47:00 -07:00
Nikolaj Bjorner 60cf482cea fix #5239
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-03 11:44:44 -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 4d7062d2a1 fix in nla_ordered_lemma
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-12-09 06:48:58 -08:00
Nikolaj Bjorner c3c7aad1a8 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-12-06 11:18:37 -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 620204bbb4
use value function in lar_solver (#4771)
* use value function in lar_solver

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

* add missing return

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

* check_feasible is called after column is added for fixed variable

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

* na
2020-11-03 01:08:24 -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
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 4039352837 add ability to touch variables for bound propagation 2020-07-30 10:20:17 -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 d13e584706 simplify the fixed var table
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-15 13:30:45 -07:00
Lev Nachmanson e5632736d2 review comments
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-12 22:11:11 -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 50b9915c57 avoid big nums in is_offset_row in cheap_eqs
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-12 22:11:11 -07:00
Lev Nachmanson 110ab5e6ef debug cheap_eqs
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-06-12 22:11:11 -07:00
Lev Nachmanson 9c078c6d59 relaxing asserts in column_to_reported_index
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 4936ace7cd more guards on 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 c355ee025a fix bugs in patching
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 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 b84585beeb more aggressive patching
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-31 20:20:49 -07:00
Lev Nachmanson e5503cdc65 change try_patch to a template
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
Nikolaj Bjorner d372af4782 add stub for cheap equality propagation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-30 15:36:27 -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 97b480ded3
Expl (#4462)
* cleaner API for explanation

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

* remove an unnecessery check

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

* expl

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-24 17:06:39 -07:00
Lev Nachmanson af2f74c05f
smarter explanation.h (#4385)
* smarter explanation.h

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

* clean explanation API

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

* suppress warnings

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

* disable the warnings

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-19 12:38:44 -07:00
Lev Nachmanson f2449df06e introduce ul_pair associated_with_row
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-05-05 15:59:09 -07:00
Lev Nachmanson 97fe2c8609 remove an assert
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-28 15:27:49 -07:00
Lev Nachmanson d5162d92ad add an assert
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-28 15:27:49 -07:00
Lev Nachmanson aa0f5db511 fixes
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-28 15:27:49 -07:00
Lev Nachmanson f8037ffda4 always call find_feasible_solution in move_nbasic_columns_to_bounds()
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-28 15:27:49 -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 8c5993d9a6 max term
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-23 18:40:16 -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 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 6d8e5400fd return an empty model when the status of the solver is neither FEASIBLE nor OPTIMAL
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 9b609af8fc fix #3924
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-12 16:19:54 -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 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
Lev Nachmanson 9d58fccd41 fix in random_update()
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-03 12:43:20 -07:00
Lev Nachmanson 7890555455 fix in random_update()
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-03 12:37:57 -07:00
Lev Nachmanson 7fe46de266 trace random update
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-03 12:00:19 -07:00
Lev Nachmanson 55329ea935 more fixes in patching of monomials
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-04-02 14:47:06 -07:00
Nikolaj Bjorner cc394f0fe9 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-01 03:42:13 -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 3e845010dd replace v by j in lp printouts
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-30 15:59:03 -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 9be7bda69a fix a bug in column patching
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-29 15:03:46 -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 3237bd9243 better tracing
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 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 bc5b68b16e convert term indices to columns in lar_solver::add_equality()
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00
Lev Nachmanson e2538afd32 better diagnostics in lar_solver and more efficient int_set::resize()
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00
Nikolaj Bjorner 2975873b91 ensure encapsulation boundaries
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-25 19:43:55 -07:00
Lev Nachmanson c16d90307b more careful resize in int_set
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00
Lev Nachmanson e0b95979e6 detect the status change in lar_solver::add_equality()
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00
Lev Nachmanson 38eca3b66a fixes in order lemmas and printing terms
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 d758a08497 do not create inf var
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00
Lev Nachmanson 6c5d7fbe96 fixes in max term with tableau
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00
Lev Nachmanson c2e7dd3378 catch the possible infeasible column when adding an equality
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-03-25 19:43:55 -07:00