proto-vulcan
A miniKanren
-family relational logic programming language embedded in Rust.
In addition to core miniKanren language, proto-vulcan currently provides support for:
- Disequality constraints CLP(Tree)
- Finite-domain constraints CLP(FD)
- Various operators: anyo, conda, condu, onceo, project
- Pattern matching: matche, matcha, matchu
- Writing goals in Rust embedded inline within proto-vulcan
- User extension interface
The language is embedded into Rust with macros which parse the language syntax and convert it into Rust.
Example
extern crate proto_vulcan;
use *;
The example program produces three solutions:
q = 1
q = 2
q = 3
New relations can be defined as Rust-functions using proto_vulcan!
and
proto_vulcan_closure!
-macros. Expressions within proto_vulcan!
are
evaluated immediately, whereas expressions within proto_vulcan_closure!
are stored into a closure and evaluated later. Recursive relations must
use the latter variant.
use *;
More examples in documentation.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.