#logic-programming #collection #goal #canrun #dsl #family #kanren

canrun_collections

Collection related types and goal constructors for the Canrun crate

1 unstable release

0.1.0 Jul 3, 2020

#4 in #kanren

MIT/Apache

175KB
4K SLoC

CI Coverage Crate Documentation

Canrun is a logic programming library inspired by the *Kanren family of language DSLs.

Status: Exploratory and Highly Experimental

I'm still quite new to both Rust and logic programming, so there are likely to be rough edges. At best it may be a useful implementation of something that resembles the core concepts of a Kanren while being idiomatically Rusty. At worst it may just be a poor misinterpretation with fatal flaws.

Quick Start

use canrun::{LVar, Query};
use canrun::goals::{both, unify};

let x = LVar::new();
let y = LVar::new();
let goal = both(unify(x, y), unify(1, x));

let result: Vec<_> = goal.query(y).collect();

assert_eq!(result, vec![1])

Dependencies

~3.5MB
~77K SLoC