This is only a demonstration copy of MacProlog32, and is subject to the following restrictions.
- You may only have up to 6 program source windows at any one time.
- You may only have up to 6K of text in any program source window.
- You may not save object code.
(The full MacProlog32 system allows an unlimited number of program windows, with up to 32K of text in each.)
There is no Optimizing Compiler or Debugger in this Demo version.
If you wish to run MacProlog from your hard disk, create a new folder and simply drag the contents of this Demo disk into the new folder.
This "Read Me" file gives a very brief introduction to a few of the facilities of MacProlog32.
Running MacProlog32
===================
Double-click on the "MacProlog32 Demo" application file, or drag one of the example programs onto the "MacProlog32 Demo" application file.
The file "MacProlog Boot" contains the compiled Prolog code for the MacProlog programming environment and will be automatically loaded by the system.
Similarly the "Graphics Boot.PC" file (containing the Graphics environment) and the "Callgraph Boot.PC" file (containing the Call Graph code) will be automatically loaded as needed.
Note that you can increase MacProlog's application memory using the "Get info" dialog in the Finder.
Program Windows
================
The current windows are listed in the submenus of the "Desktop" menu. The "Program" submenu shows all the program source windows, with visible ones being marked with a diamond.
Selecting a window from any of these submenus brings that window to the front.
To create a new program window, select "New..." from the "File" menu. You may type Prolog source code into this window, compile it using "Compile" in the "Eval" menu (with the program window at the front), and save it using "Save" or "Save as..." from the "File" menu (again, with the program window at the front).
To kill the window, select "Close" from the "File" menu. (Clicking in a program window's "close box" hides the window but does not kill it.)
(To kill any other sort of window, select "Kill" from the "Windows" menu.)
Queries
=======
Queries may be evaluated either by using the "Query dialog", or by typing into any text window.
The Query dialog may be invoked by selecting "Query..." from the "Eval" menu. Type a Prolog query into the first edit field, and then click the "First" button for the first solution, followed by the "Next" button for subsequent solutions. Alternatively click the "All" button for all solutions. The solutions appear in the lower text field.
A query may also be run by typing the Prolog query into the "∑ Output Window", and pressing the "Enter" key.
Prefixing the query with :- gives just one solution, and prefixing the query with ?- gives all solutions.
Placing the text cursor on a line of text in any text window and pressing "Enter" will read that line of text and run it as a Prolog query.
Loading programs
================
To load any of the supplied example programs, select "Open..." from the "File" menu, and choose a file from the file dialog.
A "program" may comprise a number of program windows (a MacProlog "work" file), or a single text window (a MacProlog "text" file).
When a file loads, its source text will be automatically compiled and its initialisation programs run. You will normally see the program edit windows appear and a status box giving information about the compilation. You can hide any program window (without deleting it) by clicking the "close box" in the top left hand corner.
A file may be closed by selecting "Close" from the "File" menu when any of the file's program windows is at the front. This deletes all the windows and code belonging to the file.
NOTE In this demonstration version of MacProlog32, if you try to load a file which would result in there being more than 6 program windows, you will be told that you cannot load that file. If you close all existing program windows you may then be able to load the file.
If you try to load a file which contains a window with more than 6K of text, you will be told that you cannot load that program.
Call Graph
=========
The "Call Graph" option in the "Search" menu will generate a graphical display of the call structure of any currently defined Prolog predicate. Select a predicate name in a program window and select "Call Graph".
(The "Callgraph Boot.PC" file will be automatically loaded.)
Example Programs
=================
Remember that in this demonstration version of MacProlog32, because of the restriction on the number of program windows allowed, you will normally have to close one file before loading another.
Meals Demo32
-------------
This program is a database of meals. A new menu "Choice" will appear in the menu bar from which you may select a type of meal.
Parser Example
--------------
This is a simple example of parsing English sentences. Select "Sentence..." from the "Parse" menu, and enter a sentence in the edit field. For example, type in
the boy likes the small girl
You may view (or change) the various program source windows for the words the parser recognises.
Ctrl Win egs
-----------
This demonstrates MacProlog's "Control Windows", which are similar to dialogs but offer more flexibility. Each program window in this file contains information about its source code.
Graphic Editor32
----------------
This demonstrates the graphic capabilities of MacProlog32. The program is written entirely in MacProlog, and shows a "Graphic Editor" graphic window with MacPaint-style tools. Three extra menus appear whenever this window is at the front, allowing you to change the fill and pen patterns and colours, etc.
In this example the file "Graphics Boot.PC", containing the Graphics package, will be automatically loaded when needed.
Note: Before closing the file "Graphic Editor32" you should first kill the "Graphic Editor" graphic window (using "Kill" from the "Windows" menu). This is because once the file is closed there will no longer be any definitions for the graphic window's tools and pictures.