{"id":18014830,"url":"https://github.com/zevv/nimz3","last_synced_at":"2025-04-04T15:14:24.885Z","repository":{"id":138427382,"uuid":"169637893","full_name":"zevv/nimz3","owner":"zevv","description":"Nim binding for the Z3 theorem prover","archived":false,"fork":false,"pushed_at":"2023-12-25T07:27:00.000Z","size":81,"stargazers_count":26,"open_issues_count":4,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T13:49:38.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zevv.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-07T20:30:29.000Z","updated_at":"2024-12-01T21:26:22.000Z","dependencies_parsed_at":"2023-12-25T08:29:37.133Z","dependency_job_id":"5c118fe4-a4a8-4bdb-bfa2-5ddede10b5a0","html_url":"https://github.com/zevv/nimz3","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fnimz3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fnimz3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fnimz3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fnimz3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zevv","download_url":"https://codeload.github.com/zevv/nimz3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198466,"owners_count":20900081,"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-10-30T04:11:21.528Z","updated_at":"2025-04-04T15:14:24.850Z","avatar_url":"https://github.com/zevv.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Nim Z3\n\n\u003e \"_Z3 is a cat with a funny hat_\"\n\u003e -TheLemonMan\n\nNimZ3 is an early stage Nim binding for the [Z3 theorem prover](https://github.com/Z3Prover/z3)\n\n\n## Documentation\n\n* [Module documentation](http://htmlpreview.github.io/?https://github.com/zevv/nimz3/blob/master/src/z3.html)\n* [Examples](https://github.com/zevv/nimz3/blob/master/tests/test1.nim)\n\n\n## Status\n\nThis is still a work in progress and a lot of Z3 is still missing, but the most\nimportant basics are available:\n\n* bool, bit vector, int and float types\n* solving\n* optimization\n* simplification\n\nThe API uses template magic to hide Z3 contexts and allows normal Nim syntax for defining Z3 model assertions.\n\n\n## Example\n\n```nim\nz3:\n  let x = Int(\"x\")\n  let y = Int(\"y\")\n  let z = Int(\"z\")\n  let s = Solver()\n  s.assert 3 * x + 2 * y - z == 1\n  s.assert 2 * x - 2 * y + 4 * z == -2\n  s.assert x * -1 + y / 2 - z == 0\n  s.check_model:\n    echo model\n```\n\nAnswer:\n\n```\nz -\u003e (- 2)\ny -\u003e (- 2)\nx -\u003e 1\n```\n\nMore examples are available in the tests directory, run with `nimble test`.\n\n\n## More Z3 info\n\nSome helpful documents and tutorials about Z3:\n\n* [Z3 - guide](https://rise4fun.com/z3/tutorialcontent/guide)\n* [Programming Z3](https://theory.stanford.edu/~nikolaj/programmingz3.html)\n\n\n## Open questions\n\nThings I'm not sure how to solve yet. Any input appreciated:\n\n* Should there be distinct types for signed and unsigned bit vectors? This would \n  make it easier to implement operators for things like Z3_mk_bvXXX_no_overflow()\n\n* What is a good way to create Z3 consts? The current method of doing\n  `let x = Int \"x\"` is redundant and prone to mistakes. Is it better to create\n  some kind of declaration template instead?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzevv%2Fnimz3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzevv%2Fnimz3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzevv%2Fnimz3/lists"}