Add Java (JDD) Bindings for CFLOBDD #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wrote simple Java bindings of CFLOBDD: mostly I want it to be a drop-in replacement for JDD, The API is nearly the same, with difference of some CFLOBDD-only properties, such as "level". This is done by two layers: one front-end layer provides JDD-like API, and one backend layer that adapts to the C-API in loaded shared library (also newly written). Also, I may further work on APIs for other Java BDD library, such as JavaBDD.
Instead of JNI, the Java bindings use
java.lang.foreignAPIs which is available since Java 22. This choice was done just for convenience, so it is not compatable for projects using older Java. In the future maybe I will consider JNI again.As a side product, I also made pure C bindings for the used functions, and it is included by building a shared library for CFLOBDD. I also wrote a CMake building script that builds both the CFLOBDD shared library and CFLOBDD Java bindings.
To make this happen, several other changes were made:
modsizeof CFLOBDD substructures are changed frominttolong, to meet the standards of JavahashCode;ref_ptrandCFLOBDD, enabling the reference counted pointer to be moved safely to FFI without disturbing the RC.PATH_COUNTING_ENABLEDpreprocessor variable.