kanren
kanren copied to clipboard
An extensible, lightweight relational/logic programming DSL written in pure Python
We might want a non-`cons` constraint. It would be a nice way to simplify the specification of some graph/term-walking goals.
We could implement a version of `__setitem__` in the miniKanren state object/mappings (e.g. `ConstrainedState`) that checks constraints immediately after being added to the state. A failure could throw an exception...
`buildo` (soon to be replaced by `applyo`) will actually apply a rator to its rands and unify the result with its third argument: i.e. `buildo(add, (1, 1), q_lv)` should unify...
Needing to add extra `isinstanceo` goals for additional types (e.g. `isinstanceo(x, int), isinstanceo(x, float)` instead of `isinstanceo(x, (int, float))`) is pretty inconvenient (and somewhat wasteful).
We should consider implementing [`__length_hint__`](https://www.python.org/dev/peps/pep-0424/) for goal and state streams. That way, one could make informed, dynamic decisions about computational costs and potentially make better decisions about goal evaluation order.
This isn't a problem in the `neq` constraint, but it's a confusing ambiguity/gotcha that arises from `cons`'s "null" value for lists being both `[]` and `None` (i.e. `cons(1, []) ==...
We could do less collection copying between `ConstrainedState.post_unify_checks` and `ConstraintStore.post_unify_check`. Furthermore, the whole interface could be refactored to return updated constraints.
We should introduce a few basic macros and interface changes so that running `miniKanren` from [Hissp](https://github.com/gilch/hissp) and [Hy](https://github.com/hylang/hy) will behave just like it does in standard Lisp implementations (e.g. a...
We could really use some form of tabling (i.e. a logic programming form of memoization). See Byrd, William E. 2009. “Relational Programming in MiniKanren: Techniques, Applications, and Implementations.” for a...
Per some [external conversations](https://matrix.to/#/!QqFchLNQAbmeuhDMrX:gitter.im/$Q6o93Dm5R00mKFpGqnf6qPeJHummzr3hJQGNfZo7dvE?via=gitter.im&via=matrix.org), it might be worth looking into a means of encoding and enumerating stream disjunctions in a global e-graph-like miniKanren state and using those as part of...