Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of OCaml API bugfixes/improvements courtesy of @martin-neuhaeusser #583

Merged
merged 42 commits into from
May 3, 2016

Conversation

wintersteiger
Copy link
Contributor

No description provided.

Christoph M. Wintersteiger and others added 30 commits February 13, 2016 22:09
Use a custom block for storing a Z3_config in the ML bindings.
The Z3 context and its reference counters are stored in a structure which is allocated
by the C layer outside the OCaml heap, whenever a Z3 context is created. The structure
and its Z3 context are disposed, once the last reference counter reaches zero. Reference
counters are decremented by C-level finalizers.

The OCaml representations for a Z3 context wrap only a pointer to the corresponding structure.
This patch refactors the update_api script and the z3.ml implementation
to properly translate between OCaml options and NULL pointers. Some
unifications and simplifications (avoidance of unnecessary value allocation)
in the script that creates the native bindings.
This patch avoids the use of physical equality wherever possible
and improves some details of the OCaml implementation.
Correct reference counting and handling of NULL pointers in new OCaml bindings.
This patch simplifies the implementation of the OCaml bindings. For example,
the applyX wrapper functions have become unnecessary in the new OCaml API.
It also removes the internal ML2C structure that was used as an intermediate
layer between the C and the OCaml layer.
martin-neuhaeusser and others added 12 commits April 6, 2016 12:45
Improvements of the OCaml API implementation
…Caml bindings

This patch fixes a bug detected by valgrind, where a custom error handler
did not get installed correctly.
This patch eliminates the conversion between OCaml arrays and lists
from Z3's OCaml API.
Fix installation of custom error handler during context creation in O…
This patch fixes a segmentation fault that occurs due to incorrect
wrapping of double values in the OCaml API.
Fix bug in OCaml API where double values have been wrapped incorrectly.
@wintersteiger wintersteiger merged commit cf34a2b into Z3Prover:master May 3, 2016
@wintersteiger
Copy link
Contributor Author

@martin-neuhaeusser: Just one detail: I had to change the "inline" annotation on compare_pointers and try_to_delete_context, see here: 140f0bb
LLVM/clang on OSX complained that those functions weren't there anymore at link time. Probably fixable, but for now I just removed the annotations to get it working.

@wintersteiger wintersteiger deleted the new-ml-api branch November 8, 2016 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants