Website van Eke van Batenburg


Various APL applications

After learning that APL is a programming language, one of the most frequent questions to me is "where is it used?". This page will give an answer to that question by short summaries of various APL projects.

APL is used over a wide spectrum of applications, varying from prototyping, administration, to science in a great variety of applications, varying from record keeping to mathematical applications such as actuarial use. Some examples are...

  • manufacturing resource planning by Bristol-Myers (AP86).
  • socio-economical models at the Academy of Sciences in Moskow (AP91).
  • checkout of the space shuttle at NASA (CA91).
  • prototyping at Dept of Defence (who eventually requires ADA code); for example algorithms for missile detection and for SDI's Boost Surveillance & Tracking System (AP93).
  • CAM (Computer Aided Manufacture) of various products for example golf clubs at Boston university (AP91).
  • statistical analysis by everyone who uses Statgraphics, one of the best statistical packages.
  • expert-systems, genetic algorithms and neural networks at IBM softechlab in Madrid (AL91).
  • computation of recipes (Kit-a-Kat), product planning and many other things at Rowntree (AP91).
  • actuarial computations all over in Holland, but particularly at Leuven actuaries.
  • design and production of audio equipment at Bang & Olufsen.
  • expert systems for chemical analysis by Institut Quimic de Sarria Barcelona (AP89).
  • animation of "the Bit" in the movie Tron (CA91).
  • ray-tracing in CAT scans at the German Center of Cancer Research (AP89).
  • computation of daily produce of beer at Heineken.
  • research and development in biotechnology at Novo Nordisk Denmark (AP89).
  • modern compositions programming Midi ports by Stanley Jordan (AP89, AP91).
  • operation Desert Storm; the whole logistics of supplying 2.5M ton military equipment, 5.7M ton fuel, 0.75M ton food, clothing tents and 485000 persons was planned, simulated and orchestrated by APL, calling Cobol & Fortran subroutines (IE91).

Some years ago Quote Quad, the journal of the APL Special Interest Group of ACM (SIGAPL of ACM) started a column "WhatsWhere" with succinct descriptions of APL projects. Upto now the following projects were published.

  1. J for exploration of speciation
  2. APL for description of Computer Architecture
  3. Employee Benefit Statement
  4. Mortgage Cash Flow Analysis
  5. Energy balance in arctic mammals
  6. Prediction of RNA secondary structure
  7. Portfolio Optimization Using Simulated Annealing Techniques
  8. CAFCA (a Collection of APL Functions for Cladistic Analysis)
  9. Studying behavioural tendencies with the Cox proportional hazards model
  10. Why snails are right
  11. Determining Adequacy of Reserves
  12. Time-Critical Administration
  13. Budget Management for Healthcare
  14. Sheet metal estimating for the HVAC contractor & Piping/Plumbing estimating for the mechanical contractor
  15. Boeing Capital Corporation Financial Model
  16. Computing Human Life Value
  17. Keeping hospitals healthy
  18. Covering the Windows API
  19. D2CELL: DB2 to Excel Data Mover
  20. APL in Granular Signal Processing
  21. Implementing an APL OLAP system: The Loan Information System (LIS)
  22. APL code conversion to C
  23. A list-server program in APL
  24. AIS - "Annuity Illustration System"
  25. Circuit Analysis and Electronic Design
  26. Primerica Financial Services
  27. APL based medical image analysis
  28. FTP Client as an APL+Win ActiveX Server Object
  29. GERVA: Secure Electronic Legal Communication with Attributes
  30. When "Cool" applies to Actuarial Software
  31. OpenHere site
  32. Genetic algorithms and cellular automata
The following paragraphs will give a little more details about each of these projects. In each header we give a tentative description of the field for which the application was made.

Pictures 1 t/m 21 © J.McGrew.

Evolutionary research:
J for exploration of speciation
by: Eke van Batenburg, research scientist of Institute Theoretical Biology, Leiden, Holland

Taxonomists agree about 2 mechanisms that cause divergence in traits of a former homogeneous population, leading to different species eventually. One, the environment is similar, but one part of the population focuses on another characteristic than another (sympatric speciation), say eating seeds that requires a heavy bill rather than honey that requires a long light bill. Or the environment changes locally and the organisms there adapt and gradually grow apart from those in the other environment (allopatric speciation).

We developed a simulation program in J to illustrate another mechanism. This alternative is not so commonly accepted among taxonomists. Now the environment changes, but identical for both portions of an homogeneous population. Our program showed that -given a natural barrier that temporarily prevents mixing- one portion adapt differently. Say the trees increases in size and one portion develops long necks and another long legs. Fluctuation of environmental characteristics is essential in this alternative, but the pressure is homogeneous.

This simulation program is now used to investigate what factors determine the permanence of such divergence once the barrier is removed. Knowledge of these factors will provide insight in forming of different species, rather than forming trait-divergence.

More information: Eke van Batenburg, email

QuoteQuad 28(2)13 (©Copyright 1997 by ACM, Inc.)

APL for description of Computer Architecture
by: Eke van Batenburg, Institute Theoretical Biology, Leiden, Holland

Addison Wesley recently published "Computer architecture. Concepts and Evolution" written by G.A. Blaauw and F.P. Brooks jr. (ISBN 0-201-10557-8). This book describes the computer architecture of some 30 important machines. Descriptions are in "human" language as well as in A Programming Language. These APL descriptions are useful first of all to formulate more concise how each machine works, but even more interesting is that it enables one to simulate each of the computers on a PC (later this year a CD will be produced with all APL programs).

Blaauw and Brooks first develop a conceptual framework for understanding computer architecture. Then they describe not only what present architectural practice is, but how it came to be so. A major theme is the early divergence and the later reconvergence of computer architecture. They examine both innovations that survived and became parts of the standard computer, and the many ideas that were explored in real machines but did not survive (and why not). The goal is to analyse and systematise familiar design alternatives, but the book is heavily illustrated with detailed executable APL descriptions of both early and more recent computers.

More information:

  • Addison-Wesley, 1 Jacob Way, Reading, MA 01867-39999
  • Prof.Dr. G.A. Blaauw, Mozartlaan 124, 7522 HP Enschede, The Netherlands
  • Prof.Dr.Frederick P.Brooks, Dept.Computer Science, Sitterson Hall UNC NC27510-3175

QuoteQuad 28(2)14 (©Copyright 1997 by ACM, Inc.)

Insurance/Human Resources:
Employee Benefit Statement
by: J. Karman, Pensionfund Netherlands Broadcasting, Holland

Last year we (Pensionfund Netherlands Broadcasting (PNO)) were asked by one of our major clients to provide an individual Employee Benefits Statement for their 1800 people. From the employee's point of view it is a survey of all his primary and secundary labour conditons. This includes personal data, salary, social security, pensionfund, health insurance and other fringe benefits like training programs, company car, telephone costs and so on.

These data are processed by different institutions and thus most probably by different information systems.

The first problem therefore was: how to collect and streamline the data? The examples we had available from other companies were more or less moderate looking booklets, and far from the DTP-quality we had in mind.

Thus, the second problem was: how to produce 1800 really neat looking 16 page booklets with individual, sensitive data? Once an executive comes with an idea most of the time it has already been simmering for some time, and the very moment he asks you, he preferably wants it yesterday.

The third problem was therefore: how to get it done in time?

To start with the latter: our GM usually thinks of APL when things have to be done fast and reliable. For me it was just a "programmer's delight" opportunity.

The second problem was solved by means of Causeway's DTP-product Newleaf , which is 100% APL. (See also my article in Vector)[1].

Building the "funnel" for the data was a bit of organizing and APL programming. The common format of the fields became ASCII, delimited by the horizontal tab. An APL workspace was created and functions were created for collecting, assembling, converting and re-distributing the data. The results were set on four component files and processed by a domestic APL db-system.
A cover was designed with our logo and with a cut-out little window, giving view to our client-company's logo on the first inner page. The final product looked smart.
We made it as flexible as possible, so that it could be used by other clients as well.
A new standard was set and a new product could be announced.

Reference: Karman, J., Bookbinder's fun, Vector, Vol.13 No.4, April 1997

More information: Jan Karman, email

QuoteQuad 28(2)14 (©Copyright 1997 by ACM, Inc.)

Mortgage Cash Flow Analysis
by: Stephen M. Mansour, Carlisle Group, Scranton.

The Carlisle Group in Scranton, PA develops software which is used in the mortgage industry to analyze collateral data and generate reports. The software known as CAS (Collateral Analysis System) is written in Dyalog APL and is used by several large mortgage companies in the U.S.

Many of these companies need to generate monthly cash flows of large pools of commercial and residential mortgages. These include standard fixed-rate mortgages, adjustable rate mortgages (ARMs), balloon mortgages and interest-only mortgages. These companies often need to project prepayments and defaults on these mortgages using complex mathematical models.

Much of this analysis had previously been done on spreadsheets from data retrieved from a mainframe database. CAS was designed as an analytic database--it handles both standard database functions, e.g. queries and reports, and complex analytics e.g. mortgage cash flow analysis. APL was a natural choice to program both the database and the analysis. The database operations were easy to implement from APL's array-handling capabilities, and the complex cash flow models followed naturally from APL's rich set of mathematical functions.

More information: Steve Mansour, email

QuoteQuad 28(3)3 (©Copyright 1998 by ACM, Inc.)

Energy balance in arctic mammals
by: Nils A Øritsland, Research Scientist, Norwegian Polar Institute Oslo, Norway

One of the directions in ecological physiology of mammals is to study how the physiological constraints of individuals may affect population development. I am using APL as the tool for working on theory and developing models concerned with the energy balance of individuals making up populations of arctic mammals. One of the pertinent set of processes concerns starvation and weight loss that may become lethal.

I developed a model in APL2 for simulating starvation survival and body composition in mammals, and included humans for obvious reasons. The model is expressed by simple difference equations. It showed how the decrement of the speed of combustion of body mass (metabolic depression) increase the survival time dramatically. Both body mass and fat content also affect survival time. Used in analysis of soldiers the model has yielded interesting results.

Reference: Øritsland, Nils A., 1990: Starvation survival and body composition in mammals with particular reference to homo sapiens. Bulletin of Mathematical Biology 52, No. 5, 643-655.

More information: Nils Are Øritsland, email

QuoteQuad 28(3)4 (©Copyright 1998 by ACM, Inc.)

Molecular biology research:
Prediction of RNA secondary structure
by: Eke van Batenburg, Institute Theoretical Biology, Leiden, Holland

At Theoretical Biology of Leiden University APL is used to predict the secondary structure of RNA. RNA molecules are chains of nucleic acids (the primary structure). Some parts glue to other parts forming "hairpins" resulting in a secondary structure. This secondary structure is essential for understanding if/where synthesis starts and ends, why some (industrial induced) mutations are viable and others are not, or why some mutations are only viable when accompanied with a particular other mutation.

The most used -classical- computer program to predict this secondary structure computes all possible combinations of noncontradicting hairpins and chooses the one with the lowest energy as the right solution. We assumed the glueing was a stepwise process in nature such that each formed hairpin immediately excludes other possible solutions. This resulted in a APL program that was not only more often correct than the classical program, but was much faster and needed a PC for hours or days instead of days on big powerful workstations.

Reference: Batenburg,FHD; Gultyayev,AP, Pley,CWA: An APL programmed G.A. for the prediction of RNA secondary structure, J.Theor.Biology (1995)174:269-280.

More information: Eke van Batenburg, email

QuoteQuad 28(3)4 (©Copyright 1998 by ACM, Inc.)

Operations research:
Portfolio Optimization Using Simulated Annealing Techniques
by: Stephen M. Mansour, Carlisle Group, Scranton.

The secondary mortgage market creates portfolios of existing morgages which satisfy certain criteria and sells them to investors. Portfolio selection can be a painstaking, manual process. At the Carlisle Group in Scranton, PA we are automating the process using a new technique known as simulated annealing.

Simulated annealing is physical cooling model used to minimize an objective function over a factorially-large configuration space. The model also does not stop at a local minimum; it will occasionally reverse direction and "go uphill" on its way to find the lowest or minimum point. The objective function combines constraints and objectives specified by the user to find a selection of loans which is closest to a desired target.

Although this is an iterative process and a loop is required, APL is very suitable because the objective function can be built as a dynamic function in Dyalog APL and passed as an operand to a looping operator. Inside the loop, the dynamic function can be called with a different argument each time through the loop until the optimal solution is reached. While the program is running, the user can see how close he is to the target and manually stop it or let it reach a pre-specified target. It runs on a PC under Windows 95 with a GUI (graphics user interface).

Reference: Press, Flannery, Tekolsy and Vetterling, Numerical Recipies, the Art of Scientific Computing, Cambridge University Press 1986 Boender and Romeijn, "Stochastic Methods", Handbook of Global Optimization, Klower Academic Publishers 1995.

More information: Steve Mansour, email

QuoteQuad 28(3)4 (©Copyright 1998 by ACM, Inc.)

Phylogenetic research:
CAFCA (a Collection of APL Functions for Cladistic Analysis)
by: Rino Zandee, Theoretical Biology, Evolutionary and Ecological Sciences, Leiden University, Holland

CAFCA is a Macintosh program for inferring cladogenetic trees. It implements the group- and component compatibility method. In this method cladograms are seen as cliques of sets of terminal and internal nodes (components). In contrast to standard parsimony methods CAFCA does not find cladograms by exploring a search space looking for cladograms that maximise an optimality criterion expressing a property of a cladogram in terms of the characters available, like cladogram length. Instead, CAFCA explores a search space looking for cladograms with maximum resolution given the components available.

Components can be characterised in terms of character states in various ways. They can be defined either as monothetic sets, or based on all possible (semi-)additive binary codings for each character, or through three-taxon-statement-permutations. The collection of cladograms found in this way can be delimited further by applying different optiminimality criteria (CI and RI, AUCC, corrected extra length, compatible character state index).

The program comes with example data files. Documentation is available separately from the CAFCA WWW site either as several files in PDF format (requires Acrobat Reader), or on-line as web-pages.

CAFCA is available for Apple Macintosh (system 7 or later) and PowerMac computers. Although APL is an interpreted language, the program is distributed as a stand-alone executable.

QuoteQuad 29(1)29 (©Copyright 1998 by ACM, Inc.)

Behavioural and ecological research:
Studying behavioural tendencies with the Cox proportional hazards model
by Patsy Haccou, Theoretical Biology, Institute of Evolutionary and Ecological Sciences, Leiden University, Holland

During our undergraduate study (in 1982) me and a fellow student, Lia Hemerik (now at the agricultural university, Wageningen) decided we needed survival analysis for analysing our data on attack risk of cinnabar moth larvae when migrating through ant-infested areas. At that time, no suitable survival analysis software was available, especially since we had time-dependent covariates: one of the cofactors was related to behaviour of the larva.

We decided to write our own program in APL and we used it successfully to analyse the data. Later, I decided to improve the program and make some basic documentation of it for future reference. That proved to be very convenient, since to our knowledge it is still the only program that can account for time-dependent covariates in a very general way. It is still being used by Lia and her colleagues in Wageningen and by Gerard Driessen (population biology, Leiden university) for studying parasitoid patch leaving behaviour.


  • Haccou,P. & Hemerik,L. 1985. The influence of larval dispersal in the cinnabar moth (Tyria jacobaeae) on predation by the red wood ant (Formica polyctena): an analysis based on the proportional hazards model. Journal of Animal Ecology, 54, 755-769
  • Haccou,P., De Vlas,S.J., Van Alphen,J.J.M., Visser,M.E. 1991, Information processing by foragers: effects of intra-patch experience on the leaving tendency of Leptopilina Heterotoma. Journal of Animal Ecology, 60 , 93-106
  • Hemerik,L., Driessen,G., Haccou,P. 1993. The effects of intra-patch experiences on patch leaving tendency, search time and search efficiency of parasitoids of the species Leptopilina clavipes. Journal of Animal Ecology, 62, 33-44

More information: Patsy Haccou, email

QuoteQuad 29(1)28 (©Copyright 1998 by ACM, Inc.)

Evolutionary research:
Why snails are right
by: Eke van Batenburg, Institute Theoretical Biology, Leiden, Holland

At Theoretical Biology of Leiden University APL was used to study chirality of snails. Most snails in the world are right coiled, but some species are left coiled and some even know both left and right coiled individuals. As coiling is based on one gene only, mutations that produce left winded individuals occur frequently in nature, but still right winded chirality dominates all snails in the world. Why left winded snails never catches on for most species and -if left mutations are so transient- is it a constant trait in a few others? Why is the distribution not 50-50, or 100%?

We used simulations in APL to explore the mechanisms that are involved. The process is interestingly complex; the outward appearance is determined by the mother (snails are born from a genetically left mother are left coiled although their genes may be for right coiling), the so-called "maternal effect". This proved to be of minor influence. Nor was the amount of mobility which is necessary to spread 2 mutations important. It appeared that mating success was very important; a mating success of 0.9 had already a fifth of the effectiveness of mating success 1.0. This was very insightful because mating success of different coiled snails is far smaller for snails with bulbous shells. This explains why nature shows more left coiled individuals in elongated snails than in bulbous snails.

Reference: Batenburg, FHD van, Gittenberger, E: Ease of fixation of change in coiling: computer experiments on chirality in snails. Heredity 76 (1996): 278-286.

More information: Eke van Batenburg, email

QuoteQuad 28(2)13 (©Copyright 1998 by ACM, Inc.)

Property/Casualty Insurance:
Determining Adequacy of Reserves
by: Gary A. Bergquist, Zark Incorporated, Hartford, CT, U.S.A.

