Hacker News new | past | comments | ask | show | jobs | submit login

A quick read of the comments here gives me the impression a lot of people are unfamiliar with what logic programming is, how it works, and what it might be used for.

I am among them. Really appreciate the post just for inspiring me to learn more about it. Anyone have a favorite go to resource?




You may wish to check out the (free) books Logic, Programming and Prolog (http://www.ida.liu.se/~ulfni53/lpp/) or Learn Prolog Now! (http://learnprolognow.org).

Personally, I find declarative logic programming to be a great tool in domain analysis -- it's a powerful technique to document and prototype domain rules. I've never used it as an actual business rules engine, but I always feel like I should explore Prolog/Datalog or answer-set programming as a possible solution.


The Reasoned Schemer by Daniel P. Friedman, William E. Byrd and Oleg Kiselyov

https://mitpress.mit.edu/books/reasoned-schemer

It's from the author of miniKanren on which LogicJS is based.

There are implementations for a lot of other languages (other JS implementation too) on

http://minikanren.org/


Well, the classic logic programming language is Prolog, so learning it would be a good start. Here is something fairly lightweight on the subject:

http://www.amzi.com/AdventureInProlog/advtop.php

There was a great PDF that explained how unification and substitution of symbols worked in a concise and readable fashion, but I can't find it right now. Hm, maybe this one:

http://www.cs.ubbcluj.ro/~gabis/plf/Doc/SWI-Prolog/AnIntrodu...


Could you describe a classic use case? I'm also interested in learning some logic programming, but it's hard for me to conceptualize a use case that isn't already covered by the languages I regularly use.


Back in the day the two common use cases were expert systems and natural language processing (which are somewhat related). In this day and age I would most likely use Prolog for rule-based simulations or high-level game AI.


Russell and Norvig's AI textbook has a good introduction, although maybe it'll go into more detail than you would like. Stanford has some classes on coursera, too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: