Z3::FFI - Low level FFI interfaces to the Z3 solver/prover
This is built for Z3 version 4.8.4
This is a direct translation of the Z3 C API to a Perl API. It's most likely not the level for working with Z3 from perl.
This is a mostly functional implementation right now. Three functions related to fixed point math are unimplemented currently.
It should work for any examples from the C API in Z3.
You're going to want to refer to the C API documentation for Z3, http://z3prover.github.io/api/html/group__capi.html. All functions have the Z3_ stripped from their name and are declared as part of this module.
use Z3::FFI; my $config = Z3::FFI::mk_config(); # Create a Z3 config object my $context = Z3::FFI::mk_context($config); # Create the Z3 Context object ... # work with the Z3 context
This is a nearly complete and direct translation of the Z3 C API to Perl. All the sames kinds of semantics of the C API regarding ownership and allocation will apply. You likely don't want to use this library directly, but instead wait for the higher level version wrapper of this API to get finished, which will roughly match the Python API that already exists.
For some good examples of how to actually use this library, see the t/ directory in the distrobution.
The bindings themselves are distributed under the Artistic 2.0 license. However the tests and related helper library are based heavily on a translation of the z3 C API examples, which are distrubed by Microsoft under the MIT license. As such the code under t/ is distributed under the MIT license also.
Copyright 2019 Ryan Voots Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
I will also state that I am not entirely sure if it should be me or Microsoft on the above notice for the files under t/, as they are rewritten to work with the Z3::FFI bindings in a new language with additional checks and functionality rather than the original C code.
- Memory leaks. Due to the differing levels of the APIs and languages, I strongly suspect that there's going to be some memory leaks somewhere. I'll try to fix these as they're found, but they are not a priority at the moment.
Ryan Voots <firstname.lastname@example.org>