Using Prolog - Overview

KEY The Emas Prolog system offers the user an interactive programming environment with tools for incrementally building programs, debugging programs by following their executions, and modifying parts of programs without having to start again from scratch. The text of a Prolog program is normally created in a number of EMAS files using one of the standard text editors. The Prolog interpreter can then be instructed to read-in programs from these EMAS files; this is called "consulting" the file. The text editor can be called directly from within Prolog, and it can be arranged for the file to be consulted or re-consulted when you leave the editor and return to Prolog. Re-consulting means that definitions for procedures in the file will replace any old definitions for these procedures. Using the editor in this way makes it easy to incrementally develop, debug and then correct Prolog programs without ever leaving the Prolog system. It is recommended that you make use of a number of different files when writing programs. Since you will be editing and consulting/re-consulting individual files it is useful to use files to group together related procedures; keeping collections of procedures that do different things in different files. Thus a Prolog program will consist of a number of files, each file containing a number of related procedures. When your programs start to grow to a fair size, it is also a good idea to have one file which just contains commands to the interpreter to consult all the other files which form your program. You will then be able to consult your entire program by just consulting this single file. More about how to do this later, though.