The $PATH of logic

Boy, this is going to be a short post. I recently installed the current stable version of SWI-Prolog, which is a free version of Prolog: the general purpose logic programming language. I installed it on OS X version 10.9.1, but thereupon found that the command line binary is not added to any directory for such binaries that existed in my system’s $PATH variable at the time. (It’s okay to be confused by that sentence.)

So here I now demonstrate my solution to this problem. My reason for sharing this is far less altruistic than you might think: I simply have a short memory and writing it down on my blog is just a convenient way to have access to that information in case I should need it again. But I do hope that perhaps people who have faced the same problem—people so unbelievably desperate for a solution that they would be willing to try *anything*—will also find the information I present here of some use and/or amusement. Probably more the latter than the former.

The solution is trivial and probably not the best way to do it. But the same can be said of the utility of toilet paper, and untold millions use that every day, so there you go. You need to add the path to the SWI-Prolog binary in your $PATH variable. One simply opens a terminal and changes directory into /etc/paths.d. Then you execute sudo nano SWI-Prolog in the terminal (this starts the nano text editor and creates a file called ‘SWI-Prolog’ in your current directory) and add the line /Applications/ Next, one saves this file by pressing ctrl+x and selecting ‘yes’ when the editor asks for confirmation.

If all went well, you can now start a new SWI-Prolog session within any new terminal window (so first close and re-open your terminal) by simply entering swipl in the command prompt. Live long and prosper!

Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *