TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Prolog at Work

163 点作者 triska超过 2 年前

16 条评论

triska超过 2 年前
A recent article from the Austrian Federal Computing Centre, using Prolog to analyze eligibility criteria for <i>grants</i>:<p><a href="https:&#x2F;&#x2F;www.brz.gv.at&#x2F;en&#x2F;BRZ-Tech-Blog&#x2F;Tech-Blog-7-Symbolic-Analysis-of-Grants.html" rel="nofollow">https:&#x2F;&#x2F;www.brz.gv.at&#x2F;en&#x2F;BRZ-Tech-Blog&#x2F;Tech-Blog-7-Symbolic-...</a><p>In this way, several interesting questions can be answered, such as: Are there grants that have the same prerequisites? How many companies are not eligible for any grant? Are there grants where eligibility also implies other grants? etc.<p>Prolog is becoming more interesting now that several conforming and free implementations with comprehensive features arise, notably Scryer, Tau and Trealla Prolog as the most recent systems, and interesting bindings for other languages such as ichiban&#x2F;prolog for Go. On the Datalog side, Google have recently published a Datalog system called Mangle, which supports the Datalog subset of Prolog as a proper subset.
评论 #34195382 未加载
评论 #34196520 未加载
Jedd超过 2 年前
In the late 1980&#x27;s, when I was at college in Sydney, we had a visit from a chap (I think from somewhere in the north of Europe) who&#x27;d previously won a tender for, IIRC, a booking &#x2F; tracking system for a relatively small airline, all to be written in Turbo Prolog.<p>I recall two key things from his presentation of his final product.<p>First, he claimed he&#x27;d quoted a half the cost&#x2F;time of a COBOL-based, and a quarter of a C-based, competing tenders -- and that he&#x27;d met his deadlines.<p>Second, the UI was just beautiful - for both aesthetics and performance.<p>I didn&#x27;t have much experience in enterprisey software at the time, but what little I had seen was archetypal terminal-style, monochrome, sluggish, far from user-friendly etc. I have some (no doubt unreliable) memories of this thing looking like a &#x27;modern&#x27; (say Amiga) GUI app.<p>Another item in that large category of &#x27;I wish they&#x27;d drop these things into the public domain once they retired it from production&#x27; as it would probably still make a great demo (though most free Prolog implementations these days wouldn&#x27;t support (m)any of the pretty Turbo extensions, I&#x27;m sure).
评论 #34198255 未加载
评论 #34196364 未加载
ggzor超过 2 年前
The Power of Prolog [0] is a fantastic blog&#x2F;video series covering everything from basic syntax, theoretical basis, modern features and idiomatic constructs.<p>I highly recommend it if you want to get the gist of Prolog and its modern features.<p>If you want a tour of Prolog, you can watch the video with the same name [1].<p>[0]: <a href="https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog" rel="nofollow">https:&#x2F;&#x2F;www.metalevel.at&#x2F;prolog</a><p>[1]: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;8XUutFBbUrg" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;8XUutFBbUrg</a>
LAC-Tech超过 2 年前
Prolog feels like one of those things I definitely couldn&#x27;t write a whole app in, but I often wish it was just there in other languages the same way regex is.
评论 #34194857 未加载
评论 #34194466 未加载
评论 #34194475 未加载
评论 #34200503 未加载
评论 #34202365 未加载
评论 #34199036 未加载
评论 #34199520 未加载
评论 #34196356 未加载
mark_l_watson超过 2 年前
Good comments here and the original Reddit thread.<p>I just wrote Prolog material for a book I am writing: Prolog embedded in Python. I also have an embedded MiniZinc example.<p>I have infrequently used Prolog over a 40 year period. Most interesting work project was rewriting a Common Lisp IR&amp;D planning system in ExperProlog that supported nice graphics. The personal Prolog projects that most influenced me were using the semantic web library for SWI-Prolog in the early days of the semantic web: the best environment for learning about the SW that I found at the time.
usgroup超过 2 年前
I don’t think prolog does itself any favours by advertising as a general purpose programming language.<p>I tried to learn it and it really screams “I’m not a general purpose programming language”.<p>If you take away the use cases more suitable for datalog or MiniZinc the only remaining strong use case I see is recursive parsers.<p>It’d be good to hear about how others see it.
评论 #34194905 未加载
评论 #34195426 未加载
评论 #34196187 未加载
评论 #34194562 未加载
评论 #34196084 未加载
Karrot_Kream超过 2 年前
Has anyone used Mercury? The language seems quite interesting and has C and C++ FFI. I see bower (<a href="https:&#x2F;&#x2F;github.com&#x2F;wangp&#x2F;bower&#x2F;">https:&#x2F;&#x2F;github.com&#x2F;wangp&#x2F;bower&#x2F;</a>) a notmuch client is written in it.
评论 #34198779 未加载
评论 #34197200 未加载
Al-Khwarizmi超过 2 年前
I was rather disappointed when I learned Prolog 20 years ago, because of the unfulfilled expectations.<p>You could program in a totally declarative way, with logic formulas, and the system would take care evaluating the formulas! As a person who likes the math&#x2F;theory side of CS, that sounded absolutely amazing! Except that it wasn&#x27;t really like that, because IIRC (20 years have passed so there may be some inaccuracies here, but this is the gist of what I remember) logical operators like &quot;and&quot; or &quot;or&quot; weren&#x27;t even commutative, &quot;a and b&quot; vs &quot;b and a&quot; could be the difference between running normally and an infinite loop, you had to insert &quot;!&quot; (which were totally non-declarative and non-logic) to make things work as you wanted, and at that point you were thinking about what order things would be run in, so why not use an imperative language instead, where at least the order of execution is clear in the first place.<p>To each their own, though.
评论 #34195182 未加载
评论 #34195206 未加载
sgt101超过 2 年前
Prolog is deeply unsuited for work, use Clingo instead.<p>Try this on <a href="https:&#x2F;&#x2F;swish.swi-prolog.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;swish.swi-prolog.org&#x2F;</a>.<p>on(a,b). on(b,c). above(X,Y) :- on(X,Y). above(X,Y) :- on(X,Z), above(Z,Y).<p>Query above(a,c)<p>Ok, true - it works! no probs.<p>now try<p>on(a,b). on(b,c). above(X,Y) :- above(X,Z), on(Z,Y). above(X,Y) :- on(X,Y).<p>and query... and it explodes.<p>So - this kind of bug is very hard to find and extremely easy to introduce.<p>The good news is that answer set programming is not prone to it. So instead of prolog use Clingo !<p><a href="https:&#x2F;&#x2F;potassco.org&#x2F;clingo&#x2F;" rel="nofollow">https:&#x2F;&#x2F;potassco.org&#x2F;clingo&#x2F;</a>
评论 #34194999 未加载
评论 #34203494 未加载
评论 #34198077 未加载
评论 #34196748 未加载
评论 #34195338 未加载
评论 #34202013 未加载
gneray超过 2 年前
I hear the comments that Prolog isn’t a “general purpose programming language” but indeed you can use it for a lot of use cases.<p>Eg Authorization is one such use case. Polar is a logic programming language (like Prolog) specifically designed for authorization: <a href="https:&#x2F;&#x2F;www.osohq.com&#x2F;docs&#x2F;reference&#x2F;polar-syntax" rel="nofollow">https:&#x2F;&#x2F;www.osohq.com&#x2F;docs&#x2F;reference&#x2F;polar-syntax</a>
hagendaasalpine超过 2 年前
My dad&#x27;s job for a while was configuring telecoms in a DSL built atop of prolog. The worst thing - the development enviroment was MS Word.
评论 #34201151 未加载
neilv超过 2 年前
In the early 1990s, I knew one team was using Prolog as the rich database report language for a greenfield complex new workstation platform that was otherwise written in C.<p>I was surprised, because Prolog already seemed like one of those exotic things that you learned in school was used in AI research, or had been, but hadn&#x27;t heard of it being used commercially at the time.
slekker超过 2 年前
Any resources you’d recommend for learning Prolog?
评论 #34195356 未加载
JTBooth超过 2 年前
I interviewed with a company named Gaussy recently who use it for warehouse operations.
pabloski79超过 2 年前
I quietly wonder within myself, could it be somehow used together with AI&#x2F;NN?<p>An old dream od marrying NN with rule based systems.
评论 #34195315 未加载
评论 #34195727 未加载
评论 #34196261 未加载
评论 #34195368 未加载
ramraj07超过 2 年前
At least for designing APIs, I find pydantic + FastAPI (and now SQLAlchemy 2) to be an excellent platform to do the initial spec, and the beauty of it is that it automatically produces the swagger docs as well as a fully functioning API interface as well!