* Initial plan
* Convert plain enums to enum class in EUF module
- Convert eq_status in euf::ac_plugin to enum class
- Convert undo_kind in euf::ac_plugin to enum class
- Convert undo_t in euf::arith_plugin to enum class
- Convert to_merge_t in euf::egraph to enum class
- Update all usage sites to use scoped enum syntax
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Convert more plain enums to enum class
- Convert state enum in substitution class
- Convert instruction enum in generic_model_converter class
- Convert eq_type enum in bit2int class
- Update all usage sites to use scoped enum syntax
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>
* Initial plan
* Add API coherence improvements for C#, Python, C++, and TypeScript
- C#: Add SubstituteFuns method to Expr class
- Python: Add update method to ExprRef class
- C++: Add update method to expr class
- TypeScript: Add complete Statistics API with Statistics interface, StatisticsEntry interface, StatisticsImpl class, and statistics() methods for Solver, Optimize, and Fixedpoint
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Add Z3_stats import and Statistics types to TypeScript bindings
- Add Z3_stats to imports in types.ts and high-level.ts
- Add Statistics and StatisticsEntry to type imports in high-level.ts
- Fixes missing type references identified in code review
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>
* Initial plan
* Add [[nodiscard]] to AST factory functions and modernize iterator loops
- Added [[nodiscard]] attribute to key factory functions in ast.h:
- All mk_app() variants for creating application nodes
- All mk_func_decl() variants for creating function declarations
- All mk_const() variants for creating constants
- All mk_sort() variants for creating sorts
- mk_var() for creating variables
- mk_quantifier(), mk_forall(), mk_exists(), mk_lambda() for quantifiers
- mk_label(), mk_pattern() and related functions
- Converted iterator loops to range-based for loops in:
- src/util/region.cpp: pop_scope()
- src/util/dec_ref_util.h: dec_ref_key_values(), dec_ref_keys(), dec_ref_values()
- src/util/mpf.h: dispose()
- src/util/numeral_buffer.h: reset()
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Modernize additional iterator loops to range-based for loops
- Converted iterator loops to range-based for loops in:
- src/api/api_ast_map.cpp: Z3_ast_map_keys() and Z3_ast_map_to_string()
- src/api/c++/z3++.h: optimize copy constructor and add() method
- src/opt/wmax.cpp: mk_assumptions()
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Revert changes to z3++.h for C++ version compatibility
Revert the range-based for loop changes in src/api/c++/z3++.h to maintain
compatibility with older C++ versions that users may rely on. The C++ API
wrapper must support down-level C++ standards for backward compatibility.
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Trigger CI build
[skip ci] is not used to ensure CI runs
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Initial plan
* Add AtMost, AtLeast, checkAssumptions, and unsatCore methods to JS/TS API
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Format code with prettier
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Add comprehensive documentation for Solver.check, checkAssumptions, and unsatCore methods
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Remove redundant checkAssumptions method, use check() for assumptions
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Enable unsat_core tracking in test to fix 'unknown' result
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Add reasonUnknown() method and use it in test to debug unknown results
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>
default behavior is conservative: if the body of a recursive function contains uninterpreted variables they are not rewritten.
Model evaluation will bind values to uninterpreted variables so the filter should not apply here.
* add user params
* inprocessing flag
* playing around with clause sharing with some arith constraints (complicated version commented out)
* collect shared clauses inside share units after pop to base level (might help NIA)
* dont collect clauses twice
* dont pop to base level when sharing units, manual filter
* clean up code
---------
Co-authored-by: Ilana Shapiro <ilanashapiro@Mac.localdomain>
* Add CMake option to build only Python bindings without rebuilding libz3
Introduce Z3_BUILD_LIBZ3_CORE option (default ON) to control whether libz3 is built.
When set to OFF with Z3_BUILD_PYTHON_BINDINGS=ON, only Python bindings are built
using a pre-installed libz3 library. This is useful for package managers like
conda-forge to avoid rebuilding libz3 for each Python version.
Changes:
- Add Z3_BUILD_LIBZ3_CORE option in src/CMakeLists.txt
- When OFF, find and use pre-installed libz3 as imported target
- Update Python bindings CMakeLists.txt to handle both built and imported libz3
- Add documentation in README-CMake.md with usage examples
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Fix CMake export issues when building only Python bindings
Conditionally export Z3_EXPORTED_TARGETS only when Z3_BUILD_LIBZ3_CORE=ON
to avoid errors when building Python bindings without building libz3.
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Disable executable and test builds when not building libz3 core
When Z3_BUILD_LIBZ3_CORE=OFF, automatically disable Z3_BUILD_EXECUTABLE
and Z3_BUILD_TEST_EXECUTABLES to avoid build/install errors.
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* only build src/ folder if Z3_BUILD_LIBZ3_CORE is TRUE
* move z3 python bindings to main CMake
* move more logic to main CMakeLists.txt
* move Z3_API_HEADER_FILES_TO_SCAN to main CMakeLists.txt
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
* Initial plan
* Fix DEL character encoding in string literals
Change condition from `ch >= 128` to `ch >= 127` to include the DEL
character (U+007F, 127) in escaped output. This ensures that the
non-printable DEL control character is properly escaped as \u{7f}
instead of being printed directly.
Also add test cases for DEL and other control characters.
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>