proto-vulcan

CI Status Coverage Status

Crates.io version docs.rs docs MIT/APACHE-2.0 Required rustc minimum version

A relational logic programming language embedded in Rust. It started as a yet another miniKanren, but has already evolved into its own language with miniKanren at its core.

In addition to core miniKanren language, proto-vulcan currently provides support for: * miniKanren-like breadth-first and Prolog-like depth-first search. * Compound types (Example) * Disequality constraints CLP(Tree) * Finite-domain constraints CLP(FD) * Various operators: anyo, conda, condu, onceo, project * Pattern matching: match, 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. The language looks a lot like Rust, but isn't. For example, fresh variables are presented with Rust closure syntax, and pattern matching looks like Rust match.

Example

```rust extern crate protovulcan; use protovulcan::prelude::*;

fn main() { let query = protovulcanquery!(|q| { conde { q == 1, q == 2, q == 3, } });

for result in query.run() {
    println!("q = {}", result.q);
}

} The example program produces three solutions: text q = 1 q = 2 q = 3 ```

Embedding in Rust

To embed proto-vulcan in Rust, four macros are used: proto_vulcan!, proto_vulcan_closure!, proto_vulcan_query!, and lterm!.

License

Licensed under either of

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.