File: faq

package info (click to toggle)
axiom 20170501-4
  • links: PTS
  • area: main
  • in suites: buster, sid
  • size: 1,048,504 kB
  • sloc: lisp: 3,600; makefile: 505; cpp: 223; ansic: 138; sh: 96
file content (1896 lines) | stat: -rw-r--r-- 67,408 bytes parent folder | download
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
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
FAQ  0: How do I use Axiom?
FAQ  1: X11 libraries not found
FAQ  2: axiom.sty is not found
FAQ  3: make hangs
FAQ  4: noweb needs to be rebuilt
FAQ  5: lisp needs to be rebuilt
FAQ  6: The interpreter is badly broken 
FAQ  7: The wrong version of GCL was used
FAQ  8: Parallel make (i.e. make -j) fails
FAQ  9: GCL does not build on my system: libbfd.a and bfd.a are missing
FAQ 10: The axiom.input file is ignored
FAQ 11: How do I add a new pamphlet file
FAQ 12: The axiom command fails.
FAQ 13: How can I create and access Lisp functions from Axiom?
FAQ 14: It still doesn't work
FAQ 15: How can I see what the interpreter is trying to do?
FAQ 16: How can I record console output?
FAQ 17: Graphics don't work or sman fails to start ?
FAQ 18: How can the user use the batch mode?
FAQ 19: How can I get equations written on one line?
FAQ 20: Axiom hangs when graphics should be displayed.
FAQ 21: How should I get my AXIOM shell variable and why?
FAQ 22: How do I check out the latest sources?
FAQ 23: How do I patch a file?
FAQ 24: What is the purpose of the domain HACKPI?
FAQ 25: Can I create or edit hypertex pages?
FAQ 26: How can I compile spad files on windows?
FAQ 27: Why can't I input text into the hypertex browser boxes?
FAQ 28: Graphics does not work inside TeXmacs?
FAQ 29: Where can I get help online?
FAQ 30: How can I file a bug report?
FAQ 31: How can I find out if this is a known bug
FAQ 32: How can I input an equation as a string?
FAQ 33: How can I run hypertex standalone?
FAQ 34: How can I find out about a domain?
FAQ 35: Why do .axiom.input defined functions fail in axiom?
FAQ 36: Axiom won't build on FC3
FAQ 37: Axiom won't build on FC4 or FC5
FAQ 38: How can I debug algebra code?
FAQ 39: How can I access lisp code from the Axiom command line?
FAQ 40: Text entry fails in the hypertex browser window
FAQ 41: How can I work in lisp from Axiom?
FAQ 42: How can I output equations as lisp s-expressions?
FAQ 43: Is Axiom's License compatible with the GPL?
FAQ 44: I don't have the math fonts
FAQ 45: Axiom copyright information
FAQ 46: Axiom trademark information
FAQ 47: Axiom won't build on Fedora 9 (SELinux)
FAQ 48: Getting Axiom sources from git
FAQ 49: How do I get the lastest GCL?
FAQ 50: Cannot find libXpm.a
FAQ 51: How can I do unicode in xterm?
FAQ 52: Who was User?
FAQ 53: Axiom won't build on Fedora

===================================================================
FAQ 0: How do I use Axiom?
===================================================================

Look at the online book. It is automatically built during the 'make'.
However, you can also do

make book

Either way, it will show up in

(yourpath)/axiom/mnt/linux/doc/book.dvi

===================================================================
FAQ 1: X11 libraries not found
===================================================================

You need to have Xlib.h to build the graphics. If you are building
on a RedHat 8 system you need to install the following RPM:

  rpm -i XFree86-devel-4.2.0-72.i386.rpm

On Debian GNU/Linux, the package 'xlibs-dev' is needed.

On Fedora 9: 
  yum install xorg-x11-proto-devel 
  rpm -i --nodeps libXt-devel-1.0.4-5.fc9.i386.rpm (for Intrinsics.h)

===================================================================
FAQ 2: axiom.sty is not found
===================================================================

The build of noweb creates 3 files in the mnt/linux/bin directory:
notangle, noweave, and tex/axiom.sty. The build of the src/scripts
directory copies the document command to the mnt/linux/bin
directory. These four files are necessary to rebuild a Makefile.

These can be recreated in a clean system by typing:

   make start


===================================================================
FAQ 3: make hangs
===================================================================

A pamphlet file was modified and has a syntax error.  The document
command has its output redirected to a file called
obj/linux/tmp/trace.  Latex has found the syntax error and put up a
prompt which stops the make. Look in this file for the error.  You can
also see the error by rerunning make thus:

   make NOISE=

which will override the redirection and allow the latex output to go
to the console.

If the make hangs during the test cases check to see if it occurs
while trying to run graphics. If Axiom does not have permission 
from the X server to open a window then it will hang. Try
'xhost +'

===================================================================
FAQ 4: noweb needs to be rebuilt
===================================================================

The first time noweb is built a dummy file called noweb
is written into the top level directory. If this file is
removed noweb will be rebuilt. The following sequence should work:

  rm noweb
  make noweb


===================================================================
FAQ 5: lisp needs to be rebuilt
===================================================================

The first time lisp is built a dummy file called gcldir
is written into the top level directory. If this file is
removed lisp will be rebuilt. The following sequence should work:

  rm lsp/gcldir
  make 


===================================================================
FAQ 6: The interpreter is badly broken
===================================================================

If you look in src/interp/Makefile.pamphlet you'll see a stanza that
is marked debugsys. You can add ${DEBUGSYS} to the "all" stanza, make
the system and run debugsys. This is a copy of the interpsys image
except that all of the files are interpreted.  Note that you will have
to edit src/interp/debugsys.lisp.pamphlet.  Read the comments
there. At this point you are able to do deep system internal debugging
(which pretty much assumes you know how to navigate the underground
caves in the dark without fear of dragons. If you can play the game at
this level send axiom-developer@nongnu.org a note and we'll inscribe 
your name on a log and throw it on the fire.)

The basic steps, which assumes that your axiom sources live under tmp/axiom
  0) cd /tmp/axiom 
  1) modify the line in src/interp/Makefile.pamphlet that reads:
        all: ${SAVESYS} ${DOCFILES} # ${DEBUGSYS} 
     to read:
        all: ${SAVESYS} ${DOCFILES} ${DEBUGSYS} 
  2) set up the standard AXIOM shell variable
        export AXIOM=/tmp/axiom/src/interp
  3) set up the standard PATH variable
        export PATH=$AXIOM/bin:$PATH
  4) build the system, including debugsys.lisp
        make
  5) tell debugsys where to find the databases
        export DAASE=$AXIOM
  6) tell debugsys which platform you are on
        export SYS=linux
  7) start a clean lisp image
        obj/linux/bin/lisp
  8) load the debugsys code which loads the axiom system interpreted
        (load "/tmp/axiom/int/interp/debugsys.lisp")
  9) switch to the package the interpreter uses
        (in-package "BOOT")
 10) start the system
        (restart)

and you now have a running Axiom that uses interpreted rather than
compiled code. This makes finding errors easier.
  

===================================================================
FAQ 7: The wrong version of GCL was used
===================================================================

If you are building a version of Axiom on GCL there are several tested
versions. The first is GCL-2.4.1 which is an version 1 Common Lisp.
GCL-2.5 is a version 2 Common Lisp. There is a shell variable called
GCLVERSION that must be changed to choose the version.  Be sure it is
set to either gcl-2.4.1, gcl-2.5 gcl-2.5.2, or gcl-2.6.1 as these are
the only known-good versions of GCL for Axiom.

===================================================================
FAQ 8: Parallel make (i.e. make -j) fails
===================================================================

This is a complex issue. In theory, in order to build the algebra
files we have a whole graph of constraints between the algebra files.
In order to bootstrap the algebra the whole graph of algebra files
need to be built in a particular order to ensure that the required
files exist. This would argue for including the constraint as part of
the makefile stanzas.

However, once the algebra is bootstrapped these constraints are
checked at compile and runtime so it is possible to recompile an
algebra file without compiling the files it depends upon.

If we decided to include the constraints on each stanza then we
gain the benefit that "make -j" works. However, if we later change
a single algebra file it may trigger a rebuild of the entire algebra
library unnecessarily. Since bootstrap happens only once but algebra
compiles happen often it was decided to elide the constraints. This
will cause "make -j" to fail on initial build but vastly improve
later builds.

===================================================================
FAQ 9: GCL does not build on my system: libbfd.a and bfd.a are missing
===================================================================

We are using the option \texttt{--enable-statsysbfd} when building GCL (see
lsp/Makefile) so libbfd.a and bfd.h files are necessary on your system.

On Debian GNU/Linux, the needed package is 'binutils-dev'.

===================================================================
FAQ 10: The axiom.input file is ignored
===================================================================

The standard startup file, "axiom.input", has been renamed to
".axiom.input" to follow convention. This is an incompatible change.
On unix-style systems a filename that begins with a period is not
normally printed in a directory listing. This keeps the user's home
directory from being cluttered up by initialization files.

===================================================================
FAQ 11: How do I add a new pamphlet file
===================================================================

Pamphlet files are the only file format used by Axiom at the source
level. There are several steps to adding a new file to ensure that
Axiom will build it properly.

First, you have to decide where it should reside. Almost all files
reside under the src subdirectory. Never put anything into lsp, int,
obj, or mnt as these will be destroyed by "make clean".

Assume you add a file that extends the interpreter and will
go into the src/interp] subdirectory. You must modify the
src/interp/Makefile.pamphlet to correctly build the file.

You must also modify src/doc/axiom.bib.pamphlet to include
the file. Axiom uses bibtex to cross-reference the various 
pamphlet files. The normal method of citing a file involves
just using the name, for example \cite{asq.c} will build
a citation to the ./src/etc/asq.c.pamphlet file.

You must include the following two lines in your pamphlet file:

\bibliographystyle{plain}
\bibliography{axiom}

===================================================================
FAQ 12: The axiom command fails.
===================================================================

This is likely one of two problems. Axiom uses clef as its command
line editor. This has functionality similar to GNU Readline but 
was written independently. The axiom command uses:

  clef -e $AXIOM/bin/AXIOMsys

Clef attempts to create new terminals and this might fail.
The first thing to check is the permission bits on /dev/pty.

Next it is possible to run the axiom image, called AXIOMsys, directly.
Just type AXIOMsys. It won't have command recall or command line
editing but everything else is there.

===================================================================
FAQ 13: How can I create and access Lisp functions from Axiom?
===================================================================

SExpression is the domain that handles raw lisp objects.
It is possible to create SExpression elements directly contruction:

m:=[1::SEX, 2::SEX]
  [1,2]
                             Type: List SExpression
n:=m::SEX
  (1 2)
                             Type: SExpression
car(n)
  1
                             Type: SExpression

You can access lisp functions directly with:

GENSYM()$Lisp

Lisp is the domain, known to the interpreter and compiler, that contains
lisp functions and symbols.

Notice that Axiom is case-sensitive and that generally lisp symbols
are upper case. 

You can also create and call lisp functions. For instance:

)lisp (defun foo () (print "it works"))
    Value = FOO

FOO()$Lisp
 "it works"

    it works
                             Type: SExpression

While accessing and writing functions in Lisp is possible it is
generally not recommended as Axiom contains a programming language
that should be able to achieve almost everything you need.

===================================================================
FAQ 14: It still doesn't work
===================================================================

Send email to:

axiom-developer@nongnu.org

===================================================================
FAQ 15: How can I see what the interpreter is trying to do?
===================================================================

)set message bottomup on

will tell you the signatures that the interpreter is trying to use.

Another method is to do

)lisp (setq |$monitorNewWorld| t)

and you can view database calls with

)lisp (setq *miss* t)

===================================================================
FAQ 16: How can I record console output?
===================================================================
)spool filename
    starts sending output to the file called filename
)spool )off
    stops sending output to the file

===================================================================
FAQ 17: Graphics don't work or sman fails to start ?
===================================================================

First try running sman as :
sman -debug -noclef -nonag -noht
Try this as root also.
If graphics still don't work or sman fails to start then
look at the error messages . Does it show something like :

ptyopen: Failed to grant access to slave device: No such file or directory
ptyopen: Failed to get name of slave device: No such file or directory
ptyopen: Failed to open slave: Bad address

If so you may need to do a few things 
1) Make sure that devpts support is enabled in you kernel 
   ( CONFIG_DEVPTS_FS=y )
2) Make sure the directory /dev/pts exists
3) Mount devpts as in :
   "mount -t devpts devpts /dev/pts"
   You may also want to add the following line to your /etc/fstab file
   devpts          /dev/pts        devpts  gid=5,mode=602          0       0
   This will ensure that next time you reboot devpts is automatically
   mounted.

On debian systems, it is common to run the stable distribution, and
then reserve a specific area of disk for the unstable distribution,
which one can use as if it were the entire installed OS via 'dchroot
unstable'. To make this work, certain directories have to be
accessible to both systems, and bind mounting is the usual solution.
Thus in this situation you need to do

  mount -o bind /dev/pts /unstable_chroot/dev/pts

===================================================================
FAQ 18: How can the user use the batch mode?
===================================================================

1) create an input file:

echo '2+2' >tst.input
echo '3+3' >>tst.input

2) make sure the AXIOM variable is set

export AXIOM=/path/axiom/mnt/linux
export PATH=$AXIOM/bin:$PATH

3) pipe a )read command to AXIOMsys and capture the output

echo ')read tst.input' | AXIOMsys >tst.output

===================================================================
FAQ 19: How can I get equations written on one line?
===================================================================

> Dear Axiom supporters,
> 2. I would also like to have the output of kind
> 
>  "  - (s-1) * (s+1) * (p^4 +(2*e^3 + (24*s^2 - 4)*e)*p^3 * ...) * ... 
>  "
> 
> For example, my DoCon program can read this format ...
> 
> 2.1 It prints these polynomials like for  (Z[e])[p]:  
>                                               " (e^2 + 2e)*p "
>     How to print it like for  Z[p,e]: 
>                                               " 2*p*e + e^2 "

You may wish to use the InputForm domain, where you can find some
bizarre functions. In your case, "unparse" may help you, as follows.

