The root directory for GNU prolog is /usr/local/gprolog/gprolog-1.2.13/, and you
don't want to refer to this directory in your command each time your use
prolog. So it is better for you to add a couple lines in your Unix environment
to tell Unix shell to search this directory for GNU Prolog command. Adding the
two lines below into your .cshrc at your home directory would solve the
problem.
open the file .cshrc (notice: Since it is a hidden file, you will be able to
see it using 'ls -al' command). Just use any text editor to open up this file.
For example 'pico .cshrc'
Fig 00
Add the following lines in .cshrc
set path = ( /usr/local/gprolog/gprolog-1.2.13/bin $path)
set path = (/usr/local/gprolog/gprolog-1.2.13/lib $path)
save .cshrc and exit (ctrl+X) the editor
Fig 01
In Unix command prompt, type "source .cshrc" and let the new path be effective.
Next time you login the Unix machine, this path will be effective
automatically. Now you are ready to use GNU-Prolog.
There are two types of mode for running GNU-Prolog
Interpret mode
type gprolog to enter the interpret mode of running GNU-Prolog
Use buit-in predicate consult to load the Prolog Program
for example
?consult('family.pl').
type in predicates with arguments to test your program
use built-in predicate halt.to quit
Fig 02
compilation mode
type gplc filename to use the compilation mode
type ./filename, it will load the prolog runtime and the
program automatically
type in predicates with arguments to test them
Use halt.(don't forget the dot at the end) to quit