Information Technology Reference
In-Depth Information
With Mac OS X
To install SWI-Prolog under Mac OS X, begin by downloading an installation package
from http://www.swi-prolog.org/download/stable/ . You will need to know which
version of Mac OS X you are using (which you can see by selecting “About This Mac”
under the Apple menu): 10.4 (Tiger), 10.5 (Leopard), 10.6 (Snow Leopard), or later.
Then follow the installation instructions. (Note to experts: If MacPorts is installed,
SWI-Prolog can be installed from there. Either way, the SWI-Prolog binary will be
installed as /opt/local/bin/swipl .)
With Linux
The SWI-Prolog binary comes preinstalled on some Linux systems. If so, you are
in luck as there is no easy way to do the installation. There is an RPM file at
http://www.swi-prolog.org/download/stable/ , but it may not be right for your
system. There are sources online, but if you have never installed a Linux program
from sources before, you will definitely need help.
B.2 How to load SWI-Prolog programs
Once you have installed SWI-Prolog, you are ready to use it with some Prolog pro-
grams that you have written yourself or downloaded and saved on your hard drive.
For example, assume you have saved the file family.pl (figure 3.1). This program is
available on the topic website (see appendix A) and will be used here as an example.
With Windows
Once SWI-Prolog has been installed on a Windows system, any file whose name ends
with .pl (such as family.pl ) will be known to the system as a Prolog program.
You can double-click the file, and this will start SWI-Prolog and automatically load
that Prolog program. It is therefore unnecessary to use the square bracket notation
to manually load the program, as done in figure 3.2. (However, additional Prolog
programs in the same folder as the file can be loaded with the square bracket notation
as required.) When you are finished with Prolog, close the Prolog window to exit.
 
 
Search WWH ::




Custom Search