TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The Power of Prolog

381 pointsby fogusabout 5 years ago

13 comments

triskaabout 5 years ago
Thank you very much for your interest, I greatly appreciate it!<p>I hope you are all doing reasonably well. Please take care!<p>This book was most recently discussed here in May 2018:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17121028" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17121028</a><p>Since then, I have added a new chapter, <i>Logical Foundations of Prolog</i>:<p><a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;logic" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;logic</a><p>Also, I have made several other additions and improvements. You can see most of the changes since the last discussion in a public git repository:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;triska&#x2F;the-power-of-prolog&#x2F;compare&#x2F;8a94ed3d0ab73d31d6400ab18b9b341ed56fbad1...master" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;triska&#x2F;the-power-of-prolog&#x2F;compare&#x2F;8a94ed...</a><p>Currently, I am working on several videos that will eventually form the core of the book. Here are a few previews:<p><a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;logic" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;logic</a><p><a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;timetabling" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;timetabling</a><p><a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;sparrows_on_eagles" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;sparrows_on_eagles</a><p>These videos are all work in progress, and they may be replaced by better versions at any time. Hence, if possible, please use the links above to refer to them: They will always point to the latest versions.<p>Alternatively, please use the following overview page that shows all videos:<p><a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;videos&#x2F;</a><p>Also, I have published a comprehensive journal paper about my CLP(B) system, i.e., a <i>SAT solver</i> with some nice algebraic properties, seamlessly integrated into Prolog as a specialized form of unification:<p><a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;boolean.pdf" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;boolean.pdf</a><p>For Prolog application programmers and system implementors, the paper&#x27;s appendices may be especially interesting. They formalize a few important concepts that are also a major theme in the book.<p>As of October 2019, the CLP(B) system is also available in Mark Thom&#x27;s Scryer Prolog. Scryer is a Rust-based Prolog implementation that is freely available, conforms to the Prolog ISO standard, represents strings efficiently as lists of characters, and includes important features for implementing Prolog-based constraint solvers:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;mthom&#x2F;scryer-prolog" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mthom&#x2F;scryer-prolog</a><p>As of a few days ago, Scryer Prolog also ships with my implementation of CLP(ℤ), Constraint Logic Programming over <i>integers</i>. This is a very useful declarative paradigm for solving combinatorial tasks, in some ways superior to SAT solving because it allows more convenient modeling, easier experimentation with different formulations, and reasoning at a higher conceptual level. The chapter on declarative integer arithmetic contains more information, and further pointers:<p><a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;clpz" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;clpz</a><p>For illustration, here is an example page where you can solve <i>timetabling instances</i> with this approach:<p><a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;timetabling&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog&#x2F;timetabling&#x2F;</a><p>I welcome all comments and suggestions about the book, these videos, and Prolog in general. Also, I would like to take this opportunity to thank all readers for your thoughtful comments and endorsements. Your feedback and encouragement are making this work especially worthwhile.<p>Enjoy!
评论 #22818725 未加载
评论 #22816826 未加载
评论 #22818379 未加载
评论 #22816630 未加载
评论 #22820730 未加载
评论 #22818535 未加载
评论 #22818653 未加载
smabieabout 5 years ago
Is there a reason why anyone would choose prolog today instead of a library? Like racklog [<a href="https:&#x2F;&#x2F;docs.racket-lang.org&#x2F;racklog&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.racket-lang.org&#x2F;racklog&#x2F;</a>]. All the benefits of prolog, with none of the cost of using a new language and integrating it into your project.
评论 #22819118 未加载
评论 #22820386 未加载
评论 #22820978 未加载
评论 #22818993 未加载
dangabout 5 years ago
Earlier versions were discussed in 2018: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17121028" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17121028</a><p>and 2017: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14045987" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14045987</a><p>(Links are for the curious. Reposts are ok after a year: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;newsfaq.html" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;newsfaq.html</a>)
29athrowawayabout 5 years ago
Prolog reminds me of Cyc.<p>&quot;Cyc failed to understand a story about a person named Fred shaving in the morning... Its inference engine detected an inconsistency in the story: it knew people do not have electrical parts, but because Fred was holding an electric razor, it believed the entity &#x27;FredWhileShaving&#x27; contained electrical parts. It therefore asked whether Fred was still a person while shaving.&quot;<p>From &quot;Deep Learning&quot; by Ian Goodfellow, Yoshua Bengio, Aaron Courville.
评论 #22818417 未加载
haolezabout 5 years ago
I&#x27;ve found this channel a few months ago and my wife thinks I&#x27;m crazy when I&#x27;m watching it. &quot;This looks like work, but harder!!&quot;. Awesome content! Thanks for posting it :)
评论 #22818038 未加载
davidglabout 5 years ago
See also Mercury, FP logic programming like the love child of Prolog and Haskell <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mercury_(programming_language)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mercury_(programming_language)</a>
评论 #22820888 未加载
collywabout 5 years ago
Prolog look like it would be the correct tool for the job for a certain class of problems, I wish I had time to learn it. I always wonder why it doesn&#x27;t get more attention.
评论 #22817194 未加载
评论 #22817240 未加载
评论 #22820347 未加载
评论 #22816780 未加载
评论 #22817098 未加载
评论 #22824808 未加载
downerendingabout 5 years ago
I absolutely loved Prolog and CLP(R) back in the day.<p>The one thing I never got past was its difficulty in dealing with large, mutable sets of data. So, for example, given an array of a million or billion elements that are being rapidly modified, even the most trivial sorts of backtracking become infeasable. Maybe there&#x27;s some elegant way to do it, but I never got it.<p>(And difference lists need to die.)
评论 #22818299 未加载
photon_linesabout 5 years ago
If anyone loves both Prolog and Python, I wrote a mini-prolog interpreter in Python just over a year ago which you can check out here: <a href="https:&#x2F;&#x2F;github.com&#x2F;photonlines&#x2F;Python-Prolog-Interpreter" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;photonlines&#x2F;Python-Prolog-Interpreter</a>
评论 #22820932 未加载
jlosabout 5 years ago
Just a conjecture, but I think the main drawback of Prolog is its hard to see it having popular support. Recursion, logic programming, and constraint satisfaction are challenging paradigms which doesn&#x27;t lend well to doing something useful quickly, as opposed to something like Rails.<p>Im just finishing a class using Prolog and CLP(FD) and I&#x27;ve really enjoyed using the language. And while lots of things in programming aren&#x27;t easy at first, I&#x27;m just saying its hard to see wide adoption of prolog for that reason.
vpribishabout 5 years ago
has anyone here ever used prolog in production - like real world, making money, production? How about in real world research where it produced no-kidding actual value? From what I can tell it is only useful these days as a academic example of an alternative type of language. Is there something else that has carried the torch forward?
评论 #22818694 未加载
评论 #22828873 未加载
评论 #22822281 未加载
评论 #22818784 未加载
评论 #22827682 未加载
kitdabout 5 years ago
OT, but I was entertained by the fact that, as soon as I went to the page, the &quot;Recursion&quot; link was purple.
christmmabout 5 years ago
prolog should be used as a library DSL, embedded, within programs written in other languages