5 ms·
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't get mor
by collyw 7y 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't get more attention.
- sacado2 7y agoNowadays, ontology-management systems like Protégé and SPARQL can more or less solve all problems prolog can solve, while providing higher-level formalisms and with the guarantee your query will terminate.
- baq 7y agoi've never used prolog seriously despite having a few problems very well suited for declarative solutions - variants of job shop scheduling, rule based workflows, etc. most reasons for why prolog didn't take off in my job are non-technical - it looks weird, it's hard to debug, integration with python isn't obvious and one worry i had (never tested) was that while the idea is to tell the computer about the problem, the real art was placing cuts.
- tejtm 7y agoHmm programs terminating because Protege is guaranteed to slag your machine is a feature had overlooked.
- mmarx 7y agoFor most queries, that might be true. However, the termination guarantees of Description Logic (OWL) reasoning and SPARQL (more precisely: the specific time complexity bounds) immediately imply that Prolog is more expressive. Even if we don't consider such ridiculously long-running queries, there's still limits to what can be expressed in DLs and SPARQL: since OWL doesn't have any variables, you're restricted to tree-shaped queries (indeed, this is a major part of why OWL reasoning is decidable), and SPARQL doesn't allow you to express any constraints on the intermediate nodes in a property path expression. Neither of these restrictions exist in Prolog.
- ben-schaaf 7y agoDoesn't guaranteed termination just mean it isn't Turing complete and thus by definition can't solve all problems prolog can solve?
- sacado2 7y agoAbsolutely. But in practice, I can't think of a problem that coulnd't be solved with OWL (or some other formalism like answer set programming) and where prolog would be the best solution (rather than more "traditional" programming languages). There are certainly a few, but not enough IMO to draw a lot of attention to prolog.
- Avshalom 7y ago> I wish I had time to learn it. I always wonder why it doesn't get more attention. pre-answered your own question really. Prolog 'died' in the AI winter, so no one knows it and no one knows anyone who knows it. Every time you think "huh I bet this is like 100 lines in Prolog" it doesn't matter because writing 2000 lines of Java (or whatever you know) is still going to be faster than learning Prolog. This is also the problem with literally any comment about "using the right tool for the job" with regards to programming languages.
- triska 7y agoComplementing this, neural nets shared the same fate in an AI winter, in fact in the AI winter preceding the one you mention, and yet they now attract significant attention. In large part because the hardware is better, and also because the approaches are now better. We may see analogous developments with Prolog when our current hardware gets better or changes its characteristics, and when Prolog implementations get better and use better approaches that are now becoming available. I think one difficulty we are facing when judging developments in this area is that complex software projects such as implementing a Prolog system happen on time scales we are not yet used to.
- Avshalom 7y agoPersonally I think Prolog is great* and I'm learning it for funsies but neural nets are a specific approach that people have been writing in Python, because they already know Python. Prolog is a whole thing. Kind of an apples and oranges problem. * I mean seriously it's fantastically expressive: parsing, constraint logic, expert systems, database interaction-- all look and feel completely native, it's beautiful.
- triska 7y agoAbsolutely, I fully agree! In fact, I think precisely due to this elementary difference, it is reasonable to expect it to take longer for Prolog implementations to reach the practical applicability we are now seeing in neural networks after a few decades of research and improvements.
- girzel 7y agoI'm guessing because it's so fundamentally different from most of the other programming languages out there, which I sometimes think are just variations on the variable/function/control flow theme (and yes, I've gone fairly far in Lisp). I've been teaching myself Prolog, and it's sufficiently different that I feel like I'm learning to program all over again. You can sort of pretend that predicates are just funny functions, where you have to put the return value's container into the argument list, but that's not really what's going on. I loved reading the docs for SWI-Prolog, where most of the predicate docstrings start: "True if...". You can say that the length predicate returns the length of a list, but really it returns true if the given list has a length equal to the given integer. It will tell you the length of a list, sure, but it will also do the reverse: ?- length(List, 5) -> List = [_,_,_,_,_] Nuts!
- agumonkey 7y agoever seen Friedman and Byrd talk about kanren ? ? evalo(e, 6) (+ 3 3)
- girzel 7y agoDouble nuts!
- Tomte 7y agoI have seen a few *kanren posts now on HN, and they always have their operators ending in "o". Is that just to distinguish them from normal "eval" (in this case), or is there a deeper meaning?
- agumonkey 7y agoI think it's yet another typographic ~wonder. From what I recall it's a ° to denote relation (relat°) but made into an ascii 'o'. So yeah, it's just to distinguish from the usual semantics.
- galaxyLogic 7y agoA related question is why do we still have SQL databases when everybody could be using Datalog? https://en.wikipedia.org/wiki/Datalog https://en.wikipedia.org/wiki/Datalog
- jplane 7y agoTake a look at datomic, it uses datalog.
- galaxyLogic 7y agoSeems awesome from the outset. I especially like "Datomic stores all history, and lets you query against any point in time."
- tom_mellior 7y agoSome guesses, I have no skin in this game: - historical inertia, i.e., SQL being better known, being taught to a lot more people, already used everywhere; even if every new project started Datalog, we would "still have SQL databases" for many decades, see the recent publicity for Cobol - aggregate functions, sorting of results - syntax: "select foo, bar from table_with_many_many_columns" is easier to get right than "table_with_many_many_columns(_, _, _, _, Bar, _, _, _, _, Foo, _, _, _)" (though in most other aspects Datalog syntax is indeed superior)
- antpls 7y agoThe biggest limitation I find about prolog is that the model is limited to the vocabulary and knowledge of the author. If the author only speaks English, the prolog program only works in English. If the author doesn't know anything about medicine, it will be very hard to model all the medicinal knowledge in the world (which could even be in different language). That's where Machine Learning and Neural Networks are much better : they can organize enormous amount of arbitrary data (not only text and words) way more faster that a programmer or an expert, given a sufficiently big enough dataset. In other terms, prolog "doesn't scale" with the diversity and ambiguity of humans knowledge.
- mattsouth 7y agoThis is what Im looking for in this thread - accessible critiques of prolog. Could your first issue be solved by a i8ln framework? Im not sure I accept your second issue - why would someone who doesnt know anything about medicine build a prolog program about medicine? But further to this, is there value in articulating the results of a machine learning algorithm as a prolog program?
- marcosdumay 7y agoUnfortunately, it's not. There is almost no problem that requires searching through some complex enough space for a specialized language be worthy its use, and yet have a small enough search space for zero knowledge depth-first search to be viable. (Database querying may be the one large problem, there are some comments about Datalog already.) There are some modern Prolog versions that try to use some better searching algorithms, but the language hinders that change.
- tom_mellior 7y ago> There is almost no problem that requires searching through some complex enough space for a specialized language be worthy its use Whether or not this is true, Prolog is so much more than just "searching". Unification gives you all the powers of pattern matching in functional languages, but adds a lot of extra power on top of that. For anything working with tree-shaped or even DAG-shaped data, Prolog is an excellent choice.
- marcosdumay 7y agoI do risk saying that if you are not doing search, then Prolog gives you way too much power. I have spent much more time looking for unexpected exponential runtime than the time it takes to implement the code without unification. That's the main reason I abandoned the language.