Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8874ec9
Added z3legacy implementation
leventeBajczi Oct 16, 2025
01de644
Formatted new code
leventeBajczi Oct 17, 2025
afb0445
Re-added mistakenly removed deprecation annotation
leventeBajczi Oct 17, 2025
38569fa
suppressed warnings
leventeBajczi Oct 17, 2025
314229e
2024->2025
leventeBajczi Nov 1, 2025
5c634fa
Z3_4_5_0 in enum
leventeBajczi Nov 1, 2025
a753732
nullable -> optional
leventeBajczi Nov 1, 2025
c485380
Merge pull request #536 from leventeBajczi/z3-4.5.0
baierd Nov 13, 2025
72fff42
Add Z3 legacy build publish script
Nov 19, 2025
ef2f7ee
added patch and readme for z3-4.5.0 building
leventeBajczi Nov 22, 2025
2eada59
Merge pull request #554 from leventeBajczi/z3-4.5.0-sources-patch
baierd Nov 23, 2025
25338c0
Make options of Z3 legacy distinct from normal z3 options
Nov 23, 2025
a6d1c19
Implement z3 legacy publish script (only x64 linux, no sources, no Ja…
Nov 23, 2025
3936248
Add ivy solver config file for Z3 legacy
Nov 23, 2025
811298c
Extend ivy.xml with dependency and configs for Z3 legacy
Nov 23, 2025
4ad0305
Add publish script of Z3 legacy to available publish scripts
Nov 23, 2025
b26fdd2
Add Z3 legacy config to runtime configs
Nov 23, 2025
56f0cb2
Extends classpaths for Z3 legacy
Nov 23, 2025
4a6a864
LegacyZ3: improve implementation with basic features from upstream Z3.
kfriedberger Nov 24, 2025
53130be
LegacyZ3: enable JavaSMT's loading mechanism for LegacyZ3.
kfriedberger Nov 24, 2025
5fab174
LegacyZ3: add license-info for patch-file and documentation.
kfriedberger Nov 24, 2025
2335e16
LegacyZ3: add symlinks for dependencies on Linux
kfriedberger Nov 24, 2025
d657c0f
LegacyZ3: fix compiler warning
kfriedberger Nov 24, 2025
ac68cf8
Enable some interpolation tests again that were disabled for LegacyZ3.
kfriedberger Nov 25, 2025
5144f19
LegacyZ3: replace Optional by Nullable.
kfriedberger Nov 29, 2025
bdc7dd1
Merge remote-tracking branch 'origin/master' into z3_legacy
kfriedberger Nov 29, 2025
cb7f3f6
Z3Legacy: update patch-file to also include the JavaSMT-specific opti…
kfriedberger Dec 1, 2025
b2725fe
LegacyZ3: update to newly compiled dev1-version
kfriedberger Dec 1, 2025
e13c01e
Z3Legacy: update bindings or disable tests that are not satisfied by …
kfriedberger Dec 1, 2025
4f3a70f
LegacyZ3: improve interpolation behaviour and disable some related test.
kfriedberger Dec 1, 2025
6a5a2e1
LegacyZ3: disable tests for ARM64.
kfriedberger Dec 1, 2025
d9623f2
LegacyZ3: disable most parser tests for LegacyZ3.
kfriedberger Dec 6, 2025
2aecf8b
LegacyZ3: disable most parser tests for LegacyZ3.
kfriedberger Dec 6, 2025
2202163
LegacyZ3: update documentation
kfriedberger Dec 6, 2025
5072b52
LegacyZ3: remove unneded rpath ORIGIN from library
kfriedberger Dec 9, 2025
2f8262d
LegacyZ3: support Linux with ARM64 architecture.
kfriedberger Dec 9, 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
1 change: 1 addition & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ SPDX-License-Identifier: Apache-2.0
<classpathentry kind="lib" path="lib/java/runtime-princess/ostrich_2.13.jar"/>
<classpathentry kind="lib" path="lib/java/runtime-princess/ostrich-ecma2020-parser_2.13.jar"/>
<classpathentry kind="lib" path="lib/java/runtime-z3/com.microsoft.z3.jar" sourcepath="lib/java-contrib/com.microsoft.z3-sources.jar"/>
<classpathentry kind="lib" path="lib/java/runtime-z3-legacy/com.microsoft.z3legacy.jar"/>
<classpathentry kind="lib" path="lib/java/runtime-cvc4/CVC4.jar"/>
<classpathentry kind="lib" path="lib/java/runtime-cvc5/cvc5.jar"/>
<classpathentry kind="lib" path="lib/java/test/truth-java8-extension.jar" sourcepath="lib/java-contrib/truth-java8-extension-sources.jar"/>
Expand Down
9 changes: 9 additions & 0 deletions .idea/JavaSMT.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ JavaSMT supports several SMT solvers (see [Getting Started](doc/Getting-started.
| [SMTInterpol](https://ultimate.informatik.uni-freiburg.de/smtinterpol/) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Java-based SMT solver |
| [Yices2](https://yices.csl.sri.com/) | :heavy_check_mark: | | [maybe](https://github.com/sosy-lab/java-smt/pull/215) | | [maybe](https://github.com/sosy-lab/java-smt/pull/400)⁴ | | |
| [Z3](https://github.com/Z3Prover/z3) | :heavy_check_mark:³ | :heavy_check_mark:³ | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | mature and well-known solver |
| [Z3 4.5.0](https://github.com/Z3Prover/z3) | :heavy_check_mark: | :heavy_check_mark: | | | | | an older version of Z3 that still provides interpolation support |

We support a reasonable list of operating systems and versions.
- Our main target is Linux (mainly Ubuntu or comparable Linux distributions).
Expand Down
3 changes: 2 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ SPDX-License-Identifier: Apache-2.0
runtime-princess,
runtime-smtinterpol,
runtime-yices2,
runtime-z3
runtime-z3,
runtime-z3-legacy
"/>
<property name="ivy.configuration.main" value="core"/>
<property name="ivy.configurations" value="build, ${ivy.configuration.main}, ${ivy.solver.configurations}, test, format-source, checkstyle, spotbugs"/>
Expand Down
1 change: 1 addition & 0 deletions build/build-publish-solvers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ SPDX-License-Identifier: Apache-2.0
<import file="build-publish-solvers/solver-opensmt.xml"/>
<import file="build-publish-solvers/solver-yices.xml"/>
<import file="build-publish-solvers/solver-z3.xml"/>
<import file="build-publish-solvers/solver-z3-legacy.xml"/>

</project>
154 changes: 154 additions & 0 deletions build/build-publish-solvers/solver-z3-legacy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!--
This file is part of JavaSMT,
an API wrapper for a collection of SMT solvers:
https://github.com/sosy-lab/java-smt

SPDX-FileCopyrightText: 2025 Dirk Beyer <https://www.sosy-lab.org>

SPDX-License-Identifier: Apache-2.0
-->

<!-- vim: set tabstop=8 shiftwidth=4 expandtab sts=4 filetype=ant fdm=marker: -->
<project name="publish-solvers-z3-legacy" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">

<property name="z3legacy.dist.dir" value="${ivy.solver.dist.dir}/z3legacy"/>

<import file="macros.xml"/>

<target name="check-z3-legacy-path">
<fail unless="z3.path">
INFO
Please specify the path to Z3 sources directory with the flag '-Dz3.path=/path/to/z3'.
The path should contain directories like './build/', and should be absolute.
Please provide the patched legacy Z3 version in this path.
This build script will compile and package Z3 as required for JavaSMT.
Currently only Linux x64 and arm64 version for Z3 is available.
For example, the directory structure can look like this:

z3/ // &lt;-- parent directory and target of 'z3.path'
|-- build/
|-- scripts/
|-- src/
|-- ...

The patched version can be achieved by following the steps in '/lib/native/source/z3-4.5.0/README.md'.
</fail>
</target>

<target name="check-z3-legacy-version">
<fail unless="z3.customRev">
INFO
Please specify the version string used for Z3 legacy with the flag '-Dz3.customRev=SOME_VERSION'.
This is just '4.5.0' or some updated version.
</fail>
</target>

<target name="set-properties-for-z3-legacy" depends="check-z3-legacy-path, check-z3-legacy-version">
<!-- Get a naive version (let's ignore patched/dirty status) -->
<exec executable="git" dir="${z3.path}" outputproperty="z3.revision" failonerror="true">
<arg value="show"/>
<arg value="-s"/>
<arg value="--format=%h"/>
</exec>
<property name="z3.legacy.version" value="${z3.customRev}-g${z3.revision}"/>
<echo message="Building Z3 Legacy in version '${z3.legacy.version}'"/>

<!-- set properties for the next steps -->
<property name="z3.installPathLinuxX64" location="${z3.path}/install-linux-x64"/>
<property name="z3.installPathLinuxArm64" location="${z3.path}/install-linux-arm64"/>

<!-- cleanup target directories, will be created and filled during the build-process -->
<delete dir="${z3.installPathLinuxX64}" quiet="true"/>
<delete dir="${z3.installPathLinuxArm64}" quiet="true"/>
<delete dir="${z3.path}/build" quiet="true"/>
</target>

<target name="build-z3-legacy-linux-x64" depends="set-properties-for-z3-legacy">
<delete dir="${z3.path}/build"/>
<mkdir dir="${z3.installPathLinuxX64}"/>
<exec executable="python3" dir="${z3.path}" failonerror="true">
<arg value="scripts/mk_make.py"/>
<arg value="--prefix=${z3.installPathLinuxX64}"/>
<arg value="--java"/>
</exec>
<exec executable="make" dir="${z3.path}/build" failonerror="true">
<arg value="-j"/>
</exec>
<exec executable="make" dir="${z3.path}/build" failonerror="true">
<arg value="install"/>
</exec>
<!-- soname is required for libz3legacy.so -->
<!-- Only required for older versions of Z3. Newer versions of Z3 already include this fix in their build-scripts. -->
<exec executable="patchelf" dir="${z3.installPathLinuxX64}/lib" failonerror="true">
<arg value="--set-soname"/><arg value="libz3legacy.so"/>
<arg value="libz3legacy.so"/>
</exec>
</target>

<target name="build-z3-legacy-linux-arm64" depends="set-properties-for-z3-legacy">
<delete dir="${z3.path}/build"/>
<mkdir dir="${z3.installPathLinuxArm64}"/>
<exec executable="python3" dir="${z3.path}" failonerror="true">
<env key="CXX" value="aarch64-linux-gnu-g++"/>
<env key="CC" value="aarch64-linux-gnu-gcc"/>
<env key="AR" value="aarch64-linux-gnu-ar"/>
<arg value="scripts/mk_make.py"/>
<arg value="--prefix=${z3.installPathLinuxArm64}"/>
<arg value="--java"/>
</exec>
<exec executable="make" dir="${z3.path}/build" failonerror="true">
<arg value="-j"/>
</exec>
<exec executable="make" dir="${z3.path}/build" failonerror="true">
<arg value="install"/>
</exec>
<!-- soname is required for libz3legacy.so -->
<!-- Only required for older versions of Z3. Newer versions of Z3 already include this fix in their build-scripts. -->
<exec executable="patchelf" dir="${z3.installPathLinuxArm64}/lib" failonerror="true">
<arg value="--set-soname"/><arg value="libz3legacy.so"/>
<arg value="libz3legacy.so"/>
</exec>
</target>

<target name="package-z3-legacy" depends="set-properties-for-z3-legacy, build-z3-legacy-linux-x64, build-z3-legacy-linux-arm64">
<mkdir dir="${z3legacy.dist.dir}/x64"/>
<mkdir dir="${z3legacy.dist.dir}/arm64"/>

<!-- copy library files into directory to be published for Ivy -->
<!-- Linux x64 files -->
<copy file="${z3.installPathLinuxX64}/lib/libz3legacy.so" tofile="${z3legacy.dist.dir}/x64/libz3legacy-${z3.legacy.version}.so" failonerror="true"/>
<copy file="${z3.installPathLinuxX64}/lib/libz3javalegacy.so" tofile="${z3legacy.dist.dir}/x64/libz3javalegacy-${z3.legacy.version}.so" failonerror="true"/>
<!-- Linux ARM64 files -->
<copy file="${z3.installPathLinuxArm64}/lib/libz3legacy.so" tofile="${z3legacy.dist.dir}/arm64/libz3legacy-${z3.legacy.version}.so" failonerror="true"/>
<copy file="${z3.installPathLinuxArm64}/lib/libz3javalegacy.so" tofile="${z3legacy.dist.dir}/arm64/libz3javalegacy-${z3.legacy.version}.so" failonerror="true"/>

<!-- TODO: add Windows and MacOS releases -->

<!-- common Java file, Java is platform independent -->
<copy file="${z3.installPathLinuxX64}/lib/com.microsoft.z3legacy.jar" tofile="${z3legacy.dist.dir}/com.microsoft.z3legacy-${z3.legacy.version}.jar" failonerror="true"/>
</target>

<target name="publish-z3-legacy" depends="package-z3-legacy, load-ivy"
description="Publish Z3 legacy binaries to Ivy repo.">
<ivy:resolve conf="solver-z3-legacy,solver-z3-legacy-x64" file="solvers_ivy_conf/ivy_z3-legacy.xml"/>
<publishToRepository solverName="Z3-legacy" solverVersion="${z3.legacy.version}" distDir="${z3legacy.dist.dir}"/>

<!--
We additionally provide x64-files without arch-attribute for backwards compatibility,
such that applications can load dependencies without changing their Ivy configuration.
Those files are not part of any direct configuration, but will be resolved if the
arch-attribute is not used.
-->
<echo>
Lets copy the files for architecture x64 into main directory, for backwards compatibility.
Afterward, please execute the SVN command from above.
</echo>
<copy todir="repository/${ivy.organisation}/${ivy.module}/" verbose="true">
<fileset dir="repository/${ivy.organisation}/${ivy.module}/x64/">
<include name="*-${z3.legacy.version}.*"/>
</fileset>
</copy>
</target>
</project>
Loading