(1) -> p:=(a+b+y)^2*y+1-(x+y+z)^4

   (1)
        4               3        2             2  2
     - z  + (- 4y - 4x)z  + (- 6y  - 12x y - 6x )z
   + 
          3        2      2      3      4              3        2            2
     (- 4y  - 12x y  - 12x y - 4x )z - y  + (- 4x + 1)y  + (- 6x  + 2b + 2a)y
   + 
          3    2           2      4
     (- 4x  + b  + 2a b + a )y - x  + 1
                                                     Type: Polynomial Integer
(2) -> pi:=p::InputForm

  (2)
  (+
     (+
       (+  (+ (* - 1 (** z 4)) (* (+ (* - 4 y) (* - 4 x)) (** z 3)))
       (* (+ (+ (* - 6 (** y 2)) (* (* - 12 x) y)) (* - 6 (** x 2))) (** z 2)))

      (*
         (+
           (+  (+ (* - 4 (** y 3)) (* (* - 12 x) (** y 2)))
           (* (* - 12 (** x 2)) y))
          (* - 4 (** x 3)))
        z)
      )

    (+
       (+
         (+  (+ (* - 1 (** y 4)) (* (+ (* - 4 x) 1) (** y 3)))
         (* (+ (* - 6 (** x 2)) (+ (* 2 b) (* 2 a))) (** y 2)))
        (* (+ (* - 4 (** x 3)) (+ (+ (** b 2) (* (* 2 a) b)) (** a 2))) y))
      (+ (* - 1 (** x 4)) 1))
    )
                                                              Type: InputForm
(3) -> unparse(pi)

   (3)
  "(-z**4)+((-4*y)+(-4*x))*z**3+((-6*y*y)+(-12*x*y)+(-6*x*x))*z*z+((-4*y**3)+(-
  12*x*y*y)+(-12*x*x*y)+(-4*x**3))*z+(-y**4)+((-4*x)+1)*y**3+((-6*x*x)+2*b+2*a)
  *y*y+((-4*x**3)+b*b+2*a*b+a*a)*y+(-x**4)+1"
                                                                 Type: String


Aternatively you can get the LaTex output string:

(4) -> )lisp (|parseAndInterpret| "integrate(sin(x),x)::TexFormat::OutputForm")


   (4)  ["$$","-{\cos ","\left(","{x} ","\right)}","$$"]
                                                             Type: OutputForm
Value = ((|OutputForm|) WRAPPED BRACKET (AGGLST "\"$$\"" "\"-{\\cos \""
"\"\\left(\"" "\"{x} \"" "\"\\right)}\"" "\"$$\""))

or the text form:

(5) -> )lisp (|parseAndInterpret| "integrate(sin(x),x)::OutputForm")

   (5)  - cos(x)
                                                             Type: OutputForm
Value = ((|OutputForm|) WRAPPED "-" (|cos| |x|))

or the actual string output:

Axiom's algebra gets output to a stream called |$algebraOutputStream|
Thus you can get the output you want by:

)set message autoload off
)lisp (progn
          ; we need a new output stream that is backed by a string
        (setq tmpout (make-string-output-stream))
          ; we hold on to the regular algebra output stream
        (setq save |$algebraOutputStream|)
          ; we capture the algebra output into the string stream
        (setq |$algebraOutputStream| tmpout)
          ; we generate output from string input
        (|parseAndInterpret| "(x+1)^9")
          ; we save the output into the result variable
        (setq result (get-output-stream-string |$algebraOutputStream|))
          ; we restore the regular algebra output stream
        (setq |$algebraOutputStream| save)
          ; and we return the string as our value
        result)

)lisp result

result contains the output from axiom that you want.

Alternatively you can see the internal representation using |pf2Sex|
(parsed function to s-expression) by doing:

if you start axiom and type

   )trace (|pf2Sex|)

and then type some expression 

   1

you'll see the input and output of this function. This function
(parsed function to s-expression) is internal to the axiom interpreter.
it takes the parsed input line and converts it to a lisp s-expression.
so the above '1' input yields

 1> (|pf2Sex| ((|Integer| (|posn (0 "1" 1 1 "strings") . 0)) . "1"))
 1< (|pf2Sex| 1)

the "1>" line tells you the function input.
the "1<" line tells you the function output.

notice that even a simple input line generates type information.

this function is not part of the exposed user interface because
there is nothing at the user level that needs this information.


===================================================================
FAQ 20: Axiom hangs when graphics should be displayed.
===================================================================

Be sure that your X server will allow you to display windows. try:
'xhost +'

===================================================================
FAQ 21: How should I get my AXIOM shell variable and why?
===================================================================

The AXIOM variable is used at 2 different times, during make and
during execution.

First, lets look at the make case:

The build process needs to know 2 things. It needs to know where
the axiom sources are. It needs to know what kind of system to build.
Both of these pieces of information are in the AXIOM shell variable.

Suppose you download axiom into /tmp/axiom and 
you want to build a linux system. 
The AXIOM shell variable would be set to:

export AXIOM=/tmp/axiom/mnt/linux
             ^^^^^^^^^^
             where          ^^^^^
                            what

when the make starts it looks for where it will find the sources and
gets /tmp/axiom. It next looks for what kind of system to build and
gets linux.

In the top level makefile we see:

SPD=$(shell pwd)

which means that SPD will be the current working directory. 
It got set to:

SPD=/tmp/axiom

which is correct.

Next in the Makefile we see:

SYS=$(notdir $(AXIOM))

which got set to:

SYS=linux

so we can see from this information that the AXIOM shell variable
was set to:

AXIOM=/tmp/axiom/mnt/linux


Second, the AXIOM variable is used at runtime to tell axiom where
it lives. When you build an axiom system everything that is important
and worth keeping lives under the mnt subdirectory. So to "install"
an Axiom system into /usr/local/axiom, for example, you need only
copy the mnt subdirectory thus:

mkdir /usr/local/axiom
cd /tmp/axiom
cp -pr mnt /usr/local/axiom

Now that we've done that we can remove the whole axiom directory
from /tmp because it is no longer needed. 

However, in order to run Axiom we need 2 pieces of information.
First, we have to tell Axiom where it now lives and second, we
have to put the commands on our path so they can be found. So,
since we installed axiom into /usr/local/axiom we need:

export AXIOM=/usr/local/axiom/mnt/linux
export PATH=$AXIOM/bin:$PATH

The AXIOM shell variable tells axiom where to find itself.
The PATH shell variable tells linux where to find executables.

===================================================================
FAQ 22: How do I check out the latest sources?
===================================================================

git clone git://github.com/daly/axiom.git

===================================================================
FAQ 23: How do I patch a file?
===================================================================
This is an example of changing floats.spad.pamphlet and
incorporating a test case in the src/input directory:

1) Applied the negative float rounding/truncation patch from
Savannah to the floats.spad.pamphlet file.

2) Created a simple input file called
     negfloats.input.pamphlet
   in the src/input directory that executes some Axiom
   commands illustrating the bugs

3) Modified the file src/input/Makefile.pamphlet to
   include the following new subsection and stanzas

\subsection{negfloats}
\begin{chunk}{negfloats}
${OUT}/negfloats.input: ${MID}/negfloats.input
        @ echo 426 making ${OUT}/negfloats.input from ${MID}/negfloats.input
        @ cp ${MID}/negfloats.input ${OUT}/ngefloats.input

