Homebrew is a command-line package manager for Mac which makes it much more simple and straightforward to install all sorts of things from and on the command line. If you're using a Mac as I do then I'd highly recommend installing Homebrew if you haven't already.
How can I get (SWI-)Prolog up and running on my computer?
Note that although different Prolog implementations share the same syntax and semantics, they can differ greatly in terms of the built-ins and libraries provided so Prolog programs are generally not fully portable between implementations. There is a free online version of Learn Prolog Now! which is a great book for beginners wanting to get started on SWI-Prolog, one of the few (two?) widely-accepted major Prolog implementations, SICStus Prolog being the other one. It took me about a week and a half to learn the basics of Prolog programming which is just a bit short of 12 days, hence the title ) How long did it take you to learn Prolog? Although nowhere near as influential as C, Prolog has influenced a number of notable programming languages including Clojure and Erlang. It was originally designed with natural language processing in mind but currently also finds use in other fields such as Artificial Intelligence. In contrast to C which is highly imperative and procedural, Prolog is a predominantly declarative programming language (with a few procedural elements) based on Horn clauses, a Turing-complete subset of first-order predicate logic. The Prolog programming language first appeared in 1972, making it as old as the infamous C programming language. Nevertheless, the meme prompted me to try out Prolog to see what the fuss was all about. The post also reminded me that the professor delivering the discrete math course I was enrolled in back in September also briefly mentioned Prolog when introducing the famous logical puzzle known as the Zebra Puzzle / Einstein's Riddle (more on that later) but then explicitly stated that Prolog was not required for the course (guess I was lucky :p) so I subsequently forgot about it.
So, it all started when someone posted the following meme in a Facebook Computer Science meme group I was in about a week or two ago:Īs I learned from the comment section of that post, quite a few Computer Science programs across various universities require their students to learn the Prolog programming language, usually in a discrete math course, and that students generally find it to be a rather unpleasant experience.