You should probably use the interactive program
gprolog
in development. However, for testing your code,
I will use the GNU Prolog compiler program gplc
, as
described below. In order for this to work, you must declare
an initial goal, with a line of the form
:- initialization(INITIAL_GOAL_HERE).
For example, in the 99 bottles program linked above, this line would be
:- initialization(drink(beer,99)).
(Of course, the trailing period is crucially important.)
Save your program in a file called proj.pl
in folders called proj1
and proj2
respectively for phases 1 and 2 of your project.
I will test your code in the same environment as the lab
machines in MI 302, using the commands
/usr/bin/gplc --no-top-level proj.pl ./proj
Details on the requirements for phase 2 of your project will be posted here.