3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-01-18 16:28:56 +00:00
z3/examples/java
Copilot ecea5e2b4e
Add sequence higher-order functions to Java API (#8226)
* Initial plan

* Add four sequence operations to Java API (SeqMap, SeqMapi, SeqFoldl, SeqFoldli)

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

* Fix checkContextMatch call and add test for sequence operations

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

* Add 4-parameter checkContextMatch overload for consistency

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>
2026-01-17 13:02:54 -08:00
..
JavaExample.java fix #6665 2023-04-02 10:58:21 -07:00
JavaGenericExample.java fix generic example 2024-02-21 08:16:01 -08:00
RCFExample.java Add RCF (Real Closed Field) bindings to C++, Java, C#, and TypeScript (#8171) 2026-01-12 16:34:42 -08:00
README Specify and document value for environment variable for loading native library in Java bindings (#5477) 2021-08-13 14:54:02 -07:00
SeqOperationsExample.java Add sequence higher-order functions to Java API (#8226) 2026-01-17 13:02:54 -08:00

A small example using the Z3 Java bindings.   

To build the example, configure Z3 with the --java option to scripts/mk_make.py, build via  
   make examples
in the build directory.

It will create JavaExample.class in the build directory,
which can be run on Windows via 
   java -cp com.microsoft.z3.jar;. JavaExample

On Linux and FreeBSD, we must use
   LD_LIBRARY_PATH=. java -cp com.microsoft.z3.jar:. JavaExample
On macOS, the corresponding option is DYLD_LIBRARY_PATH:
   DYLD_LIBRARY_PATH=. java -cp com.microsoft.z3.jar:. JavaExample  

By default, Z3 Java bindings are automatically loading the required native library for Z3 from the default library path.
In certain environments, depending on the developing process, the Z3 library is not available in the given library path.
To disable the automated loading process, the user can set the environment variable "z3.skipLibraryLoad=true".
In that case, the calling application should directly load the corresponding libraries before any interaction with Z3.