${MID}/negfloats.input: ${IN}/negfloats.input.pamphlet
        @ echo 427 making ${MID}/negfloats.input from
${IN}/negfloats.input.pamphlet
        @(cd ${MID} ; \
          ${BOOKS}/tangle ${IN}/negfloats.input.pamphlet >negfloats.input )

4) Made a new entry for negfloats in

FILES= ${OUT}/algaggr.input  ${OUT}/algbrbf.input    ${OUT}/algfacob.input \
       ...
       ${OUT}/ndftip.input   ${OUT}/newlodo.input \
       ${OUT}/negfloats.input \
       ...

5) Added a reference to chunk negfloats in the default chunk *

\begin{chunk}{*}
...
\getchunk{NDFtip}
\getchunk{negfloats}
...

6) Did axiom 'make' to compile the revised floats domain and
   (hopefully) run the negfloats.input test file.

   (set AXIOM and PATH manually ...)
   make

===================================================================
FAQ 24: What is the purpose of the domain HACKPI?
===================================================================

HACKPI is a hack provided for the benefit of the axiom interpreter.
As a mathematical type, it is the simple transcendental extension
Q(\pi) of the rational numbers. This type allows interactive users to
use the name '%pi' without a type both where a numerical value is
expected [ as in draw(sin x,x=-%pi..%pi) ] or when the exact symbolic
value is meant.  The interpreter defaults a typeless %pi to HACKPI and
then uses the various conversions to cast it further as required by
the context.

One could argue that it is unfair to single %pi out from other
constants, but it occurs frequently enough in school examples
(specially for graphs) so it was worth a special hack. In a
non-interactive environment (library), HACKPI would not exist.


===================================================================
FAQ 25: Can I create or edit hypertex pages?
===================================================================
The hypertex is intended to be edited by users. We are looking to
build special purpose pages around courses such as linear algebra.

Assume HERE=$AXIOM/doc/hypertex/pages

The text can be found in $HERE/foo.ht or $HERE/foo.pht

The macros are tex-like and live in $HERE/util.ht

To change a page you need to:

cd $HERE
edit the page
rm *~ (to delete backup copies)
htadd *
hypertex

the htadd command takes arguments:

htadd [-s|-l|-f db-directory] [-d|-n] filenames

but, i'm sorry to say, these have not been fully documented.

The htadd function will maintain the file called $HERE/ht.db
which is a database of absolute byte indexes into files.
Forgetting to run htadd will still work, sort-of, until you
hit a bad byte index and then it will fail.

Hypertex can also be directed elsewhere by using the HTPATH
shell variable. 

===================================================================
FAQ 26: How can I compile spad files on windows?
===================================================================
Something that probably should have been obvious caught me
by surprize today.

I have been working Axiom developer system configurations
for so long now that I had forgotten to make a distinction
between the types of users and the software that they need
to install. This is especially obvious on Windows because,
unlike linux, Windows is very often configured without
any development tools whatever. Only end-users application
programs might installed and even then these can often be
restricted to support an even more limited set of functions
for certain users. That is really what this message is
about. But first let me tell you the story...

*[This is Microsoft's World and while working intensively
with open source and linux we might sometimes forget what
it is like for the other 90% of the world ... :]*


Users, Programmers and Developers

  Anyway, this afternoon I installed Axiom for Windows

http://page.axiom-developer.org/axiom-windows-0.1.3.exe

on an entirely new machine with *no* other software installed
except the basic operating system (Windows 2000). Now that
we know about the problem of paths with spaces, I also opted
to override the default and install Axiom into the directory::

  c:\axiom

instead of::

  c:\Program Files\axiom

which is the default.

Then I proceeded to test Axiom in the usual way by running
a few selected input files. Everything seemed fine.

Finally since we have been talking about compiling spad
files today, I also tried to compile a src/algebra file.
I was very surprized when Axiom when all the way through
the spad compile and then told me (well GCL told me, really)
that it could not find `gcc'!

Then after I thought about it for a while I realized that
GCL really does depend on gcc and that gcc is *not* included
in the version of GCL that is installed with the Axiom
build. Well, of course not, right? <embarrassment> For
over more than a month now, a total of nearly 1,000 users
have downloaded the pre-release versions of axiom-windows
and it did not occur to me that they would not be able to
compile a spad file! sheesh. That seemed so odd to me since
I have been doing exactly that several times a day over
that same time, experimenting and testing new versions.
But then, I *do* have the full developer environment
installed.

So, who are all these people who are apparently quite
satisfied playing with and using this version of Axiom
that only includes about 1/2 of what Axiom can do?
Well, *Axiom Users* I guess. But certainly not Axiom
Programmers in the natural sense of the word because
they (probably) don't even have the pieces installed
that they would need to compile a program. An Axiom
end User then is someone who is satisfied with just
the contents of the mnt directory. They can do all
the calculations that Axiom is pre-programmed to do
and they can even define long calculations including
function definitions and the kind of program control
that can be written in input files, but then can *not*
compile new library files.

What besides the contents of the mnt directory is
required before one can compile library files? Well,
just the C compiler, of course. On windows the
minimum additional software that has to be installed
is called MinGW ( http://www.mingw.org/ ) and consists
of the "mingw-runtime, w32api, binutils and gcc tarball
packages" from ( http://www.mingw.org/download.shtml ):

http://prdownloads.sf.net/mingw/mingw-runtime-3.5.tar.gz?download

http://prdownloads.sf.net/mingw/w32api-3.2.tar.gz?download

http://prdownloads.sf.net/mingw/binutils-2.15.91-20040904-1.tar.gz?download

http://prdownloads.sf.net/mingw/gcc-core-3.4.2-20040916-1.tar.gz?download

You need to download each of these files and unzip them
(using a Windows shareware (evaluation version) program
like WinZip http://www.winzip.com/ http://www.7-zip.org/
or other free equivalent will do) directly into the::

  mnt/windows

directory, the root of your Axiom installation. This is
the most convenient place because the Axiom installation
has already added this location to the path that allows
your system to find and execute this programs.

FINALLY, there is one more thing that you need add. One of
the unix compatibility programs called rm.exe is missing
from::

  mnt/windows/bin

Click on

http://page.axiom-developer.org/rm.exe

and choose "Save As". Locate the `mnt\windows\bin'
directory and click Save.

Now at last you have a Windows Axiom Programmer's system
configuration. You will be able to create, modify and
compile spad files to create your own customized mathematical
library.

When you create .spad files, be sure to save them in
path that does not include spaces. This means that you
can not use `My Documents' which is (more or less) the
Windows default location. If you like, you can create
a directory called `local' within your Axiom base
installation directory. For example::

  c:\test\local

Save your files there. In Axiom you should change the
default directory to `local' so that you can easily
compile files like this::

  )cd ../..
  )cd local
  )co yourfile.spad

and::

  )library yourfile.spad

to load a file compiled during a previous session.

**Enjoy!**

In the next pre-release of Axiom for Windows I think it
would be a good idea if we provided at least the above
end User's and the larger Programmer's configurations in
two complete downloads and self-install files. I have
checked the licenses for MinGW and I am quite sure that
including the run-time and minimal compiler programs in
the Axiom install is allowed by the developers. It is
however very clearly a GPL license.

In fact, you should expect that over the next few months
many aspects of the Axiom installation will become easier
and more complete. Stay tuned to the MathAction website:

http://page.axiom-developer.org

or this email list for more up to date information!

---------

Lastly, I will define Axiom Developers as those masochists
who are willing to spend their time configuring and testing
new complete releases of Axiom for others. The development
environment of this on Windows is everything the Programmers
have plus the MSYS developer's tools. See
( http://www.mingw.org/msys.shtml ) for the following files:

http://prdownloads.sf.net/mingw/MSYS-1.0.8.exe?download

http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe?download

Download these self-install files and then run them to
create a programming environment under windows that is
in many ways like linux (however, more minimal :). When
you install these programs, make sure to specify that you
also have MingGW installed.

And one last thing. Before you can run::

  .\configure
  make

You should also have the tla arch program installed so
that you can download the Axiom source files and you will
be able to upload your patches and new features. To get
tla click

http://download.sipsolutions.de/tla-setup.exe

Download and run this program to install tla. Once this is
installed, you will be able to run tla from inside MSYS or
from tla's own special command line shell. The rest of
the instructions for developers is as

http://arch.axiom-developer.org

Axiom Programmers should (optional for Axiom Users and
mandatory for Axiom Developers) also install support for
LaTeX. Of course it is essential that developers, programmers
and even Axiom users devote as much effort as possible to
preparing accurate and easy to read documentation, otherwise
a great deal of effort and intellectual investment in can
be quickly lost.

Axiom Users can also optionally use TeXmacs

http://www.texmacs.org

to interact with Axiom and to prepare high quality mathematical
documents.

The standard form for all Axiom programs and documentation is
the noweb extension of LaTeX (called "pamphlet files" in Axiom
terminology). Pamphlet files contain both documentation and the
program code itself. This format is used for all internal Axiom
coding and the entire Algebra library. It is expected that new
Algebra that is intended by it's author to be shared with other
Axiom users will also be prepared in pamphlet format.

Unfortunately pamphlet format is not (yet) fully supported by
TeXmacs.

There are several Windows compatible versions of LaTeX to choose
from. The one that I have used very successfully is MikTeX
( http://www.miktex.org/ ). To install MikTeX click

http://www.miktex.org/setup.html

and follow the instructions. If your computer is connected to
the Internet then the "small" version (small-miktex-2.4.1705.exe)
will be sufficient for use with Axiom.

For Windows users who have no previous experience with LaTeX
(and even if you do) I would also recommend that you install
a good LaTeX-aware text editor. See

http://www.miktex.org/links.html

One of the easiest to use and completely open source is
TeXnicCenter

http://www.toolscenter.org/front_content.php?idcat=26

Click 'download' and select "TeXnicCenter Setup, Version 1
beta ...". This is a self-installing file. If you install
TeXnicCenter after MikTeX, it will be automatically configured
to support MikTeX.

TeXnicCenter is very easy to use for LaTeX beginners and
it is will supported by it's developers and the users group.
It is also quite easily configured to support LaTeX extensions
such as noweb.

===================================================================
FAQ 27: Why can't I input text into the hypertex browser boxes?
===================================================================

Check your num-lock key. If num-lock is on then you can't input
text into your browser text boxes.

Check that "Num Lock" is disabled.

It appears that the Num Lock key prevents the text window
from accepting text. This is a known problem with no current fix.


===================================================================
FAQ 28: Graphics does not work inside TeXmacs?
===================================================================

> No, I am not able to get graphics to appear in an X-window
> from inside TeXmacs.  That's what I *want* to be able to do.
> 
> I have TeXmacs 1.0.4.4 (latest being 1.0.4.5).   I know the 
> plugin calls AXIOMsys, and I tried to make it call "axiom"
> or "sman" with no immediate success.

Ok great. You are obviously on the right track. If you compiled
TeXmacs from source then to make tm_axiom call "axiom", the
simplest thing to do is to modify the souce file tm_axiom.c by
replacing "AXIOMsys" with "axiom" and then recompile it. It is
a simple C program with no dependencies and can be compiled
separately. Move the tm_axiom.exe file to the appropriate place
in the TeXmacs installation directory.

If you didn't compile TeXmacs from source you can get just the
tm_axiom.c file from the CVS, modify it and compile as above.

The Axiom graphics process has the ability to create a
postscript format output file containing the graphic.
This can be initiated from the user interface of the
graphics window or also from an Axiom command. Check "Chapter
7 Graphics" of the Axiom book, specifically section "7.1.8
Operations for Two-Dimensional Graphics", `write' operation.
It works something like this:

     viewPort := draw(sin x, x=-%pi..%pi)
     write(viewPort, "output.ps","postscript")
 
These commands can be included directly in the TeXmacs document.

===================================================================
FAQ 29: Where can I get help online?
===================================================================

Axiom Mailinglists and IRC Channel

Several ways to contact the community are available. There is an irc 
channel where developers can find other developers. It is:: 
  
    server: irc.freenode.net 
    channel:#axiom-developer 

  The mailinglists are:
 
  "axiom-math":http://lists.nongnu.org/mailman/listinfo/axiom-math 
