XGP is an integrated development environment the extends gprolog to work with Cocoa under Macintosh OS X (10.6). It extends gprolog with builtins predicates for dialog, menu, and graphics facilities.
gprolog (GNU Prolog) is primarily the work of Daniel Diaz, It is a largely ISO standard-compliant Prolog, extended with constraint logic programming. It runs on many platforms. The Mac OS X port of gprolog was created as the first step toward XGP (including creating a fink package for this port). XGP relies on patching version 1.2.19 for the PowerPC CPU and version 1.3.2 for the Intel CPU, which are only available from the main site (http://gnu-prolog.inria.fr). The SourceForge site (https://sourceforge.net/projects/gprolog/) does not carry the most recent versions.
Logic Programming Associates (LPA) has been a commercial Prolog vendor and provider of programming services for many years. They created an excellent Prolog implementation for the Macintosh, culminating in MacProlog32. They have stopped actively maintaining MacProlog32. MP32 runs under Mac OS 7.x to 8.5, and under some configurations of 8.6 and OS 9. It does run under Mac OS X 10.x in classic mode on some systems.
This project provides a migration path to Mac OS X for legacy MacProlog32 programs.
- Executes GProlog from a Cocoa Mac OS X application.
- Compatible with Mac OS X 10.6 ("Snow Leopard").
- Program editing support including:
- Predicate definition location menu: this lists the predicate defined in a document and can be used to select and display the source for any predicate definition in that document
- Current line field: this shows the line number of the beginning of the current selection. It is editable: a number entered in this field changes the selection to that numbered line of the document.
- Syntax coloring: a document window has its text colored according to syntactic categories after the document is 'consulted'. The supported categories are: comment, strings, operator, and number.
- Connects GProlog input and output to document windows within the XGP application.
- Collections of Prolog predicates built in to XGP/GProlog
- Menu management, including hierarchical menus and popup menus. Selecting a menu item calls a Prolog predicate with that item's name as functor and no arguments. All of the menus of the XGP IDE are implemented in prolog.
- Dialog management, including simple predicates supporting various types of dialog interactions.
- Control window managment. A control window is an XGP window in which a wide varietly of controls (e.g. button, text field, scrolling menu) may be placed. The dialog management mentioned above is implemented using control windows.
- Graphics, including predicates to create a graphics document and add pictures defined using LPA's Graphics Description Language (GDL).
- Files. Various predicates for working with the file system, including 'loading source' (opening a source document) and 'optimizing files' (compiling a source file to a WAM byte code file, suitable for loading into XGP).
- Persistent Values. Support for global variable, property list, and user default mechanisms.
- The IDE supports a Scripts menu for easy extension with simple operations.
- The menus and dialogs of the IDE are implemented in prolog using the above builtins. This implementation can be changed by editing a single file ('initialize_environment.pl') without modifying or re-compiling XGP. This allows the XGP user to extensively tailor the environment (while working completely in prolog). Also, this is the foundation of XGP-based "double-clickable" applications.
- Automatic consulting of source file after opening and automatic consulting of changed open source file documents before evaluating a query.
- Standard Prolog debugger (trace, spy, etc.), as implemented by gprolog.
The executable application:
version 1.0.0 for the PowerPC Macs, based on GProlog version 1.2.19.
version 1.2.0 for the Intel Macs based on GProlog version 1.3.2.
XGP is a prolog development environment supporting consulting and loading of programs, evaluation of queries and input and output with application documents.
There are aids for editing Prolog programs: definitions popup, current line number, syntax coloring.
There are API collections of builtin predicates for working with menus, dialogs, "control windows", graphics, files, and persistent values.