{"id":13749245,"url":"https://github.com/terohuttunen/proto-vulcan","last_synced_at":"2025-05-09T12:32:07.912Z","repository":{"id":43262475,"uuid":"292785589","full_name":"terohuttunen/proto-vulcan","owner":"terohuttunen","description":"A relational logic programming language embedded in Rust.","archived":false,"fork":false,"pushed_at":"2022-07-17T10:25:38.000Z","size":629,"stargazers_count":10,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-22T22:30:53.359Z","etag":null,"topics":["logic-programming","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terohuttunen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-04T07:52:56.000Z","updated_at":"2023-07-06T22:13:51.000Z","dependencies_parsed_at":"2022-08-27T22:32:00.253Z","dependency_job_id":null,"html_url":"https://github.com/terohuttunen/proto-vulcan","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/terohuttunen%2Fproto-vulcan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terohuttunen%2Fproto-vulcan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terohuttunen%2Fproto-vulcan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terohuttunen%2Fproto-vulcan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terohuttunen","download_url":"https://codeload.github.com/terohuttunen/proto-vulcan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224863108,"owners_count":17382279,"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":["logic-programming","rust"],"created_at":"2024-08-03T07:00:57.801Z","updated_at":"2024-11-16T00:30:18.435Z","avatar_url":"https://github.com/terohuttunen.png","language":"Rust","funding_links":[],"categories":["Programming Language"],"sub_categories":["Libraries"],"readme":"# proto-vulcan\n\u003c!-- CI status --\u003e\n\u003ca href=\"https://github.com/terohuttunen/proto-vulcan/actions\"\u003e\n  \u003cimg src=\"https://github.com/terohuttunen/proto-vulcan/workflows/CI/badge.svg\"\n    alt=\"CI Status\" /\u003e\n\u003c/a\u003e\n\u003c!-- Codecov.io coverage --\u003e\n\u003ca href=\"https://codecov.io/gh/terohuttunen/proto-vulcan\"\u003e\n  \u003cimg src=\"https://codecov.io/gh/terohuttunen/proto-vulcan/branch/master/graph/badge.svg?token=MR666G7GE9\"\n    alt='Coverage Status' /\u003e\n  \n\u003c/a\u003e\n\u003c!-- Crates version --\u003e\n\u003ca href=\"https://crates.io/crates/proto-vulcan\"\u003e\n  \u003cimg src=\"https://img.shields.io/crates/v/proto-vulcan.svg\"\n    alt=\"Crates.io version\" /\u003e\n\u003c/a\u003e\n\u003c!-- docs.rs docs --\u003e\n\u003ca href=\"https://docs.rs/proto-vulcan\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/docs.rs-latest-informational.svg\"\n    alt=\"docs.rs docs\" /\u003e\n\u003c/a\u003e\n\u003ca href=''\u003e\n  \u003cimg src='https://img.shields.io/badge/license-MIT%2FApache--2.0-informational.svg'\n    alt='MIT/APACHE-2.0' /\u003e\n\u003c/a\u003e\n\u003c!-- rustc version --\u003e\n\u003ca href=''\u003e\n  \u003cimg src='https://img.shields.io/badge/rustc-1.54.0+-informational.svg'\n    alt='Required rustc minimum version' /\u003e\n\u003c/a\u003e\n\nA relational logic programming language embedded in Rust. It started as a yet another \n[`miniKanren`](http://minikanren.org), but has already evolved into its own language with miniKanren at its core.\n\nIn addition to core miniKanren language, proto-vulcan currently provides support for:\n* miniKanren-like breadth-first and Prolog-like depth-first search.\n* Compound types ([Example](examples/tree-nodes.rs))\n* Disequality constraints CLP(Tree)\n* Finite-domain constraints CLP(FD)\n* Various operators: anyo, conda, condu, onceo, project\n* Pattern matching: match, matche, matcha, matchu\n* Writing goals in Rust embedded inline within proto-vulcan\n* User extension interface\n\nThe language is embedded into Rust with macros which parse the language syntax and convert it\ninto Rust. The language looks a lot like Rust, but isn't. For example, fresh variables are\npresented with Rust closure syntax, and pattern matching looks like Rust match.\n\n\n# Example\n```rust\nextern crate proto_vulcan;\nuse proto_vulcan::prelude::*;\n\nfn main() {\n    let query = proto_vulcan_query!(|q| {\n        conde {\n            q == 1,\n            q == 2,\n            q == 3,\n        }\n    });\n\n    for result in query.run() {\n        println!(\"q = {}\", result.q);\n    }\n}\n```\nThe example program produces three solutions:\n```text\nq = 1\nq = 2\nq = 3\n```\n\n## Embedding in Rust\nTo embed proto-vulcan in Rust, four macros are used: `proto_vulcan!`, `proto_vulcan_closure!`,\n`proto_vulcan_query!`, and `lterm!`.\n\n  * `proto_vulcan!(\u003cgoal\u003e)` declares a Proto-vulcan goal, and returns a Rust\n    variable of type `Goal`.\n  * `proto_vulcan_closure!(\u003cgoal\u003e)` declares a Proto-vulcan goal, and returns a Rust\n    variable of type `Goal`. The goal expression is evaluated lazily when the goal\n    is evaluated. The closure takes ownership of all variables referenced within the closure.\n  * `proto_vulcan_query!(|a, b, c| { \u003cgoal\u003e })` defines a Proto-vulcan query with query-variables\n    `a`, `b` and `c`. The returned value is a `Query`-struct, that when `run`, produces an\n    iterator that can be used to iterate over valid solutions to the logic program. The iterator\n    returns a struct with fields named after the query variables.\n  * `lterm!(\u003ctree-term\u003e)` declares a logic tree-term in Rust code, which can be passed to\n    proto-vulcan program within proto_vulcan! or proto_vulcan_query!, or compared with results.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0\n   ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n * MIT license\n   ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterohuttunen%2Fproto-vulcan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterohuttunen%2Fproto-vulcan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterohuttunen%2Fproto-vulcan/lists"}