3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +00:00
Commit graph

112 commits

Author SHA1 Message Date
Nikolaj Bjorner
947ea66cad simplify output to use signed constants
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-06-18 17:39:13 -07:00
Nikolaj Bjorner
a049235caa simplify output to use signed constants
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-06-18 17:26:11 -07:00
Nikolaj Bjorner
f263045f96 modify mk_mul
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-06-18 17:18:16 -07:00
Nikolaj Bjorner
57df45dc16 Merge branch 'master' of https://github.com/z3prover/z3 into polysat 2021-06-18 10:02:33 -07:00
Jakob Rath
c4963f4381
Polysat: add two more prototype rules (#5355)
* Add try_div to PDDs

* x>y is false when x==y

* First version of the other two prototype rules

* More band-aid fixes...
2021-06-18 08:48:50 -07:00
Nuno Lopes
f1e0d5dc8a remove a hundred implicit constructors/destructors 2021-05-23 14:25:01 +01:00
Nikolaj Bjorner
dc879dc3fb merge
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-03 12:41:14 -07:00
Jakob Rath
f83705bf9f
Polysat: first pass at forbidden intervals (not yet fully integrated into solver) (#5227)
* Add interval class

* Take dependency as const reference

* Compute forbidden intervals for ule-constraints

* Add class for evaluated interval

* We need the evaluated bounds as well

* Don't add constraint to cjust multiple times (hack, to be improved later)

* typo

* More interval helpers

* Add constraint::ult factory function

* Fix forbidden interval condition

* Add solver::has_viable

* Add conflict explanation using forbidden intervals (not yet fully integrated into solver)
2021-04-29 10:12:54 -07:00
Jakob Rath
2fac9e6e66
Add propagate/narrow for ule_constraint (#5214)
* Add helper to check whether pdd is univariate and linear

* Reorganize propagate/narrow of eq_constraint

* Implement propagate/narrow for ule constraints

* Also push trail instruction in push_viable
2021-04-23 08:41:02 -07:00
Jakob Rath
12444c7e8b
Phase saving and some minor changes (#5209)
* Implement phase saving

* Implement signed comparison on BDD vectors

* Add fdd::non_zero

* Simplify construction of fdds over disjoint variables

* Minor changes to adding constraint
2021-04-22 09:47:46 -07:00
Nikolaj Bjorner
fc60690742 tidy, initial polysat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-20 12:21:50 -07:00
Nikolaj Bjorner
770c79a939 prepare for std::vector 2021-04-20 09:24:24 -07:00
Jakob Rath
77350d97da
BDD vectors: add subtract and quot_rem, move finite domain abstraction out of bdd_manager (#5201)
* Coding style

* Simplify bddv class

* mk_eq: run loop from below

* Add unit test for bddv unsigned comparison

* Add test that shows contains_num/find_num fail after reordering

* Add BDD vector subtraction

* Call apply_rec in mk_ite_rec instead of apply

* Question about mk_quant

* Implement quot_rem over BDD vectors

* Move shl/shr to bddv

* Make unit test smaller

* Add class dd::fdd to manage association between BDDs and numbers

* Remove contains_num/find_num from bdd_manager
2021-04-20 09:09:32 -07:00
Jakob Rath
4da1b7b03c
Add functionality for BDD vectors (#5198)
* Fix XOR over BDDs

* Add operator<< for find_int_t

* Add equality assertion macro that prints expression values on failure

* Adapt contains_int and find_int to take externally-defined bits

* Add more operations on BDD vectors

* Remove old functions

* Additional bddv functions

* Rename some things

* Make bddv a class and add operators

* Fix find_num/contains_num calls
2021-04-19 09:05:19 -07:00
Nikolaj Bjorner
0d65b19c20 cr
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-17 14:27:47 -07:00
Nikolaj Bjorner
4b35c75712 add code review and replacement for mk_int
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-17 14:19:17 -07:00
Nikolaj Bjorner
5706c7a93b addition
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-16 10:37:53 -07:00
Nikolaj Bjorner
c7868579c0 add sample bdd vector operations
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-16 10:22:48 -07:00
Jakob Rath
f72e30e539
Add BDD utilities; use them for narrowing/propagation of linear equality constraints (#5192)
* Add a few helper methods for encoding sets of integers as BDDs

* Use BDD functions in solver

* Add bdd::find_int

* Use bdd::find_int in solver

* Add narrowing for linear equality constraints

* Simplify code for linear propagation

* Add test for later

* Narrowing can only handle linear constraints with a single variable

* Need to push_cjust
2021-04-16 08:44:18 -07:00
Jakob Rath
7067fc16ae
Test and fix PDD subst_val (#5185) 2021-04-15 08:35:46 -07:00
Nikolaj Bjorner
9a2b7677bf na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-14 22:03:28 -07:00
Nikolaj Bjorner
e6c9f27de4 misc fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-14 14:15:43 -07:00
Jakob Rath
324d9ed461
Add more PDD utilities (div, pow) (#5180)
* Expose 'inv' on rationals to get reciprocal value

* Align parameter names with implementation

* Add cached operation that divides PDD by a constant

* Fix display for constant PDDs

* operator^ should probably call ^ instead of + (mk_xor instead of add)

* Add helper function 'pow' on PDDs
2021-04-14 04:48:42 -07:00
Nikolaj Bjorner
a0d112b7b0 general form migration
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-13 13:00:47 -07:00
Nikolaj Bjorner
f18789257e Print polynomials with power
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-12 11:20:40 -07:00
Jakob Rath
0e9fc4762a Fix PDD factor cache in case GC happens while factoring (#5170)
* Add method to find largest power of two that is a divisor

* Binary resolve on PDDs

* Add unit tests for binary resolve

* Fix factor cache access in case GC happens while factoring

* Coding conventions

* Change to gc_generation
2021-04-12 11:20:40 -07:00
Jakob Rath
75c87a2869 Test and memoize pdd factoring (#5163)
* Test and fix pdd_manager::factor

* Memoize pdd_manager::factor

* Fix Windows build (maybe)
2021-04-12 11:20:40 -07:00
Jakob Rath
f8562380d6 Fix pdd_manager::degree(PDD, unsigned) and add unit tests (#5155)
* Fix pdd_manager::degree(PDD, unsigned) and add unit tests

* Another marking opportunity
2021-04-12 11:20:40 -07:00
Nikolaj Bjorner
446654b680 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-12 11:20:39 -07:00
Nikolaj Bjorner
c2b353ba72 adding factorization 2021-03-26 14:58:24 -07:00
Nikolaj Bjorner
2fef6dc502 more scaffolding 2021-03-21 11:31:14 -07:00
Nikolaj Bjorner
a1f484fa35 na 2021-03-19 16:42:45 -07:00
Nikolaj Bjorner
c41abf2241 fix #4624 #4633 #4632 #4631
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-13 08:36:16 -07:00
Nikolaj Bjorner
d0e20e44ff booyah
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-04 15:56:30 -07:00
Nuno Lopes
e844aef896 remove a few more copy constructors, though still not enough to enable the assertion in vector
I give up for now; there are too many copies left for little return..
2020-06-03 20:32:13 +01:00
Nikolaj Bjorner
33042268b5 bounds propagation functionality
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-13 13:36:22 -07:00
Nikolaj Bjorner
b889b110ee bool_vector, some spacer tidy
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-05 12:59:04 -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
Nikolaj Bjorner
1c0e583abc avoid calling del on memory not owned by object allocator
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-25 19:43:55 -07:00
Nikolaj Bjorner
0b785cc942 track variables used by nla_solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-25 19:43:55 -07:00
Nikolaj Bjorner
c68d15f441 build of template
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-25 19:43:55 -07:00
Nikolaj Bjorner
1aaf6d879f use same interval manager in pdd_interval as caller
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-25 19:43:55 -07:00
Nikolaj Bjorner
f76432933f avoid calling del on memory not owned by object allocator
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-25 19:43:55 -07:00
Nikolaj Bjorner
f1f974638d track variables used by nla_solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-25 19:43:55 -07:00
Nikolaj Bjorner
a7158772ad move to scoped intervals for memory management
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-25 19:43:55 -07:00
Nikolaj Bjorner
88374a15d0 build errors/warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-02-07 10:09:10 -08:00
Lev Nachmanson
696c95e1cf remove duplicate lines
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
06203d227e cleanup the grobner config init
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
7ad95aa5d2 Nikolaj fixes pdd_manager::reduce() to work with the changed order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00
Lev Nachmanson
d6a246777a Nikolaj implemented lm_lt on dd::pdd
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2020-01-28 10:04:21 -08:00