Skip to content

Add "occurs-check" functionality #36

@rlouf

Description

@rlouf

I am trying to reproduce the examples in The Reasoned Schemer using kanren, and example 45 ("a variable cannot be equal to a list in which it occurs") hangs:

from kanren import var, run, eq

run(1, q, eq((q,), q))
# expected the empty tuple ()

The following also hangs:

from cons import cons
from kanren import var, run, eq

run(1, q, eq(cons(q, ()), q))
# expected an empty tuple

I am not sure this is a bug, so posting before investigating further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requesthelp wantedExtra attention is neededimportant

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions