minikanren

Clojure core.logic CLP(FD) projecting FD variables

拜拜、爱过 提交于 2019-12-20 01:59:20
问题 I'm working on a naive square-packing algorithm using Clojure's core.logic CLP(FD) library (core.logic version 0.8.3). Squares are represented like so: [[[x11 y11] [x12 y12]] [[x21 y21] [x22 y22] ...]] with each square represented as the coordinates of its top-left and bottom-right corners. Coordinates are FD variables, within a certain interval. I want to define the size of a solution as the distance between the top-right corner and bottom-right corners of the closest and farthest squares to

Prolog matching vs miniKanren unification

橙三吉。 提交于 2019-12-06 02:39:52
问题 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 most Prolog systems, is implemented in a way that does not exactly correspond to unification. Proper unification requires the so-called occurs check: does a given variable occur in a given term? The occurs check would make matching inefficient."

mini-kanren what is the difference between cond-a cond-u and cond-e?

半城伤御伤魂 提交于 2019-12-01 06:36:38
I have tried to use an implementation of mini-kanren in clojure. But been struggling to understand the difference between cond-a cond-u and cond-e. I seem to be quite clear about cond-e but understanding of cond-a and cond-u is quiet bad. cond-e takes a set of goals and then tries each of them... i.e tries all the branches that succeed. cond-a and cond-u on the contrary commit to the branch whose first predicate succeeds and cond-a returns all the possible successful unifications there after. while cond-u returns only the first successfull unification ... but however it seems like this

mini-kanren what is the difference between cond-a cond-u and cond-e?

余生颓废 提交于 2019-12-01 05:54:40
问题 I have tried to use an implementation of mini-kanren in clojure. But been struggling to understand the difference between cond-a cond-u and cond-e. I seem to be quite clear about cond-e but understanding of cond-a and cond-u is quiet bad. cond-e takes a set of goals and then tries each of them... i.e tries all the branches that succeed. cond-a and cond-u on the contrary commit to the branch whose first predicate succeeds and cond-a returns all the possible successful unifications there after.

A graph DB vs a Prolog (or miniKanren)

扶醉桌前 提交于 2019-11-30 11:43:58
问题 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 some selections. So, actually I cannot see much difference between them in that they both can be used to build a graph and query it, but using different syntax. However, they are presented as totally different kinds of software. Except the

A graph DB vs a Prolog (or miniKanren)

此生再无相见时 提交于 2019-11-30 00:17:53
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 some selections. So, actually I cannot see much difference between them in that they both can be used to build a graph and query it, but using different syntax. However, they are presented as totally different kinds of software. Except the technicality that databases maybe propose a more space-time effective storage technology, and except that tiny

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

牧云@^-^@ 提交于 2019-11-28 14:56:26
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 programming language. What I'm interested in now: What are the principal technical differences between the two? Are they very similar in approach and implementation, or do they take completely different approaches to logic programming? Which branches of mathematics do they come from, and what are the theoretical foundations? William E. Byrd First, allow me

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

大城市里の小女人 提交于 2019-11-27 08:57:32
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . 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 programming language. What I'm interested

conda, condi, conde, condu

a 夏天 提交于 2019-11-26 18:45:10
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 definitions. Is there a formal definition of conde , conda , condi , condu somewhere? In Prolog's terms, condA is "soft cut" , *-> , and condU is "committed choice" – a combination of once and a soft cut, so that (once(A) *-> B ; false) expresses the cut in (A, !, B) : A *-> B ; C %% soft cut, condA once(A) *-> B ; C %% committed choice,

conda, condi, conde, condu

血红的双手。 提交于 2019-11-26 06:34:33
问题 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 definitions. Is there a formal definition of conde , conda , condi , condu somewhere? 回答1: In Prolog's terms, condA is "soft cut" , *-> , and condU is "committed choice" – a combination of once and a soft cut, so that (once(A) *-> B ;