("archive":http://lists.nongnu.org/archive/html/axiom-math)
  Discussion of math theory and philosophy related to Axiom

  "axiom-mail":http://lists.nongnu.org/mailman/listinfo/axiom-mail 
("archive":http://lists.nongnu.org/archive/html/axiom-mail)
  General discussion on Axiom

  "axiom-developer":http://lists.nongnu.org/mailman/listinfo/axiom-developer 
("archive":http://lists.nongnu.org/archive/html/axiom-developer)
  When you have issues to compile Axiom or with Axiom internals

  "axiom-legal":http://lists.nongnu.org/mailman/listinfo/axiom-legal 
("archive":http://lists.nongnu.org/archive/html/axiom-legal)
  All legal issues, like license issues



===================================================================
FAQ 30: How can I file a bug report?
===================================================================

Send email with details of the bug report to bugs@axiom-developer.org

The email should contain enough information so we can help you figure
out what the problem could be. Since you are the only one who knows
what the problem is it is necessary to give us enough information to
work out the details.

At the top of your Axiom session when you start Axiom there are two
lines printed, the Version line and the Timestamp line. They look

Version: Axiom 3.0 Beta (February 2005)
Timestamp: Thursday January 20, 2005 at 19:34:25

These two lines enable us to determine what version of the source
code you are using. Without this information we can't tell if the
bug has already been fixed or is new.

We also need to know what kind of system you are using. This
includes the kind of software and the kind of hardware. So we
need to know if it is something like

RedHat Linux Version 9 on Intel PC
Solaris 8 on Sun Ultrasparc

Now that we know what version of code you are running and what
kind of system you are running on we need to know what the exact
problem is. It is best if you can send a copy of the failing 
output. If not, please send the EXACT error message so we can
search the code for the error.

===================================================================
FAQ 31: How can I find out if this is a known bug
===================================================================

http://page.axiom-developer.org/zope/mathaction/FrontPage/IssueTracker

contains a page with all of the known bug reports. You can search
thru all of the bug reports to see if your error has happened before
and, if so, if it was fixed.

Please try to do this before filing a bug report. It will save us
all a lot of time.

===================================================================
FAQ 32: How can I input an equation as a string?
===================================================================

There is an embedded command server within AXIOMsys.
Look at:
http://daly.axiom-developer.org/TimothyDaly_files/lisptalk/pages/lisp35.html

In particular, see the function

  parseAndInterpret stringBuf

(which is boot language code. So in lisp I have
to tack on the | | onto the function name and then I can
call it like this:

  (1) -> )lisp (|parseAndInterpret| "integrate(sin x,x)")

   (1)  - cos(x)
                          Type: Union(Expression Integer,...)

  Value = ((|Union| (|Expression| (|Integer|)) (|List| (|Expression|
(|Integer|)))
  ) WRAPPED 0 (1 #<vector 10ccde54> (1 0 . -1)) 0 . 1)

  (2) ->

and sure enough! Axiom parses and interprets the string.

The result appears as stdout and the value returned
seems to contain the type information. The "WRAPPED"
information is the lisp data structure.

> The string output function mentioned in FAQ 19 is a linear
> form of the output. However Axiom's native output machinery
> is called CHARYBDIS which was a research project from the
> 60s with the goal of printing mathematics on typewriters.
> Axiom still uses that code.

===================================================================
FAQ 33: How do I run hypertex standalone?
===================================================================

export AXIOM=/whatever/mnt/linux
export HTPATH=$AXIOM/doc/hypertex/pages
export PATH=$AXIOM/bin:$PATH
hypertex

===================================================================
FAQ 34: How can I find out about a domain?
===================================================================

There is a standalone command called asq which will give information
from Axiom's databases:

asq
asq Integer
asq -sh Integer

===================================================================
FAQ 35: Why do .axiom.input defined functions fail in axiom?
===================================================================
You write this in your .axiom.input file:

mrd(x:Integer,v:Integer):Integer == x+y

You can't see this function even though it appears to be defined. That's
because Axiom is working in a new frame. 

When you start AXIOMsys you are running the interpreter talking directly
to the terminal. So the .input file is actually talking to a frame
at the top level. Your function is defined. 

The .axiom.input file is read in a "frame" called "initial".
AXIOMsys only uses the "initial" frame (although you can define and
use new ones). A frame contains its own variables and function definitions.

The "axiom" command does several things that AXIOMsys does not. In
particular the axiom shell script starts up the 'sman' process which
starts AXIOMsys (which reads the .axiom.input file) and then sman
creates a new frame (usually a random lisp gensym name). In this new
frame (created after .axiom.input is read) your mrandom function is
not defined.

To see this do:
  AXIOMsys
  mrandom(3,3,3)   -- compiles and runs the function
  )quit

Now do:
  axiom
  mrandom(3,3,3)   -- undefined function
  )frame next
  mrandom(3,3,3)   -- compiles and runs the function
  )frame names     -- shows you all of the defined frames 
  )quit


So with the axiom shell script the process is:
  axiom 
    start sman                    (done by axiom shell script)
      sman starts AXIOMsys        (done by sman)
        create frame "initial"    (done by AXIOMsys)
          read .axiom.input       (define your function here)
        create frame "G00234"     (done by sman)
          put up a command prompt (in frame G00234, no functions defined)
        )frame next               (done by you)
                        .... and now you're back in frame initial
                        .... and your function is there


So your function was read and it is defined. However the function got
defined in the "initial" frame (because you defined it in the .axiom.input
file) and is not known in the frame created by sman. The ")frame next"
command will move you around the ring of frames. (See the hardcopy book
on page 579).

===================================================================
FAQ 36: Axiom won't build on FC3
===================================================================
You need to turn off dynamic library load point randomization.
As root do:

echo 0 >/proc/sys/kernel/exec-shield


===================================================================
FAQ 37: Axiom won't build on FC4 or FC5
===================================================================
You need to turn off dynamic library load point randomization.
As root do:

echo 0 >/proc/sys/kernel/randomize_va_space

or do

setarch i386 -R make axiom

If the above fails then it is possible that you may have to take
more drastic measures. This will disable the SELinux:

/usr/sbin/setenforce 0

although it may be possible to tweak the policy directly. Change
/etc/selinux/strict/src/policy/domains/user.te:bool allow_execmem false;
to
/etc/selinux/strict/src/policy/domains/user.te:bool allow_execmem true;

then do:

cd /etc/selinux/strict/src/policy
make load

===================================================================
FAQ 38: How can I debug algebra code?
===================================================================

  Axiom contains some powerful commands to help with testing and
debugging library modules written in Spad and also the Axiom system
itself. The most important of these commands is ')trace'.

This command is used to trace the execution of functions that make
up the Axiom system, functions defined by users, and functions from
the system library. Almost all options are available for each type
of function but exceptions will be noted below.

To list all functions, constructors, domains and packages that are
traced, simply issue::

  )trace

To untrace everything that is traced, issue::

  )trace )off

When a function is traced, the default system action is to display
the arguments to the function and the return value when the function
is exited. Other information can be displayed or collected when a
function is traced and this is controlled by the various options.
If a domain or package is traced, the default action is to trace all
functions exported. Individual interpreter, lisp or boot functions
can be traced by listing their names after ')trace'. Any options that
are present must follow the functions to be traced. For example::

  )trace f

traces the function f. To untrace f, issue::

  )trace f )off

Note that if a function name contains a special character, it will
be necessary to escape the character with an underscore::

  )trace _/D_,1

To trace all domains or packages that are or will be created from a
particular constructor, give the constructor name or abbreviation
after ')trace'::

  )trace MATRIX
  )trace List Integer

The first command traces all domains currently instantiated with
Matrix. If additional domains are instantiated with this constructor
(for example, if you have used 'Matrix(Integer)' and 'Matrix(Float)'),
they will be automatically traced. The second command traces
'List(Integer)'.

The following are the general options for the ')trace' command.

')break after' -- causes a Common Lisp break loop to be entered after
exiting the traced function.

')break before' -- causes a Common Lisp break loop to be entered before
entering the traced function.

')break' -- is the same as )break before.

')count' -- causes the system to keep a count of the number of times the
traced function is entered.

The total can be displayed with::

   )trace )stats

and cleared with::

   )trace )stats reset

')count n' -- causes information about the traced function to be displayed
for the first n executions. After the n-th execution, the function is
untraced.

')depth n' -- causes trace information to be shown for only n levels of
recursion of the traced function.

The command::

  )trace fib )depth 10

will cause the display of only 10 levels of trace information for the
recursive execution of a user function fib.

')math' causes -- the function arguments and return value to be displayed
in the Axiom monospace two-dimensional math format.

')nonquietly' -- causes the display of additional messages when a function
is traced.

')nt' -- This suppresses all normal trace information. This option is useful
if the ')count' or ')timer' options are used and you are interested in the
statistics but not the function calling information.

')off' -- causes untracing of all or specific functions. Without an argument,
all functions, constructors, domains and packages are untraced. Otherwise,
the given functions and other objects are untraced.

To immediately retrace the untraced functions, issue::

  )trace )restore

')only listOfDataToDisplay' -- causes only specific trace information to be
shown.

')restore' -- causes the last untraced functions to be retraced. If
additional options are present, they are added to those previously in
effect.

')stats' -- causes the display of statistics collected by the use of the
')count' and ')timer' options.

')stats reset' -- resets to 0 the statistics collected by the use of the
')count' and ')timer' options.