When accidents occur, insurance companies cough up the money to compensate for the loss to their policyholders. Since the full extent of the loss is sometimes not known for years, the companies must set aside some money today to pay claims in the future for accidents of the past. This money is called "reserves."
If the company sets aside too little in reserves, it will have to dip into future profits and surplus to pay old claims. If they set aside too much, they will have a future surplus that will bolster future profits and book value (at the expense of today's shareholders and policyholders).

Each year, more than a thousand insurance companies send their annual financial statements to the National Association of Insurance Commissioners (NAIC). And each year, the NAIC sends a copy of these statements, on disk, to the anxiously awaiting insurance industry analyst Andrew Zunser. Andrew feeds the data into his APL-based analysis system, which uses a series of sophisticated extrapolation techniques to measure the adequacy of reserves.
In the end, he publishes for his subscribers a set of manuals that describe his findings.

The market for his booklet: institutional investors and insurance companies. In general, companies that are over-reserved have more promising investment potential than those that are under-reserved. Moreover, many insurance companies like to keep close watch on the reserves adequacy of their competition.

More information: Andrew Zunser, email

QuoteQuad 29(4)5 (©Copyright 1999 by ACM, Inc.)

Variable Insurance Products:
Time-Critical Administration
by: Gary A. Bergquist, Zark Incorporated, Hartford, CT, U.S.A.

These days, more and more people are placing their money in investments that are tied to stock market performance, such as mutual funds. When these investments are purchased through insurance companies in the form of Variable Annuities, or Variable Life Insurance, insurance-related tax advantages improve their appeal. The products are called "Variable" because the value of a unit of such an investment (called the "Unit Value" or UV) varies daily in direct proportion to the value (called the "Net Asset Value" or NAV) of the underlying mutual fund.

Each evening when the market closes, the insurance company notes the closing NAVs, re-computes the corresponding Uvs, incorporating daily fees and dividends, and passes along the Uvs to the policy-level administration system. The admin system, in an overnight run, then translates that day's cash transactions (buys and sells) into units via the UV. The net cash and units are summarised by the admin system into distinct buckets (called "sub-accounts") by insurance plan and mutual fund. The net dollars are translated back to mutual fund shares via the NAV, and are passed along to the fund manager to buy or sell the appropriate number of mutual fund shares.

All of this must be done before the market opens the next morning! If late, the insurance company must pay the difference, possibly thousands of dollars, for any losses arising from fluctuating NAVs. Meanwhile, Murphy's law continues to operate. If something can go wrong, it does. With no time to spare, what programmers would not choose APL as their language of choice?
The Variable Products Administration (VPA) System was written in APL and is used by a dozen companies to serve as the intermediary between the admin system and the fund manager.

More information: Doug Draeseke FSA, email

QuoteQuad 29(4)6 (©Copyright 2000 by ACM, Inc.)

Healthcare Finance:
Budget Management for Healthcare
by: Gregory R. Ferguson, President, Kreg Information Systems, Eight Piedmont Center, Suite 412; Atlanta, GA 30305 USA

Kreg Information Systems over the past two years has rewritten several applications using APL2000's Windows APL. Healthcare providers, like hospitals, physicians, nursing homes, use these products used to develop Enterprise wide budgets: labour, non-labour expenses, and revenue. During the year, they use these same products to import data from their General Ledger and Payroll systems and then produce monthly expense and revenue variance reports for management control.

Kreg writes these products using Windows APL. We have incorporated the Formula One grid control (an Excel compatible 32-bit OCX) for data editing and printing, and another 32-bit OCX, ChartFX, to generate graphs.
We spent about one year designing the basic Windows based system, and then about six months converting the various calculations, input, and reports from the DOS system.

This spring Kreg will release new features for these products, including our Task Manager. The Task Manager keeps track of the settings of all objects on a form.
The user then stores these settings as a task, and then can group tasks together as a job. Then, by simply clicking on a job the systems will run automatically with no manual intervention.
This summer we will connect Task Manager with the System Agent so users can schedule jobs to run overnight or over the weekend.

More information:Greg Ferguson, email and

QuoteQuad 29(4)6 (©Copyright 2000 by ACM, Inc.)

Cost estimation:
Sheet metal estimating for the HVAC contractor & Piping/Plumbing estimating for the mechanical contractor
by: John W. Gregg, Tallysheet Corporation, 2816 Rowena Ave. #3, Los Angeles, CA 90039

I have been in the heating, ventilating, and air conditioning, industry (hvac) since 1950. Since I shared in the job's profit I had a vested interest in accurate cost estimating when bidding on an air conditioning job.

If a bid is too high you lose the job. If it is too low, you get the job and may lose money.
Most hvac estimators estimate the cost of sheet metal duct work by the pound. There is a problem with this method: three different jobs, say a discount store, office building and a hospital may have the same number of pounds of sheet metal duct work but will have grossly different costs.
The calculated labor must be adjusted for the complexity of the duct AND for job conditions.

In 1975 I watched a representative for a timesharing company write a simple APL program in my office. A light went on, I thought. "Hey, I can read what he is writing. I can do that! I can speedup and improve my bidding."
I took extension courses in APL at the community college and UCLA, made a deal with STSC, and created a sheet metal estimating system which estimates labor by the operation NOT by the pound.

The Greggway system adjusts the labor for the complexity of the duct. The estimator adjusts the labor for job conditions..
The Greggway System was on STSC's timesharing system for ten years 1978-1988. In late 1985 a PC version was created. Contractors who were using the timesharing version in 1978 are using it today on the PC's along with over 500 contractors who have purchased the PC version.
Now, with the help of Eric Lescasse and his "Monthly APL+Win Training Program", I am working on a windows version.

More information: John W. Gregg, email, phone 323.665.5891, fax 323.550.5080.

QuoteQuad 29(4)7 (©Copyright 2000 by ACM, Inc.)

Financial analysis:
Boeing Capital Corporation Financial Model
by: Terrence S. Johnson, Boeing Capital Corporation.

At Boeing Capital Corporation we use an internally developed pricing model to structure financial transactions. It has been in development for 15 to 20 years. It was originally written in Fortran on the mainframe and migrated to a Data General Mini Computer 15 years ago and written in APL at that time. It was ported to personal computers 9 years ago using APL Plus, APL Plus II and is currently being converted to windows based program using APL+Win.

The model is designed to analyze cash flows taking into account the appropriate book and tax accounting methods applied and compute the after-tax economic yield on lessor's equity.
It computes book and tax accounting correctly for tax-oriented leases as well as notes, discounted notes and conditional sales contracts. On the leasing side it can analyze finance leases, operating leases and leveraged leases both domestic and foreign.
It also has the ability to analyze the cost of providing residual value and credit guarantees using probability and present value techniques.

The model has the ability to solve problems heuristically by converging on the correct solution or mathematically solving for the best possible optimized solution. The optimized solutions are solved using CPLEX callable library. The process for solving the optimizations is entirely managed with APL; the objective function, equations, constraints and bounds are all generated using APL. The CPLEX callable library is used to solve the algebraic matrix. The non-optimized solutions range from cost, rental or payment, residual value or balloon, early buyouts, after-tax or pre-tax lessor yield etc. The optimization solutions are for variable or proportional rent and debt with objectives to minimize present value of rent, minimize implicit rate, maximize cost, maximize after tax lessor yield, maximize after tax cash or maximize pretax cash.
The solutions have numerous constraints including leverage limits, average life of debt, minimum pretax cash flow, minimum after tax cash flow, minimum return on asset, IRS - uneven rent test, safe harbor rent test, profit test, cash flow test, and minimum equity test.
The leasing model has been benchmarked against the "Best in Class Models" with identical results obtained with consistent assumptions.

Every transaction bought or sold at Boeing Capital is analyzed with this model. It has performed flawlessly over time and we have never failed to meet a challenge with APL.

More information: Terrence S. Johnson, email

QuoteQuad 29(4)7 (©Copyright 2000 by ACM, Inc.)

Life Insurance:
Computing Human Life Value
by: Gary A. Bergquist, Zark Incorporated, Hartford, CT, U.S.A.

A plane goes down. Hundreds are killed. Many more hundreds of lives are disrupted by the loss of their loved ones. Airline officials, lawyers, insurance representatives, and economists huddle together to work out financial compensation for the survivors. In the process, the unquantifiable is quantified -- a value is placed on each life. The age, occupation, salary, family characteristics, and so on are considered in the process of determining the financial loss represented by the victim's death.

Litigation Analytics, Inc. (LAI) developed an interactive APL system for rapidly computing human life value, the economic loss to survivors. Drawing upon the literature involving the economics of human capital and upon extensive demographic databases from a variety of federal agencies, the "PhD LIFE" system projects the earnings, taxes, consumption, savings, inflation, and so on of a target "client." Economists at LAI have used this system to prepare their testimony as expert witnesses for almost 20 years.

The system has been made available to life insurance agents as a tool in their selling efforts. What better way to assess the adequacy of a client's insurance coverage than to examine scientifically, in the form of colorful charts and graphs, the client's future life value?

More information: email

QuoteQuad 29(4)8 (©Copyright 2000 by ACM, Inc.)

Healtcare Information Management:
Keeping hospitals healthy
by: Christopher H. Lee

SoftMed Systems, Inc., based in Bethesda, MD, is a two-hundred person company providing Medical Records Management software to the healthcare industry. They are the number one vendor of such products with software in approximately 1500 hospitals in the US and Canada. Most of their sixty products and add-ons are written in APL+Win by a permanent staff of 12 developers with a little help from two part-time consultants. SoftMed also sports a C++ group that deals mainly in supporting software (DLLs etc.) and a FoxPro group with two products. APL has been the main development language at SoftMed for all of its fifteen year history.

When moving from DOS to Windows, the development team decided to take a ground-up approach to APL Windows development, using the power of arrays to develop an easy-to-use tool set that makes for rapid construction and a standard user interface across all their products. They invented the concept of User-Defined Classes to provide APL with the same kind of value that VBXs gave to Visual Basic and Parts gave to Smalltalk. Coupled with a Master Code suite of over 500 functions, this has led to higher than 90% code re-use across their applications.

With two to five new applications every year plus major releases of most of the existing applications, these 12 APL developers are providing an impossible challenge to SoftMed's competition. This lead is increased by SoftMed's ability to concentrate on the design of a highly specialized user interface that optimally addresses the way their customers do business. They credit this to "thinking at a higher level" because of the extensive set of building blocks they have produced.

Recently, they started developing with SQL databases, using APL LinkPro, and this has proved a very successful approach to high volume data management. Their applications include image scanning, storage and retrieval, faxing, e-mail, web access, integration with Microsoft Word, voice and APL COM Objects and they stand ready to embrace any new technology that helps them deliver the applications their customers need.

SoftMed's developers are frequent presenters at the APL2000 Annual User Conferences and are happy to provide others with large portions of their toolset, including the UDCs. Their envelope-pushing attitude has had a significant impact on new features in APL+Win, and has led to several extensions to its Windows Interface.

More information: Christopher H. Lee, email

QuoteQuad 29(4)8 (©Copyright 2000 by ACM, Inc.)

Covering the Windows API
by: William R. Parke

Recently I decided to make it my quest to write additional APL+Win cover functions for Windows API functions not included in the standard APL2000 release or that I had not seen elsewhere. Most of the commonly-used ones are built-in to the APL+Win system or have already been done, and a lot of what's left seem very esoteric, so I've only accomplished a few so far.

The first ones I wrote were for reading and writing volume (disk) labels, GetVolumeInformation and SetVolumeLabel.
Next was the ShellExecute function to open files with registered file-types in their native applications. The actual code needed is only one line, but I included some handling of file paths and names in varying formats as well as allowing passing a handle for a parent window from the user's application.
The Page Setup Dialog is a little-known dialog for setting page margins, paper size and orientation for printing. It has the useful side benefit of returning the current printer's margin minimums.
WNetOpenEnum and WNetEnumResource allow the programmer to determine what network resources are available on a LAN, and I use this to display and access them in my Explorer-like file-management application.
WNetAddConnection2 allows connection to password-protected resources.

There are many more to be done, either when I need them or want to indulge my curiosity. Researching the Windows API documentation for useful functions becomes a great learning experience, and writing re-usable code is always time well-spent.

More information: William Parke

QuoteQuad 29(4)8 (©Copyright 2000 by ACM, Inc.)

D2CELL: DB2 to Excel Data Mover
by: John "doc" Manges

D2CELL is a Dyalog APL/W application I built for Primerica Financial Services a little over a year ago. D2CELL lets users build custom SQL through the use of point and click GUI screens, and then automatically and quickly downloads the results into MS Excel. The system uses ODBC (Open Database Connectivity) to gather the mainframe DB2 data and then posts it into Excel using DDE (Dynamic Data Exchange). A wizard was written to guide the user through selecting which columns and which conditions they wish to extract. Pop-up windows help the user determine which databases and tables to be selected, and identify which columns are indexed for maximum efficiency.

Once a set of SQL has been generated by the system, the user may save it in a file for future usage. Options for viewing and printing the results before downloading are provided, as well as a built-in tutorial and help screens.

D2CELL is currently in use by over a hundred internal company users. It has saved countless hours in many departments of the company.

More information:John Manges, email: SEAPLdoc@AOL.COM.

QuoteQuad 30(2)18 (©Copyright 2000 by ACM, Inc.)

auditory signal processing:
APL in Granular Signal Processing
by: John K. Bates

In contrast to most uses of APL that concentrate on business applications, I have been using it in acoustic signal processing. The reason for this is that I have been developing a new approach based on fine-grain, or "granular," time domain analysis. My granular method is based on simultaneous recognition of patterns using multi-dimensional arrays, an approach that is ideal for APL. This method allows separation of intermixed acoustic sounds that is not possible with classic Fourier-based signal processing. Development of multi-signal processing is necessary for achieving robust speech recognition; for example, recognizing speakers and speech in the "cocktail party effect."

APL has been excellent for quickly developing and testing different algorithms using both simulated and actual signal sources. My experiments on the fine structure of acoustic waveforms have demonstrated multi-signal separation and have revealed possible explanations for a number of psychoacoustic "mysteries" in auditory perception. I could not have done this in any other language.

Incidentally, in March, 1995, Quote Quad published an article in which I compared run-time of some of my APL algorithms translated to C using Wai-Mee Ching's experimental APL-to-C compiler.

Reference: John K. Bates(1995): Some observations on using Ching's APL-to-C translator. APL Quote Quad 1995(march),p.47-49.

More information: John K. Bates, Time/Space Systems 79 Sarles Lane, Pleasantville, NY 10570, 914-747-3143), email:

