aboutsummaryrefslogtreecommitdiff
path: root/src/hyper/pages/ug15.ht
blob: da2e0eca424f19ae8c62cc4993432584b2754054 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved.
% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk.

\texht{\setcounter{chapter}{14}}{} % Chapter 15 

%
\newcommand{\ugWhatsNewTitle}{What's New in \Language{} Version 2.0}
\newcommand{\ugWhatsNewNumber}{15.}
%
% =====================================================================
\begin{page}{ugWhatsNewPage}{15. What's New in \Language{} Version 2.0}
% =====================================================================
\beginscroll

Many things have changed in this new version of \Language{} and
we describe many of the more important topics here.

%------------------------------------------------------------------------
\beginmenu
    \menudownlink{{15.1. Important Things to Read First}}{ugWhatsNewImportantPage}
    \menudownlink{{15.2. The New \Language{} Library Compiler}}{ugWhatsNewAsharpPage}
    \menudownlink{{15.3. The NAG Library Link}}{nagLinkIntroPage}
    \menudownlink{{15.4. Interactive Front-end and Language}}{ugWhatsNewLanguagePage}
    \menudownlink{{15.5. Library}}{ugWhatsNewLibraryPage}
    \menudownlink{{15.6. \HyperName}}{ugWhatsNewHyperDocPage}
    \menudownlink{{15.7. Documentation}}{ugWhatsNewDocumentationPage}
\endmenu
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugWhatsNewImportantTitle}{Important Things to Read First}
\newcommand{\ugWhatsNewImportantNumber}{15.1.}
%
% =====================================================================
\begin{page}{ugWhatsNewImportantPage}{15.1. Important Things to Read First}
% =====================================================================
\beginscroll
%------------------------------------------------------------------------

If you have any private {\tt .spad} files (that is, library files
which were not shipped with \Language{}) you will need to
recompile them.  For example, if you wrote the file {\tt
regress.spad} then you should issue {\tt )compile regress.spad}
before trying to use it.

The internal representation of \axiomType{Union}  has changed. 
This means that \texht{\linebreak}{} \Language{} data saved 
with Release 1.x may not
be readable by this Release. If you cannot recreate the saved data      
by recomputing in Release 2.0, please contact NAG for assistance.       

%------------------------------------------------------------------------
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugWhatsNewAsharpTitle}{The New \Language{} Library Compiler}
\newcommand{\ugWhatsNewAsharpNumber}{15.2.}
%
% =====================================================================
\begin{page}{ugWhatsNewAsharpPage}{15.2. The New \Language{} Library Compiler}
% =====================================================================
\beginscroll
%------------------------------------------------------------------------

A new compiler is now available for \Language{}.
The programming language is referred to as the \Language{} Extension Language
(or \axiomxl{} for short), and
improves upon the old \Language{} language in many ways.
The \spadcmd{)compile} command has been upgraded to be able to
invoke the new or old compilers.
The language and the compiler are described in the hard-copy
documentation which came with your \Language{} system.

To ease the chore of upgrading your {\it .spad} files (old
compiler) to {\it .as} files (new compiler), the
\spadcmd{)compile} command has been given a {\tt )translate}
option. This invokes a special version of the old compiler which
parses and analyzes your old code and produces augmented code
using the new syntax.
Please be aware that the translation is not necessarily one
hundred percent complete or correct.
You should attempt to compile the output with the \axiomxl{} compiler
and make any necessary corrections.


\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\nagLinkIntroTitle}{The NAG Library Link}
\newcommand{\nagLinkIntroNumber}{15.3.}
%
% =====================================================================
\begin{page}{nagLinkIntroPage}{15.3. The NAG Library Link}
% =====================================================================
\beginscroll

The \naglib{} link allows you to call NAG Fortran
routines from within \Language{}, passing \Language{} objects as parameters
and getting them back as results.

The \naglib{} and, consequently, the link are divided into {\em chapters},
which cover different areas of numerical analysis.  The statistical
and sorting {\em chapters} of the Library, however, are not included in the
link and various support and utility routines (mainly the F06 and X
{\em chapters}) have been omitted.

Each {\em chapter} has a short (at most three-letter) name;
for example, the {\em chapter} devoted to the
solution of ordinary differential equations is called D02.  When
using the link via the \downlink{\HyperName{} interface}{htxl1},
you will be presented with a complete menu of these {\em chapters}. The
names of individual routines within each {\em chapter} are formed by
adding three letters to the {\em chapter} name, so for example the routine
for solving ODEs by Adams method is called
\axiomFunFrom{d02cjf}{NagOrdinaryDifferentialEquationsPackage}.

\beginmenu
    \menudownlink{{15.3.1. Interpreting NAG Documentation}}{nagDocumentationPage}
    \menudownlink{{15.3.2. Using the Link}}{nagLinkUsagePage}
    \menudownlink{{15.3.3. Providing values for Argument Subprograms}}{aspSectionPage}
    \menudownlink{{15.3.4. General Fortran-generation utilities in \Language{}}}{generalFortranPage}
    \menudownlink{{15.3.5. Some technical information}}{nagTechnicalPage}
\endmenu
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\nagDocumentationTitle}{Interpreting NAG Documentation}
\newcommand{\nagDocumentationNumber}{15.3.1.}
%
% =====================================================================
\begin{page}{nagDocumentationPage}{15.3.1. Interpreting NAG Documentation}
% =====================================================================
\beginscroll

Information about using the \naglib{} in general, and about using
individual routines in particular, can be accessed via \HyperName{}.
This documentation refers to the Fortran routines directly; the
purpose of this subsection is to explain how this corresponds to the
\Language{} routines.

For general information about the \naglib{} users should consult
\downlink{Essential Introduction to the NAG Foundation Library}{manpageXXintro}.
The documentation is in ASCII format, and a description of the conventions
used to represent mathematical symbols is given in
\downlink{Introduction to NAG On-Line Documentation}{manpageXXonline}.
Advice about choosing a routine from a particular {\em chapter} can be found in
the \downlink{Chapter Documents}{FoundationLibraryDocPage}.

