% From geyers@uxe.wu-wien.ac.at Thu Sep 19 10:00 EDT 1991
% From: Andreas Geyer-Schulz  <geyers@uxe.wu-wien.ac.at>
% Subject: stanacc.tex
% Date: Thu, 19 Sep 91 15:42:28 MEZ

%
% paper.tex
%
\documentstyle[twocolum,apl]{article}

% This version sent to Stanford as tutorial material
% 29.5.1991

\title{An Introduction to Financial Accounting with APL2\thanks
       {This paper is a revised version of the handout
        of the tutorial ``An Introduction to Financial
        Accounting with APL2'' held by the author at the
        APL'91 conference, Stanford, August $6^{th}$,1991.}}

\author{Andreas Geyer-Schulz\\
        Department of Applied Computer Science \\
        Institute of Information Processing and Information Economics \\
        Vienna University of Economics and Business Administration \\
        A-1090 Vienna, Augasse 2-6, Austria}

\date{}

%\markboth{An Introduction to Financial Accounting with APL2}%
%{An Introduction to Financial Accounting with APL2}
%\pagestyle{myheadings}

\oddsidemargin=0.75in
\addtolength{\oddsidemargin}{-1in}
\evensidemargin=0.75in
\addtolength{\evensidemargin}{-1in}
\topmargin=0.75in
\addtolength{\topmargin}{-1in}
\footheight=1.25in

\textheight=9in
\textwidth=6.99in
\columnsep=0.33in

\def\ace{\APLless accounting entity\APLgreater }
\def\dat{\APLless date\APLgreater }
\def\jen{\APLless journal entry number\APLgreater }
\def\key{\APLless account key\APLgreater }
\parindent=2em

\def\cur{\$}
\def\APL{{\it APL}}
\def\corp{{\em The Vienna \APL\ Corporation}}

\newdimen\ags

\def\aplsymbol{{\large\APLquadquote}\APLindent}
\def\aplese{\begin{trivlist}\item[]\aplsymbol}
%\ags=\linewidth\advance\ags by -4em\parindent=0pt\parshape 2 2em \ags 2em \ags}
\def\endaplese{\par\end{trivlist}}

\def\finsymbol{{\large\fbox{\APLuptack}}\APLindent}
\def\financial{\begin{trivlist}\item[]\finsymbol}
\def\endfinancial{\par\end{trivlist}}

\newcount\trano
\global\trano=0
\def\transno{\global\advance\trano by 1 (\the\trano)}
\def\transaction{\begin{trivlist}\item[]\transno\ }
\def\endtransaction{\end{trivlist}\vspace{2pt}}

\begin{document}

\maketitle

\begin{abstract}
A financial accounting system suitable for teaching courses in
financial accounting is analyzed and implemented in this article.
The article is structured in four sections: the founding
of a new company, the recording of transactions, the
preparation of financial statements and the account type system.
%and the description
%of the system in an object--oriented design method.
In each of the sections
the presentation of financial accounting material is
intertwined with systems analysis and implementation.
The implementation is given in a functional programming style annotated
with a grammar in Backus-Naur-Form (BNF). The grammar describes the
basic data structures in a financial accounting system in financial
accounting terminology and thus enhances readability.
% In order to stress the
% role of \APL\ as formal notation the balance sheet equation is presented
% as formal identity.
As conclusion the author claims that \APL\ is
an excellent notation for financial accounting (and other related
commercial applications) with all the advantages of mathematical notation
as for instance ease of expression, subordination of detail, amenability
to formal proofs.
\end{abstract}

{\bf Keywords:} Notation, Algorithms, Financial Accounting, Functional Programming.
\vspace{7.5cm}

\section{Introduction}

In his 1979 ACM Turing Award Lecture ``Notation as a Tool of Thought''
K. E. Iverson introduced \APL\ in the context of mathematics as a language
combining the advantages of executability and universality of programming
languages with the advantages of mathematical notation: ease of expressing
constructs arising in problems, suggestivity, ability to subordinate detail,
economy and amenability to formal proofs \cite{iverson}.
In this article we choose financial accounting as a topic and since we present
a first course in financial accounting, we interweave an implementation in \APL\
and construct a complete double entry financial accounting system step by step \cite{ijiri}.
The financial accounting system presented is suitable for teaching courses
in financial accounting, and it constitutes a formal specification as well
as a working prototype. The elegance, generality and compactness of the
system supports, as we believe, the claim, that \APL\ is an excellent
tool for commercial applications.

%{\Large Only Financial Accounting covered.}

We establish the claim by presenting a small case-study:
we take an imaginary company and call it  \corp.
We track its records through its first accounting
cycle. In section \ref{foundingsec} we establish a new company, \corp, and start with the opening
balance sheet. In section \ref{transactionsec} we analyze and record transactions
and discuss their impact on the balance sheet and the income
statement. In section \ref{preparationsec} we first prepare an unadjusted trial balance.
Next we analyze and record the adjustments to the accounts
and prepare adjusted financial statements.
%deal with
%the allocation of income and the final financial statements
%and discuss the balance equation as formal identity.
%Finally, in section \ref{objsys} we give a synopsis of the financial accounting system
%in the form of an object oriented design method \cite{beck}.
Finally, in section \ref{accts} we generalize opening and closing the
books and we present the account type system and its properties.
A survey of the definition of data
structures, the grammar of the user interface, the direct definitions,
the definitions for the chart of accounts and the account closing
order and last but not least, the direct definition compiler
are relegated to appendices A -- E.

Throughout this paper we employ a functional programming style.
All function definitions but two are in direct definition form
\cite{iverson} using \APLalpha\ and \APLomega\ to represent right and
left arguments and \APLalphaunderbar\ and \APLomegaunderbar\ for the
right and left function argument of an operator. The \APL\ dialect
used is \APL2\ as defined in the APL2 Programming: Language Reference
\cite{ibm}. All data structures of the accounting system are explained
by a description in terms of a BNF-grammar, for some data structures
an example is displayed in boxed representation. Functions are
annotated with a BNF-rule showing argument and result structure.

Two lines of thought are interwoven in this paper: one on
financial accounting, the second on \APL. We mark financial
accounting material with the symbol {\small\fbox{\APLuptack}} which represents
a T-account and we mark \APL\ material with {\small\APLquadquote}.

\section{A New Company} \label{foundingsec}

\begin{financial}
Do you make decisions that have a financial impact? Your answer is
undoubtedly yes. The major purpose of any introduction to accounting
is to make you feel comfortable with financial information. Accounting
should be called the ``language of financial decisions''. It is with
accounting as with living in a foreign country: the better you speak
the language, the better you are off. ({\small\APLquadquote}\ The same holds
for \APL.) In brief, learning accounting means learning a language \cite{horngren}.

Usually we are interested in two important questions about an organization:
How did it perform during a given period? and What is the organization's
standing on a given day? ``The accountant answers these questions with
two major financial statements -- an income statement and a balance sheet.
To obtain these statements, he analyzes, records, quantifies, accumulates,
summarizes, classifies, reports, and interprets the numerous events
and their financial effects on the organization.''\cite{horngren}
Users of financial statements include managers, lenders, tax authorities,
government regulators, and last but not least, owners. Financial accounting
is concerned with how accounting serves external decision-makers, whereas
management accounting serves internal decision-makers.

In the sequel we turn to examining what an accountant does. By working with
a concrete case-study, we gradually introduce the underlying theory
of accounting and the concepts of accounting.

Suppose we decide to open a new software company, \corp, which trades
\APL\ products. For common stock we invest \cur 500,000 \transno; in order to
have enough money we borrow \cur 100,000 from a local bank \transno.
An opening balance sheet of \corp\ is shown in figure \ref{openbal}.

\begin{figure*}[htbp]
{\centering
% The Opening Balance
\begin{minipage}{15cm}
{\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig1}
%
%
% fig1.tex
%
% FIG1 FIGURE_1
\begin{APLarray}
\APLmb{\APLspace}\APLmb{\APLB}\APLmb{\APLa}\APLmb{\APLl}
\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLc}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLs}\APLmb{\APLh}\APLmb{\APLe}\APLmb{\APLe}\APLmb{
\APLt}\APLmb{\APLspace}\APLmb{\APLa}\APLmb{\APLs}\APLmb{
\APLspace}\APLmb{\APLo}\APLmb{\APLf}\APLmb{\APLspace}\APLmb{
\APLthree}\APLmb{\APLone}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{
\APLtwo}\APLmb{\APLspace}\APLmb{\APLf}\APLmb{\APLo}\APLmb{\APLr}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}
\APLmb{\APLh}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLV}\APLmb{
\APLi}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLn}\APLmb{\APLa}
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLP}\APLmb{\APLL}\APLmb{
\APLspace}\APLmb{\APLC}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLp}
\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLa}\APLmb{\APLt}\APLmb{\APLi}
\APLmb{\APLo}\APLmb{\APLn}
\APLspace\par
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLC}\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLh}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLc}
\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLN}
\APLmb{\APLo}\APLmb{\APLt}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{
\APLp}\APLmb{\APLa}\APLmb{\APLy}\APLmb{\APLa}\APLmb{\APLb}
\APLmb{\APLl}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLleftparen}\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{
\APLspace}\APLmb{\APLP}\APLmb{\APLa}\APLmb{\APLi}\APLmb{\APLd}
\APLmb{\APLbar}\APLmb{\APLi}\APLmb{\APLn}\APLmb{\APLspace}\APLmb{
\APLc}\APLmb{\APLa}\APLmb{\APLp}\APLmb{\APLi}\APLmb{\APLt}
\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLfive}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{\APLo}
\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLT}\APLmb{\APLo}\APLmb{\APLt}
\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLsix}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\end{APLarray}
%
% fig1.tex
%
}
\end{minipage}
\caption{Opening Balance Sheet of \corp \label{openbal}}
}
\end{figure*}

The balance sheet is a snapshot of the financial status at an instant of time.
It has two sections: assets (i.e. cash) and equities (i.e. note payable and
paid-in capital). Assets are economic resources, equities are claims against the
total assets (or sources of total assets or interests in total assets). The accountant's
fundamental analytical tool is the balance sheet equation:

\begin{displaymath}
\begin{array}{rcl}
\mbox{Assets} & = & \mbox{Equity}
\end{array}
\end{displaymath}

Liabilities are economic obligations to outsiders as for instance the loan of the bank
(see figure \ref{openbal} {\em Note payable}), whereas common stock represents the owner's equity
(see figure \ref{openbal} {\em Paid-in capital}). Rewriting the balance sheet equation to reflect
this distinction results in:

\begin{displaymath}
\begin{array}{rcl}
\mbox{Assets} & = & \mbox{Liabilities} + \mbox{Owner's Equity}
\end{array}
\end{displaymath}

For compiling the opening balance sheet shown in figure \ref{openbal}
the accountant has already recorded
two transactions. The first transaction of \corp\ was the investment
in common stock by the owners, the second was the bank loan. A transaction
is any event that affects the financial position and requires recording.
A transaction cannot and should not destroy the equality of the balance
sheet equation. The accounting process focuses on transactions as they
affect the organization. An accounting entity is a specific area of
accountability, a center of attention, a clear-cut boundary for reporting.
In short, \corp\ is an accounting entity.

Obviously we can discuss the effects of the transactions on the balance sheet
equation (and we will do so in the next section) and compile a new balance
sheet after each transaction. In practice, large numbers of transactions
make this approach unwieldy. So, ledgers are used to keep track on how transactions
affect each particular account. A ledger is a group of related accounts kept
in a systematic manner. In our example the ledger of \corp\ contains four
accounts, namely {\em Cash}, {\em Note payable}, {\em Paid-in capital}, and the {\em Balance sheet}.
Recording the two transactions affects the account {\em Cash} as shown in figure
\ref{account}.

% The internal representation of the account cash
\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig2}
%
%
% fig2.tex
%
% FIG2 FIGURE_2
\begin{APLarray}
\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLdot}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{
\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{
\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLdot}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLdot}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLA}\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLC}\APLmb{
\APLa}\APLmb{\APLs}\APLmb{\APLh}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLA}\APLmb{\APLS}\APLmb{\APLS}
\APLmb{\APLE}\APLmb{\APLT}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLdownarrow}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{
\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{
\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLdot}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLquote}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLthree}\APLmb{\APLone}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLtwo}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLC}\APLmb{\APLo}\APLmb{\APLm}\APLmb{\APLm}
\APLmb{\APLo}\APLmb{\APLn}\APLmb{\APLspace}\APLmb{\APLS}\APLmb{
\APLt}\APLmb{\APLo}\APLmb{\APLc}\APLmb{\APLk}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLA}\APLmb{\APLnine}\APLmb{\APLsix}\APLmb{\APLzero}
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLfive}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}
\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLdot}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLdot}
\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLthree}\APLmb{\APLone}
\APLmb{\APLslash}\APLmb{\APLone}\APLmb{\APLtwo}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLB}\APLmb{\APLa}
\APLmb{\APLn}\APLmb{\APLk}\APLmb{\APLspace}\APLmb{\APLl}\APLmb{
\APLo}\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLtwo}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLA}\APLmb{
\APLthree}\APLmb{\APLone}\APLmb{\APLone}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}
\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLquote}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{
\APLepsilon}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLquote}\APLmb{\APLepsilon}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLquote}
\APLspace\par
\end{APLarray}
%
% fig2.tex
%
\end{minipage}
\caption{The Account {\em Cash} \label{account}}
}
\end{figure*}

After closing the books the T-account form of the account cash is
shown in figure \ref{taccount}.

\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
% The T-account
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig3}
%
%
% fig3.tex
%
% FIG3 FIGURE_3
\begin{APLarray}
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLC}\APLmb{\APLa}
\APLmb{\APLs}\APLmb{\APLh}
\APLspace\par
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLnine}\APLmb{\APLsix}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLfive}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLthree}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLnine}
\APLmb{\APLseven}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLsix}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLthree}\APLmb{\APLone}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLone}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLT}\APLmb{\APLo}\APLmb{\APLt}\APLmb{\APLa}
\APLmb{\APLl}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLsix}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLT}\APLmb{\APLo}\APLmb{\APLt}
\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLB}
\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLc}
\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}
\APLspace\par
\end{APLarray}
%
% fig3.tex
%
\end{minipage}
\caption{{\em Cash} in T-Account Form \label{taccount}}
}
\end{figure*}

A T-account is a simplified way
-- for teaching purposes --
of presenting
an account.
Each T-account has two sections: the debit section (the column on the left) and
the credit section (the column on the right). In our example the debit section
contains two entries: the first referring to the investment of the owners,
the second to the bank loan. The first number is the journal entry number,
a cross reference to the journal. In our example 1 refers to the owner's
investment, the first entry in the journal. The `A960' is the account key
of the credited account {\em Paid-in capital} and the third number is the amount of money.
\corp\ has -- like all organizations -- a chart of accounts, which is a coded list
describing all accounts of an accounting entity. For \corp\ the chart of accounts is
shown in figure \ref{chart}.

\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
% The Chart of Accounts
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig4}
%
%
% fig4.tex
%
% FIG4 FIGURE_4
\begin{APLarray}
\APLmb{\APLC}\APLmb{\APLh}\APLmb{\APLa}\APLmb{\APLr}\APLmb{
\APLt}\APLmb{\APLspace}\APLmb{\APLo}\APLmb{\APLf}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLc}\APLmb{\APLc}\APLmb{\APLo}\APLmb{
\APLu}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLs}\APLmb{\APLspace}
\APLmb{\APLf}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLspace}
\APLmb{\APLT}\APLmb{\APLh}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{
\APLV}\APLmb{\APLi}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLn}\APLmb{
\APLa}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLP}\APLmb{\APLL}
\APLmb{\APLspace}\APLmb{\APLC}\APLmb{\APLo}\APLmb{\APLr}\APLmb{
\APLp}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLa}\APLmb{\APLt}
\APLmb{\APLi}\APLmb{\APLo}\APLmb{\APLn}\APLmb{\APLspace}\APLmb{
\APLa}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{\APLo}\APLmb{\APLf}
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLslash}\APLmb{\APLone}
\APLspace\par
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLzero}\APLmb{
\APLfive}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLS}\APLmb{\APLt}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLe}\APLmb{\APLq}\APLmb{\APLu}\APLmb{\APLi}
\APLmb{\APLp}\APLmb{\APLm}\APLmb{\APLe}\APLmb{\APLn}\APLmb{
\APLt}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLone}\APLmb{\APLone}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLM}\APLmb{\APLe}\APLmb{\APLr}\APLmb{\APLc}\APLmb{\APLh}\APLmb{
\APLa}\APLmb{\APLn}\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLs}
\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLi}\APLmb{\APLn}\APLmb{
\APLv}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLo}\APLmb{
\APLr}\APLmb{\APLy}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLC}\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLh}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{
\APLthree}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLA}\APLmb{\APLc}\APLmb{\APLc}\APLmb{\APLo}\APLmb{\APLu}\APLmb{
\APLn}\APLmb{\APLt}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{\APLr}
\APLmb{\APLe}\APLmb{\APLc}\APLmb{\APLe}\APLmb{\APLi}\APLmb{
\APLv}\APLmb{\APLa}\APLmb{\APLb}\APLmb{\APLl}\APLmb{\APLe}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{
\APLeight}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLP}\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLp}\APLmb{\APLa}\APLmb{
\APLi}\APLmb{\APLd}\APLmb{\APLspace}\APLmb{\APLr}\APLmb{\APLe}
\APLmb{\APLn}\APLmb{\APLt}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLthree}\APLmb{
\APLone}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLN}\APLmb{\APLo}\APLmb{\APLt}\APLmb{\APLe}\APLmb{\APLspace}
\APLmb{\APLp}\APLmb{\APLa}\APLmb{\APLy}\APLmb{\APLa}\APLmb{\APLb}
\APLmb{\APLl}\APLmb{\APLe}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLthree}\APLmb{
\APLthree}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLA}\APLmb{\APLc}\APLmb{\APLc}\APLmb{\APLo}\APLmb{\APLu}
\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{
\APLp}\APLmb{\APLa}\APLmb{\APLy}\APLmb{\APLa}\APLmb{\APLb}\APLmb{
\APLl}\APLmb{\APLe}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLthree}\APLmb{
\APLthree}\APLmb{\APLzero}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{
\APLH}\APLmb{\APLo}\APLmb{\APLw}\APLmb{\APLe}\APLmb{\APLl}\APLmb{
\APLl}\APLmb{\APLspace}\APLmb{\APLC}\APLmb{\APLo}\APLmb{
\APLdot}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLthree}\APLmb{
\APLthree}\APLmb{\APLzero}\APLmb{\APLtwo}\APLmb{\APLspace}\APLmb{
\APLP}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLt}\APLmb{\APLe}\APLmb{
\APLr}\APLmb{\APLspace}\APLmb{\APLC}\APLmb{\APLo}\APLmb{
\APLdot}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLthree}\APLmb{
\APLnine}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLD}\APLmb{\APLi}\APLmb{\APLv}\APLmb{\APLi}\APLmb{\APLd}
\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLd}\APLmb{\APLs}\APLmb{
\APLspace}\APLmb{\APLp}\APLmb{\APLa}\APLmb{\APLy}\APLmb{\APLa}\APLmb{
\APLb}\APLmb{\APLl}\APLmb{\APLe}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLfour}\APLmb{
\APLone}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLC}\APLmb{\APLo}\APLmb{\APLs}\APLmb{\APLt}\APLmb{\APLspace}
\APLmb{\APLo}\APLmb{\APLf}\APLmb{\APLspace}\APLmb{\APLg}\APLmb{
\APLo}\APLmb{\APLo}\APLmb{\APLd}\APLmb{\APLs}\APLmb{\APLspace}
\APLmb{\APLs}\APLmb{\APLo}\APLmb{\APLl}\APLmb{\APLd}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLsix}\APLmb{
\APLthree}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLR}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLspace}
\APLmb{\APLe}\APLmb{\APLx}\APLmb{\APLp}\APLmb{\APLe}\APLmb{\APLn}
\APLmb{\APLs}\APLmb{\APLe}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLseven}\APLmb{
\APLone}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLD}\APLmb{\APLe}\APLmb{\APLp}\APLmb{\APLr}\APLmb{\APLe}\APLmb{
\APLc}\APLmb{\APLi}\APLmb{\APLa}\APLmb{\APLt}\APLmb{\APLi}
\APLmb{\APLo}\APLmb{\APLn}\APLmb{\APLspace}\APLmb{\APLe}\APLmb{
\APLx}\APLmb{\APLp}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLs}\APLmb{
\APLe}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLeight}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLS}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLe}\APLmb{\APLs}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLnine}\APLmb{
\APLone}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLC}\APLmb{\APLa}\APLmb{\APLp}\APLmb{\APLi}\APLmb{\APLt}\APLmb{
\APLa}\APLmb{\APLl}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLnine}\APLmb{
\APLfive}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLP}\APLmb{\APLr}\APLmb{\APLi}\APLmb{\APLv}\APLmb{\APLa}\APLmb{
\APLt}\APLmb{\APLe}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLnine}\APLmb{
\APLfive}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLC}\APLmb{\APLa}\APLmb{\APLp}\APLmb{\APLi}\APLmb{\APLt}\APLmb{
\APLa}\APLmb{\APLl}\APLmb{\APLspace}\APLmb{\APLS}\APLmb{\APLm}
\APLmb{\APLi}\APLmb{\APLt}\APLmb{\APLh}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLnine}\APLmb{
\APLfive}\APLmb{\APLtwo}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLC}\APLmb{\APLa}\APLmb{\APLp}\APLmb{\APLi}\APLmb{\APLt}\APLmb{
\APLa}\APLmb{\APLl}\APLmb{\APLspace}\APLmb{\APLJ}\APLmb{\APLo}
\APLmb{\APLn}\APLmb{\APLe}\APLmb{\APLs}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLnine}\APLmb{
\APLsix}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLP}\APLmb{\APLa}\APLmb{\APLi}\APLmb{\APLd}\APLmb{\APLbar}
\APLmb{\APLi}\APLmb{\APLn}\APLmb{\APLspace}\APLmb{\APLc}\APLmb{
\APLa}\APLmb{\APLp}\APLmb{\APLi}\APLmb{\APLt}\APLmb{\APLa}\APLmb{
\APLl}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLnine}\APLmb{
\APLsix}\APLmb{\APLnine}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLR}\APLmb{\APLe}\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLi}\APLmb{
\APLn}\APLmb{\APLe}\APLmb{\APLd}\APLmb{\APLspace}\APLmb{\APLi}
\APLmb{\APLn}\APLmb{\APLc}\APLmb{\APLo}\APLmb{\APLm}\APLmb{
\APLe}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLnine}\APLmb{
\APLseven}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLO}\APLmb{\APLp}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLi}
\APLmb{\APLn}\APLmb{\APLg}\APLmb{\APLspace}\APLmb{\APLb}\APLmb{
\APLa}\APLmb{\APLl}\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLc}\APLmb{
\APLe}\APLmb{\APLspace}\APLmb{\APLs}\APLmb{\APLh}\APLmb{\APLe}
\APLmb{\APLe}\APLmb{\APLt}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLnine}\APLmb{
\APLseven}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLB}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLa}\APLmb{\APLn}\APLmb{
\APLc}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLs}\APLmb{\APLh}
\APLmb{\APLe}\APLmb{\APLe}\APLmb{\APLt}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLnine}\APLmb{
\APLseven}\APLmb{\APLtwo}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLI}\APLmb{\APLn}\APLmb{\APLc}\APLmb{\APLo}\APLmb{\APLm}\APLmb{
\APLe}\APLmb{\APLspace}\APLmb{\APLs}\APLmb{\APLt}\APLmb{\APLa}
\APLmb{\APLt}\APLmb{\APLe}\APLmb{\APLm}\APLmb{\APLe}\APLmb{
\APLn}\APLmb{\APLt}
\APLspace\par
\end{APLarray}
%
% fig4.tex
%
\end{minipage}
\caption{The Chart of Accounts \label{chart}}
}
\end{figure*}

The journal is a chronological documentation of transactions.
After two transactions the journal of \corp\ is shown in figure
\ref{journal}.

% The internal representation of the journal
\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig5}
%
%
% fig5.tex
%
% FIG5 FIGURE_5
\begin{APLarray}
\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLspace\par
\APLmb{\APLdownarrow}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{
\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLdot}
\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLthree}\APLmb{\APLone}\APLmb{
\APLslash}\APLmb{\APLone}\APLmb{\APLtwo}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLC}\APLmb{\APLo}\APLmb{
\APLm}\APLmb{\APLm}\APLmb{\APLo}\APLmb{\APLn}\APLmb{\APLspace}
\APLmb{\APLS}\APLmb{\APLt}\APLmb{\APLo}\APLmb{\APLc}\APLmb{
\APLk}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLA}\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLfive}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLA}\APLmb{\APLnine}\APLmb{
\APLsix}\APLmb{\APLzero}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{
\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLquote}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}
\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLdot}
\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLthree}\APLmb{\APLone}\APLmb{
\APLslash}\APLmb{\APLone}\APLmb{\APLtwo}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLC}\APLmb{\APLo}\APLmb{
\APLm}\APLmb{\APLm}\APLmb{\APLo}\APLmb{\APLn}\APLmb{\APLspace}
\APLmb{\APLS}\APLmb{\APLt}\APLmb{\APLo}\APLmb{\APLc}\APLmb{
\APLk}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLA}\APLmb{\APLnine}\APLmb{\APLsix}\APLmb{\APLzero}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{
\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLquote}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLdot}
\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLtwo}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLthree}\APLmb{\APLone}\APLmb{
\APLslash}\APLmb{\APLone}\APLmb{\APLtwo}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLB}\APLmb{\APLa}\APLmb{
\APLn}\APLmb{\APLk}\APLmb{\APLspace}\APLmb{\APLl}\APLmb{\APLo}
\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLA}\APLmb{
\APLthree}\APLmb{\APLone}\APLmb{\APLone}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLquote}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLdot}
\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLtwo}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLthree}\APLmb{\APLone}\APLmb{
\APLslash}\APLmb{\APLone}\APLmb{\APLtwo}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLB}\APLmb{\APLa}\APLmb{
\APLn}\APLmb{\APLk}\APLmb{\APLspace}\APLmb{\APLl}\APLmb{\APLo}
\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLA}\APLmb{\APLthree}\APLmb{\APLone}\APLmb{
\APLone}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLA}\APLmb{
\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLquote}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLquote}\APLmb{\APLepsilon}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}
\APLspace\par
\end{APLarray}
%
% fig5.tex
%
\end{minipage}
\caption{The Journal of \corp\ as of 31/12 \label{journal}}
}
\end{figure*}

\end{financial}

\begin{aplese}
For the \APL\ line of thought we use a cunning way of presenting a system
adopted from \cite{abelson}. So, let's assume
for the moment, that the financial accounting
system already exists. Compiling the opening balance sheet of \corp\
requires four steps and is shown in figure \ref{foursteps}.

% The internal representation of the journal
\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
\begin{enumerate}
\item The accountant establishes a new accounting entity:
%
% S1
{\parsep=0pt % begin of dialogue step
\begin{APLbold}\begin{APLexpr}
\APLA\APLP\APLL\protect\APLunderbar\APLC\APLO\APLR\APLP
\APLleftarrow\APLN\APLE\APLW\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\APLI\APLN\APLG\protect\APLunderbar\APLbr\APLE
\APLN\APLT\APLI\APLT\APLbr\APLY\APLspace\APLquote\APLT\APLh
\APLe\APLspace\APLV\APLi\APLe\APLn\APLn\APLa\APLspace\APLA\APLP
\APLL\APLspace\APLC\APLo\APLr\APLp\APLo\APLr\APLa\APLt\APLi\APLo
\APLn\APLquote
\end{APLexpr}\end{APLbold}
% S1
}           % end of dialogue step

\item The accountant records the first two transactions:
%
% S21
{\parsep=0pt % begin of dialogue step
\begin{APLbold}\begin{APLexpr}
\APLA\APLP\APLL\protect\APLunderbar\APLC\APLO\APLR\APLP
\APLleftarrow\APLA\APLP\APLL\protect\APLunderbar\APLC\APLO\APLR
\APLP\APLspace\APLR\APLE\APLC\APLO\APLR\APLD\APLspace\APLquote
\APLthree\APLone\APLslash\APLone\APLtwo\APLquote\APLspace\APLquote
\APLC\APLo\APLm\APLm\APLo\APLn\APLspace\APLS\APLt\APLo\APLc
\APLk\APLquote\APLspace\APLquote\APLA\APLtwo\APLzero\APLzero
\APLquote\APLspace\APLquote\APLA\APLnine\APLsix\APLzero\APLquote
\APLspace\APLfive\APLzero\APLzero\APLzero\APLzero\APLzero
\end{APLexpr}\end{APLbold}
% S21
}           % end of dialogue step
%
% S22
{\parsep=0pt % begin of dialogue step
\begin{APLbold}\begin{APLexpr}
\APLA\APLP\APLL\protect\APLunderbar\APLC\APLO\APLR\APLP
\APLleftarrow\APLA\APLP\APLL\protect\APLunderbar\APLC\APLO\APLR
\APLP\APLspace\APLR\APLE\APLC\APLO\APLR\APLD\APLspace\APLquote
\APLthree\APLone\APLslash\APLone\APLtwo\APLquote\APLspace\APLquote
\APLB\APLa\APLn\APLk\APLspace\APLl\APLo\APLa\APLn\APLquote
\APLspace\APLquote\APLA\APLtwo\APLzero\APLzero\APLquote\APLspace
\APLquote\APLA\APLthree\APLone\APLone\APLquote\APLspace\APLone
\APLzero\APLzero\APLzero\APLzero\APLzero
\end{APLexpr}\end{APLbold}
% S22
}           % end of dialogue step

\item The accountant compiles the balance sheet by closing the books:
%
% S3
{\parsep=0pt % begin of dialogue step
\begin{APLbold}\begin{APLexpr}
\APLA\APLP\APLL\protect\APLunderbar\APLC\APLO\APLR\APLP
\APLleftarrow\APLA\APLP\APLL\protect\APLunderbar\APLC\APLO\APLR
\APLP\APLspace\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLT
\APLH\APLE\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS\APLspace
\APLquote\APLthree\APLone\APLslash\APLone\APLtwo\APLquote
\end{APLexpr}\end{APLbold}
% S3
}           % end of dialogue step

\item The accountant prints the opening balance sheet:
%
% S4
{\parsep=0pt % begin of dialogue step
\begin{APLbold}\begin{APLexpr}
\APLA\APLleftarrow\APLA\APLP\APLL\protect\APLunderbar\APLC
\APLO\APLR\APLP\APLspace\APLP\APLR\APLI\APLN\APLT\protect
\APLunderbar\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect\APLunderbar
\APLS\APLbr\APLH\APLE\APLE\APLT\APLspace\APLquote\APLthree
\APLone\APLslash\APLone\APLtwo\APLquote
\end{APLexpr}\end{APLbold}
% S4
}           % end of dialogue step

\end{enumerate}
\end{minipage}
\caption{Compiling the Opening Balance Sheet of \corp\ \label{foursteps}}
}
\end{figure*}

\end{aplese}

\begin{aplese}
Finally, we summarize our findings and at the end of the section we are
ready to present the way for establishing a new accounting entity in \APL.
An accounting entity has a journal, a ledger and a company name.
For accessing accounts in the ledger we add account keys and for
closing the books a closing order.
For opening the books we have to be able to restore the closing
journal entries (which we shall explain later). Therefore, we
remember the number of lines in the journal before starting
the closing of the accounts.
We model the data structure
describing an accounting entity as generalized
array with six elements:


% data structure accounting entity
%
% \input{ds1}
%
%
% ds1.tex
%

% data structure accounting entity
\begin{APLline}
\ace := \APLless journal\APLgreater
        \APLless ledger\APLgreater
        \APLless account keys\APLgreater
        \APLless closing order\APLgreater
        \APLless number of journal lines before closing\APLgreater
        \APLless company name\APLgreater
\end{APLline}

%
% ds1.tex
%

In figure \ref{journal} we have shown the boxed representation of a journal --
a matrix with seven columns:

% data structure journal
%
% \input{ds2}
%
%
% ds2.tex
%

% data structure accounting entity

\begin{APLline}
\APLless journal\APLgreater :=
        \APLless journal entry number column\APLgreater
        \APLless date column\APLgreater
        \APLless explanation column\APLgreater
        \APLless posting reference column\APLgreater
        \APLless debit column\APLgreater
        \APLless credit column\APLgreater
        \APLless dual account column\APLgreater
\end{APLline}

%
% ds2.tex
%

A new and, therefore, empty journal has zero lines and seven columns and is
the explicit result of the niladic function NEW\_JOURNAL.

\begin{APLfns}
% NEW_JOURNAL
\begin{APLline}
\APLless journal \APLgreater
\APLleftarrow
{\bf NEW\_JOURNAL}
\end{APLline}
\vspace{2mm}
% NEW_JOURNAL
%
% \input{c38}
%
%
% c38.tex
%
% C38 NEW_JOURNAL
\begin{APLline}
{\bf
\APLN\APLE\APLW\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN
\APLA\APLL
}
\APLcolon\APLzero\APLspace\APLseven\APLrho\APLzero
\end{APLline}
%
% c38.tex
%
\end{APLfns}

A ledger is a list of accounts, a new ledger an empty list of accounts:

\begin{APLfns}
% datastructure ledger
%
% \input{ds3}
%
%
% ds3.tex
%

% data structure ledger

\begin{APLline}
\APLless ledger \APLgreater :=
        \APLless list of accounts\APLgreater
\end{APLline}

%
% ds3.tex
%
% datastructure list of accounts
%
% \input{ds4}
%
%
% ds4.tex
%

% data structure list of accounts

\begin{APLline}
\APLless list of accounts\APLgreater :=
        \APLless account\APLgreater \APLstile
        \APLless account\APLgreater
        \APLless list of accounts\APLgreater
\end{APLline}

%
% ds4.tex
%
\vspace{2mm}
% NEW_LEDGER
\begin{APLline}
\APLless ledger \APLgreater
\APLleftarrow
{\bf NEW\_LEDGER}
\end{APLline}
\vspace{2mm}
% NEW_LEDGER
%
% \input{c39}
%
%
% c39.tex
%
% C39 NEW_LEDGER
\begin{APLline}
{\bf
\APLN\APLE\APLW\protect\APLunderbar\APLL\APLE\APLD\APLG\APLE
\APLR
}
\APLcolon\APLzero\APLrho\APLzero
\end{APLline}
%
% c39.tex
%
\end{APLfns}

For large companies with many accounts in the ledger, a linear
search in the ledger becomes too slow and the implementation of more
sophisticated access methods (e.g. hashing, balanced trees) becomes
mandatory. To minimize changes in the application we have encapsulated
the computation of the index of an account in the ledger with
the help of an abstract data type. Since we have teaching in mind,
and accounting exercises usually affect only a small number of accounts,
a linear list of account keys is sufficient.

\begin{APLfns}
% datastructure account keys
%
% \input{ds7}
%
%
% ds7.tex
%

% data structure account keys

\begin{APLline}
\APLless account keys \APLgreater :=
        \APLless list of account keys\APLgreater
\end{APLline}

%
% ds7.tex
%
% datastructure list of account keys
%
% \input{ds8}
%
%
% ds8.tex
%

% data structure list of account keys

\begin{APLline}
\APLless list of account keys\APLgreater :=
        \APLless account key\APLgreater \APLstile
        \APLless account key\APLgreater
        \APLless list of account keys\APLgreater
\end{APLline}

%
% ds8.tex
%
\vspace{2mm}
% NEW_ACCOUNT_KEYS
\begin{APLline}
\APLless account keys \APLgreater
\APLleftarrow
{\bf NEW\_ACCOUNT\_KEYS}
\end{APLline}
% ADD_KEY
\begin{APLline}
\APLless account keys \APLgreater
\APLleftarrow
\APLless account keys \APLgreater
{\bf ADD\_KEY}
\APLless account key \APLgreater
\end{APLline}
% ACCESS_KEY
\begin{APLline}
\APLless index \APLgreater
\APLleftarrow
\APLless account keys \APLgreater
{\bf ACCESS\_KEY}
\APLless account key \APLgreater
\end{APLline}
\vspace{2mm}
% NEW_ACCOUNT_KEYS
%
% \input{c35}
%
%
% c35.tex
%
% C35 NEW_ACCOUNT_KEYS
\begin{APLline}
{\bf
\APLN\APLE\APLW\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU
\APLN\APLT\protect\APLunderbar\APLK\APLE\APLY\APLS
}
\APLcolon\APLzero\APLrho\APLzero
\end{APLline}
%
% c35.tex
%
% ADD_KEY
%
% \input{c2}
%
%
% c2.tex
%
% C2 ADD_KEY
\begin{APLline}
{\bf
\APLA\APLD\APLD\protect\APLunderbar\APLK\APLE\APLY
}
\APLcolon\APLalpha\APLcomma\APLleftshoe\APLomega
\end{APLline}
%
% c2.tex
%
% ACCESS_KEY
%
% \input{c1}
%
%
% c1.tex
%
% C1 ACCESS_KEY
\begin{APLline}
{\bf
\APLA\APLC\APLC\APLE\APLS\APLS\protect\APLunderbar\APLK\APLE
\APLY
}
\APLcolon\APLalpha\APLiota\APLleftshoe\APLomega
\end{APLline}
%
% c1.tex
%
\end{APLfns}

For the closing order we provide the function NEW\_CLOSING\_ORDER whose
presentation we defer to section \ref{preparationsec}. In figure \ref{account}
we have shown the boxed re\-presentation of an account. An account is a vector
of four elements, namely account key, account name, account type and account
contents. The latter, the account contents, is a six column matrix which is
empty at the creation time of an account:

\begin{APLfns}
% datastructure account
%
% \input{ds5}
%
%
% ds5.tex
%

% data structure account

\begin{APLline}
\APLless account\APLgreater := \key
        \APLless account name\APLgreater
        \APLless account type\APLgreater
        \APLless account contents\APLgreater
\end{APLline}

%
% ds5.tex
%
% datastructure account contents
%
% \input{ds6}
%
%
% ds6.tex
%

% data structure account contents

\begin{APLline}
\APLless account contents\APLgreater :=
        \APLless date column\APLgreater
        \APLless explanation column\APLgreater
        \APLless journal entry number column\APLgreater
        \APLless dual account column\APLgreater
        \APLless debit column\APLgreater
        \APLless credit column\APLgreater
\end{APLline}

%
% ds6.tex
%
\end{APLfns}

The function NEW\_ACCOUNT generates an empty account and appends the
account to the ledger and the account key to the account keys.

\begin{APLfns}
\begin{APLline}
\ace \APLleftarrow \ace {\bf NEW\_ACCOUNT} \APLless account key \APLgreater
\APLless account name \APLgreater
\APLless account type \APLgreater
\end{APLline}
\vspace{2mm}
% NEW_ACCOUNT
%
% \input{c34}
%
%
% c34.tex
%
% C34 NEW_ACCOUNT
\begin{APLline}
{\bf
\APLN\APLE\APLW\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU
\APLN\APLT
}
\APLcolon\APLleftparen\APLone\APLuparrow\APLalpha
\APLrightparen\APLcomma\APLleftparen\APLleftparen\APLtwo\APLrightshoe
\APLalpha\APLrightparen\APLcomma\APLleftshoe\APLomega\APLcomma
\APLleftshoe\APLzero\APLspace\APLsix\APLrho\APLzero\APLrightparen
\APLleftparen\APLleftparen\APLthree\APLrightshoe\APLalpha
\APLrightparen\APLA\APLD\APLD\protect\APLunderbar\APLK\APLE\APLY
\APLuparrow\APLomega\APLrightparen\APLcomma\APLthree\APLdownarrow
\APLalpha
\end{APLline}
%
% c34.tex
%
\end{APLfns}

Each organization usually has its own chart of accounts and its
own scheme of coding account keys. The function NEW\_CHART\_OF\_ACCOUNTS
shown in appendix \ref{appchart} generates the chart of accounts shown in figure
\ref{chart} used in the case study. The function NEW\_BOOKS will be discussed at the end of
section \ref{transactionsec} and in section \ref{accts}. Last but not least, the function
NEW\_ACCOUNTING\_ENTITY hides all these details from the user:

\begin{APLfns}
\begin{APLline}
\ace \APLleftarrow {\bf NEW\_ACCOUNTING\_ENTITY} \APLless company name \APLgreater
\end{APLline}
\vspace{2mm}
% NEW_ACCOUNTING_ENTITY
%
% \input{c36}
%
%
% c36.tex
%
% C36 NEW_ACCOUNTING_ENTITY
\begin{APLline}
{\bf
\APLN\APLE\APLW\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU
\APLN\APLT\APLI\APLN\APLG\protect\APLunderbar\APLE\APLN\APLT
\APLI\APLT\APLY
}
\APLcolon\APLN\APLE\APLW\protect\APLunderbar\APLC\APLH\APLA
\APLR\APLT\protect\APLunderbar\APLO\APLF\protect\APLunderbar
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLS\APLspace\APLN\APLE\APLW
\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA\APLL
\APLspace\APLN\APLE\APLW\protect\APLunderbar\APLL\APLE\APLD\APLG\APLE
\APLR\APLspace\APLN\APLE\APLW\protect\APLunderbar\APLA\APLC
\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar\APLK\APLE\APLY\APLS
\APLleftparen\APLN\APLE\APLW\protect\APLunderbar\APLB\APLO\APLO
\APLK\APLS\APLspace\APLN\APLE\APLW\protect\APLunderbar\APLC
\APLL\APLO\APLS\APLI\APLN\APLG\protect\APLunderbar\APLO\APLR\APLD
\APLE\APLR\APLrightparen\APLleftparen\APLuparrow\APLrho\APLN
\APLE\APLW\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA
\APLL\APLrightparen\APLomega
\end{APLline}
%
% c36.tex
%
\end{APLfns}

\end{aplese}

\section{Effects of Transactions} \label{transactionsec}

\begin{financial}
On January 1 \corp's first business period starts and the accountant
opens the books for recording the following transactions:

{\partopsep=0pt\topsep=0pt\parskip=0pt\parsep=0pt\itemsep=0pt\parindent=0pt
\begin{transaction}
On January 2 we acquire \APL\ interpreters and products from a software
company for \cur 200,000.
{\sc (PURCHASE FOR CASH)}
\end{transaction}
\begin{transaction}
On January 3 \corp\ buys some fancy graphic workspaces for \cur 10,000 from
a small company. Payment does not have to be made for 45 days.
{\sc (PURCHASES ON CREDIT)}
\end{transaction}
\begin{transaction}
On January 7 \corp\ acquires store equipment for a total of \cur 20,500.
A cash down payment of \cur 5,000 is made, the rest is due in sixty days.
{\sc (PURCHASE FOR CASH PLUS CREDIT)}
\end{transaction}
\begin{transaction}
On January 9 \corp\ sells a store showcase to a neighboring company for \cur 500
to be paid within 30 days. This happens to be exactly equal to its cost.
{\sc (SALE ON CREDIT)}
\end{transaction}
\begin{transaction}
On January 11 \corp\ returns manuals for \cur 1,200 which have been acquired on January 3
to the small company for full credit.
{\sc (RETURN OF MERCHANDISE TO THE SUPPLIER)}
\end{transaction}
\begin{transaction}
On January 12 \corp\ pays \cur 2,000 to the small company.
{\sc (PAYMENTS TO CREDITORS)}
\end{transaction}
\begin{transaction}
On January 13 \corp\ collects \cur 400 of the \cur 500 owed by the neighboring
company.
{\sc (COLLECTIONS FROM DEBTORS)}
\end{transaction}
}

We show the journal entries for these transactions in figure \ref{journal1}
and we analyze the effects of the transactions on the balance sheet.
Check that the balance sheet equation holds for all transactions.

% The journal entries for transactions (3) -- (9)
\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig7}
%
%
% fig7.tex
%
% FIG7 FIGURE_7
\begin{APLarray}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLfour}\APLmb{
\APLspace}\APLmb{\APLtwo}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{
\APLthree}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLP}\APLmb{
\APLu}\APLmb{\APLr}\APLmb{\APLc}\APLmb{\APLh}\APLmb{\APLa}
\APLmb{\APLs}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLone}\APLmb{\APLone}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}
\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLfour}\APLmb{
\APLspace}\APLmb{\APLtwo}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{
\APLthree}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLP}\APLmb{
\APLu}\APLmb{\APLr}\APLmb{\APLc}\APLmb{\APLh}\APLmb{\APLa}
\APLmb{\APLs}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLtwo}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLone}
\APLmb{\APLone}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLfive}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLslash}\APLmb{\APLone}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{
\APLfour}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLP}\APLmb{
\APLu}\APLmb{\APLr}\APLmb{\APLc}\APLmb{\APLh}\APLmb{\APLa}
\APLmb{\APLs}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLo}\APLmb{
\APLn}\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLr}\APLmb{\APLe}
\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLt}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLone}\APLmb{\APLone}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLthree}\APLmb{\APLthree}\APLmb{
\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLfive}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLslash}\APLmb{\APLone}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{
\APLfour}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLP}\APLmb{
\APLu}\APLmb{\APLr}\APLmb{\APLc}\APLmb{\APLh}\APLmb{\APLa}
\APLmb{\APLs}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLo}\APLmb{
\APLn}\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLr}\APLmb{\APLe}
\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLt}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLthree}\APLmb{\APLthree}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLone}\APLmb{\APLone}\APLmb{
\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{
\APLspace}\APLmb{\APLseven}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{
\APLfive}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLP}\APLmb{
\APLu}\APLmb{\APLr}\APLmb{\APLc}\APLmb{\APLh}\APLmb{\APLa}
\APLmb{\APLs}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLf}\APLmb{
\APLo}\APLmb{\APLr}\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLa}
\APLmb{\APLs}\APLmb{\APLh}\APLmb{\APLspace}\APLmb{\APLp}\APLmb{
\APLl}\APLmb{\APLu}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{\APLc}
\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLt}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLzero}
\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLfive}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLD}\APLmb{\APLi}\APLmb{
\APLv}\APLmb{\APLdot}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{
\APLspace}\APLmb{\APLseven}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{
\APLfive}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLP}\APLmb{
\APLu}\APLmb{\APLr}\APLmb{\APLc}\APLmb{\APLh}\APLmb{\APLa}
\APLmb{\APLs}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLf}\APLmb{
\APLo}\APLmb{\APLr}\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLa}
\APLmb{\APLs}\APLmb{\APLh}\APLmb{\APLspace}\APLmb{\APLp}\APLmb{
\APLl}\APLmb{\APLu}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{\APLc}
\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLt}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLD}\APLmb{\APLi}\APLmb{
\APLv}\APLmb{\APLdot}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{
\APLspace}\APLmb{\APLseven}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{
\APLfive}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLP}\APLmb{
\APLu}\APLmb{\APLr}\APLmb{\APLc}\APLmb{\APLh}\APLmb{\APLa}
\APLmb{\APLs}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLf}\APLmb{
\APLo}\APLmb{\APLr}\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLa}
\APLmb{\APLs}\APLmb{\APLh}\APLmb{\APLspace}\APLmb{\APLp}\APLmb{
\APLl}\APLmb{\APLu}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{\APLc}
\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLt}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLthree}
\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLone}\APLmb{\APLfive}\APLmb{\APLfive}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLD}\APLmb{\APLi}
\APLmb{\APLv}\APLmb{\APLdot}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLseven}\APLmb{
\APLspace}\APLmb{\APLnine}\APLmb{\APLslash}\APLmb{\APLone}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{
\APLsix}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLS}\APLmb{
\APLa}\APLmb{\APLl}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLo}
\APLmb{\APLn}\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLr}\APLmb{
\APLe}\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLt}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{
\APLthree}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLfive}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLzero}\APLmb{
\APLfive}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLseven}\APLmb{
\APLspace}\APLmb{\APLnine}\APLmb{\APLslash}\APLmb{\APLone}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{
\APLsix}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLS}\APLmb{
\APLa}\APLmb{\APLl}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLo}
\APLmb{\APLn}\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLr}\APLmb{
\APLe}\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLt}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLzero}\APLmb{
\APLfive}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{
\APLthree}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLeight}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLone}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{
\APLseven}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLR}\APLmb{
\APLe}\APLmb{\APLt}\APLmb{\APLu}\APLmb{\APLr}\APLmb{\APLn}
\APLmb{\APLspace}\APLmb{\APLo}\APLmb{\APLf}\APLmb{\APLspace}\APLmb{
\APLm}\APLmb{\APLe}\APLmb{\APLr}\APLmb{\APLc}\APLmb{\APLh}
\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLs}
\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLt}\APLmb{\APLo}\APLmb{
\APLspace}\APLmb{\APLt}\APLmb{\APLh}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLs}\APLmb{\APLu}\APLmb{\APLp}\APLmb{\APLp}\APLmb{
\APLl}\APLmb{\APLi}\APLmb{\APLe}\APLmb{\APLr}\APLmb{\APLspace}
\APLmb{\APLA}\APLmb{\APLthree}\APLmb{\APLthree}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLone}\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLone}\APLmb{\APLone}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLeight}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLone}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{
\APLseven}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLR}\APLmb{
\APLe}\APLmb{\APLt}\APLmb{\APLu}\APLmb{\APLr}\APLmb{\APLn}
\APLmb{\APLspace}\APLmb{\APLo}\APLmb{\APLf}\APLmb{\APLspace}\APLmb{
\APLm}\APLmb{\APLe}\APLmb{\APLr}\APLmb{\APLc}\APLmb{\APLh}
\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLs}
\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLt}\APLmb{\APLo}\APLmb{
\APLspace}\APLmb{\APLt}\APLmb{\APLh}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLs}\APLmb{\APLu}\APLmb{\APLp}\APLmb{\APLp}\APLmb{
\APLl}\APLmb{\APLi}\APLmb{\APLe}\APLmb{\APLr}\APLmb{\APLspace}
\APLmb{\APLA}\APLmb{\APLone}\APLmb{\APLone}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}
\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLA}\APLmb{\APLthree}\APLmb{\APLthree}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLnine}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLtwo}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLeight}
\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLP}\APLmb{
\APLa}\APLmb{\APLy}\APLmb{\APLm}\APLmb{\APLe}\APLmb{\APLn}\APLmb{
\APLt}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{\APLt}\APLmb{\APLo}
\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLr}\APLmb{\APLe}
\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLt}\APLmb{\APLo}\APLmb{\APLr}
\APLmb{\APLs}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLA}\APLmb{\APLthree}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLA}\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLnine}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLtwo}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLeight}
\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLP}\APLmb{
\APLa}\APLmb{\APLy}\APLmb{\APLm}\APLmb{\APLe}\APLmb{\APLn}\APLmb{
\APLt}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{\APLt}\APLmb{\APLo}
\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLr}\APLmb{\APLe}
\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLt}\APLmb{\APLo}\APLmb{\APLr}
\APLmb{\APLs}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLA}\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLA}\APLmb{\APLthree}\APLmb{\APLthree}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLthree}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLnine}
\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLC}\APLmb{
\APLo}\APLmb{\APLl}\APLmb{\APLl}\APLmb{\APLe}\APLmb{\APLc}\APLmb{
\APLt}\APLmb{\APLi}\APLmb{\APLo}\APLmb{\APLn}\APLmb{\APLspace}
\APLmb{\APLf}\APLmb{\APLr}\APLmb{\APLo}\APLmb{\APLm}\APLmb{
\APLspace}\APLmb{\APLd}\APLmb{\APLe}\APLmb{\APLb}\APLmb{\APLt}
\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLfour}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLA}
\APLmb{\APLtwo}\APLmb{\APLthree}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLthree}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLnine}
\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLC}\APLmb{
\APLo}\APLmb{\APLl}\APLmb{\APLl}\APLmb{\APLe}\APLmb{\APLc}\APLmb{
\APLt}\APLmb{\APLi}\APLmb{\APLo}\APLmb{\APLn}\APLmb{\APLspace}
\APLmb{\APLf}\APLmb{\APLr}\APLmb{\APLo}\APLmb{\APLm}\APLmb{
\APLspace}\APLmb{\APLd}\APLmb{\APLe}\APLmb{\APLb}\APLmb{\APLt}
\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLtwo}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLfour}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLA}
\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\end{APLarray}
%
% fig7.tex
%
\end{minipage}
\caption{The Journal of \corp\ for Transactions (3) -- (9) \label{journal1}}
}
\end{figure*}

{\partopsep=0pt\topsep=0pt\parskip=2pt\parsep=0pt\itemsep=0pt\parindent=0pt
(3) {\sc (PURCHASE FOR CASH)} The purchase of merchandise for cash increases
                              the {\em Merchandise inventory} (asset) by \cur 200,000 and decreases
                              {\em Cash} (asset) by \cur 200,000.

(4) {\sc (PURCHASES ON CREDIT)} Buying merchandise on credit (on open account)
                              creates a debt. The debt is shown in the balance
                              sheet as {\em Accounts payable} (liability). Thus this
                              merchandise purchase on account increased the
                              {\em Merchandise inventory} (asset) by \cur 10,000 and increased
                              the {\em Accounts payable} (liability) by \cur 10,000.

(5) {\sc (PURCHASE FOR CASH PLUS CREDIT)} This is the first example of a compound
                              transaction which affects more than two accounts
                              simultaneously. {\em Store equipment} (asset) is increased
                              by \cur 20,500 and {\em Cash} (asset) is decreased by \cur 5,000
                              and {\em Accounts payable} (liability) is increased by \cur 15,500.

(6) {\sc (SALE ON CREDIT)} This transaction is similar to a purchase on credit, except that
                              the {\em Store equipment} (asset) is decreased by \cur 500 and {\em Accounts
                              receivable} (asset) is increased by \cur 500. It does not result
                              in a profit or loss.

(7) {\sc (RETURN OF MERCHANDISE TO THE SUPPLIER)} {\em Merchandise inventory} (asset) is decreased by \cur 1,200
                              and {\em Accounts payable} (liability) is decreased by \cur 1,200.

(8) {\sc (PAYMENTS TO CREDITORS)} {\em Cash} (asset) is decreased by \cur 2,000 and {\em Accounts payable}
                              (liability) is decreased by the same amount.

(9) {\sc (COLLECTIONS FROM DEBTORS)} {\em Cash} (asset) is increased by \cur 400 and {\em Accounts receivable}
                              (asset) is decreased by the same amount.
}

% Analysis of a compound transaction
\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig8}
%
%
% fig8.tex
%
% FIG8 FIGURE_8
\begin{APLarray}
\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{\APLspace}\APLmb{
\APLseven}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{
\APLleftparen}\APLmb{\APLfive}\APLmb{\APLrightparen}\APLmb{
\APLspace}\APLmb{\APLP}\APLmb{\APLu}\APLmb{\APLr}\APLmb{\APLc}
\APLmb{\APLh}\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLf}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLspace}
\APLmb{\APLc}\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLh}\APLmb{
\APLspace}\APLmb{\APLp}\APLmb{\APLl}\APLmb{\APLu}\APLmb{\APLs}
\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLr}\APLmb{\APLe}\APLmb{
\APLd}\APLmb{\APLi}\APLmb{\APLt}\APLmb{\APLspace}\APLmb{\APLA}
\APLmb{\APLzero}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLfive}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLD}\APLmb{\APLi}\APLmb{\APLv}\APLmb{
\APLdot}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{\APLspace}\APLmb{
\APLseven}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{
\APLleftparen}\APLmb{\APLfive}\APLmb{\APLrightparen}\APLmb{
\APLspace}\APLmb{\APLP}\APLmb{\APLu}\APLmb{\APLr}\APLmb{\APLc}
\APLmb{\APLh}\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLf}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLspace}
\APLmb{\APLc}\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLh}\APLmb{
\APLspace}\APLmb{\APLp}\APLmb{\APLl}\APLmb{\APLu}\APLmb{\APLs}
\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLr}\APLmb{\APLe}\APLmb{
\APLd}\APLmb{\APLi}\APLmb{\APLt}\APLmb{\APLspace}\APLmb{\APLA}
\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLfive}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLD}\APLmb{\APLi}\APLmb{\APLv}\APLmb{
\APLdot}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{\APLspace}\APLmb{
\APLseven}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{
\APLleftparen}\APLmb{\APLfive}\APLmb{\APLrightparen}\APLmb{
\APLspace}\APLmb{\APLP}\APLmb{\APLu}\APLmb{\APLr}\APLmb{\APLc}
\APLmb{\APLh}\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLf}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLspace}
\APLmb{\APLc}\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLh}\APLmb{
\APLspace}\APLmb{\APLp}\APLmb{\APLl}\APLmb{\APLu}\APLmb{\APLs}
\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLr}\APLmb{\APLe}\APLmb{
\APLd}\APLmb{\APLi}\APLmb{\APLt}\APLmb{\APLspace}\APLmb{\APLA}
\APLmb{\APLthree}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLfive}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLD}\APLmb{\APLi}\APLmb{\APLv}\APLmb{
\APLdot}
\APLspace\par

\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLzero}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLS}\APLmb{\APLt}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLe}\APLmb{\APLq}\APLmb{\APLu}\APLmb{\APLi}
\APLmb{\APLp}\APLmb{\APLm}\APLmb{\APLe}\APLmb{\APLn}\APLmb{
\APLt}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLsix}\APLmb{\APLspace}\APLmb{\APLD}\APLmb{\APLi}\APLmb{\APLv}
\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLfive}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLseven}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLtwo}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLfive}\APLmb{
\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLseven}\APLmb{\APLspace}
\APLmb{\APLA}\APLmb{\APLnine}\APLmb{\APLseven}\APLmb{\APLone}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{\APLo}\APLmb{
\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLfive}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{\APLo}
\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}
\APLmb{\APLzero}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLB}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLa}\APLmb{
\APLn}\APLmb{\APLc}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLzero}
\APLspace\par

\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLC}\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLh}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLnine}\APLmb{\APLseven}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLfour}
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLone}\APLmb{\APLone}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLone}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLtwo}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLfour}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLsix}\APLmb{\APLspace}\APLmb{\APLD}\APLmb{\APLi}\APLmb{\APLv}
\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLnine}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLthree}
\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}
\APLmb{\APLthree}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}
\APLmb{\APLeight}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLfour}\APLmb{\APLfive}
\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}
\APLmb{\APLnine}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLnine}
\APLmb{\APLseven}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLthree}\APLmb{\APLeight}\APLmb{\APLeight}\APLmb{\APLnine}
\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{
\APLo}\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLfour}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLT}\APLmb{\APLo}\APLmb{\APLt}\APLmb{\APLa}
\APLmb{\APLl}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLfour}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLB}\APLmb{\APLa}
\APLmb{\APLl}\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLc}\APLmb{\APLe}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}
\APLspace\par

\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLthree}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLA}\APLmb{\APLc}\APLmb{\APLc}\APLmb{\APLo}\APLmb{\APLu}
\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{
\APLp}\APLmb{\APLa}\APLmb{\APLy}\APLmb{\APLa}\APLmb{\APLb}\APLmb{
\APLl}\APLmb{\APLe}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLeight}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLone}\APLmb{\APLone}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}
\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLfive}\APLmb{\APLspace}\APLmb{\APLA}
\APLmb{\APLone}\APLmb{\APLone}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLnine}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLtwo}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLsix}\APLmb{\APLspace}\APLmb{\APLD}
\APLmb{\APLi}\APLmb{\APLv}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLone}\APLmb{\APLfive}\APLmb{\APLfive}\APLmb{\APLzero}
\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLtwo}\APLmb{\APLthree}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{
\APLnine}\APLmb{\APLseven}\APLmb{\APLone}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}\APLmb{\APLtwo}
\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{
\APLo}\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLtwo}\APLmb{\APLfive}\APLmb{
\APLfive}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{\APLo}
\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}
\APLmb{\APLfive}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLB}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLa}\APLmb{
\APLn}\APLmb{\APLc}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLzero}
\APLspace\par
\end{APLarray}
%
% fig8.tex
%
\end{minipage}
\caption{Analysis of Compound Transaction (5) \label{analysis}}
}
\end{figure*}

In figure \ref{analysis} we illustrate how transaction (5) affects
the ledger accounts. The rules for making entries in the ledger accounts
used in transactions (1) to (9) can be summarized as follows
(we use ``debit'' as synonym for ``left'' and ``credit'' as synonym for ``right''):

Asset accounts have left-hand (debit) balances. (The total of the debit column is larger
than the total of the credit column.) Entries on the left-hand (debit) side increase,
entries on the right-hand (credit) side decrease assets.

Liability and owner's equity have right-hand (credit) balances. Entries on the
right-hand (credit) side increase and entries on the left-hand (debit) side decrease
liabilities and owner's equity.

The balance of an account is computed by simply deducting the smaller total amount
from the larger.

Let us turn now to the more mechanical aspects of the recording process. In a first
step, from source documents like invoices, checks etc.
 the accountant prepares  an
analysis of the transaction which is subsequently placed (``journalized'') in
a book of original entry (e.g. the general journal). In the next step the
amounts from the journal are transferred (``posted'') to the appropriate
accounts in the ledger. Note, how in figure \ref{analysis} cross-referencing
between journal entry and ledger accounts occurs: The fourth column of the
journal entry, the posting reference column, indicates to which account the
amount has been posted. The first columns of the debit and
credit side (the journal reference columns) in the T-accounts contain the journal entry number.
All accounts affected by a transaction can be easily tracked
because of keyed entries.
\end{financial}

\begin{aplese}
>From transaction (5) we have learned to distinguish simple and compound transactions:

\begin{APLfns}
% data structure transaction
%
% \input{ds12}
%
%
% ds12.tex
%

% data structure transaction

\begin{APLline}
\APLless transaction \APLgreater := \APLless simple transaction \APLgreater
        \APLstile
        \APLless compound transaction \APLgreater
\end{APLline}

%
% ds12.tex
%
\end{APLfns}

% A simple transaction
\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig9}
%
%
% fig9.tex
%
% FIG9 FIGURE_9
\begin{APLarray}
\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{
\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLdot}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLnine}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLleftparen}\APLmb{
\APLsix}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLS}\APLmb{
\APLa}\APLmb{\APLl}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLo}
\APLmb{\APLn}\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLr}\APLmb{
\APLe}\APLmb{\APLd}\APLmb{\APLi}\APLmb{\APLt}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLA}\APLmb{\APLtwo}
\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLA}\APLmb{\APLzero}\APLmb{
\APLfive}\APLmb{\APLzero}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLfive}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLquote}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLquote}\APLmb{\APLepsilon}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}
\APLspace\par
\end{APLarray}
%
% fig9.tex
%
\end{minipage}
\caption{Structure of a Simple Transaction \label{simpletransaction}}
}
\end{figure*}

Figure \ref{simpletransaction} shows the data structure of a simple
transaction, a five element vector.

\begin{APLfns}
% data structure simple transaction
%
% \input{ds13}
%
%
% ds13.tex
%
% data structure simple transaction

\begin{APLline}
\APLless simple transaction \APLgreater := \dat
        \APLless explanation \APLgreater
        \APLless account key debit \APLgreater
        \APLless account key credit \APLgreater
        \APLless amount of money \APLgreater
\end{APLline}

%
% ds13.tex
%
\end{APLfns}

To journalize a simple transaction, all we have to do is to prepare
the journal entry lines for the debit and credit accounts, laminate them
and catenate the resulting matrix to the journal. Because of writing pure
functional programs we provide a list of journal entry lines
and the new journal as explicit result.

% JOURNALIZE_SIMPLE_ENTRY
\begin{APLfns}
\begin{APLline}
(\APLless list of journal entry lines \APLgreater
\APLless journal \APLgreater)
\APLleftarrow
\APLless journal \APLgreater
{\bf JOURNALIZE\_SIMPLE\_ENTRY}
\APLless simple transaction \APLgreater
\end{APLline}
\vspace{2mm}
% JOURNALIZE_SIMPLE_ENTRY
%
% \input{c32}
%
%
% c32.tex
%
% C32 JOURNALIZE_SIMPLE_ENTRY
\begin{APLline}
{\bf
\APLJ\APLO\APLU\APLR\APLN\APLA\APLL\APLI\APLZ\APLE\protect
\APLunderbar\APLS\APLI\APLM\APLP\APLL\APLE\protect\APLunderbar
\APLE\APLN\APLT\APLR\APLY
}
\APLcolon\APLleftparen\APLleftshoe\APLleftbracket\APLtwo
\APLrightbracket\APLM\APLrightparen\APLleftparen\APLalpha\APLcomma
\APLleftbracket\APLone\APLrightbracket\APLM\APLleftarrow
\APLleftparen\APLone\APLspace\APLone\APLspace\APLone\APLspace\APLone
\APLspace\APLone\APLspace\APLzero\APLspace\APLone\APLslope
\APLleftparen\APLone\APLplus\APLuparrow\protect\APLoverbar\APLone
\APLspace\APLone\APLuparrow\APLalpha\APLrightparen\APLcomma
\APLleftparen\APLone\APLspace\APLone\APLspace\APLone\APLspace
\APLzero\APLspace\APLone\APLslash\APLomega\APLrightparen\APLcomma
\APLomega\APLleftbracket\APLfour\APLrightbracket\APLrightparen
\APLcomma\APLleftbracket\APLzero\APLdot\APLfive\APLrightbracket
\APLone\APLspace\APLone\APLspace\APLone\APLspace\APLone
\APLspace\APLzero\APLspace\APLone\APLspace\APLone\APLslope
\APLleftparen\APLone\APLplus\APLuparrow\protect\APLoverbar\APLone\APLspace
\APLone\APLuparrow\APLalpha\APLrightparen\APLcomma
\APLleftparen\APLone\APLspace\APLone\APLspace\APLzero\APLspace\APLone
\APLspace\APLone\APLslash\APLomega\APLrightparen\APLcomma\APLomega
\APLleftbracket\APLthree\APLrightbracket\APLrightparen
\end{APLline}
%
% c32.tex
%
\end{APLfns}

% A compound transaction
\begin{figure*}[htbp]
{\centering
\begin{minipage}{16cm}
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig10}
%
%
% fig10.tex
%
% FIG10 FIGURE_10
\begin{APLarray}
\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{
\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}
\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLdot}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLseven}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLleftparen}\APLmb{
\APLfive}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLP}
\APLmb{\APLu}\APLmb{\APLr}\APLmb{\APLdot}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLdot}
\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{
\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLdot}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLdot}
\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLA}\APLmb{
\APLzero}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLfive}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLfive}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLA}\APLmb{\APLthree}\APLmb{
\APLthree}\APLmb{\APLzero}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLone}\APLmb{\APLfive}\APLmb{\APLfive}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLquote}\APLmb{\APLepsilon}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLepsilon}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}
\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLepsilon}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLepsilon}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{
\APLepsilon}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLquote}\APLmb{\APLepsilon}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLquote}
\APLspace\par
\end{APLarray}
%
% fig10.tex
%
\end{minipage}
\caption{Structure of a Compound Transaction \label{compoundtransaction}}
}
\end{figure*}

The data structure of a compound transaction shown in figure \ref{compoundtransaction}
is a little bit more complicated, but allows for arbitrarily complex transactions:
we have a four element vector whose last two elements are the lists of debit and credit entries.
Each list element is defined as the pair account key/amount of money which specifies an entry.
The BNF of this data structure follows below.

\begin{APLfns}
% data structure compound transaction
%
% \input{ds14}
%
%
% ds14.tex
%
% data structure compound transaction

\begin{APLline}
\APLless compound transaction \APLgreater := \dat
        \APLless explanation \APLgreater
        \APLless debit list \APLgreater
        \APLless credit list \APLgreater
\end{APLline}

%
% ds14.tex
%
% data structure debit list
%
% \input{ds15}
%
%
% ds15.tex
%

% data structure debit list

\begin{APLline}
\APLless debit list \APLgreater := \APLless list item \APLgreater \APLstile
             \APLless list item \APLgreater
             \APLless debit list \APLgreater
\end{APLline}

%
% ds15.tex
%
% data structure credit list
%
% \input{ds16}
%
%
% ds16.tex
%

% data structure credit list

\begin{APLline}
\APLless credit list \APLgreater := \APLless list item \APLgreater \APLstile
             \APLless list item \APLgreater
             \APLless credit list \APLgreater
\end{APLline}

%
% ds16.tex
%
% data structure list item
%
% \input{ds17}
%
%
% ds17.tex
%

% data structure list item

\begin{APLline}
\APLless list item \APLgreater := \key
        \APLless amount of money \APLgreater
\end{APLline}

%
% ds17.tex
%
\end{APLfns}

In journalizing a compound transaction we pursue a similar strategy as for simple
transactions: we prepare the journal entry lines for the debit and credit accounts
and append this matrix to the journal. From the account key/amount of money pairs
of the debit and credit lists we build a three column matrix with the columns
posting reference, debit, and credit. Note, that since the fill item for expand is
the prototype of the matrix, we use the expression \APLone\APLcirclestile\APLomega\
to position the amount of money column in the first position in order to get \APLzero\ as
fill item for expand. By exploiting scalar extension with catenation we are
able to build the columns for the journal entry number, the date, the explanation,
and the dual account in an elegant way.

% JOURNALIZE_COMPOUND_ENTRY
\begin{APLfns}
\begin{APLline}
(\APLless list of journal entry lines \APLgreater
\APLless journal \APLgreater)
\APLleftarrow
\APLless journal \APLgreater
{\bf JOURNALIZE\_COMPOUND\_ENTRY}
\APLless compound transaction \APLgreater
\end{APLline}
\vspace{2mm}
% JOURNALIZE_COMPOUND_ENTRY
%
% \input{c31}
%
%
% c31.tex
%
% C31 JOURNALIZE_COMPOUND_ENTRY
\begin{APLline}
{\bf
\APLJ\APLO\APLU\APLR\APLN\APLA\APLL\APLI\APLZ\APLE\protect
\APLunderbar\APLC\APLO\APLM\APLP\APLO\APLU\APLN\APLD\protect
\APLunderbar\APLE\APLN\APLT\APLR\APLY
}
\APLcolon\APLleftparen\APLleftshoe\APLleftbracket\APLtwo
\APLrightbracket\APLM\APLrightparen\APLleftparen\APLalpha\APLcomma
\APLleftbracket\APLone\APLrightbracket\APLM\APLleftarrow
\APLleftparen\APLone\APLplus\APLuparrow\protect\APLoverbar\APLone
\APLspace\APLone\APLuparrow\APLalpha\APLrightparen\APLcomma
\APLleftbracket\APLtwo\APLrightbracket\APLomega\APLleftbracket
\APLone\APLrightbracket\APLcomma\APLleftbracket\APLtwo
\APLrightbracket\APLomega\APLleftbracket\APLtwo\APLrightbracket\APLcomma
\APLleftbracket\APLtwo\APLrightbracket\APLleftparen\APLleftparen
\protect\APLoverbar\APLone\APLcirclestile\APLone\APLspace
\APLzero\APLspace\APLone\APLslope\APLone\APLcirclestile\APLrightshoe
\APLleftbracket\APLtwo\APLrightbracket\APLthree\APLrightshoe
\APLomega\APLrightparen\APLcomma\APLleftbracket\APLone
\APLrightbracket\protect\APLoverbar\APLone\APLcirclestile\APLzero
\APLspace\APLone\APLspace\APLone\APLslope\APLone\APLcirclestile
\APLrightshoe\APLleftbracket\APLtwo\APLrightbracket\APLfour
\APLrightshoe\APLomega\APLrightparen\APLcomma\APLleftshoe\APLquote\APLD
\APLi\APLv\APLdot\APLquote\APLrightparen
\end{APLline}
%
% c31.tex
%
\end{APLfns}

\end{aplese}
%\end{document}

\begin{financial}
Next, we introduce the subject of income measurement. How did \corp\
perform in its first business period?

% Expense and revenue
{\partopsep=0pt\topsep=0pt\parskip=2pt\parsep=0pt\itemsep=0pt\parindent=0pt
\begin{transaction}
On January 30 \corp\ has sold \APL\ products for \cur 180,000 on open account.
The cost to \corp\ of the inventory sold is \cur 80,000.
\end{transaction}

\begin{transaction}
On January 30 \corp\ pays the store rent of \cur 4,500 for the first quarter of
the year.
\end{transaction}
}

Transaction (10) shows, that \corp\ -- like all companies -- follows a typical
operating cycle: \corp\ used cash to acquire merchandise (transactions (3) and (4)),
which in turn had been sold to customers, who in turn will pay for their purchases
with cash. In order to analyze transaction (10) we split it into two phases:
a revenue phase (10a) and an expense phase (10b). In the revenue phase (10a)
sales on account are an inflow and increase {\em Accounts receivable} (asset)
by \cur 180,000 and increase the owner's equity by \cur 180,000. In the
expense phase (10b) we recognize the cost of inventory sold, we recognize an outflow.
{\em Merchandise inventory} (asset) is decreased by \cur 80,000 and the owner's equity
is decreased by \cur 80,000. Transaction (10) leaves liabilities unaffected, owner's
equity rises by \cur 180,000 - \cur 80,000, or \cur 100,000.

% The journal entries for transactions (10) -- (11)
\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig11}
%
%
% fig11.tex
%
% FIG11 FIGURE_11
\begin{APLarray}
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLone}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLone}
\APLmb{\APLzero}\APLmb{\APLa}\APLmb{\APLrightparen}\APLmb{
\APLspace}\APLmb{\APLS}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLe}
\APLmb{\APLspace}\APLmb{\APLo}\APLmb{\APLn}\APLmb{\APLspace}\APLmb{
\APLo}\APLmb{\APLp}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLspace}
\APLmb{\APLa}\APLmb{\APLc}\APLmb{\APLc}\APLmb{\APLo}\APLmb{
\APLu}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{\APLthree}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLeight}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLeight}\APLmb{\APLzero}
\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLone}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLone}
\APLmb{\APLzero}\APLmb{\APLa}\APLmb{\APLrightparen}\APLmb{
\APLspace}\APLmb{\APLS}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLe}
\APLmb{\APLspace}\APLmb{\APLo}\APLmb{\APLn}\APLmb{\APLspace}\APLmb{
\APLo}\APLmb{\APLp}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLspace}
\APLmb{\APLa}\APLmb{\APLc}\APLmb{\APLc}\APLmb{\APLo}\APLmb{
\APLu}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLeight}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLeight}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{\APLthree}
\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLtwo}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLone}
\APLmb{\APLzero}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{
\APLspace}\APLmb{\APLC}\APLmb{\APLo}\APLmb{\APLs}\APLmb{\APLt}
\APLmb{\APLspace}\APLmb{\APLo}\APLmb{\APLf}\APLmb{\APLspace}\APLmb{
\APLo}\APLmb{\APLn}\APLmb{\APLv}\APLmb{\APLe}\APLmb{\APLn}
\APLmb{\APLt}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLy}\APLmb{
\APLspace}\APLmb{\APLs}\APLmb{\APLo}\APLmb{\APLl}\APLmb{\APLd}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLfour}\APLmb{\APLone}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLeight}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLone}\APLmb{\APLone}\APLmb{
\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLtwo}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLone}
\APLmb{\APLzero}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{
\APLspace}\APLmb{\APLC}\APLmb{\APLo}\APLmb{\APLs}\APLmb{\APLt}
\APLmb{\APLspace}\APLmb{\APLo}\APLmb{\APLf}\APLmb{\APLspace}\APLmb{
\APLo}\APLmb{\APLn}\APLmb{\APLv}\APLmb{\APLe}\APLmb{\APLn}
\APLmb{\APLt}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLy}\APLmb{
\APLspace}\APLmb{\APLs}\APLmb{\APLo}\APLmb{\APLl}\APLmb{\APLd}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLone}\APLmb{\APLone}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLeight}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLfour}\APLmb{\APLone}\APLmb{
\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLthree}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLslash}
\APLmb{\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLone}
\APLmb{\APLone}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{
\APLP}\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLp}\APLmb{\APLa}
\APLmb{\APLi}\APLmb{\APLd}\APLmb{\APLspace}\APLmb{\APLs}\APLmb{
\APLt}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLspace}
\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{
\APLeight}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLfour}\APLmb{\APLfive}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{
\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLthree}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLslash}
\APLmb{\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLone}
\APLmb{\APLone}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{
\APLP}\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLp}\APLmb{\APLa}
\APLmb{\APLi}\APLmb{\APLd}\APLmb{\APLspace}\APLmb{\APLs}\APLmb{
\APLt}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLspace}
\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLfour}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{
\APLeight}\APLmb{\APLone}
\APLspace\par
\end{APLarray}
%
% fig11.tex
%
\end{minipage}
\caption{The Journal of \corp\ for Transactions (10) -- (11) \label{journal2}}
}
\end{figure*}

Revenues are gross increases in assets from delivering goods or services.
To be realized as revenue (recognized in the books as revenue earned in the
current period), the goods and services must be fully rendered (e.g. delivery
to customer), an exchange of resources in the form of a market transaction
must occur (e.g. the buyer pays or promises to pay and the seller delivers
merchandise) and the collectibility of any noncash asset (e.g. {\em Accounts receivable})
must be reasonably assured. In brief, no profit is realized until a sale
is actually made to customers.

Expenses are gross decreases in assets from delivering goods or services.
Expenses are used-up assets and assets are unexpired cost awaiting expiration
in future periods. We never acquire expenses per se, we always acquire goods or
services which become expenses as they are utilized in obtaining revenue.

Profit (earnings, income) is defined as the excess of revenue over expenses.

To recapitulate these relationships, we illustrate these concepts with the help
of the balance sheet equation. Since \corp\ is a corporation, the owner's equity
has two parts: {\em Paid-in capital} denotes the total amount of capital paid
in for common stock, {\em Retained income} is additional owner's equity generated
by profits (and not shown in the opening balance sheet of figure \ref{openbal} since
no profits accrued yet):

\begin{displaymath}
\begin{array}{rcl}
\mbox{Assets} & = & \mbox{Liabilities} + \mbox{Paid-in capital} + \\
\             & \ & + \mbox{Retained income}
\end{array}
\end{displaymath}

>From the definition of profit we immediately get:

\begin{displaymath}
\begin{array}{rcl}
\mbox{Assets} & = & \mbox{Liabilities} + \mbox{Paid-in capital} + \\
\             & \  & + \mbox{Revenue} - \mbox{Expenses}
\end{array}
\end{displaymath}

So, revenue and expense accounts are subdivisions of owner's equity with the
purpose to document changes in owner's equity. The income statement summarizes
revenue and expense accounts and reports the change in owner's equity for
the business period. Figure \ref{unadjustedincome} summarizes the effects of
transaction (10).

% The income statement unadjusted
\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig12}
%
%
% fig12.tex
%
% FIG12 FIGURE_12
\begin{APLarray}
\APLmb{\APLspace}\APLmb{\APLI}\APLmb{\APLn}\APLmb{\APLc}
\APLmb{\APLo}\APLmb{\APLm}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{
\APLs}\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLt}\APLmb{\APLe}\APLmb{
\APLm}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLspace}
\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{\APLo}
\APLmb{\APLf}\APLmb{\APLspace}\APLmb{\APLthree}\APLmb{\APLone}
\APLmb{\APLslash}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{\APLf}
\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLT}\APLmb{\APLh}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLV}\APLmb{\APLi}\APLmb{\APLe}\APLmb{\APLn}\APLmb{
\APLn}\APLmb{\APLa}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLP}
\APLmb{\APLL}\APLmb{\APLspace}\APLmb{\APLC}\APLmb{\APLo}
\APLmb{\APLr}\APLmb{\APLp}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLa}
\APLmb{\APLt}\APLmb{\APLi}\APLmb{\APLo}\APLmb{\APLn}
\APLspace\par
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLC}\APLmb{\APLo}\APLmb{\APLs}\APLmb{\APLt}\APLmb{
\APLspace}\APLmb{\APLo}\APLmb{\APLf}\APLmb{\APLspace}\APLmb{\APLg}
\APLmb{\APLo}\APLmb{\APLo}\APLmb{\APLd}\APLmb{\APLs}\APLmb{
\APLspace}\APLmb{\APLs}\APLmb{\APLo}\APLmb{\APLl}\APLmb{\APLd}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLeight}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{
\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLS}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLe}\APLmb{\APLs}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLeight}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLN}\APLmb{\APLe}
\APLmb{\APLt}\APLmb{\APLspace}\APLmb{\APLi}\APLmb{\APLn}
\APLmb{\APLc}\APLmb{\APLo}\APLmb{\APLm}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLone}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{\APLo}
\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLeight}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLT}\APLmb{\APLo}\APLmb{\APLt}\APLmb{\APLa}
\APLmb{\APLl}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLeight}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\end{APLarray}
%
% fig12.tex
%
\end{minipage}
\caption{The Income Statement of \corp\ as of 31/1 \label{unadjustedincome}}
}
\end{figure*}

We are now in the position to derive the rules for making entries in expense
and revenue accounts from the rules for owner's equity accounts:

Since expense accounts are negative elements of owner's equity,
expense accounts have a left-hand (debit) balance. Entries on the
left-hand (debit) side increase, entries on the right hand (credit)
side decrease expenses. Keep in mind, an increase of expenses is a
decrease of owner's equity.

Because revenue accounts are positive elements of owner's equity,
revenue accounts have a right hand (credit) balance. Entries on the
right-hand (credit) side increase, entries on the left-hand (debit)
side decrease revenues.
\end{financial}

\begin{aplese}
Let us analyze our implementation of posting a journal entry
line once again by reverse engineering.
Suppose, we have the account and the account line which should be posted
to the account, then we only have to append the account line to the
account contents. POST\_3 takes care of this (easy) task.

% POST_3
\begin{APLfns}
\begin{APLline}
\APLless account \APLgreater
\APLleftarrow
\APLless date \APLgreater
\APLless explanation \APLgreater
\APLless journal reference number \APLgreater
\APLless dual account \APLgreater
\APLless debit \APLgreater
\APLless credit \APLgreater
{\bf POST\_3}
\APLless account \APLgreater
\end{APLline}
\vspace{2mm}
% POST_3
%
% \input{c55}
%
%
% c55.tex
%
% C55 POST_3
\begin{APLline}
{\bf
\APLP\APLO\APLS\APLT\protect\APLunderbar\APLthree
}
\APLcolon\APLleftparen\APLthree\APLuparrow\APLomega
\APLrightparen\APLcomma\APLleftshoe\APLleftparen\APLuparrow\protect
\APLoverbar\APLone\APLuparrow\APLomega\APLrightparen\APLcomma
\APLleftbracket\APLone\APLrightbracket\APLalpha
\end{APLline}
%
% c55.tex
%
\end{APLfns}

Suppose next, we know the index of the account to which we want to post the
account line, the account line which we want posted, and we have the ledger.
We first set up the arguments for POST\_3 and call POST\_3 to add the account
line to the account and finally, we insert the new account (the result of POST\_3)
into the ledger. This is the task of POST\_2.

% POST_2
\begin{APLfns}
\begin{APLline}
\APLless ledger \APLgreater
\APLleftarrow
\APLless index of account \APLgreater
\APLless date \APLgreater
\APLless explanation \APLgreater
\APLless journal reference number \APLgreater
\APLless dual account \APLgreater
\APLless debit \APLgreater
\APLless credit \APLgreater
{\bf POST\_2}
\APLless ledger \APLgreater
\end{APLline}
\vspace{2mm}
% POST_2
%
% \input{c54}
%
%
% c54.tex
%
% C54 POST_2
\begin{APLline}
{\bf
\APLP\APLO\APLS\APLT\protect\APLunderbar\APLtwo
}
\APLcolon\APLleftparen\APLleftparen\protect\APLoverbar
\APLone\APLplus\APLuparrow\APLalpha\APLrightparen\APLuparrow
\APLomega\APLrightparen\APLcomma\APLleftparen\APLleftshoe\APLleftparen
\APLone\APLdownarrow\APLalpha\APLrightparen\APLP\APLO\APLS
\APLT\protect\APLunderbar\APLthree\APLleftparen\APLuparrow
\APLomega\APLleftbracket\APLuparrow\APLalpha\APLrightbracket
\APLrightparen\APLrightparen\APLcomma\APLleftparen\APLuparrow\APLalpha
\APLrightparen\APLdownarrow\APLomega
\end{APLline}
%
% c54.tex
%
\end{APLfns}

Next, we have ledger, account keys, the index of the account to which we want to post,
and the journal entry line. POST\_1 basically rearranges the elements of the
journal entry line in the order of an account line and calls POST\_2 to
insert the account line in the account in the ledger. In the process
of posting journal entry lines for transactions (1) to (11) EXPLAIN
simply passes the explanations. So we can -- without
trouble -- defer a full account of the task of EXPLAIN.

% POST_1
\begin{APLfns}
\begin{APLline}
\APLless ledger \APLgreater
\APLleftarrow
(\APLless ledger \APLgreater
\APLless account keys \APLgreater)
{\bf POST\_1}
\APLless index of account \APLgreater
\APLless journal entry line \APLgreater
\end{APLline}
\vspace{2mm}
% POST_1
%
% \input{c53}
%
%
% c53.tex
%
% C53 POST_1
\begin{APLline}
{\bf
\APLP\APLO\APLS\APLT\protect\APLunderbar\APLone
}
\APLcolon\APLleftparen\APLomega\APLleftbracket\APLone
\APLspace\APLthree\APLrightbracket\APLcomma\APLleftparen\APLomega
\APLleftbracket\APLfive\APLrightbracket\APLE\APLX\APLP\APLL\APLA
\APLI\APLN\APLomega\APLleftbracket\APLfour\APLspace\APLeight
\APLrightbracket\APLcomma\APLalpha\APLrightparen\APLcomma\APLomega
\APLleftbracket\APLtwo\APLspace\APLeight\APLspace\APLsix
\APLspace\APLseven\APLrightbracket\APLrightparen\APLP\APLO\APLS\APLT
\protect\APLunderbar\APLtwo\APLuparrow\APLalpha
\end{APLline}
%
% c53.tex
%
\end{APLfns}

Finally we arrive at the function POST, which extracts
ledger and account keys from the accounting entity and
calculates the index of the account to which the
journal entry line should be posted in order to set up
the arguments for POST\_1.

% POST
\begin{APLfns}
\begin{APLline}
\APLless accounting entity \APLgreater
\APLleftarrow
\APLless accounting entity \APLgreater
{\bf POST}
\APLless journal entry line \APLgreater
\end{APLline}
\vspace{2mm}
% POST
%
% \input{c52}
%
%
% c52.tex
%
% C52 POST
\begin{APLline}
{\bf
\APLP\APLO\APLS\APLT
}
\APLcolon\APLleftparen\APLone\APLuparrow\APLalpha
\APLrightparen\APLcomma\APLleftparen\APLleftshoe\APLleftparen\APLalpha
\APLleftbracket\APLtwo\APLspace\APLthree\APLrightbracket
\APLrightparen\APLP\APLO\APLS\APLT\protect\APLunderbar\APLone
\APLleftparen\APLleftparen\APLthree\APLrightshoe\APLalpha\APLrightparen
\APLA\APLC\APLC\APLE\APLS\APLS\protect\APLunderbar\APLK\APLE
\APLY\APLspace\APLfour\APLrightshoe\APLomega\APLrightparen
\APLcomma\APLomega\APLrightparen\APLcomma\APLleftparen\APLtwo
\APLdownarrow\APLalpha\APLrightparen
\end{APLline}
%
% c52.tex
%
\end{APLfns}
\end{aplese}

\begin{aplese}
The task of EXPLAIN is simply to generate meaningful
explanations for accounts which report summaries like
the balance sheet or the income statement.
Of course, normal transactions are never modified by
EXPLAIN. Only opening and closing transactions which
are generated automatically, when the books are opened
or closed, are affected by EXPLAIN. EXPLAIN documents
automatically generated
transactions.

 The niladic
function BOOKS which has been generated from the closing order by
the function NEW\_BOOKS returns a list of account keys of the
summary accounts of the accounting entity. We may think of the
summary accounts arranged in a tree with the balance sheet as root
in the closing process and the opening balance sheet as root in the opening process.
The summary accounts correspond exactly to the ``inner'' nodes of the opening
and the closing tree.
If the
account key is in the list of summary account keys
and if the explanation is meaningless, this means `(ob)' in the
opening process and `(cb)' in the closing process, then
EXPLAIN returns the name of the dual account as explanation catenated
with `(ob)' or `(cb)' to indicate an opening or closing transaction
for the summary.

% EXPLAIN
\begin{APLfns}
\begin{APLline}
\APLless explanation \APLgreater
\APLleftarrow
\APLless account key \APLgreater
{\bf EXPLAIN}
\APLless explanation \APLgreater
\APLless dual account key \APLgreater
\APLless ledger \APLgreater
\APLless account keys \APLgreater
\end{APLline}
\vspace{2mm}
% EXPLAIN
%
% \input{c28}
%
%
% c28.tex
%
% C28 EXPLAIN
\begin{APLline}
{\bf
\APLE\APLX\APLP\APLL\APLA\APLI\APLN
}
\APLcolon\APLE\APLX\APLP\APLL\APLA\APLI\APLN\protect
\APLunderbar\APLone\APLomega\APLcolon\APLleftparen\APLleftparen
\APLquote\APLleftparen\APLo\APLb\APLrightparen\APLquote
\APLequalunderbar\APLuparrow\APLomega\APLrightparen\APLdowncaret\APLquote
\APLleftparen\APLc\APLb\APLrightparen\APLquote\APLequalunderbar
\APLuparrow\APLomega\APLrightparen\APLupcaret\APLleftparen
\APLalpha\APLepsilon\APLB\APLO\APLO\APLK\APLS\APLrightparen\APLcolon
\APLleftshoe\APLleftparen\APLuparrow\APLomega\APLrightparen
\APLcomma\APLquote\APLspace\APLquote\APLcomma\APLtwo\APLrightshoe
\APLleftparen\APLleftparen\APLfour\APLrightshoe\APLomega
\APLrightparen\APLA\APLC\APLC\APLE\APLS\APLS\protect\APLunderbar
\APLK\APLE\APLY\APLleftparen\APLtwo\APLrightshoe\APLomega
\APLrightparen\APLrightparen\APLrightshoe\APLthree\APLrightshoe\APLomega
\end{APLline}
%
% c28.tex
%
\end{APLfns}

Otherwise, we call EXPLAIN\_1 to generate a meaningful explanation
for the account. If the dual account key is in the list of summary
account keys and if the explanation is meaningless, EXPLAIN\_1
returns the name of the summary account catenated with `(ob)' for
opening or `(cb)' for closing as documentation of the automatically
generated transaction.

% EXPLAIN_1
\begin{APLfns}
\begin{APLline}
\APLless explanation \APLgreater
\APLleftarrow
{\bf EXPLAIN\_1}
\APLless explanation \APLgreater
\APLless dual account key \APLgreater
\APLless ledger \APLgreater
\APLless account keys \APLgreater
\end{APLline}
\vspace{2mm}
% EXPLAIN_1
%
% \input{c29}
%
%
% c29.tex
%
% C29 EXPLAIN_1
\begin{APLline}
{\bf
\APLE\APLX\APLP\APLL\APLA\APLI\APLN\protect\APLunderbar
\APLone
}
\APLcolon\APLomega\APLleftbracket\APLone\APLrightbracket
\APLcolon\APLleftparen\APLleftparen\APLquote\APLleftparen\APLo
\APLb\APLrightparen\APLquote\APLequalunderbar\APLuparrow\APLomega
\APLrightparen\APLdowncaret\APLquote\APLleftparen\APLc\APLb
\APLrightparen\APLquote\APLequalunderbar\APLuparrow\APLomega
\APLrightparen\APLupcaret\APLleftparen\APLomega\APLleftbracket
\APLtwo\APLrightbracket\APLepsilon\APLB\APLO\APLO\APLK\APLS
\APLrightparen\APLcolon\APLleftshoe\APLleftparen\APLuparrow\APLomega
\APLrightparen\APLcomma\APLquote\APLspace\APLquote\APLcomma
\APLtwo\APLrightshoe\APLleftparen\APLleftparen\APLfour\APLrightshoe
\APLomega\APLrightparen\APLA\APLC\APLC\APLE\APLS\APLS\protect
\APLunderbar\APLK\APLE\APLY\APLleftparen\APLtwo\APLrightshoe
\APLomega\APLrightparen\APLrightparen\APLrightshoe\APLthree
\APLrightshoe\APLomega
\end{APLline}
%
% c29.tex
%
\end{APLfns}
\end{aplese}

\begin{aplese}
Recording a transaction means journalizing the transaction and
posting a list of journal entry lines. By testing the number
of elements of a transaction, simple and compound transactions
are distinguished.

\begin{APLfns}
\begin{APLline}
\ace \APLleftarrow \ace {\bf RECORD} \APLless transaction \APLgreater
\end{APLline}
\vspace{2mm}
% RECORD
%
% \input{c71}
%
%
% c71.tex
%
% C71 RECORD
\begin{APLline}
{\bf
\APLR\APLE\APLC\APLO\APLR\APLD
}
\APLcolon\APLleftparen\APLleftparen\APLone\APLdownarrow\APLJ
\APLrightparen\APLcomma\APLleftparen\APLone\APLdownarrow
\APLalpha\APLrightparen\APLrightparen\APLP\APLO\APLS\APLT\APLspace
\APLC\APLO\APLL\APLL\APLE\APLC\APLT\APLuparrow\APLJ\APLleftarrow
\APLleftparen\APLuparrow\APLalpha\APLrightparen\APLJ\APLO\APLU
\APLR\APLN\APLA\APLL\APLI\APLZ\APLE\protect\APLunderbar\APLS
\APLI\APLM\APLP\APLL\APLE\protect\APLunderbar\APLE\APLN\APLT
\APLR\APLY\APLomega\APLcolon\APLfour\APLequal\APLrho\APLomega
\APLcolon\APLleftparen\APLleftparen\APLone\APLdownarrow\APLJ
\APLrightparen\APLcomma\APLleftparen\APLone\APLdownarrow\APLalpha
\APLrightparen\APLrightparen\APLP\APLO\APLS\APLT\APLspace\APLC
\APLO\APLL\APLL\APLE\APLC\APLT\APLuparrow\APLJ\APLleftarrow
\APLleftparen\APLuparrow\APLalpha\APLrightparen\APLJ\APLO\APLU\APLR
\APLN\APLA\APLL\APLI\APLZ\APLE\protect\APLunderbar\APLC\APLO
\APLM\APLP\APLO\APLU\APLN\APLD\protect\APLunderbar\APLE\APLN\APLT
\APLR\APLY\APLomega
\end{APLline}
%
% c71.tex
%
\end{APLfns}

The recursive operator COLLECT allows us to use POST with
an arbitrary list of journal entry lines as argument.
More generally, COLLECT maps all functions which
compute a new system state from an old system state and an input symbol
to functions which calculate the current system state from some
starting system state and a list of input symbols.

% COLLECT
\begin{APLfns}
\begin{APLline}
\APLless item \APLgreater
\APLleftarrow
\APLless item \APLgreater
(
\APLless function \APLgreater
COLLECT
)
\APLless list \APLgreater
\end{APLline}
\vspace{2mm}
% COLLECT
%
% \input{col3}
%
%
% col3.tex
%

% COLLECT
\begin{APLline}
{\bf\APLC\APLO\APLL\APLL\APLE\APLC\APLT}\APLcolon\APLleftparen
\APLalpha\APLalphaunderbar
\APLuparrow\APLomega\APLrightparen\APLalphaunderbar
\APLC\APLO\APLL\APLL\APLE\APLC\APLT\APLspace
\APLone\APLdownarrow\APLomega\APLcolon\APLzero\APLequal\APLrho
\APLomega\APLcolon\APLalpha
\end{APLline}


%
% col3.tex
%
\end{APLfns}
\end{aplese}

\begin{aplese}
A short digression on the subject of translating direct definitions
to canonical representations closes this section. Blindly translating
the direct definition of COLLECT results in the following recursive
operator which is highly inefficient in terms of memory usage:

%
% \input{col1}
%
%
% col1.tex
%
% COL1 COLLECT_R
\begin{APLfns}
\begin{APLfnsline}{}{\APLdel}
\APLZ\APLleftarrow\APLA\APLleftparen\APLF\APLspace\APLC\APLO
\APLL\APLL\APLE\APLC\APLT\protect\APLunderbar\APLR
\APLrightparen\APLW
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLrightbracket}{}
\APLrightarrow\APLleftparen\APLzero\APLequal\APLrho\APLW
\APLrightparen\APLslash\APLE\APLN\APLD
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLtwo\APLrightbracket}{}
\APLZ\APLleftarrow\APLleftparen\APLA\APLspace\APLF
\APLuparrow\APLW\APLrightparen\APLF\APLspace\APLC\APLO\APLL\APLL\APLE
\APLC\APLT\APLspace\APLone\APLdownarrow\APLW
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLthree\APLrightbracket}{}
\APLrightarrow\APLzero
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLfour\APLrightbracket}{}
\APLE\APLN\APLD\APLcolon\APLZ\APLleftarrow\APLA
\end{APLfnsline}
\begin{APLfnsline}{}{\APLdel}

\end{APLfnsline}
\end{APLfns}
%
% col1.tex
%

Applying a technique from logic programming known as
`recursive tail optimization' we can get the
following iterative version:

%
% \input{col2}
%
%
% col2.tex
%
% COL2 COLLECT
\begin{APLfns}
\begin{APLfnsline}{}{\APLdel}
\APLZ\APLleftarrow\APLA\APLleftparen\APLF\APLspace\APLC\APLO
\APLL\APLL\APLE\APLC\APLT\APLrightparen\APLW
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLrightbracket}{}
\APLZ\APLleftarrow\APLA
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLtwo\APLrightbracket}{}
\APLL\APLO\APLO\APLP\APLcolon\APLrightarrow\APLleftparen
\APLzero\APLequal\APLrho\APLW\APLrightparen\APLslash\APLzero
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLthree\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLF\APLuparrow\APLW
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLfour\APLrightbracket}{}
\APLW\APLleftarrow\APLone\APLdownarrow\APLW
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLfive\APLrightbracket}{}
\APLrightarrow\APLL\APLO\APLO\APLP
\end{APLfnsline}
\begin{APLfnsline}{}{\APLdel}

\end{APLfnsline}
\end{APLfns}
%
% col2.tex
%
\end{aplese}

\begin{aplese}
Usually, recording of transactions is split into two phases:
the accountant first prepares a set of journal entries from
source documents, the journal entries are checked and only after
checking they are posted to the ledger. For convenience, we provide
the function POST\_A\_JOURNAL, which renumbers the journal entries
and posts them to the ledger.

% POST_A_JOURNAL
\begin{APLfns}
\begin{APLline}
\APLless accounting entity \APLgreater
\APLleftarrow
\APLless accounting entity \APLgreater
{\bf POST\_A\_JOURNAL}
\APLless journal \APLgreater
\end{APLline}
\vspace{2mm}
% POST_A_JOURNAL
%
% \input{c56}
%
%
% c56.tex
%
% C56 POST_A_JOURNAL
\begin{APLline}
{\bf
\APLP\APLO\APLS\APLT\protect\APLunderbar\APLA\protect
\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA\APLL
}
\APLcolon\APLleftparen\APLleftparen\APLleftshoe\APLleftparen
\APLuparrow\APLalpha\APLrightparen\APLcomma\APLleftbracket
\APLone\APLrightbracket\APLJ\APLrightparen\APLcomma\APLleftparen
\APLone\APLdownarrow\APLalpha\APLrightparen\APLrightparen\APLP
\APLO\APLS\APLT\APLspace\APLC\APLO\APLL\APLL\APLE\APLC\APLT
\APLleftshoe\APLleftbracket\APLtwo\APLrightbracket\APLJ
\APLleftarrow\APLleftparen\APLleftparen\APLuparrow\protect\APLoverbar
\APLone\APLspace\APLone\APLuparrow\APLuparrow\APLalpha
\APLrightparen\APLplus\APLomega\APLleftbracket\APLsemicolon\APLone
\APLrightbracket\APLplus\APLone\APLbar\APLuparrow\APLomega
\APLrightparen\APLcomma\APLleftparen\APLzero\APLspace\APLone\APLdownarrow
\APLomega\APLrightparen
\end{APLline}
%
% c56.tex
%
\end{APLfns}
\end{aplese}

\section{The Preparation of Financial Statements} \label{preparationsec}

\begin{financial}
At the end of the business period the accountant closes the books.
Figures \ref{unadjustedincome} and \ref{trialbalance}
show the trial balance and income statement of \corp.

% The trial balance unadjusted
\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig13}
%
%
% fig13.tex
%
% FIG13 FIGURE_13
\begin{APLarray}
\APLmb{\APLspace}\APLmb{\APLB}\APLmb{\APLa}\APLmb{\APLl}
\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLc}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLs}\APLmb{\APLh}\APLmb{\APLe}\APLmb{\APLe}\APLmb{
\APLt}\APLmb{\APLspace}\APLmb{\APLa}\APLmb{\APLs}\APLmb{
\APLspace}\APLmb{\APLo}\APLmb{\APLf}\APLmb{\APLspace}\APLmb{
\APLthree}\APLmb{\APLone}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{
\APLspace}\APLmb{\APLf}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{\APLh}
\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLV}\APLmb{\APLi}\APLmb{
\APLe}\APLmb{\APLn}\APLmb{\APLn}\APLmb{\APLa}\APLmb{\APLspace}
\APLmb{\APLA}\APLmb{\APLP}\APLmb{\APLL}\APLmb{\APLspace}\APLmb{
\APLC}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLp}\APLmb{\APLo}
\APLmb{\APLr}\APLmb{\APLa}\APLmb{\APLt}\APLmb{\APLi}\APLmb{\APLo}
\APLmb{\APLn}
\APLspace\par
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLS}\APLmb{\APLt}\APLmb{\APLo}\APLmb{\APLr}\APLmb{
\APLe}\APLmb{\APLspace}\APLmb{\APLe}\APLmb{\APLq}\APLmb{\APLu}
\APLmb{\APLi}\APLmb{\APLp}\APLmb{\APLm}\APLmb{\APLe}\APLmb{\APLn}
\APLmb{\APLt}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLc}
\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLN}
\APLmb{\APLo}\APLmb{\APLt}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{
\APLp}\APLmb{\APLa}\APLmb{\APLy}\APLmb{\APLa}\APLmb{\APLb}
\APLmb{\APLl}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLone}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLM}\APLmb{\APLe}\APLmb{\APLr}\APLmb{\APLc}\APLmb{
\APLh}\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLd}\APLmb{\APLi}\APLmb{
\APLs}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLi}\APLmb{\APLn}
\APLmb{\APLv}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{
\APLo}\APLmb{\APLr}\APLmb{\APLy}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLone}\APLmb{\APLtwo}\APLmb{\APLeight}\APLmb{
\APLeight}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLleftparen}\APLmb{\APLc}\APLmb{\APLb}\APLmb{
\APLrightparen}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLc}\APLmb{
\APLc}\APLmb{\APLo}\APLmb{\APLu}\APLmb{\APLn}\APLmb{\APLt}\APLmb{
\APLs}\APLmb{\APLspace}\APLmb{\APLp}\APLmb{\APLa}\APLmb{\APLy}
\APLmb{\APLa}\APLmb{\APLb}\APLmb{\APLl}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}\APLmb{
\APLtwo}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLC}\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLh}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLeight}\APLmb{\APLeight}\APLmb{
\APLnine}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLleftparen}\APLmb{\APLc}\APLmb{\APLb}\APLmb{
\APLrightparen}\APLmb{\APLspace}\APLmb{\APLP}\APLmb{\APLa}\APLmb{
\APLi}\APLmb{\APLd}\APLmb{\APLbar}\APLmb{\APLi}\APLmb{\APLn}
\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLa}\APLmb{\APLp}\APLmb{
\APLi}\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLfive}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLA}\APLmb{\APLc}\APLmb{\APLc}\APLmb{\APLo}\APLmb{
\APLu}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLs}\APLmb{\APLspace}
\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLc}\APLmb{\APLe}\APLmb{\APLi}
\APLmb{\APLv}\APLmb{\APLa}\APLmb{\APLb}\APLmb{\APLl}\APLmb{
\APLe}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLeight}\APLmb{\APLzero}\APLmb{
\APLone}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLleftparen}\APLmb{\APLc}\APLmb{\APLb}\APLmb{
\APLrightparen}\APLmb{\APLspace}\APLmb{\APLR}\APLmb{\APLe}
\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLi}\APLmb{\APLn}\APLmb{\APLe}
\APLmb{\APLd}\APLmb{\APLspace}\APLmb{\APLi}\APLmb{\APLn}\APLmb{
\APLc}\APLmb{\APLo}\APLmb{\APLm}\APLmb{\APLe}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLP}\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLp}\APLmb{
\APLa}\APLmb{\APLi}\APLmb{\APLd}\APLmb{\APLspace}\APLmb{\APLr}
\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLfour}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{\APLo}
\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLseven}\APLmb{\APLtwo}\APLmb{\APLtwo}\APLmb{\APLthree}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLT}\APLmb{\APLo}\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLseven}\APLmb{\APLtwo}\APLmb{\APLtwo}\APLmb{\APLthree}
\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\end{APLarray}
%
% fig13.tex
%
\end{minipage}
\caption{The Trial Balance of \corp\ as of 31/1 \label{trialbalance}}
}
\end{figure*}

In a final
purely mechanical process the accountant sweeps through the accounts and
transfers the balances of the accounts to summary accounts like for instance the
balance sheet and the income statement. After recording the closing transactions
all accounts should be balanced.
For example, the {\em Cash} account shown in figure \ref{analysis}
had a debit balance of \cur 388,900 before closing. The closing
transaction with journal reference 16 credited {\em Cash}, and
debited the balance sheet in figure \ref{trialbalance} with \cur 388,900.
As a result of this transaction the {\em Cash} account is balanced (closed),
and the debit balance of {\em Cash} has been transferred to the balance sheet.

>From the rules of recording derived in the previous section we know whether
an account usually has a debit or credit balance. The balance sheet
equation describes the structure of the balance sheet.
Figure \ref{closord} shows
the basic schema of the closing process \cite{grohmann}.

\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
%
% The closing scheme

\setlength{\unitlength}{1mm}
\begin{picture}(100,150)
% The Balance Sheet
\put(42.5,30.5){Balance Sheet}
\put(40,30){\line(1,0){30}}
\put(55,0){\line(0,1){30}}
\put(40,0){\framebox(14,29){\phantom{a}}}
\put(40.5,0.5){\framebox(13,28){\phantom{a}}}
\put(56,0){\framebox(14,9){\phantom{a}}}
\put(56.5,0.5){\framebox(13,8){\phantom{a}}}
\put(56,10){\framebox(14,19){\phantom{a}}}
\put(56.5,10.5){\framebox(13,18){\phantom{a}}}
% The Assets
\put(2.5,75.5){Assets}
\put(0,75){\line(1,0){30}}
\put(15,45){\line(0,1){30}}
\put(0,45){\framebox(14,29){\phantom{a}}}
\put(16,45){\framebox(14,29){\phantom{a}}}
\put(16.5,45.5){\framebox(13,28){\phantom{a}}}
% The Liabilities
\put(42.5,75.5){Liabilities}
\put(40,75){\line(1,0){30}}
\put(55,55){\line(0,1){20}}
\put(40,55){\framebox(14,19){\phantom{a}}}
\put(40.5,55.5){\framebox(13,18){\phantom{a}}}
\put(56,55){\framebox(14,19){\phantom{a}}}
% Owner's equity
\put(82.5,75.5){Owner's Equity}
\put(80,75){\line(1,0){30}}
\put(95,65){\line(0,1){10}}
\put(80,65){\framebox(14,9){\phantom{a}}}
\put(80.5,65.5){\framebox(13,8){\phantom{a}}}
\put(96,65){\framebox(14,4){\phantom{a}}}
\put(96.5,65.5){\framebox(13,3){\phantom{a}}}
\put(96,70){\framebox(14,4){\phantom{a}}}
% Income Statement
\put(82.5,100.5){Income Statement}
\put(80,100){\line(1,0){30}}
\put(95,80){\line(0,1){20}}
\put(80,80){\framebox(14,4){\phantom{a}}}
\put(80.5,80.5){\framebox(13,3){\phantom{a}}}
\put(80,85){\framebox(14,14){\phantom{a}}}
\put(80.5,85.5){\framebox(13,13){\phantom{a}}}
\put(96,80){\framebox(14,19){\phantom{a}}}
\put(96.5,80.5){\framebox(13,18){\phantom{a}}}
% Expenses
\put(62.5,135.5){Expenses}
\put(60,135){\line(1,0){30}}
\put(75,120){\line(0,1){15}}
\put(60,120){\framebox(14,14){\phantom{a}}}
\put(76,120){\framebox(14,14){\phantom{a}}}
\put(76.5,120.5){\framebox(13,13){\phantom{a}}}
% Revenues
\put(102.5,135.5){Revenues}
\put(100,135){\line(1,0){30}}
\put(115,115){\line(0,1){20}}
\put(100,115){\framebox(14,19){\phantom{a}}}
\put(100.5,115.5){\framebox(13,18){\phantom{a}}}
\put(116,115){\framebox(14,19){\phantom{a}}}
\put(22.5,60){\vector(1,-2){25}}
\put(47.5,65){\vector(1,-3){15}}
\put(87.5,70){\vector(-1,-3){22}}
\put(87.5,82.5){\vector(1,-1){15}}
\put(85,130){\vector(0,-1){35}}
\put(105,130){\vector(0,-1){35}}
\end{picture}
\end{minipage}
\caption{The Closing Process \label{closord}}
}
\end{figure*}
\end{financial}

\begin{aplese}
For at least two practical reasons the closing process shown in figure \ref{closord}
is but an idealized model. First, companies have different structures of owner's equity
according to their organization as proprietorships, partnerships or corporations. Second,
companies use a variety of subsidiary ledgers as for instance the customers ledger or the
suppliers ledger for purposes like analyzing special types of mass transactions. In practice
the closing process must be tailored to the needs of the company. A neat implementation
of the closing process should take this requirement into account.

Let us first recapitulate the closing process described in figure \ref{closord}. First, we
close all accounts from the set of asset, liability, expense, and revenue accounts in
arbitrary order. Next, we have to close the income statement, and finally, we have to close
the owner's equity account. Just to be sure, we repeat, what ``closing an account'' means:
``closing an account'' means calculating the balance of the account and recording a transaction
which transfers the balance of the account to a summary account.

The following, perhaps a bit abstract observation gives us the key for a general
implementation of the closing process: {\em The set of accounts has a partial
order with respect to the function of `closing an account'.} This means,
that we have to apply the function of `closing an account' to each
element of the set of accounts in a sequence which respects the partial
order. Or, we never close a summary account without closing all its
subaccounts first. We describe now the implementation of the closing
process in two parts: the first part describes, how the partial order
is used, the second concentrates on the implementation of the
function CLOSE\_ACCOUNT which closes an account.

The partial order of the set of accounts which has to be respected
in the closing process is encoded in the closing order which is a
list of closing entries. The first two closing entries
of a closing order are shown in figure \ref{closingorder}

% The closing order
\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
\tiny
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig15}
%
%
% fig15.tex
%
% FIG15 FIGURE_15
\begin{APLarray}
\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{
\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{
\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLdot}
\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{
\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLdot}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{\APLrightarrow}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{
\APLdot}\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLdot}
\APLmb{\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLdot}\APLmb{\APLspace}\APLmb{\APLdot}\APLmb{
\APLrightarrow}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLdot}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}
\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLE}\APLmb{\APLX}\APLmb{
\APLP}\APLmb{\APLE}\APLmb{\APLN}\APLmb{\APLS}\APLmb{\APLE}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLA}
\APLmb{\APLnine}\APLmb{\APLseven}\APLmb{\APLtwo}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLleftparen}\APLmb{
\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLleftparen}\APLmb{\APLc}
\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLR}\APLmb{\APLE}\APLmb{
\APLV}\APLmb{\APLE}\APLmb{\APLN}\APLmb{\APLU}\APLmb{\APLE}
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLA}
\APLmb{\APLnine}\APLmb{\APLseven}\APLmb{\APLtwo}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLleftparen}\APLmb{
\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{\APLquote}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLquote}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}
\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{\APLquote}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLquote}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}
\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{
\APLepsilon}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}
\APLmb{\APLspace}\APLmb{\APLquote}\APLmb{\APLepsilon}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}\APLmb{\APLspace}\APLmb{
\APLstile}
\APLspace\par
\APLmb{\APLquote}\APLmb{\APLepsilon}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLquote}
\APLspace\par
\end{APLarray}
%
% fig15.tex
%
\end{minipage}
\caption{The First Two Closing Entries \label{closingorder}}
}
\end{figure*}

Each closing entry provides the information necessary to
generate a closing transaction for one type of accounts.
The BNF of the data structure follows below.

\begin{APLfns}
% data structure closing order
%
% \input{ds9}
%
%
% ds9.tex
%

% data structure closing order

\begin{APLline}
\APLless closing order\APLgreater :=
        \APLless list of closing entries\APLgreater
\end{APLline}

%
% ds9.tex
%
% data structure list of closing entries
%
% \input{ds10}
%
%
% ds10.tex
%

% data structure preordered list of closing entries

\begin{APLline}
\APLless list of closing entries\APLgreater :=
        \APLless closing entry\APLgreater \APLstile
        \APLless closing entry\APLgreater
        \APLless list of closing entries\APLgreater
\end{APLline}

%
% ds10.tex
%
%data structure closing entry
%
% \input{ds11}
%
%
% ds11.tex
%

% data structure closing entry

\begin{APLline}
\APLless closing entry\APLgreater :=
        \APLless account type\APLgreater
        \APLless summary account key\APLgreater
        \APLless debit explanation\APLgreater
        \APLless credit explanation\APLgreater
\end{APLline}

%
% ds11.tex
%
\end{APLfns}

\noindent
By rewriting the function NEW\_CLOSING\_ORDER presented in appendix D, we are able
to adapt the closing process as appropriate. We have to take care to include
a closing entry for each account type and -- if we expect the closing order
to be preordered, and if we do not check in the program -- we have to be careful
to arrange the closing entries in the correct order. We discuss this in more
detail in section \ref{accts}.

The function CLOSE\_THE\_BOOKS has two steps. First, it uses the function
CLOSE\_THE\_BOOKS\_1 to close the books, then it uses the function CLOSE\_THE\_BOOKS\_2
to store the number of the journal entries before the closing process started in
the fifth element of the accounting entity.

\begin{APLfns}
\begin{APLline}
\APLless new accounting entity \APLgreater \APLleftarrow \ace {\bf CLOSE\_THE\_BOOKS} \dat
\end{APLline}
\vspace{2mm}
% CLOSE_THE_BOOKS
%
% \input{c18}
%
%
% c18.tex
%
% C18 CLOSE_THE_BOOKS
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLT\APLH\APLE
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
}
\APLcolon\APLleftparen\APLuparrow\APLrho\APLone\APLrightshoe
\APLalpha\APLrightparen\APLC\APLL\APLO\APLS\APLE\protect
\APLunderbar\APLT\APLH\APLE\protect\APLunderbar\APLB\APLO\APLO\APLK
\APLS\protect\APLunderbar\APLtwo\APLleftparen\APLalpha\APLC
\APLL\APLO\APLS\APLE\protect\APLunderbar\APLT\APLH\APLE\protect
\APLunderbar\APLB\APLO\APLO\APLK\APLS\protect\APLunderbar\APLone
\APLomega\APLrightparen
\end{APLline}
%
% c18.tex
%
\end{APLfns}

Since the closing journal entries are exactly the journal entries which are
appended to the journal by the closing process, CLOSE\_THE\_BOOKS\_2 stores
the number of journal lines, before the books have been closed. (This
information suffices to compute the closing journal entries during the
opening process.)

\begin{APLfns}
\begin{APLline}
\APLless new accounting entity \APLgreater \APLleftarrow
\APLless number of journal lines before closing \APLgreater
{\bf CLOSE\_THE\_BOOKS\_2} \ace
\end{APLline}
\vspace{2mm}
% CLOSE_THE_BOOKS_2
%
% \input{c20}
%
%
% c20.tex
%
% C20 CLOSE_THE_BOOKS_2
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLT\APLH\APLE
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS\protect
\APLunderbar\APLtwo
}
\APLcolon\APLomega\APLleftbracket\APLiota\APLfour
\APLrightbracket\APLcomma\APLleftparen\APLleftshoe\APLalpha\APLrightparen
\APLcomma\APLomega\APLleftbracket\APLsix\APLrightbracket
\end{APLline}
%
% c20.tex
%
\end{APLfns}

The function CLOSE\_THE\_BOOKS\_1 implements the closing process. With
MAKE\_CLOSING\_ORDER we construct a list whose items are the account index,
the elements of the appropriate closing entry and the date. The list is arranged
respecting the partial order of the accounts. This ensures that no summary account is closed without
closing all subaccounts first. The operator COLLECT described in the previous
section allows us then to use CLOSE\_ACCOUNT with a list argument.

\begin{APLfns}
\begin{APLline}
\APLless new accounting entity \APLgreater \APLleftarrow \ace {\bf CLOSE\_THE\_BOOKS\_1} \dat
\end{APLline}
\vspace{2mm}
% CLOSE_THE_BOOKS_1
%
% \input{c19}
%
%
% c19.tex
%
% C19 CLOSE_THE_BOOKS_1
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLT\APLH\APLE
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS\protect
\APLunderbar\APLone
}
\APLcolon\APLalpha\APLC\APLL\APLO\APLS\APLE\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLC\APLO\APLL
\APLL\APLE\APLC\APLT\APLleftparen\APLM\APLA\APLK\APLE\protect
\APLunderbar\APLC\APLL\APLO\APLS\APLI\APLN\APLG\protect
\APLunderbar\APLO\APLR\APLD\APLE\APLR\APLalpha\APLrightparen\APLcomma
\APLdieresis\APLleftshoe\APLleftshoe\APLomega
\end{APLline}
%
% c19.tex
%
\end{APLfns}

The function MAKE\_CLOSING\_ORDER first computes for each account
the index of the first occurence of its account type in the closing
order and stores the index vector in a local variable V. V is graded
up to get S. S is an index vector which is used to get the accounts
sorted in ascending order of the account types in the closing order.
Finally, we sort V and append to each account index in S a closing entry
of matching account type. The function BREADTH\_FIRST arranges the closing
entries in the correct order, we discuss its working in section \ref{accts}.

% MAKE_CLOSING_ORDER
\begin{APLfns}
\begin{APLline}
\APLless list of (
\APLless account index  \APLgreater,
\APLless closing entry \APLgreater)
\APLgreater
\APLleftarrow
{\bf MAKE\_CLOSING\_ORDER}
\APLless accounting entity \APLgreater
\end{APLline}
\vspace{2mm}
% MAKE_CLOSING_ORDER
%
% \input{c33}
%
%
% c33.tex
%
% C33 MAKE_CLOSING_ORDER
\begin{APLline}
{\bf
\APLM\APLA\APLK\APLE\protect\APLunderbar\APLC\APLL\APLO\APLS
\APLI\APLN\APLG\protect\APLunderbar\APLO\APLR\APLD\APLE\APLR
}
\APLcolon\APLS\APLcomma\APLdieresis\APLJ\APLleftbracket\APLV
\APLleftbracket\APLS\APLleftarrow\APLdeltastile\APLV
\APLleftarrow\APLleftparen\APLone\APLrightshoe\APLdieresis\APLJ
\APLleftarrow\APLB\APLR\APLE\APLA\APLD\APLT\APLH\protect\APLunderbar
\APLF\APLI\APLR\APLS\APLT\APLomega\APLrightparen\APLiota
\APLleftparen\APLthree\APLrightshoe\APLdieresis\APLtwo\APLrightshoe
\APLomega\APLrightparen\APLrightbracket\APLrightbracket
\end{APLline}
%
% c33.tex
%
\end{APLfns}

The function CLOSE\_ACCOUNT implements the process of closing an account.
CLOSE\_ACCOUNT first extracts the account to be closed from the ledger
and tests the contents of the account. If the account is empty, the
accounting entity is returned unchanged, otherwise the arguments for
CLOSE\_ACCOUNT\_1 are set up and CLOSE\_ACCOUNT\_1 is called.

% CLOSE_ACCOUNT
\begin{APLfns}
\begin{APLline}
\APLless accounting entity \APLgreater
\APLleftarrow
\APLless accounting entity \APLgreater
{\bf CLOSE\_ACCOUNT}
\APLless vector of
\APLless account index \APLgreater,
\APLless closing entry \APLgreater,
\APLless date \APLgreater
\APLgreater
\end{APLline}
\vspace{2mm}
% CLOSE_ACCOUNT
%
% \input{c14}
%
%
% c14.tex
%
% C14 CLOSE_ACCOUNT
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT
}
\APLcolon\APLleftparen\APLleftparen\APLalpha\APLcomma\APLone
\APLdownarrow\APLomega\APLrightparen\APLC\APLL\APLO\APLS\APLE
\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect
\APLunderbar\APLone\APLspace\APLM\APLrightparen\APLcomma
\APLsix\APLdownarrow\APLalpha\APLcolon\APLzero\APLepsilon\APLrho
\APLuparrow\APLthree\APLdownarrow\APLM\APLleftarrow\APLleftparen
\APLuparrow\APLomega\APLrightparen\APLrightshoe\APLtwo
\APLrightshoe\APLalpha\APLcolon\APLalpha
\end{APLline}
%
% c14.tex
%
\end{APLfns}

CLOSE\_ACCOUNT\_1 tests if the account type of the closing entry
corresponds to the type of the account. If not, the accounting entity
is returned unchanged. If both types match, the balance is calculated and
CLOSE\_ACCOUNT\_2 is called.

% CLOSE_ACCOUNT_1
\begin{APLfns}
\begin{APLline}
\APLless accounting entity \APLgreater
\APLleftarrow
(\APLless accounting entity \APLgreater,
\APLless closing entry \APLgreater,
\APLless date \APLgreater)
{\bf CLOSE\_ACCOUNT\_1}
\APLless account \APLgreater
\end{APLline}
\vspace{2mm}
% CLOSE_ACCOUNT_1
%
% \input{c15}
%
%
% c15.tex
%
% C15 CLOSE_ACCOUNT_1
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLone
}
\APLcolon\APLleftparen\APLalpha\APLcomma\APLbar\APLslash
\APLplus\APLslashbar\APLzero\APLspace\APLfour\APLdownarrow
\APLuparrow\APLthree\APLdownarrow\APLomega\APLrightparen\APLC\APLL
\APLO\APLS\APLE\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN
\APLT\protect\APLunderbar\APLtwo\APLomega\APLcolon\APLtilde
\APLleftparen\APLuparrow\APLsix\APLdownarrow\APLalpha
\APLrightparen\APLequalunderbar\APLuparrow\APLtwo\APLdownarrow\APLomega
\APLcolon\APLsix\APLuparrow\APLalpha
\end{APLline}
%
% c15.tex
%
\end{APLfns}

CLOSE\_ACCOUNT\_2 tests on zero balances. If an account has a zero balance,
the accounting entity is returned unchanged, else CLOSE\_ACCOUNT\_3 is called.

% CLOSE_ACCOUNT_2
\begin{APLfns}
\begin{APLline}
\APLless accounting entity \APLgreater
\APLleftarrow
(\APLless accounting entity \APLgreater,
\APLless closing entry \APLgreater,
\APLless date \APLgreater,
\APLless balance \APLgreater)
{\bf CLOSE\_ACCOUNT\_2}
\APLless account \APLgreater
\end{APLline}
\vspace{2mm}
% CLOSE_ACCOUNT_2
%
% \input{c16}
%
%
% c16.tex
%
% C16 CLOSE_ACCOUNT_2
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLtwo
}
\APLcolon\APLalpha\APLC\APLL\APLO\APLS\APLE\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar
\APLthree\APLomega\APLcolon\APLleftparen\protect\APLoverbar\APLone
\APLuparrow\APLalpha\APLrightparen\APLequal\APLzero\APLcolon
\APLsix\APLuparrow\APLalpha
\end{APLline}
%
% c16.tex
%
\end{APLfns}

CLOSE\_ACCOUNT\_3 prepares the recording of the closing transaction.
The arguments for RECORD are set up for debit or credit balances, and
RECORD is called in order to record the closing transaction.

% CLOSE_ACCOUNT_3
\begin{APLfns}
\begin{APLline}
\APLless accounting entity \APLgreater
\APLleftarrow
(\APLless accounting entity \APLgreater,
\APLless closing entry \APLgreater,
\APLless date \APLgreater,
\APLless balance \APLgreater)
{\bf CLOSE\_ACCOUNT\_3}
\APLless account \APLgreater
\end{APLline}
\vspace{2mm}
% CLOSE_ACCOUNT_3
%
% \input{c17}
%
%
% c17.tex
%
% C17 CLOSE_ACCOUNT_3
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLthree
}
\APLcolon\APLleftparen\APLsix\APLuparrow\APLalpha
\APLrightparen\APLR\APLE\APLC\APLO\APLR\APLD\APLalpha\APLleftbracket
\APLone\APLone\APLspace\APLnine\APLrightbracket\APLcomma\APLomega
\APLleftbracket\APLone\APLrightbracket\APLcomma\APLalpha
\APLleftbracket\APLeight\APLrightbracket\APLcomma\APLstile\APLalpha
\APLleftbracket\APLone\APLtwo\APLrightbracket\APLcolon
\APLleftparen\protect\APLoverbar\APLone\APLuparrow\APLalpha\APLrightparen
\APLnotless\APLzero\APLcolon\APLleftparen\APLsix\APLuparrow
\APLalpha\APLrightparen\APLR\APLE\APLC\APLO\APLR\APLD\APLalpha
\APLleftbracket\APLone\APLone\APLspace\APLone\APLzero\APLspace
\APLeight\APLrightbracket\APLcomma\APLomega\APLleftbracket\APLone
\APLrightbracket\APLcomma\APLstile\APLalpha\APLleftbracket
\APLone\APLtwo\APLrightbracket
\end{APLline}
%
% c17.tex
%
\end{APLfns}

\end{aplese}

\begin{financial}
A closer look at the income statement given in figure \ref{unadjustedincome}
reveals, that the accountant did not recognize all expenses, which \corp\
incurred in January. The next two transactions adjust the financial statements
of figures \ref{unadjustedincome} and \ref{trialbalance} in order to give
a more precise picture of \corp's economic performance in January:

{\partopsep=0pt\topsep=0pt\parskip=0pt\parsep=0pt\itemsep=0pt\parindent=0pt
\begin{transaction}
On January 31 the expiration of one third of the rental services is recognized.
\end{transaction}

\begin{transaction}
On January 31 the depreciation of the remaining store equipment is recognized.
The predicted life of the equipment is 10 years and the estimated terminal
disposal value is \cur 2,000. Like most companies \corp\ uses the straight line
depreciation method.
\end{transaction}
}

In transaction (11) \corp\ prepaid \cur 4,500 for the right to use
store facilities for the next three months. The \cur 4,500 measure
the future benefit from this services, so {\em Prepaid rent} (asset)
is created. On January 31 the accountant recognizes that one-third
of the rental services have expired. With transcation (12) he decreases
{\em Prepaid rent} (asset) by \cur 1,500 and increases {\em Rent expense}
(expense) by the same amount. Transaction (12) records the fact, that
one third of {\em Prepaid rent} has been used up in the conduct of operations
during January.

The same line of reasoning applies to {\em Store equipment}. {\em Store equipment}
really represents a bundle of services with a limited useful life. The length of
the useful life and the terminal disposal value given in transaction (13) are
estimations of \corp's accountant. With these estimations he calculates the cost
of store equipment accrued to \corp\ during January, and he records these costs
as depreciation expense. In transaction (13) the most popular method of
depreciation, straight-line depreciation is used. The depreciation of store
equipment for January is calculated by \APLleftparen\APLtwo\APLzero\APLzero\APLzero\APLzero
\APLmathbar \APLtwo\APLzero\APLzero\APLzero\APLrightparen\APLdivide\APLone\APLzero\APLtimes\APLone\APLtwo,
giving \cur 150. {\em Store equipment} (asset) is decreased by \cur 150 and {\em Depreciation expense}
(expense) is increased by the same amount. Figure \ref{adjustingentries} shows the
journal entries for transactions (12) and (13), and figure \ref{adjustedstatements} shows the
adjusted financial statements of \corp\ as for 31/1.

% adjustment of accounts
\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig16}
%
%
% fig16.tex
%
% FIG16 FIGURE_16
\begin{APLarray}
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLthree}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLone}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLone}
\APLmb{\APLtwo}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{
\APLE}\APLmb{\APLx}\APLmb{\APLp}\APLmb{\APLi}\APLmb{\APLr}
\APLmb{\APLa}\APLmb{\APLt}\APLmb{\APLi}\APLmb{\APLo}\APLmb{\APLn}
\APLmb{\APLspace}\APLmb{\APLo}\APLmb{\APLf}\APLmb{\APLspace}
\APLmb{\APLp}\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLp}\APLmb{\APLa}
\APLmb{\APLi}\APLmb{\APLd}\APLmb{\APLspace}\APLmb{\APLr}\APLmb{
\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}
\APLmb{\APLspace}\APLmb{\APLs}\APLmb{\APLe}\APLmb{\APLr}\APLmb{
\APLv}\APLmb{\APLi}\APLmb{\APLc}\APLmb{\APLe}\APLmb{\APLs}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLsix}\APLmb{\APLthree}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLfive}
\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{\APLeight}\APLmb{\APLone}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLthree}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLone}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLone}
\APLmb{\APLtwo}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{
\APLE}\APLmb{\APLx}\APLmb{\APLp}\APLmb{\APLi}\APLmb{\APLr}
\APLmb{\APLa}\APLmb{\APLt}\APLmb{\APLi}\APLmb{\APLo}\APLmb{\APLn}
\APLmb{\APLspace}\APLmb{\APLo}\APLmb{\APLf}\APLmb{\APLspace}
\APLmb{\APLp}\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLp}\APLmb{\APLa}
\APLmb{\APLi}\APLmb{\APLd}\APLmb{\APLspace}\APLmb{\APLr}\APLmb{
\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}
\APLmb{\APLspace}\APLmb{\APLs}\APLmb{\APLe}\APLmb{\APLr}\APLmb{
\APLv}\APLmb{\APLi}\APLmb{\APLc}\APLmb{\APLe}\APLmb{\APLs}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLtwo}\APLmb{\APLeight}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLone}
\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLA}\APLmb{\APLsix}\APLmb{\APLthree}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLfour}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLone}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLone}
\APLmb{\APLthree}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{
\APLD}\APLmb{\APLe}\APLmb{\APLp}\APLmb{\APLr}\APLmb{\APLe}
\APLmb{\APLc}\APLmb{\APLi}\APLmb{\APLa}\APLmb{\APLt}\APLmb{\APLi}
\APLmb{\APLo}\APLmb{\APLn}\APLmb{\APLspace}\APLmb{\APLo}\APLmb{
\APLf}\APLmb{\APLspace}\APLmb{\APLs}\APLmb{\APLt}\APLmb{\APLo}
\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLe}\APLmb{
\APLq}\APLmb{\APLu}\APLmb{\APLi}\APLmb{\APLp}\APLmb{\APLm}
\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLseven}
\APLmb{\APLone}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLzero}\APLmb{
\APLfive}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLfour}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLone}\APLmb{\APLslash}\APLmb{
\APLone}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLone}
\APLmb{\APLthree}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{
\APLD}\APLmb{\APLe}\APLmb{\APLp}\APLmb{\APLr}\APLmb{\APLe}
\APLmb{\APLc}\APLmb{\APLi}\APLmb{\APLa}\APLmb{\APLt}\APLmb{\APLi}
\APLmb{\APLo}\APLmb{\APLn}\APLmb{\APLspace}\APLmb{\APLo}\APLmb{
\APLf}\APLmb{\APLspace}\APLmb{\APLs}\APLmb{\APLt}\APLmb{\APLo}
\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLe}\APLmb{
\APLq}\APLmb{\APLu}\APLmb{\APLi}\APLmb{\APLp}\APLmb{\APLm}
\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLzero}
\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{\APLfive}\APLmb{
\APLzero}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLseven}\APLmb{
\APLone}\APLmb{\APLzero}
\APLspace\par
\end{APLarray}
%
% fig16.tex
%
\end{minipage}
\caption{Journal Entries of Transactions (12) -- (13) \label{adjustingentries}}
}
\end{figure*}

% The trial balance adjusted
\begin{figure*}[htbp]
{\centering
\begin{minipage}{15cm}
\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig17}
%
%
% fig17.tex
%
% FIG17 FIGURE_17
\begin{APLarray}
\APLmb{\APLspace}\APLmb{\APLB}\APLmb{\APLa}\APLmb{\APLl}
\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLc}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLs}\APLmb{\APLh}\APLmb{\APLe}\APLmb{\APLe}\APLmb{
\APLt}\APLmb{\APLspace}\APLmb{\APLa}\APLmb{\APLs}\APLmb{
\APLspace}\APLmb{\APLo}\APLmb{\APLf}\APLmb{\APLspace}\APLmb{
\APLthree}\APLmb{\APLone}\APLmb{\APLslash}\APLmb{\APLone}\APLmb{
\APLspace}\APLmb{\APLf}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{\APLh}
\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLV}\APLmb{\APLi}\APLmb{
\APLe}\APLmb{\APLn}\APLmb{\APLn}\APLmb{\APLa}\APLmb{\APLspace}
\APLmb{\APLA}\APLmb{\APLP}\APLmb{\APLL}\APLmb{\APLspace}\APLmb{
\APLC}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLp}\APLmb{\APLo}
\APLmb{\APLr}\APLmb{\APLa}\APLmb{\APLt}\APLmb{\APLi}\APLmb{\APLo}
\APLmb{\APLn}
\APLspace\par
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLS}\APLmb{\APLt}\APLmb{\APLo}\APLmb{\APLr}\APLmb{
\APLe}\APLmb{\APLspace}\APLmb{\APLe}\APLmb{\APLq}\APLmb{\APLu}
\APLmb{\APLi}\APLmb{\APLp}\APLmb{\APLm}\APLmb{\APLe}\APLmb{\APLn}
\APLmb{\APLt}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLnine}\APLmb{\APLeight}\APLmb{\APLfive}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}\APLmb{\APLc}
\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}\APLmb{\APLN}
\APLmb{\APLo}\APLmb{\APLt}\APLmb{\APLe}\APLmb{\APLspace}
\APLmb{\APLp}\APLmb{\APLa}\APLmb{\APLy}\APLmb{\APLa}\APLmb{\APLb}
\APLmb{\APLl}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLM}\APLmb{\APLe}\APLmb{\APLr}\APLmb{\APLc}\APLmb{
\APLh}\APLmb{\APLa}\APLmb{\APLn}\APLmb{\APLd}\APLmb{\APLi}\APLmb{
\APLs}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLi}\APLmb{\APLn}
\APLmb{\APLv}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{
\APLo}\APLmb{\APLr}\APLmb{\APLy}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLone}\APLmb{\APLtwo}\APLmb{\APLeight}\APLmb{
\APLeight}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLleftparen}\APLmb{\APLc}\APLmb{\APLb}\APLmb{
\APLrightparen}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLc}\APLmb{
\APLc}\APLmb{\APLo}\APLmb{\APLu}\APLmb{\APLn}\APLmb{\APLt}\APLmb{
\APLs}\APLmb{\APLspace}\APLmb{\APLp}\APLmb{\APLa}\APLmb{\APLy}
\APLmb{\APLa}\APLmb{\APLb}\APLmb{\APLl}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLtwo}\APLmb{
\APLtwo}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLC}\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLh}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLeight}\APLmb{\APLeight}\APLmb{
\APLnine}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLleftparen}\APLmb{\APLc}\APLmb{\APLb}\APLmb{
\APLrightparen}\APLmb{\APLspace}\APLmb{\APLP}\APLmb{\APLa}\APLmb{
\APLi}\APLmb{\APLd}\APLmb{\APLbar}\APLmb{\APLi}\APLmb{\APLn}
\APLmb{\APLspace}\APLmb{\APLc}\APLmb{\APLa}\APLmb{\APLp}\APLmb{
\APLi}\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLfive}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLA}\APLmb{\APLc}\APLmb{\APLc}\APLmb{\APLo}\APLmb{
\APLu}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLs}\APLmb{\APLspace}
\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLc}\APLmb{\APLe}\APLmb{\APLi}
\APLmb{\APLv}\APLmb{\APLa}\APLmb{\APLb}\APLmb{\APLl}\APLmb{
\APLe}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLeight}\APLmb{\APLzero}\APLmb{
\APLone}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLstile}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLleftparen}\APLmb{\APLc}\APLmb{\APLb}\APLmb{
\APLrightparen}\APLmb{\APLspace}\APLmb{\APLR}\APLmb{\APLe}
\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLi}\APLmb{\APLn}\APLmb{\APLe}
\APLmb{\APLd}\APLmb{\APLspace}\APLmb{\APLi}\APLmb{\APLn}\APLmb{
\APLc}\APLmb{\APLo}\APLmb{\APLm}\APLmb{\APLe}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLnine}\APLmb{\APLeight}\APLmb{\APLthree}\APLmb{\APLfive}\APLmb{
\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLP}\APLmb{\APLr}\APLmb{\APLe}\APLmb{\APLp}\APLmb{
\APLa}\APLmb{\APLi}\APLmb{\APLd}\APLmb{\APLspace}\APLmb{\APLr}
\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLthree}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{\APLo}
\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLseven}\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLsix}
\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLT}\APLmb{\APLo}\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLseven}\APLmb{\APLtwo}\APLmb{\APLzero}\APLmb{\APLsix}
\APLmb{\APLfive}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLI}\APLmb{\APLn}\APLmb{\APLc}
\APLmb{\APLo}\APLmb{\APLm}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{
\APLs}\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLt}\APLmb{\APLe}\APLmb{
\APLm}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{\APLspace}
\APLmb{\APLa}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{\APLo}
\APLmb{\APLf}\APLmb{\APLspace}\APLmb{\APLthree}\APLmb{\APLone}
\APLmb{\APLslash}\APLmb{\APLone}\APLmb{\APLspace}\APLmb{\APLf}
\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLT}\APLmb{\APLh}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLV}\APLmb{\APLi}\APLmb{\APLe}\APLmb{\APLn}\APLmb{
\APLn}\APLmb{\APLa}\APLmb{\APLspace}\APLmb{\APLA}\APLmb{\APLP}
\APLmb{\APLL}\APLmb{\APLspace}\APLmb{\APLC}\APLmb{\APLo}
\APLmb{\APLr}\APLmb{\APLp}\APLmb{\APLo}\APLmb{\APLr}\APLmb{\APLa}
\APLmb{\APLt}\APLmb{\APLi}\APLmb{\APLo}\APLmb{\APLn}
\APLspace\par
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}\APLmb{
\APLbar}\APLmb{\APLbar}\APLmb{\APLbar}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLC}\APLmb{\APLo}\APLmb{\APLs}\APLmb{\APLt}\APLmb{
\APLspace}\APLmb{\APLo}\APLmb{\APLf}\APLmb{\APLspace}\APLmb{\APLg}
\APLmb{\APLo}\APLmb{\APLo}\APLmb{\APLd}\APLmb{\APLs}\APLmb{
\APLspace}\APLmb{\APLs}\APLmb{\APLo}\APLmb{\APLl}\APLmb{\APLd}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLeight}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLleftparen}\APLmb{\APLc}\APLmb{\APLb}\APLmb{
\APLrightparen}\APLmb{\APLspace}\APLmb{\APLS}\APLmb{\APLa}\APLmb{
\APLl}\APLmb{\APLe}\APLmb{\APLs}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLone}\APLmb{\APLeight}\APLmb{\APLzero}\APLmb{
\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLR}\APLmb{\APLe}\APLmb{\APLn}\APLmb{\APLt}\APLmb{
\APLspace}\APLmb{\APLe}\APLmb{\APLx}\APLmb{\APLp}\APLmb{\APLe}
\APLmb{\APLn}\APLmb{\APLs}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLone}\APLmb{\APLfive}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLleftparen}
\APLmb{\APLc}\APLmb{\APLb}\APLmb{\APLrightparen}\APLmb{\APLspace}
\APLmb{\APLD}\APLmb{\APLe}\APLmb{\APLp}\APLmb{\APLr}\APLmb{
\APLe}\APLmb{\APLc}\APLmb{\APLi}\APLmb{\APLa}\APLmb{\APLt}\APLmb{
\APLi}\APLmb{\APLo}\APLmb{\APLn}\APLmb{\APLspace}\APLmb{\APLe}
\APLmb{\APLx}\APLmb{\APLp}\APLmb{\APLe}\APLmb{\APLn}\APLmb{
\APLs}\APLmb{\APLe}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLfive}\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLN}\APLmb{\APLe}
\APLmb{\APLt}\APLmb{\APLspace}\APLmb{\APLi}\APLmb{\APLn}
\APLmb{\APLc}\APLmb{\APLo}\APLmb{\APLm}\APLmb{\APLe}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLnine}
\APLmb{\APLeight}\APLmb{\APLthree}\APLmb{\APLfive}\APLmb{\APLzero}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{\APLo}
\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}
\APLmb{\APLeight}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLzero}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLstile}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLT}\APLmb{
\APLo}\APLmb{\APLt}\APLmb{\APLa}\APLmb{\APLl}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLone}\APLmb{
\APLeight}\APLmb{\APLzero}\APLmb{\APLzero}\APLmb{\APLzero}
\APLmb{\APLzero}
\APLspace\par
\end{APLarray}
%
% fig17.tex
%
\end{minipage}
\caption{Adjusted Financial Statements of \corp\ as of 31/1 \label{adjustedstatements}}
}
\end{figure*}

In determining the income and financial position of \corp\ as described above the
accountant used the accrual basis of accounting. Accrual accounting means,
that the financial impact of events is recognized in the accounting records
in the time periods, when services are rendered or utilized, but not when
cash changes hands. Revenue is recognized as it is earned, expenses are
recognized as they are incurred.

At the end of each accounting period the accountant uses adjustments to
the accounts in order to assign the financial effects of transactions to
the appropriate time periods. Transactions (12) and (13) are an example
of adjustments. Transactions (1) to (11) are explicit transactions triggered
by source documents, whereas transactions (12) and (13) -- like all adjustments --
reflect implicit transactions which -- although neglected in day to day accounting --
are recognized in the preparation of financial statements. Adjustments reflect the
accrual basis of accounting, a strict cash basis uses no adjustments.

Adjustments are typically classified into four types:
{\partopsep=0pt\topsep=0pt\parskip=0pt\parsep=0pt\itemsep=0pt\parindent=0pt
\begin{enumerate}
\item Expiration of unexpired costs (e.g. prepaid rent expense and depreciation in
      transactions (12) and (13))
\item Realization (earning) of previously deferred revenues (e.g. rent received in advance,
      advance payments)
\item Accrual of previously unrecorded expenses (e.g. wages payable, interest payable)
\item Accrual of previously unrecorded revenues (e.g. interest receivable, unbilled fees)
\end{enumerate}
}
\end{financial}

\begin{aplese}
Opening the books prepares the accounts for the next business period.
Expense and revenue accounts as well as the income statement (all
temporary owner's equity accounts) start as empty accounts. All accounts
of the balance sheet (all permanent accounts) are opened with the help
of opening transactions. An opening transaction transfers a position
of the balance sheet (of a summary account) back to the account.
Technically speaking an opening transaction is the reverse of
the corresponding closing transaction, except that the balance sheet
account is substituted by the opening balance sheet account.

% OPEN_THE_BOOKS
\begin{APLfns}
\begin{APLline}
\APLless new accounting entity \APLgreater \APLleftarrow \ace {\bf OPEN\_THE\_BOOKS} \dat
\end{APLline}
\vspace{2mm}
% OPEN_THE_BOOKS
%
% \input{c46}
%
%
% c46.tex
%
% C46 OPEN_THE_BOOKS
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLT\APLH\APLE
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
}
\APLcolon\APLalpha\APLO\APLP\APLE\APLN\protect\APLunderbar
\APLT\APLH\APLE\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
\protect\APLunderbar\APLone\APLomega\APLleftparen\APLone\APLrho
\APLleftshoe\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect
\APLunderbar\APLS\APLH\APLE\APLE\APLT\APLrightparen
\end{APLline}
%
% c46.tex
%
\end{APLfns}

If we only had a trial balance in mind, and if we wanted to continue
recording transactions for the business period (e.g. adjustments)
the balances of expense and revenue accounts should not be clear
after the opening, the balances of all accounts should be restored
to their value before the closing. In our case study we, therefore, reverse
the closing transactions for the balance sheet and the income statement.
(Note that this solution is not completely general. We present the general
solution in section \ref{accts}.)

% OPEN_TRIAL_BALANCE
\begin{APLfns}
\begin{APLline}
\APLless new accounting entity \APLgreater \APLleftarrow \ace {\bf OPEN\_TRIAL\_BALANCE} \dat
\end{APLline}
\vspace{2mm}
% OPEN_TRIAL_BALANCE
%
% \input{c49}
%
%
% c49.tex
%
% C49 OPEN_TRIAL_BALANCE
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLT\APLR\APLI\APLA
\APLL\protect\APLunderbar\APLB\APLA\APLL\APLA\APLN\APLC\APLE
}
\APLcolon\APLalpha\APLO\APLP\APLE\APLN\protect\APLunderbar
\APLT\APLH\APLE\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
\protect\APLunderbar\APLone\APLomega\APLleftparen\APLB\APLA\APLL
\APLA\APLN\APLC\APLE\protect\APLunderbar\APLS\APLH\APLE\APLE
\APLT\APLspace\APLI\APLN\APLC\APLO\APLM\APLE\protect\APLunderbar
\APLS\APLT\APLA\APLT\APLE\APLM\APLE\APLN\APLT\APLrightparen
\end{APLline}
%
% c49.tex
%
\end{APLfns}

OPEN\_THE\_BOOKS\_1 is used by both functions, OPEN\_THE\_BOOKS and
OPEN\_TRIAL\_BALANCE, to perform the opening process. It extracts
the account contents of all summary accounts, which should be reversed,
establishes a new accounting entity, and uses the COLLECT operator
in order to use the function OPEN\_THE\_BOOKS\_2 with several
summary accounts.

% OPEN_THE_BOOKS_1
\begin{APLfns}
\begin{APLline}
\APLless accounting entity \APLgreater
\APLleftarrow
\APLless accounting entity \APLgreater
{\bf OPEN\_THE\_BOOKS\_1}
\APLless date \APLgreater
\APLless vector of account keys \APLgreater
\end{APLline}
\vspace{2mm}
% OPEN_THE_BOOKS_1
%
% \input{c47}
%
%
% c47.tex
%
% C47 OPEN_THE_BOOKS_1
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLT\APLH\APLE
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS\protect\APLunderbar
\APLone
}
\APLcolon\APLleftparen\APLN\APLE\APLW\protect\APLunderbar
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLI\APLN\APLG\protect
\APLunderbar\APLE\APLN\APLT\APLI\APLT\APLY\APLuparrow\protect
\APLoverbar\APLone\APLuparrow\APLalpha\APLrightparen\APLO\APLP\APLE
\APLN\protect\APLunderbar\APLT\APLH\APLE\protect\APLunderbar\APLB
\APLO\APLO\APLK\APLS\protect\APLunderbar\APLtwo\APLspace\APLC
\APLO\APLL\APLL\APLE\APLC\APLT\APLleftparen\APLleftshoe\APLone
\APLuparrow\APLomega\APLrightparen\APLcomma\APLdieresis
\APLleftparen\APLthree\APLdownarrow\APLdieresis\APLleftparen
\APLuparrow\APLone\APLdownarrow\APLalpha\APLrightparen\APLleftbracket
\APLleftparen\APLleftshoe\APLuparrow\APLtwo\APLdownarrow\APLalpha
\APLrightparen\APLA\APLC\APLC\APLE\APLS\APLS\protect
\APLunderbar\APLK\APLE\APLY\APLdieresis\APLuparrow\APLone\APLdownarrow
\APLomega\APLrightbracket\APLrightparen
\end{APLline}
%
% c47.tex
%
\end{APLfns}

OPEN\_THE\_BOOKS\_2 calls the function OPENING\_TRANSACTIONS,
which constructs for each entry in the summary account an opening
transaction, and records these transactions. We assume, that only
closing transactions have affected the summary account.

% OPEN_THE_BOOKS_2
\begin{APLfns}
\begin{APLline}
\APLless accounting entity \APLgreater
\APLleftarrow
\APLless accounting entity \APLgreater
{\bf OPEN\_THE\_BOOKS\_2}
\APLless date \APLgreater
\APLless account contents \APLgreater
\end{APLline}
\vspace{2mm}
% OPEN_THE_BOOKS_2
%
% \input{c48}
%
%
% c48.tex
%
% C48 OPEN_THE_BOOKS_2
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLT\APLH\APLE
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS\protect\APLunderbar
\APLtwo
}
\APLcolon\APLalpha\APLR\APLE\APLC\APLO\APLR\APLD\APLspace
\APLC\APLO\APLL\APLL\APLE\APLC\APLT\APLleftparen\APLone
\APLuparrow\APLomega\APLrightparen\APLO\APLP\APLE\APLN\APLI\APLN\APLG
\protect\APLunderbar\APLT\APLR\APLA\APLN\APLS\APLA\APLC\APLT\APLI
\APLO\APLN\APLS\APLspace\APLzero\APLspace\APLthree
\APLdownarrow\APLuparrow\APLone\APLdownarrow\APLomega
\end{APLline}
%
% c48.tex
%
\end{APLfns}

OPENING\_TRANSACTIONS simply constructs opening transactions
from the dual account, debit and credit columns of the summary
account.

% OPENING_TRANSACTIONS
\begin{APLfns}
\begin{APLline}
\APLless list of simple transactions \APLgreater
\APLleftarrow
\APLless date \APLgreater
{\bf OPENING\_TRANSACTIONS}
\APLless dual account column \APLgreater
\APLless debit column \APLgreater
\APLless credit column \APLgreater
\end{APLline}
\vspace{2mm}
% OPENING_TRANSACTIONS
%
% \input{c51}
%
%
% c51.tex
%
% C51 OPENING_TRANSACTIONS
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\APLI\APLN\APLG\protect\APLunderbar\APLT
\APLR\APLA\APLN\APLS\APLA\APLC\APLT\APLI\APLO\APLN\APLS
}
\APLcolon\APLleftparen\APLleftshoe\APLalpha\APLrightparen
\APLcomma\APLdieresis\APLleftparen\APLleftshoe\APLleftshoe
\APLquote\APLleftparen\APLo\APLb\APLrightparen\APLquote\APLrightparen
\APLcomma\APLdieresis\APLleftshoe\APLleftbracket\APLtwo
\APLrightbracket\APLleftparen\APLleftparen\APLomega\APLleftbracket
\APLsemicolon\APLthree\APLrightbracket\APLequal\APLzero
\APLrightparen\APLcirclestile\APLleftbracket\APLtwo\APLrightbracket
\APLleftparen\APLleftshoe\APLO\APLP\APLE\APLN\APLI\APLN\APLG
\protect\APLunderbar\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect
\APLunderbar\APLS\APLH\APLE\APLE\APLT\APLrightparen\APLcomma
\APLleftbracket\APLtwo\APLrightbracket\APLleftparen\APLzero\APLspace
\protect\APLoverbar\APLtwo\APLdownarrow\APLomega\APLrightparen
\APLrightparen\APLcomma\APLleftbracket\APLtwo\APLrightbracket
\APLplus\APLslash\APLzero\APLspace\APLone\APLdownarrow\APLomega
\end{APLline}
%
% c51.tex
%
\end{APLfns}

\end{aplese}

%\begin{financial}
%{\bf The Allocation of Net Income}

%\begin{transaction}
%On January 31 the board of directors of \corp\ declares a dividend of \cur 40,000
%payable to the stockholders on record as of February 5.
%\end{transaction}

%% allocating income
%\begin{figure*}[htbp]
%{\centering
%\begin{minipage}{15cm}
%\small
%\def\APLgb{\relax}
%\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
%\end{minipage}
%\caption{Journal Entry of Transaction (14) -- Declaration of Dividends \label{dividendsdeclared}}
%}
%\end{figure*}

%% The final balance
%\begin{figure*}[htbp]
%{\centering
%\begin{minipage}{15cm}
%\small
%\def\APLgb{\relax}
%\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
%\end{minipage}
%\caption{The Final Balance Sheet of \corp\ as of 31/1 \label{finalbalance}}
%}
%\end{figure*}

%% The retained income statement
%\begin{figure*}[htbp]
%{\centering
%\begin{minipage}{15cm}
%\small
%\def\APLgb{\relax}
%\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
%\end{minipage}
%\caption{The Retained Income Account of \corp\ as of 31/1 \label{retainedincome}}
%}
%\end{figure*}

%\begin{transaction}
%On February 5 the dividend of \cur 40,000 is paid in cash.
%\end{transaction}

%% dividends
%\begin{figure*}[htbp]
%{\centering
%\begin{minipage}{15cm}
%\small
%\def\APLgb{\relax}
%\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
%\end{minipage}
%\caption{Journal Entry of Transaction (15) -- Payment of Dividends \label{dividendspaid}}
%}
%\end{figure*}

%% a paginated account
%\begin{figure*}[htbp]
%{\centering
%\begin{minipage}{15cm}
%\small
%\def\APLgb{\relax}
%\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
%\end{minipage}
%\caption{The {\em Cash} Account in Paginated Form \label{paginatedaccount}}
%}
%\end{figure*}

%% The final balance
%\begin{figure*}[htbp]
%{\centering
%\begin{minipage}{15cm}
%\small
%\def\APLgb{\relax}
%\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
%\end{minipage}
%\caption{The Balance Sheet of \corp\ as of 5/2 \label{thelastbalance}}
%}
%\end{figure*}

%\end{financial}

%\section{The Financial Accounting System} \label{objsys}

\section{The Account Type System} \label{accts}

\begin{aplese}
Before we can discuss the general version of the opening process,
we have to think a little bit about the hierarchical organization
of the accounts of a company. For example, in figure \ref{accounttypes}
we show the account type system of \corp.

\begin{figure}[htbp]
{\centering
% The Account Type System
\begin{minipage}{7cm}
{\small
\def\APLgb{\relax}
\def\APLmb#1{\leavevmode\hbox to 0.6em{\hss#1\hss}}
%
% \input{fig18}
%
%
% fig18.tex
%
% FIG18 FIGURE_18
\begin{APLarray}
\APLmb{\APLB}\APLmb{\APLO}\APLmb{\APLO}\APLmb{\APLK}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLP}\APLmb{\APLA}\APLmb{\APLR}\APLmb{\APLT}\APLmb{\APLN}
\APLmb{\APLE}\APLmb{\APLR}\APLmb{\APLS}\APLmb{\APLH}\APLmb{\APLI}
\APLmb{\APLP}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLC}\APLmb{\APLO}\APLmb{\APLR}\APLmb{\APLP}\APLmb{\APLO}
\APLmb{\APLR}\APLmb{\APLA}\APLmb{\APLT}\APLmb{\APLI}\APLmb{\APLO}
\APLmb{\APLN}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLI}\APLmb{
\APLN}\APLmb{\APLC}\APLmb{\APLO}\APLmb{\APLM}\APLmb{\APLE}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLE}\APLmb{\APLX}
\APLmb{\APLP}\APLmb{\APLE}\APLmb{\APLN}\APLmb{\APLS}\APLmb{\APLE}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLR}\APLmb{\APLE}
\APLmb{\APLV}\APLmb{\APLE}\APLmb{\APLN}\APLmb{\APLU}\APLmb{\APLE}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLO}\APLmb{\APLW}\APLmb{\APLN}\APLmb{\protect\APLunderbar}
\APLmb{\APLE}\APLmb{\APLQ}\APLmb{\APLU}\APLmb{\APLI}\APLmb{\APLT}
\APLmb{\APLY}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLS}\APLmb{
\APLO}\APLmb{\APLL}\APLmb{\APLE}\APLmb{\protect\APLunderbar}
\APLmb{\APLP}\APLmb{\APLR}\APLmb{\APLO}\APLmb{\APLP}\APLmb{
\APLR}\APLmb{\APLI}\APLmb{\APLE}\APLmb{\APLT}\APLmb{\APLO}\APLmb{
\APLR}\APLmb{\APLS}\APLmb{\APLH}\APLmb{\APLI}\APLmb{\APLP}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLL}\APLmb{\APLI}\APLmb{\APLA}\APLmb{\APLB}\APLmb{\APLI}
\APLmb{\APLL}\APLmb{\APLI}\APLmb{\APLT}\APLmb{\APLY}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLS}\APLmb{
\APLU}\APLmb{\APLP}\APLmb{\APLP}\APLmb{\APLL}\APLmb{\APLI}
\APLmb{\APLE}\APLmb{\APLR}
\APLspace\par
\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{\APLspace}\APLmb{
\APLA}\APLmb{\APLS}\APLmb{\APLS}\APLmb{\APLE}\APLmb{\APLT}
\APLspace\par
\end{APLarray}
%
% fig18.tex
%
}
\end{minipage}
\caption{The Account Type System of \corp \label{accounttypes}}
}
\end{figure}

Of course, we have specified the tree structure of the account type
system in the function NEW\_CLOSING\_ORDER. Each line of this function defines
one \APLless closing entry \APLgreater, which corresponds to the connection
between a summary account and an account type. An account type simply
denotes a subset of accounts. The root account type (`BOOK' in the example)
is a special case and points to itself.

The effect of introducing account types
and defining the hierarchy on the account types instead of on the accounts
is, that the number of nodes and arcs of the tree defined by the account type system is
considerably smaller than the number of nodes and arcs
of the tree defined directly on the accounts. Even for our toy example
the number of nodes in the type system tree is $11$, and this is less than
half of the nodes in the induced account tree ($23$). In most applications
the number of accounts and the number of account types are of different
orders of magnitude.

The account type system is an acyclic, connected tree which is defined by
the closing entries. All the tree algorithms used are working on a two
column type matrix, a ``preorder''. This means, that the first element
of a line is the type of the subaccounts of the second. This table is generated
by the function PREORDER.

% PREORDER
\begin{APLfns}
\begin{APLline}
\APLless preorder matrix \APLgreater
\APLleftarrow
\APLless ledger \APLgreater
{\bf PREORDER}
\APLless closing order \APLgreater
\end{APLline}
\vspace{2mm}
% PREORDER
%
% \input{c57}
%
%
% c57.tex
%
% C57 PREORDER
\begin{APLline}
{\bf
\APLP\APLR\APLE\APLO\APLR\APLD\APLE\APLR
}
\APLcolon\APLleftparen\APLone\APLrightshoe\APLdieresis
\APLomega\APLrightparen\APLcomma\APLleftbracket\APLone\APLdot
\APLfive\APLrightbracket\APLleftparen\APLthree\APLrightshoe
\APLdieresis\APLalpha\APLrightparen\APLleftbracket\APLleftparen\APLone
\APLrightshoe\APLdieresis\APLalpha\APLrightparen\APLiota
\APLleftparen\APLtwo\APLrightshoe\APLdieresis\APLomega\APLrightparen
\APLrightbracket
\end{APLline}
%
% c57.tex
%
\end{APLfns}

For \hfill printing \hfill the \hfill account \hfill type \\
system \hfill shown \hfill in \hfill figure \hfill \ref{accounttypes}
we  \hfill provide \hfill the \hfill function \\ PRINT\_ACCOUNT\_TYPE\_TREE.

% PRINT_ACCOUNT_TYPE_TREE
\begin{APLfns}
\begin{APLline}
\APLless account type tree \APLgreater
\APLleftarrow
{\bf PRINT\_ACCOUNT\_TYPE\_TREE}
\ace
\end{APLline}
\vspace{2mm}
% PRINT_ACCOUNT_TYPE_TREE
%
% \input{c60}
%
%
% c60.tex
%
% C60 PRINT_ACCOUNT_TYPE_TREE
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT\APLY\APLP\APLE
\protect\APLunderbar\APLT\APLR\APLE\APLE
}
\APLcolon\APLrightshoe\APLleftbracket\APLtwo\APLrightbracket
\APLepsilon\APLdieresis\APLleftparen\APLleftparen\APLthree
\APLtimes\APLJ\APLleftbracket\APLsemicolon\APLtwo\APLrightbracket
\APLrightparen\APLrho\APLdieresis\APLquote\APLspace\APLquote
\APLrightparen\APLcomma\APLdieresis\APLleftshoe\APLleftbracket
\APLtwo\APLrightbracket\APLzero\APLspace\protect\APLoverbar
\APLone\APLdownarrow\APLJ\APLleftarrow\APLleftparen\APLleftparen
\APLupstile\APLleftparen\APLuparrow\APLrho\APLJ\APLrightparen
\APLdivide\APLtwo\APLrightparen\APLcomma\APLtwo\APLrightparen
\APLrho\APLJ\APLleftarrow\APLleftparen\APLleftparen\APLleftshoe
\APLomega\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar
\APLT\APLY\APLP\APLE\APLspace\APLB\APLA\APLL\APLA\APLN\APLC\APLE
\protect\APLunderbar\APLS\APLH\APLE\APLE\APLT\APLrightparen
\APLzero\APLrightparen\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect
\APLunderbar\APLT\APLY\APLP\APLE\protect\APLunderbar\APLT\APLR
\APLE\APLE\APLleftparen\APLtwo\APLrightshoe\APLomega
\APLrightparen\APLP\APLR\APLE\APLO\APLR\APLD\APLE\APLR\APLleftparen
\APLfour\APLrightshoe\APLomega\APLrightparen
\end{APLline}
%
% c60.tex
%
\end{APLfns}

This function basically first sets up the call of ACCOUNT\_TYPE\_TREE with the help
of the functions PREORDER and ACCOUNT\_TYPE, then calls ACCOUNT\_TYPE\_TREE and formats
its result. The key idea in formatting is to use the depth information which is returned
from ACCOUNT\_TYPE\_TREE to calculate the indentation of the account type.

The function ACCOUNT\_TYPE returns the account type of an account given
its account key. In PRINT\_ACCOUNT\_TYPE\_TREE the function ACCOUNT\_TYPE returns the
account type of the  balance sheet. The account type of the balance sheet is the root of the account
type system.

% ACCOUNT_TYPE
\begin{APLfns}
\begin{APLline}
\APLless account type \APLgreater
\APLleftarrow
\ace
{\bf ACCOUNT\_TYPE}
\APLless account key \APLgreater
\end{APLline}
\vspace{2mm}
% ACCOUNT_TYPE
%
% \input{c3}
%
%
% c3.tex
%
% C3 ACCOUNT_TYPE
\begin{APLline}
{\bf
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT
\APLY\APLP\APLE
}
\APLcolon\APLthree\APLrightshoe\APLleftparen\APLleftparen
\APLthree\APLrightshoe\APLalpha\APLrightparen\APLA\APLC\APLC\APLE
\APLS\APLS\protect\APLunderbar\APLK\APLE\APLY\APLomega
\APLrightparen\APLrightshoe\APLtwo\APLrightshoe\APLalpha
\end{APLline}
%
% c3.tex
%
\end{APLfns}

The function ACCOUNT\_TYPE\_TREE is a depth first recursive tree traversal function.

% ACCOUNT_TYPE_TREE
\begin{APLfns}
\begin{APLline}
\APLless vector of \APLless enclosed account type \APLgreater \APLless depth \APLgreater \dots \APLgreater
\APLleftarrow
(\APLless enclosed account type \APLgreater
\APLless depth \APLgreater)
{\bf ACCOUNT\_TYPE\_TREE}
\APLless preorder matrix \APLgreater
\end{APLline}
\vspace{2mm}
% ACCOUNT_TYPE_TREE
%
% \input{c4}
%
%
% c4.tex
%
% C4 ACCOUNT_TYPE_TREE
\begin{APLline}
{\bf
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT
\APLY\APLP\APLE\protect\APLunderbar\APLT\APLR\APLE\APLE
}
\APLcolon\APLalpha\APLcomma\APLrightshoe\APLcomma\APLslash
\APLleftparen\APLleftparen\APLleftshoe\APLdieresis\APLleftshoe
\APLdieresis\APLJ\APLrightparen\APLcomma\APLdieresis\APLone
\APLplus\APLtwo\APLrightshoe\APLalpha\APLrightparen\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT\APLY\APLP\APLE
\protect\APLunderbar\APLT\APLR\APLE\APLE\APLdieresis\APLleftshoe
\APLomega\APLcolon\APLleftparen\APLzero\APLequal\APLrho\APLJ
\APLleftarrow\APLleftparen\APLleftparen\APLuparrow\APLalpha
\APLrightparen\APLS\APLU\APLB\protect\APLunderbar\APLT\APLY\APLP
\APLE\APLomega\APLrightparen\APLtilde\APLuparrow\APLalpha
\APLrightparen\APLdowncaret\APLleftparen\APLleftparen\APLone\APLplus
\APLuparrow\APLrho\APLomega\APLrightparen\APLless\APLtwo
\APLrightshoe\APLalpha\APLrightparen\APLcolon\APLcomma\APLalpha
\end{APLline}
%
% c4.tex
%
\end{APLfns}

We start the tree traversal by setting up the left argument as the root account type with
a depth of \APLzero. The recursion terminates, if we do not find a strict subtype or if the depth
of the tree exceeds the number of types in the account type system. The phrasing `strict'
subtype takes care of the special case of the root of the type system. The second condition
breaks cycles.

The function SUB\_TYPE finds all subtypes for a given account type.

% SUB_TYPE
\begin{APLfns}
\begin{APLline}
\APLless subaccount types \APLgreater
\APLleftarrow
\APLless account type \APLgreater
{\bf SUB\_TYPE}
\APLless preorder matrix \APLgreater
\end{APLline}
\vspace{2mm}
% SUB_TYPE
%
% \input{c75}
%
%
% c75.tex
%
% C75 SUB_TYPE
\begin{APLline}
{\bf
\APLS\APLU\APLB\protect\APLunderbar\APLT\APLY\APLP\APLE
}
\APLcolon\APLleftparen\APLcomma\APLomega\APLleftbracket
\APLsemicolon\APLtwo\APLrightbracket\APLepsilon\APLalpha
\APLrightparen\APLslash\APLleftbracket\APLone\APLrightbracket\APLomega
\APLleftbracket\APLsemicolon\APLone\APLrightbracket
\end{APLline}
%
% c75.tex
%
\end{APLfns}

Is \hfill the \hfill account \hfill type \hfill system \hfill consistent?  \\
Well, \hfill we \hfill may \hfill check \hfill this \hfill with \hfill the \hfill function \\
CHECK\_ACCOUNT\_TYPE\_SYSTEM.

An account type system is consistent:
{\partopsep=0pt\topsep=0pt\parskip=0pt\parsep=0pt\itemsep=0pt\parindent=0pt
\begin{enumerate}
\item If the account types of all ledger accounts are types of the account type system.
\item If it is connected.
\item If it is acyclic.
\end{enumerate}
}

% CHECK_ACCOUNT_TYPE_SYSTEM
\begin{APLfns}
\begin{APLline}
\APLless diagnostic message \APLgreater
\APLleftarrow
{\bf CHECK\_ACCOUNT\_TYPE\_SYSTEM}
\ace
\end{APLline}
\vspace{2mm}
% CHECK_ACCOUNT_TYPE_SYSTEM
%
% \input{c13}
%
%
% c13.tex
%
% C13 CHECK_ACCOUNT_TYPE_SYSTEM
\begin{APLline}
{\bf
\APLC\APLH\APLE\APLC\APLK\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT\APLY\APLP\APLE
\protect\APLunderbar\APLS\APLY\APLS\APLT\APLE\APLM
}
\APLcolon\APLleftparen\APLepsilon\APLleftparen\APLupcaret
\APLslash\APLA\APLX\APLone\APLspace\APLA\APLX\APLtwo\APLspace
\APLA\APLX\APLthree\APLrightparen\APLleftparen\APLtilde\APLA\APLX
\APLone\APLleftarrow\APLzero\APLequal\APLrho\APLW\APLR\APLO
\APLN\APLG\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT
\protect\APLunderbar\APLT\APLY\APLP\APLE\APLomega\APLrightparen
\APLleftparen\APLleftparen\APLtilde\APLA\APLX\APLtwo
\APLleftarrow\APLleftparen\APLrho\APLfour\APLrightshoe\APLomega
\APLrightparen\APLequal\APLJ\APLrightparen\APLupcaret\APLleftparen\APLJ
\APLless\APLrho\APLfour\APLrightshoe\APLomega\APLrightparen
\APLrightparen\APLleftparen\APLtilde\APLA\APLX\APLthree
\APLleftarrow\APLleftparen\APLrho\APLfour\APLrightshoe\APLomega
\APLrightparen\APLnotless\APLJ\APLleftarrow\APLupstile\APLzero\APLdot
\APLfive\APLtimes\APLrho\APLleftparen\APLleftparen\APLleftshoe
\APLomega\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar
\APLT\APLY\APLP\APLE\APLspace\APLB\APLA\APLL\APLA\APLN\APLC
\APLE\protect\APLunderbar\APLS\APLH\APLE\APLE\APLT\APLrightparen
\APLzero\APLrightparen\APLA\APLC\APLC\APLO\APLU\APLN\APLT
\protect\APLunderbar\APLT\APLY\APLP\APLE\protect\APLunderbar\APLT
\APLR\APLE\APLE\APLleftparen\APLtwo\APLrightshoe\APLomega
\APLrightparen\APLP\APLR\APLE\APLO\APLR\APLD\APLE\APLR\APLleftparen
\APLfour\APLrightshoe\APLomega\APLrightparen\APLrightparen
\APLrightparen\APLslash\APLquote\APLO\APLk\APLquote\APLspace\APLquote
\APLW\APLr\APLo\APLn\APLg\APLspace\APLa\APLc\APLc\APLo\APLu
\APLn\APLt\APLspace\APLt\APLy\APLp\APLe\APLspace\APLi\APLn
\APLspace\APLl\APLe\APLd\APLg\APLe\APLr\APLquote\APLspace\APLquote
\APLC\APLl\APLo\APLs\APLi\APLn\APLg\APLspace\APLo\APLr\APLd\APLe
\APLr\APLspace\APLn\APLo\APLt\APLspace\APLc\APLo\APLm\APLp\APLl
\APLe\APLt\APLe\APLquote\APLspace\APLquote\APLC\APLy\APLc\APLl
\APLe\APLspace\APLi\APLn\APLspace\APLc\APLl\APLo\APLs\APLi
\APLn\APLg\APLspace\APLo\APLr\APLd\APLe\APLr\APLquote
\end{APLline}
%
% c13.tex
%
\end{APLfns}

The function WRONG\_ACCOUNT\_TYPE lists all accounts whose account types
are not included in the account type system.

% WRONG_ACCOUNT_TYPE
\begin{APLfns}
\begin{APLline}
\APLless list of account keys \APLgreater
\APLleftarrow
{\bf WRONG\_ACCOUNT\_TYPE}
\ace
\end{APLline}
\vspace{2mm}
% WRONG_ACCOUNT_TYPE
%
% \input{c78}
%
%
% c78.tex
%
% C78 WRONG_ACCOUNT_TYPE
\begin{APLline}
{\bf
\APLW\APLR\APLO\APLN\APLG\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT\APLY\APLP\APLE
}
\APLcolon\APLleftparen\APLtilde\APLleftparen\APLthree
\APLrightshoe\APLdieresis\APLtwo\APLrightshoe\APLomega\APLrightparen
\APLepsilon\APLleftparen\APLone\APLrightshoe\APLdieresis
\APLfour\APLrightshoe\APLomega\APLrightparen\APLrightparen\APLslash
\APLleftparen\APLone\APLrightshoe\APLdieresis\APLtwo
\APLrightshoe\APLomega\APLrightparen
\end{APLline}
%
% c78.tex
%
\end{APLfns}
\end{aplese}

\begin{aplese}
The summary accounts defined in the closing order are the inner nodes of
the tree of accounts induced by the account type system. In the opening
process the root of the tree is the opening balance sheet. By adding
the opening balance sheet we take this into account. The function NEW\_BOOKS
constructs a niladic function named BOOKS which returns this set of accounts
and fixes the function BOOKS in the workspace. The list of accounts returned
by BOOKS is used by EXPLAIN and EXPLAIN\_1 to generate the documentation
for opening and closing transactions. Be aware, that this is a side effect.

% NEW\_BOOKS
\begin{APLfns}
\begin{APLline}
\APLless closing order \APLgreater
\APLleftarrow
{\bf NEW\_BOOKS}
\APLless closing order \APLgreater
\end{APLline}
\vspace{2mm}
% NEW\_BOOKS
%
% \input{c37}
%
%
% c37.tex
%
% C37 NEW_BOOKS
\begin{APLline}
{\bf
\APLN\APLE\APLW\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
}
\APLcolon\APLomega\APLcomma\APLzero\APLrho\APLquad\APLF\APLX
\APLspace\APLquote\APLZ\APLleftarrow\APLB\APLO\APLO\APLK\APLS
\APLquote\APLleftparen\APLtwo\APLspace\APLquad\APLT\APLF
\APLspace\APLquote\APLZ\APLquote\APLcomma\APLzero\APLrho\APLZ
\APLleftarrow\APLleftparen\APLleftshoe\APLO\APLP\APLE\APLN\APLI\APLN
\APLG\protect\APLunderbar\APLB\APLA\APLL\APLA\APLN\APLC\APLE
\protect\APLunderbar\APLS\APLH\APLE\APLE\APLT\APLrightparen
\APLcomma\APLU\APLN\APLI\APLQ\APLU\APLE\APLspace\APLtwo\APLrightshoe
\APLdieresis\APLomega\APLrightparen
\end{APLline}
%
% c37.tex
%
\end{APLfns}

UNIQUE is a well known APL idiom, which deletes all
duplicates from a vector of elements:

% UNIQUE
\begin{APLfns}
\begin{APLline}
\APLless set of items \APLgreater
\APLleftarrow
{\bf UNIQUE}
\APLless bag of items \APLgreater
\end{APLline}
\vspace{2mm}
% UNIQUE
%
% \input{c79}
%
%
% c79.tex
%
% C79 UNIQUE
\begin{APLline}
{\bf
\APLU\APLN\APLI\APLQ\APLU\APLE
}
\APLcolon\APLleftparen\APLleftparen\APLomega\APLiota
\APLomega\APLrightparen\APLequal\APLiota\APLrho\APLomega\APLrightparen
\APLslash\APLomega
\end{APLline}
%
% c79.tex
%
\end{APLfns}
\end{aplese}

\begin{aplese}
To tighten up the loose ends, we implement as promised in section \ref{preparationsec}
the function BREADTH\_FIRST. It first sets up the arguments for
SUB\_TYPES, another tree traversal algorithm and then reverses the result and
rearranges the closing entries in topologically sorted order.

% BREADTH_FIRST
\begin{APLfns}
\begin{APLline}
\APLless topologically sorted closing entries \APLgreater
\APLleftarrow
{\bf BREADTH\_FIRST}
\ace
\end{APLline}
\vspace{2mm}
% BREADTH_FIRST
%
% \input{c10}
%
%
% c10.tex
%
% C10 BREADTH_FIRST
\begin{APLline}
{\bf
\APLB\APLR\APLE\APLA\APLD\APLT\APLH\protect\APLunderbar\APLF
\APLI\APLR\APLS\APLT
}
\APLcolon\APLleftparen\APLfour\APLrightshoe\APLomega
\APLrightparen\APLleftbracket\APLleftparen\APLone\APLrightshoe
\APLdieresis\APLfour\APLrightshoe\APLomega\APLrightparen\APLiota
\APLcirclestile\APLleftparen\APLleftshoe\APLomega\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT\APLY\APLP\APLE
\APLspace\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect\APLunderbar
\APLS\APLH\APLE\APLE\APLT\APLrightparen\APLS\APLU\APLB\protect
\APLunderbar\APLT\APLY\APLP\APLE\APLS\APLleftparen\APLtwo
\APLrightshoe\APLomega\APLrightparen\APLP\APLR\APLE\APLO\APLR\APLD\APLE
\APLR\APLleftparen\APLfour\APLrightshoe\APLomega\APLrightparen
\APLrightbracket
\end{APLline}
%
% c10.tex
%
\end{APLfns}

SUB\_TYPES is a breadth first tree traversal algorithm which produces a linear
list of account types starting from the root. It terminates, when the list of
account types ceases to change. For starting, the left argument should be
a one element list of the root account type.

% SUB_TYPES
\begin{APLfns}
\begin{APLline}
\APLless list of account types \APLgreater
\APLleftarrow
\APLless list of account types \APLgreater
{\bf SUB\_TYPES}
\APLless preorder matrix \APLgreater
\end{APLline}
\vspace{2mm}
% SUB_TYPES
%
% \input{c76}
%
%
% c76.tex
%
% C76 SUB_TYPES
\begin{APLline}
{\bf
\APLS\APLU\APLB\protect\APLunderbar\APLT\APLY\APLP\APLE\APLS
}
\APLcolon\APLJ\APLspace\APLS\APLU\APLB\protect\APLunderbar
\APLT\APLY\APLP\APLE\APLS\APLomega\APLcolon\APLalpha
\APLequalunderbar\APLJ\APLleftarrow\APLU\APLN\APLI\APLQ\APLU\APLE\APLalpha
\APLcomma\APLrightshoe\APLcomma\APLslash\APLleftparen
\APLleftshoe\APLdieresis\APLalpha\APLrightparen\APLS\APLU\APLB\protect
\APLunderbar\APLT\APLY\APLP\APLE\APLdieresis\APLleftshoe
\APLomega\APLcolon\APLJ
\end{APLline}
%
% c76.tex
%
\end{APLfns}
\end{aplese}

\begin{aplese}
Finally we are ready to tackle the problem of a really general
opening procedure. But we have to be careful, four different
ways of opening the books exist:
\begin{enumerate}
\item We open new books for a new accounting period.
      All temporary owner's equity accounts are not opened.
      All permanent accounts are opened with their balance.
      The history of previous accounting periods is lost.
      (OPEN\_NEW\_BOOKS)
\item We open old books for a new accounting period.
      All temporary owner's equity accounts are not opened.
      All permanent accounts are opened with their balance.
      The history remains in the accounts, old entries are
      separated by an empty line from the new ones.
      (OPEN\_OLD\_BOOKS)
\item We open after a trial balance new books.
      All accounts are opened with their balance.
      The history of the accounting period is lost.
      (OPEN\_NEW\_TRIAL\_BALANCE)
\item We open after a trial balance old books.
      All accounts are opened with their balance.
      (OPEN\_OLD\_TRIAL\_BALANCE)
\end{enumerate}

Let us construct the building blocks for these four functions next:

Opening an open ledger might ruin all data, so all opening
functions test, if the books really have been closed.
If the books are open, they behave like identity functions:
Nothing happens and an error message is printed.
The function OPEN\_ERROR is used by all four of them.

\begin{APLfns}
\begin{APLline}
\ace
\APLleftarrow
{\bf OPEN\_ERROR}
\ \ace
\end{APLline}
\vspace{2mm}
% OPEN_ERROR
%
% \input{c41}
%
%
% c41.tex
%
% C41 OPEN_ERROR
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLE\APLR\APLR\APLO
\APLR
}
\APLcolon\APLomega\APLcomma\APLzero\APLrho\APLquadquote
\APLleftarrow\APLquote\APLE\APLr\APLr\APLo\APLr\APLdot\APLspace
\APLB\APLo\APLo\APLk\APLs\APLspace\APLa\APLr\APLe\APLspace\APLa
\APLl\APLr\APLe\APLa\APLd\APLy\APLspace\APLo\APLp\APLe\APLn
\APLdot\APLquote
\end{APLline}
%
% c41.tex
%
\end{APLfns}

The next (simple) building block is a ``neutral'' transaction
which generates an empty (at least almost) line in the accounts.
The function END\_OF\_PERIOD, which is only used by the function
OPEN\_OLD\_BOOKS, implements this.

\begin{APLfns}
\begin{APLline}
\ace
\APLleftarrow
{\bf END\_OF\_PERIOD}
\ \ace
\end{APLline}
\vspace{2mm}
% END_OF_PERIOD
%
% \input{c21}
%
%
% c21.tex
%
% C21 END_OF_PERIOD
\begin{APLline}
{\bf
\APLE\APLN\APLD\protect\APLunderbar\APLO\APLF\protect
\APLunderbar\APLP\APLE\APLR\APLI\APLO\APLD
}
\APLcolon\APLomega\APLP\APLO\APLS\APLT\protect\APLunderbar
\APLA\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA\APLL
\APLspace\APLone\APLcomma\APLquote\APLspace\APLquote\APLcomma
\APLquote\APLspace\APLquote\APLcomma\APLleftparen\APLthree
\APLrightshoe\APLomega\APLrightparen\APLcomma\APLzero\APLcomma\APLzero
\APLcomma\APLleftbracket\APLone\APLdot\APLfive\APLrightbracket
\APLthree\APLrightshoe\APLomega
\end{APLline}
%
% c21.tex
%
\end{APLfns}

The basic idea of the opening process is simply to reverse the arrows
and to use the reversed closing transactions as opening transactions:

REVERSE\_JOURNAL \hfill simply \hfill constructs \hfill the \\
 opening journal entries from
the closing journal entries. Let \APLalpha\ denote an accounting entity.
\APLleftparen\APLleftparen\APLleftparen\APLfive\APLrightshoe\APLalpha%
\APLrightparen\APLcomma\APLzero\APLrightparen\APLdownarrow\APLleftparen%
\APLone\APLrightshoe\APLalpha\APLrightparen\APLrightparen\ constructs
the closing journal entries and by appending date and explanation,
reordering and inverting the journal columns and finally, by
substituting the account key of the balance sheet by the account
key of the opening balance sheet, we get the opening journal entries.

\begin{APLfns}
\begin{APLline}
\APLless opening journal entries \APLgreater
\APLleftarrow
\ace
{\bf REVERSE\_JOURNAL}
\ \dat
\end{APLline}
\vspace{2mm}
% REVERSE_JOURNAL
%
% \input{c72}
%
%
% c72.tex
%
% C72 REVERSE_JOURNAL
\begin{APLline}
{\bf
\APLR\APLE\APLV\APLE\APLR\APLS\APLE\protect\APLunderbar\APLJ
\APLO\APLU\APLR\APLN\APLA\APLL
}
\APLcolon\APLleftparen\APLB\APLA\APLL\APLA\APLN\APLC\APLE
\protect\APLunderbar\APLS\APLH\APLE\APLE\APLT\APLspace\APLO\APLP
\APLE\APLN\APLI\APLN\APLG\protect\APLunderbar\APLB\APLA\APLL
\APLA\APLN\APLC\APLE\protect\APLunderbar\APLS\APLH\APLE\APLE\APLT
\APLrightparen\APLC\APLH\APLA\APLN\APLG\APLE\protect
\APLunderbar\APLR\APLO\APLO\APLT\APLleftparen\APLleftparen\APLleftshoe
\APLomega\APLrightparen\APLcomma\APLleftparen\APLleftshoe
\APLquote\APLleftparen\APLo\APLb\APLrightparen\APLquote\APLrightparen
\APLcomma\APLleftparen\APLleftparen\APLleftparen\APLfive
\APLrightshoe\APLalpha\APLrightparen\APLcomma\APLzero\APLrightparen
\APLdownarrow\APLleftparen\APLone\APLrightshoe\APLalpha
\APLrightparen\APLrightparen\APLleftbracket\APLsemicolon\APLone
\APLspace\APLseven\APLspace\APLfive\APLspace\APLsix\APLspace\APLfour
\APLrightbracket\APLrightparen\APLleftbracket\APLsemicolon
\APLthree\APLspace\APLone\APLspace\APLtwo\APLspace\APLfour\APLspace
\APLfive\APLspace\APLsix\APLspace\APLseven\APLrightbracket
\end{APLline}
%
% c72.tex
%
\end{APLfns}

CHANGE\_ROOT implements changing the balance sheet's account key to the
account key of the opening balance sheet \dots

\begin{APLfns}
\begin{APLline}
\APLless new journal entries \APLgreater
\APLleftarrow
(\APLless old root account key \APLgreater
\APLless new root account key \APLgreater
{\bf CHANGE\_ROOT}
\APLless journal entries \APLgreater
\end{APLline}
\vspace{2mm}
% CHANGE_ROOT
%
% \input{c11}
%
%
% c11.tex
%
% C11 CHANGE_ROOT
\begin{APLline}
{\bf
\APLC\APLH\APLA\APLN\APLG\APLE\protect\APLunderbar\APLR\APLO
\APLO\APLT
}
\APLcolon\APLomega\APLleftbracket\APLsemicolon\APLiota
\APLthree\APLrightbracket\APLcomma\APLleftparen\APLleftparen
\APLleftshoe\APLalpha\APLrightparen\APLS\APLW\APLA\APLP\APLdieresis
\APLomega\APLleftbracket\APLsemicolon\APLfour\APLrightbracket
\APLrightparen\APLcomma\APLomega\APLleftbracket\APLsemicolon
\APLfive\APLspace\APLsix\APLrightbracket\APLcomma\APLleftparen
\APLleftshoe\APLalpha\APLrightparen\APLS\APLW\APLA\APLP\APLdieresis
\APLomega\APLleftbracket\APLsemicolon\APLseven\APLrightbracket
\end{APLline}
%
% c11.tex
%
\end{APLfns}

\noindent
\dots and uses SWAP for the exchange of the account keys:
if the template matches the item, the item is replaced by the substitute.

\begin{APLfns}
\begin{APLline}
\APLless new item \APLgreater
\APLleftarrow
(\APLless template \APLgreater
\APLless substitute \APLgreater
{\bf SWAP}
\APLless item \APLgreater
\end{APLline}
\vspace{2mm}
% SWAP
%
% \input{c77}
%
%
% c77.tex
%
% C77 SWAP
\begin{APLline}
{\bf
\APLS\APLW\APLA\APLP
}
\APLcolon\APLomega\APLcolon\APLomega\APLequalunderbar\APLone
\APLrightshoe\APLalpha\APLcolon\APLtwo\APLrightshoe\APLalpha
\end{APLline}
%
% c77.tex
%
\end{APLfns}

The last brick is the idea of splitting the opening journal entries and
for a new accounting period forgetting all entries which affect temporary
owner's equity accounts (all subaccounts of and including the income statement).

\begin{APLfns}
\begin{APLline}
\APLless opening journal entries \APLgreater
\APLleftarrow
\APLless account key \APLgreater
\APLless ledger \APLgreater
\APLless closing order \APLgreater
{\bf SPLIT\_JOURNAL}
\APLless opening journal entries \APLgreater
\end{APLline}
\vspace{2mm}
% SPLIT_JOURNAL
%
% \input{c73}
%
%
% c73.tex
%
% C73 SPLIT_JOURNAL
\begin{APLline}
{\bf
\APLS\APLP\APLL\APLI\APLT\protect\APLunderbar\APLJ\APLO\APLU
\APLR\APLN\APLA\APLL
}
\APLcolon\APLleftparen\APLtilde\APLleftparen\APLcomma
\APLomega\APLleftbracket\APLsemicolon\APLfour\APLrightbracket
\APLepsilon\APLS\APLrightparen\APLdowncaret\APLleftparen\APLcomma
\APLomega\APLleftbracket\APLsemicolon\APLseven\APLrightbracket
\APLepsilon\APLS\APLleftarrow\APLleftparen\APLuparrow\APLalpha
\APLrightparen\APLS\APLU\APLB\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\APLS\APLspace\APLone\APLdownarrow\APLalpha
\APLrightparen\APLrightparen\APLslash\APLleftbracket\APLone
\APLrightbracket\APLomega
\end{APLline}
%
% c73.tex
%
\end{APLfns}

The function SPLIT\_JOURNAL shown above uses the
function SUB\_ACCOUNTS to enumerate all subaccounts
of the income statement.

\begin{APLfns}
\begin{APLline}
\APLless list of account keys \APLgreater
\APLleftarrow
\APLless account key \APLgreater
{\bf SUB\_ACCOUNTS}
\APLless ledger \APLgreater
\APLless closing order \APLgreater
\end{APLline}
\vspace{2mm}
% SUB_ACCOUNTS
%
% \input{c74}
%
%
% c74.tex
%
% C74 SUB_ACCOUNTS
\begin{APLline}
{\bf
\APLS\APLU\APLB\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU
\APLN\APLT\APLS
}
\APLcolon\APLleftparen\APLleftshoe\APLalpha\APLrightparen
\APLcomma\APLleftparen\APLleftparen\APLthree\APLrightshoe
\APLdieresis\APLone\APLrightshoe\APLomega\APLrightparen\APLepsilon
\APLleftparen\APLM\APLslash\APLone\APLrightshoe\APLdieresis\APLtwo
\APLrightshoe\APLomega\APLrightparen\APLS\APLU\APLB\protect
\APLunderbar\APLT\APLY\APLP\APLE\APLS\APLleftparen\APLone
\APLrightshoe\APLomega\APLrightparen\APLP\APLR\APLE\APLO\APLR\APLD
\APLE\APLR\APLleftparen\APLtwo\APLrightshoe\APLomega\APLrightparen
\APLrightparen\APLslash\APLleftparen\APLone\APLrightshoe
\APLdieresis\APLone\APLrightshoe\APLomega\APLrightparen\APLcolon
\APLzero\APLequal\APLdowncaret\APLslash\APLM\APLleftarrow
\APLleftparen\APLtwo\APLrightshoe\APLdieresis\APLleftparen\APLtwo
\APLrightshoe\APLomega\APLrightparen\APLrightparen\APLepsilon
\APLleftshoe\APLalpha\APLcolon\APLcomma\APLleftshoe\APLalpha
\end{APLline}
%
% c74.tex
%
\end{APLfns}

Finally we present now the opening functions for the four cases:
\begin{enumerate}
\item We open new books for a new accounting period.

\begin{APLfns}
\begin{APLline}
\APLless new accounting entity \APLgreater
\APLleftarrow
\ace
{\bf OPEN\_NEW\_BOOKS}
\ \dat
\end{APLline}
\vspace{2mm}
% OPEN_NEW_BOOKS
%
% \input{c42}
%
%
% c42.tex
%
% C42 OPEN_NEW_BOOKS
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLN\APLE\APLW
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
}
\APLcolon\APLleftparen\APLN\APLE\APLW\protect\APLunderbar
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLI\APLN\APLG\protect
\APLunderbar\APLE\APLN\APLT\APLI\APLT\APLY\APLuparrow\protect
\APLoverbar\APLone\APLuparrow\APLalpha\APLrightparen\APLP\APLO\APLS
\APLT\protect\APLunderbar\APLA\protect\APLunderbar\APLJ\APLO\APLU
\APLR\APLN\APLA\APLL\APLleftparen\APLleftparen\APLleftshoe
\APLI\APLN\APLC\APLO\APLM\APLE\protect\APLunderbar\APLS\APLT\APLA
\APLT\APLE\APLM\APLE\APLN\APLT\APLrightparen\APLcomma\APLalpha
\APLleftbracket\APLtwo\APLspace\APLfour\APLrightbracket
\APLrightparen\APLS\APLP\APLL\APLI\APLT\protect\APLunderbar\APLJ\APLO
\APLU\APLR\APLN\APLA\APLL\APLalpha\APLR\APLE\APLV\APLE\APLR
\APLS\APLE\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA\APLL
\APLomega\APLcolon\APLleftparen\APLfive\APLrightshoe\APLalpha
\APLrightparen\APLequal\APLzero\APLcolon\APLO\APLP\APLE\APLN
\protect\APLunderbar\APLE\APLR\APLR\APLO\APLR\APLalpha
\end{APLline}
%
% c42.tex
%
\end{APLfns}

\item We open old books for a new accounting period.

\begin{APLfns}
\begin{APLline}
\APLless new accounting entity \APLgreater
\APLleftarrow
\ace
{\bf OPEN\_OLD\_BOOKS}
\ \dat
\end{APLline}
\vspace{2mm}
% OPEN_OLD_BOOKS
%
% \input{c44}
%
%
% c44.tex
%
% C44 OPEN_OLD_BOOKS
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLO\APLL\APLD
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
}
\APLcolon\APLleftparen\APLE\APLN\APLD\protect\APLunderbar
\APLO\APLF\protect\APLunderbar\APLP\APLE\APLR\APLI\APLO\APLD
\APLleftparen\APLalpha\APLleftbracket\APLiota\APLfour
\APLrightbracket\APLcomma\APLleftparen\APLleftshoe\APLuparrow\APLrho\APLN
\APLE\APLW\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA\APLL
\APLrightparen\APLcomma\APLalpha\APLleftbracket\APLsix
\APLrightbracket\APLrightparen\APLrightparen\APLP\APLO\APLS\APLT
\protect\APLunderbar\APLA\protect\APLunderbar\APLJ\APLO\APLU\APLR
\APLN\APLA\APLL\APLleftparen\APLleftparen\APLleftshoe\APLI\APLN
\APLC\APLO\APLM\APLE\protect\APLunderbar\APLS\APLT\APLA\APLT
\APLE\APLM\APLE\APLN\APLT\APLrightparen\APLcomma\APLalpha
\APLleftbracket\APLtwo\APLspace\APLfour\APLrightbracket\APLrightparen
\APLS\APLP\APLL\APLI\APLT\protect\APLunderbar\APLJ\APLO\APLU
\APLR\APLN\APLA\APLL\APLalpha\APLR\APLE\APLV\APLE\APLR\APLS\APLE
\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA\APLL\APLomega
\APLcolon\APLleftparen\APLfive\APLrightshoe\APLalpha
\APLrightparen\APLequal\APLzero\APLcolon\APLO\APLP\APLE\APLN\protect
\APLunderbar\APLE\APLR\APLR\APLO\APLR\APLalpha
\end{APLline}
%
% c44.tex
%
\end{APLfns}

\item We open after a trial balance new books.

\begin{APLfns}
\begin{APLline}
\APLless new accounting entity \APLgreater
\APLleftarrow
\ace
{\bf OPEN\_NEW\_TRIAL\_BALANCE}
\ \dat
\end{APLline}
\vspace{2mm}
% OPEN_NEW_TRIAL_BALANCE
%
% \input{c43}
%
%
% c43.tex
%
% C43 OPEN_NEW_TRIAL_BALANCE
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLN\APLE\APLW
\protect\APLunderbar\APLT\APLR\APLI\APLA\APLL\protect\APLunderbar
\APLB\APLA\APLL\APLA\APLN\APLC\APLE
}
\APLcolon\APLleftparen\APLN\APLE\APLW\protect\APLunderbar
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLI\APLN\APLG\protect
\APLunderbar\APLE\APLN\APLT\APLI\APLT\APLY\APLuparrow\protect
\APLoverbar\APLone\APLuparrow\APLalpha\APLrightparen\APLP\APLO\APLS
\APLT\protect\APLunderbar\APLA\protect\APLunderbar\APLJ\APLO\APLU
\APLR\APLN\APLA\APLL\APLleftparen\APLI\APLN\APLC\APLO\APLM
\APLE\protect\APLunderbar\APLS\APLT\APLA\APLT\APLE\APLM\APLE\APLN
\APLT\APLspace\APLO\APLP\APLE\APLN\APLI\APLN\APLG\protect
\APLunderbar\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect\APLunderbar
\APLS\APLH\APLE\APLE\APLT\APLrightparen\APLC\APLH\APLA\APLN
\APLG\APLE\protect\APLunderbar\APLR\APLO\APLO\APLT\APLleftparen
\APLalpha\APLR\APLE\APLV\APLE\APLR\APLS\APLE\protect\APLunderbar
\APLJ\APLO\APLU\APLR\APLN\APLA\APLL\APLomega\APLrightparen
\APLcolon\APLleftparen\APLfive\APLrightshoe\APLalpha\APLrightparen
\APLequal\APLzero\APLcolon\APLO\APLP\APLE\APLN\protect
\APLunderbar\APLE\APLR\APLR\APLO\APLR\APLalpha
\end{APLline}
%
% c43.tex
%
\end{APLfns}

\item We open after a trial balance old books.

\begin{APLfns}
\begin{APLline}
\APLless new accounting entity \APLgreater
\APLleftarrow
\ace
{\bf OPEN\_OLD\_TRIAL\_BALANCE}
\ \dat
\end{APLline}
\vspace{2mm}
% OPEN_OLD_TRIAL_BALANCE
%
% \input{c45}
%
%
% c45.tex
%
% C45 OPEN_OLD_TRIAL_BALANCE
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLO\APLL\APLD
\protect\APLunderbar\APLT\APLR\APLI\APLA\APLL\protect\APLunderbar
\APLB\APLA\APLL\APLA\APLN\APLC\APLE
}
\APLcolon\APLleftparen\APLalpha\APLleftbracket\APLiota
\APLfour\APLrightbracket\APLcomma\APLleftparen\APLleftshoe
\APLuparrow\APLrho\APLN\APLE\APLW\protect\APLunderbar\APLJ\APLO\APLU
\APLR\APLN\APLA\APLL\APLrightparen\APLcomma\APLalpha
\APLleftbracket\APLsix\APLrightbracket\APLrightparen\APLP\APLO\APLS\APLT
\protect\APLunderbar\APLA\protect\APLunderbar\APLJ\APLO\APLU\APLR
\APLN\APLA\APLL\APLleftparen\APLI\APLN\APLC\APLO\APLM\APLE
\protect\APLunderbar\APLS\APLT\APLA\APLT\APLE\APLM\APLE\APLN\APLT
\APLspace\APLO\APLP\APLE\APLN\APLI\APLN\APLG\protect\APLunderbar
\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect\APLunderbar\APLS
\APLH\APLE\APLE\APLT\APLrightparen\APLC\APLH\APLA\APLN\APLG\APLE
\protect\APLunderbar\APLR\APLO\APLO\APLT\APLleftparen\APLalpha
\APLR\APLE\APLV\APLE\APLR\APLS\APLE\protect\APLunderbar\APLJ
\APLO\APLU\APLR\APLN\APLA\APLL\APLomega\APLrightparen\APLcolon
\APLleftparen\APLfive\APLrightshoe\APLalpha\APLrightparen
\APLequal\APLzero\APLcolon\APLO\APLP\APLE\APLN\protect\APLunderbar
\APLE\APLR\APLR\APLO\APLR\APLalpha
\end{APLline}
%
% c45.tex
%
\end{APLfns}
\end{enumerate}
\end{aplese}

\section{Summary}

We presented an introduction to financial accounting intertwined with an
implementation of the system in direct definition form. In presenting
the system we were only able to explain the core of the accounting system
and we did not discuss the user interface nor any of the printing routines.
The complete implementation of the system can be found in the appendix.

The system can be used for teaching courses in financial accounting or
as an introduction to the design and implementation of business applications in \APL\ \cite{hedge}.
The functions presented are intended either as source for advanced comprehension
and drilling exercises on accessing elements in generalized arrays or as
an introduction to functional programming and a first lecture on
abstract data types. Extensions to the system
which support special accounting topics like inflation accounting \cite{seicht} or
interpretation of financial ratios \cite{platzer} provide additional valuable exercise,
both in \APL\ and financial accounting. Furthermore, the system may serve
as testbed for embedding expert systems, intelligent user interfaces
or tutoring systems into commercial applications.
In order to be useful to the non-\APL\ world, either a full screen based user
interface or a window oriented user interface should be added.

\begin{thebibliography}{99}

\bibitem{abelson} Abelson H., Sussman G. J. and Sussman J., Structure and
                Interpretation of Computer Programs, MIT Press, Cambridge, MA, 1985.

\bibitem{adams} Adams S.S. and Nabi A. K., Neural Agents - A Frame of Mind,
                OOPSLA'89 Proceedings, 1989, 139-149.

\bibitem{beck}  Beck K. and Cunningham W., A Laboratory for Teaching Object-Oriented Thinking,
                OOPSLA'89 Proceedings, 1989, 1-6.

\bibitem{frand} Frand J.L. and Britt J.A., Sixth Annual UCLA Survey of Business School
                Computer Usage, CACM, V33, N5, 1990, 544-562.

\bibitem{gries} Gries D., Teaching Calculation and Discrimination:
                A More Effective Curriculum, CACM, V34, N3, 1991, 44-55.

\bibitem{grohmann} Grohmann C. and Schneider W., Materialien zum Rechnungswesen: Einheiten 1+2,
                Institut f\"ur Wirtschaftsp\"adagogik, Wirtschaftsuniversit\"at Wien, Wien, 1978.

\bibitem{hedge} Hedge G. W., Designing Modern Accounting Software, Byte, Summer 1987, 47-52.

\bibitem{horngren} Horngren C. T., Introduction to Financial Accounting,
                Prentice Hall, Englewood Cliffs, NJ, 1984.

\bibitem{ibm} IBM, APL2 Programming: Language Reference, Form No.: SH20-9227-1, 1985.

\bibitem{ijiri} Ijiri Y., Accounting Structured in APL,
                American Accounting Association, Sarasota,USA, 1984.

\bibitem{iverson} Iverson K. E., Notation as a Tool of Thought, CACM, V23, N8, 1980, 444-465.

\bibitem{jarvenpaa} Jarvenpaa S.L. and Ives B. and Davis G.B.,
                Supply/Demand of IS Doctorates in the 1990s,
                CACM, V34, N1, 1991, 86-98.

\bibitem{platzer} Platzer W. and Kros F. W., Buchhaltungs- und Bilanzierungs-Handbuch, ORAC, Wien, 1978.

\bibitem{seicht} Seicht G., Die kapitaltheoretische Bilanz und die Entwicklung
                 der Bilanztheorien, Duncker \& Humblot, Berlin, 1970.

\bibitem{soloway} Soloway E., Quick, Where do the Computers Go?,
                  CACM, V34, N2, 1991, 28-33.
\end{thebibliography}

\onecolumn
%\clearpage
\appendix
\parindent=0pt
\section{Definition of Data Structures}

\subsection{Accounting Entity}

\begin{APLfns}
% data structure accounting entity
%
% \input{ds1}
%
%
% ds1.tex
%

% data structure accounting entity
\begin{APLline}
\ace := \APLless journal\APLgreater
        \APLless ledger\APLgreater
        \APLless account keys\APLgreater
        \APLless closing order\APLgreater
        \APLless number of journal lines before closing\APLgreater
        \APLless company name\APLgreater
\end{APLline}

%
% ds1.tex
%

% data structure journal
%
% \input{ds2}
%
%
% ds2.tex
%

% data structure accounting entity

\begin{APLline}
\APLless journal\APLgreater :=
        \APLless journal entry number column\APLgreater
        \APLless date column\APLgreater
        \APLless explanation column\APLgreater
        \APLless posting reference column\APLgreater
        \APLless debit column\APLgreater
        \APLless credit column\APLgreater
        \APLless dual account column\APLgreater
\end{APLline}

%
% ds2.tex
%

% data structure ledger
%
% \input{ds3}
%
%
% ds3.tex
%

% data structure ledger

\begin{APLline}
\APLless ledger \APLgreater :=
        \APLless list of accounts\APLgreater
\end{APLline}

%
% ds3.tex
%

% data structure list of accounts
%
% \input{ds4}
%
%
% ds4.tex
%

% data structure list of accounts

\begin{APLline}
\APLless list of accounts\APLgreater :=
        \APLless account\APLgreater \APLstile
        \APLless account\APLgreater
        \APLless list of accounts\APLgreater
\end{APLline}

%
% ds4.tex
%

% data structure account
%
% \input{ds5}
%
%
% ds5.tex
%

% data structure account

\begin{APLline}
\APLless account\APLgreater := \key
        \APLless account name\APLgreater
        \APLless account type\APLgreater
        \APLless account contents\APLgreater
\end{APLline}

%
% ds5.tex
%

% data structure account contents
%
% \input{ds6}
%
%
% ds6.tex
%

% data structure account contents

\begin{APLline}
\APLless account contents\APLgreater :=
        \APLless date column\APLgreater
        \APLless explanation column\APLgreater
        \APLless journal entry number column\APLgreater
        \APLless dual account column\APLgreater
        \APLless debit column\APLgreater
        \APLless credit column\APLgreater
\end{APLline}

%
% ds6.tex
%

% data structure account keys
%
% \input{ds7}
%
%
% ds7.tex
%

% data structure account keys

\begin{APLline}
\APLless account keys \APLgreater :=
        \APLless list of account keys\APLgreater
\end{APLline}

%
% ds7.tex
%

% data structure list of account keys
%
% \input{ds8}
%
%
% ds8.tex
%

% data structure list of account keys

\begin{APLline}
\APLless list of account keys\APLgreater :=
        \APLless account key\APLgreater \APLstile
        \APLless account key\APLgreater
        \APLless list of account keys\APLgreater
\end{APLline}

%
% ds8.tex
%

% data structure closing order
%
% \input{ds9}
%
%
% ds9.tex
%

% data structure closing order

\begin{APLline}
\APLless closing order\APLgreater :=
        \APLless list of closing entries\APLgreater
\end{APLline}

%
% ds9.tex
%

% data structure list of closing of entries
%
% \input{ds10}
%
%
% ds10.tex
%

% data structure preordered list of closing entries

\begin{APLline}
\APLless list of closing entries\APLgreater :=
        \APLless closing entry\APLgreater \APLstile
        \APLless closing entry\APLgreater
        \APLless list of closing entries\APLgreater
\end{APLline}

%
% ds10.tex
%

% data structure closing entry
%
% \input{ds11}
%
%
% ds11.tex
%

% data structure closing entry

\begin{APLline}
\APLless closing entry\APLgreater :=
        \APLless account type\APLgreater
        \APLless summary account key\APLgreater
        \APLless debit explanation\APLgreater
        \APLless credit explanation\APLgreater
\end{APLline}

%
% ds11.tex
%

\end{APLfns}

\subsection{Transaction}

\begin{APLfns}
% data structure transaction
%
% \input{ds12}
%
%
% ds12.tex
%

% data structure transaction

\begin{APLline}
\APLless transaction \APLgreater := \APLless simple transaction \APLgreater
        \APLstile
        \APLless compound transaction \APLgreater
\end{APLline}

%
% ds12.tex
%

% data structure simple transaction
%
% \input{ds13}
%
%
% ds13.tex
%
% data structure simple transaction

\begin{APLline}
\APLless simple transaction \APLgreater := \dat
        \APLless explanation \APLgreater
        \APLless account key debit \APLgreater
        \APLless account key credit \APLgreater
        \APLless amount of money \APLgreater
\end{APLline}

%
% ds13.tex
%

% data structure compound transaction
%
% \input{ds14}
%
%
% ds14.tex
%
% data structure compound transaction

\begin{APLline}
\APLless compound transaction \APLgreater := \dat
        \APLless explanation \APLgreater
        \APLless debit list \APLgreater
        \APLless credit list \APLgreater
\end{APLline}

%
% ds14.tex
%

% data structure debit list
%
% \input{ds15}
%
%
% ds15.tex
%

% data structure debit list

\begin{APLline}
\APLless debit list \APLgreater := \APLless list item \APLgreater \APLstile
             \APLless list item \APLgreater
             \APLless debit list \APLgreater
\end{APLline}

%
% ds15.tex
%

% data structure credit list
%
% \input{ds16}
%
%
% ds16.tex
%

% data structure credit list

\begin{APLline}
\APLless credit list \APLgreater := \APLless list item \APLgreater \APLstile
             \APLless list item \APLgreater
             \APLless credit list \APLgreater
\end{APLline}

%
% ds16.tex
%

% data structure list item
%
% \input{ds17}
%
%
% ds17.tex
%

% data structure list item

\begin{APLline}
\APLless list item \APLgreater := \key
        \APLless amount of money \APLgreater
\end{APLline}

%
% ds17.tex
%

\end{APLfns}

\subsection{Simple Structures}

Since the BNF for the financial accounting data structures
is an informal means of describing the
nested arrays,  the names of the symbols are chosen in such a way
as to suggest its meaning in the field of financial
accounting. Simple structures as vectors and numbers are not
included in the grammar.

Tables are described in terms of their column names. We have
four types of columns of text vectors, namely
\APLless date column \APLgreater,
\APLless explanation column \APLgreater,
\APLless posting reference column \APLgreater\ and
\APLless dual account column \APLgreater,
and three types of columns of numbers, namely
\APLless journal entry number column \APLgreater,
\APLless debit column \APLgreater\ and
\APLless credit column \APLgreater.

Two types of number, namely
\APLless amount of money \APLgreater
and
\APLless number of journal lines before closing \APLgreater,
and six types of text vectors, namely
\APLless company name \APLgreater,
\APLless date \APLgreater,
\APLless explanation \APLgreater,
\APLless account key \APLgreater,
\APLless account name \APLgreater,
\APLless account type \APLgreater,
complete the description. To make the grammar more readable,
we have introduced three more names for
\APLless account key \APLgreater,
namely
\APLless account key debit \APLgreater,
\APLless account key credit \APLgreater,
\APLless summary account key \APLgreater, and two more
names for
\APLless explanation \APLgreater,
namely
\APLless debit explanation \APLgreater,
\APLless credit explanation \APLgreater.

\section{The Grammar of the User Interface}

\subsection{Line Oriented Data Entry}

\begin{APLfns}
\begin{APLline}
\ace \APLleftarrow {\bf ENTER\_ACCOUNT} \ace
\end{APLline}
\begin{APLline}
\ace \APLleftarrow {\bf ENTER\_TRANSACTION} \ace
\end{APLline}
\begin{APLline}
\ace \APLleftarrow {\bf ENTER\_COMPOUND\_TRANSACTION} \ace
\end{APLline}
\end{APLfns}

\subsection{Founding a New Company, Opening and Closing the Books}

\begin{APLfns}
\begin{APLline}
\ace \APLleftarrow {\bf NEW\_ACCOUNTING\_ENTITY} \APLless company name \APLgreater
\end{APLline}
\begin{APLline}
\APLless new accounting entity \APLgreater \APLleftarrow \ace {\bf OPEN\_NEW\_BOOKS} \dat
\end{APLline}
\begin{APLline}
\APLless new accounting entity \APLgreater \APLleftarrow \ace {\bf OPEN\_OLD\_BOOKS} \dat
\end{APLline}
\begin{APLline}
\APLless new accounting entity \APLgreater \APLleftarrow \ace {\bf OPEN\_NEW\_TRIAL\_BALANCE} \dat
\end{APLline}
\begin{APLline}
\APLless new accounting entity \APLgreater \APLleftarrow \ace {\bf OPEN\_OLD\_TRIAL\_BALANCE} \dat
\end{APLline}
\begin{APLline}
\APLless new accounting entity \APLgreater \APLleftarrow \ace {\bf CLOSE\_THE\_BOOKS} \dat
\end{APLline}
\end{APLfns}

\subsection{Chart of Accounts}

\begin{APLfns}
\begin{APLline}
\APLless chart of accounts \APLgreater \APLleftarrow \ace {\bf PRINT\_CHART\_OF\_ACCOUNTS} \dat
\end{APLline}
\end{APLfns}

\subsection{Transactions}

\begin{APLfns}
\begin{APLline}
\ace \APLleftarrow \ace {\bf RECORD} \APLless transaction \APLgreater
\end{APLline}
\begin{APLline}
\APLless analysis of transactions \APLgreater \APLleftarrow \ace {\bf ANALYZE\_TRANSACTION} \jen
\end{APLline}
\end{APLfns}

\subsection{General Journal}

\begin{APLfns}
\begin{APLline}
\APLless balance of journal entry \APLgreater \APLleftarrow \ace {\bf BALANCE\_ENTRY} \jen
\end{APLline}
\begin{APLline}
\APLless journal entry \APLgreater \APLleftarrow \ace {\bf PRINT\_ENTRY} \jen
\end{APLline}
\end{APLfns}

\subsection{General Ledger \& Accounts}

\begin{APLfns}
\begin{APLline}
\ace \APLleftarrow \ace {\bf NEW\_ACCOUNT} \APLless account key\APLgreater
\APLless account name\APLgreater
\APLless account type\APLgreater
\end{APLline}
\begin{APLline}
\APLless balance of account \APLgreater \APLleftarrow \ace {\bf BALANCE\_ACCOUNT} \key
\end{APLline}
\begin{APLline}
\APLless account in column format \APLgreater \APLleftarrow \ace {\bf PRINT\_ACCOUNT} \dat \key
\end{APLline}
\begin{APLline}
\APLless (short) T-account \APLgreater \APLleftarrow \ace {\bf PRINT\_T\_ACCOUNT} \key
\end{APLline}
\begin{APLline}
\APLless (long) T-account \APLgreater \APLleftarrow \ace {\bf PRINT\_LT\_ACCOUNT} \dat \key
\end{APLline}
\end{APLfns}

\subsection{Financial Statements}

\begin{APLfns}
\begin{APLline}
\APLless balance sheet \APLgreater \APLleftarrow \ace {\bf PRINT\_BALANCE\_SHEET} \dat
\end{APLline}
\begin{APLline}
\APLless income statement \APLgreater \APLleftarrow \ace {\bf PRINT\_INCOME\_STATEMENT} \dat
\end{APLline}
\end{APLfns}

\subsection{Account Type System}

\begin{APLfns}
\begin{APLline}
\APLless diagnostic message \APLgreater \APLleftarrow {\bf CHECK\_ACCOUNT\_TYPE\_SYSTEM} \ace
\end{APLline}
\begin{APLline}
\APLless account type tree \APLgreater \APLleftarrow {\bf ACCOUNT\_TYPE\_TREE} \ace
\end{APLline}
\end{APLfns}

\section{The Direct Definitions}

% Direct Definitions in alphabetical order
% Financial Accounting
\begin{APLfns}
%
% \input{col3}
%
%
% col3.tex
%

% COLLECT
\begin{APLline}
{\bf\APLC\APLO\APLL\APLL\APLE\APLC\APLT}\APLcolon\APLleftparen
\APLalpha\APLalphaunderbar
\APLuparrow\APLomega\APLrightparen\APLalphaunderbar
\APLC\APLO\APLL\APLL\APLE\APLC\APLT\APLspace
\APLone\APLdownarrow\APLomega\APLcolon\APLzero\APLequal\APLrho
\APLomega\APLcolon\APLalpha
\end{APLline}


%
% col3.tex
%
\end{APLfns}

\begin{APLfns}
%
% \input{dd}
%
%
% dd.tex
%
%
% \input{c1}
%
%
% c1.tex
%
% C1 ACCESS_KEY
\begin{APLline}
{\bf
\APLA\APLC\APLC\APLE\APLS\APLS\protect\APLunderbar\APLK\APLE
\APLY
}
\APLcolon\APLalpha\APLiota\APLleftshoe\APLomega
\end{APLline}
%
% c1.tex
%
%
% \input{c2}
%
%
% c2.tex
%
% C2 ADD_KEY
\begin{APLline}
{\bf
\APLA\APLD\APLD\protect\APLunderbar\APLK\APLE\APLY
}
\APLcolon\APLalpha\APLcomma\APLleftshoe\APLomega
\end{APLline}
%
% c2.tex
%
%
% \input{c3}
%
%
% c3.tex
%
% C3 ACCOUNT_TYPE
\begin{APLline}
{\bf
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT
\APLY\APLP\APLE
}
\APLcolon\APLthree\APLrightshoe\APLleftparen\APLleftparen
\APLthree\APLrightshoe\APLalpha\APLrightparen\APLA\APLC\APLC\APLE
\APLS\APLS\protect\APLunderbar\APLK\APLE\APLY\APLomega
\APLrightparen\APLrightshoe\APLtwo\APLrightshoe\APLalpha
\end{APLline}
%
% c3.tex
%
%
% \input{c4}
%
%
% c4.tex
%
% C4 ACCOUNT_TYPE_TREE
\begin{APLline}
{\bf
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT
\APLY\APLP\APLE\protect\APLunderbar\APLT\APLR\APLE\APLE
}
\APLcolon\APLalpha\APLcomma\APLrightshoe\APLcomma\APLslash
\APLleftparen\APLleftparen\APLleftshoe\APLdieresis\APLleftshoe
\APLdieresis\APLJ\APLrightparen\APLcomma\APLdieresis\APLone
\APLplus\APLtwo\APLrightshoe\APLalpha\APLrightparen\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT\APLY\APLP\APLE
\protect\APLunderbar\APLT\APLR\APLE\APLE\APLdieresis\APLleftshoe
\APLomega\APLcolon\APLleftparen\APLzero\APLequal\APLrho\APLJ
\APLleftarrow\APLleftparen\APLleftparen\APLuparrow\APLalpha
\APLrightparen\APLS\APLU\APLB\protect\APLunderbar\APLT\APLY\APLP
\APLE\APLomega\APLrightparen\APLtilde\APLuparrow\APLalpha
\APLrightparen\APLdowncaret\APLleftparen\APLleftparen\APLone\APLplus
\APLuparrow\APLrho\APLomega\APLrightparen\APLless\APLtwo
\APLrightshoe\APLalpha\APLrightparen\APLcolon\APLcomma\APLalpha
\end{APLline}
%
% c4.tex
%
%
% \input{c5}
%
%
% c5.tex
%
% C5 ANALYZE_TRANSACTION
\begin{APLline}
{\bf
\APLA\APLN\APLA\APLL\APLY\APLZ\APLE\protect\APLunderbar\APLT
\APLR\APLA\APLN\APLS\APLA\APLC\APLT\APLI\APLO\APLN
}
\APLcolon\APLrightshoe\APLleftbracket\APLtwo\APLrightbracket
\APLleftparen\APLleftshoe\APLleftbracket\APLtwo
\APLrightbracket\APLuptackjot\APLM\APLcomma\APLleftbracket\APLone
\APLrightbracket\APLquote\APLspace\APLquote\APLrightparen\APLcomma
\APLleftshoe\APLleftbracket\APLtwo\APLrightbracket\APLuptackjot
\APLleftparen\APLleftparen\APLrho\APLB\APLrightparen\APLcomma\APLone
\APLrightparen\APLrho\APLB\APLleftarrow\APLleftparen
\APLleftshoe\APLalpha\APLrightparen\APLP\APLR\APLI\APLN\APLT\protect
\APLunderbar\APLT\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN
\APLT\APLdieresis\APLleftparen\APLM\APLleftarrow\APLalpha\APLP
\APLR\APLI\APLN\APLT\protect\APLunderbar\APLE\APLN\APLT\APLR
\APLY\APLomega\APLrightparen\APLleftbracket\APLsemicolon\APLfour
\APLrightbracket
\end{APLline}
%
% c5.tex
%
%
% \input{c6}
%
%
% c6.tex
%
% C6 ASK
\begin{APLline}
{\bf
\APLA\APLS\APLK
}
\APLcolon\APLquadquote\APLtilde\APLquad\APLP\APLR\APLcomma
\APLzero\APLrho\APLquadquote\APLleftarrow\APLomega\APLcomma
\APLzero\APLrho\APLquad\APLP\APLR\APLleftarrow\APLquad\APLT\APLC
\APLleftbracket\APLquad\APLI\APLO\APLplus\APLone\APLrightbracket
\end{APLline}
%
% c6.tex
%
%
% \input{c7}
%
%
% c7.tex
%
% C7 BALANCE_ACCOUNT
\begin{APLline}
{\bf
\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect\APLunderbar\APLA
\APLC\APLC\APLO\APLU\APLN\APLT
}
\APLcolon\APLbar\APLslash\APLplus\APLslashbar\APLzero
\APLspace\APLfour\APLdownarrow\APLuparrow\APLthree\APLdownarrow
\APLuparrow\APLleftparen\APLuparrow\APLone\APLdownarrow\APLalpha
\APLrightparen\APLleftbracket\APLleftparen\APLuparrow\APLtwo
\APLdownarrow\APLalpha\APLrightparen\APLA\APLC\APLC\APLE\APLS\APLS
\protect\APLunderbar\APLK\APLE\APLY\APLomega\APLrightbracket
\end{APLline}
%
% c7.tex
%
%
% \input{c8}
%
%
% c8.tex
%
% C8 BALANCE_ENTRY
\begin{APLline}
{\bf
\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect\APLunderbar\APLE
\APLN\APLT\APLR\APLY
}
\APLcolon\APLbar\APLslash\APLplus\APLslashbar\APLzero
\APLspace\protect\APLoverbar\APLone\APLdownarrow\APLzero\APLspace
\APLfour\APLdownarrow\APLleftparen\APLomega\APLequal\APLcomma
\APLzero\APLspace\protect\APLoverbar\APLsix\APLdownarrow\APLuparrow
\APLalpha\APLrightparen\APLslashbar\APLuparrow\APLalpha
\end{APLline}
%
% c8.tex
%
%
% \input{c9}
%
%
% c9.tex
%
% C9 BALANCE_SHEET
\begin{APLline}
{\bf
\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect\APLunderbar\APLS
\APLH\APLE\APLE\APLT
}
\APLcolon\APLquote\APLA\APLnine\APLseven\APLone\APLquote
\end{APLline}
%
% c9.tex
%
%
% \input{c10}
%
%
% c10.tex
%
% C10 BREADTH_FIRST
\begin{APLline}
{\bf
\APLB\APLR\APLE\APLA\APLD\APLT\APLH\protect\APLunderbar\APLF
\APLI\APLR\APLS\APLT
}
\APLcolon\APLleftparen\APLfour\APLrightshoe\APLomega
\APLrightparen\APLleftbracket\APLleftparen\APLone\APLrightshoe
\APLdieresis\APLfour\APLrightshoe\APLomega\APLrightparen\APLiota
\APLcirclestile\APLleftparen\APLleftshoe\APLomega\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT\APLY\APLP\APLE
\APLspace\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect\APLunderbar
\APLS\APLH\APLE\APLE\APLT\APLrightparen\APLS\APLU\APLB\protect
\APLunderbar\APLT\APLY\APLP\APLE\APLS\APLleftparen\APLtwo
\APLrightshoe\APLomega\APLrightparen\APLP\APLR\APLE\APLO\APLR\APLD\APLE
\APLR\APLleftparen\APLfour\APLrightshoe\APLomega\APLrightparen
\APLrightbracket
\end{APLline}
%
% c10.tex
%
%
% \input{c11}
%
%
% c11.tex
%
% C11 CHANGE_ROOT
\begin{APLline}
{\bf
\APLC\APLH\APLA\APLN\APLG\APLE\protect\APLunderbar\APLR\APLO
\APLO\APLT
}
\APLcolon\APLomega\APLleftbracket\APLsemicolon\APLiota
\APLthree\APLrightbracket\APLcomma\APLleftparen\APLleftparen
\APLleftshoe\APLalpha\APLrightparen\APLS\APLW\APLA\APLP\APLdieresis
\APLomega\APLleftbracket\APLsemicolon\APLfour\APLrightbracket
\APLrightparen\APLcomma\APLomega\APLleftbracket\APLsemicolon
\APLfive\APLspace\APLsix\APLrightbracket\APLcomma\APLleftparen
\APLleftshoe\APLalpha\APLrightparen\APLS\APLW\APLA\APLP\APLdieresis
\APLomega\APLleftbracket\APLsemicolon\APLseven\APLrightbracket
\end{APLline}
%
% c11.tex
%
%
% \input{c12}
%
%
% c12.tex
%
% C12 CHECK_BALANCE
\begin{APLline}
{\bf
\APLC\APLH\APLE\APLC\APLK\protect\APLunderbar\APLB\APLA\APLL
\APLA\APLN\APLC\APLE
}
\APLcolon\APLquote\APLD\APLi\APLf\APLf\APLe\APLr\APLe\APLn
\APLc\APLe\APLquote\APLleftparen\APLM\APLrightparen\APLquote
\APLi\APLn\APLspace\APLb\APLa\APLl\APLa\APLn\APLc\APLe\APLspace
\APLo\APLf\APLquote\APLleftparen\protect\APLoverbar\APLone
\APLuparrow\APLomega\APLrightparen\APLcolon\APLzero\APLequal\APLM
\APLleftarrow\APLomega\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLB
\APLA\APLL\APLA\APLN\APLC\APLE\protect\APLunderbar\APLS\APLH
\APLE\APLE\APLT\APLcolon\APLquote\APLN\APLo\APLspace\APLe\APLr
\APLr\APLo\APLr\APLspace\APLf\APLo\APLu\APLn\APLd\APLspace\APLi
\APLn\APLspace\APLb\APLa\APLl\APLa\APLn\APLc\APLe\APLspace\APLo
\APLf\APLquote\APLleftparen\protect\APLoverbar\APLone\APLuparrow
\APLomega\APLrightparen
\end{APLline}
%
% c12.tex
%
%
% \input{c13}
%
%
% c13.tex
%
% C13 CHECK_ACCOUNT_TYPE_SYSTEM
\begin{APLline}
{\bf
\APLC\APLH\APLE\APLC\APLK\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT\APLY\APLP\APLE
\protect\APLunderbar\APLS\APLY\APLS\APLT\APLE\APLM
}
\APLcolon\APLleftparen\APLepsilon\APLleftparen\APLupcaret
\APLslash\APLA\APLX\APLone\APLspace\APLA\APLX\APLtwo\APLspace
\APLA\APLX\APLthree\APLrightparen\APLleftparen\APLtilde\APLA\APLX
\APLone\APLleftarrow\APLzero\APLequal\APLrho\APLW\APLR\APLO
\APLN\APLG\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT
\protect\APLunderbar\APLT\APLY\APLP\APLE\APLomega\APLrightparen
\APLleftparen\APLleftparen\APLtilde\APLA\APLX\APLtwo
\APLleftarrow\APLleftparen\APLrho\APLfour\APLrightshoe\APLomega
\APLrightparen\APLequal\APLJ\APLrightparen\APLupcaret\APLleftparen\APLJ
\APLless\APLrho\APLfour\APLrightshoe\APLomega\APLrightparen
\APLrightparen\APLleftparen\APLtilde\APLA\APLX\APLthree
\APLleftarrow\APLleftparen\APLrho\APLfour\APLrightshoe\APLomega
\APLrightparen\APLnotless\APLJ\APLleftarrow\APLupstile\APLzero\APLdot
\APLfive\APLtimes\APLrho\APLleftparen\APLleftparen\APLleftshoe
\APLomega\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar
\APLT\APLY\APLP\APLE\APLspace\APLB\APLA\APLL\APLA\APLN\APLC
\APLE\protect\APLunderbar\APLS\APLH\APLE\APLE\APLT\APLrightparen
\APLzero\APLrightparen\APLA\APLC\APLC\APLO\APLU\APLN\APLT
\protect\APLunderbar\APLT\APLY\APLP\APLE\protect\APLunderbar\APLT
\APLR\APLE\APLE\APLleftparen\APLtwo\APLrightshoe\APLomega
\APLrightparen\APLP\APLR\APLE\APLO\APLR\APLD\APLE\APLR\APLleftparen
\APLfour\APLrightshoe\APLomega\APLrightparen\APLrightparen
\APLrightparen\APLslash\APLquote\APLO\APLk\APLquote\APLspace\APLquote
\APLW\APLr\APLo\APLn\APLg\APLspace\APLa\APLc\APLc\APLo\APLu
\APLn\APLt\APLspace\APLt\APLy\APLp\APLe\APLspace\APLi\APLn
\APLspace\APLl\APLe\APLd\APLg\APLe\APLr\APLquote\APLspace\APLquote
\APLC\APLl\APLo\APLs\APLi\APLn\APLg\APLspace\APLo\APLr\APLd\APLe
\APLr\APLspace\APLn\APLo\APLt\APLspace\APLc\APLo\APLm\APLp\APLl
\APLe\APLt\APLe\APLquote\APLspace\APLquote\APLC\APLy\APLc\APLl
\APLe\APLspace\APLi\APLn\APLspace\APLc\APLl\APLo\APLs\APLi
\APLn\APLg\APLspace\APLo\APLr\APLd\APLe\APLr\APLquote
\end{APLline}
%
% c13.tex
%
%
% \input{c14}
%
%
% c14.tex
%
% C14 CLOSE_ACCOUNT
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT
}
\APLcolon\APLleftparen\APLleftparen\APLalpha\APLcomma\APLone
\APLdownarrow\APLomega\APLrightparen\APLC\APLL\APLO\APLS\APLE
\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect
\APLunderbar\APLone\APLspace\APLM\APLrightparen\APLcomma
\APLsix\APLdownarrow\APLalpha\APLcolon\APLzero\APLepsilon\APLrho
\APLuparrow\APLthree\APLdownarrow\APLM\APLleftarrow\APLleftparen
\APLuparrow\APLomega\APLrightparen\APLrightshoe\APLtwo
\APLrightshoe\APLalpha\APLcolon\APLalpha
\end{APLline}
%
% c14.tex
%
%
% \input{c15}
%
%
% c15.tex
%
% C15 CLOSE_ACCOUNT_1
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLone
}
\APLcolon\APLleftparen\APLalpha\APLcomma\APLbar\APLslash
\APLplus\APLslashbar\APLzero\APLspace\APLfour\APLdownarrow
\APLuparrow\APLthree\APLdownarrow\APLomega\APLrightparen\APLC\APLL
\APLO\APLS\APLE\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN
\APLT\protect\APLunderbar\APLtwo\APLomega\APLcolon\APLtilde
\APLleftparen\APLuparrow\APLsix\APLdownarrow\APLalpha
\APLrightparen\APLequalunderbar\APLuparrow\APLtwo\APLdownarrow\APLomega
\APLcolon\APLsix\APLuparrow\APLalpha
\end{APLline}
%
% c15.tex
%
%
% \input{c16}
%
%
% c16.tex
%
% C16 CLOSE_ACCOUNT_2
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLtwo
}
\APLcolon\APLalpha\APLC\APLL\APLO\APLS\APLE\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar
\APLthree\APLomega\APLcolon\APLleftparen\protect\APLoverbar\APLone
\APLuparrow\APLalpha\APLrightparen\APLequal\APLzero\APLcolon
\APLsix\APLuparrow\APLalpha
\end{APLline}
%
% c16.tex
%
%
% \input{c17}
%
%
% c17.tex
%
% C17 CLOSE_ACCOUNT_3
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLthree
}
\APLcolon\APLleftparen\APLsix\APLuparrow\APLalpha
\APLrightparen\APLR\APLE\APLC\APLO\APLR\APLD\APLalpha\APLleftbracket
\APLone\APLone\APLspace\APLnine\APLrightbracket\APLcomma\APLomega
\APLleftbracket\APLone\APLrightbracket\APLcomma\APLalpha
\APLleftbracket\APLeight\APLrightbracket\APLcomma\APLstile\APLalpha
\APLleftbracket\APLone\APLtwo\APLrightbracket\APLcolon
\APLleftparen\protect\APLoverbar\APLone\APLuparrow\APLalpha\APLrightparen
\APLnotless\APLzero\APLcolon\APLleftparen\APLsix\APLuparrow
\APLalpha\APLrightparen\APLR\APLE\APLC\APLO\APLR\APLD\APLalpha
\APLleftbracket\APLone\APLone\APLspace\APLone\APLzero\APLspace
\APLeight\APLrightbracket\APLcomma\APLomega\APLleftbracket\APLone
\APLrightbracket\APLcomma\APLstile\APLalpha\APLleftbracket
\APLone\APLtwo\APLrightbracket
\end{APLline}
%
% c17.tex
%
%
% \input{c18}
%
%
% c18.tex
%
% C18 CLOSE_THE_BOOKS
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLT\APLH\APLE
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
}
\APLcolon\APLleftparen\APLuparrow\APLrho\APLone\APLrightshoe
\APLalpha\APLrightparen\APLC\APLL\APLO\APLS\APLE\protect
\APLunderbar\APLT\APLH\APLE\protect\APLunderbar\APLB\APLO\APLO\APLK
\APLS\protect\APLunderbar\APLtwo\APLleftparen\APLalpha\APLC
\APLL\APLO\APLS\APLE\protect\APLunderbar\APLT\APLH\APLE\protect
\APLunderbar\APLB\APLO\APLO\APLK\APLS\protect\APLunderbar\APLone
\APLomega\APLrightparen
\end{APLline}
%
% c18.tex
%
%
% \input{c19}
%
%
% c19.tex
%
% C19 CLOSE_THE_BOOKS_1
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLT\APLH\APLE
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS\protect
\APLunderbar\APLone
}
\APLcolon\APLalpha\APLC\APLL\APLO\APLS\APLE\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLC\APLO\APLL
\APLL\APLE\APLC\APLT\APLleftparen\APLM\APLA\APLK\APLE\protect
\APLunderbar\APLC\APLL\APLO\APLS\APLI\APLN\APLG\protect
\APLunderbar\APLO\APLR\APLD\APLE\APLR\APLalpha\APLrightparen\APLcomma
\APLdieresis\APLleftshoe\APLleftshoe\APLomega
\end{APLline}
%
% c19.tex
%
%
% \input{c20}
%
%
% c20.tex
%
% C20 CLOSE_THE_BOOKS_2
\begin{APLline}
{\bf
\APLC\APLL\APLO\APLS\APLE\protect\APLunderbar\APLT\APLH\APLE
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS\protect
\APLunderbar\APLtwo
}
\APLcolon\APLomega\APLleftbracket\APLiota\APLfour
\APLrightbracket\APLcomma\APLleftparen\APLleftshoe\APLalpha\APLrightparen
\APLcomma\APLomega\APLleftbracket\APLsix\APLrightbracket
\end{APLline}
%
% c20.tex
%
%
% \input{c21}
%
%
% c21.tex
%
% C21 END_OF_PERIOD
\begin{APLline}
{\bf
\APLE\APLN\APLD\protect\APLunderbar\APLO\APLF\protect
\APLunderbar\APLP\APLE\APLR\APLI\APLO\APLD
}
\APLcolon\APLomega\APLP\APLO\APLS\APLT\protect\APLunderbar
\APLA\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA\APLL
\APLspace\APLone\APLcomma\APLquote\APLspace\APLquote\APLcomma
\APLquote\APLspace\APLquote\APLcomma\APLleftparen\APLthree
\APLrightshoe\APLomega\APLrightparen\APLcomma\APLzero\APLcomma\APLzero
\APLcomma\APLleftbracket\APLone\APLdot\APLfive\APLrightbracket
\APLthree\APLrightshoe\APLomega
\end{APLline}
%
% c21.tex
%
%
% \input{c22}
%
%
% c22.tex
%
% C22 ENTER_ACCOUNT
\begin{APLline}
{\bf
\APLE\APLN\APLT\APLE\APLR\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT
}
\APLcolon\APLomega\APLN\APLE\APLW\protect\APLunderbar\APLA
\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLA\APLS\APLK
\APLdieresis\APLleftparen\APLleftparen\APLepsilon\protect\APLoverbar
\APLone\APLuparrow\APLomega\APLrightparen\APLcomma\APLquad\APLT
\APLC\APLleftbracket\APLtwo\APLrightbracket\APLcomma\APLquote
\APLA\APLc\APLc\APLo\APLu\APLn\APLt\APLspace\APLk\APLe\APLy
\APLspace\APLquote\APLrightparen\APLquote\APLA\APLc\APLc\APLo\APLu
\APLn\APLt\APLspace\APLn\APLa\APLm\APLe\APLspace\APLquote
\APLspace\APLquote\APLA\APLc\APLc\APLo\APLu\APLn\APLt\APLspace\APLt
\APLy\APLp\APLe\APLspace\APLquote
\end{APLline}
%
% c22.tex
%
%
% \input{c23}
%
%
% c23.tex
%
% C23 ENTER_COMPOUND_TRANSACTION
\begin{APLline}
{\bf
\APLE\APLN\APLT\APLE\APLR\protect\APLunderbar\APLC\APLO\APLM
\APLP\APLO\APLU\APLN\APLD\protect\APLunderbar\APLT\APLR\APLA
\APLN\APLS\APLA\APLC\APLT\APLI\APLO\APLN
}
\APLcolon\APLomega\APLR\APLE\APLC\APLO\APLR\APLD\APLspace
\APLM\APLleftarrow\APLleftparen\APLM\APLcomma\APLE\APLN\APLT\APLE
\APLR\protect\APLunderbar\APLL\APLI\APLS\APLT\APLS\APLspace
\APLtwo\APLrho\APLleftshoe\APLzero\APLrho\APLzero\APLrightparen
\APLcomma\APLzero\APLrho\APLM\APLleftarrow\APLA\APLS\APLK
\APLdieresis\APLleftparen\APLleftparen\APLepsilon\protect\APLoverbar
\APLone\APLuparrow\APLomega\APLrightparen\APLcomma\APLquad\APLT
\APLC\APLleftbracket\APLtwo\APLrightbracket\APLcomma\APLquote
\APLD\APLa\APLt\APLe\APLspace\APLquote\APLrightparen\APLquote
\APLE\APLx\APLp\APLl\APLa\APLn\APLa\APLt\APLi\APLo\APLn\APLspace
\APLquote
\end{APLline}
%
% c23.tex
%
%
% \input{c24}
%
%
% c24.tex
%
% C24 ENTER_LISTS
\begin{APLline}
{\bf
\APLE\APLN\APLT\APLE\APLR\protect\APLunderbar\APLL\APLI\APLS
\APLT\APLS
}
\APLcolon\APLE\APLN\APLT\APLE\APLR\protect\APLunderbar\APLL
\APLI\APLS\APLT\APLS\APLspace\APLM\APLcolon\APLomega
\APLequalunderbar\APLM\APLleftarrow\APLE\APLN\APLT\APLE\APLR\protect
\APLunderbar\APLL\APLI\APLS\APLT\APLS\protect\APLunderbar\APLone
\APLomega\APLcolon\APLM
\end{APLline}
%
% c24.tex
%
%
% \input{c25}
%
%
% c25.tex
%
% C25 ENTER_LISTS_1
\begin{APLline}
{\bf
\APLE\APLN\APLT\APLE\APLR\protect\APLunderbar\APLL\APLI\APLS
\APLT\APLS\protect\APLunderbar\APLone
}
\APLcolon\APLM\APLspace\APLE\APLN\APLT\APLE\APLR\protect
\APLunderbar\APLL\APLI\APLS\APLT\APLS\protect\APLunderbar\APLtwo
\APLomega\APLcolon\APLquote\APLzero\APLquote\APLequal\APLuparrow
\APLleftparen\APLM\APLleftarrow\APLA\APLS\APLK\APLspace
\APLquote\APLD\APLe\APLb\APLi\APLt\APLequal\APLquote\APLquote\APLplus
\APLquote\APLquote\APLslash\APLspace\APLC\APLr\APLe\APLd\APLi
\APLt\APLspace\APLequal\APLquote\APLquote\APLbar\APLquote
\APLquote\APLslash\APLspace\APLQ\APLu\APLi\APLt\APLspace\APLequal
\APLquote\APLquote\APLzero\APLquote\APLquote\APLspace\APLquote
\APLrightparen\APLtilde\APLquote\APLspace\APLquote\APLcolon
\APLomega
\end{APLline}
%
% c25.tex
%
%
% \input{c26}
%
%
% c26.tex
%
% C26 ENTER_LISTS_2
\begin{APLline}
{\bf
\APLE\APLN\APLT\APLE\APLR\protect\APLunderbar\APLL\APLI\APLS
\APLT\APLS\protect\APLunderbar\APLtwo
}
\APLcolon\APLleftparen\APLone\APLuparrow\APLomega
\APLrightparen\APLcomma\APLleftshoe\APLleftparen\APLuparrow\APLone
\APLdownarrow\APLomega\APLrightparen\APLcomma\APLleftshoe
\APLleftparen\APLleftparen\APLuparrow\APLM\APLrightparen\APLtilde\APLquote
\APLspace\APLquote\APLrightparen\APLleftparen\APLdowntackjot
\APLepsilon\APLone\APLdownarrow\APLM\APLleftarrow\APLA\APLS\APLK
\APLdieresis\APLquote\APLA\APLc\APLc\APLo\APLu\APLn\APLt
\APLspace\APLk\APLe\APLy\APLspace\APLc\APLr\APLe\APLd\APLi\APLt
\APLspace\APLquote\APLspace\APLquote\APLA\APLm\APLo\APLu\APLn\APLt
\APLspace\APLo\APLf\APLspace\APLm\APLo\APLn\APLe\APLy\APLspace
\APLquote\APLrightparen\APLcolon\APLquote\APLplus\APLquote
\APLequal\APLalpha\APLcolon\APLleftparen\APLleftshoe\APLleftparen
\APLuparrow\APLomega\APLrightparen\APLcomma\APLleftshoe
\APLleftparen\APLleftparen\APLuparrow\APLM\APLrightparen\APLtilde
\APLquote\APLspace\APLquote\APLrightparen\APLleftparen
\APLdowntackjot\APLepsilon\APLone\APLdownarrow\APLM\APLleftarrow\APLA\APLS
\APLK\APLdieresis\APLquote\APLA\APLc\APLc\APLo\APLu\APLn\APLt
\APLspace\APLk\APLe\APLy\APLspace\APLd\APLe\APLb\APLi\APLt
\APLspace\APLquote\APLspace\APLquote\APLA\APLm\APLo\APLu\APLn\APLt
\APLspace\APLo\APLf\APLspace\APLm\APLo\APLn\APLe\APLy\APLspace
\APLquote\APLrightparen\APLrightparen\APLcomma\APLleftparen
\APLone\APLdownarrow\APLomega\APLrightparen
\end{APLline}
%
% c26.tex
%
%
% \input{c27}
%
%
% c27.tex
%
% C27 ENTER_TRANSACTION
\begin{APLline}
{\bf
\APLE\APLN\APLT\APLE\APLR\protect\APLunderbar\APLT\APLR\APLA
\APLN\APLS\APLA\APLC\APLT\APLI\APLO\APLN
}
\APLcolon\APLomega\APLR\APLE\APLC\APLO\APLR\APLD\APLspace
\APLN\APLU\APLM\APLE\APLR\APLI\APLC\APLspace\APLA\APLS\APLK
\APLdieresis\APLleftparen\APLleftparen\APLepsilon\protect\APLoverbar
\APLone\APLuparrow\APLomega\APLrightparen\APLcomma\APLquad
\APLT\APLC\APLleftbracket\APLtwo\APLrightbracket\APLcomma\APLquote
\APLD\APLa\APLt\APLe\APLspace\APLquote\APLrightparen\APLquote
\APLE\APLx\APLp\APLl\APLa\APLn\APLa\APLt\APLi\APLo\APLn
\APLspace\APLquote\APLspace\APLquote\APLA\APLc\APLc\APLo\APLu\APLn
\APLt\APLspace\APLk\APLe\APLy\APLspace\APLd\APLe\APLb\APLi\APLt
\APLspace\APLquote\APLspace\APLquote\APLA\APLc\APLc\APLo\APLu
\APLn\APLt\APLspace\APLk\APLe\APLy\APLspace\APLc\APLr\APLe\APLd
\APLi\APLt\APLspace\APLquote\APLspace\APLquote\APLA\APLm\APLo
\APLu\APLn\APLt\APLspace\APLo\APLf\APLspace\APLm\APLo\APLn\APLe
\APLy\APLspace\APLquote
\end{APLline}
%
% c27.tex
%
%
% \input{c28}
%
%
% c28.tex
%
% C28 EXPLAIN
\begin{APLline}
{\bf
\APLE\APLX\APLP\APLL\APLA\APLI\APLN
}
\APLcolon\APLE\APLX\APLP\APLL\APLA\APLI\APLN\protect
\APLunderbar\APLone\APLomega\APLcolon\APLleftparen\APLleftparen
\APLquote\APLleftparen\APLo\APLb\APLrightparen\APLquote
\APLequalunderbar\APLuparrow\APLomega\APLrightparen\APLdowncaret\APLquote
\APLleftparen\APLc\APLb\APLrightparen\APLquote\APLequalunderbar
\APLuparrow\APLomega\APLrightparen\APLupcaret\APLleftparen
\APLalpha\APLepsilon\APLB\APLO\APLO\APLK\APLS\APLrightparen\APLcolon
\APLleftshoe\APLleftparen\APLuparrow\APLomega\APLrightparen
\APLcomma\APLquote\APLspace\APLquote\APLcomma\APLtwo\APLrightshoe
\APLleftparen\APLleftparen\APLfour\APLrightshoe\APLomega
\APLrightparen\APLA\APLC\APLC\APLE\APLS\APLS\protect\APLunderbar
\APLK\APLE\APLY\APLleftparen\APLtwo\APLrightshoe\APLomega
\APLrightparen\APLrightparen\APLrightshoe\APLthree\APLrightshoe\APLomega
\end{APLline}
%
% c28.tex
%
%
% \input{c29}
%
%
% c29.tex
%
% C29 EXPLAIN_1
\begin{APLline}
{\bf
\APLE\APLX\APLP\APLL\APLA\APLI\APLN\protect\APLunderbar
\APLone
}
\APLcolon\APLomega\APLleftbracket\APLone\APLrightbracket
\APLcolon\APLleftparen\APLleftparen\APLquote\APLleftparen\APLo
\APLb\APLrightparen\APLquote\APLequalunderbar\APLuparrow\APLomega
\APLrightparen\APLdowncaret\APLquote\APLleftparen\APLc\APLb
\APLrightparen\APLquote\APLequalunderbar\APLuparrow\APLomega
\APLrightparen\APLupcaret\APLleftparen\APLomega\APLleftbracket
\APLtwo\APLrightbracket\APLepsilon\APLB\APLO\APLO\APLK\APLS
\APLrightparen\APLcolon\APLleftshoe\APLleftparen\APLuparrow\APLomega
\APLrightparen\APLcomma\APLquote\APLspace\APLquote\APLcomma
\APLtwo\APLrightshoe\APLleftparen\APLleftparen\APLfour\APLrightshoe
\APLomega\APLrightparen\APLA\APLC\APLC\APLE\APLS\APLS\protect
\APLunderbar\APLK\APLE\APLY\APLleftparen\APLtwo\APLrightshoe
\APLomega\APLrightparen\APLrightparen\APLrightshoe\APLthree
\APLrightshoe\APLomega
\end{APLline}
%
% c29.tex
%
%
% \input{c30}
%
%
% c30.tex
%
% C30 INCOME_STATEMENT
\begin{APLline}
{\bf
\APLI\APLN\APLC\APLO\APLM\APLE\protect\APLunderbar\APLS\APLT
\APLA\APLT\APLE\APLM\APLE\APLN\APLT
}
\APLcolon\APLquote\APLA\APLnine\APLseven\APLtwo\APLquote
\end{APLline}
%
% c30.tex
%
%
% \input{c31}
%
%
% c31.tex
%
% C31 JOURNALIZE_COMPOUND_ENTRY
\begin{APLline}
{\bf
\APLJ\APLO\APLU\APLR\APLN\APLA\APLL\APLI\APLZ\APLE\protect
\APLunderbar\APLC\APLO\APLM\APLP\APLO\APLU\APLN\APLD\protect
\APLunderbar\APLE\APLN\APLT\APLR\APLY
}
\APLcolon\APLleftparen\APLleftshoe\APLleftbracket\APLtwo
\APLrightbracket\APLM\APLrightparen\APLleftparen\APLalpha\APLcomma
\APLleftbracket\APLone\APLrightbracket\APLM\APLleftarrow
\APLleftparen\APLone\APLplus\APLuparrow\protect\APLoverbar\APLone
\APLspace\APLone\APLuparrow\APLalpha\APLrightparen\APLcomma
\APLleftbracket\APLtwo\APLrightbracket\APLomega\APLleftbracket
\APLone\APLrightbracket\APLcomma\APLleftbracket\APLtwo
\APLrightbracket\APLomega\APLleftbracket\APLtwo\APLrightbracket\APLcomma
\APLleftbracket\APLtwo\APLrightbracket\APLleftparen\APLleftparen
\protect\APLoverbar\APLone\APLcirclestile\APLone\APLspace
\APLzero\APLspace\APLone\APLslope\APLone\APLcirclestile\APLrightshoe
\APLleftbracket\APLtwo\APLrightbracket\APLthree\APLrightshoe
\APLomega\APLrightparen\APLcomma\APLleftbracket\APLone
\APLrightbracket\protect\APLoverbar\APLone\APLcirclestile\APLzero
\APLspace\APLone\APLspace\APLone\APLslope\APLone\APLcirclestile
\APLrightshoe\APLleftbracket\APLtwo\APLrightbracket\APLfour
\APLrightshoe\APLomega\APLrightparen\APLcomma\APLleftshoe\APLquote\APLD
\APLi\APLv\APLdot\APLquote\APLrightparen
\end{APLline}
%
% c31.tex
%
%
% \input{c32}
%
%
% c32.tex
%
% C32 JOURNALIZE_SIMPLE_ENTRY
\begin{APLline}
{\bf
\APLJ\APLO\APLU\APLR\APLN\APLA\APLL\APLI\APLZ\APLE\protect
\APLunderbar\APLS\APLI\APLM\APLP\APLL\APLE\protect\APLunderbar
\APLE\APLN\APLT\APLR\APLY
}
\APLcolon\APLleftparen\APLleftshoe\APLleftbracket\APLtwo
\APLrightbracket\APLM\APLrightparen\APLleftparen\APLalpha\APLcomma
\APLleftbracket\APLone\APLrightbracket\APLM\APLleftarrow
\APLleftparen\APLone\APLspace\APLone\APLspace\APLone\APLspace\APLone
\APLspace\APLone\APLspace\APLzero\APLspace\APLone\APLslope
\APLleftparen\APLone\APLplus\APLuparrow\protect\APLoverbar\APLone
\APLspace\APLone\APLuparrow\APLalpha\APLrightparen\APLcomma
\APLleftparen\APLone\APLspace\APLone\APLspace\APLone\APLspace
\APLzero\APLspace\APLone\APLslash\APLomega\APLrightparen\APLcomma
\APLomega\APLleftbracket\APLfour\APLrightbracket\APLrightparen
\APLcomma\APLleftbracket\APLzero\APLdot\APLfive\APLrightbracket
\APLone\APLspace\APLone\APLspace\APLone\APLspace\APLone
\APLspace\APLzero\APLspace\APLone\APLspace\APLone\APLslope
\APLleftparen\APLone\APLplus\APLuparrow\protect\APLoverbar\APLone\APLspace
\APLone\APLuparrow\APLalpha\APLrightparen\APLcomma
\APLleftparen\APLone\APLspace\APLone\APLspace\APLzero\APLspace\APLone
\APLspace\APLone\APLslash\APLomega\APLrightparen\APLcomma\APLomega
\APLleftbracket\APLthree\APLrightbracket\APLrightparen
\end{APLline}
%
% c32.tex
%
%
% \input{c33}
%
%
% c33.tex
%
% C33 MAKE_CLOSING_ORDER
\begin{APLline}
{\bf
\APLM\APLA\APLK\APLE\protect\APLunderbar\APLC\APLL\APLO\APLS
\APLI\APLN\APLG\protect\APLunderbar\APLO\APLR\APLD\APLE\APLR
}
\APLcolon\APLS\APLcomma\APLdieresis\APLJ\APLleftbracket\APLV
\APLleftbracket\APLS\APLleftarrow\APLdeltastile\APLV
\APLleftarrow\APLleftparen\APLone\APLrightshoe\APLdieresis\APLJ
\APLleftarrow\APLB\APLR\APLE\APLA\APLD\APLT\APLH\protect\APLunderbar
\APLF\APLI\APLR\APLS\APLT\APLomega\APLrightparen\APLiota
\APLleftparen\APLthree\APLrightshoe\APLdieresis\APLtwo\APLrightshoe
\APLomega\APLrightparen\APLrightbracket\APLrightbracket
\end{APLline}
%
% c33.tex
%
%
% \input{c34}
%
%
% c34.tex
%
% C34 NEW_ACCOUNT
\begin{APLline}
{\bf
\APLN\APLE\APLW\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU
\APLN\APLT
}
\APLcolon\APLleftparen\APLone\APLuparrow\APLalpha
\APLrightparen\APLcomma\APLleftparen\APLleftparen\APLtwo\APLrightshoe
\APLalpha\APLrightparen\APLcomma\APLleftshoe\APLomega\APLcomma
\APLleftshoe\APLzero\APLspace\APLsix\APLrho\APLzero\APLrightparen
\APLleftparen\APLleftparen\APLthree\APLrightshoe\APLalpha
\APLrightparen\APLA\APLD\APLD\protect\APLunderbar\APLK\APLE\APLY
\APLuparrow\APLomega\APLrightparen\APLcomma\APLthree\APLdownarrow
\APLalpha
\end{APLline}
%
% c34.tex
%
%
% \input{c35}
%
%
% c35.tex
%
% C35 NEW_ACCOUNT_KEYS
\begin{APLline}
{\bf
\APLN\APLE\APLW\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU
\APLN\APLT\protect\APLunderbar\APLK\APLE\APLY\APLS
}
\APLcolon\APLzero\APLrho\APLzero
\end{APLline}
%
% c35.tex
%
%
% \input{c36}
%
%
% c36.tex
%
% C36 NEW_ACCOUNTING_ENTITY
\begin{APLline}
{\bf
\APLN\APLE\APLW\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU
\APLN\APLT\APLI\APLN\APLG\protect\APLunderbar\APLE\APLN\APLT
\APLI\APLT\APLY
}
\APLcolon\APLN\APLE\APLW\protect\APLunderbar\APLC\APLH\APLA
\APLR\APLT\protect\APLunderbar\APLO\APLF\protect\APLunderbar
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLS\APLspace\APLN\APLE\APLW
\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA\APLL
\APLspace\APLN\APLE\APLW\protect\APLunderbar\APLL\APLE\APLD\APLG\APLE
\APLR\APLspace\APLN\APLE\APLW\protect\APLunderbar\APLA\APLC
\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar\APLK\APLE\APLY\APLS
\APLleftparen\APLN\APLE\APLW\protect\APLunderbar\APLB\APLO\APLO
\APLK\APLS\APLspace\APLN\APLE\APLW\protect\APLunderbar\APLC
\APLL\APLO\APLS\APLI\APLN\APLG\protect\APLunderbar\APLO\APLR\APLD
\APLE\APLR\APLrightparen\APLleftparen\APLuparrow\APLrho\APLN
\APLE\APLW\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA
\APLL\APLrightparen\APLomega
\end{APLline}
%
% c36.tex
%
%
% \input{c37}
%
%
% c37.tex
%
% C37 NEW_BOOKS
\begin{APLline}
{\bf
\APLN\APLE\APLW\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
}
\APLcolon\APLomega\APLcomma\APLzero\APLrho\APLquad\APLF\APLX
\APLspace\APLquote\APLZ\APLleftarrow\APLB\APLO\APLO\APLK\APLS
\APLquote\APLleftparen\APLtwo\APLspace\APLquad\APLT\APLF
\APLspace\APLquote\APLZ\APLquote\APLcomma\APLzero\APLrho\APLZ
\APLleftarrow\APLleftparen\APLleftshoe\APLO\APLP\APLE\APLN\APLI\APLN
\APLG\protect\APLunderbar\APLB\APLA\APLL\APLA\APLN\APLC\APLE
\protect\APLunderbar\APLS\APLH\APLE\APLE\APLT\APLrightparen
\APLcomma\APLU\APLN\APLI\APLQ\APLU\APLE\APLspace\APLtwo\APLrightshoe
\APLdieresis\APLomega\APLrightparen
\end{APLline}
%
% c37.tex
%
%
% \input{c38}
%
%
% c38.tex
%
% C38 NEW_JOURNAL
\begin{APLline}
{\bf
\APLN\APLE\APLW\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN
\APLA\APLL
}
\APLcolon\APLzero\APLspace\APLseven\APLrho\APLzero
\end{APLline}
%
% c38.tex
%
%
% \input{c39}
%
%
% c39.tex
%
% C39 NEW_LEDGER
\begin{APLline}
{\bf
\APLN\APLE\APLW\protect\APLunderbar\APLL\APLE\APLD\APLG\APLE
\APLR
}
\APLcolon\APLzero\APLrho\APLzero
\end{APLline}
%
% c39.tex
%
%
% \input{c40}
%
%
% c40.tex
%
% C40 NUMERIC
\begin{APLline}
{\bf
\APLN\APLU\APLM\APLE\APLR\APLI\APLC
}
\APLcolon\APLleftparen\APLtwo\APLuparrow\APLomega
\APLrightparen\APLcomma\APLleftparen\APLleftparen\APLtwo\APLdownarrow
\APLfour\APLuparrow\APLomega\APLrightparen\APLtilde\APLdieresis
\APLquote\APLspace\APLquote\APLrightparen\APLcomma\APLleftparen
\APLdowntackjot\APLuparrow\APLfour\APLdownarrow\APLomega
\APLrightparen
\end{APLline}
%
% c40.tex
%
%
% \input{c41}
%
%
% c41.tex
%
% C41 OPEN_ERROR
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLE\APLR\APLR\APLO
\APLR
}
\APLcolon\APLomega\APLcomma\APLzero\APLrho\APLquadquote
\APLleftarrow\APLquote\APLE\APLr\APLr\APLo\APLr\APLdot\APLspace
\APLB\APLo\APLo\APLk\APLs\APLspace\APLa\APLr\APLe\APLspace\APLa
\APLl\APLr\APLe\APLa\APLd\APLy\APLspace\APLo\APLp\APLe\APLn
\APLdot\APLquote
\end{APLline}
%
% c41.tex
%
%
% \input{c42}
%
%
% c42.tex
%
% C42 OPEN_NEW_BOOKS
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLN\APLE\APLW
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
}
\APLcolon\APLleftparen\APLN\APLE\APLW\protect\APLunderbar
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLI\APLN\APLG\protect
\APLunderbar\APLE\APLN\APLT\APLI\APLT\APLY\APLuparrow\protect
\APLoverbar\APLone\APLuparrow\APLalpha\APLrightparen\APLP\APLO\APLS
\APLT\protect\APLunderbar\APLA\protect\APLunderbar\APLJ\APLO\APLU
\APLR\APLN\APLA\APLL\APLleftparen\APLleftparen\APLleftshoe
\APLI\APLN\APLC\APLO\APLM\APLE\protect\APLunderbar\APLS\APLT\APLA
\APLT\APLE\APLM\APLE\APLN\APLT\APLrightparen\APLcomma\APLalpha
\APLleftbracket\APLtwo\APLspace\APLfour\APLrightbracket
\APLrightparen\APLS\APLP\APLL\APLI\APLT\protect\APLunderbar\APLJ\APLO
\APLU\APLR\APLN\APLA\APLL\APLalpha\APLR\APLE\APLV\APLE\APLR
\APLS\APLE\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA\APLL
\APLomega\APLcolon\APLleftparen\APLfive\APLrightshoe\APLalpha
\APLrightparen\APLequal\APLzero\APLcolon\APLO\APLP\APLE\APLN
\protect\APLunderbar\APLE\APLR\APLR\APLO\APLR\APLalpha
\end{APLline}
%
% c42.tex
%
%
% \input{c43}
%
%
% c43.tex
%
% C43 OPEN_NEW_TRIAL_BALANCE
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLN\APLE\APLW
\protect\APLunderbar\APLT\APLR\APLI\APLA\APLL\protect\APLunderbar
\APLB\APLA\APLL\APLA\APLN\APLC\APLE
}
\APLcolon\APLleftparen\APLN\APLE\APLW\protect\APLunderbar
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLI\APLN\APLG\protect
\APLunderbar\APLE\APLN\APLT\APLI\APLT\APLY\APLuparrow\protect
\APLoverbar\APLone\APLuparrow\APLalpha\APLrightparen\APLP\APLO\APLS
\APLT\protect\APLunderbar\APLA\protect\APLunderbar\APLJ\APLO\APLU
\APLR\APLN\APLA\APLL\APLleftparen\APLI\APLN\APLC\APLO\APLM
\APLE\protect\APLunderbar\APLS\APLT\APLA\APLT\APLE\APLM\APLE\APLN
\APLT\APLspace\APLO\APLP\APLE\APLN\APLI\APLN\APLG\protect
\APLunderbar\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect\APLunderbar
\APLS\APLH\APLE\APLE\APLT\APLrightparen\APLC\APLH\APLA\APLN
\APLG\APLE\protect\APLunderbar\APLR\APLO\APLO\APLT\APLleftparen
\APLalpha\APLR\APLE\APLV\APLE\APLR\APLS\APLE\protect\APLunderbar
\APLJ\APLO\APLU\APLR\APLN\APLA\APLL\APLomega\APLrightparen
\APLcolon\APLleftparen\APLfive\APLrightshoe\APLalpha\APLrightparen
\APLequal\APLzero\APLcolon\APLO\APLP\APLE\APLN\protect
\APLunderbar\APLE\APLR\APLR\APLO\APLR\APLalpha
\end{APLline}
%
% c43.tex
%
%
% \input{c44}
%
%
% c44.tex
%
% C44 OPEN_OLD_BOOKS
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLO\APLL\APLD
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
}
\APLcolon\APLleftparen\APLE\APLN\APLD\protect\APLunderbar
\APLO\APLF\protect\APLunderbar\APLP\APLE\APLR\APLI\APLO\APLD
\APLleftparen\APLalpha\APLleftbracket\APLiota\APLfour
\APLrightbracket\APLcomma\APLleftparen\APLleftshoe\APLuparrow\APLrho\APLN
\APLE\APLW\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA\APLL
\APLrightparen\APLcomma\APLalpha\APLleftbracket\APLsix
\APLrightbracket\APLrightparen\APLrightparen\APLP\APLO\APLS\APLT
\protect\APLunderbar\APLA\protect\APLunderbar\APLJ\APLO\APLU\APLR
\APLN\APLA\APLL\APLleftparen\APLleftparen\APLleftshoe\APLI\APLN
\APLC\APLO\APLM\APLE\protect\APLunderbar\APLS\APLT\APLA\APLT
\APLE\APLM\APLE\APLN\APLT\APLrightparen\APLcomma\APLalpha
\APLleftbracket\APLtwo\APLspace\APLfour\APLrightbracket\APLrightparen
\APLS\APLP\APLL\APLI\APLT\protect\APLunderbar\APLJ\APLO\APLU
\APLR\APLN\APLA\APLL\APLalpha\APLR\APLE\APLV\APLE\APLR\APLS\APLE
\protect\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA\APLL\APLomega
\APLcolon\APLleftparen\APLfive\APLrightshoe\APLalpha
\APLrightparen\APLequal\APLzero\APLcolon\APLO\APLP\APLE\APLN\protect
\APLunderbar\APLE\APLR\APLR\APLO\APLR\APLalpha
\end{APLline}
%
% c44.tex
%
%
% \input{c45}
%
%
% c45.tex
%
% C45 OPEN_OLD_TRIAL_BALANCE
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLO\APLL\APLD
\protect\APLunderbar\APLT\APLR\APLI\APLA\APLL\protect\APLunderbar
\APLB\APLA\APLL\APLA\APLN\APLC\APLE
}
\APLcolon\APLleftparen\APLalpha\APLleftbracket\APLiota
\APLfour\APLrightbracket\APLcomma\APLleftparen\APLleftshoe
\APLuparrow\APLrho\APLN\APLE\APLW\protect\APLunderbar\APLJ\APLO\APLU
\APLR\APLN\APLA\APLL\APLrightparen\APLcomma\APLalpha
\APLleftbracket\APLsix\APLrightbracket\APLrightparen\APLP\APLO\APLS\APLT
\protect\APLunderbar\APLA\protect\APLunderbar\APLJ\APLO\APLU\APLR
\APLN\APLA\APLL\APLleftparen\APLI\APLN\APLC\APLO\APLM\APLE
\protect\APLunderbar\APLS\APLT\APLA\APLT\APLE\APLM\APLE\APLN\APLT
\APLspace\APLO\APLP\APLE\APLN\APLI\APLN\APLG\protect\APLunderbar
\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect\APLunderbar\APLS
\APLH\APLE\APLE\APLT\APLrightparen\APLC\APLH\APLA\APLN\APLG\APLE
\protect\APLunderbar\APLR\APLO\APLO\APLT\APLleftparen\APLalpha
\APLR\APLE\APLV\APLE\APLR\APLS\APLE\protect\APLunderbar\APLJ
\APLO\APLU\APLR\APLN\APLA\APLL\APLomega\APLrightparen\APLcolon
\APLleftparen\APLfive\APLrightshoe\APLalpha\APLrightparen
\APLequal\APLzero\APLcolon\APLO\APLP\APLE\APLN\protect\APLunderbar
\APLE\APLR\APLR\APLO\APLR\APLalpha
\end{APLline}
%
% c45.tex
%
%
% \input{c46}
%
%
% c46.tex
%
% C46 OPEN_THE_BOOKS
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLT\APLH\APLE
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
}
\APLcolon\APLalpha\APLO\APLP\APLE\APLN\protect\APLunderbar
\APLT\APLH\APLE\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
\protect\APLunderbar\APLone\APLomega\APLleftparen\APLone\APLrho
\APLleftshoe\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect
\APLunderbar\APLS\APLH\APLE\APLE\APLT\APLrightparen
\end{APLline}
%
% c46.tex
%
%
% \input{c47}
%
%
% c47.tex
%
% C47 OPEN_THE_BOOKS_1
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLT\APLH\APLE
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS\protect\APLunderbar
\APLone
}
\APLcolon\APLleftparen\APLN\APLE\APLW\protect\APLunderbar
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLI\APLN\APLG\protect
\APLunderbar\APLE\APLN\APLT\APLI\APLT\APLY\APLuparrow\protect
\APLoverbar\APLone\APLuparrow\APLalpha\APLrightparen\APLO\APLP\APLE
\APLN\protect\APLunderbar\APLT\APLH\APLE\protect\APLunderbar\APLB
\APLO\APLO\APLK\APLS\protect\APLunderbar\APLtwo\APLspace\APLC
\APLO\APLL\APLL\APLE\APLC\APLT\APLleftparen\APLleftshoe\APLone
\APLuparrow\APLomega\APLrightparen\APLcomma\APLdieresis
\APLleftparen\APLthree\APLdownarrow\APLdieresis\APLleftparen
\APLuparrow\APLone\APLdownarrow\APLalpha\APLrightparen\APLleftbracket
\APLleftparen\APLleftshoe\APLuparrow\APLtwo\APLdownarrow\APLalpha
\APLrightparen\APLA\APLC\APLC\APLE\APLS\APLS\protect
\APLunderbar\APLK\APLE\APLY\APLdieresis\APLuparrow\APLone\APLdownarrow
\APLomega\APLrightbracket\APLrightparen
\end{APLline}
%
% c47.tex
%
%
% \input{c48}
%
%
% c48.tex
%
% C48 OPEN_THE_BOOKS_2
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLT\APLH\APLE
\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS\protect\APLunderbar
\APLtwo
}
\APLcolon\APLalpha\APLR\APLE\APLC\APLO\APLR\APLD\APLspace
\APLC\APLO\APLL\APLL\APLE\APLC\APLT\APLleftparen\APLone
\APLuparrow\APLomega\APLrightparen\APLO\APLP\APLE\APLN\APLI\APLN\APLG
\protect\APLunderbar\APLT\APLR\APLA\APLN\APLS\APLA\APLC\APLT\APLI
\APLO\APLN\APLS\APLspace\APLzero\APLspace\APLthree
\APLdownarrow\APLuparrow\APLone\APLdownarrow\APLomega
\end{APLline}
%
% c48.tex
%
%
% \input{c49}
%
%
% c49.tex
%
% C49 OPEN_TRIAL_BALANCE
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\protect\APLunderbar\APLT\APLR\APLI\APLA
\APLL\protect\APLunderbar\APLB\APLA\APLL\APLA\APLN\APLC\APLE
}
\APLcolon\APLalpha\APLO\APLP\APLE\APLN\protect\APLunderbar
\APLT\APLH\APLE\protect\APLunderbar\APLB\APLO\APLO\APLK\APLS
\protect\APLunderbar\APLone\APLomega\APLleftparen\APLB\APLA\APLL
\APLA\APLN\APLC\APLE\protect\APLunderbar\APLS\APLH\APLE\APLE
\APLT\APLspace\APLI\APLN\APLC\APLO\APLM\APLE\protect\APLunderbar
\APLS\APLT\APLA\APLT\APLE\APLM\APLE\APLN\APLT\APLrightparen
\end{APLline}
%
% c49.tex
%
%
% \input{c50}
%
%
% c50.tex
%
% C50 OPENING_BALANCE_SHEET
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\APLI\APLN\APLG\protect\APLunderbar\APLB
\APLA\APLL\APLA\APLN\APLC\APLE\protect\APLunderbar\APLS\APLH
\APLE\APLE\APLT
}
\APLcolon\APLquote\APLA\APLnine\APLseven\APLzero\APLquote
\end{APLline}
%
% c50.tex
%
%
% \input{c51}
%
%
% c51.tex
%
% C51 OPENING_TRANSACTIONS
\begin{APLline}
{\bf
\APLO\APLP\APLE\APLN\APLI\APLN\APLG\protect\APLunderbar\APLT
\APLR\APLA\APLN\APLS\APLA\APLC\APLT\APLI\APLO\APLN\APLS
}
\APLcolon\APLleftparen\APLleftshoe\APLalpha\APLrightparen
\APLcomma\APLdieresis\APLleftparen\APLleftshoe\APLleftshoe
\APLquote\APLleftparen\APLo\APLb\APLrightparen\APLquote\APLrightparen
\APLcomma\APLdieresis\APLleftshoe\APLleftbracket\APLtwo
\APLrightbracket\APLleftparen\APLleftparen\APLomega\APLleftbracket
\APLsemicolon\APLthree\APLrightbracket\APLequal\APLzero
\APLrightparen\APLcirclestile\APLleftbracket\APLtwo\APLrightbracket
\APLleftparen\APLleftshoe\APLO\APLP\APLE\APLN\APLI\APLN\APLG
\protect\APLunderbar\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect
\APLunderbar\APLS\APLH\APLE\APLE\APLT\APLrightparen\APLcomma
\APLleftbracket\APLtwo\APLrightbracket\APLleftparen\APLzero\APLspace
\protect\APLoverbar\APLtwo\APLdownarrow\APLomega\APLrightparen
\APLrightparen\APLcomma\APLleftbracket\APLtwo\APLrightbracket
\APLplus\APLslash\APLzero\APLspace\APLone\APLdownarrow\APLomega
\end{APLline}
%
% c51.tex
%
%
% \input{c52}
%
%
% c52.tex
%
% C52 POST
\begin{APLline}
{\bf
\APLP\APLO\APLS\APLT
}
\APLcolon\APLleftparen\APLone\APLuparrow\APLalpha
\APLrightparen\APLcomma\APLleftparen\APLleftshoe\APLleftparen\APLalpha
\APLleftbracket\APLtwo\APLspace\APLthree\APLrightbracket
\APLrightparen\APLP\APLO\APLS\APLT\protect\APLunderbar\APLone
\APLleftparen\APLleftparen\APLthree\APLrightshoe\APLalpha\APLrightparen
\APLA\APLC\APLC\APLE\APLS\APLS\protect\APLunderbar\APLK\APLE
\APLY\APLspace\APLfour\APLrightshoe\APLomega\APLrightparen
\APLcomma\APLomega\APLrightparen\APLcomma\APLleftparen\APLtwo
\APLdownarrow\APLalpha\APLrightparen
\end{APLline}
%
% c52.tex
%
%
% \input{c53}
%
%
% c53.tex
%
% C53 POST_1
\begin{APLline}
{\bf
\APLP\APLO\APLS\APLT\protect\APLunderbar\APLone
}
\APLcolon\APLleftparen\APLomega\APLleftbracket\APLone
\APLspace\APLthree\APLrightbracket\APLcomma\APLleftparen\APLomega
\APLleftbracket\APLfive\APLrightbracket\APLE\APLX\APLP\APLL\APLA
\APLI\APLN\APLomega\APLleftbracket\APLfour\APLspace\APLeight
\APLrightbracket\APLcomma\APLalpha\APLrightparen\APLcomma\APLomega
\APLleftbracket\APLtwo\APLspace\APLeight\APLspace\APLsix
\APLspace\APLseven\APLrightbracket\APLrightparen\APLP\APLO\APLS\APLT
\protect\APLunderbar\APLtwo\APLuparrow\APLalpha
\end{APLline}
%
% c53.tex
%
%
% \input{c54}
%
%
% c54.tex
%
% C54 POST_2
\begin{APLline}
{\bf
\APLP\APLO\APLS\APLT\protect\APLunderbar\APLtwo
}
\APLcolon\APLleftparen\APLleftparen\protect\APLoverbar
\APLone\APLplus\APLuparrow\APLalpha\APLrightparen\APLuparrow
\APLomega\APLrightparen\APLcomma\APLleftparen\APLleftshoe\APLleftparen
\APLone\APLdownarrow\APLalpha\APLrightparen\APLP\APLO\APLS
\APLT\protect\APLunderbar\APLthree\APLleftparen\APLuparrow
\APLomega\APLleftbracket\APLuparrow\APLalpha\APLrightbracket
\APLrightparen\APLrightparen\APLcomma\APLleftparen\APLuparrow\APLalpha
\APLrightparen\APLdownarrow\APLomega
\end{APLline}
%
% c54.tex
%
%
% \input{c55}
%
%
% c55.tex
%
% C55 POST_3
\begin{APLline}
{\bf
\APLP\APLO\APLS\APLT\protect\APLunderbar\APLthree
}
\APLcolon\APLleftparen\APLthree\APLuparrow\APLomega
\APLrightparen\APLcomma\APLleftshoe\APLleftparen\APLuparrow\protect
\APLoverbar\APLone\APLuparrow\APLomega\APLrightparen\APLcomma
\APLleftbracket\APLone\APLrightbracket\APLalpha
\end{APLline}
%
% c55.tex
%
%
% \input{c56}
%
%
% c56.tex
%
% C56 POST_A_JOURNAL
\begin{APLline}
{\bf
\APLP\APLO\APLS\APLT\protect\APLunderbar\APLA\protect
\APLunderbar\APLJ\APLO\APLU\APLR\APLN\APLA\APLL
}
\APLcolon\APLleftparen\APLleftparen\APLleftshoe\APLleftparen
\APLuparrow\APLalpha\APLrightparen\APLcomma\APLleftbracket
\APLone\APLrightbracket\APLJ\APLrightparen\APLcomma\APLleftparen
\APLone\APLdownarrow\APLalpha\APLrightparen\APLrightparen\APLP
\APLO\APLS\APLT\APLspace\APLC\APLO\APLL\APLL\APLE\APLC\APLT
\APLleftshoe\APLleftbracket\APLtwo\APLrightbracket\APLJ
\APLleftarrow\APLleftparen\APLleftparen\APLuparrow\protect\APLoverbar
\APLone\APLspace\APLone\APLuparrow\APLuparrow\APLalpha
\APLrightparen\APLplus\APLomega\APLleftbracket\APLsemicolon\APLone
\APLrightbracket\APLplus\APLone\APLbar\APLuparrow\APLomega
\APLrightparen\APLcomma\APLleftparen\APLzero\APLspace\APLone\APLdownarrow
\APLomega\APLrightparen
\end{APLline}
%
% c56.tex
%
%
% \input{c57}
%
%
% c57.tex
%
% C57 PREORDER
\begin{APLline}
{\bf
\APLP\APLR\APLE\APLO\APLR\APLD\APLE\APLR
}
\APLcolon\APLleftparen\APLone\APLrightshoe\APLdieresis
\APLomega\APLrightparen\APLcomma\APLleftbracket\APLone\APLdot
\APLfive\APLrightbracket\APLleftparen\APLthree\APLrightshoe
\APLdieresis\APLalpha\APLrightparen\APLleftbracket\APLleftparen\APLone
\APLrightshoe\APLdieresis\APLalpha\APLrightparen\APLiota
\APLleftparen\APLtwo\APLrightshoe\APLdieresis\APLomega\APLrightparen
\APLrightbracket
\end{APLline}
%
% c57.tex
%
%
% \input{c58}
%
%
% c58.tex
%
% C58 PRINT_ACCOUNT
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT
}
\APLcolon\APLleftparen\APLleftshoe\APLuptackjot\APLleftparen
\APLtwo\APLuparrow\APLL\APLrightparen\APLquote\APLa\APLs
\APLspace\APLo\APLf\APLquote\APLleftparen\APLuparrow\APLomega
\APLrightparen\APLquote\APLf\APLo\APLr\APLquote\APLleftparen\protect
\APLoverbar\APLone\APLuparrow\APLalpha\APLrightparen
\APLrightparen\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLA\APLC
\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar\APLone\APLleftparen
\APLone\APLuparrow\APLomega\APLrightparen\APLcomma\APLthree
\APLdownarrow\APLL\APLleftarrow\APLuparrow\APLleftparen\APLuparrow
\APLone\APLdownarrow\APLalpha\APLrightparen\APLleftbracket
\APLleftparen\APLuparrow\APLtwo\APLdownarrow\APLalpha
\APLrightparen\APLA\APLC\APLC\APLE\APLS\APLS\protect\APLunderbar\APLK\APLE
\APLY\APLuparrow\APLone\APLdownarrow\APLomega\APLrightbracket
\end{APLline}
%
% c58.tex
%
%
% \input{c59}
%
%
% c59.tex
%
% C59 PRINT_ACCOUNT_1
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLone
}
\APLcolon\APLrightshoe\APLleftbracket\APLtwo\APLrightbracket
\APLalpha\APLcomma\APLleftparen\APLleftshoe\APLleftparen
\APLleftparen\APLrho\APLrightshoe\APLalpha\APLrightparen\APLupstile
\APLepsilon\APLupstile\APLslash\APLrho\APLdieresis\APLS
\APLrightparen\APLrho\APLquote\APLbar\APLquote\APLrightparen\APLcomma
\APLS\APLleftarrow\APLleftshoe\APLleftbracket\APLtwo
\APLrightbracket\APLuptackjot\APLleftparen\APLuparrow\APLone\APLdownarrow
\APLomega\APLrightparen\APLcomma\APLleftbracket\APLone
\APLrightbracket\APLleftparen\APLone\APLspace\APLsix\APLrho\APLquote
\APLspace\APLquote\APLrightparen\APLcomma\APLleftbracket\APLone
\APLrightbracket\APLleftparen\APLomega\APLleftbracket\APLone
\APLrightbracket\APLcomma\APLleftparen\APLleftshoe\APLquote\APLT
\APLo\APLt\APLa\APLl\APLquote\APLrightparen\APLcomma\APLquote
\APLspace\APLquote\APLcomma\APLquote\APLspace\APLquote\APLcomma
\APLcomma\APLS\APLrightparen\APLcomma\APLleftbracket\APLzero
\APLdot\APLfive\APLrightbracket\APLleftparen\APLquote\APLspace
\APLquote\APLcomma\APLleftparen\APLleftshoe\APLquote\APLB\APLa
\APLl\APLa\APLn\APLc\APLe\APLquote\APLrightparen\APLcomma
\APLquote\APLspace\APLquote\APLcomma\APLquote\APLspace\APLquote
\APLcomma\APLleftparen\APLstile\APLB\APLrightparen\APLcomma\APLzero
\APLrightparen\APLcolon\APLleftparen\APLB\APLleftarrow\APLbar
\APLslash\APLS\APLleftarrow\APLplus\APLslashbar\APLzero\APLspace
\APLfour\APLdownarrow\APLuparrow\APLone\APLdownarrow\APLomega
\APLrightparen\APLnotless\APLzero\APLcolon\APLrightshoe
\APLleftbracket\APLtwo\APLrightbracket\APLalpha\APLcomma\APLleftparen
\APLleftshoe\APLleftparen\APLleftparen\APLrho\APLrightshoe
\APLalpha\APLrightparen\APLupstile\APLepsilon\APLupstile\APLslash
\APLrho\APLdieresis\APLS\APLrightparen\APLrho\APLquote\APLbar
\APLquote\APLrightparen\APLcomma\APLS\APLleftarrow\APLleftshoe
\APLleftbracket\APLtwo\APLrightbracket\APLuptackjot\APLleftparen
\APLuparrow\APLone\APLdownarrow\APLomega\APLrightparen\APLcomma
\APLleftbracket\APLone\APLrightbracket\APLleftparen\APLone
\APLspace\APLsix\APLrho\APLquote\APLspace\APLquote\APLrightparen
\APLcomma\APLleftbracket\APLone\APLrightbracket\APLleftparen
\APLomega\APLleftbracket\APLone\APLrightbracket\APLcomma
\APLleftparen\APLleftshoe\APLquote\APLT\APLo\APLt\APLa\APLl\APLquote
\APLrightparen\APLcomma\APLquote\APLspace\APLquote\APLcomma
\APLquote\APLspace\APLquote\APLcomma\APLcomma\APLS\APLrightparen
\APLcomma\APLleftbracket\APLzero\APLdot\APLfive\APLrightbracket
\APLleftparen\APLquote\APLspace\APLquote\APLcomma\APLleftparen
\APLleftshoe\APLquote\APLB\APLa\APLl\APLa\APLn\APLc\APLe\APLquote
\APLrightparen\APLcomma\APLquote\APLspace\APLquote\APLcomma
\APLquote\APLspace\APLquote\APLcomma\APLzero\APLcomma\APLleftparen
\APLstile\APLB\APLrightparen\APLrightparen
\end{APLline}
%
% c59.tex
%
%
% \input{c60}
%
%
% c60.tex
%
% C60 PRINT_ACCOUNT_TYPE_TREE
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT\APLY\APLP\APLE
\protect\APLunderbar\APLT\APLR\APLE\APLE
}
\APLcolon\APLrightshoe\APLleftbracket\APLtwo\APLrightbracket
\APLepsilon\APLdieresis\APLleftparen\APLleftparen\APLthree
\APLtimes\APLJ\APLleftbracket\APLsemicolon\APLtwo\APLrightbracket
\APLrightparen\APLrho\APLdieresis\APLquote\APLspace\APLquote
\APLrightparen\APLcomma\APLdieresis\APLleftshoe\APLleftbracket
\APLtwo\APLrightbracket\APLzero\APLspace\protect\APLoverbar
\APLone\APLdownarrow\APLJ\APLleftarrow\APLleftparen\APLleftparen
\APLupstile\APLleftparen\APLuparrow\APLrho\APLJ\APLrightparen
\APLdivide\APLtwo\APLrightparen\APLcomma\APLtwo\APLrightparen
\APLrho\APLJ\APLleftarrow\APLleftparen\APLleftparen\APLleftshoe
\APLomega\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar
\APLT\APLY\APLP\APLE\APLspace\APLB\APLA\APLL\APLA\APLN\APLC\APLE
\protect\APLunderbar\APLS\APLH\APLE\APLE\APLT\APLrightparen
\APLzero\APLrightparen\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect
\APLunderbar\APLT\APLY\APLP\APLE\protect\APLunderbar\APLT\APLR
\APLE\APLE\APLleftparen\APLtwo\APLrightshoe\APLomega
\APLrightparen\APLP\APLR\APLE\APLO\APLR\APLD\APLE\APLR\APLleftparen
\APLfour\APLrightshoe\APLomega\APLrightparen
\end{APLline}
%
% c60.tex
%
%
% \input{c61}
%
%
% c61.tex
%
% C61 PRINT_BALANCE_SHEET
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLB\APLA\APLL
\APLA\APLN\APLC\APLE\protect\APLunderbar\APLS\APLH\APLE\APLE
\APLT
}
\APLcolon\APLalpha\APLP\APLR\APLI\APLN\APLT\protect
\APLunderbar\APLL\APLT\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU
\APLN\APLT\APLomega\APLB\APLA\APLL\APLA\APLN\APLC\APLE\protect
\APLunderbar\APLS\APLH\APLE\APLE\APLT
\end{APLline}
%
% c61.tex
%
%
% \input{c62}
%
%
% c62.tex
%
% C62 PRINT_CHART_OF_ACCOUNTS
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLC\APLH\APLA
\APLR\APLT\protect\APLunderbar\APLO\APLF\protect\APLunderbar
\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLS
}
\APLcolon\APLrightshoe\APLleftbracket\APLtwo\APLrightbracket
\protect\APLoverbar\APLone\APLcirclestile\APLleftparen
\APLleftshoe\APLleftparen\APLupstile\APLslash\APLepsilon\APLrho
\APLdieresis\APLM\APLrightparen\APLrho\APLquote\APLbar\APLquote
\APLrightparen\APLcomma\APLM\APLleftarrow\APLleftparen\APLleftshoe
\APLleftbracket\APLtwo\APLrightbracket\APLuptackjot\APLrightshoe
\APLleftbracket\APLtwo\APLrightbracket\APLtwo\APLuparrow
\APLdieresis\APLtwo\APLrightshoe\APLalpha\APLrightparen\APLcomma
\APLleftparen\APLleftshoe\APLepsilon\APLquote\APLC\APLh\APLa\APLr
\APLt\APLspace\APLo\APLf\APLspace\APLA\APLc\APLc\APLo\APLu\APLn
\APLt\APLs\APLspace\APLf\APLo\APLr\APLspace\APLquote\APLcomma
\APLleftparen\protect\APLoverbar\APLone\APLuparrow\APLalpha
\APLrightparen\APLcomma\APLquote\APLspace\APLa\APLs\APLspace\APLo
\APLf\APLspace\APLquote\APLcomma\APLomega\APLrightparen
\end{APLline}
%
% c62.tex
%
%
% \input{c63}
%
%
% c63.tex
%
% C63 PRINT_ENTRY
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLE\APLN\APLT
\APLR\APLY
}
\APLcolon\APLleftparen\APLomega\APLequal\APLcomma\APLzero
\APLspace\protect\APLoverbar\APLsix\APLdownarrow\APLuparrow
\APLalpha\APLrightparen\APLslashbar\APLuparrow\APLalpha
\end{APLline}
%
% c63.tex
%
%
% \input{c64}
%
%
% c64.tex
%
% C64 PRINT_INCOME_STATEMENT
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLI\APLN\APLC
\APLO\APLM\APLE\protect\APLunderbar\APLS\APLT\APLA\APLT\APLE
\APLM\APLE\APLN\APLT
}
\APLcolon\APLalpha\APLP\APLR\APLI\APLN\APLT\protect
\APLunderbar\APLL\APLT\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU
\APLN\APLT\APLomega\APLI\APLN\APLC\APLO\APLM\APLE\protect
\APLunderbar\APLS\APLT\APLA\APLT\APLE\APLM\APLE\APLN\APLT
\end{APLline}
%
% c64.tex
%
%
% \input{c65}
%
%
% c65.tex
%
% C65 PRINT_LT_ACCOUNT
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLL\APLT
\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT
}
\APLcolon\APLleftparen\APLleftshoe\APLuptackjot\APLleftparen
\APLtwo\APLrightshoe\APLL\APLrightparen\APLquote\APLa\APLs
\APLspace\APLo\APLf\APLquote\APLleftparen\APLuparrow\APLomega
\APLrightparen\APLquote\APLf\APLo\APLr\APLquote\APLleftparen
\protect\APLoverbar\APLone\APLuparrow\APLalpha\APLrightparen
\APLrightparen\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLL\APLT
\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect
\APLunderbar\APLone\APLspace\APLfour\APLrightshoe\APLL
\APLleftarrow\APLuparrow\APLleftparen\APLuparrow\APLone\APLdownarrow
\APLalpha\APLrightparen\APLleftbracket\APLleftparen\APLuparrow
\APLtwo\APLdownarrow\APLalpha\APLrightparen\APLA\APLC\APLC\APLE
\APLS\APLS\protect\APLunderbar\APLK\APLE\APLY\APLuparrow\APLone
\APLdownarrow\APLomega\APLrightbracket
\end{APLline}
%
% c65.tex
%
%
% \input{c66}
%
%
% c66.tex
%
% C66 PRINT_LT_ACCOUNT_1
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLL\APLT
\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect
\APLunderbar\APLone
}
\APLcolon\APLalpha\APLP\APLR\APLI\APLN\APLT\protect
\APLunderbar\APLL\APLT\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU
\APLN\APLT\protect\APLunderbar\APLtwo\APLleftparen\APLtwo\APLspace
\APLthree\APLrho\APLquote\APLspace\APLspace\APLquote\APLcomma
\APLzero\APLcomma\APLquote\APLspace\APLquote\APLcomma\APLzero
\APLrightparen\APLcomma\APLleftbracket\APLone\APLrightbracket
\APLleftparen\APLtwo\APLspace\APLthree\APLrho\APLleftparen
\APLleftshoe\APLquote\APLT\APLo\APLt\APLa\APLl\APLquote\APLrightparen
\APLcomma\APLleftparen\APLleftshoe\APLone\APLrho\APLS
\APLleftbracket\APLone\APLrightbracket\APLrightparen\APLcomma\APLzero
\APLcomma\APLleftparen\APLleftshoe\APLquote\APLT\APLo\APLt\APLa
\APLl\APLquote\APLrightparen\APLcomma\APLzero\APLcomma
\APLleftparen\APLleftshoe\APLone\APLrho\APLtwo\APLrightshoe\APLS
\APLleftarrow\APLplus\APLslashbar\APLomega\APLleftbracket
\APLsemicolon\APLfive\APLspace\APLsix\APLrightbracket\APLrightparen
\APLrightparen\APLcomma\APLleftbracket\APLone\APLrightbracket
\APLomega\APLleftbracket\APLsemicolon\APLtwo\APLspace\APLfive\APLspace
\APLsix\APLrightbracket
\end{APLline}
%
% c66.tex
%
%
% \input{c67}
%
%
% c67.tex
%
% C67 PRINT_LT_ACCOUNT_2
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLL\APLT
\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect
\APLunderbar\APLtwo
}
\APLcolon\APLrightshoe\APLleftbracket\APLtwo\APLrightbracket
\APLalpha\APLcomma\APLleftparen\APLleftshoe\APLleftparen
\APLleftparen\APLrho\APLrightshoe\APLalpha\APLrightparen\APLupstile
\APLone\APLdownarrow\APLrho\APLM\APLrightparen\APLrho\APLquote
\APLbar\APLquote\APLrightparen\APLcomma\APLtwo\APLcirclestile
\APLleftbracket\APLone\APLrightbracket\APLleftshoe
\APLleftbracket\APLtwo\APLrightbracket\APLM\APLleftarrow\APLuptackjot
\APLleftparen\APLleftparen\APLomega\APLleftbracket\APLsemicolon
\APLthree\APLrightbracket\APLequalunderbar\APLdieresis\APLzero
\APLrightparen\APLslashbar\APLomega\APLleftbracket\APLsemicolon
\APLiota\APLtwo\APLrightbracket\APLrightparen\APLleftparen
\APLleftparen\APLleftparen\APLleftparen\APLuparrow\APLrho\APLM
\APLrightparen\APLupstile\APLleftparen\APLleftparen\APLuparrow\APLrho
\APLomega\APLrightparen\APLbar\APLuparrow\APLrho\APLM
\APLrightparen\APLrightparen\APLcomma\APLone\APLrightparen\APLrho
\APLquote\APLstile\APLquote\APLrightparen\APLM\APLleftarrow
\APLleftparen\APLomega\APLleftbracket\APLsemicolon\APLtwo\APLrightbracket
\APLequalunderbar\APLdieresis\APLzero\APLrightparen
\APLslashbar\APLomega\APLleftbracket\APLsemicolon\APLone\APLspace
\APLthree\APLrightbracket
\end{APLline}
%
% c67.tex
%
%
% \input{c68}
%
%
% c68.tex
%
% C68 PRINT_T_ACCOUNT
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLT\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT
}
\APLcolon\APLleftparen\APLleftshoe\APLuptackjot\APLtwo
\APLuparrow\APLL\APLrightparen\APLP\APLR\APLI\APLN\APLT\protect
\APLunderbar\APLT\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN
\APLT\protect\APLunderbar\APLone\APLspace\APLzero\APLspace
\APLtwo\APLdownarrow\APLfour\APLrightshoe\APLL\APLleftarrow
\APLuparrow\APLleftparen\APLuparrow\APLone\APLdownarrow\APLalpha
\APLrightparen\APLleftbracket\APLleftparen\APLuparrow\APLtwo
\APLdownarrow\APLalpha\APLrightparen\APLA\APLC\APLC\APLE\APLS\APLS
\protect\APLunderbar\APLK\APLE\APLY\APLomega\APLrightbracket
\end{APLline}
%
% c68.tex
%
%
% \input{c69}
%
%
% c69.tex
%
% C69 PRINT_T_ACCOUNT_1
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLT\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect
\APLunderbar\APLone
}
\APLcolon\APLalpha\APLP\APLR\APLI\APLN\APLT\protect
\APLunderbar\APLT\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN
\APLT\protect\APLunderbar\APLtwo\APLleftparen\APLtwo\APLspace
\APLfour\APLrho\APLquote\APLspace\APLspace\APLspace\APLquote
\APLcomma\APLzero\APLcomma\APLquote\APLspace\APLspace\APLquote
\APLcomma\APLzero\APLrightparen\APLcomma\APLleftbracket\APLone
\APLrightbracket\APLleftparen\APLtwo\APLspace\APLfour\APLrho\APLquote
\APLspace\APLquote\APLcomma\APLleftparen\APLleftshoe\APLquote
\APLT\APLo\APLt\APLa\APLl\APLquote\APLrightparen\APLcomma
\APLleftparen\APLleftshoe\APLone\APLrho\APLS\APLleftbracket\APLone
\APLrightbracket\APLrightparen\APLcomma\APLzero\APLcomma
\APLquote\APLspace\APLquote\APLcomma\APLleftparen\APLleftshoe\APLquote
\APLT\APLo\APLt\APLa\APLl\APLquote\APLrightparen\APLcomma
\APLzero\APLcomma\APLleftparen\APLleftshoe\APLone\APLrho\APLS
\APLleftbracket\APLtwo\APLrightbracket\APLrightparen\APLrightparen
\APLcomma\APLleftbracket\APLone\APLrightbracket\APLleftparen
\APLtwo\APLspace\APLfour\APLrho\APLquote\APLspace\APLquote
\APLcomma\APLleftparen\APLleftshoe\APLquote\APLB\APLa\APLl\APLa\APLn
\APLc\APLe\APLquote\APLrightparen\APLcomma\APLleftparen
\APLleftshoe\APLone\APLrho\APLstile\APLB\APLrightparen\APLcomma\APLzero
\APLcomma\APLquote\APLspace\APLspace\APLquote\APLcomma\APLzero
\APLrightparen\APLcomma\APLleftbracket\APLone\APLrightbracket
\APLomega\APLcolon\APLleftparen\APLB\APLleftarrow\APLbar
\APLslash\APLS\APLleftarrow\APLplus\APLslashbar\APLomega
\APLleftbracket\APLsemicolon\APLthree\APLspace\APLfour\APLrightbracket
\APLrightparen\APLnotless\APLzero\APLcolon\APLalpha\APLP\APLR\APLI
\APLN\APLT\protect\APLunderbar\APLT\protect\APLunderbar\APLA
\APLC\APLC\APLO\APLU\APLN\APLT\protect\APLunderbar\APLtwo
\APLleftparen\APLtwo\APLspace\APLfour\APLrho\APLquote\APLspace
\APLspace\APLspace\APLquote\APLcomma\APLzero\APLcomma\APLquote
\APLspace\APLspace\APLquote\APLcomma\APLzero\APLrightparen\APLcomma
\APLleftbracket\APLone\APLrightbracket\APLleftparen\APLtwo
\APLspace\APLfour\APLrho\APLquote\APLspace\APLquote\APLcomma
\APLleftparen\APLleftshoe\APLquote\APLT\APLo\APLt\APLa\APLl\APLquote
\APLrightparen\APLcomma\APLleftparen\APLleftshoe\APLone\APLrho
\APLS\APLleftbracket\APLone\APLrightbracket\APLrightparen
\APLcomma\APLzero\APLcomma\APLquote\APLspace\APLquote\APLcomma
\APLleftparen\APLleftshoe\APLquote\APLT\APLo\APLt\APLa\APLl\APLquote
\APLrightparen\APLcomma\APLzero\APLcomma\APLleftparen
\APLleftshoe\APLone\APLrho\APLS\APLleftbracket\APLtwo\APLrightbracket
\APLrightparen\APLrightparen\APLcomma\APLleftbracket\APLone
\APLrightbracket\APLleftparen\APLtwo\APLspace\APLfour\APLrho\APLquote
\APLspace\APLquote\APLcomma\APLleftparen\APLleftshoe\APLquote
\APLB\APLa\APLl\APLa\APLn\APLc\APLe\APLquote\APLrightparen
\APLcomma\APLzero\APLcomma\APLleftparen\APLleftshoe\APLone\APLrho
\APLstile\APLB\APLrightparen\APLcomma\APLquote\APLspace\APLspace
\APLspace\APLquote\APLcomma\APLzero\APLrightparen\APLcomma
\APLleftbracket\APLone\APLrightbracket\APLomega
\end{APLline}
%
% c69.tex
%
%
% \input{c70}
%
%
% c70.tex
%
% C70 PRINT_T_ACCOUNT_2
\begin{APLline}
{\bf
\APLP\APLR\APLI\APLN\APLT\protect\APLunderbar\APLT\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\protect
\APLunderbar\APLtwo
}
\APLcolon\APLrightshoe\APLleftbracket\APLtwo\APLrightbracket
\APLalpha\APLcomma\APLleftparen\APLleftshoe\APLleftparen
\APLleftparen\APLrho\APLrightshoe\APLalpha\APLrightparen\APLupstile
\APLone\APLdownarrow\APLrho\APLM\APLrightparen\APLrho\APLquote
\APLbar\APLquote\APLrightparen\APLcomma\APLthree\APLcirclestile
\APLleftbracket\APLone\APLrightbracket\APLleftshoe
\APLleftbracket\APLtwo\APLrightbracket\APLM\APLleftarrow\APLuptackjot
\APLleftparen\APLleftparen\APLomega\APLleftbracket\APLsemicolon
\APLfour\APLrightbracket\APLequalunderbar\APLdieresis\APLzero
\APLrightparen\APLslashbar\APLomega\APLleftbracket\APLsemicolon
\APLiota\APLthree\APLrightbracket\APLrightparen\APLleftparen
\APLleftparen\APLleftparen\APLleftparen\APLuparrow\APLrho\APLM
\APLrightparen\APLupstile\APLleftparen\APLleftparen\APLuparrow
\APLrho\APLomega\APLrightparen\APLbar\APLuparrow\APLrho\APLM
\APLrightparen\APLrightparen\APLcomma\APLone\APLrightparen\APLrho
\APLquote\APLstile\APLquote\APLrightparen\APLM\APLleftarrow
\APLleftparen\APLomega\APLleftbracket\APLsemicolon\APLthree
\APLrightbracket\APLequalunderbar\APLdieresis\APLzero\APLrightparen
\APLslashbar\APLomega\APLleftbracket\APLsemicolon\APLone\APLspace
\APLtwo\APLspace\APLfour\APLrightbracket
\end{APLline}
%
% c70.tex
%
%
% \input{c71}
%
%
% c71.tex
%
% C71 RECORD
\begin{APLline}
{\bf
\APLR\APLE\APLC\APLO\APLR\APLD
}
\APLcolon\APLleftparen\APLleftparen\APLone\APLdownarrow\APLJ
\APLrightparen\APLcomma\APLleftparen\APLone\APLdownarrow
\APLalpha\APLrightparen\APLrightparen\APLP\APLO\APLS\APLT\APLspace
\APLC\APLO\APLL\APLL\APLE\APLC\APLT\APLuparrow\APLJ\APLleftarrow
\APLleftparen\APLuparrow\APLalpha\APLrightparen\APLJ\APLO\APLU
\APLR\APLN\APLA\APLL\APLI\APLZ\APLE\protect\APLunderbar\APLS
\APLI\APLM\APLP\APLL\APLE\protect\APLunderbar\APLE\APLN\APLT
\APLR\APLY\APLomega\APLcolon\APLfour\APLequal\APLrho\APLomega
\APLcolon\APLleftparen\APLleftparen\APLone\APLdownarrow\APLJ
\APLrightparen\APLcomma\APLleftparen\APLone\APLdownarrow\APLalpha
\APLrightparen\APLrightparen\APLP\APLO\APLS\APLT\APLspace\APLC
\APLO\APLL\APLL\APLE\APLC\APLT\APLuparrow\APLJ\APLleftarrow
\APLleftparen\APLuparrow\APLalpha\APLrightparen\APLJ\APLO\APLU\APLR
\APLN\APLA\APLL\APLI\APLZ\APLE\protect\APLunderbar\APLC\APLO
\APLM\APLP\APLO\APLU\APLN\APLD\protect\APLunderbar\APLE\APLN\APLT
\APLR\APLY\APLomega
\end{APLline}
%
% c71.tex
%
%
% \input{c72}
%
%
% c72.tex
%
% C72 REVERSE_JOURNAL
\begin{APLline}
{\bf
\APLR\APLE\APLV\APLE\APLR\APLS\APLE\protect\APLunderbar\APLJ
\APLO\APLU\APLR\APLN\APLA\APLL
}
\APLcolon\APLleftparen\APLB\APLA\APLL\APLA\APLN\APLC\APLE
\protect\APLunderbar\APLS\APLH\APLE\APLE\APLT\APLspace\APLO\APLP
\APLE\APLN\APLI\APLN\APLG\protect\APLunderbar\APLB\APLA\APLL
\APLA\APLN\APLC\APLE\protect\APLunderbar\APLS\APLH\APLE\APLE\APLT
\APLrightparen\APLC\APLH\APLA\APLN\APLG\APLE\protect
\APLunderbar\APLR\APLO\APLO\APLT\APLleftparen\APLleftparen\APLleftshoe
\APLomega\APLrightparen\APLcomma\APLleftparen\APLleftshoe
\APLquote\APLleftparen\APLo\APLb\APLrightparen\APLquote\APLrightparen
\APLcomma\APLleftparen\APLleftparen\APLleftparen\APLfive
\APLrightshoe\APLalpha\APLrightparen\APLcomma\APLzero\APLrightparen
\APLdownarrow\APLleftparen\APLone\APLrightshoe\APLalpha
\APLrightparen\APLrightparen\APLleftbracket\APLsemicolon\APLone
\APLspace\APLseven\APLspace\APLfive\APLspace\APLsix\APLspace\APLfour
\APLrightbracket\APLrightparen\APLleftbracket\APLsemicolon
\APLthree\APLspace\APLone\APLspace\APLtwo\APLspace\APLfour\APLspace
\APLfive\APLspace\APLsix\APLspace\APLseven\APLrightbracket
\end{APLline}
%
% c72.tex
%
%
% \input{c73}
%
%
% c73.tex
%
% C73 SPLIT_JOURNAL
\begin{APLline}
{\bf
\APLS\APLP\APLL\APLI\APLT\protect\APLunderbar\APLJ\APLO\APLU
\APLR\APLN\APLA\APLL
}
\APLcolon\APLleftparen\APLtilde\APLleftparen\APLcomma
\APLomega\APLleftbracket\APLsemicolon\APLfour\APLrightbracket
\APLepsilon\APLS\APLrightparen\APLdowncaret\APLleftparen\APLcomma
\APLomega\APLleftbracket\APLsemicolon\APLseven\APLrightbracket
\APLepsilon\APLS\APLleftarrow\APLleftparen\APLuparrow\APLalpha
\APLrightparen\APLS\APLU\APLB\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\APLS\APLspace\APLone\APLdownarrow\APLalpha
\APLrightparen\APLrightparen\APLslash\APLleftbracket\APLone
\APLrightbracket\APLomega
\end{APLline}
%
% c73.tex
%
%
% \input{c74}
%
%
% c74.tex
%
% C74 SUB_ACCOUNTS
\begin{APLline}
{\bf
\APLS\APLU\APLB\protect\APLunderbar\APLA\APLC\APLC\APLO\APLU
\APLN\APLT\APLS
}
\APLcolon\APLleftparen\APLleftshoe\APLalpha\APLrightparen
\APLcomma\APLleftparen\APLleftparen\APLthree\APLrightshoe
\APLdieresis\APLone\APLrightshoe\APLomega\APLrightparen\APLepsilon
\APLleftparen\APLM\APLslash\APLone\APLrightshoe\APLdieresis\APLtwo
\APLrightshoe\APLomega\APLrightparen\APLS\APLU\APLB\protect
\APLunderbar\APLT\APLY\APLP\APLE\APLS\APLleftparen\APLone
\APLrightshoe\APLomega\APLrightparen\APLP\APLR\APLE\APLO\APLR\APLD
\APLE\APLR\APLleftparen\APLtwo\APLrightshoe\APLomega\APLrightparen
\APLrightparen\APLslash\APLleftparen\APLone\APLrightshoe
\APLdieresis\APLone\APLrightshoe\APLomega\APLrightparen\APLcolon
\APLzero\APLequal\APLdowncaret\APLslash\APLM\APLleftarrow
\APLleftparen\APLtwo\APLrightshoe\APLdieresis\APLleftparen\APLtwo
\APLrightshoe\APLomega\APLrightparen\APLrightparen\APLepsilon
\APLleftshoe\APLalpha\APLcolon\APLcomma\APLleftshoe\APLalpha
\end{APLline}
%
% c74.tex
%
%
% \input{c75}
%
%
% c75.tex
%
% C75 SUB_TYPE
\begin{APLline}
{\bf
\APLS\APLU\APLB\protect\APLunderbar\APLT\APLY\APLP\APLE
}
\APLcolon\APLleftparen\APLcomma\APLomega\APLleftbracket
\APLsemicolon\APLtwo\APLrightbracket\APLepsilon\APLalpha
\APLrightparen\APLslash\APLleftbracket\APLone\APLrightbracket\APLomega
\APLleftbracket\APLsemicolon\APLone\APLrightbracket
\end{APLline}
%
% c75.tex
%
%
% \input{c76}
%
%
% c76.tex
%
% C76 SUB_TYPES
\begin{APLline}
{\bf
\APLS\APLU\APLB\protect\APLunderbar\APLT\APLY\APLP\APLE\APLS
}
\APLcolon\APLJ\APLspace\APLS\APLU\APLB\protect\APLunderbar
\APLT\APLY\APLP\APLE\APLS\APLomega\APLcolon\APLalpha
\APLequalunderbar\APLJ\APLleftarrow\APLU\APLN\APLI\APLQ\APLU\APLE\APLalpha
\APLcomma\APLrightshoe\APLcomma\APLslash\APLleftparen
\APLleftshoe\APLdieresis\APLalpha\APLrightparen\APLS\APLU\APLB\protect
\APLunderbar\APLT\APLY\APLP\APLE\APLdieresis\APLleftshoe
\APLomega\APLcolon\APLJ
\end{APLline}
%
% c76.tex
%
%
% \input{c77}
%
%
% c77.tex
%
% C77 SWAP
\begin{APLline}
{\bf
\APLS\APLW\APLA\APLP
}
\APLcolon\APLomega\APLcolon\APLomega\APLequalunderbar\APLone
\APLrightshoe\APLalpha\APLcolon\APLtwo\APLrightshoe\APLalpha
\end{APLline}
%
% c77.tex
%
%
% \input{c78}
%
%
% c78.tex
%
% C78 WRONG_ACCOUNT_TYPE
\begin{APLline}
{\bf
\APLW\APLR\APLO\APLN\APLG\protect\APLunderbar\APLA\APLC\APLC
\APLO\APLU\APLN\APLT\protect\APLunderbar\APLT\APLY\APLP\APLE
}
\APLcolon\APLleftparen\APLtilde\APLleftparen\APLthree
\APLrightshoe\APLdieresis\APLtwo\APLrightshoe\APLomega\APLrightparen
\APLepsilon\APLleftparen\APLone\APLrightshoe\APLdieresis
\APLfour\APLrightshoe\APLomega\APLrightparen\APLrightparen\APLslash
\APLleftparen\APLone\APLrightshoe\APLdieresis\APLtwo
\APLrightshoe\APLomega\APLrightparen
\end{APLline}
%
% c78.tex
%
%
% \input{c79}
%
%
% c79.tex
%
% C79 UNIQUE
\begin{APLline}
{\bf
\APLU\APLN\APLI\APLQ\APLU\APLE
}
\APLcolon\APLleftparen\APLleftparen\APLomega\APLiota
\APLomega\APLrightparen\APLequal\APLiota\APLrho\APLomega\APLrightparen
\APLslash\APLomega
\end{APLline}
%
% c79.tex
%
%
% dd.tex
%
\end{APLfns}

\section{The Chart of Accounts and the Account Closing Order} \label{appchart}

\begin{APLfns}
% NEW_CHART_OF_ACCOUNTS
\begin{APLline}
\APLless accounting entity\APLgreater
\APLleftarrow
{\bf NEW\_CHART\_OF\_ACCOUNTS}
\APLless accounting entity\APLgreater
\end{APLline}
% NEW_CLOSING_ORDER
\begin{APLline}
\APLless closing order \APLgreater
\APLleftarrow
{\bf NEW\_CLOSING\_ORDER}
\end{APLline}
\end{APLfns}

%
% \input{d1}
%
%
% d1.tex
%
% D1 NEW_CHART_OF_ACCOUNTS
\begin{APLfns}
\begin{APLfnsline}{}{\APLdel}
\APLZ\APLleftarrow\APLN\APLE\APLW\protect\APLunderbar\APLC
\APLH\APLA\APLR\APLT\protect\APLunderbar\APLO\APLF\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLS\APLspace\APLW
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLrightbracket}{}
\APLZ\APLleftarrow\APLW\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLzero\APLfive\APLzero\APLquote\APLspace\APLquote\APLS
\APLt\APLo\APLr\APLe\APLspace\APLe\APLq\APLu\APLi\APLp\APLm\APLe
\APLn\APLt\APLquote\APLspace\APLquote\APLA\APLS\APLS\APLE\APLT
\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLtwo\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLone\APLone\APLzero\APLquote\APLspace\APLquote\APLM\APLe
\APLr\APLc\APLh\APLa\APLn\APLd\APLi\APLs\APLe\APLspace\APLi
\APLn\APLv\APLe\APLn\APLt\APLo\APLr\APLy\APLquote\APLspace
\APLquote\APLA\APLS\APLS\APLE\APLT\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLthree\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLtwo\APLzero\APLzero\APLquote\APLspace\APLquote\APLC
\APLa\APLs\APLh\APLquote\APLspace\APLquote\APLA\APLS\APLS\APLE
\APLT\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLfour\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLtwo\APLthree\APLzero\APLquote\APLspace\APLquote\APLA
\APLc\APLc\APLo\APLu\APLn\APLt\APLs\APLspace\APLr\APLe\APLc\APLe
\APLi\APLv\APLa\APLb\APLl\APLe\APLquote\APLspace\APLquote\APLA
\APLS\APLS\APLE\APLT\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLfive\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLtwo\APLeight\APLone\APLquote\APLspace\APLquote\APLP
\APLr\APLe\APLp\APLa\APLi\APLd\APLspace\APLr\APLe\APLn\APLt
\APLquote\APLspace\APLquote\APLA\APLS\APLS\APLE\APLT\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLsix\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLthree\APLone\APLone\APLquote\APLspace\APLquote\APLN
\APLo\APLt\APLe\APLspace\APLp\APLa\APLy\APLa\APLb\APLl\APLe
\APLquote\APLspace\APLquote\APLL\APLI\APLA\APLB\APLI\APLL\APLI\APLT
\APLY\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLseven\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLthree\APLthree\APLzero\APLquote\APLspace\APLquote\APLA
\APLc\APLc\APLo\APLu\APLn\APLt\APLs\APLspace\APLp\APLa\APLy
\APLa\APLb\APLl\APLe\APLquote\APLspace\APLquote\APLL\APLI\APLA
\APLB\APLI\APLL\APLI\APLT\APLY\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLeight\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLthree\APLthree\APLzero\APLone\APLquote\APLspace
\APLquote\APLH\APLo\APLw\APLe\APLl\APLl\APLspace\APLC\APLo\APLdot
\APLquote\APLspace\APLquote\APLS\APLU\APLP\APLP\APLL\APLI\APLE\APLR
\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLnine\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLthree\APLthree\APLzero\APLtwo\APLquote\APLspace
\APLquote\APLP\APLo\APLr\APLt\APLe\APLr\APLspace\APLC\APLo\APLdot
\APLquote\APLspace\APLquote\APLS\APLU\APLP\APLP\APLL\APLI\APLE\APLR
\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLzero\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLthree\APLnine\APLzero\APLquote\APLspace\APLquote\APLD
\APLi\APLv\APLi\APLd\APLe\APLn\APLd\APLs\APLspace\APLp\APLa\APLy
\APLa\APLb\APLl\APLe\APLquote\APLspace\APLquote\APLL\APLI\APLA
\APLB\APLI\APLL\APLI\APLT\APLY\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLone\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLfour\APLone\APLzero\APLquote\APLspace\APLquote\APLC
\APLo\APLs\APLt\APLspace\APLo\APLf\APLspace\APLg\APLo\APLo\APLd
\APLs\APLspace\APLs\APLo\APLl\APLd\APLquote\APLspace\APLquote
\APLE\APLX\APLP\APLE\APLN\APLS\APLE\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLtwo\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLsix\APLthree\APLzero\APLquote\APLspace\APLquote\APLR
\APLe\APLn\APLt\APLspace\APLe\APLx\APLp\APLe\APLn\APLs\APLe
\APLquote\APLspace\APLquote\APLE\APLX\APLP\APLE\APLN\APLS\APLE
\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLthree\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLseven\APLone\APLzero\APLquote\APLspace\APLquote\APLD
\APLe\APLp\APLr\APLe\APLc\APLi\APLa\APLt\APLi\APLo\APLn\APLspace
\APLe\APLx\APLp\APLe\APLn\APLs\APLe\APLquote\APLspace\APLquote
\APLE\APLX\APLP\APLE\APLN\APLS\APLE\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLfour\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLeight\APLzero\APLzero\APLquote\APLspace\APLquote\APLS
\APLa\APLl\APLe\APLs\APLquote\APLspace\APLquote\APLR\APLE\APLV
\APLE\APLN\APLU\APLE\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLfive\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLnine\APLone\APLzero\APLquote\APLspace\APLquote\APLC
\APLa\APLp\APLi\APLt\APLa\APLl\APLquote\APLspace\APLquote\APLO
\APLW\APLN\protect\APLunderbar\APLE\APLQ\APLU\APLI\APLT\APLY
\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLsix\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLnine\APLfive\APLzero\APLquote\APLspace\APLquote\APLP
\APLr\APLi\APLv\APLa\APLt\APLe\APLquote\APLspace\APLquote\APLS
\APLO\APLL\APLE\protect\APLunderbar\APLP\APLR\APLO\APLP\APLR\APLI
\APLE\APLT\APLO\APLR\APLS\APLH\APLI\APLP\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLseven\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLnine\APLfive\APLone\APLquote\APLspace\APLquote\APLC
\APLa\APLp\APLi\APLt\APLa\APLl\APLspace\APLS\APLm\APLi\APLt\APLh
\APLquote\APLspace\APLquote\APLP\APLA\APLR\APLT\APLN\APLE\APLR
\APLS\APLH\APLI\APLP\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLeight\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLnine\APLfive\APLtwo\APLquote\APLspace\APLquote\APLC
\APLa\APLp\APLi\APLt\APLa\APLl\APLspace\APLJ\APLo\APLn\APLe\APLs
\APLquote\APLspace\APLquote\APLP\APLA\APLR\APLT\APLN\APLE\APLR
\APLS\APLH\APLI\APLP\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLnine\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLnine\APLsix\APLzero\APLquote\APLspace\APLquote\APLP
\APLa\APLi\APLd\APLbar\APLi\APLn\APLspace\APLc\APLa\APLp\APLi\APLt
\APLa\APLl\APLquote\APLspace\APLquote\APLC\APLO\APLR\APLP\APLO
\APLR\APLA\APLT\APLI\APLO\APLN\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLtwo\APLzero\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLnine\APLsix\APLnine\APLquote\APLspace\APLquote\APLR
\APLe\APLt\APLa\APLi\APLn\APLe\APLd\APLspace\APLi\APLn\APLc\APLo
\APLm\APLe\APLquote\APLspace\APLquote\APLC\APLO\APLR\APLP\APLO
\APLR\APLA\APLT\APLI\APLO\APLN\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLtwo\APLone\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLnine\APLseven\APLzero\APLquote\APLspace\APLquote\APLO
\APLp\APLe\APLn\APLi\APLn\APLg\APLspace\APLb\APLa\APLl\APLa\APLn
\APLc\APLe\APLspace\APLs\APLh\APLe\APLe\APLt\APLquote\APLspace
\APLquote\APLB\APLO\APLO\APLK\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLtwo\APLtwo\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLnine\APLseven\APLone\APLquote\APLspace\APLquote\APLB
\APLa\APLl\APLa\APLn\APLc\APLe\APLspace\APLs\APLh\APLe\APLe\APLt
\APLquote\APLspace\APLquote\APLB\APLO\APLO\APLK\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLtwo\APLthree\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLspace\APLN\APLE\APLW\protect
\APLunderbar\APLA\APLC\APLC\APLO\APLU\APLN\APLT\APLspace\APLquote
\APLA\APLnine\APLseven\APLtwo\APLquote\APLspace\APLquote\APLI
\APLn\APLc\APLo\APLm\APLe\APLspace\APLs\APLt\APLa\APLt\APLe\APLm
\APLe\APLn\APLt\APLquote\APLspace\APLquote\APLI\APLN\APLC\APLO
\APLM\APLE\APLquote
\end{APLfnsline}
\begin{APLfnsline}{}{\APLdel}

\end{APLfnsline}
\end{APLfns}
%
% d1.tex
%
\clearpage

%
% \input{d2}
%
%
% d2.tex
%
% D2 NEW_CLOSING_ORDER
\begin{APLfns}
\begin{APLfnsline}{}{\APLdel}
\APLZ\APLleftarrow\APLN\APLE\APLW\protect\APLunderbar\APLC
\APLL\APLO\APLS\APLI\APLN\APLG\protect\APLunderbar\APLO\APLR
\APLD\APLE\APLR
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLrightbracket}{}
\APLZ\APLleftarrow\APLleftshoe\APLquote\APLE\APLX\APLP\APLE
\APLN\APLS\APLE\APLquote\APLspace\APLquote\APLA\APLnine
\APLseven\APLtwo\APLquote\APLspace\APLquote\APLleftparen\APLc\APLb
\APLrightparen\APLquote\APLspace\APLquote\APLleftparen\APLc\APLb
\APLrightparen\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLtwo\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLcomma\APLleftshoe\APLquote\APLR
\APLE\APLV\APLE\APLN\APLU\APLE\APLquote\APLspace\APLquote\APLA
\APLnine\APLseven\APLtwo\APLquote\APLspace\APLquote\APLleftparen
\APLc\APLb\APLrightparen\APLquote\APLspace\APLquote
\APLleftparen\APLc\APLb\APLrightparen\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLthree\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLcomma\APLleftshoe\APLquote\APLI
\APLN\APLC\APLO\APLM\APLE\APLquote\APLspace\APLquote\APLA
\APLnine\APLsix\APLnine\APLquote\APLspace\APLquote\APLN\APLe\APLt
\APLspace\APLi\APLn\APLc\APLo\APLm\APLe\APLquote\APLspace\APLquote
\APLL\APLo\APLs\APLs\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLfour\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLcomma\APLleftshoe\APLquote\APLS
\APLO\APLL\APLE\protect\APLunderbar\APLP\APLR\APLO\APLP\APLR
\APLI\APLE\APLT\APLO\APLR\APLS\APLH\APLI\APLP\APLquote\APLspace
\APLquote\APLA\APLnine\APLone\APLzero\APLquote\APLspace\APLquote
\APLC\APLa\APLp\APLi\APLt\APLa\APLl\APLquote\APLspace\APLquote
\APLD\APLr\APLa\APLw\APLi\APLn\APLg\APLs\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLfive\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLcomma\APLleftshoe\APLquote\APLP
\APLA\APLR\APLT\APLN\APLE\APLR\APLS\APLH\APLI\APLP\APLquote
\APLspace\APLquote\APLA\APLnine\APLseven\APLone\APLquote\APLspace
\APLquote\APLleftparen\APLc\APLb\APLrightparen\APLquote\APLspace
\APLquote\APLleftparen\APLc\APLb\APLrightparen\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLsix\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLcomma\APLleftshoe\APLquote\APLC
\APLO\APLR\APLP\APLO\APLR\APLA\APLT\APLI\APLO\APLN\APLquote
\APLspace\APLquote\APLA\APLnine\APLseven\APLone\APLquote\APLspace
\APLquote\APLleftparen\APLc\APLb\APLrightparen\APLquote\APLspace
\APLquote\APLleftparen\APLc\APLb\APLrightparen\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLseven\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLcomma\APLleftshoe\APLquote\APLO
\APLW\APLN\protect\APLunderbar\APLE\APLQ\APLU\APLI\APLT\APLY
\APLquote\APLspace\APLquote\APLA\APLnine\APLseven\APLone\APLquote
\APLspace\APLquote\APLleftparen\APLc\APLb\APLrightparen
\APLquote\APLspace\APLquote\APLleftparen\APLc\APLb\APLrightparen
\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLeight\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLcomma\APLleftshoe\APLquote\APLS
\APLU\APLP\APLP\APLL\APLI\APLE\APLR\APLquote\APLspace\APLquote
\APLA\APLthree\APLthree\APLzero\APLquote\APLspace\APLquote
\APLleftparen\APLc\APLb\APLrightparen\APLquote\APLspace\APLquote
\APLleftparen\APLc\APLb\APLrightparen\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLnine\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLcomma\APLleftshoe\APLquote\APLL
\APLI\APLA\APLB\APLI\APLL\APLI\APLT\APLY\APLquote\APLspace
\APLquote\APLA\APLnine\APLseven\APLone\APLquote\APLspace\APLquote
\APLleftparen\APLc\APLb\APLrightparen\APLquote\APLspace\APLquote
\APLleftparen\APLc\APLb\APLrightparen\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLzero\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLcomma\APLleftshoe\APLquote\APLA
\APLS\APLS\APLE\APLT\APLquote\APLspace\APLquote\APLA\APLnine
\APLseven\APLone\APLquote\APLspace\APLquote\APLleftparen\APLc\APLb
\APLrightparen\APLquote\APLspace\APLquote\APLleftparen\APLc
\APLb\APLrightparen\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLone\APLrightbracket}{}
\APLZ\APLleftarrow\APLZ\APLcomma\APLleftshoe\APLquote\APLB
\APLO\APLO\APLK\APLquote\APLspace\APLquote\APLA\APLnine\APLseven
\APLone\APLquote\APLspace\APLquote\APLdot\APLquote\APLspace
\APLquote\APLdot\APLquote
\end{APLfnsline}
\begin{APLfnsline}{}{\APLdel}

\end{APLfnsline}
\end{APLfns}
%
% d2.tex
%

\section{The Direct Definition Compiler} \label{ddcomp}

The direct definition compiler has been taken from \cite{iverson} and
adopted for niladic functions. This direct definition compiler does
not compile user defined operators and it does no tail recursive
optimization. The operator COLLECT has been translated and optimized
by hand.

%
% \input{e1}
%
%
% e1.tex
%
% E1 FIX
\begin{APLfns}
\begin{APLfnsline}{}{\APLdel}
\APLZ\APLleftarrow\APLF\APLI\APLX\APLspace\APLA\APLsemicolon
\APLC\APLnine\APLsemicolon\APLA\APLnine\APLsemicolon\APLF
\APLnine\APLsemicolon\APLV\APLnine
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLrightbracket}{}
\APLupshoejot\APLspace\APLK\APLdot\APLspace\APLE\APLdot
\APLspace\APLI\APLv\APLe\APLr\APLs\APLo\APLn\APLcomma\APLspace\APLN
\APLo\APLt\APLa\APLt\APLi\APLo\APLn\APLspace\APLa\APLs
\APLspace\APLa\APLspace\APLT\APLo\APLo\APLl\APLspace\APLo\APLf
\APLspace\APLT\APLh\APLo\APLu\APLg\APLh\APLt\APLcomma\APLspace\APLC
\APLA\APLC\APLM\APLcomma\APLspace\APLV\APLthree\APLtwo\APLcomma
\APLspace\APLN\APLeight\APLcomma\APLspace\APLone\APLnine
\APLeight\APLzero
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLtwo\APLrightbracket}{}
\APLC\APLnine\APLleftarrow\APLfive\APLspace\APLone\APLone
\APLrho\APLquote\APLspace\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLthree\APLrightbracket}{}
\APLC\APLnine\APLleftbracket\APLone\APLsemicolon
\APLrightbracket\APLleftarrow\APLquote\APLspace\APLspace\APLspace\APLZ
\APLnine\APLleftarrow\APLspace\APLspace\APLspace\APLspace\APLspace
\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLfour\APLrightbracket}{}
\APLC\APLnine\APLleftbracket\APLtwo\APLsemicolon
\APLrightbracket\APLleftarrow\APLquote\APLspace\APLY\APLnine\APLZ\APLnine
\APLleftarrow\APLspace\APLspace\APLspace\APLspace\APLspace
\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLfive\APLrightbracket}{}
\APLC\APLnine\APLleftbracket\APLthree\APLsemicolon
\APLrightbracket\APLleftarrow\APLquote\APLspace\APLY\APLnine\APLZ
\APLnine\APLleftarrow\APLX\APLnine\APLspace\APLspace\APLspace\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLsix\APLrightbracket}{}
\APLC\APLnine\APLleftbracket\APLfour\APLsemicolon
\APLrightbracket\APLleftarrow\APLquote\APLrightparen\APLslash\APLthree
\APLrightarrow\APLleftparen\APLzero\APLequal\APLone\APLuparrow
\APLcomma\APLspace\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLseven\APLrightbracket}{}
\APLC\APLnine\APLleftbracket\APLfive\APLsemicolon
\APLrightbracket\APLleftarrow\APLquote\APLspace\APLspace\APLspace
\APLrightarrow\APLzero\APLcomma\APLzero\APLrho\APLZ\APLnine
\APLleftarrow\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLeight\APLrightbracket}{}
\APLA\APLnine\APLleftarrow\APLseven\APLspace\APLnine\APLrho
\APLquote\APLzero\APLone\APLtwo\APLthree\APLfour\APLfive\APLsix
\APLseven\APLeight\APLnine\APLA\APLB\APLC\APLD\APLE\APLF\APLG
\APLH\APLI\APLJ\APLK\APLL\APLM\APLN\APLO\APLP\APLQ\APLR\APLS
\APLT\APLU\APLV\APLW\APLX\APLY\APLZ\APLuA\APLuB\APLuC\APLuD\APLuE
\APLuF\APLuG\APLuH\APLuI\APLuJ\APLuK\APLuL\APLuM\APLuN\APLuO
\APLuP\APLuQ\APLuR\APLuS\APLbr\APLuT\APLuU\APLuV\APLuW\APLuX
\APLbr\APLuY\APLuZ\APLquad\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLnine\APLrightbracket}{}
\APLV\APLnine\APLleftarrow\APLquote\APLD\APLleftarrow\APLF
\APLnine\APLspace\APLE\APLsemicolon\APLF\APLsemicolon\APLI
\APLsemicolon\APLK\APLquote\APLspace\APLquote\APLF\APLleftarrow
\APLleftparen\APLcomma\APLleftparen\APLE\APLequal\APLquote\APLquote
\APLomega\APLquote\APLquote\APLrightparen\APLjot\APLdot
\APLnotequal\APLfive\APLuparrow\APLone\APLrightparen\APLslash
\APLcomma\APLE\APLcomma\APLleftparen\APLcirclestile\APLfour\APLcomma
\APLrho\APLE\APLrightparen\APLrho\APLquote\APLquote\APLspace
\APLY\APLnine\APLspace\APLquote\APLquote\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLzero\APLrightbracket}{}
\APLV\APLnine\APLleftarrow\APLV\APLnine\APLcomma\APLleftshoe
\APLquote\APLF\APLleftarrow\APLleftparen\APLcomma\APLleftparen
\APLF\APLequal\APLquote\APLquote\APLalpha\APLquote\APLquote
\APLrightparen\APLjot\APLdot\APLnotequal\APLfive\APLuparrow
\APLone\APLrightparen\APLslash\APLcomma\APLF\APLcomma\APLleftparen
\APLcirclestile\APLfour\APLcomma\APLrho\APLF\APLrightparen
\APLrho\APLquote\APLquote\APLspace\APLX\APLnine\APLspace\APLquote
\APLquote\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLone\APLrightbracket}{}
\APLV\APLnine\APLleftarrow\APLV\APLnine\APLcomma\APLleftshoe
\APLquote\APLF\APLleftarrow\APLone\APLdownarrow\APLrho\APLD
\APLleftarrow\APLleftparen\APLzero\APLcomma\APLplus\APLslash
\protect\APLoverbar\APLsix\APLcomma\APLI\APLrightparen\APLdownarrow
\APLleftparen\APLbar\APLleftparen\APLthree\APLtimes\APLI
\APLrightparen\APLplus\APLplus\APLslope\APLI\APLleftarrow\APLquote
\APLquote\APLcolon\APLquote\APLquote\APLequal\APLF\APLrightparen
\APLcirclestile\APLF\APLcomma\APLleftparen\APLcirclestile
\APLsix\APLcomma\APLrho\APLF\APLrightparen\APLrho\APLquote\APLquote
\APLspace\APLquote\APLquote\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLtwo\APLrightbracket}{}
\APLV\APLnine\APLleftarrow\APLV\APLnine\APLcomma\APLleftshoe
\APLquote\APLD\APLleftarrow\APLthree\APLcirclestile\APLC
\APLnine\APLleftbracket\APLone\APLplus\APLleftparen\APLleftparen
\APLquote\APLquote\APLomega\APLquote\APLquote\APLepsilon\APLE
\APLrightparen\APLplus\APLquote\APLquote\APLalpha\APLquote\APLquote
\APLepsilon\APLE\APLrightparen\APLcomma\APLI\APLcomma\APLzero
\APLsemicolon\APLrightbracket\APLcomma\APLcircleslope\APLD
\APLleftbracket\APLsemicolon\APLone\APLcomma\APLleftparen\APLI
\APLleftarrow\APLtwo\APLdownarrow\APLiota\APLF\APLrightparen
\APLcomma\APLtwo\APLrightbracket\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLthree\APLrightbracket}{}
\APLV\APLnine\APLleftarrow\APLV\APLnine\APLcomma\APLleftshoe
\APLquote\APLK\APLleftarrow\APLK\APLplus\APLtwo\APLtimes\APLK
\APLless\APLone\APLcirclestile\APLK\APLleftarrow\APLI
\APLupcaret\APLK\APLepsilon\APLleftparen\APLgreater\APLslashbar\APLone
\APLspace\APLzero\APLcirclestile\APLquote\APLquote\APLleftarrow
\APLquad\APLquote\APLquote\APLjot\APLdot\APLequal\APLE
\APLrightparen\APLslash\APLK\APLleftarrow\APLplus\APLslope\APLtilde
\APLI\APLleftarrow\APLE\APLepsilon\APLA\APLnine\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLfour\APLrightbracket}{}
\APLV\APLnine\APLleftarrow\APLV\APLnine\APLcomma\APLleftshoe
\APLquote\APLF\APLleftarrow\APLleftparen\APLzero\APLcomma
\APLone\APLplus\APLrho\APLE\APLrightparen\APLupstile\APLrho\APLD
\APLleftarrow\APLD\APLcomma\APLleftparen\APLF\APLcomma\APLrho
\APLE\APLrightparen\APLuparrow\APLcircleslope\APLzero\APLspace
\protect\APLoverbar\APLtwo\APLdownarrow\APLK\APLcirclestile
\APLquote\APLquote\APLspace\APLquote\APLquote\APLcomma\APLE\APLcomma
\APLleftbracket\APLone\APLdot\APLfive\APLrightbracket\APLquote
\APLquote\APLsemicolon\APLquote\APLquote\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLfive\APLrightbracket}{}
\APLV\APLnine\APLleftarrow\APLV\APLnine\APLcomma\APLleftshoe
\APLquote\APLD\APLleftarrow\APLleftparen\APLF\APLuparrow\APLD
\APLrightparen\APLcomma\APLleftbracket\APLone\APLrightbracket
\APLF\APLleftbracket\APLtwo\APLrightbracket\APLuparrow\APLquote
\APLquote\APLupshoejot\APLquote\APLquote\APLcomma\APLE\APLquote
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLsix\APLrightbracket}{}
\APLV\APLnine\APLleftarrow\APLquad\APLF\APLX\APLspace\APLV
\APLnine
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone\APLseven\APLrightbracket}{}
\APLZ\APLleftarrow\APLquad\APLF\APLX\APLspace\APLF\APLnine
\APLspace\APLA
\end{APLfnsline}
\begin{APLfnsline}{}{\APLdel}

\end{APLfnsline}
\end{APLfns}
%
% e1.tex
%
\end{document}
%
% paper.tex
%