QuoteQuad 30(2)19 (©Copyright 2000 by ACM, Inc.)

Implementing an APL OLAP *) system: The Loan Information System (LIS)
by: Bernard Houben
*) OLAP is an acronym for OnLine Analytical Processing, in general software to process huge amounts of data.

For many years the information on the 400000 long-term student-loans, which are "granted" by the government in the Netherlands, was very poor. Of the total amount of more than 1.5 billion euro, only the most essential financial information was available (for book-keeping purposes).

Several attempts were made in the past with substantial high-quality labour-effort and expensive main-stream tools (which I will not mention) to construct additional information systems that would be able to generate more information in an easy way on this subject. For all kinds of reasons (which I do not wish to be familiar with) none of these systems survived.

To improve this situation, a few months ago we implemented an APL OLAP system (OLAP is on acronym for OnLine Analytical Processing, in general software to process huge amounts of data. ed.) for these loans. The universal OLAP/database system that we are using for this purpose was developed in our own company in order to deal with information problems of other systems in the past. The beautiful thing about this loan-system-implementation is not only that the entire process took less than one day (!), but that the system generates the required information extremely fast (response in a few seconds), easy (user-designed modern GUI: the user will not see a single apl-character) inexpensive (the system is running on two budget-line personal computers now) and on any aggregation level (indeed: also low-level individual data).

This project proves that APL-based systems are easy to implement and that the traditional slow performance of APL has become history.

More information:

QuoteQuad 30(2)19 (©Copyright 2000 by ACM, Inc.)

APL code conversion to C
by: Tilman P. Otto

Even if APL is the best-suited programming language for multi-dimensional data, nowadays computer applications additionally require complex graphical user interfaces, internet and database access. Combining software written in C, C++ or Java with interpreted APL programs is difficult.

A homogeneous solution has been found by automatically converting APL programs into native C code. A complete APL2 like system including interpreter and session manager has been implemented in ISO C from scratch only based on the standard C library.

The system has been successfully compiled on several operating systems. The built in system call APL2C allows one to compile any APL function including all referenced functions or operators within the workspace into native C code and completely removes the interpreter using direct calls to the C coded APL primitives. Only obvious restrictions (no runtime execution of character arrays or dynamic creation of functions via FX) apply. In addition, a makefile is created to enable the simple build of standalone executable files. The C files, generated by APL2C, can be easily mixed with other C/C++source files and compiled on any platform provided that the required library for the APL primitives is available.

The system is the property of the author.

More information: Tilman P. Otto, Paul-Martin-Ufer 13, 68163 Mannheim, Germany, email:, website:

A list-server program in APL
by: Conrad Hoesle-Kienzlen

All modern APL systems nowadays come with an interface to TCP/IP, which is the basic transport protocol of the Internet. If one can make use of TCP/IP, virtually all applications which make the WWW so fascinating can be accessed from whithin APL. Some of the protocols superimposed on TCP/IP are quite complex, others are very easy to use. POP3 and SMTP are the most widely used protocols for reading and sending e-mail and they are relatively simple.

I wrote a list server program called ALISIA (A LIst Server In Apl) in Dyalog APL and deployed it as shareware. This gave rise to a favourable article in one of Germany's best reputed PC magazines, the first time in many years that APL was mentioned in a german computer magazine! The program and some more basic workspaces which resulted from my studies, as well as a few articles about the topic can be downloaded from my website.

Reference: c't 29/99 Page 74

More information:
Contact information: Conrad Hoesle-Kienzlen (email: web:

AIS - Annuity *) Illustration System
by: Ray Cannon

*) Annuity is a sum of money paid annually. Now the term annuity is used to mean any regular income, which has been purchased in advance by payment.

I do a lot of consultancy for a very large insurance company. One of the systems I have written for them is called AIS, and was originally developed to produce quotations for "annuities"*.

AIS may be used to calculate what size pension a fund will pay for, taking into account many factors such as age, sex, marital status, frequency of payments, etc and then produces a formal quotation as part of a pension contract.

AIS was originally written in APL*PLUS under TSO, but due to the very high overheads incurred when running small APL systems on the mainframe, it was quickly rewritten in Dyalog APL/W to run under Windows 3.x/NT. (Within one month of being written, AIS was accounting for 40% of the total CPU being used on the mainframe and of this, half was accounted for by users just logging on and off TSO!)

The Windows version of AIS consists of 3 main parts, a (GUI) user interface, a calculation engine, and a letter writer. Now several other systems within the company use the calculation engine part of AIS to perform many related annuity calculations. The last time I counted, there were over 200 registered users running AIS.

