µKanren-rs
This is a Rust implementation of µKanren, a featherweight relational programming language. See the original Scheme implementation here for reference.
Features
- Structural unification of Scheme-like cons cells.
- Streams implemented with the
Iteratortrait. - Conjunction, disjunction, and
freshbased on traits (macro-free API). - Integer,
bool,char,&str, and unit type atoms. - Explicit
ToValuetrait that converts vectors and arrays into cons-lists. - Convenience macro
state!to inspect and specify state.
Usage
Here's a simple example, defining and using the appendo predicate.
use *;
let goal = fresh;
assert_eq!;
More examples can be found in the tests/ folder and the API documentation.