Graphical Programming Server

The Graphical Programming Server allows you to write programs by composition of generic procedures that are specialized for your data structures. This document tells how to use the interactive graphical interface to specify the program you want.

When you start the Graphical Programming Server, it creates a window containing an input area and a command menu:

Select Output Language

The first thing you should do is to select the Language for the program that is to be created (default is Lisp). Click on the Language button in the Commands menu and select the desired language from the menu. The available languages are Lisp, C, C++, Java, and Pascal.

An Easy Example

There is a built-in example data structure: an assembly, which has a linked list of parts. Suppose that you would like a program to add up the weight of all the parts in an assembly.

First click on Language and select the desired language. Then click Program; position the box, then select ASSEMBLYC and PARTS. Position the small box to the left of the larger box. Click on the Acc button of the larger box, then select SUM and WEIGHT and position the box to the right of the larger box. Then click Done.

Describe Your Data

A few example data types are defined; you can use these for testing if you wish. An assembly (assemblyc for languages other than Lisp) has a name and a linked list of parts. A part (partc for languages other than Lisp) has a string name, an integer size, a float weight, a Boolean flag pretty, and a link pointing to another part. A part also has a linked-list view predefined.

It is also possible to define your own data structures, as described here. Click the mouse in the input area (the empty box), then enter the description of your data; the input editor is an Emacs subset. After the description of your data structure is complete, click the mouse outside the input area; the system will respond with a confirming message. Repeat the process as needed to define other data types.

After describing your data, you may want to make a view of your data structure as an abstract type; this is described here.

Select a Program

At the present time, there is only one program, Iterate-Accumulate. This will be selected automatically when the Program command is clicked.

Select Input

Iterate-Accumulate iterates over a sequence of items, accumulating something from each item. After the Iterate-Accumulate box has been positioned, the system will present a menu asking for the input data type. The built-in type assembly (or assemblyc) can be selected, or a user-defined type name can be entered.

After the inpuut type has been selected, the system will ask for selection of the sequence over which to iterate. The assembly type has two sequences: the name (a string, which is a sequence of characters) and the parts, a linked list of part records.

Select Accumulators

If the user has selected assemblyc as the input and parts as the sequence, the screen image will look like this:

The next task is to select one or more accumulators to accumulate something about the parts. Click on the Acc button of the ITER_ACC box to add an accumulator. The system will present a menu of accumulators. Many of the accumulators are fairly obvious; Find-Update and some other accumulators are described below.

Specifying What is Accumulated

After an accumulator has been selected, the system will present menus to ask for the input to the accumulator. For example, if SUM is selected, the system will present a menu of things about a PART that could be summed, such as the WEIGHT.

It is also possible to accumulate the values of some expression, similar to the process described below for specifying a test. There may be other things about the accumulator that can be specified, e.g. the INITIAL-VALUE of a SUM.

Specifying a Test

It may be desired to accumulate items only if they pass some test, e.g. to SUM the WEIGHT only when the SIZE is greater than 3. To specify the test, click on the left button of the SUM box and select TEST.

The TEST can be specified in several ways:

An abbreviated form of the test will be displayed in the window.

Find-Update and Data Structure

Find-Update is an accumulator that finds an item in a database (using the KEY feature of the item), inserting the item if it is not present in the database. Then the information related to that key (one or more accumulators) is updated.

When Find-Update is selected, the system will first ask for the KEY to be used; this key must be compatible with the database that is chosen.

Accumulators can be added to the Acc button of Find-Update. In addition, a database must be selected for the Storage button of the Find-Update box.

Gordon S. Novak Jr.