Skip to content

tgecho/canrun_rs

main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
bin
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

GitHub Workflow Status 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::{domain, var, Goal, both, unify};

domain! {
    pub I32 { i32 }
}

let x = var();
let y = var();
let goal: Goal<I32> = both(unify(x, y), unify(1, x));

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

assert_eq!(result, vec![1])

About

A Rust logic programming library inspired by the *Kanren family of language DSLs.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks