3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-11-02 04:27:52 +00:00
Commit graph

20087 commits

Author SHA1 Message Date
Nikolaj Bjorner
87d1131620 bump version for release
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-29 12:48:58 -07:00
Nikolaj Bjorner
745087e237 update release notes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-29 07:39:33 -07:00
Nikolaj Bjorner
c88295a7c7 fix C++ example and add polymorphic interface for C++
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-29 03:08:49 -07:00
Nikolaj Bjorner
6efffa0054 renemable Centos AMD nightly
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-28 18:55:47 -07:00
Nikolaj Bjorner
1b9a636910 fix build break introduced when adding support for polymorphic datatypes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-28 18:55:47 -07:00
dependabot[bot]
88fcc05d6c
Bump actions/upload-artifact from 4 to 5 (#7998)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  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>
2025-10-28 15:47:26 -07:00
dependabot[bot]
488c712f5b
Bump actions/download-artifact from 5 to 6 (#7999)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  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>
2025-10-28 15:47:15 -07:00
Copilot
3570073c29
Add missing mkLastIndexOf method and CharSort case to Java API (#8002)
* Initial plan

* Add mkLastIndexOf method and CharSort support to Java API

- Added mkLastIndexOf method to Context.java for extracting last index of sub-string
- Added Z3_CHAR_SORT case to Sort.java's create() method switch statement
- Added test file to verify both fixes work correctly

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

* Fix author field in test file

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

* Delete examples/java/TestJavaAPICompleteness.java

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-28 15:46:48 -07:00
Nikolaj Bjorner
b6e3a68839 update centos version
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-28 15:13:30 -07:00
Nikolaj Bjorner
766eaa3376 disable centos build until resolved
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-28 15:12:05 -07:00
Lev Nachmanson
efd5d04af5 enable always add all coeffs in nlsat
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-24 17:47:16 -07:00
Lev Nachmanson
887ecc0c98 throttle grobner method more actively
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-22 21:36:22 -07:00
Lev Nachmanson
58e64ea826 try exponential delay in grobner
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-22 17:00:16 -07:00
hwisungi
2bf1cc7d61
Enabling Control Flow Guard (CFG) by default for MSVC on Windows, with options to disable CFG. (#7988)
* Enabling Control Flow Guard by default for MSVC on Windows, with options to disable it.

* Fix configuration error for non-MSVC compilers.

* Reviewed and updated configuration for Python build and added comment for CFG.
2025-10-22 14:18:25 +02:00
dependabot[bot]
68a7d1e1b1
Bump actions/setup-node from 5 to 6 (#7994)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  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>
2025-10-21 21:17:35 +02:00
Nelson Elhage
9a2867aeb7
Add a fast-path to _coerce_exprs. (#7995)
When the inputs are already the same sort, we can skip most of the
coercion logic and just return.

Currently, `_coerce_exprs` is by far the most expensive part of
building up many common Z3 ASTs, so this fast-path is a substantial
speedup for many use-cases.
2025-10-21 21:16:54 +02:00
Lev Nachmanson
06ed96dbda add the "noexcept" keyword to value_score=(value_score&&) declaration 2025-10-20 11:53:34 -07:00
Nikolaj Bjorner
f2e7abbdc1 disable manylinux until segfault is resolved
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-20 08:28:08 +02:00
Nikolaj Bjorner
aaaa32b4a0 build fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-19 20:55:45 +02:00
Nikolaj Bjorner
d65c0fbcd6 add explicit constructors for nightly mac build failure
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-19 20:14:20 +02:00
Nikolaj Bjorner
fcc7e02167
Update arith_rewriter.cpp
fix memory leak introduced by update to ensure determinism
2025-10-18 13:32:49 +02:00
Nikolaj Bjorner
62ee7ccf65
Revert "Add finite_set_value_factory for creating finite set values in model …" (#7985)
This reverts commit 05ffc0a77b.
2025-10-16 13:18:35 +02:00
Copilot
05ffc0a77b
Add finite_set_value_factory for creating finite set values in model generation (#7981)
* Initial plan

* Add finite_set_value_factory implementation

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

* Remove unused dl_decl_plugin variable and include

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

* Update copyright and add TODOs in finite_set_value_factory

Updated copyright information and added TODO comments for handling in finite_set_value_factory methods.

* Update copyright information in finite_set_value_factory.h

Updated copyright year from 2006 to 2025.

* Implement finite_set_value_factory using array_util to create singleton sets

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

* Simplify empty set creation in finite_set_value_factory

Refactor finite_set_value_factory to simplify empty set handling and remove array-specific logic.

* Change family ID for finite_set_value_factory

* Fix build error by restoring array_decl_plugin include and implementation

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

* Update finite_set_value_factory.h

* Add SASSERT for finite set check in factory

Added assertion to check if the sort is a finite set.

* Rename member variable from m_util to u

* Refactor finite_set_value_factory for value handling

* Use register_value instead of direct set insertion

Replaced direct insertion into set with register_value calls.

* Update finite_set_value_factory.cpp

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-16 13:16:54 +02:00
Lev Nachmanson
a179286183 restore the method behavior
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-15 16:44:13 -07:00
Lev Nachmanson
1921260c42 restore single cell
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-15 16:44:13 -07:00
Nikolaj Bjorner
3b565bb284 trim parametric datatype test
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-15 21:39:39 +02:00
Copilot
5163411f9b
Update Z3_mk_datatype_sort API to accept array of sort parameters and add Z3_mk_polymorphic_datatype (#7966)
* Initial plan

* Update Z3_mk_datatype_sort API to accept array of parameters

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

* Update language bindings for parametric datatype sort API

- Python: Updated DatatypeSort() to accept optional params list
- OCaml: Added mk_sort_ref_p/mk_sort_ref_ps for parametric datatypes
- .NET: Added MkDatatypeSortRef() methods with optional params
- Java: Added mkDatatypeSortRef() methods with optional params
- All changes maintain backward compatibility

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

* Fix .NET build error - rename params to parameters

The 'params' keyword is reserved in C#, causing compilation errors.
Renamed parameter from 'params' to 'parameters' in MkDatatypeSortRef methods.

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

* Add unit test for parametric datatypes

Added test_parametric_datatype.cpp to demonstrate polymorphic datatypes.
The test creates two concrete instantiations of a generic pair concept:
- pair_int_real with fields (first:Int, second:Real)
- pair_real_int with fields (first:Real, second:Int)
Then verifies that accessors work correctly and type checking is enforced.

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

* Implement polymorphic type variables support for parametric datatypes

- Modified datatype_decl_plugin to allow type variables as parameters
- Updated mk_datatype_decl to extract type variables from field sorts
- Type variables are collected in order of first appearance
- Revised unit test to use Z3_mk_type_variable for polymorphic datatypes
- Test creates pair datatype with type variables alpha and beta
- Successfully instantiates with concrete types (pair Int Real) and (pair Real Int)
- Verifies accessor types match and equality terms are well-typed
- All tests pass

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

* Add Z3_mk_polymorphic_datatype API and refactor datatype creation

- Added new API Z3_mk_polymorphic_datatype to z3_api.h
- Renamed static mk_datatype_decl to api_datatype_decl in api_datatype.cpp
- Modified api_datatype_decl to accept explicit type parameters
- Updated all callers to use renamed function
- Added test_polymorphic_datatype_api demonstrating new API usage
- Both tests pass successfully

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

* Remove type variable collection logic from constructors

Removed the logic for collecting type variables from field sorts based on constructors.

* Update comments on parameter handling in api_datatype.cpp

Clarify usage of parameters in API documentation.

* Fix OCaml build error - use list instead of array for mk_datatype_sort

Changed mk_sort_ref to pass empty list [] instead of empty array [||].
Changed mk_sort_ref_p to pass params list directly instead of converting to array.
Z3native.mk_datatype_sort expects a list, not an array.

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

* Add polymorphic datatype example to C++ examples

Added polymorphic_datatype_example() demonstrating:
- Creating type variables alpha and beta with Z3_mk_type_variable
- Defining parametric Pair datatype with fields of type alpha and beta
- Instantiating with concrete types (Pair Int Real) and (Pair Real Int)
- Getting constructors and accessors from instantiated datatypes
- Creating constants and expressions using the polymorphic types
- Verifying type correctness with equality (= (first p1) (second p2))

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>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-15 20:51:21 +02:00
dependabot[bot]
e669fbe557
Bump github/codeql-action from 3 to 4 (#7971)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  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>
2025-10-14 18:08:27 +02:00
Lev Nachmanson
641741f3a8 parameter eval order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-07 10:30:58 -07:00
Lev Nachmanson
8af9a20e01 parameter eval order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-07 10:26:40 -07:00
Lev Nachmanson
6a9520bdc2 parameter eval order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-07 10:21:09 -07:00
Lev Nachmanson
8ccf4cd8f7 parameter eval order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-07 10:19:24 -07:00
Lev Nachmanson
40b980079b parameter eval order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-07 10:14:02 -07:00
Lev Nachmanson
a41549eee6 parameter eval order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-07 10:06:43 -07:00
Lev Nachmanson
2b3068d85f parameter eval order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-07 09:17:12 -07:00
Lev Nachmanson
3a2bbf4802 param eval order 2025-10-07 09:13:21 -07:00
Lev Nachmanson
6e52b9584c param eval 2025-10-07 09:04:24 -07:00
Lev Nachmanson
93ff8c76db parameter evaluation order 2025-10-07 08:53:49 -07:00
Lev Nachmanson
00f1e6af7e parameter eval order 2025-10-07 08:40:24 -07:00
Lev Nachmanson
c154b9df90 param order evaluation 2025-10-07 08:34:56 -07:00
Lev Nachmanson
77c70bf812 param order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-06 15:52:09 -07:00
Lev Nachmanson
63bb367a10 param order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-06 15:52:09 -07:00
Nikolaj Bjorner
e9a2766e6c remove AI slop
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-06 13:53:37 -07:00
Lev Nachmanson
5a9663247b fix the order of parameter evaluation
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-06 13:44:19 -07:00
Lev Nachmanson
5ae858f66b fixing the order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-06 13:44:19 -07:00
Lev Nachmanson
aa5645b54b fixing the order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-06 13:44:19 -07:00
Nikolaj Bjorner
542e015550
Remove unused variable 'first' in mpz.cpp
Removed unused variable 'first' from the function.
2025-10-06 13:39:27 -07:00
Copilot
cd1ceb6efe
[WIP] Add a mutex to warning.cpp to ensure that warning messages from different threads don't interfere (#7963)
* Initial plan

* Add mutex to warning.cpp for thread safety

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>
2025-10-06 13:38:18 -07:00
dependabot[bot]
3ce8aca411
Bump actions/checkout from 4 to 5 (#7954)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [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/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  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>
2025-10-04 01:22:52 -07:00
Nikolaj Bjorner
c8bdbd2dc4 remove directory
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-03 11:58:57 -07:00