3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-19 15:04:42 +00:00
Commit graph

20276 commits

Author SHA1 Message Date
Ilana Shapiro
34a40c7747 Search tree core resolution optimization (#8066)
* Add cube tree optimization about resolving cores recursively up the path, to prune. Also integrate asms into the tree so they're not tracked separately (#7960)

* draft attempt at optimizing cube tree with resolvents. have not tested/ran yet

* adding comments

* fix bug about needing to bubble resolvent upwards to highest ancestor

* fix bug where we need to cover the whole resolvent in the path when bubbling up

* clean up comments

* close entire tree when sibling resolvent is empty

* integrate asms directly into cube tree, remove separate tracking

* try to fix bug about redundant resolutions, merging close and try_resolve_upwards into once function

* separate the logic again to avoid mutual recursion

* Refactor search tree closure and resolution logic

Refactor close_with_core to simplify logic and remove unnecessary parameters. Update sibling resolvent computation and try_resolve_upwards for clarity.

* apply formatting

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

* Refactor close_with_core to use current node in lambda

* Fix formatting issues in search_tree.h

* fix build issues

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

* Update smt_parallel.cpp

* Change loop variable type in unsat core processing

* Change method to retrieve unsat core from root

---------

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:58 -08:00
Copilot
1081916973 Implement Z3_optimize_translate for context translation (#8072)
* Initial plan

* Implement Z3_optimize_translate functionality

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Fix compilation errors and add tests for optimize translate

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Revert changes to opt_solver.cpp as requested

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-02-18 20:56:58 -08:00
Nikolaj Bjorner
3a09b0d2b5 remove stale experimental code #8063
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:58 -08:00
Nikolaj Bjorner
3669dc37b3 don't unfold recursive defs if there is an uninterpreted subterm, #7671
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:58 -08:00
Nikolaj Bjorner
b6e8f2b033 disable preprocessing only after formulas are internalized 2026-02-18 20:56:57 -08:00
Nikolaj Bjorner
d59d40a356 allow parsing declared arrays without requiring explicit select
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:57 -08:00
Lev Nachmanson
7a6eb9bb4d fix the build
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2026-02-18 20:56:57 -08:00
Copilot
5aa35eba20 Disable C++98 compatibility warnings for Clang builds (#8060)
* Initial plan

* Disable C++98 compatibility warnings for Clang to fix vcpkg build freeze

Add -Wno-c++98-compat and -Wno-c++98-compat-pedantic flags to prevent
excessive warning output when building with clang-cl or when -Weverything
is enabled. These warnings are not useful for Z3 since it requires C++20.

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-02-18 20:56:57 -08:00
Lev Nachmanson
1200c0bd0c remove unused *_signed_project() methods
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2026-02-18 20:56:57 -08:00
Nikolaj Bjorner
208c5b1b73 fix #8054
inherit denominators when evaluating polynomials
2026-02-18 20:56:57 -08:00
Nikolaj Bjorner
5d824d6a5f fix #8055 2026-02-18 20:56:57 -08:00
Nikolaj Bjorner
6f4c571f6a remove deprecated set_has_size
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:57 -08:00
Nikolaj Bjorner
c892b6ba66 remove deprecated set_has_size
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:57 -08:00
Nikolaj Bjorner
715b73c93d remove deprecated set_has_size
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:57 -08:00
Nikolaj Bjorner
ad73d5f490 remove deprecated set_has_size
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:56 -08:00
Josh Berdine
e664d006d9 Fix _in vs _out def_API param for Z3_solver_get_levels (#8050)
Signed-off-by: Josh Berdine <josh@berdine.net>
2026-02-18 20:56:56 -08:00
Nikolaj Bjorner
e76d477ab0 refine givup conditions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:56 -08:00
Nikolaj Bjorner
b8b6d96fba insert theory only once
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:56 -08:00
Nikolaj Bjorner
e4697fe18e remove set cardinality operators from array theory. Make final-check use priority levels
Issue #7502 shows that running nlsat eagerly during final check can block quantifier instantiation.
To give space for quantifier instances we introduce two levels for final check such that nlsat is only applied in the second and final level.
2026-02-18 20:56:51 -08:00
Nikolaj Bjorner
7b9eb2a92f fix second byref to bool 2026-02-18 20:56:03 -08:00
Nikolaj Bjorner
c033f432d8 remove references to set_has_size 2026-02-18 20:56:03 -08:00
Nikolaj Bjorner
58d86c2798 use c_bool instead of c_int for sign 2026-02-18 20:56:02 -08:00
Nikolaj Bjorner
08babfff60 fix build warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:02 -08:00
Nikolaj Bjorner
032a3a879b python type fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:02 -08:00
Nikolaj Bjorner
ee88359f50 fix dotnet build errors
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:02 -08:00
Nikolaj Bjorner
0c1ff55adf fix warnings in nla_pp
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:02 -08:00
Nikolaj Bjorner
2fd89c5921 fix warnings in nra_solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:02 -08:00
Nikolaj Bjorner
c66628e6e1 port dotnet to use bool sorts from API
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:02 -08:00
Nikolaj Bjorner
abd9b4c05d fix type for BoolPtr
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:02 -08:00
Nikolaj Bjorner
f0e0beedb1 port to BoolPtr
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:02 -08:00
Nikolaj Bjorner
a0ed6096eb remove unused
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:01 -08:00
Nikolaj Bjorner
8a88356fa5 update java API code to work with boolean pointers
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:01 -08:00
Nikolaj Bjorner
913779d507 open_log returns bool
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:01 -08:00
Nikolaj Bjorner
0fcc7b5123 update doc test string
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:01 -08:00
Josh Berdine
f0cb79fc21 Return bool instead of int in extra_API for Z3_open_log (#8048)
The C declaration returns `bool`.

Signed-off-by: Josh Berdine <josh@berdine.net>
2026-02-18 20:56:01 -08:00
Josh Berdine
d8ac364bf7 Return sign from Z3_fpa_get_numeral_sign as bool instead of int (#8047)
The underlying `mpf_manager::sgn` function returns a `bool`, and functions
such as `Z3_mk_fpa_numeral_int_uint` take the sign as a `bool`.

Signed-off-by: Josh Berdine <josh@berdine.net>
2026-02-18 20:56:01 -08:00
Josh Berdine
2b1583a7f0 Return bool instead of int from Z3_rcf_interval (#8046)
In the underlying realclosure implementation, the interval operations for
{`lower`,`upper`}`_is_`{`inf`,`open`} return `bool` results. Currently these
are cast to `int` when surfacing them to the API. This patch keeps them at
type `bool` through to `Z3_rcf_interval`.

Signed-off-by: Josh Berdine <josh@berdine.net>
2026-02-18 20:56:01 -08:00
Nikolaj Bjorner
66141dfdfa apply gcd test also before saturation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:00 -08:00
Nikolaj Bjorner
b50286084e use edit distance for simplified error messaging on wrong trace tags
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-02-18 20:56:00 -08:00
Lev Nachmanson
f8ce742890 try reordering before analyzing bounds
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2026-02-18 20:56:00 -08:00
Lev Nachmanson
79f83154a3 parameter correct order experiment
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2026-02-18 20:56:00 -08:00
dependabot[bot]
7592db1362 Bump actions/checkout from 5 to 6 (#8043)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-18 20:56:00 -08:00
Lev Nachmanson
80acfbeea3 remove the debug print 2026-02-18 20:56:00 -08:00
Lev Nachmanson
7d48a7318e remove the exit statement 2026-02-18 20:56:00 -08:00
Lev Nachmanson
b582b2f32e disable add_zero_disc(disc) by default
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2026-02-18 20:56:00 -08:00
Lev Nachmanson
1f3d61b6f4 optionally call add_zero_assumption on a vanishing discriminant
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2026-02-18 20:56:00 -08:00
Lev Nachmanson
a94373981a restart projection when found a non-trivial nullified polynomial, and remove is_square_free
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2026-02-18 20:56:00 -08:00
Lev Nachmanson
7909e2498a refactoring
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2026-02-18 20:55:59 -08:00
Lev Nachmanson
c9add31da7 remove unused code 2026-02-18 20:55:59 -08:00
Lev Nachmanson
d2dd7f9df5 remve add_zero_assumption from pcs()
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2026-02-18 20:55:59 -08:00