kanren icon indicating copy to clipboard operation
kanren copied to clipboard

An extensible, lightweight relational/logic programming DSL written in pure Python

Results 24 kanren issues
Sort by recently updated
recently updated
newest added

The following code fails with a `RecursionError`: ```python from kanren import eq, lall, lany, run, vars observations = [(0, 1), (1, 0)] def generate(pixels): pairs = [(a, b) for a,...

bug
enhancement
help wanted
important
stream processing
performance

This PR provides an implementation of [“A Surprisingly Competitive Conditional Operator”](https://www.brinckerhoff.org/scheme2018/papers/Boskin_Ma_Christiansen_Friedman.pdf). As I mentioned in [this comment](https://github.com/pymc-devs/symbolic-pymc/issues/6#issuecomment-470765132), there's an interesting avenue to explore regarding cross-`cond`-branch states, and I've included an...

enhancement
stream processing
new goal

With a `ChainMap`-like state class, we could constrain the amount of state (e.g. `dict`) cloning that `kanren` does, which should provide a big performance improvement when states are large `Mapping`s...

enhancement
help wanted
important
performance

In relation to https://github.com/pythological/kanren/issues/55, using a [`WeakKeyDictionary`](https://github.com/pythological/kanren/issues/55) might help automatically thin large states containing "auxiliary" logic variables that are no longer relevant. We would definitely need to profile this and...

enhancement
help wanted
important
performance

Looking at the `walko` example in https://github.com/aesara-devs/aesara/discussions/1082, I'm starting to wonder if some of those entries in the state are necessary or not. In particular, ```python from kanren import eq,...

enhancement
help wanted
question
important
term rewriting
performance

`ground_order` doesn't really order terms in a way that avoids infinite recursion in `term_walko` (e.g. when called by the `kanren.assoccomm` goals). There should be a way to handle this—at least...

enhancement
important
term rewriting

This PR introduces a simple relational typing example for Python AST. This implementation is based on Racket examples provided by @jasonhemann. - [ ] Add all function body statements to...

enhancement

With `condp` from #48, we could implement a simple, usable version of Pie as a demo of a type system with minimal dependent typing.

enhancement

This project needs type annotations and a Mypy `pre-commit` hook.

enhancement
help wanted
important

I was trying to write a simple transitive relation, and had a bit of a difficult time (and as I can see in previous issues I am not the first)....