3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-27 00:18:45 +00:00
Commit graph

2616 commits

Author SHA1 Message Date
Brandon Stride
257b8e91e6
Fix out of bounds error in OCaml API (#7665) (#7666) 2025-05-29 17:06:48 +01:00
LeeYoungJoon
0a93ff515d
Centralize and document TRACE tags using X-macros (#7657)
* Introduce X-macro-based trace tag definition
- Created trace_tags.def to centralize TRACE tag definitions
- Each tag includes a symbolic name and description
- Set up enum class TraceTag for type-safe usage in TRACE macros

* Add script to generate Markdown documentation from trace_tags.def
- Python script parses trace_tags.def and outputs trace_tags.md

* Refactor TRACE_NEW to prepend TraceTag and pass enum to is_trace_enabled

* trace: improve trace tag handling system with hierarchical tagging

- Introduce hierarchical tag-class structure: enabling a tag class activates all child tags
- Unify TRACE, STRACE, SCTRACE, and CTRACE under enum TraceTag
- Implement initial version of trace_tag.def using X(tag, tag_class, description)
  (class names and descriptions to be refined in a future update)

* trace: replace all string-based TRACE tags with enum TraceTag
- Migrated all TRACE, STRACE, SCTRACE, and CTRACE macros to use enum TraceTag values instead of raw string literals

* trace : add cstring header

* trace : Add Markdown documentation generation from trace_tags.def via mk_api_doc.py

* trace : rename macro parameter 'class' to 'tag_class' and remove Unicode comment in trace_tags.h.

* trace : Add TODO comment for future implementation of tag_class activation

* trace : Disable code related to tag_class until implementation is ready (#7663).
2025-05-28 14:31:25 +01:00
Nikolaj Bjorner
7ebe7c46b9 remove stale API #7648 2025-05-15 10:57:46 -07:00
Nikolaj Bjorner
9232ef579c remove copy of LICENSE.txt - pypi doesn't take it 2025-05-09 16:53:45 -07:00
Nikolaj Bjorner
644118660f list euf dependency in api cmakefile
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-05-07 15:47:03 -07:00
Nikolaj Bjorner
dd211bade9 filter out terms that are not solved 2025-04-30 09:40:45 -07:00
Nikolaj Bjorner
17cac7d87c provide shortcut to command-line version to retrieve parameters
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-04-19 13:51:08 -07:00
Shiwei Weng 翁士伟
f7aec02503
WIP: Migrating OCaml binding to CMake (#7254)
* Update doc for `mk_context`.

* Migrating to cmake.

* Migrating to cmake. It builds both internal or external libz3.

* Start to work on platform-specific problem.

* Messy notes.

* debug.

* Cleanup a bit.

* Fixing shared lib extension.

* Minor.

* Resume working on this PR.

* Remove including `AddOCaml`.

* Keep `z3.ml` and `z3.mli` in the src but specify the generated file in the bin.

* Keep `ml_example.ml` in the src.

* Try github action for ocaml.

* Add workflow using matrix.

* Fix mac linking once more.

* Bypass @rpath in building sanity check.
2025-04-19 13:41:27 -07:00
Nikolaj Bjorner
ed5dd26bb7 remove non-working ts mcp server, settle with python variant 2025-04-18 10:10:12 -07:00
Nikolaj Bjorner
741cb5c3b5 minimal z3 MCP server 2025-04-18 10:00:04 -07:00
Nikolaj Bjorner
3f73c8b18f stab at SMTLIB REL mcp server 2025-04-17 17:23:09 -07:00
Nikolaj Bjorner
755f57931b fix #7622 2025-04-17 11:05:49 -07:00
Kyle Bloom
5ad79f2864
Add Iterators as acceptable arguments to functions (#7620) 2025-04-12 10:32:56 -07:00
Nikolaj Bjorner
a83efa68eb spacing 2025-04-09 20:24:09 -07:00
Nikolaj Bjorner
8138829231 fix #7616 2025-04-09 20:24:09 -07:00
Josh Berdine
d792840739
Add Z3_is_recursive_datatype_sort to the API (#7615)
It does not seem to be possible to test if a datatype sort is recursive.
2025-04-08 14:36:57 -07:00
Mark Ryan
14e2aadad0
include LICENSE.txt in wheels (#7614)
Update setup.py so that we copy LICENSE.TXT to src/api/python before
creating the sdist.  Any wheels built from this sdist will now
contain the LICENSE.txt file.

Fixes #7604
2025-04-07 08:41:50 -07:00
Nikolaj Bjorner
0b7a81b7c9 list[ExprRef] doesn't build for python 2025-04-05 14:45:52 -07:00
Nikolaj Bjorner
e7ff6009a0 #7605
add case for linux/risc64
2025-04-05 12:07:46 -07:00
Nikolaj Bjorner
9d8291a75b remove type annotation Context | None to ensure Centos ARM Build pass 2025-04-05 10:51:35 -07:00
Nikolaj Bjorner
f607331856 type annotations across Python versions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-04-04 22:14:32 -07:00
Nikolaj Bjorner
bd2c7aa908 remove downlevel version incompatible elements of typing 2025-04-04 20:18:23 -07:00
Nikolaj Bjorner
305f1e8498 remove references to TypeGuard
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-04-04 19:41:50 -07:00
Nikolaj Bjorner
0a3719447e fix #7609 2025-04-04 18:40:15 -07:00
Nikolaj Bjorner
5e10fd39fc add selected type annotations to python API 2025-04-04 18:40:15 -07:00
Ammar Askar
eb4e28d5d4
[z3.py] Fix incorrect call to _get_ctx in SeqMapI (#7610) 2025-04-04 15:54:32 -07:00
Josh Berdine
8d81a2dcaf
Note that Z3_get_numeral_small is essentially redundant (#7599)
* Check that Z3_get_numeral_small is given non-null out params

Analogous to other Z3_get_numeral_* functions with out params.

* Note that Z3_get_numeral_small is essentially redundant

The error behavior of Z3_get_numeral_small does not follow the pattern of
the other functions. The functions that have out params and return a bool
indicating success (such as Z3_get_numeral_rational_int64) return false
rather than signaling an error when given an unsupported expression
argument (such as a rounding mode value). The functions that do not have out
params signal an error in such cases. Z3_get_numeral_small is the odd one
out in that it signals errors and returns a status bool.

This error handling is the only difference between Z3_get_numeral_small and
Z3_get_numeral_rational_int64, so this patch adds a comment to the
documentation.
2025-03-29 10:02:32 -07:00
Josh Berdine
63ad2837e2
Add Z3_get_array_arity (#7598) 2025-03-28 14:42:51 -07:00
Josh Berdine
934455a24b
Remove vestiges of old ml api (#7597) 2025-03-27 16:41:31 -07:00
Nikolaj Bjorner
80f00f191a fix #7572 and fix #7574
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-03-07 10:46:29 -08:00
Phil Clayton
e6a089e63d
Fix build when Z3_API macro is non-empty (#7553)
API function definitions are updated to be consistent with header files.
2025-02-13 08:46:08 -08:00
Clemens Eisenhofer
091984419e
Fixed bug in UP (#7545)
* Fixed bug in UP

* Put decrement at the right position
2025-02-04 08:41:28 -08:00
Nikolaj Bjorner
6893e782ed add cases for new parameters for ts build 2025-01-22 11:59:36 -08:00
Nikolaj Bjorner
bd566f16b1 Expose PARAMETER_INTERNAL and PARAMETER_ZSTRING in case API users access these #7522 2025-01-22 11:46:11 -08:00
Nikolaj Bjorner
ef275ab1a0 fix #7523 2025-01-22 11:46:11 -08:00
Michał Górny
fc9ff946b7
use cmake from PyPI only when system executable is not available (#7514)
Rather than pulling `cmake` from PyPI unconditionally, add it to build
dependencies only if the system `cmake` executable cannot be found.
This eliminates an unnecessary dependency on systems featuring CMake,
and ensures that whenever possible, a downstream patched CMake version
is used that is more compatible with the system in question.
2025-01-21 14:39:19 -08:00
Nikolaj Bjorner
71a4801c1d add shortcuts to convert to python objects in cases of numerals and strings 2025-01-05 12:17:38 -08:00
Nikolaj Bjorner
cd41b21fa2 fix #7501 2025-01-05 11:59:59 -08:00
Nikolaj Bjorner
05f166f736 add py_value to selected classes in python bindings, add mode for input-assertion based lookahead solving 2025-01-04 13:40:49 -08:00
Nuno Lopes
322dcec531
Add 2 new API functions to get depth & groundness of exprs (#7479)
* Update api_ast.cpp

* Update z3_api.h
2024-12-30 08:49:43 -08:00
Dmitri
f99e1ee581
Support BitVectors in the TypeScript Optimize API (#7480)
This is just a change in type declarations to allow calling minimize/maximize with BitVectors.
2024-12-30 08:49:30 -08:00
Nuno Lopes
bd8c870bbe api: avoid some string copies when using mk_external_string 2024-12-28 09:42:54 +00:00
Nikolaj Bjorner
2044fb460d fix #7490 2024-12-21 14:32:02 +01:00
Nikolaj Bjorner
87f7a20e14 Add (updated and general) solve_for functionality for arithmetic, add congruence_explain to API to retrieve explanation for why two terms are congruent Tweak handling of smt.qi.max_instantations
Add API solve_for(vars).
It takes a list of variables and returns a triangular solved form for the variables.
Currently for arithmetic. The solved form is a list with elements of the form (var, term, guard).
Variables solved in the tail of the list do not occur before in the list.
For example it can return a solution [(x, z, True), (y, x + z, True)] because first x was solved to be z,
then y was solved to be x + z which is the same as 2z.

Add congruent_explain that retuns an explanation for congruent terms.
Terms congruent in the final state after calling SimpleSolver().check() can be queried for
an explanation, i.e., a list of literals that collectively entail the equality under congruence closure.
The literals are asserted in the final state of search.

Adjust smt_context cancellation for the smt.qi.max_instantiations parameter.
It gets checked when qi-queue elements are consumed.
Prior it was checked on insertion time, which didn't allow for processing as many
instantations as there were in the queue. Moreover, it would not cancel the solver.
So it would keep adding instantations to the queue when it was full / depleted the
configuration limit.
2024-12-19 23:27:57 +01:00
Oskar Haarklou Veileborg
b4295620b3
Add __enter__ and __exit__ methods on Optimize class (#7477)
This enables the use of the with statement for the Optimize class to
concisely call push() and pop(). This works similarly to the Solver
class.
2024-12-13 09:19:04 -08:00
Kevin Gibbons
e5f8327483
Update emscripten (#7473)
* fixes for newer emscripten thread handling behavior

* fix return type for async wrapper functions

* update prettier

* update typescript and fix errors

* update emscripten version in CI

* update js readme about tests
2024-12-06 18:11:14 -08:00
Yuantian Ding
4be4067f75
Typescript high-level api for Sets (#7471) 2024-12-05 07:00:11 -08:00
Nikolaj Bjorner
05e053247d add facility to solve for a linear term over API 2024-11-30 09:34:27 -08:00
Nikolaj Bjorner
d2411567b5 add projection with witnesses
expose model based projection with witness creation
2024-11-27 10:26:34 -08:00
Nikolaj Bjorner
36725758eb fix typos POLING -> POLLING in setup.py and remove unused CFLAGS
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-21 11:32:38 -08:00