\subsubsection{Correspondence Between Fortran and \Language{} types}

The NAG documentation refers to the Fortran types of objects; in
general, the correspondence to \Language{} types is as follows.
\indent{4}
\beginitems
\item[-] Fortran INTEGER corresponds to \Language{} \axiomType{Integer}.
\item[-] Fortran DOUBLE PRECISION corresponds to \Language{} \axiomType{DoubleFloat}.
\item[-] Fortran COMPLEX corresponds to \Language{} \axiomType{Complex DoubleFloat}.
\item[-] Fortran LOGICAL corresponds to \Language{} \axiomType{Boolean}.
\item[-] Fortran CHARACTER*(*) corresponds to \Language{} \axiomType{String}.
\enditems
\indent{0}
(Exceptionally, for NAG EXTERNAL parameters -- ASPs in link parlance
-- REAL and COMPLEX correspond to \axiomType{MachineFloat} and \axiomType{MachineComplex},
respectively; see \downlink{``\aspSectionTitle''}{aspSectionPage} in Section \aspSectionNumber\ignore{aspSection}.)

The correspondence for aggregates is as follows.
\indent{4}
\beginitems
\item[-] A one-dimensional Fortran array corresponds to an \Language{} \texht{\linebreak}{}
      \axiomType{Matrix} with one column.
\item[-] A two-dimensional Fortran ARRAY corresponds to an \Language{} \texht{\linebreak}{}
      \axiomType{Matrix}.
\item[-] A three-dimensional Fortran ARRAY corresponds to an \Language{} \texht{\linebreak}{}
      \axiomType{ThreeDimensionalMatrix}.
\enditems
\indent{0}
Higher-dimensional arrays are not currently needed for the \naglib{}.

Arguments which are Fortran FUNCTIONs or SUBROUTINEs correspond
to special ASP domains in \Language{}. See \downlink{``\aspSectionTitle''}{aspSectionPage} in Section \aspSectionNumber\ignore{aspSection}.

\subsubsection{Classification of NAG parameters}

NAG parameters are classified as belonging to one (or more)
of the following categories: {\tt Input}, {\tt Output}, {\tt Workspace} or {\tt External} procedure.
Within {\tt External} procedures a similar classification is used, and parameters
may also be {\tt Dummies}, or {\tt User Workspace} (data structures not used by the
NAG routine but provided for the convenience of the user).

When calling a NAG routine via the link the user only provides values
for {\tt Input} and {\tt External} parameters.

The order of the parameters is, in general, different from  the order
specified in the \naglib{} documentation. The Browser description
for each routine helps in determining the correspondence. As a rule of
thumb, {\tt Input} parameters come first followed by {\tt Input/Output}
parameters. The {\tt External} parameters are always found at the end.


\subsubsection{IFAIL}

NAG routines often return diagnostic information through a parameter called
\axiom{ifail}.  With a few exceptions, the principle is that on input
\axiom{ifail} takes
one of the values $-1,0,1$.  This determines how the routine behaves when
it encounters an error:
\indent{4}
\beginitems
\item[-] a value of 1 causes the NAG routine to return without printing an error
message;
\item[-] a value of 0 causes the NAG routine to print an error message and abort;
\item[-] a value of -1 causes the NAG routine to return and print an error message.
\enditems
\indent{0}

The user is STRONGLY ADVISED to set \axiom{ifail} to \texht{$-1$}{-1} when using the link.
If \axiom{ifail} has been set to \texht{$1$}{1} or \texht{$-1$}{-1} on input, then its value on output
will determine the possible cause of any error.  A value of \texht{$0$}{0} indicates
successful completion, otherwise it provides an index into a table of
diagnostics provided as part of the routine documentation (accessible via
\Browse{}).

\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\nagLinkUsageTitle}{Using the Link}
\newcommand{\nagLinkUsageNumber}{15.3.2.}
%
% =====================================================================
\begin{page}{nagLinkUsagePage}{15.3.2. Using the Link}
% =====================================================================
\beginscroll

The easiest way to use the link is via the
\downlink{\HyperName{} interface}{htxl1}.
You will be presented with a set of fill-in forms where
you can specify the parameters for each call.  Initially, the forms
contain example values, demonstrating the use of each routine (these,
in fact, correspond to the standard NAG example program for the
routine in question).  For some parameters, these values can provide
reasonable defaults; others, of course, represent data.  When you
change a parameter which controls the size of an array, the data in
that array are reset to a ``neutral'' value -- usually zero.

When you are satisfied with the values entered, clicking on the
``Continue'' button will display the \Language{} command needed to
run the chosen NAG routine with these values.  Clicking on the
``Do It'' button will then cause \Language{} to execute this command
and return the result in the parent \Language{} session, as described
below.  Note that, for some routines, multiple HyperDoc ``pages'' are
required, due to the structure of the data.  For these, returning to
an earlier page causes HyperDoc to reset the later pages (this is a
general feature of HyperDoc); in such a case, the simplest way to
repeat a call, varying a parameter on an earlier page, is probably to
modify the call displayed in the parent session.

An alternative approach is to call NAG routines directly in your
normal \Language{} session (that is, using the \Language{}
interpreter).  Such calls return an
object of type \axiomType{Result}.  As not
all parameters in the underlying NAG routine are required in the
AXIOM call (and the parameter ordering may be different), before
calling a NAG routine you should consult the description of the
\Language{} operation in the Browser.  (The quickest route to this
is to type the routine name, in lower case, into the Browser's
input area, then click on {\tt Operations}.)  The parameter names
used coincide with NAG's, although they will appear here in lower
case.  Of course, it is also possible to become familiar with the
\Language{} form of a routine by first using it through the
\downlink{\HyperName{} interface}{htxl1}.

