Skip to content

Appropriate use of APL for Artificial Intelligence

Vector 5:2, page 56

expert systems and AI

Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 56

I have been working on Expert Systems projects in British Airways for the last 2 years using a mixture of PROLOG, C, and PC-based shells. Since my previous background was as an APL programmer I have kept a close watch on whether APL has anything to offer the AI world. This article is intended as a summary of my opinions in the light of the recent conference workshop “APL Techniques in Expert Systems”.

The amount of AI work taking place in the APL community is now pretty large – the conference material overflows a large lever-arch file such that the total library of APL/AI papers now covers 3 volumes. However most of this work is still research with only 5 systems that I would call successful. Nevertheless the conference has further convinced me that APL could be a good choice for working in the following areas:

  • Uncertainty applications such as risk analysis can benefit from APL’s arithmetic capabilities. Most research has concentrated on how to produce a variety of fuzzy logic functions [8][9]. An interesting alternative is Hagamen’s approach in MEDCAT where ‘conclusions’ are only fired when the combined effect of the ‘conditions’ rises above a certain threshold [2][3].

  • Natural language. Hagamen has demonstrated that APL can produce effective natural language input and output provided the discourse is kept within a limited specialism [3].

  • Neural networks. These learn to recognise patterns in complex data and may have applications in computer vision, speech recognition, and forecasting. APL seems a natural choice since these models work by manipulating numeric arrays thousands of times over. Parallel processors are eagerly awaited by neural net researchers – a suitable interpreter would be able to use APL’s inherent parallelism without any need to change the source code.

  • Embedded intelligence. APL has proven itself as an excellent tool for MIS, DSS, and OR building. The use of APL could eliminate the need for data extractions, file downloads, or complex memory linking in applications where the ‘intelligent’ part must be well integrated into a larger whole. The benefits could be particularly marked in an application requiring complex data manipulations or hefty number crunching. This is IBM’s reason for using APL in the LMS system at Burlington [4].

Rule-based systems

For embedding intelligence into new systems or adding intelligence to existing systems the simplest technique, if appropriate, is to represent expert knowledge as rules. Rule-based systems are fairly straightforward to build in APL. Rules would be typed-in via a full-screen interface using an English-like syntax and converted into an internal format. The two most promising internal formats are: (a) a list of rules each of which would be an executable APL statement or (b) a set of Boolean tables relating conclusions to rules, rules to conditions, conditions to objects etc. The first approach is easier to program but the second should be more efficient [5].

Success Stories

RESEDA

Interestingly this system dates back to at least 1979 and was written in old-fashioned VS APL. It was developed under Zarri at the French Centre National de la Recherche Scientifique and is used by historians for querying a database of biographical information. The query obtains not only information which was directly introduced into the database but also implicit information found using inferences. The historian’s inferencing rules take the form:

<general observation> BECAUSE <possible explanation>

For example (in natural language): “One might take a particular attitude in an argument because one has close links with one of the parties in a conflicting situation.” For further details on the (rather complicated) methodology behind RESEDA please see the reference [1].

MEDCAT

Bill Hagamen is a neuro-physiologist at Cornell University Medical College with some particularly clever innovations for computer aided teaching systems. MEDCAT is a MYCIN-like system aimed at sharpening the diagnostic skills of medical students. It has 4 modes of working: diagnosis, consultation, teaching, and learning.

The diagnostic mode uses forward chaining adding up numbers received from stimulus nodes and firing conclusions when they rise above a certain threshold. The consultation mode uses backward chaining to explain conclusions. The teaching mode runs in a stepwise fashion through the forward chainer but instead of showing conclusions it asks the student for their diagnosis: if the student’s logic is inconsistent or incomplete it asks them some probing questions until any misunderstandings are resolved. In learn mode MEDCAT is able to learn from experts, incorporating knowledge about a new or wrong diagnosis. To make all this even better the dialogue is via natural language with responses given in a matter of seconds [2][3].

CATS
is another Hagamen teaching system but this time for anatomy. It shares many features with MEDCAT but looks more like a ‘semantic net’; there are no threshold values to the inferencing mechanism. The natural language interface is quite clever. Synonyms and spelling mistakes are accepted as input but responses are always given using the strict anatomical terminology. If the question contains an ambiguous word the system tries to look at the context before asking for clarification. Questions are not isolated but depend on what has gone before; for example pronouns refer to the last mentioned object of an appropriate type to fit the verb. The question “Why?” does not restate the facts but examines the knowledge base to infer ‘rules of thumb’ which might explain things in a more general sense [3].
?
developed by Stephen Jaffe at Mobil Research to help geologists determine the existence of Submarine Fans and hence oil. It has the same feel as a diagnostic expert system built using a PC-based shell. Rules are held internally as executable lines of APL such as 35 IF (NOT P 33) AND (OR/ P 30 31 32) AND (10 < D 6)
LMS
Logistics Management System developed by IBM at the Burlington manufacturing facility and reckoned to save IBM several million dollars every year. LMS is described as “an implementation of continuous flow manufacturing principles using the power of knowledge based expert systems and drawing on the fields of industrial and manufacturing systems engineering, computer networking, window interfaces, data engineering, operations research, statistics, and rule, object, and function based programming paradigms. …LMS is now a critical component in running major areas of the manufacturing facility, and critical for future successful plant operation” [4]. Implementation details of LMS are not given but the chief architect for LMS has written several papers on coding the traditional AI paradigms in APL [5][6][7].

Conclusion

Products purpose-built for AI work will always be better than APL at the tasks they were designed for. Neuron Data’s ‘Nexpert Object’ will beat APL for frame-based object hierarchies, Intelligent Environment’s ‘Crystal’ will beat it for rule-based programming, and PROLOG will beat it hands-down for logic programming. APL has something to offer the AI purist where the purpose-built tools are at an early stage of development. Uncertain systems, natural language, and neural nets are examples of these. Reproducing the functionality of existing AI tools in APL will sometimes be justified where a hybrid MIS/DSS/OR system requires a relatively small amount of embedded intelligence.

References

  1. Using APL in an AI Environment: a Knowledge Engineering System Dealing with Biographical Data. G Lee, R LeLouche, V Meissonnier, G Zarri
    APL 82 conference proceedings
  2. Medcat: an APL Program for Medical Diagnosis, Consultation, and Teaching
    W Hagamen, M Gardy, G Bell, E Rekosh, S Zatz
    APL 85 conference proceedings
  3. Associative Semantic Processing. W Hagamen, P Berry, K Iverson, J Weber
    APL Techniques in Expert Systems (SigAPL 1988)
  4. Logistics Management System: Continuous Flow Manufacturing using Knowledge Based Expert System (KBES). G Sullivan, K Fordyce
    APL Techniques in Expert Systems (SigAPL 1988)
  5. An Efficient Algorithm for Rule Based Production Systems using Boolean Arrays and Functions as an Alternative to Tree Structured Networks
    K Fordyce, G Sullivan
    APL Techniques in Expert Systems (SigAPL 1988)
  6. Object Programming: a Brief Review of What it is and Why it is Useful
    K Fordyce, G Sullivan
    APL Techniques in Expert Systems (SigAPL 1988)
  7. APL and Expert Systems. J Brown, E Eusebi, K Fordyce, G Sullivan
    APL Techniques in Expert Systems (SigAPL 1988)
  8. Mapless and Uncertainty. D Bonyun, G Jones
    APL Techniques in Expert Systems (SigAPL 1988)
  9. Fuzzy Rule Based Expert Systems. A Geyer-Schulz
    APL Techniques in Expert Systems (SigAPL 1988)