')timer' -- causes the system to keep a count of execution times for the
traced function. The total can be displayed with ')trace )stats' and
cleared with ')trace )stats reset'.

')varbreak var1 ... varN' -- causes a Common Lisp break loop to be
entered after the assignment to any of the listed variables in the
traced function.

')vars' -- causes the display of the value of any variable after it is
assigned in the traced function. Note that library code must have been
compiled using the ')vartrace' option in order to support this option.

')vars var1  ... varN' -- causes the display of the value of any of
the specified variables after they are assigned in the traced function.
Note that library code must have been compiled using the ')vartrace'
option in order to support this option.

')within executingFunction' -- causes the display of trace information
only if the traced function is called when the given executingFunction
is running.

The following are the options for tracing constructors, domains and
packages.

')local op1 ... opN' -- causes local functions of the constructor to
be traced. Note that to untrace an individual local function, you must
use the fully qualified internal name, using the escape character before
the semicolon. For example::

  )trace FRAC )local
  )trace FRAC_;cancelGcd )off

')ops op1 ... opN' -- By default, all operations from a domain or package
are traced when the domain or package is traced. This option allows you
to specify that only particular operations should be traced.

The command::

  )trace Integer )ops min max _+ _-

traces four operations from the domain Integer. Since + and - are special
characters, it is necessary to escape them with an underscore.

Also See: ')boot', ')lisp' , and ')ltrace'. Please refer to the
Axiom Book section "Axiom System Commands" for more detailed information.

===================================================================
FAQ 39: How can I access lisp code from the Axiom command line?
===================================================================

To run a lisp command from the command line use )lisp:

 --> )lisp (+ 2 3)

If you want to run a lot of lisp commands from the command line do:

 --> )lisp (setq $dalymode t)
 --> (+ 2 3)
 --> (defun foo (x y) (+ x y))
 --> (foo 2 3)
 --> 2 + 3

$dalymode says:
 
   If the first character is a '('
     then it is lisp
     else it is axiom

to disable it do:

  --> (setq $dalymode nil)

I wrote this change to the interpreter because I tend to use lisp a lot
during maintenance. It breaks some syntax but you can work around that.

If you really want to "drop" into lisp do:

  --> )fin
BOOT> (+ 2 3)

and now you are talking only to lisp at a lisp command prompt in
the BOOT package. To restart Axiom type:

BOOT>(restart)


===================================================================
FAQ 41: How can I work in lisp from Axiom?
===================================================================


> I want to work in the boot package. Is it possible from the interpreter
> to open a gcl prompt with all the Axiom packages loaded and, it's _very
> important_, all the internal variables set? If I work with depsys some
> variables are not set so its behavior is different. Just an example
> (MERGE-PATHNAMES "TEST") in depsys returns #p"/usr/local/axiom/mnt/TEST"
> but in the interpreter it returns "#p"TEST" or #p"/home/greg/Axiom/TEST"
> if I modified the AXIOM default directory with ')cd /home/greg/Axiom'.
> Of course I know that it's possible to use ')lisp lisp-code' but this is
> not practical.



There are at least several ways.



The one I usually use is to type:

  -> )lisp (setq |$DALYMODE| t)

This is a special mode of the interpreter.
ANY expression that starts with an open paren is 
interpreted as a lisp expression. Thus, after you
do this you can type lisp expressions at the prompt:

  -> (+ 2 3)
Value = 5





Another method is to type:

  -> )lisp (break)

which will put you into a lisp break loop (a recursive
version of the top level loop). To return back to axiom type
 
BOOT>> :q

at the lisp prompt.




A third method is to type:

  -> )lisp (throw |$intTopLevel| nil)

which will put you back into the lisp top level. To return
to axiom type:

BOOT> (restart)



A fourth method is to type:

  -> )fin

which will put you back into the lisp top level. To return
to axiom type:

BOOT> (restart)


===================================================================
FAQ 42: How can I output equations as lisp s-expressions?
===================================================================

(1) -> p:=(1+x)^5

         5     4      3      2
   (1)  x  + 5x  + 10x  + 10x  + 5x + 1
                                                     Type: Polynomial Integer
(2) -> VALUES(p)$Lisp

   (2)  (1 x (5 0 . 1) (4 0 . 5) (3 0 . 10) (2 0 . 10) (1 0 . 5) (0 0 . 1))
                                                            Type: SExpression

===================================================================
FAQ 43: Is Axiom's License compatible with the GPL?
===================================================================
Axiom is licensed under the Modified BSD license. According to both 
historical discussions with Richard Stallman and this website:

http://www.fsf.or/licensing/licenses/index_html#GPLCompatibleLicenses

which we quote here:

"Modified BSD license

    (Note: on the preceding link, the modified BSD license is listed 
     in the "General" section.)

    This is the original BSD license, modified by removal of the 
    advertising clause. It is a simple, permissive non-copyleft 
    free software license, compatible with the GNU GPL.

    If you want a simple, permissive non-copyleft free software 
    license, the modified BSD license is a reasonable choice. 
    However, it is risky to recommend use of ``the BSD license'', 
    because confusion could easily occur and lead to use of the 
    flawed original BSD license. To avoid this risk, you can 
    suggest the X11 license instead. The X11 license and the 
    revised BSD license are more or less equivalent.

    This license is sometimes referred to as the University of 
    Illinois/NCSA Open Source License."

Please note that all legal discussions should occur ONLY on the
axiom-legal@nongnu.org mailing list and not copied to the other
developer mailing lists. 

===================================================================
FAQ 44: I don't have the math fonts
===================================================================
View the file zips/mathops.html to see if you have all the symbols.
See http://www.unicode.org/charts/PDF/U2200.pdf

There is a file zips/axiomfonts.tgz which contains some of the fonts
(mostly the Stix fonts which recently became available). Other 
missing fonts can be found at:

http://www.stixfonts.org
http://www.alanwood.net/unicode
http://support.wolfram.com/mathematica/systems/windows/general/latestfonts.html

===================================================================
FAQ 45: Axiom Copyright information
===================================================================
Axiom is intended for not-for-profit, personal, educational use.
Any other use is permitted but not endorsed.

A fundamental project goal is to document the system for future
educational, research, and scientific use.

Axiom may contain some copyrighted material whose use has not been
authorized by the copyright owners. We believe that this not-for-
profit, educational, and research use constitutes a fair use of the 
copyrighted material (as provided for in section 107 of the U.S.  
Copyright Law).

Notwithstanding the provisions of sections 106 and 106A, the fair use
of a copyrighted work, including such use by reproduction in copies or
phonorecords, or by any other means specified by that section, for
purposes such as criticism, comment, news reporting, teaching
(including multiple copies for classroom use), scholarship, or
research, is not an infringement of copyright. In determining whether
the use made of a work in any particular case is a fair use the
factors to be considered shall include:

  1. the purpose and character of the use, including whether such use
     is of a commercial nature or is for nonprofit educational purposes;
  2. the nature of the copyrighted work;
  3. the amount and substantiality of the portion used in relation to
     the copyrighted work as a whole; and
  4. the effect of the use upon the potential market for or value of
     the copyrighted work.

The fact that a work is unpublished shall not itself bar a finding of
fair use if such finding is made upon consideration of all of the
above factors.

