next up previous
Next: Compiling a program Up: No Title Previous: Loading a Prolog program

Writing a Prolog program

To write a new program or add clauses into an existing one, type the source text into a program edit window and compile it. The edit window can be obtained by selecting New from the File menu at the top of the screen. The program is compiled by selecting the Compile option from the Eval menu, also at the top of the screen. If there is more than one window on the screen and the required one is not active, it can be made active (indicated by the highlighted title bar) by clicking the mouse button on the window concerned.

If a new program window is required for an opened file, select the Work files option from the File menu; a sub-menu is shown on the right - slide the mouse and select the Add new window... option. A single dialog box allows you to name the new window and associate it to an existing opened file (select the desired file and click the Create button).

To destroy a program window, select either Close from the File menu or Kill window ... in the Work files sub-menu.

Note that the default in MacProlog32 is for different clauses of the same relation to be defined in the same window. It is not required for such clauses to be defined consecutively, but it is more convenient for debugging purposes if they are kept together. Once you are more familiar with the environment you may alter this default to suit particular needs, but for the time being you are advised not to.



Omer F Rana
Thu Jan 23 16:35:21 GMT 1997