{"id":18422426,"url":"https://github.com/sri-csl/yices2_ocaml_bindings","last_synced_at":"2025-04-07T14:32:50.591Z","repository":{"id":41448836,"uuid":"220144334","full_name":"SRI-CSL/yices2_ocaml_bindings","owner":"SRI-CSL","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-10T18:22:22.000Z","size":613,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-09-10T20:42:21.306Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SRI-CSL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-07T03:33:08.000Z","updated_at":"2024-09-10T18:22:33.000Z","dependencies_parsed_at":"2023-12-01T23:31:37.634Z","dependency_job_id":"41b2806a-a0e1-4138-a935-9c9f8985d3d0","html_url":"https://github.com/SRI-CSL/yices2_ocaml_bindings","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SRI-CSL%2Fyices2_ocaml_bindings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SRI-CSL%2Fyices2_ocaml_bindings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SRI-CSL%2Fyices2_ocaml_bindings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SRI-CSL%2Fyices2_ocaml_bindings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SRI-CSL","download_url":"https://codeload.github.com/SRI-CSL/yices2_ocaml_bindings/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223284541,"owners_count":17119723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T04:29:44.895Z","updated_at":"2024-11-06T04:29:45.456Z","avatar_url":"https://github.com/SRI-CSL.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n# OCaml Bindings for Yices 2\n\nThis repository provides an ocaml library containing bindings for yices2's standard API (https://yices.csl.sri.com/doc/).\n\n## Contents\n\n### Main library\n\nThe main OCaml library, called `yices2`, provides three levels of abstraction that wrap the yices C functions:\n\n- Level **low**: the functions that wrap the yices C functions are essentially identical to the yices API.\n(+ some type safety provided by type abstraction over the types types_t of yices's types and term_t of yices's terms, which are now abstract instead of int32_t).\n\n- Level **high**: it is more ocaml-friendly, using some ML datatype (lists inside of C vectors, OCaml ints instead of C integer types), etc.\n\n- Level **ext**: same as high, but it adds a few useful functions implemented on the OCaml side (e.g., computation of free variables, purification, log-keeping, pretty-printing functions in SMTLib2 format, etc).\n\nAt each level *lev*, the types and module signatures are defined in file *lev*_types.ml and the bindings are in *lev*.ml/mli\n\nThe library also provides an SMTLib2 parser for OCaml.\n\n### Extension library\n\nAn additional OCaml library, called `yices2.extensions`, contains experimental extensions leveraging the bindings (e.g. tuple-blasting, etc).\n\n\n### SMT-solver executable\n\nBuilding the bindings will also compile an executable `yices_smt2.exe`. That executable file is an SMT-solver you can run on an SMTLib2 file such as `src_smt2/simple.smt2`. The solver plugs the SMTLib parser with the Yices2 API bindings, so it is essentially running Yices2, through the Yices2 API rather than throug the Yices2 native front-end for SMTLib2. It is mostly there as an example of how you can use the Yices2 bindings, and offers a quick test that everything works.\n\n## Building and Installing\n\n### Dependencies\n\nOutside of the OCaml world, you need Yices2 compiled and installed, with the MCSAT mode enabled, which means you also need the Yices2/MCSAT dependencies [libpoly](https://github.com/SRI-CSL/libpoly) and [CUDD](https://github.com/ivmai/cudd). You also need gmp.\n\nOn the OCaml side, you need the [libpoly OCaml bindings](https://github.com/SRI-CSL/yices2_ocaml_bindings) installed in findlib.\nAll of the other dependencies are listed in `yices2_bindings.opam`\nand can be installed in findlib by opam (2.0 or higher), for instance \n\n```\nopam install . --deps-only\n```\n\n### Building using opam (2.0 or higher)\n\nIn the directory of this `README.md`, build and install (in findlib) with the following command:\n\n```\nopam install .\n```\nThis expects the yices library (and the libraries it depends on) to be present in the relevant paths (e.g., `/usr/local/lib`), as weel as its header files (e.g., `/usr/local/include/`). If for some reason these libraries are not in the usual paths, you can specify their paths by setting \nthe environment variables `LDFLAGS` (for the yices library) and `LD_LIBRARY_PATH` (for its dependencies, like libpoly or cudd), \nas well as `C_INCLUDE_PATH`, e.g.:\n\n```\nexport LD_LIBRARY_PATH=[UNCONVENTIONAL_PATHS]:/usr/local/lib\nexport LDFLAGS=\"-L[UNCONVENTIONAL_PATH]\"\nexport C_INCLUDE_PATH=\"[UNCONVENTIONAL_PATH]\"\n```\n\n### Building without opam\n\nAssuming that the dependencies have been installed, you can build the yices2 bindings by running the following command:\n```\nmake\n```\nin the directory of this `README.md`.\n\nTo install (in findlib), run the following command:\n```\nmake install\n```\n\nYou can also use `make reinstall` and `make clean`.\n\n### Quick Testing\n\nIn the directory of this `README.md`, run the following command:\n```\nmake test\n```\nWhether the tests pass is rather self-explanatory.\n\nAgain, if the non-OCaml dependencies are not installed in conventional directories, make sure you set `LDFLAGS` and `LD_LIBRARY_PATH` correctly as described above.\n\nYou can also run the `yices_smt2.exe` executable, giving as sole argument the name of the SMTLib2 file to solve, suuch as `src_smt2/simple.smt2`.\nAs with `make test`, this step involves linking and requires yices being installed. You can set `LDFLAGS` as above in case it is not in a standard location.\n\nThe code in `src_test` and in the `src_smt2/yices_smt2.ml` file give examples on how to use the bindings.\n\n### Building the documentation\n\nIn the top-level directory, run the following command:\n\n```\nmake doc\n```\nYou can then open `_build/default/_doc/_html/index.html` in a web browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsri-csl%2Fyices2_ocaml_bindings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsri-csl%2Fyices2_ocaml_bindings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsri-csl%2Fyices2_ocaml_bindings/lists"}