The next phase of the development of AIS, is to extract the annuity engine into a stand-alone module (to be called "ACE" - the Annuity Calculation Engine), and make it available to other systems, to actuaries for use in spreadsheets, and for developing web based annuity applications.

AIS was written with the aid of two tool sets provided by Adrian Smith (of Causeway Graphical Systems Ltd) an early version of Causeway (used to develop and maintain the GUI interface), and a prototype report package which was later evolved into NewLeaf.

More information: Ray Cannon, email:, website:

Electronic Design:
Circuit Analysis and Electronic Design
by: Doug White

For the past 25 years or more, a number of staff members at MIT Lincoln Laboratory have made extensive use of the APL computer language to solve an variety of problems, primarily in the area of radio frequency and microwave circuit design. This was aided and inspired by the availability of the 'MARTHA' software package, which is a collection of APL-based circuit analysis functions developed by Professor Paul Penfield Jr. at M.I.T.

The Lincoln Laboratory Advanced 'MARTHA' Applications (or 'LLAMA' for short) is a set of 15 workspaces developed primarily in conjunction with 'MARTHA'. Many of the workspaces are an extension of 'MARTHA', and allow the use of new circuit elements or new types of analysis. A number of workspaces are devoted to filter synthesis, using both lumped elements and coupled microstrip transmission lines. Other workspaces are aimed toward RF system design, including mixer-spur and dynamic-range analysis.

I frequently use the run-time capability of the old APL*PLUS PC to create programs for the un-enlightened. Prof. Penfield & I tried to get 'MARTHA' & 'LLAMA' back out as a commercial package, but that died on the vine. I write APL programs on a fairly steady basis, but only to support my needs as a circuit designer. Rather than working with a 'canned' package that performs one large task (like many commercial houses), I mostly just keep adding functions to 'MARTHA', which operates as a circuit analysis 'language'. More information: ; email;

