Logic programming ...

307 views
Skip to first unread message

mraptor

unread,
Dec 5, 2013, 12:31:40 AM12/5/13
to elixir-l...@googlegroups.com
Last couple of days was watching some videos on core.logic in Clojure ... it seems it is a big thing there !
There is the mini language that encompass the ideas of logic programming called miniKanren :

http://minikanren.org/

It seems that it has implementation in Erlang.. ;)

https://github.com/bodil/lolkanren/blob/master/kanren.erl

and even Ruby implementation :

https://github.com/spariev/mini_kanren

Just curious, Is there a plans of adding Logic programming ideas in Elixir ?

Joseph Wilk (personal)

unread,
Dec 5, 2013, 6:11:06 AM12/5/13
to elixir-l...@googlegroups.com, mraptor

Elixir already has some strong logic programming ideas since Erlang & Elixir share a common ancestor of Prolog. 

They both take the strong ideas of pattern matching which make Prolog so powerful. 

Clojure core.logic has to deal with the fact Clojure does not have native pattern matching (see core.match).

The golden part of Prolog that Erlang had removed was backtracking. Though Clojure has no such thing and manages a good attempt at logic programming.

So in brief from my perspective all that needs to happen is a lib using macros to add backtracking and you have logic programming.

You could also just use Prolog (its awesome) which still blows anything else out of the water when jt comes to logic programming.

--

Joseph Wilk

http://blog.josephwilk.net

@josephwilk


 



--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Devin Torres

unread,
Dec 5, 2013, 5:57:49 PM12/5/13
to elixir-l...@googlegroups.com, mraptor
miniKanren in Elixir would be awesome!

TR NS

unread,
Dec 6, 2013, 12:09:16 AM12/6/13
to elixir-l...@googlegroups.com, mraptor, de...@devintorr.es


On Thursday, December 5, 2013 5:57:49 PM UTC-5, Devin Torres wrote:
miniKanren in Elixir would be awesome!

miniKanren's terminology is yucky. It reads like a joke --as if an American was trying to speak Spanish so he threw extraneous vowels on every English word. Beyond the terms, I am not so sure that the power of miniKanren is any better than Prolog, yet it adds a lot more syntactical constructs to achieve anything. So i am not so sold on it. But my evaluation wasn't that in depth so I could be wrong.

mraptor

unread,
Dec 6, 2013, 1:03:36 AM12/6/13
to elixir-l...@googlegroups.com, mraptor, de...@devintorr.es
Very nice review of core.logic, even that I dont know Clojure is very understandable :

http://www.infoq.com/presentations/Introduction-Logic-Programming

Jim McCoy

unread,
Dec 6, 2013, 9:37:41 AM12/6/13
to elixir-l...@googlegroups.com
If you are really interested in something like this I would recommend taking a look at erlog (by Robert Virding, one of the creators of Erlang) which is an actual prolog interpreter that runs on the erlang vm.  This would probably be a good place to start rather than yet-another-miniKanran implementation.


--
Reply all
Reply to author
Forward
0 new messages