4 ms·
> it was a mind bending experience Still remember the expressions of the undergrads walking out of our first Prolog lecture. Equal parts shell-shocked and worr
by flir 3y ago
> it was a mind bending experience
Still remember the expressions of the undergrads walking out of our first Prolog lecture. Equal parts shell-shocked and worried.
There's a thought: I wonder how the chatbots handle Prolog. Have they seen enough of it? Can they "reason" in that way?
- PaulHoule 3y agoIn Prolog you can write "pure logical" programs or you can use cuts and some other mechanisms to write imperative programs in it. The methods for writing imperative programs in Prolog are really clever but they are also awkward. (For instance "success" is often represented as a logical false and "failure" as a logical true) I think there has been an explosion of interest in a pure logical dialect of Prolog called Datalog https://en.wikipedia.org/wiki/Datalog https://en.wikipedia.org/wiki/Datalog when I first got interested in the semantic web I thought "OWL sucks" and thought Datalog was an interesting alternative, although it was invented in 1986 there was very little literature on it. I got dragged kicking and screaming away from the semantic web multiple times and when I got back to it again recently I found that the opinion "OWL sucks, use Datalog instead" has gotten widespread and now there are a lot of Datalog implementations and a huge literature. (Oddly, I met somebody who taught me the true meaning of OWL and how to do interesting things with it.) If you think that materialized views, CTEs and such are a ugly and disorganized mess in SQL you might like datalog a lot. (Of course if you think triggers are a disorganized mess you might like production rules but I haven't quite seen a production rules-based database that really works.)
- YeGoblynQueenne 3y ago>> (For instance "success" is often represented as a logical false and "failure" as a logical true) I'm confused by this. false/0 (or fail/0, equivalently) is used to force a clause to fail. Frex: p(X,Y):- false. Will always fail, not succeed. So what do you mean?
- i_don_t_know 3y agoNot OP. He might be referring to the looping or enumeration pattern: evaluate some clause to get the first solution, “fail” to trigger backtracking and to get the next solution, etc. At the very end after printing all solutions, the program returns “No” because there are no solutions left.
- YeGoblynQueenne 3y agoMaybe, but that's known as a "failure-driven loop", in Prolog parlance, so it's still not clear to me how "success is represented as a logical false". Also, "false/0" is extra logical.