125 points · by nickmain · 10y ago · 47 comments
Binaries: https://github.com/AmziLS/distribution
[edit: for v9] Not too sure how that fits with the restrictions in the download page, http://www.amzi.com/AmziPrologLogicServer/store.php
But I do get a small itch to try the http://www.amzi.com/AdventureInProlog/advtop.php
""" Adventure in Prolog ™ — Prolog Tutorial
A full tutorial for learning Prolog, using an interactive fiction game for it's basic example. In the course of the tutorial you will also build an expert system and a business application. """
Looks like a standard case of "the source is OSS and you can use it for free if you build from source, but if you want pre-built binaries, you have to buy them from us". That's basically what Red Hat does with RHEL... you can get the source and build yourself, or you can buy RHEL binaries from them (for the sake of argument, for the moment lets forget about support and indemnification and all the 'other' stuff buying a subscription gets you).
Of course, one difference with RHEL is that there's a vibrant community of people who take the RHEL source and rebuild it and release things like CentOS. Presumably you could do the same kind of thing with the Amzi source, so long as you respect their trademarks and what-not.
The very stable 9.x release of the software will remain as a supported commercial version.I mean, I get the point they're trying to make (I think) but I wish people would be a little more precise when talking about this topic.
https://www.schneier.com/blog/archives/2014/05/friday_squid_...
Good catch, thanks. I did read that bit, and promptly overlooked it.
Also, having more open-source Prolog engines is a very good thing, both for the language and for the project itself. For the project, it's good because it makes it easier for a community to grow around it. Swi has benefited enormously from its popularity (Jan Wielemaker has commented on this occasionally). For the language, it's good because the more healthy Prolog communities we have, the more we can hope to get new people interested in the language.
Comparing to other Prologs (and Prologs-ish'es) the problem with having closed-source and only for-pay Prolog engines is mainly one of portability, which in the Prolog world is a bit shit (and that's a vast understatement).
Frex, I wrote my degree dissertation using Win-LPA Prolog in 2010-11. LPA is commercial and I don't have a licence anymore (I had a student one) so now I can't run my dissertation. I tried (and tried (and tried)) to make it work on Swi but failed (and failed (and failed))[1].
The problem is there are subtle differences between implementations that bite you in ways you never thought possible, and it's just aaaargh hard to get the same program running in the same way on two different Prologs.
Apparently the exception to this portability hell is Yap and Swi, who have worked together to maintain some compatibility with each other. I don't have experience of this myself (after getting burned I've stuck to Swi) but if Amzi open-sourcing their stuff also means they'll be more open to this sort of working with others, then that's really, really amazing news.
____________________________
[1] It's here: https://github.com/stassa/Gleemin But it will hurt you.
Also, graduate dissertation, 5 years ago: embarrassing.
Or even between versions of the same implementation. E.g., I know of one project that sticks with SICStus 3, because in SICStus 4 findall/3 removes blocked goals from copied variables. This system relies quite heavily on blocked goals and working around this change turned out to be too expensive.
(If I recall correctly ;).)
Another example is SWI Prolog diverging from the ISO standard in version 7 (e.g. double quoted strings are now a type on their own, rather than a list of character codes). Luckily, there is a --traditional flag for older code.
In both cases, there are good reasons for the changes, but it makes portability hard.
Edit: wanted to add that this is not intended to be a critique of these particular (great) implementations of Prolog.
When you say "blocked goals" do you mean it like:
:-block(a_block). % ... stuff ... :-end_block(a_block).
That sort of thing? Anyway yeah, sounds typical :/
With Swi I hurt a little recently when an update screwed up some of my stuff but then that was my fault for doing hacky tricks and trying to use modules as they're not meant to be.
>> In both cases, there are good reasons for the changes, but it makes portability hard.
Oh indeed. I started using 7.x the moment it was out pretty much, knowing that it means I'm tied to Swi for good and bad, but there's much more good than bad and so far I haven't regretted it.
Btw, have you tried Mercury? My last foray into logic programming made it seem like it was killing Prologs in quite a few fronts. Prover work moved onto HOL, Coq, etc. Some people still use it for type-checking and queries. Yet, seems hard for me... not a logic programmer btw... to justify Prolog given capabilities and results from other tools. Any ideas on why it's worth keeping around or would you use an alternative today?
Regarding dissertation, I lost most of life's work when three HD's (main + 2 backups) all died within short time of each other. Encrypted with custom crypto that also fried haha. You can't run something you spent years on and is referenced in your degree. I feel your pain or irritation on that. ;)
Note: Oh shit, it's a Magic the Gathering interpreter! I used to play that every day with friends like a decade ago to pass time at school/work. I even wrote some GUI's and game engines for it but really alpha stuff. Probably would've wrote an AI for it if I didn't discover Starcraft. Might try to read some of it this week if I get spare time even though idk Prolog anymore. Maybe I'll learn something anyway or get some nostalgia at the least. :)
Ouch. Oh dear, that sounds horrible.
>> Btw, have you tried Mercury?
I've picked it up a few times but I keep coming back to vanilla Prolog. It's great but I'm a bit scared by the tiny amount of adoption. I know it's kind of ironic: low adoption feeds back on to itself.
>> Any ideas on why it's worth keeping around or would you use an alternative today?
I do a lot of nlp for university, and although I use Python for all the machine learning stuff, the text processing capabilities of Prolog are beyond any comparison with anything else.
For instance, everyone uses regular expressions for tiny bits of parsing and string manipulation. Prolog uses a sort of pattern matching, unification, that is like regular expressions except without any special syntax and Turing-complete.
For language processing, most interpreters have something called Definite Clause Grammars. In short, it's syntactic sugar that lets you declare a grammar, except the grammar is also a parser, that recognises and generate strings (because Prolog). They make developing a parser a piece of cake.
Also, Prolog runtimes are essentially fast, in-memory relational databases, with added reasoning (and no SQL). I can think of many applications that could use that sort of thing. Plus, the language itself is the database, so there's no object-relational impedance mismatch and whatnot.
>> Might try to read some of it this week if I get spare time even though idk Prolog anymore
Thanks, I appreciate that. But please keep in mind: 5 years ago and embarrassing :)
Frankly, SWI gets all the action. There are times where it isn't the most efficient Prolog, but the toolset you're going to get from AMZI is much more limited, and that in the end is going to be a bigger deal. Does AMZI have ODBC, CLP, CHR, and a web framework? Probably not. SWI has the biggest community, the largest built-in library, the most 3rd-party packages, and is the easiest to install. Everything else is basically tied for second place. Except Visual Prolog, which comes last. :)
It's kind of a shame, because my earliest exposure to Prolog was through AMZI; they had a nice Windows IDE you could try for free (30 minutes at a whack). I went through their "Nani Quest" tutorial and that gave me positive memories of Prolog that I revisited later.
Mercury is an interesting language, but not having a REPL is a huge problem for me. The language mixes in some good ideas from Haskell and Clean. The tutorial comes off as sort of condescending towards Prolog users and fans though. Having to furnish modes and effect types is a bit of a burden.
Allegro is a pretty compelling product, but when I want to do Prolog, I want to do Prolog. core.logic in Clojure seems like it would be more interesting to me, because Clojure is enough better than Common Lisp. I believe core.logic is based on miniKanren, which is also interesting.
The Prolog implementations I sometimes wish I knew more about are B-Prolog, YAP and XSB. But I don't really have the kinds of performance problems that would benefit from tabling or a more sophisticated compiler.
Yeah, that's a great tutorial to the language, I learned a buttload from that when I was doing my degree. Not to look down on Learn Prolog Now! and others, but this is how to teach Prolog to university students.
Note: Your alias is hilarious. Nice one.
I'd like to revisit prolog, I think it is an underused language in industry.
If SICStus went open source or free for academic use, I would probably use that in my research/courses over SWI Prolog. Mostly because of familiarity, performance, and compatibility reasons.
http://www.let.rug.nl/vannoord/alp/Alpino/
Prolog has some nice advantages for such knowledge-based language processing:
- With relatively little work, terms can be used to represent linguistic feature structures. You can build a small type system using meta programming and define operators on feature structures.
- Unification can be used build larger structures, check syntactic constraints, etc.
- Backtracking makes handling ambiguity in parsers/generators much easier
There are two quite elaborate chapters in my PhD thesis about the system mentioned above and the generator:
http://danieldk.eu/Research/Publications/phd-thesis.pdf
Though for the time being, I am working on dependency parsing using deep neural nets (like everyone else ;)).
My house might burn down haha. It would be interesting to know a complex, useful, performant application coded entirely in PROLOG that wasn't a Visual Prolog IDE or something. ;) A list of those with what advantages and headaches Prolog gave the developers would be a nice start.
Now I should probably recommend you to play a bit with both approaches and do the same myself.
My classmate used it for his master-degree paper, and I just want to know its status when AI is starting to really catch up these days.
So, if prolog has future, it probably is outside of AI research.
I would say, that verifying is one of the places where logic programming never went away. I.e if you ever wanted to write type checker of protocol verification, you might write an embedded prolog first.
Prolog and erlang are not the same, or even particularly similar. Some features (such as unification, which is what erlang uses, not assignment, with the = symbol) are present, and inspired by, prolog. But the underlying computational models aren't the same. Erlang is functional/concurrent/procedural (procedural meaning you write an explicit sequence of steps). Prolog is functional/declarative. You don't (normally) write explicit steps. Rather, you describe the solution you want to find, describe the configuration of a system (essentially propositions and axioms), and let prolog search for your solution. You can do a lot more than that with the operators (declaring order of execution, terminating early, etc.), but the underlying computational model is this search. You would not use them for the same domain.
You can because they're both turing complete and thus capable of expressing the same computations. You won't because erlang excels in its concurrency model (and performance with many concurrent processes), and prolog excels in its declarative/search model. I believe there are some other languages (Oz/Mozart?) that might be suitable if you want a hybrid of erlang's concurrency and prolog's declarative model.