No description, website, or topics provided.
Groovy Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gradle/wrapper
src
.gitignore
.travis.yml
LICENSE.txt
README.md
build.gradle
gradlew
gradlew.bat

README.md

A miniKanren in Groovy.

Build Status

Basically a port of https://github.com/spariev/mini_kanren to Groovy.

Currently experimental, and could do with some help to make it nicer/faster/more useful.

For a simple example, say you have 2 lists, and you need to find the common members, you could do:

import com.bloidonia.logic.Logic

new Logic().with {

    // Create a fresh logic variable `q`
    fresh { q ->

        // Find all values for q which are in [ 1,2,3 ] and [ 2,3,4 ]
        assert run( q, membero( q, buildList( [ 1, 2, 3 ] ) ),
                       membero( q, buildList( [ 2, 3, 4 ] ) ) ) == [ 2, 3 ]
    }
}