login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

This is an edited version of the FAQ file found in the Axiom source code distributions.

Table of Contents

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:


FAQ 1: Xlib.h is 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.

Richard Harke wrote:

On my ia64 debian-linux workstation, apt-get refuses to install xlibs-dev. I think I have gotten around this by installing libxt-dev.

Waldek Hebisch wrote:

Debian testing has Xlib.h in libx11-dev.

Alfredo Portes wrote:

In Ubuntu install: libxpm-dev, libx11-dev and libxt-dev.

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

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 at 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

  1. cd /tmp/axiom

  2. modify the line in src/interp/Makefile.pamphlet that reads:


    to read:

  3. set up the standard AXIOM shell variable:

    export AXIOM=/tmp/axiom/src/interp
  4. set up the standard PATH variable:

    export PATH=$AXIOM/bin:$PATH
  5. build the system, including debugsys.lisp:

  6. tell debugsys where to find the databases:

    export DAASE=$AXIOM
  7. tell debugsys which platform you are on:

    export SYS=linux
  8. start a clean lisp image:

  9. load the debugsys code which loads the axiom system interpreted:

    (load "/tmp/axiom/int/interp/debugsys.lisp")
  10. switch to the package the interpreter uses:

    (in-package "BOOT")
  11. start the system:


    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. There is a shell variable called GCLVERSION that must be changed to choose the version.

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 --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:


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]
                           Type: List SExpression
  (1 2)
                           Type: SExpression
                           Type: SExpression

You can access lisp functions directly with:


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

 "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 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.

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

      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

     (+  (+ (* - 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)))

       (+  (+ (* - 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)

                                                               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

)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:


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          ^^^^^

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:


which is correct.

Next in the Makefile we see:

SYS=$(notdir $(AXIOM))

which got set to:


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


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?

export CVS_RSH=ssh
cvs -d:ext:anoncvs@savannah.nongnu.org:/cvsroot/axiom co axiom

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.

  1. Created a simple input file called


    in the src/input directory that executes some Axiom commands illustrating the bugs

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

    ${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
       (cd ${MID} ; \
         ${TANGLE} ${IN}/negfloats.input.pamphlet >negfloats.input )
  3. 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 \
  4. Added a reference to <<negfloats>> in <<*>>=

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

    (set AXIOM and PATH manually ... yuck :)

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 *

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 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.

FAQ 28: Graphics does not work inside OldTeXmacs?

> No, I am not able to get graphics to appear in an X-window
> from inside OldTeXmacs.  That's what I *want* to be able to do.
> I have OldTeXmacs (latest being   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 OldTeXmacs 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 OldTeXmacs installation directory.

If you didn't compile OldTeXmacs 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 OldTeXmacs 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

The mailinglists are:

Discussion of math theory and philosophy related to Axiom

General discussion on Axiom

When you have issues to compile Axiom or with Axiom internals

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 at 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

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

to view 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: "this":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

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 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:

mrandom(3,3,3)   -- compiles and runs the function

Now do:

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

So with the axiom shell script the process is:

  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:


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:


FAQ 40: Text entry fails in the hypertex browser window

Check that "Num Lock" is disabled.

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

  Subject:   Be Bold !!
  ( 13 subscribers )  
Please rate this page: