3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00
Commit graph

1754 commits

Author SHA1 Message Date
Jakob Rath
183e911a79 Merge remote-tracking branch 'origin/master' into poly 2024-02-26 11:46:22 +01:00
Nikolaj Bjorner
2b14793213 #7117
probably overflow of unsigned for large capacity
2024-02-14 17:08:09 +07:00
Bruce Mitchener
155dfb10c4
Fix some typos in identifiers. (#7118) 2024-02-14 09:25:32 +07:00
Nikolaj Bjorner
548be4c1f9 add explicit move constructor to deal with unit test regression test-z3 algebraic on Windows/debug -
it uses copy constructor instead of move when returning a scoped_anum in functions such as power and root.
This leads to freeing memory that gets passed as return value.

The copy constructor for scoped_numeral is also suspicious because it doesn't ensure memory ownership.
2024-01-20 12:59:58 -08:00
Nikolaj Bjorner
a2993f7457 encapsulate mpz a bit more 2024-01-20 12:59:58 -08:00
Nikolaj Bjorner
59b18d4a14 create as_bin as_hex wrappers for display
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-01-12 09:19:22 -08:00
Nikolaj Bjorner
1acaed69c6 fix overflow
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-01-11 16:42:58 -08:00
Nikolaj Bjorner
d91820fe51 bug fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-01-01 16:24:15 -08:00
Jakob Rath
ec2b8eb4ca
Merge shared parts from polysat branch (#7063)
* sat_literal: make constants constexpr

* dlist: rename elem -> list

* tbv: use get_bit

* additional pdd and rational tests

* egraph: callback setters take functions by value

This allows to set callbacks without defining a separate variable for
the callback lambda.

(previous usage does one copy of the function, exactly as before)

* cmake: enable compiler error when non-void function does not return value
2023-12-28 11:11:53 -08:00
Nuno Lopes
ab22e763d7 some code simplifications in mpn
plus remove duplicated assertion
2023-12-22 15:29:04 +00:00
Nikolaj Bjorner
1d1457f81a migrating interface
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-12-22 07:05:17 -08:00
Nuno Lopes
766f5f04c0 reduce memory allocs in params 2023-12-21 23:27:28 +00:00
Nuno Lopes
b2d5c24c1d remove a few string copies 2023-12-20 16:55:09 +00:00
Jakob Rath
97d450868e
Vector updates from polysat branch (#7066)
* vector: add erase_if

* vector: generalize operator<<

* vector: fix missing destructor call
2023-12-19 08:58:55 -08:00
Jakob Rath
4c9f705cd1
tptr: add pointer tagging templates (#7067) 2023-12-19 08:58:32 -08:00
Nikolaj Bjorner
085b5e2588 port Jakob's update to union_find from polysat branch
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-12-18 09:25:24 -08:00
Nikolaj Bjorner
6a0f407019 add log helper to util 2023-12-16 16:12:13 -08:00
Bruce Mitchener
50e0fd3ba6
Use noexcept more. (#7058) 2023-12-16 12:14:53 +00:00
Nikolaj Bjorner
9293923b8a Add intblast solver 2023-12-15 13:50:38 -08:00
Bruce Mitchener
3ebec56880
tptr.h: Include <cstdint> once rather than twice. (#7051) 2023-12-13 09:36:41 -08:00
Nikolaj Bjorner
70d4f32ffd port updates from poly/polysat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-12-09 13:00:43 -08:00
Nikolaj Bjorner
e580c384b8 import updates to rational from polysat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-12-09 12:46:06 -08:00
Nikolaj Bjorner
1d6616afac make var-queue a template
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-12-05 15:41:35 -08:00
Nikolaj Bjorner
8a0dec1a4b fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-11-30 14:08:29 -08:00
Nikolaj Bjorner
b52fd8d954 add EUF plugin framework.
plugin setting allows adding equality saturation within the E-graph propagation without involving externalizing theory solver dispatch. It makes equality saturation independent of SAT integration.
Add a special relation operator to support ad-hoc AC symbols.
2023-11-30 13:58:30 -08:00
Christoph M. Wintersteiger
9d57bdd2ef
Assorted fixes for floats (#6968)
* Improve 4be26eb543

* Add-on to 0f4f32c5d0

* Fix mk_numeral

* Fix corner-case in fp.div

* Fixes for corner-cases in mk_to_fp_(un)signed

* Fix out-of-range results in mpf_manager::fma

* Further adjustments for fp.to_fp_(un)signed

* fp.to_fp from real can't be NaN

* fp.to_fp from reals: add bounds

* Fix NaN encodings in theory_fpa.

* Fix fp.fma rounding with tiny floats

* Fix literal creation order in theory_fpa
2023-10-29 17:29:42 -07:00
Nuno Lopes
fcb03aa56c minor code simplification 2023-10-11 01:38:03 +01:00
Nikolaj Bjorner
e8e636c3ec fix #6936 2023-10-10 13:42:21 -07:00
Lev Nachmanson
bf3817ef7c restore move_non_basic_to_bounds
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-10-05 18:14:52 -07:00
Nikolaj Bjorner
2297b0334b re-introduce simple implementation of linear monomial propagation for evaluation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-26 23:53:14 -07:00
Nikolaj Bjorner
6559e5fb32 port over std_vector and std-allocator functionality from monomial propagation branch
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-26 21:15:07 -07:00
Nikolaj Bjorner
5e3df9ee77
Arith min max (#6864)
* prepare for dependencies

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

* snapshot

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

* more refactoring

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

* more refactoring

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

* build

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

* pass in u_dependency_manager

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

* address NYIs

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

* more refactoring names

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

* eq_explanation update

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

* add outline of bounds improvement functionality

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

* fix unit tests

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

* remove unused structs

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

* more bounds

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

* more bounds

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

* convert more internals to use u_dependency instead of constraint_index

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

* convert more internals to use u_dependency instead of constraint_index

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

* remember to push/pop scopes

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

* use the main function for updating bounds

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>

* remove reset of shared dep manager

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

* disable improve-bounds, add statistics

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

---------

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-19 17:44:09 -07:00
Nikolaj Bjorner
6366f8f6b2 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-13 14:05:07 -07:00
Lev Nachmanson
f58b703ac5
u_set replaced by indexed_uint_set (#6841)
* replace u_set by indexed_uint_set

* replace u_set by indexed_uint_set

* create insert-fresh and insert for indexed_uint_set to make use cases with non-fresh inserts easier

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

* update nightly to pull arm

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

* update nightly to pull arm

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

* fixing the build of lp_tst

* update nightly to pull arm

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

* replace u_set by indexed_uint_set

* replace u_set by indexed_uint_set

* fixing the build of lp_tst

* remove unnecessery call to contains() before
insert to indexed_uint_set

* formatting, no check for contains()
 in indexed_uint_set, always init m_touched_rows to nullptr

---------

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-03 16:01:27 -07:00
Nikolaj Bjorner
7b36563196 create insert-fresh and insert for indexed_uint_set to make use cases with non-fresh inserts easier
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-08-03 09:48:07 -07:00
Michał Górny
c9d8e646ed
fix missing <cstdint> include (#6720)
Fix missing <cstdint> include in src/util/tptr.h that causes build
failure with GCC 13:

```
In file included from /tmp/z3/src/util/region.cpp:53:
/tmp/z3/src/util/region.cpp: In member function ‘void* region::allocate(size_t)’:
/tmp/z3/src/util/tptr.h:29:62: error: ‘uintptr_t’ does not name a type
   29 | #define ALIGN(T, PTR) reinterpret_cast<T>(((reinterpret_cast<uintptr_t>(PTR) >> PTR_ALIGNMENT) + \
      |                                                              ^~~~~~~~~
/tmp/z3/src/util/region.cpp:82:22: note: in expansion of macro ‘ALIGN’
   82 |         m_curr_ptr = ALIGN(char *, new_curr_ptr);
      |                      ^~~~~
/tmp/z3/src/util/region.cpp:57:1: note: ‘uintptr_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   56 | #include "util/page.h"
  +++ |+#include <cstdint>
   57 |
```
2023-05-13 09:37:57 -07:00
Tomasz Kłoczko
520e692a43
Fix building with gcc 13 (#6723)
Trivial fix to build with gcc 13 reported in #6722.

Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
2023-05-13 09:37:35 -07:00
Nikolaj Bjorner
624907823d add tests for distribution utility and fix loose ends 2023-04-13 11:19:06 -07:00
Nikolaj Bjorner
f61168cd53 module for maintaining probability distributions 2023-04-12 19:40:31 -07:00
Nikolaj Bjorner
84b9204616 inherit and reset rlimit counter on children limits
addresses rlimit leak reported by @mtzguido
2023-04-05 16:39:21 -07:00
Nikolaj Bjorner
996e5b1755 fix #6655 2023-03-31 03:25:20 -07:00
igcontreras
4b3408696d
use uintptr_t instead of size_t (tptr) for portability (#6627) 2023-03-08 21:13:38 +00:00
Nikolaj Bjorner
755b517001 fix #6600
ensure that semantics of last-indexof(t,"") = len(t)
2023-02-19 14:02:37 -08:00
Nikolaj Bjorner
554a9e8efe fix #6346 2023-02-16 08:53:08 -08:00
Jakob Rath
d69155b9e9
Shared features from polysat branch (#6567)
* Allow setting default debug action

* Fix dlist and add iterator

* Add var_queue iterator

* Add some helpers

* rational: machine_div2k and pseudo_inverse

* Basic support for non-copyable types in map

* tbv helpers

* pdd updates

* Remove duplicate functions

gcc doesn't like having both versions
2023-02-03 13:08:47 -08:00
Nikolaj Bjorner
8ea49eed8e convert reduce-args to a simplifier
- convert reduce-args to a simplifier. Currently exposed as reduce-args2 tactic until the old tactic code gets removed.
- bug fixes in model_reconstruction trail
  - allow multiple defs to be added with same pool of removed formulas
  - fix tracking of function symbols instead of expressions to filter replay
- add nla_divisions to track (cheap) divisibility lemmas.
-
2023-01-28 20:12:14 -08:00
Brecht Sanders
2bd933d87f
Fix hwf.cpp for MinGW-w64 32-bit clang (#6529)
Fix src/util/hwf.cpp for building with MinGW-w64 clang targetting Windows 32-bit.
Without this fix there is an arror about `__control87_2` not being defined.
2023-01-10 13:44:11 -08:00
Nikolaj Bjorner
c3e31149a5 fix #6530
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-10 13:43:17 -08:00
Nikolaj Bjorner
f7269bb60a update doc
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-11 10:16:17 -08:00
Nuno Lopes
9ebacd87e2 fix buggy mask (typo in my last commit..) 2022-12-09 16:16:52 +00:00