\xtc{
As an example of this mode of working, we can find a zero
of a function, lying between 3 and 4, as follows:
}{
\spadpaste{answer:=c05adf(3.0,4.0,1.0e-5,0.0,-1,sin(X)::ASP1(F))\bound{answer} }
}
\xtc{
By default, \axiomType{Result} only displays the type of returned values,
since the amount of information returned can be quite large.  Individual
components can be examined as follows:
}{
\spadpaste{answer . x\free{answer}}
}
\xtc{
}{
\spadpaste{answer . ifail\free{answer}}
}
\xtc{
In order to avoid conflict with names defined in the workspace, you can also
get the values by using the \axiomType{String} type (the interpreter automatically
coerces them to \axiomType{Symbol})
}{
\spadpaste{answer "x"\free{answer}}
}


It is possible to have \Language{} display the values of scalar or array
results automatically.  For more details, see the commands  
\axiomFunFrom{showScalarValues}{Result}
and \axiomFunFrom{showArrayValues}{Result}.

\xtc{
There is also a {\bf .input} file for each NAG routine, containing
\Language{} interpreter commands to set up and run the standard NAG
example for that routine.
}{
\spadpaste{)read c05adf.input}
}

\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\aspSectionTitle}{Providing values for Argument Subprograms}
\newcommand{\aspSectionNumber}{15.3.3.}
%
% =====================================================================
\begin{page}{aspSectionPage}{15.3.3. Providing values for Argument Subprograms}
% =====================================================================
\beginscroll

There are a number of ways in which users can provide values for argument
subprograms (ASPs).  At the top level the user will see that NAG routines
require
an object from the \axiomType{Union} of a \axiomType{Filename} and an ASP.
\xtc{
For example \axiomFun{c05adf} requires an object of type \texht{\linebreak}{}
\axiomType{Union}(fn: \axiomType{FileName},fp: \axiomType{Asp1 F})
}{
\spadpaste{)display operation c05adf}
}

The user thus has a choice of providing the name of a file containing
Fortran source code, or of somehow generating the ASP within \Language{}.
If a filename is specified, it is searched for in the {\it local} 
machine, i.e., the machine that \Language{} is running on.

\subsubsection{Providing ASPs via \axiomType{FortranExpression}}

The \axiomType{FortranExpression} domain is used to represent expressions
which can be translated into Fortran under certain circumstances.    It is
very similar to \axiomType{Expression} except that only operators which exist
in Fortran can be used, and only certain variables can occur.
For
example the instantiation \axiomType{FortranExpression([X],[M],MachineFloat)}
is the domain of expressions containing the scalar \axiom{X} and the array
\axiom{M}.
\xtc{
This allows us to create expressions like:
}{
\spadpaste{f : FortranExpression([X],[M],MachineFloat) := sin(X)+M[3,1]}
}
\xtc{
but not
}{
\spadpaste{f : FortranExpression([X],[M],MachineFloat) := sin(M)+Y}
}

Those ASPs which represent expressions usually export a \axiomFun{coerce} from
an appropriate instantiation of \axiomType{FortranExpression} (or perhaps
\axiomType{Vector FortranExpression} etc.).  For convenience there are also
retractions from appropriate instantiations of \axiomType{Expression},
\axiomType{Polynomial} and \axiomType{Fraction Polynomial}.

\subsubsection{Providing ASPs via \axiomType{FortranCode}}

\texht{\exptypeindex{FortranCode}}{}
\axiomType{FortranCode} allows us to build arbitrarily complex ASPs via a
kind of pseudo-code.  It is described fully in
\downlink{``\generalFortranTitle''}{generalFortranPage} in Section \generalFortranNumber\ignore{generalFortran}.

Every ASP exports two \axiomFun{coerce} functions: one from
\axiomType{FortranCode} and one from \axiomType{List FortranCode}.  There
is also a \axiomFun{coerce} from \texht{\linebreak}{}
\axiomType{Record( localSymbols: SymbolTable, code: List FortranCode)}
which is used for passing extra symbol information about the ASP.

\xtc{
So for example, to integrate the function abs(x) we could use the built-in
\axiomFun{abs} function.  But suppose we want to get back to basics and define
it directly, then we could do the following:
}{
\spadpaste{d01ajf(-1.0, 1.0, 0.0, 1.0e-5, 800, 200, -1, cond(LT(X,0), assign(F,-X), assign(F,X))) result }
}
The \axiomFunFrom{cond}{FortranCode} operation creates a conditional clause
and the \axiomFunFrom{assign}{FortranCode} an assignment statement.

\subsubsection{Providing ASPs via \axiomType{FileName}}

Suppose we have created the file ``asp.f'' as follows:
\begin{verbatim}
      DOUBLE PRECISION FUNCTION F(X)
      DOUBLE PRECISION X
      F=4.0D0/(X*X+1.0D0)
      RETURN
      END
\end{verbatim}
and wish to pass it to the NAG
routine \axiomFun{d01ajf} which performs one-dimensional quadrature.
We can do this as follows:
\begin{verbatim}
d01ajf(0.0 ,1.0, 0.0, 1.0e-5, 800, 200, -1, "asp.f")
\end{verbatim}

\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\generalFortranTitle}{General Fortran-generation utilities in \Language{}}
\newcommand{\generalFortranNumber}{15.3.4.}
%
% =====================================================================
\begin{page}{generalFortranPage}{15.3.4. General Fortran-generation utilities in \Language{}}
% =====================================================================
\beginscroll

This section describes more advanced facilities which are available to users
who wish to generate Fortran code from within \Language{}.  There are
facilities to manipulate templates, store type information, and generate
code fragments or complete programs.

\subsubsection{Template Manipulation}

A template is a skeletal program which is ``fleshed out'' with data when
it is processed.  It is a sequence of {\em active} and {\em passive} parts:
active parts are sequences of \Language{} commands which are processed as if they
had been typed into the interpreter; passive parts are simply echoed
verbatim on the Fortran output stream.

Suppose, for example, that we have the following template, stored in
the file ``test.tem'':
\begin{verbatim}
-- A simple template
beginVerbatim
      DOUBLE PRECISION FUNCTION F(X)
      DOUBLE PRECISION X