===================================================================
FAQ 46: Axiom Trademark information
===================================================================
The name "Axiom" and the Axiom-included iconic images are common
law trademarks of this project. The term of service applies to the
code distributed and compiled versions of code distributed from the
Axiom websites at 
  axiom-developer.org
  savannah.nongnu.org/projects/axiom
  sourceforge.net/projects/axiom
  github.com/daly/axiom


===================================================================
FAQ 47: Axiom won't build on Fedora 9 (SELinux)
===================================================================
You need to turn off dynamic library load point randomization.
As root do:

echo 0 >/proc/sys/kernel/randomize_va_space

or do

setarch i386 -R make 

Also, Fedora now appears to install SELinux without giving the
user an option at system install time. The symptom seems to be:

...[snip]...
 invoking make in ~/axiom/src/boot
 Permission Denied
...[snip]...

Problem:

SELinux is preventing lisp from changing the access protection of
memory on the heap

Explanation:

The lisp application attempted to change the access protection of
memory on the heap (e.g. allocated using malloc). This is a potential
security problem. Applications should not be doing this. Applications
are sometimes coded incorrectly and request this permission. The
SELinux Memory Protections Tests web page explains how to remove this
requirement. If lisp does not work and you need it to work, you can
configure SELinux temporarily to allow this access until the
application is fixed.

If you want lisp to continue, you must turn on the allow_execheap boolean.

setsebool -P allow_execheap=1

Rant: Not "applications should not be doing this...applications are
sometimes coded incorrectly"... but "security software should not be
doing this...security software is sometimes coded incorrectly".
Claiming valid code is incorrect is a bug in SELinux. Programs change
protection to allow efficiencies like copy-on-write, garbage collection
optimizations, dynamically compiled functions executed out of the
heap, dynamic stack boundary checking, etc.. This is common computer
science knowledge. The hubris of the "explanation" is beyond remark.

Another alternative is to use the commands:

/sbin/sysctl -w kernel.randomize_va_space=0
/sbin/sysctl -w kernel.exec-shield=0

A third alternative is to edit /etc/sysctl.conf and add the lines:

kernel.randomize_va_space=0
kernel.exec-shield=0

If the above fails then it is possible that you may have to take
more drastic measures. This will disable the SELinux:

/usr/sbin/setenforce 0

although it may be possible to tweak the policy directly. 

Change
/etc/selinux/strict/src/policy/domains/user.te:bool allow_execmem false;
to
/etc/selinux/strict/src/policy/domains/user.te:bool allow_execmem true;

then do:

cd /etc/selinux/strict/src/policy
make load

===================================================================
FAQ 48: Getting Axiom sources from git
===================================================================
There are 2 git repositories for Axiom source code.

The first repository is at github.com. This repository is the
latest released version of Axiom (Gold). To get the source type:

  git-clone git://github.com/daly/axiom.git

The second repository is at axiom-developer.org. This repository is the
latest development version of Axiom (Silver). To get the source type:

  git-clone ssh://git@axiom-developer.org/home/git/silver
  (pswd:linus)

Once you have the source code visit 

http://axiom.axiom-developer.org/axiom-website/download.html

for further information.

===================================================================
FAQ 49: How do I get the lastest GCL?
===================================================================

You can use the latest version of GCL although it will require
a few steps. Axiom builds GCL by untaring the GCL source tree
from a file in the axiom/zips subdirectory. Then it applies some
local patches to the source tree. Finally, it builds GCL.

Under the control of axiom/lsp/Makefile(.pamphlet) the steps are:
  * axiom/zips/GCLVERSION.tgz -> axiom/lsp/GCLVERSION
  * apply patches
  * cd axiom/lsp/GCLVERSION
  * ./configure GCLOPTS
  * make 

The file and patches chosen are prefixed by the GCLVERSION 
variable string. For example, if GCLVERSION=gcl-2.6.7 we would see
axiom/zips/gcl-2.6.7.tgz
axiom/zips/gcl-2.6.7-somefilepath1.patch
axiom/zips/gcl-2.6.7-somefilepath2.patch
  ...

Thus we can introduce new versions of GCL by fetching the new
code, giving it a name (in this case gcl-2.6.8pre3), and 
setting the GCLVERSION to that name. 

Note that you may have to modify the patches. The patches are applied
using the axiom/lsp/Makefile.pamphlet file so if you add or delete
patches you have to set up corresponding chunks.  There are very few
patches as almost every change has been accepted upstream. Most
patches have been stable for the lifetime of Axiom.

Unless you're chasing a bug it is unlikely you will ever have
to do this.

1) First we fetch the latest code:
cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/gcl 
   co -r Version_2_6_8pre -d gcl-2.6.8pre gcl

2) Next we rename it to be the same as the GCLVERSION variable:
mv gcl-2.6.8pre gcl-2.6.8pre3

3) Next we tar-gzip the directory
tar -zcf gcl-2.6.8pre3.tgz gcl-2.6.8pre3

4) Put the latest tgz file into the proper location in Axiom:
cp gcl-2.6.8pre3.tgz axiom/zips

5) Modify axiom/Makefile GCLVERSION variable to read:
GCLVERSION=gcl-2.6.8pre3

5) Modify axiom/Makefile.pamphlet GCLVERSION variable to read:
GCLVERSION=gcl-2.6.8pre3

6) Copy any needed patches from the previous version (likely all)
and rename them using the new GCLVERSION prefix

7) In the axiom top level directory type:
make

===================================================================
FAQ 50: Cannot find libXpm.a
===================================================================

The static library is missing from some distributions.
The source code to build this library is available at:
 http://axiom-developer.org/axiom-website/Xpm.tgz

===================================================================
FAQ 51: How can I do unicode in xterm?
===================================================================

Axiom intends to support unicode I/O at some point in the future.
You can do unicode I/O with xterm. The 'locale' command should show
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Other results might work but are not tested.

xterm -fn '-*-fixed-medium-*-*-*-15-*-*-*-*-*-iso10646-1'

You can find iso10646-1 fonts using the xfontsel tool.
You can test the fonts using the file zips/utf-8-demo.txt 
If it works you should see very large braces around the
sqrt expression. There are fonts in the zips directory.
See FAQ 44

In emacs you can type "Ctrl-x 8 ' e" to get an accented e.
You can see all of the bindings with "Ctrl-x 8 Ctrl-h"
You can insert a right-arrow with "Alt-x ucs-insert" 2192
"Alt-x describe-char-after" will describe the character under the point.
"Ctrl-h-v buffer-file-coding-system" will describe the decoding
"Alt-x describe-coding-system" will give information about the buffer coding

===================================================================
FAQ 52: Who was User?
===================================================================

User was a powerful advisor to the 18th dynasty Queen Hatshepsut in Egypt.

Queen Hatshepsut ruled Egypt between 1479 B.C. and 1458 B.C.
They have recently uncovered a large red granite false door from User's tomb.
This door is believed to have been the threshold to the afterlife.

Due to this barrier it is know to be difficult to communicate with User.

http://news.yahoo.com/s/afp/20100329/wl_africa_afp/egyptarchaeology


===================================================================
FAQ 53: Axiom won't build on Fedora
===================================================================
Fedora prevents lisp from using the execheap access on a process.

As root, type:

   setsebool -P allow_execheap 1