Questions tagged [minikanren]

KANREN is a declarative logic programming system with first-class relations, embedded in a pure functional subset of Scheme. miniKANREN is a simplified subset of KANREN without many bells, whistles, and optimizations.

KANREN is a declarative logic programming system with first-class relations, embedded in a pure functional subset of Scheme. The system has a set-theoretical semantics, true unions, fair scheduling, first-class relations, lexically-scoped logical variables, depth-first and iterative deepening strategies. The system achieves high performance and expressivity without cuts.

Applications of the system range from expert systems to polymorphic type inference and overloading resolution, to model checking and theorem proving. The system can be used as a meta-logic system.

KANREN works on any computer platform for which a Scheme implementation exists (from PalmPilot and iPAQ to Unix/Linux/Winxx/Mac workstations and servers to MindLego bricks). The system can be compiled or interpreted. Being essentially a Scheme library, KANREN can interact with the user through any graphical or command-line interface provided by the host Scheme implementation.

miniKANREN is a simplified KANREN without many bells, whistles, and optimizations of the full system. The goal of the simplifications was to make miniKANREN easier to explain.

61 questions
132
votes
2 answers

What are the main technical differences between Prolog and miniKanren, with respect to logic programming?

When I want to read up on logic programming I always stumble over two "main" ways to do it nowadays: miniKanren, a minilanguage introduced in The Reasoned Schemer and popular at the moment due to core.logic. Prolog, the first "big" logic…
Profpatsch
  • 4,338
  • 5
  • 25
  • 30
32
votes
4 answers

conda, condi, conde, condu

I'm reading the Reasoned Schemer. I have some intuition about how conde works. However, I can't find a formal definition of what conde/conda/condu/condi do. I'm aware of https://www.cs.indiana.edu/~webyrd/ but that seems to have examples rather than…
user1383359
  • 2,583
  • 2
  • 22
  • 30
29
votes
8 answers

What are the best uses of Logic Programming?

By Logic Programming I mean the a sub-paradigm of declarative programming languages. Don't confuse this question with "What problems can you solve with if-then-else?" A language like Prolog is very fascinating, and it's worth learning for the sake…
mbac32768
  • 11,025
  • 9
  • 31
  • 39
27
votes
3 answers

A graph DB vs a Prolog (or miniKanren)

Recently I have been looking into graph databases like Neo4j and into logic programming in Prolog and miniKanren. From what I have learned so far, both allow specifying facts and relations between them, and also querying the resulting system for…
noncom
  • 4,762
  • 3
  • 34
  • 69
20
votes
2 answers

Concise Explanation of Core.logic

I want to use Clojure's Core.logic. However, I want to also understand how it works. Is there a concise explanation of it somewhere? (Like implementing a metacircular evaluator?) Thanks!
user1311390
16
votes
2 answers

How to simulate an 'outer join' in core.logic?

I've just started playing with core.logic, and to work on it I'm trying to implement something simple that is similar to a problem that I am currently working on professionally. However, one part of the problem has me stumped... As a simplification…
Peter Hart
  • 4,745
  • 2
  • 20
  • 28
15
votes
3 answers

Partial Dictionary/Record Unification?

I understand that some Prologs support dictionary-like associative data structures out of the box. For the implementations that do, do they support some notion of partial unification with another structure that doesn't actually contain all of the…
dnolen
  • 18,116
  • 3
  • 58
  • 69
15
votes
2 answers

Understanding Mini-Kanren's Execution Model

Chapter 5 of SICP explains the scheme meta circular evaluator interns of a register machine. Is there anything that provides a similar type of Mini-Kanren in terms of Scheme primitives? I know that there is a Thesis written on Mini-Kanren (however,…
user1311390
10
votes
2 answers

Arenas where core.logic dominates [soft]

Community Wiki I don't care about the reputation points, I just want good answers. Feel free to remark this question as community wiki. Context I'm been working through The Reasoned Schemer, and have found the following observations: Logic…
user1311390
8
votes
2 answers

Why do miniKanren names always end with `o`?

All miniKanren relations end with the letter o. What is the motivation for this? I see that the Clojure core.logic library also does this.
Eli Schneider
  • 4,717
  • 3
  • 24
  • 50
7
votes
4 answers

MiniKanren support by Dr Racket

I started studying miniKanren with the book "The Reasoned Schemer - second edition" and the DrRacket scheme environment. I installed the "faster-minikanren" package, but the first examples of the book with the command run* (for example, (run* q #f))…
Schemer
  • 107
  • 6
7
votes
2 answers

Prolog matching vs miniKanren unification

In Prolog - Programming for Artificial Intelligence, Bratko says the following on page 58. "Matching in Prolog corresponds to what is called unification in logic. However, we avoid the word unification because matching, for for efficiency reasons in…
user3139545
  • 5,380
  • 8
  • 30
  • 64
7
votes
1 answer

mini-Kanren, core.logic, clojure: Reasoned Scheme Exercise 60

This is NOT homework -- the solution is already in the text. I just failed to understand the solution. Problem (run* (q) (let [a (== true q) b (== false q)] b)) Correct Solution (false) My believed solution () My…
user1311390
6
votes
1 answer

Listing unique DAG parents with core.logic

Here's a (hopefully) simple logical program I've been stuck with for a while. I have a DAG represented by an edge relation in core.logic, when generating the list of parent nodes, I get duplicates when I have "diamond shapes" in the graph (I'm not…
5
votes
1 answer

Feature structure unification in minikanren

How would one define a feature structure unification and subsumption in minikanren if we represent feature structures with lists? The general behaviour would be something like this (I think): (run* (q) (unifyo '(a b) '(a b) q))) => (a b) (run* (q)…
1
2 3 4 5