endVerbatim
outputAsFortran("F",f)
beginVerbatim
      RETURN
      END
endVerbatim
\end{verbatim}
The passive parts lie between the two
tokens {\tt beginVerbatim} and \texht{\linebreak}{} {\tt endVerbatim}.  There
are two active statements: one which is simply an \Language{} (
\texht{\verb+--+}{\-\-})
comment, and one which produces an assignment to the current value
of {\tt f}.  We could use it as follows:
\begin{verbatim}
(4) ->f := 4.0/(1+X**2)

           4
   (4)   ------
          2
         X  + 1
                       
(5) ->processTemplate "test.tem"
      DOUBLE PRECISION FUNCTION F(X)
      DOUBLE PRECISION X
      F=4.0D0/(X*X+1.0D0)
      RETURN 
      END

   (5)  "CONSOLE"
\end{verbatim}

(A more reliable method of specifying the filename will be introduced
below.)  Note that the Fortran assignment {\tt F=4.0D0/(X*X+1.0D0)}
automatically converted 4.0 and 1 into DOUBLE PRECISION numbers; in
general, the \Language{} Fortran generation facility will convert
anything which should be a floating point object into either
a Fortran REAL or DOUBLE PRECISION object.
\xtc{
Which alternative is used is determined by the command
}{
\spadpaste{)set fortran precision}
}

It is sometimes useful to end a template before the file itself ends (e.g. to
allow the template to be tested incrementally or so that a piece of text
describing how the template works can be included).  It is of course possible
to ``comment-out'' the remainder of the file.  Alternatively, the single token
{\tt endInput} as part of an active portion of the template will cause
processing to be ended prematurely at that point.

The \axiomFun{processTemplate} command comes in two flavours.  In the first case,
illustrated above, it takes one argument of domain \axiomType{FileName},
the name of the template to be processed, and writes its output on the
current Fortran output stream.  In general, a filename can be generated
from {\em directory}, {\em name} and {\em extension} components, using
the operation \axiomFun{filename}, as in
\begin{verbatim}
processTemplate filename("","test","tem")
\end{verbatim}
There is an alternative version of \axiomFun{processTemplate}, which
takes two arguments (both of domain \axiomType{FileName}).  In this case the
first argument is the name of the template to be processed, and the
second is the file in which to write the results.  Both versions return
the location of the generated Fortran code as their result
({\tt "CONSOLE"} in the above example).

It is sometimes useful to be able to mix active and passive parts of a
line or statement.  For example you might want to generate a Fortran
Comment describing your data set.  For this kind of application we
provide three functions as follows:
\texht
{
\begin{tabular}{p{1.8in}p{2.6in}}
\axiomFun{fortranLiteral} & writes a string on the Fortran output stream \\
 & \\
\axiomFun{fortranCarriageReturn} & writes a carriage return on the Fortran output stream \\
& \\
\axiomFun{fortranLiteralLine} & writes a string followed by a return
on the Fortran output stream \\
\end{tabular}
}
{
\newline
\axiomFun{fortranLiteral}\tab{25}writes a string on the Fortran output stream\newline
\axiomFun{fortranCarriageReturn}\tab{25}writes a carriage return on the Fortran output stream\newline
\axiomFun{fortranLiteralLine}\tab{25}writes a string followed by a return on the Fortran output stream\newline
}
\xtc{
So we could create our comment as follows:
}{
\spadpaste{m := matrix [[1,2,3],[4,5,6]]\bound{m}}
}
\xtc{
}{
\spadpaste{fortranLiteralLine concat ["C\ \ \ \ \ \ The\ Matrix\ has\ ", nrows(m)::String, "\ rows\ and\ ", ncols(m)::String, "\ columns"]\free{m}}
}
\xtc{
or, alternatively:
}{
\spadpaste{fortranLiteral "C\ \ \ \ \ \ The\ Matrix\ has\ "}
}
\xtc{
}{
\spadpaste{fortranLiteral(nrows(m)::String)}
}
\xtc{
}{
\spadpaste{fortranLiteral "\ rows\ and\ "}
}
\xtc{
}{
\spadpaste{fortranLiteral(ncols(m)::String)\free{m}}
}
\xtc{
}{
\spadpaste{fortranLiteral "\ columns"}
}
\xtc{
}{
\spadpaste{fortranCarriageReturn()}
}

We should stress that these functions, together with the \axiomFun{outputAsFortran}
function are the {\em only} sure ways
of getting output to appear on the Fortran output stream.  Attempts to use
\Language{} commands such as \axiomFun{output} or \axiomFunX{writeline} may appear to give
the required result when displayed on the console, but will give the wrong
result when Fortran and algebraic output are sent to differing locations.  On
the other hand, these functions can be used to send helpful messages to the
user, without interfering with the generated Fortran.

\subsubsection{Manipulating the Fortran Output Stream}
\texht{\exptypeindex{FortranOutputStackPackage}}{}

Sometimes it is useful to manipulate the Fortran output stream in a program,
possibly without being aware of its current value.  The main use of this is
for gathering type declarations (see ``Fortran Types'' below) but it can be useful
in other contexts as well.  Thus we provide a set of commands to manipulate
a stack of (open) output streams.  Only one stream can be written to at
any given time.  The stack is never empty---its initial value is the
console or the current value of the Fortran output stream, and can be
determined using
\xtc{
}{
\spadpaste{topFortranOutputStack()}
}
(see below).
The commands available to manipulate the stack are:
\texht{
\begin{tabular}{ll}
\axiomFun{clearFortranOutputStack} & resets the stack to the console \\
 & \\
\axiomFun{pushFortranOutputStack} & pushes a \axiomType{FileName} onto the stack \\
 & \\
\axiomFun{popFortranOutputStack} & pops the stack \\
 & \\
\axiomFun{showFortranOutputStack} & returns the current stack \\
 & \\
\axiomFun{topFortranOutputStack} & returns the top element of the stack \\
\end{tabular}
}
{
\newline
\axiomFun{clearFortranOutputStack}\tab{25}resets the stack\newline
\axiomFun{pushFortranOutputStack}\tab{25}pushes a \axiomType{FileName} onto the stack\newline
\axiomFun{popFortranOutputStack}\tab{25}pops the stack\newline
\axiomFun{showFortranOutputStack}\tab{25}returns the current stack\newline
\axiomFun{topFortranOutputStack}\tab{25}returns the top element of the stack\newline
}
These commands are all part of \axiomType{FortranOutputStackPackage}.

\subsubsection{Fortran Types}

When generating code it is important to keep track of the Fortran types of
the objects which we are generating.  This is useful for a number of reasons,
not least to ensure that we are actually generating legal Fortran code.  The
current type system is built up in several layers, and we shall describe each
in turn.

\subsubsection{FortranScalarType}
\texht{\exptypeindex{FortranScalarType}}{}

This domain represents the simple Fortran datatypes: REAL, DOUBLE PRECISION,
COMPLEX, LOGICAL, INTEGER, and CHARACTER.
It is possible to \axiomFun{coerce} a \axiomType{String} or \axiomType{Symbol}
into the domain, test whether two objects are equal, and also apply
the predicate functions \axiomFunFrom{real?}{FortranScalarType} etc.

\subsubsection{FortranType}
\texht{\exptypeindex{FortranType}}{}

This domain represents ``full'' types: i.e., datatype plus array dimensions
(where appropriate) plus whether or not the parameter is an external
subprogram.  It is possible to \axiomFun{coerce} an object of
\axiomType{FortranScalarType} into the domain or \axiomFun{construct} one
from an element of \axiomType{FortranScalarType}, a list of
\axiomType{Polynomial Integer}s (which can of course be simple integers or
symbols) representing its dimensions, and
a \axiomType{Boolean} declaring whether it is external or not.  The list
of dimensions must be empty if the \axiomType{Boolean} is {\tt true}.
The functions \axiomFun{scalarTypeOf}, \axiomFun{dimensionsOf} and
\axiomFun{external?} return the appropriate
parts, and it is possible to get the various basic Fortran Types via
functions like \axiomFun{fortranReal}.
\xtc{
For example:
}{
\spadpaste{type:=construct(real,[i,10],false)$FortranType}
}
\xtc{
or
}{
\spadpaste{type:=[real,[i,10],false]$FortranType\bound{type}}
}
\xtc{
}{
\spadpaste{scalarTypeOf type\free{type}}
}
\xtc{
}{
\spadpaste{dimensionsOf type\free{type}}
}
\xtc{
}{
\spadpaste{external?  type\free{type}}
}
\xtc{
}{
\spadpaste{fortranLogical()}
}
\xtc{
}{
\spadpaste{construct(integer,[],true)$FortranType}
}

\subsubsection{SymbolTable}
\texht{\exptypeindex{SymbolTable}}{}

This domain creates and manipulates a symbol table for generated Fortran code.
This is used by \axiomType{FortranProgram} to represent the types of objects in
a subprogram.  The commands available are:
\texht{
\begin{tabular}{ll}
\axiomFun{empty} & creates a new \axiomType{SymbolTable} \\
 & \\
\axiomFunX{declare} & creates a new entry in a table \\
 & \\
\axiomFun{fortranTypeOf} & returns the type of an object in a table \\
 & \\
\axiomFun{parametersOf} & returns a list of all the symbols in the table \\
 & \\
\axiomFun{typeList} & returns a list of all objects of a given type \\
 & \\
\axiomFun{typeLists} & returns a list of lists of all objects sorted by type \\
 & \\
\axiomFun{externalList} & returns a list of all {\tt EXTERNAL} objects \\
 & \\
\axiomFun{printTypes} & produces Fortran type declarations from a table\\
\end{tabular}
}
{
\newline
\axiomFun{empty}\tab{25}creates a new \axiomType{SymbolTable}\newline
\axiomFunX{declare}\tab{25}creates a new entry in a table \newline
\axiomFun{fortranTypeOf}\tab{25}returns the type of an object in a table \newline
\axiomFun{parametersOf}\tab{25}returns a list of all the symbols in the table \newline
\axiomFun{typeList}\tab{25}returns a list of all objects of a given type \newline
\axiomFun{typeLists}\tab{25}returns a list of lists of all objects sorted by type \newline
\axiomFun{externalList}\tab{25}returns a list of all {\tt EXTERNAL} objects \newline
\axiomFun{printTypes}\tab{25}produces Fortran type declarations from a table\newline
}
\xtc{
}{
\spadpaste{symbols := empty()$SymbolTable\bound{symbols}}
}
\xtc{
}{
\spadpaste{declare!(X,fortranReal(),symbols)\free{symbols}}
}
\xtc{
}{
\spadpaste{declare!(M,construct(real,[i,j],false)$FortranType,symbols)\free{symbols}}
}
\xtc{
}{
\spadpaste{declare!([i,j],fortranInteger(),symbols)\free{symbols}}
}
\xtc{
}{
\spadpaste{symbols\free{symbols}}
}
\xtc{
}{
\spadpaste{fortranTypeOf(i,symbols)\free{symbols}}
}
\xtc{
}{
\spadpaste{typeList(real,symbols)\free{symbols}}
}
\xtc{
}{
\spadpaste{printTypes symbols\free{symbols}}
}

\subsubsection{TheSymbolTable}
\texht{\exptypeindex{TheSymbolTable}}{}

