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.

A Primer on Logic Programming

117 pointsby refsetover 1 year ago

3 comments

2-718-281-828over 1 year ago
aren't predicates in prolog always starting with a lower letter and only variables with a capital letter?
评论 #37532384 未加载
评论 #37532430 未加载
timClicksover 1 year ago
Introductions to Prolog seem to suffer the &quot;draw the rest of the fucking owl&quot; problem. There&#x27;s a huge gap from the introductory examples to building real projects.<p>What I would love to see more of is how to embed a prolog interpreter into a wider program, using the source program&#x27;s data as the database, then prolog (or perhaps datalog) as an advanced query engine or rules engine.
评论 #37538591 未加载
dannymiover 1 year ago
Just a heads-up to the author:<p>&gt;Ancestor(X, Y) → Parent(X, Y) ∨ (Parent(X, Z) ∧ Ancestor(Z, Y)).<p>That&#x27;s a bug. The arrow needs to go to the left. Also, then, you can also opt to dispense with the disjunction and just use first-order logic normally.<p><pre><code> Ancestor(X, Y) ← Parent(X, Y). Ancestor(X, Y) ← Parent(X, Z) ∧ Ancestor(Z, Y).</code></pre>