[Previous]   [Next]   [Contents]   [Index]   [Books]   

Global Concepts

This section describes essential programming techniques that characterize the AI. There are techniques which have a large impact on the AI structure as well as on the linked application program, for example, tree scanning or vector algebra.

The functionality needed to support these concepts may look different in the various AI modules and is described in the appropriate sections.

Context Free Procedures

The philosophy behind the AI is to offer context free procedures. This principle allows you to selectively use the AI functionality without having to call a lot of other routines in advance. However before calling a function the proper environment should be made available, for example, by initializations.

AI Communication to Programming Languages Other Than C

The AI is implemented to support explicitly the C programming language. C is the common denominator on UNIX systems and it is also widely used on other operating systems (for example MS-DOS). Some applications to be integrated into ME10 might be implemented in, for example, FORTRAN or PASCAL. For these languages it is easy to implement a bridge to the C implementation of AI. Interfacing routines have to be defined to map the FORTRAN/PASCAL procedures/data structures to the corresponding C procedures/data structures.

(UNIX-Based Systems: Refer to the HP-UX manuals for details of writing interfacing routines.)

Tree Scanning

The term tree scanning refers to a method to separate the necessity to traverse the nodes in a data structure from the operation to be done on the nodes.

A tree scanner takes a user-defined function and calls it whenever the scanner finds an appropriate node in the data structure.

The type of the nodes traversed as well as the information about found nodes, which is passed to the user, depends on the type of the tree scanner.

Tree Scanning Versus List Creation

The traditional method of dealing with different nodes in a data structure is to put selected nodes into a list. This list has to be processed in a second pass and finally it has to be deleted in a third pass.

In cases where such a list has to be processed only once, tree scanning is much faster since there is no need for creation, deletion and scanning of lists.

In cases where a list is necessary, because the data are to be used more than once, tree scanning is as fast as the traditional method. The only action of the tree scanner is to create a list in this case.

Naming Convention

The AI routines will have a prefix me_ (for example, me_add_node).

This helps in differentiating CoCreate provided routines from other ones.

It is recommended not to use the prefix me_ for non-CoCreate routines.


[Previous]   [Next]   [Contents]   [Index]   [Books]