3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-13 16:06:39 +00:00
Commit graph

1637 commits

Author SHA1 Message Date
Nikolaj Bjorner
524ebed44f Merge branch 'master' of https://github.com/z3prover/z3 into polysat 2021-08-11 09:21:58 -07:00
Margus Veanes
225204e2f4
updates related to issue #5140 (#5463)
* updates related to issue #5140

* updated/simplified some cases

* fixing feedback comments

* fixed comments and added missing case for get_re_head_tail_reversed

* two bug fixes and some other code improvements
2021-08-09 10:48:56 -07:00
Nikolaj Bjorner
0249d009f1 Merge branch 'master' of https://github.com/z3prover/z3 into polysat 2021-08-04 14:02:41 -07:00
Nikolaj Bjorner
202ed79a24 #5445 2021-08-03 11:17:23 -07:00
Nikolaj Bjorner
123c446395 fix #5449 2021-08-01 13:03:40 -07:00
Nikolaj Bjorner
4c6e2acd45 add colors
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-07-15 00:03:56 +02:00
Nikolaj Bjorner
5bd900a7e1 fix include dependencies for tbv
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-07-02 03:36:17 -07:00
Nikolaj Bjorner
f18dccebc2 move tbv
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-06-21 21:12:46 -07:00
Nikolaj Bjorner
4a0a678e3f #5336 2021-06-19 22:21:45 -07:00
Nikolaj Bjorner
57df45dc16 Merge branch 'master' of https://github.com/z3prover/z3 into polysat 2021-06-18 10:02:33 -07:00
Nikolaj Bjorner
3da9d91866 #5333 2021-06-06 16:45:50 -07:00
Jakob Rath
46f8b15c14
ref/ref_vector minor convenience changes (#5322)
* Add ref_vector_core::push_back(ref<T>&&)

* Make operator bool() explicit
2021-05-31 10:27:46 -07:00
Jakob Rath
8757f04d20
Polysat: disjunctive lemmas (#5311)
* Add macro to disable linear solver for development

* Move new_* and add_* to header

* Add ref_vector_core::push_back(ref<T>&&)

* Attempt to simplify lifetime handling

* Make operator bool() explicit

* clause improvements

* display boolean assignment

* clause::resolve

* bug fixes

* more fixes

* final case of backtrack
2021-05-28 13:53:08 -07:00
Nuno Lopes
f1545b04d2 optimize symbol table for single-threaded mode
remotes a bunch of mem allocs + unnecessary computations on every string lookup
2021-05-23 16:35:44 +01:00
Nuno Lopes
aef38099bf vector.h: add assert to fail compilation if alignment isn't ok
let's see if all buildbots are happy with this..
2021-05-23 15:57:56 +01:00
Nuno Lopes
8fd7226b6f typo 2021-05-23 14:28:42 +01:00
Nuno Lopes
f1e0d5dc8a remove a hundred implicit constructors/destructors 2021-05-23 14:25:01 +01:00
Nuno Lopes
9eb566b401 simplify some constructors/destructors 2021-05-23 12:39:49 +01:00
Nuno Lopes
79201e5ce6 buffer.h c++17 improvements
1) ensure data is properly aligned
2) add move constructor (useful for zstrings)
2021-05-23 12:11:12 +01:00
Nuno Lopes
34e8a2f0f6 simplify 2021-05-23 12:01:04 +01:00
Nikolaj Bjorner
147b3600d9 keep
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-22 14:36:49 -07:00
Nikolaj Bjorner
20a67e47ca remove symbol -> zstring -> symbol round-trips
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-22 13:12:49 -07:00
Nikolaj Bjorner
5cb0bac41d patch
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-22 12:26:54 -07:00
Nikolaj Bjorner
a10de2e975 #5140 2021-05-22 10:15:06 -07:00
Jakob Rath
28996429df
Polysat disjunctive lemmas (WIP) (#5275)
* Extend search state by boolean literals

* Only resolve against positive equality

* mk_dep_ref

* Make clause non-owning

* scoped_clause

* Use scoped_clause

* minor

* scoped_ptr move assignment

* WIP: internal handling of disjunctive constraints

* leaf_value

* disjunctive constraints continued

* Fix bool_lit

* Actually add constraints to storage

* Some fixes

* more fixes

* constraint should have a bool_lit instead of a bool_var

* propagate(bool_lit)

* updates

* interface changes

* small fixes

* Make sat::dimacs_lit's constructor explicit

(otherwise, calling operator<< with sat::literal is ambiguous)

* Use sat::literal

* Print test name at the beginning

* Convention: constraint corresponds to the positive boolean literal

* Make constraint ownership more explicit

* clause stores literals
2021-05-21 13:50:25 -07:00
Jakob Rath
089015b250
Minor fix in sat::literal (#5293) 2021-05-21 13:50:01 -07:00
Nikolaj Bjorner
26893005c7 Merge branch 'master' of https://github.com/z3prover/z3 into polysat 2021-05-20 15:28:32 -07:00
Nikolaj Bjorner
03d2c5f3d0 consolidate literals 2021-05-20 12:58:27 -07:00
Nikolaj Bjorner
ec034679ce #5215
memory leaks
2021-05-19 12:42:38 -07:00
Nikolaj Bjorner
dc879dc3fb merge
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-03 12:41:14 -07:00
Jakob Rath
f7e476a4a0
Polysat: fixes in solver, forbidden intervals for eq_constraint (#5240)
* Rename to neg_cond

* Add some logging utilities

* Implement case of forbidden interval covering the whole domain

* Implement diseq_narrow

* Do not activate constraint if we are in a conflict state

* comments

* Assert that lemma isn't undefined

* Update revert_decision to work in the case where narrowing causes propagation

* Fix case of non-disjunctive lemma from forbidden intervals

* Conflict should not leak outside user scope

* Add guard to decide(), some notes

* Add test case

* Add constraints to watchlist of unassigned variable during propagation

* Move common propagation functionality into base class

* Combine eq/diseq narrow

* Compute forbidden interval for equality constraints by considering them as p <=u 0 (or p >u 0 for disequalities)
2021-05-03 09:30:17 -07:00
Jakob Rath
0c4824f194
Polysat: forbidden intervals updates (#5230)
* Pop assign_eh

* Fix scoped_ptr_vector constructors, add detach()

* Need to copy the returned lemma

* Add test

* Basic inequality tests

* Return disjunctive lemma to caller
2021-04-30 08:41:50 -07:00
Nikolaj Bjorner
decbf4be11 fix undo record for lblset
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-29 14:06:18 -07:00
Nikolaj Bjorner
e5892e5e97 #5215
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-27 15:26:56 -07:00
Nikolaj Bjorner
c03fac8390 Investigating std::vector and #5178 2021-04-24 14:50:59 -07:00
Nikolaj Bjorner
36cd80748f working on pivot
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-20 17:42:01 -07:00
Nikolaj Bjorner
831edba1c8 fixplex
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-20 12:03:28 -07:00
Nikolaj Bjorner
770c79a939 prepare for std::vector 2021-04-20 09:24:24 -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
Nuno Lopes
e67b9ebcf7 try to fix ARM32 build (#2776) 2021-04-17 16:14:05 +01: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
feb31045f5
Add more logging to polysat (#5186)
* Add polysat logging support

* Don't really need the usual log levels

* Indent log headings

* Add display method to ptr_vector

* Add some logging to solver

* Use __FUNCSIG__ on MSVC
2021-04-15 08:35:57 -07:00
Jakob Rath
8a260d89cd
Small polysat fixes (#5183)
* Add some display functions

* Add new variables to free vars
2021-04-14 10:29:58 -07:00
Rolf Eike Beer
7f8e2a9f75
clean up CMake code (#5182)
* CMake: simplify FindGMP.cmake

Remove printing of all the different variables, and let FPHSA output the library
name. Add an imported target, which bundles the library and the include
directories for easier usage.

* fix build: vector::c_ptr() now is vector::data()

* CMake: use Threads::Threads imported module

Otherwise the setting of THREADS_PREFER_PTHREAD_FLAG has no effect.

* CMake: remove needless policy setting

The minimum required version is CMake 3.4, where these policies are already set
to new because they were introduced earlier.

* CMake: remove needless variable expansion
2021-04-14 10:29:15 -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
21baa2a70a Merge branch 'master' of https://github.com/z3prover/z3 into polysat 2021-04-14 03:51:12 -07:00
Nikolaj Bjorner
4a6083836a call it data instead of c_ptr for approaching C++11 std::vector convention. 2021-04-13 18:17:35 -07:00
Nikolaj Bjorner
c2b213c049 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-12 11:20:38 -07:00
Nikolaj Bjorner
31baab49c8 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-04-12 11:20:37 -07:00
Nikolaj Bjorner
e89071d366 #5125 2021-03-26 14:58:24 -07:00