[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] list bug

From: root
Subject: Re: [Axiom-developer] list bug
Date: Fri, 18 Jul 2003 18:54:02 -0400


btw, your CC list is wrong. You reference address@hidden not

> Greetings!  Could someone please instruct me where to insert a
> debugging '(format t "hello~%") statement which would enumerate the
> number of recursive calls, and then tell me what the correct number
> should be on a working system?  I can keep expanding the stacks, but
> I'm not sure if the problem is they're being too small, or another
> termination error.  

Madness lies in that direction :-)


If you wish you can look at the clisp (boot translation), lisp (hand
written lisp) or lsp (compiler output) files, modify them, and reload
them. All of the translated code is translated to common lisp and the
common lisp lies in int/algebra and its subdirectories. Essentially
you can consider the compiler/interpreter sources to live in this

You can drop into lisp by typing:
and return to the Axiom prompt by typing:

You can issue any lisp command (e.g. call the function foo) thus:
)lisp (foo)


Axiom creates arrays of functions and does a dynamic lookup using a
macro called SPADCALL. (Look at the .lsp files in the subdirectories
under int/algebra) To see this macro expanded you can start up
Axiom and type:

)lisp (macroexpand '(spadcall a b))

Each algebra file has its own private vector and there is no central
place where recursion occurs. You can see this call-vector by doing:

)lisp (setq *print-array* t)
)lisp (setq *print-circle* t)
)lisp (hget |$ConstructorCache| '|Integer|)

The Axiom compiler hard-codes indexes into the call vector using the
spadcall macro.


The infinite loop happens during compilation.  I've been looking at
the compiler code trying to understand why it cannot properly walk the
inheritance chain. The infinite loop only happens if the domain you
are compiling has code of the form:

if R has X

where R is the current domain and X is a category somewhere in the
inheritance chain. In the case I've been chasing:

)co xpoly )con XPR

the chain gets walked until the category Ring is found at which point
it continues to find Ring. This leads me to believe that one of the
set functions is not quite right as the compiler keeps adding the
inherited files to be processed into a set for later analysis. I have
found only one case, so far, that changes the set definitions from
CCL (the NAG version) to GCL. 

(setq a '(a))
(setq b '(a b c))

(set-difference b a)

CCL ==> (b c)
GCL ==> (c b)

Both definitions are correct but the change in order changes the
way that Axiom walks the inheritance tree. Ideally Axiom's compiler
should not be sensitive to this. However, I think it is and yet I
have not yet found the sensitive code (if it exists) or proven that
it is not.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]