Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
41b5c64
very basic setup
ilanashapiro Jul 23, 2025
563906d
Merge branch 'Z3Prover:master' into parallel-solving
ilanashapiro Jul 24, 2025
4b87458
Merge remote-tracking branch 'upstream/ilana' into parallel-solving
ilanashapiro Jul 24, 2025
a6c51df
ensure solve_eqs is fully disabled when smt.solve_eqs=false, #7743
NikolajBjorner Jul 24, 2025
01633f7
respect smt configuration parameter in elim_unconstrained simplifier
NikolajBjorner Jul 24, 2025
1a488bb
indentation
NikolajBjorner Jul 25, 2025
6550495
add bash files for test runs
ilanashapiro Jul 25, 2025
e549286
add option to selectively disable variable solving for only ground ex…
NikolajBjorner Jul 26, 2025
95be0cf
remove verbose output
NikolajBjorner Jul 26, 2025
0528c86
fix #7745
NikolajBjorner Jul 26, 2025
8e1a528
ensure atomic constraints are processed by arithmetic solver
NikolajBjorner Jul 26, 2025
1f8b081
#7739 optimization
NikolajBjorner Jul 26, 2025
ad2934f
fix unsound len(substr) axiom
NikolajBjorner Jul 26, 2025
eb24488
FreshConst is_sort (#7748)
humnrdble Jul 27, 2025
e3139d4
#7750
NikolajBjorner Jul 27, 2025
0761394
Add parameter validation for selected API functions
NikolajBjorner Jul 27, 2025
67695b4
updates to ac-plugin
NikolajBjorner Jul 27, 2025
f77123c
enable passive, add check for bloom up-to-date
NikolajBjorner Jul 28, 2025
36fbee3
add top-k fixed-sized min-heap priority queue for top scoring literals
ilanashapiro Jul 28, 2025
f607a70
Merge branch 'Z3Prover:master' into parallel-solving
ilanashapiro Jul 28, 2025
4eeb98d
Merge branch 'ilana' into parallel-solving
NikolajBjorner Jul 29, 2025
2c188a5
set up worker thread batch manager for multithreaded batch cubes para…
ilanashapiro Jul 29, 2025
375d537
Merge branch 'parallel-solving' of github.com:ilanashapiro/z3 into pa…
ilanashapiro Jul 29, 2025
8a6cbec
fix bug in parallel solving batch setup
ilanashapiro Jul 30, 2025
e6213f8
fix bug
ilanashapiro Jul 31, 2025
2d876d5
allow for internalize implies
NikolajBjorner Aug 1, 2025
89cc9bd
disable pre-processing during cubing
NikolajBjorner Aug 1, 2025
12df9f8
Merge branch 'Z3Prover:master' into parallel-solving
ilanashapiro Aug 1, 2025
2a26776
debugging
ilanashapiro Aug 1, 2025
33c184f
Merge branch 'parallel-solving' of github.com:ilanashapiro/z3 into pa…
ilanashapiro Aug 1, 2025
97aa46a
remove default constructor
nunoplopes Aug 3, 2025
f23b053
remove a bunch of string copies
nunoplopes Aug 3, 2025
d8fafd8
Update euf_ac_plugin.cpp
NikolajBjorner Aug 3, 2025
b9b3e0d
Update euf_completion.cpp
NikolajBjorner Aug 3, 2025
d66fabe
Update smt_parallel.cpp
NikolajBjorner Aug 3, 2025
aac8787
process cubes as lists of individual lits
ilanashapiro Aug 4, 2025
a0a0670
Merge branch 'ilana' into parallel-solving
NikolajBjorner Aug 4, 2025
c9c3548
Merge branch 'Z3Prover:master' into parallel-solving
ilanashapiro Aug 4, 2025
7df95c0
merge
ilanashapiro Aug 4, 2025
cc8bc84
Merge branch 'parallel-solving' of github.com:ilanashapiro/z3 into pa…
ilanashapiro Aug 4, 2025
e520a42
merge
ilanashapiro Aug 4, 2025
7a8ba4b
Add support for Algebraic Datatypes in JavaScript/TypeScript bindings…
Copilot Aug 5, 2025
3982b29
chipping away at the new code structure
ilanashapiro Aug 5, 2025
0b21376
Merge branch 'Z3Prover:master' into parallel-solving
ilanashapiro Aug 5, 2025
2fce048
comments
ilanashapiro Aug 5, 2025
cdcc89a
merge
ilanashapiro Aug 5, 2025
d0bf711
Merge branch 'parallel-solving' of github.com:ilanashapiro/z3 into pa…
ilanashapiro Aug 5, 2025
723de8d
debug infinite recursion and split cubes on existing split atoms that…
ilanashapiro Aug 6, 2025
58e3121
share lemmas, learn from unsat core, try to debug a couple of things,…
ilanashapiro Aug 6, 2025
445339d
merge
ilanashapiro Aug 6, 2025
870729b
merge
ilanashapiro Aug 6, 2025
b1ab695
fix #7603: race condition in Ctrl-C handling (#7755)
nunoplopes Aug 6, 2025
d4a4dd6
add arithemtic saturation
NikolajBjorner Aug 6, 2025
b33f444
add an option to register callback on quantifier instantiation
NikolajBjorner Aug 7, 2025
aad511d
missing new closure
NikolajBjorner Aug 7, 2025
31a3037
add Z3_solver_propagate_on_binding to ml callback declarations
NikolajBjorner Aug 7, 2025
d218e87
add python file
levnach Aug 6, 2025
efa63db
debug under defined calls
levnach Aug 7, 2025
eeb1c18
more untangle params
levnach Aug 7, 2025
3eda386
precalc parameters to define the eval order
levnach Aug 7, 2025
f5016b4
remove a printout
levnach Aug 7, 2025
30830aa
rename a Python file
levnach Aug 7, 2025
fa3d341
add on_binding callbacks across APIs
NikolajBjorner Aug 7, 2025
d57dd6e
use jboolean in Native interface
NikolajBjorner Aug 7, 2025
0cefc92
register on_binding attribute
NikolajBjorner Aug 7, 2025
7ba967e
fix java build for java bindings
NikolajBjorner Aug 7, 2025
2ac1b24
avoid interferring side-effects in function calls
NikolajBjorner Aug 7, 2025
fcd3a70
remove theory_str and classes that are only used by it
NikolajBjorner Aug 8, 2025
baa0588
remove automata from python build
NikolajBjorner Aug 8, 2025
efb0bda
remove ref to theory_str
NikolajBjorner Aug 8, 2025
88293bf
get the finest factorizations before project
levnach Aug 7, 2025
8598a74
rename add_lcs to add_lc
levnach Aug 8, 2025
72757c4
resolve bad bug about l2g and g2l translators using wrong global cont…
ilanashapiro Aug 8, 2025
a9228f4
initial attempt at dynamically switching from greedy to frugal splitt…
ilanashapiro Aug 9, 2025
b7d5add
Update RELEASE_NOTES.md
NikolajBjorner Aug 10, 2025
8493c30
resolve bug about not translating managers correctly for the second p…
ilanashapiro Aug 11, 2025
2e6d95d
Merge branch 'Z3Prover:master' into parallel-solving
ilanashapiro Aug 11, 2025
e33dc47
remove unused square-free check
levnach Aug 11, 2025
7d57e6f
Merge branch 'ilana' into parallel-solving
NikolajBjorner Aug 11, 2025
6b3b8ac
add some debug prints and impelement internal polynomial fix
ilanashapiro Aug 11, 2025
ffb4bf1
merge
ilanashapiro Aug 11, 2025
de64a53
Merge branch 'parallel-solving' of github.com:ilanashapiro/z3 into pa…
ilanashapiro Aug 11, 2025
53eb2ca
Merge branch 'Z3Prover:master' into parallel-solving
ilanashapiro Aug 11, 2025
9373fec
Merge branch 'parallel-solving' of github.com:ilanashapiro/z3 into pa…
ilanashapiro Aug 11, 2025
cf8a17a
restore the square-free check
levnach Aug 11, 2025
ef61315
add some comments and debug m_assumptions_used
ilanashapiro Aug 11, 2025
a32b7ba
redo greedy->frugal strategy so we don't split on existing cubes in f…
ilanashapiro Aug 12, 2025
d864226
set up initial scaffolding for sharing clauses between threads and ba…
ilanashapiro Aug 12, 2025
f895dbc
merge
ilanashapiro Aug 12, 2025
efa5219
Merge remote-tracking branch 'upstream/ilana' into parallel-solving
ilanashapiro Aug 12, 2025
6486d92
Add .github/copilot-instructions.md with comprehensive Z3 development…
Copilot Aug 12, 2025
d375d97
Bump actions/checkout from 4 to 5 (#7773)
dependabot[bot] Aug 12, 2025
4bd40e9
turn off logging at level 0 for testing
ilanashapiro Aug 12, 2025
bdd0122
Merge remote-tracking branch 'upstream/ilana' into parallel-solving
ilanashapiro Aug 13, 2025
ae64207
add max thread conflicts backoff
ilanashapiro Aug 13, 2025
c8e866f
Parallel solving (#7775)
ilanashapiro Aug 13, 2025
3abb091
fix #7776
NikolajBjorner Aug 13, 2025
57a60c8
add > operator as shorthand for Array
NikolajBjorner Aug 13, 2025
237891c
updates to euf completion
NikolajBjorner Aug 13, 2025
bba1111
resolve bug about not popping local ctx to base level before collecti…
ilanashapiro Aug 13, 2025
eb7fd9e
Add virtual translate method to solver_factory class (#7780)
Copilot Aug 14, 2025
7f25a0d
put return_cubes under lock
ilanashapiro Aug 14, 2025
3ba08bd
Revert "resolve bug about not popping local ctx to base level before …
ilanashapiro Aug 14, 2025
6df8b39
Update seq_rewriter.cpp
NikolajBjorner Aug 14, 2025
174d64c
fix releaseNotesSource to inline
NikolajBjorner Aug 14, 2025
4362f2d
merge
ilanashapiro Aug 15, 2025
1e7832a
Use solver factory translate method in Z3_solver_translate (#7782)
Copilot Aug 15, 2025
e24a5b6
Revert "Parallel solving (#7775)" (#7777)
NikolajBjorner Aug 15, 2025
7422d81
remove upload artifact for azure-pipeline
NikolajBjorner Aug 15, 2025
a467d8c
Fix compilation warning: add missing is_passive_eq case to switch sta…
Copilot Aug 15, 2025
7b8482a
Remove NugetPublishNightly stage from nightly.yaml (#7787)
Copilot Aug 15, 2025
7250146
add more params
ilanashapiro Aug 15, 2025
063c09b
merge, and remove misleading defaults
ilanashapiro Aug 15, 2025
9b8dc4a
Merge remote-tracking branch 'upstream/ilana' into parallel-solving
ilanashapiro Aug 15, 2025
a121e6c
enable pypi public
NikolajBjorner Aug 15, 2025
d8bf0e0
Fix nullptr dereference in pp_symbol when handling null symbol names …
Copilot Aug 17, 2025
c75b8ec
add option to control epsilon #7791
NikolajBjorner Aug 17, 2025
4082e4e
update on euf
NikolajBjorner Aug 17, 2025
ff74af7
check for internalized in solve_for
NikolajBjorner Aug 17, 2025
5ad5899
merge
ilanashapiro Aug 17, 2025
7ff0b24
fix #7792
NikolajBjorner Aug 18, 2025
4542fc0
update version number to 4.15.4
NikolajBjorner Aug 18, 2025
21e3168
fix #7753
NikolajBjorner Aug 18, 2025
debe043
fix #7796
NikolajBjorner Aug 18, 2025
b1eb5b5
Merge remote-tracking branch 'upstream/ilana' into parallel-solving
ilanashapiro Aug 19, 2025
265265a
Create centralized version management with VERSION.txt (#7802)
Copilot Aug 20, 2025
7265563
read version from VERSION.txt
NikolajBjorner Aug 20, 2025
02f195a
fix version parse
NikolajBjorner Aug 20, 2025
fa0f9c9
fix parsing of version
NikolajBjorner Aug 20, 2025
48c8da4
add param tuning experiment in python
ilanashapiro Aug 21, 2025
47ce383
Merge branch 'Z3Prover:master' into parallel-solving
ilanashapiro Aug 21, 2025
4e3734d
Merge remote-tracking branch 'upstream/ilana' into parallel-solving
ilanashapiro Aug 22, 2025
d5764a1
Merge branch 'parallel-solving' of github.com:ilanashapiro/z3 into pa…
ilanashapiro Aug 22, 2025
05e8c2e
Merge remote-tracking branch 'upstream/ilana' into parallel-solving
ilanashapiro Aug 22, 2025
5d29eb1
Fix Azure Pipeline PyPI package builds by including VERSION.txt in so…
Copilot Aug 23, 2025
64419ad
Update nightly.yaml to match release.yml NuGet tool installer changes…
Copilot Aug 23, 2025
4792068
Attempt at adding the README to the NuGet package (#7807)
SolalPirelli Aug 23, 2025
12e7478
add resources
NikolajBjorner Aug 23, 2025
7e6e96f
remove resources directive again
NikolajBjorner Aug 23, 2025
ba068d7
Document how to use system-installed Z3 with CMake projects (#7809)
Copilot Aug 23, 2025
8d395d6
Fix Julia bindings linker errors on Windows MSVC (#7794)
Copilot Aug 23, 2025
21e63db
add print for version file
NikolajBjorner Aug 23, 2025
3b03636
add more logging to setup.py
NikolajBjorner Aug 23, 2025
778b9a5
try diferennt dirs
NikolajBjorner Aug 24, 2025
1987b3d
try src_dir_repo
NikolajBjorner Aug 24, 2025
438b41a
try other dir
NikolajBjorner Aug 24, 2025
867bc6a
remove extra characters
NikolajBjorner Aug 24, 2025
be22111
more output
NikolajBjorner Aug 24, 2025
116e1ec
print dirs
NikolajBjorner Aug 24, 2025
2874645
copy VERSION from SRC_DIR
NikolajBjorner Aug 24, 2025
300e0ae
Move VERSION.txt to scripts directory and update all references (#7811)
Copilot Aug 24, 2025
12563c6
clean up a little of the handling of VERSION.txt
NikolajBjorner Aug 24, 2025
9bf74b5
add implementation and toggleable param for splitting frugal + choosi…
ilanashapiro Aug 25, 2025
8866cf5
Merge branch 'Z3Prover:master' into parallel-solving
ilanashapiro Aug 25, 2025
58dc54e
remove priority queue for top-k lits and replace with simple linear s…
ilanashapiro Aug 25, 2025
0901711
Merge branch 'parallel-solving' of github.com:ilanashapiro/z3 into pa…
ilanashapiro Aug 25, 2025
b9256ba
Add new configurations for SMT parallel settings
ilanashapiro Aug 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.16)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxx_compiler_flags_overrides.cmake")

# Read version from VERSION.txt file
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" Z3_VERSION_FROM_FILE)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/scripts/VERSION.txt" Z3_VERSION_FROM_FILE)
string(STRIP "${Z3_VERSION_FROM_FILE}" Z3_VERSION_FROM_FILE)

project(Z3 VERSION ${Z3_VERSION_FROM_FILE} LANGUAGES CXX)
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "z3",
version = "4.16.0", # TODO: Read from VERSION.txt - currently manual sync required
version = "4.15.4", # TODO: Read from VERSION.txt - currently manual sync required
bazel_compatibility = [">=7.0.0"],
)

Expand Down
7 changes: 7 additions & 0 deletions PARALLEL_PROJECT_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,13 @@ threads-4-cube
threads-4-cube-shareconflicts
-T:30 smt.threads=4 tactic.default_tactic=smt smt_parallel.never_cube=false smt_parallel.frugal_cube_only=false smt_parallel.share_conflicts=true smt_parallel.share_units=false


threads-4-cube-maxdepth-10
-T:30 smt.threads=4 tactic.default_tactic=smt smt_parallel.share_conflicts=false smt_parallel.share_units=false smt_parallel.max_cube_depth=10

threads-4-cube-shareconflicts
-T:30 smt.threads=4 tactic.default_tactic=smt smt_parallel.share_conflicts=true smt_parallel.share_units=false smt_parallel.frugal_depth_splitting_only=true

</pre>

Ideas for other knobs that can be tested
Expand Down
24 changes: 24 additions & 0 deletions README-CMake.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,30 @@ target_link_libraries(yourTarget libz3)
```
Note that this is `libz3` not `z3` (`libz3` refers to the library target from `src/CMakeLists.txt`).

#### Using system-installed Z3

If you have Z3 installed on your system (e.g., via package manager or by building and installing Z3 yourself), you can use CMake's `find_package` to locate it:

```cmake
find_package(Z3 REQUIRED CONFIG)
```

Once found, you can use the Z3 include directories and libraries:

```cmake
# For C projects
target_include_directories(yourTarget PRIVATE ${Z3_C_INCLUDE_DIRS})
target_link_libraries(yourTarget PRIVATE ${Z3_LIBRARIES})

# For C++ projects
target_include_directories(yourTarget PRIVATE ${Z3_CXX_INCLUDE_DIRS})
target_link_libraries(yourTarget PRIVATE ${Z3_LIBRARIES})
```

The `find_package(Z3 CONFIG)` approach uses Z3's provided `Z3Config.cmake` file, which is installed to a standard location (typically `<prefix>/lib/cmake/z3/`). If CMake cannot automatically find Z3, you can help it by setting `-DZ3_DIR=<path>` where `<path>` is the directory containing the `Z3Config.cmake` file.

**Note**: This approach requires that Z3 was built and installed using CMake. Z3 installations from the Python build system may not provide the necessary CMake configuration files.



### Ninja
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion scripts/mk_nuget_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def mk_targets(source_root):
def mk_icon(source_root):
mk_dir("out/content")
shutil.copy(f"{source_root}/resources/icon.jpg", "out/content/icon.jpg")
# shutil.copy(f"{source_root}/src/api/dotnet/README.md", "out/content/README.md")
shutil.copy(f"{source_root}/src/api/dotnet/README.md", "out/content/README.md")



Expand All @@ -124,6 +124,7 @@ def create_nuget_spec(version, repo, branch, commit, symbols, arch):
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
<tags>smt constraint solver theorem prover</tags>
<icon>content/icon.jpg</icon>
<readme>content/README.md</readme>
<projectUrl>https://github.com/Z3Prover/z3</projectUrl>
<license type="expression">MIT</license>
<repository type="git" url="{1}" branch="{2}" commit="{3}" />
Expand Down
2 changes: 1 addition & 1 deletion scripts/mk_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

def init_version():
# Read version from VERSION.txt file
version_file_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'VERSION.txt')
version_file_path = os.path.join(os.path.dirname(__file__), 'VERSION.txt')
try:
with open(version_file_path, 'r') as f:
version_str = f.read().strip()
Expand Down
12 changes: 6 additions & 6 deletions scripts/nightly.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
variables:
# Version components read from VERSION.txt (updated manually when VERSION.txt changes)
Major: '4'
Minor: '16'
Patch: '0'
Minor: '15'
Patch: '4'
ReleaseVersion: $(Major).$(Minor).$(Patch)
AssemblyVersion: $(Major).$(Minor).$(Patch).$(Build.BuildId)
NightlyVersion: $(AssemblyVersion)-$(Build.buildId)
Expand Down Expand Up @@ -254,9 +254,9 @@ stages:
inputs:
artifact: 'MacArm64'
path: $(Agent.TempDirectory)\package
- task: NuGetToolInstaller@0
- task: NuGetToolInstaller@1
inputs:
versionSpec: 5.x
versionSpec: 6.x
checkLatest: false
- task: PythonScript@0
displayName: 'Python: assemble files'
Expand Down Expand Up @@ -302,9 +302,9 @@ stages:
inputs:
artifact: 'WindowsBuild-x86'
path: $(Agent.TempDirectory)\package
- task: NuGetToolInstaller@0
- task: NuGetToolInstaller@1
inputs:
versionSpec: 5.x
versionSpec: 6.x
checkLatest: false
- task: PythonScript@0
displayName: 'Python: assemble files'
Expand Down
16 changes: 8 additions & 8 deletions scripts/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
trigger: none

variables:
ReleaseVersion: '4.16.0' # TODO: Auto-read from VERSION.txt when Azure DevOps supports it better
ReleaseVersion: '4.15.4' # TODO: Auto-read from VERSION.txt when Azure DevOps supports it better

stages:

Expand Down Expand Up @@ -261,9 +261,9 @@ stages:
artifact: 'MacArm64'
path: $(Agent.TempDirectory)\package

- task: NuGetToolInstaller@0
- task: NuGetToolInstaller@1
inputs:
versionSpec: 5.x
versionSpec: 6.x
checkLatest: false
- task: PythonScript@0
displayName: 'Python: assemble files'
Expand Down Expand Up @@ -305,9 +305,9 @@ stages:
inputs:
artifact: 'WindowsBuild-x86'
path: $(Agent.TempDirectory)\package
- task: NuGetToolInstaller@0
- task: NuGetToolInstaller@1
inputs:
versionSpec: 5.x
versionSpec: 6.x
checkLatest: false
- task: PythonScript@0
displayName: 'Python: assemble files'
Expand Down Expand Up @@ -471,17 +471,17 @@ stages:


- job: NuGetPublish
condition: eq(1,0)
condition: eq(1,1)
displayName: "Publish to NuGet.org"
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download NuGet Package'
inputs:
artifact: 'NuGetPackage'
path: $(Agent.TempDirectory)
- task: NuGetToolInstaller@0
- task: NuGetToolInstaller@1
inputs:
versionSpec: 5.x
versionSpec: 6.x
checkLatest: false
- task: NuGetCommand@2
inputs:
Expand Down
2 changes: 1 addition & 1 deletion scripts/update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
def read_version():
"""Read version from VERSION.txt file."""
script_dir = os.path.dirname(os.path.abspath(__file__))
version_file = os.path.join(os.path.dirname(script_dir), 'VERSION.txt')
version_file = os.path.join(script_dir, 'VERSION.txt')

try:
with open(version_file, 'r') as f:
Expand Down
27 changes: 27 additions & 0 deletions src/api/julia/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
find_package(JlCxx REQUIRED)

# Check for Windows MSVC + MinGW library compatibility issues
if(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Get the JlCxx library path to check its format
get_target_property(JLCXX_LIB_PATH JlCxx::cxxwrap_julia IMPORTED_LOCATION)
if(NOT JLCXX_LIB_PATH)
get_target_property(JLCXX_LIB_PATH JlCxx::cxxwrap_julia IMPORTED_LOCATION_RELEASE)
endif()
if(NOT JLCXX_LIB_PATH)
get_target_property(JLCXX_LIB_PATH JlCxx::cxxwrap_julia IMPORTED_IMPLIB)
endif()
if(NOT JLCXX_LIB_PATH)
get_target_property(JLCXX_LIB_PATH JlCxx::cxxwrap_julia IMPORTED_IMPLIB_RELEASE)
endif()

if(JLCXX_LIB_PATH AND JLCXX_LIB_PATH MATCHES "\\.dll\\.a$")
message(FATAL_ERROR
"Julia bindings build error: Incompatible CxxWrap library format detected.\n"
"The found libcxxwrap_julia library (${JLCXX_LIB_PATH}) is a MinGW import library (.dll.a), "
"but Z3 is being built with MSVC which requires .lib format.\n\n"
"Solutions:\n"
"1. Use MinGW/GCC instead of MSVC to build Z3\n"
"2. Install a MSVC-compatible version of CxxWrap\n"
"3. Disable Julia bindings with -DZ3_BUILD_JULIA_BINDINGS=OFF\n\n"
"For more information, see: https://github.com/JuliaInterop/CxxWrap.jl#compiling-the-c-code")
endif()
endif()

add_library(z3jl SHARED z3jl.cpp)
target_link_libraries(z3jl PRIVATE JlCxx::cxxwrap_julia libz3)
target_include_directories(z3jl PRIVATE
Expand Down
21 changes: 14 additions & 7 deletions src/api/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,21 @@ def _clean_native_build():

def _z3_version():
post = os.getenv('Z3_VERSION_SUFFIX', '')
print("z3_version", "release dir", RELEASE_DIR)
if RELEASE_DIR is None:
fn = os.path.join(SRC_DIR_REPO, 'VERSION.txt')
if os.path.exists(fn):
with open(fn) as f:
for line in f:
n = re.match(r"(.*)\.(.*)\.(.*)\.(.*)", line)
if not n is None:
return n.group(1) + '.' + n.group(2) + '.' + n.group(3) + '.' + n.group(4) + post
dirs = [SRC_DIR, ROOT_DIR, SRC_DIR_REPO, SRC_DIR_LOCAL, os.path.join(ROOT_DIR, '..', '..')]
for d in dirs:
if os.path.exists(d):
print(d, ": ", os.listdir(d))
fns = [os.path.join(d, 'scripts', 'VERSION.txt') for d in dirs]
for fn in fns:
print("loading version file", fn, "exists", os.path.exists(fn))
if os.path.exists(fn):
with open(fn) as f:
for line in f:
n = re.match(r"(.*)\.(.*)\.(.*)\.(.*)", line)
if not n is None:
return n.group(1) + '.' + n.group(2) + '.' + n.group(3) + '.' + n.group(4) + post
return "?.?.?.?"
else:
version = RELEASE_METADATA[0]
Expand Down
3 changes: 3 additions & 0 deletions src/params/smt_parallel_params.pyg
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ def_module_params('smt_parallel',
('share_units_initial_only', BOOL, False, 'share only initial Boolean atoms as units'),
('cube_initial_only', BOOL, False, 'cube only on initial Boolean atoms'),
('max_cube_size', UINT, 20, 'maximum size of a cube to share'),
('max_greedy_cubes', UINT, 1000, 'maximum number of cube to greedily share before switching to frugal'),
('num_split_lits', UINT, 2, 'how many literals, k, we split on to create 2^k cubes'),
('frugal_deepest_cube_only', BOOL, False, 'only apply frugal cube strategy, and only on a deepest (biggest) cube from the batch manager'),
))
5 changes: 2 additions & 3 deletions src/smt/smt_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,14 @@ namespace smt {
unsigned_vector m_lit_occs; //!< occurrence count of literals
svector<bool_var_data> m_bdata; //!< mapping bool_var -> data
svector<double> m_activity;
updatable_priority_queue::priority_queue<bool_var, double> m_pq_scores;
// updatable_priority_queue::priority_queue<bool_var, double> m_pq_scores;

struct lit_node : dll_base<lit_node> {
literal lit;
lit_node(literal l) : lit(l) { init(this); }
};
lit_node* m_dll_lits;

// svector<std::array<double, 2>> m_lit_scores;
svector<double> m_lit_scores[2];

clause_vector m_aux_clauses;
Expand Down Expand Up @@ -952,7 +951,7 @@ namespace smt {
e = 0;
for (auto& e : m_lit_scores[1])
e = 0;
m_pq_scores.clear(); // Clear the priority queue heap as well
// m_pq_scores.clear(); // Clear the priority queue heap as well
}
double get_score(literal l) const {
return m_lit_scores[l.sign()][l.var()];
Expand Down
12 changes: 2 additions & 10 deletions src/smt/smt_internalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1532,23 +1532,15 @@ namespace smt {
}}
}

// void context::add_scores(unsigned n, literal const* lits) {
// for (unsigned i = 0; i < n; ++i) {
// auto lit = lits[i];
// unsigned v = lit.var();
// m_lit_scores[v][lit.sign()] += 1.0 / n;
// }
// }

void context::add_scores(unsigned n, literal const* lits) {
for (unsigned i = 0; i < n; ++i) {
auto lit = lits[i];
unsigned v = lit.var(); // unique key per literal

m_lit_scores[lit.sign()][v] += 1.0 / n;

auto new_score = m_lit_scores[0][v] * m_lit_scores[1][v];
m_pq_scores.set(v, new_score);
// auto new_score = m_lit_scores[0][v] * m_lit_scores[1][v];
// m_pq_scores.set(v, new_score);

}
}
Expand Down
Loading