This domain creates and manipulates one global symbol table to be used, for
example, during template processing. It is
also used when
linking to external Fortran routines. The
information stored for each subprogram (and the main program segment, where
relevant) is:
\indent{4}
\beginitems
\item[-] its name;
\item[-] its return type;
\item[-] its argument list;
\item[-] and its argument types.
\enditems
\indent{0}
Initially, any information provided is deemed to be for the main program
segment.
\xtc{
Issuing the following command indicates that from now on all information
refers to the subprogram \axiom{F}.
}{
\spadpaste{newSubProgram F}
}
\xtc{
It is possible to return to processing the main program segment by issuing
the command:
}{
\spadpaste{endSubProgram()}
}
The following commands exist:
\texht{
\begin{tabular}{p{1.6in}p{2.8in}}
\axiomFunX{returnType} & declares the return type of the current subprogram \\
 & \\
\axiomFun{returnTypeOf} & returns the return type of a subprogram \\
 & \\
\axiomFunX{argumentList} &  declares the argument list of the current subprogram \\
 & \\
\axiomFun{argumentListOf} &  returns the argument list of a subprogram \\
 & \\
\axiomFunX{declare} & provides type declarations for parameters of the current subprogram \\
 & \\
\axiomFun{symbolTableOf} & returns the symbol table  of a subprogram \\
 & \\
\axiomFun{printHeader} & produces the Fortran header for the current subprogram \\
\end{tabular}
}
{
\newline
\axiomFunX{returnType}\tab{25}declares the return type of the current subprogram \newline
\axiomFun{returnTypeOf}\tab{25}returns the return type of a subprogram \newline
\axiomFunX{argumentList}\tab{25}declares the argument list of the current subprogram \newline
\axiomFun{argumentListOf}\tab{25}returns the argument list of a subprogram \newline
\axiomFunX{declare}\tab{25}provides type declarations for parameters of the current subprogram \newline
\axiomFun{symbolTableOf}\tab{25}returns the symbol table  of a subprogram \newline
\axiomFun{printHeader}\tab{25}produce the Fortran header for the current subprogram \newline
}
In addition there are versions of these commands which are parameterised by
the name of a subprogram, and others parameterised by both the name of a
subprogram and by an instance of \axiomType{TheSymbolTable}.
\xtc{
}{
\spadpaste{newSubProgram F \bound{forPleasure}}
}
\xtc{
}{
\spadpaste{argumentList!(F,[X])\free{forPleasure}}
}
\xtc{
}{
\spadpaste{returnType!(F,real)\free{forPleasure}}
}
\xtc{
}{
\spadpaste{declare!(X,fortranReal(),F)\free{forPleasure}}
}
\xtc{
}{
\spadpaste{printHeader F\free{forPleasure}}
}

\subsubsection{Advanced Fortran Code Generation}

This section describes facilities for representing Fortran statements, and
building up complete subprograms from them.

\subsubsection{Switch}
\texht{\exptypeindex{Switch}}{}

This domain is used to represent statements like {\tt x < y}.  Although
these can be represented directly in \Language{}, it is a little cumbersome,
since \Language{} evaluates the last statement, for example, to \axiom{true}
(since \axiom{x} is  lexicographically less than \axiom{y}).

Instead we have a set of operations, such as \axiomFun{LT} to represent \axiom{<},
to let us build such statements.  The available constructors are:
\texht{
\centerline{{\begin{tabular}{ll}}}
\centerline{{\axiomFun{LT} & $<$ }}
\centerline{{\axiomFun{GT} & $>$ }}
\centerline{{\axiomFun{LE} & $\leq$ }}
\centerline{{\axiomFun{GE} & $\geq$ }}
\centerline{{\axiomFun{EQ} & $=$ }}
\centerline{{\axiomFun{AND} & $and$}}
\centerline{{\axiomFun{OR} & $or$ }}
\centerline{{\axiomFun{NOT} & $not$ }}
\centerline{{\end{tabular}}}
}
{
\newline
\axiomFun{LT}\tab{25}\texht{$<$}{<} \newline
\axiomFun{GT}\tab{25}\texht{$>$}{>} \newline
\axiomFun{LE}\tab{25}\texht{$\leq$}{<=} \newline
\axiomFun{GE}\tab{25}\texht{$\geq$}{>=} \newline
\axiomFun{EQ}\tab{25}\texht{$=$}{=} \newline
\axiomFun{AND}\tab{25}\texht{$and$}{{\tt and}}\newline
\axiomFun{OR}\tab{25}\texht{$or$}{{\tt or}} \newline
\axiomFun{NOT}\tab{25}\texht{$not$}{{\tt not}} \newline
}
\xtc{
So for example:
}{
\spadpaste{LT(x,y)}
}

\subsubsection{FortranCode}

This domain represents code segments or operations: currently assignments,
conditionals, blocks, comments, gotos, continues, various kinds of loops,
and return statements.
\xtc{
For example we can create quite a complicated conditional statement using
assignments, and then turn it into Fortran code:
}{
\spadpaste{c := cond(LT(X,Y),assign(F,X),cond(GT(Y,Z),assign(F,Y),assign(F,Z)))\bound{c}}
}
\xtc{
}{
\spadpaste{printCode c\free{c}}
}

The Fortran code is printed
on the current Fortran output stream.

\subsubsection{FortranProgram}
\texht{\exptypeindex{FortranProgram}}{}

This domain is used to construct complete Fortran subprograms out of
elements of \axiomType{FortranCode}.  It is parameterised by the name of the
target subprogram (a \axiomType{Symbol}), its return type (from
\axiomType{Union}(\axiomType{FortranScalarType},``void'')),
its arguments (from \axiomType{List Symbol}), and
its symbol table (from \axiomType{SymbolTable}).  One can
\axiomFun{coerce} elements of either \axiomType{FortranCode}
or \axiomType{Expression} into it.

\xtc{
First of all we create a symbol table:
}{
\spadpaste{symbols := empty()$SymbolTable\bound{symbols}}
}
\xtc{
Now put some type declarations into it:
}{
\spadpaste{declare!([X,Y],fortranReal(),symbols)\free{symbols}}
}
\xtc{
Then (for convenience)
we set up the particular instantiation of \axiomType{FortranProgram}
}{
\spadpaste{FP := FortranProgram(F,real,[X,Y],symbols)\free{symbols}\bound{FP}}
}
\xtc{
Create an object of type \axiomType{Expression(Integer)}:
}{
\spadpaste{asp := X*sin(Y)\bound{asp}}
}
\xtc{
Now \axiomFun{coerce} it into \axiomType{FP}, and print its Fortran form:
}{
\spadpaste{outputAsFortran(asp::FP)\free{FP asp}}
}

We can generate a \axiomType{FortranProgram} using \axiom{FortranCode}.  For
example:
\xtc{
Augment our symbol table:
}{
\spadpaste{declare!(Z,fortranReal(),symbols)\free{symbols}\bound{Z}}
}
\xtc{
and transform the conditional expression we prepared earlier:
}{
\spadpaste{outputAsFortran([c,returns()]::FP) \free{FP c Z}}
}

%------------------------------------------------------------------------
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\nagTechnicalTitle}{Some technical information}
\newcommand{\nagTechnicalNumber}{15.3.5.}
%
% =====================================================================
\begin{page}{nagTechnicalPage}{15.3.5. Some technical information}
% =====================================================================
\beginscroll
%------------------------------------------------------------------------

The model adopted for the link is a server-client configuration
-- \Language{} acting as a client via a local agent
(a process called {\tt nagman}). The server side is implemented
by the {\tt nagd} daemon process which may run on a different host.
The {\tt nagman} local agent is started by default whenever you
start \Language{}. The {\tt nagd} server must be started separately.
Instructions for installing and running the server are supplied
in \texht{\downlink{``\nugNagdTitle''}{nugNagdPage} in Section \nugNagdNumber\ignore{nugNagd}}{printed form}. 
Use the \spadcmd{)set naglink host} system command
to point your local agent to a server in your network.



On the \Language{} side, one sees a set of {\em packages}
(ask \Browse{} for {\em Nag*}) for each chapter, each exporting
operations with the same name as a routine in the \naglib{}.
The arguments and return value of each operation belong to
standard \Language{} types.

The {\tt man} pages for the \naglib{} are accessible via the description
of each operation in \Browse{} (among other places).

In the implementation of each operation, the set of inputs is passed
to the local agent {\tt nagman}, which makes a
Remote Procedure Call (RPC) to the
remote {\tt nagd} daemon process.  The local agent receives the RPC
results and forwards them to the \Language{} workspace where they
are interpreted appropriately.

How are Fortran subroutines turned into RPC calls?
For each Fortran routine in the \naglib{}, a C main() routine
is supplied.
Its job is to assemble the RPC input (numeric) data stream into
the appropriate Fortran data structures for the routine, call the Fortran
routine from C and serialize the results into an RPC output data stream.

Many \naglib{} routines accept ASPs (Argument Subprogram Parameters).
These specify user-supplied Fortran routines (e.g. a routine to
supply values of a function is required for numerical integration).
How are they handled? There are new facilities in \Language{} to help.
A set of \Language{} domains has been provided to turn values in standard
 \Language{} types (such as Expression Integer) into the appropriate
piece of Fortran for each case (a filename pointing to Fortran source
for the ASP can always be supplied instead).
Ask \Browse{} for {\em Asp*} to see these domains. The Fortran fragments
are included in the outgoing RPC stream, but {\tt nagd} intercepts them,
compiles them, and links them with the main() C program before executing
the resulting program on the numeric part of the RPC stream.


%------------------------------------------------------------------------
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugWhatsNewLanguageTitle}{Interactive Front-end and Language}
\newcommand{\ugWhatsNewLanguageNumber}{15.4.}
%
% =====================================================================
\begin{page}{ugWhatsNewLanguagePage}{15.4. Interactive Front-end and Language}
% =====================================================================
\beginscroll
%------------------------------------------------------------------------

The \axiom{leave} keyword has been replaced by the
\axiom{break} keyword for compatibility with the new \Language{}
extension language.
See section \downlink{``\ugLangLoopsBreakTitle''}{ugLangLoopsBreakPage} in Section \ugLangLoopsBreakNumber\ignore{ugLangLoopsBreak}
for more information.

Curly braces are no longer used to create sets. Instead, use
\axiomFun{set} followed by a bracketed expression. For example,
\xtc{
}{
\spadpaste{set [1,2,3,4]}
}

Curly braces are now used to enclose a block (see section
\downlink{``\ugLangBlocksTitle''}{ugLangBlocksPage} in Section \ugLangBlocksNumber\ignore{ugLangBlocks}
for more information). For compatibility, a block can still be 
enclosed by parentheses as well.

``Free functions'' created by the \axiomxl{} compiler can now be
loaded and used within the \Language{} interpreter. A {\it free
function} is a library function that is implemented outside a
domain or category constructor.

New coercions to and from type \axiomType{Expression} have been
added. For example, it is now possible to map a polynomial
represented as an expression to an appropriate polynomial type.

Various messages have been added or rewritten for clarity.

%------------------------------------------------------------------------
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugWhatsNewLibraryTitle}{Library}
\newcommand{\ugWhatsNewLibraryNumber}{15.5.}
%
% =====================================================================
\begin{page}{ugWhatsNewLibraryPage}{15.5. Library}
% =====================================================================
\beginscroll
%------------------------------------------------------------------------

