{"id":13941137,"url":"https://github.com/philnguyen/z3-rkt","last_synced_at":"2025-10-20T14:57:12.628Z","repository":{"id":62424481,"uuid":"61902707","full_name":"philnguyen/z3-rkt","owner":"philnguyen","description":"Racket bindings for Z3","archived":false,"fork":true,"pushed_at":"2019-05-11T19:31:12.000Z","size":661,"stargazers_count":24,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-23T04:48:32.919Z","etag":null,"topics":["binding","bindings","racket","smt-solver","z3"],"latest_commit_sha":null,"homepage":"","language":"Racket","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"sunshowers/z3.rkt","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philnguyen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-24T17:56:02.000Z","updated_at":"2022-08-15T16:21:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/philnguyen/z3-rkt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/philnguyen/z3-rkt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnguyen%2Fz3-rkt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnguyen%2Fz3-rkt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnguyen%2Fz3-rkt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnguyen%2Fz3-rkt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philnguyen","download_url":"https://codeload.github.com/philnguyen/z3-rkt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philnguyen%2Fz3-rkt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266067254,"owners_count":23871324,"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":["binding","bindings","racket","smt-solver","z3"],"created_at":"2024-08-08T02:01:12.037Z","updated_at":"2025-10-20T14:57:07.336Z","avatar_url":"https://github.com/philnguyen.png","language":"Racket","funding_links":[],"categories":["Racket"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/philnguyen/z3-rkt.svg?branch=master)](https://travis-ci.org/philnguyen/z3-rkt) Z3 library for Racket\n================================\n\nThis package provides an implementation of Z3 in Racket.\nAlthough I develop it specifically for use in my symbolic execution,\nit should be usable for general-purpose Racket SMT integration.\nI originally forked from Siddharth Agarwal's repository ([sid0/z3.rkt](https://github.com/sid0/z3.rkt)), then:\n* ported the package to Typed Racket\n* migrated from the deprecated API to the new Solver API\n* ditched all deprecated functions\n* generalized SMT constructs like `declare-datatypes`, `forall/s`, `exists/s`\n* ~~added macro-expansion time scraping of the documentation to automatically generate all FFI bindings (ish) and Typed Racket bindings~~\n\n\nInstallation\n----------\n\n### Install Z3\n\n- This package has been tested with Z3 4.4.1 on Linux. You can also download and build the lastest version from [https://github.com/Z3Prover/z3](https://github.com/Z3Prover/z3), which the Travis CI script uses.\n\n### Install Z3 Racket library\n\n- Set environment variable `Z3_LIB` to the *directory* containing the Z3 library.\nThe library file is named `libz3.dll`, `libz3.so` or `libz3.dylib`, depending on your system being Windows, Linux, or Mac, respectively.\n\n- ~~By default, at installation, the package parses the [latest documentation](http://research.microsoft.com/en-us/um/redmond/projects/z3/code/group__capi.html) over the internet and generates Z3 bindings from there. To customize the documentation to build from, you can:~~\n  + ~~Set environment variable `Z3_DOC_LOCAL` to a local file with the same format as the official documentation. If this is set, it takes priority over the next setting~~\n  + ~~Set environment variable `Z3_DOC_HTTP` to an alternate HTTP link to the documentation~~\n\n- Install Z3 bindings:\n\u003e raco pkg install z3\n\n- Some examples mimicking the [Z3 guide](http://rise4fun.com/Z3/tutorial/guide)\n  are in [`tests/guide.rkt`](https://github.com/philnguyen/z3-rkt/blob/master/z3/tests/guide.rkt).\n  To run the tests:\n\u003e raco test tests/guide.rkt\n\nThe API\n----------\n\n* [`z3/ffi`](https://github.com/philnguyen/z3-rkt/blob/master/z3/ffi/ffi-typed.rkt)\n  defines bindings for low-level Z3 API.\n  The interface was originally generated from the\n  [documentation](https://z3prover.github.io/api/html/group__capi.html).\n  The [low-level Racket interface](https://github.com/philnguyen/z3-rkt/blob/master/z3/ffi/ffi.rkt) differs from C in a predictable way:\n  \n  | C                                                                       | Racket\n  |-------------------------------------------------------------------------|----------------------------------------\n  | `Z3_app_to_ast`, `Z3_is_app`, `Z3_stats_is_uint`, `Z3_solver_push`, etc.| `app-\u003east`, `app?`, `stats-is-uint?`, `solver-push!`, etc. (renaming based on both name and type)\n  | multiple out parameters                                                 | multiple return values\n  | input array(s) with user supplied length(s)                             | list or list of tuples with computed length(s). Tuples of size 2 are `Pairof _ _`s. Tuples of size 3+ are `List _ ...`s\n  | out parameter `A` with result `Boolean` indicating success              | result `U Boolean A` or `U Boolean (List A)`, depending on whether `A` overlaps with `Boolean`\n\n* [`z3/smt`](https://github.com/philnguyen/z3.rkt/tree/master/z3/smt) defines the high-level Z3 API, close to the SMT2 language.\n  This is the reccommended way to interact with Z3.\n  Examples in [`tests/guide.rkt`](https://github.com/philnguyen/z3-rkt/blob/master/z3/tests/guide.rkt) use this\n  \nTODO\n----------\n\n- [ ] `smt`: Mutually recursive datatypes\n- [ ] `smt`: Parameterized sorts. This feature does not exist at the C API level.\n- [ ] `ffi`: Several missing functions without `def_API` lines from doc\n- [ ] Scribble?\n- [x] Figure out package name\n- [x] Figure out how to make package and register\n- [ ] generate the typed wrapper automatically instead of having 2 version in sync currently\n\nKnown issues\n-------------\n\n- A minority of functions allow `null` arguments as valid use cases,\n  which is mentioned in prose in the doc.\n  I'm just hacking special cases that I need instead of flooding the API with `null`s.\n- The bindings were originally generated automatically,\n  and all names with `-to-` were converted to `-\u003e`.\n  While most of them are appropriate, some of them aren't.\n\nLicense\n-------\n\nLicensed under the Simplified BSD License. See the LICENSE file for more\ndetails.\n\nPlease note that this license does not apply to Z3, only to these bindings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilnguyen%2Fz3-rkt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilnguyen%2Fz3-rkt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilnguyen%2Fz3-rkt/lists"}