This is the archived website of SI 413 from the Fall 2012 semester. Feel free to browse around; you may also find more recent offerings at my teaching page.
Created by French researchers in 1972. Prolog represents yet another major programming paradigm, logic programming. In this paradigm, programs are expressed as facts and rules, and a program is essentially a proof of a stated goal, using first-order predicate logic. This is a declarative language that lends itself to simple yet brilliant programs for many tasks, shifting most of the work from the programmer to the compiler or interpreter.
You should probably use the interactive program
gprolog in development. However, for testing your code,
I will use the GNU Prolog compiler program
described below. In order for this to work, you must declare
an initial goal, with a line of the form
For example, in the 99 bottles program linked above, this line would be
(Of course, the trailing period is crucially important.)
Save your program in a file called
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
For this language, you need to implement modifications A, B, D, and G. See the Phase 1 page for details on what this means.
See the Phase 2 Page for the list of suggested
problems. Of the ones listed, I recommend the following as being most
well-suited for Prolog: