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.

69 questions
1
vote
1 answer

Synthesize smallest map satisfying featurec constraints in core.logic?

In core.logic, is there a way to translate the outputs of a program like (run 2 [q] (fresh [a] (featurec q {:foo a}) (membero a '(5)) (conde ((featurec q {:bar 2})) ((featurec q {:baz 2}))))) into the smallest maps that…
Alex Lew
  • 2,064
  • 14
  • 17
1
vote
1 answer

Why does this implementation of sorto does not terminate?

I'm a beginner with logic programming. I'm trying to implement a sorting relation like this: (sorto [3 2 1][1 2 3]) -> #s I'am using clojure and core.logic: I don't understand why this can not terminate in most cases. Any idea would be helpful,…
szymanowski
  • 1,359
  • 1
  • 14
  • 25
1
vote
1 answer

what algorithms does clojure's core.logic use for solving?

According to wikipedia, prolog uses SLD Resolution. What are the principle algorithms driving the solving in core.logic?
matanster
  • 15,072
  • 19
  • 88
  • 167
1
vote
1 answer

Using core.logic to solve the sum product riddle

So I've been trying to teach myself clojure and core.logic and decided to try and implement a solution to the sum product problem (http://en.wikipedia.org/wiki/Impossible_Puzzle). So far I've implemented the first two steps. (ns…
1
vote
1 answer

Does projecting in two directions count as relational in core.logic?

I understand that project in core.logic is not relational. However, it seems that I can get relational-like behaviour by projecting in both directions inside conda, e.g.: (defn lifto-with-inverse "Lifts a unary function and its inverse into a…
mikera
  • 105,238
  • 25
  • 256
  • 415
1
vote
1 answer

Dynamic type relation for core.logic

What would be the best way to define or use a type relation in core.logic? I tried something like this to get a simplified representation of the type of the form argument, but the project usage causes various issues (defn typeo [form type] …
Timo Westkämper
  • 21,824
  • 5
  • 78
  • 111
1
vote
1 answer

How to select from a set of possible values in minikanren / clojure-core.logic?

How do I express the constraint that n variables take different values from a set of n values? For example, maybe I want to search for the expression of the form (op1 a (op2 b c)) with the largest value, when a, b and c should 1, 2 and 3 (in some…
andrew cooke
  • 45,717
  • 10
  • 93
  • 143
0
votes
1 answer

miniKanren (logpy, or others) how to assert a fact is true?

I am doing an exercise to write some logic code in a few different idioms... Prolog, miniKanren, ASP etc... to get a feel for each. I have a question about something really basic: In Prolog you can define: human(bob). then in the REPL you can check…
Anentropic
  • 32,188
  • 12
  • 99
  • 147
0
votes
1 answer

Modelling recipes and available ingredients with constraint logic

Imagine I have a number of recipes for different dishes and a larder containing various ingredients in my kitchen. I want to construct a model using core.logic which will enable me to answer the following question: for a given set of ingredients…
1 2 3 4
5