7 ms·
Scryer Prolog
- sriku 4y agoSWIProlog[1] has so far been my go to due to the extensive support system it has. However, I've been meaning to explore higher order logic a bit and Ciao[2] caught my attention there, with sugar for function-like notation and higher order programming including "lambda" style predicate expressions .... and it compiles down to executable. The function notation in this context is along the same lines as Mozart/Oz and can be convenient. Not explore the higher order aspects much though. [1]: https://www.swi-prolog.org/ https://www.swi-prolog.org/ [2]: https://en.wikipedia.org/wiki/Ciao_(programming_language) https://en.wikipedia.org/wiki/Ciao_(programming_language)
- YeGoblynQueenne 4y agoHey, if you're interested in higher-order logic programming then you might want to have a look at Meta-Interpretive Learning (MIL). It's a new approach to Inductive Logic Programming (ILP) that learns by SLD-resolution with first- and second-order definite clauses (hence, "higher-order"). You won't find much on MIL as "higher-order logic programming" but that's really what it is: it's logic programming; with a higher-order program (i.e. one containing both first- and second-order clauses). The catch is that once you do this any proof you complete gives you instantiations into the second-order variables in the second-order clauses and now you have yourself a first-order program, that you didn't have before; hence "inductive". So it's basically a form of machine learning of logic programs, from other logic programs. There are a few papers you can find online about MIL, but I recommend (PLUG ALERT) the documentation of the MIL system I created for my doctoral thesis as a starting point: https://github.com/stassa/louise https://github.com/stassa/louise I recommend that as a starting point because it's written for people who are familiar with logic programming, but not necessarily ILP. Anyway, plug over. I think MIL is an exciting new development that has of course gone under the radar of the logic programming community at large.
- cvalka 4y agoBeware of the license - https://github.com/stassa/louise/blob/master/LICENSE.md https://github.com/stassa/louise/blob/master/LICENSE.md
- YeGoblynQueenne 4y agoEh? What's wrong with the license? :P
- javbit 4y agoIt's not a free software license as it restricts freedom zero, the ability to use it for any purpose. https://www.gnu.org/philosophy/free-sw.html#four-freedoms https://www.gnu.org/philosophy/free-sw.html#four-freedoms It's interesting because I'm sure no free software author wants to inadvertently support a dubious cause. The Anti-Mil clause prevents that (in theory at least, as license enforcement is hard for everyone). However, it also nominally prevents use by good causes as well (you can grant exceptions, however). Good and bad here are relative to the author. I guess it's a balancing act between upholding ones own sense of right and wrong, and the freedom for someone else to have a differing opinion than you. Edit: Removed "strictly" from "strictly free software". It's unfree. Edit: Added some words for clarification.
- YeGoblynQueenne 4y agoThanks for your feedback. To be honest I wasn't thinking about free software, I wanted a license that would make the project available to everyone, unless they are affiliated with the military of some nation. There are no such licenses, so I improvised. Perhaps there should be more such licenses. On the other hand, it might also create problems. For example, what if I decide that I don't want my code to be used by people who are against same-sex marriage, or abortion, or who are for those things, or who eat meat, or don't eat meat, etc? In any case, the license is what it is. It's an unfree license. Thanks for pointing it out, I hadn't realised.
- electroly 4y ago
- Avshalom 4y agoNice, this project has been sorely missing some documentation.
- triska 4y agoScryer Prolog was most recently discussed here in October 2021: https://news.ycombinator.com/item?id=28966133 https://news.ycombinator.com/item?id=28966133 Since then, a great number of improvements have become available, among them: The system is now much faster, thanks to a much more compact internal representation of WAM heap cells. In addition, goals that occur as arguments of meta-predicates are now automatically compiled much more efficiently, avoiding superfluous lookups at runtime. Also, Adrían Arroyo Calle has contributed new and much improved HTTP server and client libraries, based on the Rust crate "hyper". Scryer Prolog 0.9.1 and later versions ship with all these improvements and several smaller corrections and additional features. Adrían also built the documentation system DocLog that he uses to generate this nice home page of the project: https://github.com/aarroyoc/doclog https://github.com/aarroyoc/doclog DocLog uses Djota, a Prolog implementation of the markup language Djot: https://github.com/aarroyoc/djota https://github.com/aarroyoc/djota Such systems show that nice applications can already be built with Scryer Prolog and its innovations. Thank you a lot to Mark and everyone who contributed to Scryer Prolog, please keep up the great work!
- kinow 4y agoI had seen the news about the new website, but didn't know that there were more great improvements in Scryer. Going to check it out, thanks for the nice summary of updates.
- joeatwork 4y agoHey,folks who are working with Prolog - what sort of work are you doing?
- triska 4y agoThere was a recent thread Prolog at work with many interesting links and posts: https://news.ycombinator.com/item?id=34164221 https://news.ycombinator.com/item?id=34164221
- YeGoblynQueenne 4y agoI work on an ancient, legacy system that manages company car rentals, written in Visual Prolog. Visual Prolog is an ojbect-oriented, typed, compiled, version of Prolog, so it's very, very different than ordinary Prolog ("ordinary" for me anyway). To be honest, it's not the most exciting system to be working on. It's basically using Prolog to encode business rules and perform calculations that you would sometimes expect to see in a spreadsheet (but then, there are parallels between logic programming and spreadsheets, e.g. see [1,2]). Prolog of course is a great language for that sort of use. On the other hand, I think the idea of turning Prolog into an object-oriented language is the worst idea of all times. I mean, when I quit my job in the industry to do a PhD, a big draw was that I could work with Prolog, but not OOP. And now I'm back in the industry working with an OOP Prolog. Resistance is futile. The fun part is that the project I'm working on has been developed over 20 years by multiple people with very, ah, let's say varied opinions on the necessity of maintainability of old code. There are missing sources, old configurations that break compilation, no structured comments whatsoever, no version control (NO VERSION CONTROL!!! AAAAAH!!!), about 1/10th of the LOCs are commented-out for reasons unknown and unspecified in any comments, and so on, so forth. So it's really cool to work with. I absolutely love digital archeology! :D _________________ [1] https://www.j-paine.org/spreadsheet_structure_discovery.html https://www.j-paine.org/spreadsheet_structure_discovery.html [2] https://dl.acm.org/doi/10.1145/67449.67466 https://dl.acm.org/doi/10.1145/67449.67466
- pjmlp 4y agoNow that is a name I didn't saw for a while. I remember the ads in Dr Dobbs! Thanks for sharing.
- eddsh1994 4y agoAre there any nice temporal logic libraries?
- mark_l_watson 4y agoI work with Mark Thom, a Scryer Prolog developer. That said I have used Swi-Prolog for 20 years so it may be a while before switching. Coincidentally I just started re-reading The Art of Prolog yesterday. It is an old book, but good. For some types of applications, Prolog is pretty much amazing. EDIT: nice documentation pages, BTW.
- jeff-davis 4y agoIs the difficulty switching from SWI due to tooling issues or because source code changes are required?
- noloblo 4y agomark, which type of applications is prolog amazing for?
- crabbone 4y agoNot Mark. The obvious answer: knowledge base. Prolog is the best database I know when it comes to encoding complex relationships and querying for complicated answers. Less obvious: parsing. It's very easy to write parsers in Prolog. I wrote Protobuf and Thrift parsers in it (for the schema, not the binary payload) and each one took about a day of work. I didn't use those parsers in commercial settings, but I did write a parser in Prolog to help me to generate Swagger from some RoR structured comments (I don't know Ruby, but could figure out what was in the comments). Another ways I used Prolog in practice and would use it more: software testing. Prolog lends itself very well to describing the model of SUT and to "parametrization" of testing. I was very close to using Prolog in this capacity, and worked for almost half a year on a proposal for replacement of the company's existing tests with something based on Prolog, but eventually failed to convince my bosses that it would work (same arguments as always, basically, "water from the toilet").
- YeGoblynQueenne 4y agoSorry, I'm curious, what is "water from the toilet"? A quick search of the internet turns up nothing very clear.
- tannhaeuser 4y agoNit: a page advertising ISO Prolog shouldn't start with non-ISO builtins such as append/3 however widespread append or the belief it's in ISO may be. Here's a variant using atom_concat/3 which is actually defined by ISO: ?- atom_concat('Hello, ', X, 'Hello, ISO Prolog!') You can paste that Prolog code into eg [1] and other sites for execution in the browser btw. [1]: https://quantumprolog.sgml.io/browser-demo/browser-demo.html https://quantumprolog.sgml.io/browser-demo/browser-demo.html
- triska 4y agoappend/3 is a so-called extension of the standard: 3.70 extension: A facility provided by the processor that is not specified in this part of ISO/IEC 13211 but that would not cause any ambiguity or contradiction if added to this part of ISO/IEC 13211. This means that every conforming system is free to provide append/3, because it causes no ambiguity or contradiction with the standard. However, by 5.1, every conforming Prolog system must offer a strictly conforming mode: e) Offer a strictly conforming mode which shall reject the use of an implementation specific feature in Prolog text or while executing a goal. In the case of append/3, this means that there must be a way to run the system without the presence of this predicate. Scryer Prolog satisfies this criterion: In Scryer Prolog, append/3 is only available if library(lists) is loaded, otherwise it is not available. For example, we get: $ scryer-prolog -f ?- append("Hello, ", X, "Hello, Scryer Prolog!"). error(existence_error(procedure,append/3),append/3). append/3 is part of the suggested Prologue for Prolog: https://www.complang.tuwien.ac.at/ulrich/iso-prolog/prologue https://www.complang.tuwien.ac.at/ulrich/iso-prolog/prologue Strings are a good representation for ephemeral data, where allocating an atom would yield additional overhead, via an entry in the atom table that is not needed elsewhere and can only be reclaimed by GC instead of much faster on backtracking. Another major attraction of strings is that we can use DCGs to reason about them, and we can write this specific example equivalently as: ?- phrase(("Hello, ",seq(Cs)), "Hello, Scryer Prolog!"). Cs = "Scryer Prolog!". DCGs are another example of a conforming extension, and they are themselves currently being drafted for inclusion in the Prolog ISO standard. In Scryer Prolog, DCGs are available only when library(dcgs) is loaded, so that its default mode after invocation remains strictly conforming.