The \axiomType{FullPartialFractionExpansion}
domain has been added. This domain computes factor-free full
partial fraction expansions.
See section
\downlink{`FullPartialFractionExpansion'}{FullPartialFractionExpansionXmpPage}\ignore{FullPartialFractionExpansion}
for examples.

We have implemented the Bertrand/Cantor algorithm for integrals of
hyperelliptic functions. This brings a major speedup for some
classes of algebraic integrals.

We have implemented a new (direct) algorithm for integrating trigonometric
functions. This brings a speedup and an improvement in the answer
quality.

The {\sf SmallFloat} domain has been renamed
\axiomType{DoubleFloat} and {\sf SmallInteger} has been renamed
\axiomType{SingleInteger}. The new abbreviations as
\axiomType{DFLOAT} and \axiomType{SINT}, respectively.
We have defined the macro {\sf SF}, the old abbreviation for {\sf
SmallFloat}, to expand to \axiomType{DoubleFloat} and modified
the documentation and input file examples to use the new names
and abbreviations. You should do the same in any private \Language{}
files you have.

There are many new categories, domains and packages related to the
NAG Library Link facility. See the file

\unixcommand{\env{AXIOM}/../../src/algebra/exposed.lsp}{xterm\ -e\ vi\ +"/naglink"\ \env{AXIOM}/../../src/algebra/exposed.lsp}

for a list of constructors in the {\bf naglink} \Language{} exposure group.

We have made improvements to the differential equation solvers
and there is a new facility for solving systems of first-order 
linear differential equations.
In particular, an important fix was made to the solver for
inhomogeneous linear ordinary differential equations that
corrected the calculation of particular solutions.
We also made improvements to the polynomial
and transcendental equation solvers including the
ability to solve some classes of systems of transcendental
equations.

The efficiency of power series have been improved and left and right
expansions of \spad{tan(f(x))} at \spad{x =} a pole of \spad{f(x)}
can now be computed.
A number of power series bugs were fixed and the \axiomType{GeneralUnivariatePowerSeries}
domain was added.
The power series variable can appear in the coefficients and when this
happens, you cannot differentiate or integrate the series.  Differentiation
and integration with respect to other variables is supported.

A domain was added for representing asymptotic expansions of a
function at an exponential singularity.

For limits, the main new feature is the exponential expansion domain used
to treat certain exponential singularities.  Previously, such singularities
were treated in an {\it ad hoc} way and only a few cases were covered.  Now
\Language{} can do things like

\begin{verbatim}
limit( (x+1)**(x+1)/x**x - x**x/(x-1)**(x-1), x = %plusInfinity)
\end{verbatim}

in a systematic way.  It only does one level of nesting, though.  In other
words, we can handle \spad{exp(} some function with a pole \spad{)}, but not
\texht{\linebreak}{} \spad{exp(exp(} some function with a pole \spad{)).}

The computation of integral bases has been improved through careful
use of Hermite row reduction. A P-adic algorithm
for function fields of algebraic curves in finite characteristic has also
been developed.

Miscellaneous:
There is improved conversion of definite and indefinite integrals to
\axiomType{InputForm};
binomial coefficients are displayed in a new way;
some new simplifications of radicals have been implemented;
the operation \spadfun{complexForm} for converting to rectangular coordinates
has been added;
symmetric product operations have been added to \axiomType{LinearOrdinaryDifferentialOperator}.

%------------------------------------------------------------------------
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugWhatsNewHyperDocTitle}{\HyperName}
\newcommand{\ugWhatsNewHyperDocNumber}{15.6.}
%
% =====================================================================
\begin{page}{ugWhatsNewHyperDocPage}{15.6. \HyperName}
% =====================================================================
\beginscroll
%------------------------------------------------------------------------

The buttons on the titlebar and scrollbar have been replaced
with ones which have a 3D effect. You can change the foreground and
background colors of these ``controls'' by including and modifying
the following lines in your {\bf .Xdefaults} file.
\begin{verbatim}
Axiom.hyperdoc.ControlBackground: White
Axiom.hyperdoc.ControlForeground: Black
\end{verbatim}

For various reasons, \HyperName{} sometimes displays a
secondary window. You can control the size and placement of this
window by including and modifying
the following line in your {\bf .Xdefaults} file.
%
\begin{verbatim}
Axiom.hyperdoc.FormGeometry: =950x450+100+0
\end{verbatim}
%
This setting is a standard X Window System geometry specification:
you are requesting a window 950 pixels wide by 450 deep and placed in
the upper left corner.

Some key definitions have been changed to conform more closely
with the CUA guidelines. Press
\texht{F9}{\downlink{F9}{ugHyperKeysPage}}
to see the current definitions.

Input boxes (for example, in the Browser) now accept paste-ins from
the X Window System. Use the second button to paste in something
you have previously copied or cut. An example of how you can use this
is that you can paste the type from an \Language{} computation
into the main Browser input box.


%------------------------------------------------------------------------
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugWhatsNewDocumentationTitle}{Documentation}
\newcommand{\ugWhatsNewDocumentationNumber}{15.7.}
%
% =====================================================================
\begin{page}{ugWhatsNewDocumentationPage}{15.7. Documentation}
% =====================================================================
\beginscroll
%------------------------------------------------------------------------
\texht{
We describe here a few additions to the on-line
version of the AXIOM book which you can read with
HyperDoc.
}{}

A section has been added to the graphics chapter, describing
how to build \twodim{} graphs from lists of points. An example is
given showing how to read the points from a file.
See section \downlink{``\ugGraphTwoDbuildTitle''}{ugGraphTwoDbuildPage} in Section \ugGraphTwoDbuildNumber\ignore{ugGraphTwoDbuild}
for details.

A further section has been added to that same chapter, describing
how to add a \twodim{} graph to a viewport which already
contains other graphs.
See section
\downlink{``\ugGraphTwoDappendTitle''}{ugGraphTwoDappendPage} in Section \ugGraphTwoDappendNumber\ignore{ugGraphTwoDappend}
for details.

Chapter 3 
and the on-line \HyperName{} help have been unified.

An explanation of operation names ending in ``?'' and ``!'' has
been added to the first chapter. 
See the
end of the section
\downlink{``\ugIntroCallFunTitle''}{ugIntroCallFunPage} in Section \ugIntroCallFunNumber\ignore{ugIntroCallFun}
for details.

An expanded explanation of using predicates has
been added to the sixth chapter. See the
example involving \userfun{evenRule} in the middle of the section
\downlink{``\ugUserRulesTitle''}{ugUserRulesPage} in Section \ugUserRulesNumber\ignore{ugUserRules}
for details.

Documentation for the \spadcmd{)compile}, \spadcmd{)library} and
\spadcmd{)load} commands has been greatly changed. This reflects
the ability of the \spadcmd{)compile} to now invoke the \axiomxl{}
compiler, the impending deletion of the \spadcmd{)load} command
and the new \spadcmd{)library} command.
The \spadcmd{)library} command replaces \spadcmd{)load} and is
compatible with the compiled output from both the old and new
compilers.

\endscroll
\autobuttons
\end{page}
%