More information: Doug White, MIT Lincoln Laboratory, 244 Wood St., Lexington, MA 02420-9108, tel:(781)981-3986 (email:

Legal Information Management & Incident Tracking System
by John Manges "doc", Primerica Financial Services

The Legal Information Management Incident Tracking System (LIMITS) is a multi departmental application in use at Primerica Financial Services. It is written in Dyalog APL and uses ODBC to gather, store and report mainframe DB2 information. It originally replaced a manual procedure that required users to screen-print many pages of CICS screens in order to produce one report. The LIMITS application has grown in scope and usage since it was first implemented nearly two years ago. Currently, there are five major subsystems in LIMITS. Each contains it's own unique set of screens and information that is used by various departments in the company such as Compliance, Agency, Phone Units, Legal, Marketing and Auditing.

LIMITS supports a number of features found only in the most sophisticated applications such as a custom cut and paste interface with MS Word; tips and hints; built in tutorials; customizable report writers; built in graphs; exports to Excel spreadsheets; user definable appearance; user definable print formats; and support for remote users (using dial-up ODBC).

LIMITS currently numbers 124 screens, 344 functions, 6610 lines of APL code, and supports about 200 users. The system is very well received and even has it's own motto: There is No Limit to LIMITS!

More information: John Manges, Primerica Financial Services email: SEAPLdoc@AOL.COM.

APL based medical image analysis
by: Tilman P. Otto

Ophthalmology (eye care) is an important medical discipline. Since 1961 the representation of the ocular vascular system using fluorescence dyes has been one of the most important methods used in the diagnosis of diseases of the human eye. The recently introduced laser scanning systems allows fast and continuous imaging of the complete inflow of dye into the vascular system.

With the aid of APL as a well-suited image analysis tool it is now possible to analyse these image sequences to extract diagnostic relevant blood flow parameters. During the image acquisition there are unavoidable eye movements which render the automatic follow up of a specific area over time more difficult.

Therefore a method has been developed to robustly analyse the eye movements. Beside the determination of the filling delay, i.e. the time of dye appearance for every point, the filling time has been measured. Result images will be presented for two different cases. A slightly modified algorithm is able to automatically compose a panoramic wide-angle retinal image out of partially overlapping single images.

The APL system itself (called APL2C) and the algorithms for the image processing have been developed by the author and are not commercially available.

More information: Tilman P. Otto, Paul-Martin-Ufer 13, email:

FTP Client as an APL+Win ActiveX Server Object
by: William R. Parke

As the informational world migrates to the Web, applications need to be able to transfer files via the Internet. FTPClientX is an APL+Win workspace that can provide FTP client services entirely under program control for APL and Visual Basic applications through the APL+Win ActiveX Server interface. Developers can use it for batch, unattended file transfers, as the FTP engine for a GUI application, or even from the command line as an active FTP client.

Although FTPClientX contains a complex feature-set that implements nearly all FTP commands, client applications access its methods and properties by calling a single function through the APL+Win server-system Call method and receive status and error messages through the system Notify method. This provides a simple, consistent syntax that is easy to adapt to a variety of FTP uses.

Batch operation is the most powerful feature of FTPClientX. Structured lists can be used to operate the FTP client from logon to disconnect, with unattended execution of all FTP commands. This can be especially useful for automatic updating of file-sets or other recurring FTP tasks.

More information: William R. Parke

GERVA: Secure Electronic Legal Communication with Attributes
by: Dietmar Sengenleitner

DATEV is a software-company and IT Service Provider for tax consultants, lawyers, auditors, certified accountants and their clients.

Electronic communication today is essential for modern business. However many lawyers, tax consultants and their clients hesitate to send sensible data via email for security reasons. DATEV has established a Trust Center to issue certificates and provides the APL-based application GERVA ('Gesicherter Elektronischer RechtsVerkehr mit Attributen' meaning Secure Electronic Legal Communication with Attributes).

GERVA enables you to digitally sign any files (e.g. documents or messages) and encrypt them so that only selected persons can open them. Files can be signed or encrypted if you have a smartcard from the DATEV Trust Center (certificate authority) and enter a valid personal identification number (PIN).

To use the software, you need a smartcard and a reader which is connected via a serial port. One of the operating systems Windows 9x or Windows NT 4.0 is required. MS Word 97 (text processor) and Outlook (mail program) is supported but not mandatory, documents signed and encrypted with GERVA can be mailed by any mail client as an attachment.

GERVA is implemented in DyalogAPL. You have possibility of rapid development and can quickly react on changes in affords, which often occur in this surrounding. Additionally you may transfer Application- Complexity into Data-Complexity and not in Programming Complexity (using variable Data-structures) and also in Dyalog the Windows-Object-Handling is quite easy.

DATEV started a field test with a total of now 580 participants from several organizations. For example in Hamburg it is possible to deliver law-suits to the appellate tax tribunal via email secured by GERVA. More information: Dietmar Sengenleitner, DATEV eG, Paumgartnerstrasse 6-14, 90329 Nürnberg; email

More information: Dietmar Sengenleitner. DATEV eG, Paumgartnerstrasse 6-14, 90329 Nürnberg, email:

Actuarial Products:
When "Cool" applies to Actuarial Software
by: George VanDreumel

I get different reactions when I say "Actuarial software" and when I say "Cool web page." I think you can guess which phrase captures people's attention. PTS 2000(tm) is a software package used by hundreds of actuaries at insurance companies across the United States. This APL application contains literally hundreds of screens for managing all of the complex assumptions required for asset and liability modeling. PTS 2000(tm) also contains some very cool Web page features.

Thanks to APL it was a quick conversion from DOS to Windows, and the graphical Windows interface was very well received. In fact, Today's Corporate Investor magazine showcased the PTS 2000(tm) main navigation screen on their 12/98 cover. But it couldn't stop there, not with all the exciting buzz surrounding the Internet dot com mania.

First, I redesigned the main navigation screen to look just like a web page, completely graphical with onMouseOver graphic change events. Then I hooked in web links utilizing the Internet Explorer Browser active control. Next, I created a mail form for clients to contact PTS support directly from the PTS 2000(tm) interface, utilizing SMTP via APL+Win's Network Interface sockets. Finally, I created the ability to update PTS 2000(tm) database files from the Web with the click of a mouse, utilizing FTP via APL+Win's Network Interface sockets. Using APL made all of these changes very easy to implement.

And all these Web features make PTS 2000(tm) "cool actuarial software!"

More information: for information about PTS 2000(tm) and SS&C's other industry leadingsoftware applications.

Web services:
OpenHere site
by: Fred M. Waid, Evangelist, APL2000

The OpenHere site (, being one of the 10 largest search and index portals on the internet today, is by its nature a complex effort. However, to be perfectly clear, all of the interactive services are provided and created using applications written in APL.

As we also use the OpenHere site as a demonstration vehicle in our consulting work, the static pages on OpenHere are served using IIS to demonstrate the various methods we have for integrating APL with IIS.

To see APL+WIN as the server type, go to our VirtualDesk site ( which has the static pages served using APL. The server for static pages is a single APL function with less than 200 lines of code, with no diamond separators :-)

    To provide some background about the way APL is being used to create the OpenHere site, here is a break down of our effort at present:
  • Approximately 12,000 pages and links are added to the OpenHere search engine and index every week. This is done using a spider written in APL which spiders the net discovering new sites. hat means that on average every minute of every day a new link or page is being added to OpenHere.
  • The resulting databases are created and accessed using APL. In fact the databases are now over 2 gig and reside in APL component and native files. The entire search engine is written in APL.
  • The index feature of OpenHere includes over 100,000 categories, all of which are created and maintained using applications written in APL and integrated into the spider and search engine technology.
  • Our search and index pages are retrieved millions of times each month, making this one of the most widely used APL applications on the internet.
  • We also have created technology (patent pending) which permits anyone to maintain their own site information within the OpenHere search engine and index. This application is also written in APL.

As we are a portal, we also provide free e-mail accounts to 1000's of people. The server side of this application is written in APL, and APL is used to dynamically create over 15,000 lines of JAVA code which is run in the user's browser I would have preferred to use APL for the browser interface as well, but as yet we have not convinced Microsoft to include APL in their Windows install :-) The e-mail facility includes attachments, address books, folders, etc. It is one of the most complete e-mail based applications on the net.

    Some other services on our site, all written in APL, are:

  • an html based chat facility (including chat rooms, chat filters, avatars, nicknames, etc)..
  • e-cards and holiday pages that enable you to send an e-card for most holidays to someone
  • a Reminder Service that delivers reminders to your e-mail
  • the ability to send a Mother Goose Rhyme to a friend (quite popular with both children and adults).
  • creation and maintainance or your own web site. This the ability to create html using the browser with a Java application which is created dyanically within the VirtualDesk APL server application and delivered to the client.
  • Discussion Groups that maintains threaded discussions and is compatible with most News servers
  • a current events utilizing the VOA news feed. This application is being introduced in serveral schools to provide students the experience of editing current events and publishing them to the net.

All of the OpenHere site is provided and created using only APL+Win and the NT 4.0 operating system from Microsoft. Now, if we could just get someone to rewrite NT using APL....

More information:; if you have any additional questions about OpenHere, please just drop me a note at:

Genetic algorithms and cellular automata
by: Manuel Alfonseca, Universidad Autonoma de Madrid, Dept. Ingenieria Informatica

Cellular automata are regular grids of points, each associated to a set of finite automata, which differ only in their initial states. The inputto the automaton associated to a given point, is the set of states of the automata associated to the neighboring points in the grid. APL2 is anexcellent language to experiment with cellular automata. The states of thefinite automata, at a given step, can be represented by matrices, while their rules may often be expressed by means of vectors, and their application to oneset of states to compute the next is made easy by the use of the each operator.

Artificial life has been simulated frequently by means of systems of agents, using genetic algorithms as the standard way to implement evolution and natural selection. Less often, these algorithms have been applied tocellular automata. Our group is working in this field, and we have programmeda set of cellular automata that evolve towards Conway's game of life. The program, written in APL2, is made of a set of functions that implement the standard game of life (for comparison purposes), a random density generator ofinitial conditions, the execution of each cellular automaton, and the geneticalgorithm. The total system has been programmed in about 50 APL2 lines.

More information: Manuel Alfonseca, Universidad Autonoma de Madrid, Dept. Ingenieria Informatica, Madrid, Spain, email:, website: