Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tgecho/canrun_rs
A Rust logic programming library inspired by the *Kanren family of language DSLs.
https://github.com/tgecho/canrun_rs
dsl kanren logic rust
Last synced: 3 months ago
JSON representation
A Rust logic programming library inspired by the *Kanren family of language DSLs.
- Host: GitHub
- URL: https://github.com/tgecho/canrun_rs
- Owner: tgecho
- License: apache-2.0
- Created: 2020-02-24T04:34:02.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-20T08:35:56.000Z (6 months ago)
- Last Synced: 2024-05-23T05:32:13.211Z (6 months ago)
- Topics: dsl, kanren, logic, rust
- Language: Rust
- Homepage: https://docs.rs/canrun/
- Size: 668 KB
- Stars: 51
- Watchers: 6
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-rust-formalized-reasoning - Canrun - logic programming library inspired by the *Kanren family of language DSLs. (Kanren / Libraries)
README
[![CI](https://github.com/tgecho/canrun_rs/actions/workflows/tests.yml/badge.svg)](https://github.com/tgecho/canrun_rs/actions/workflows/tests.yml)
[![Coverage](https://img.shields.io/codecov/c/gh/tgecho/canrun_rs?token=7HSAMYDWEB)](https://codecov.io/gh/tgecho/canrun_rs)
[![Crate](https://img.shields.io/crates/v/canrun.svg)](https://crates.io/crates/canrun)
[![Documentation](https://docs.rs/canrun/badge.svg)](https://docs.rs/canrun/latest/canrun/)Canrun is a [logic programming](https://en.wikipedia.org/wiki/Logic_programming)
library inspired by the [\*Kanren](http://minikanren.org/) family of language
DSLs.- Intro blog post: [https://esimmler.com/announcing-canrun/](https://esimmler.com/announcing-canrun/)
- How it works (part 1): [https://esimmler.com/building-canrun-part-1/](https://esimmler.com/building-canrun-part-1/)## 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
```rust
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])
```