gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] Re: [Axiom-developer] list bug


From: Camm Maguire
Subject: Re: [Gcl-devel] Re: [Axiom-developer] list bug
Date: 18 Jul 2003 23:44:40 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  Just thought I'd mention quickly how I'm debugging this
thus far.

The issue appears to be in knownInfo in info.clisp, which is called
recursively.  If one copies info.clisp into
mnt/linux/autoload/info.lsp, and moves the info.o in that directory
out of the way, then one can reproduce the same error with the
interpreted code and debugging messages to taste.  Here is what I see
so far:

=============================================================================
knownInfo called with (|has| R (|Field|))
knownInfo called with T
calling 9 with T   ((|RetractableTo| E) T 42)
knownInfo called with T
foo is NIL, (|Field|) ((|RetractableTo| E))
calling 9 with T   ((|FreeModuleCat| R E) T 41)
knownInfo called with T
foo is NIL, (|Field|) ((|FreeModuleCat| R E))
calling 9 with T   ((|XAlgebra| R) T 40)
knownInfo called with T
foo is NIL, (|Field|) ((|XAlgebra| R))
calling 9 with T   ((|XAlgebra| R) T NIL)
knownInfo called with T
foo is NIL, (|Field|) ((|XAlgebra| R))
calling 9 with (|has| R (|CommutativeRing|))   ((|Algebra| R) (|has| R 
(|CommutativeRing|)) 39)
knownInfo called with (|has| R (|CommutativeRing|))
knownInfo called with T
calling 9 with T   ((|RetractableTo| E) T 42)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|RetractableTo| E))
calling 9 with T   ((|FreeModuleCat| R E) T 41)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|FreeModuleCat| R E))
calling 9 with T   ((|XAlgebra| R) T 40)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|XAlgebra| R))
calling 9 with T   ((|XAlgebra| R) T NIL)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|XAlgebra| R))
calling 9 with (|has| R (|CommutativeRing|))   ((|Algebra| R) (|has| R 
(|CommutativeRing|)) 39)
knownInfo called with (|has| R (|CommutativeRing|))
knownInfo called with T
calling 9 with T   ((|RetractableTo| E) T 42)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|RetractableTo| E))
calling 9 with T   ((|FreeModuleCat| R E) T 41)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|FreeModuleCat| R E))
calling 9 with T   ((|XAlgebra| R) T 40)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|XAlgebra| R))
calling 9 with T   ((|XAlgebra| R) T NIL)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|XAlgebra| R))
calling 9 with (|has| R (|CommutativeRing|))   ((|Algebra| R) (|has| R 
(|CommutativeRing|)) 39)
knownInfo called with (|has| R (|CommutativeRing|))
knownInfo called with T
calling 9 with T   ((|RetractableTo| E) T 42)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|RetractableTo| E))
calling 9 with T   ((|FreeModuleCat| R E) T 41)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|FreeModuleCat| R E))
calling 9 with T   ((|XAlgebra| R) T 40)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|XAlgebra| R))
calling 9 with T   ((|XAlgebra| R) T NIL)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|XAlgebra| R))
calling 9 with (|has| R (|CommutativeRing|))   ((|Algebra| R) (|has| R 
(|CommutativeRing|)) 39)
knownInfo called with (|has| R (|CommutativeRing|))
knownInfo called with T
calling 9 with T   ((|RetractableTo| E) T 42)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|RetractableTo| E))
calling 9 with T   ((|FreeModuleCat| R E) T 41)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|FreeModuleCat| R E))
calling 9 with T   ((|XAlgebra| R) T 40)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|XAlgebra| R))
calling 9 with T   ((|XAlgebra| R) T NIL)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|XAlgebra| R))
calling 9 with (|has| R (|CommutativeRing|))   ((|Algebra| R) (|has| R 
(|CommutativeRing|)) 39)
knownInfo called with (|has| R (|CommutativeRing|))
knownInfo called with T
calling 9 with T   ((|RetractableTo| E) T 42)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|RetractableTo| E))
calling 9 with T   ((|FreeModuleCat| R E) T 41)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|FreeModuleCat| R E))
calling 9 with T   ((|XAlgebra| R) T 40)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|XAlgebra| R))
calling 9 with T   ((|XAlgebra| R) T NIL)
knownInfo called with T
foo is NIL, (|CommutativeRing|) ((|XAlgebra| R))
calling 9 with (|has| R (|CommutativeRing|))   ((|Algebra| R) (|has| R 
(|CommutativeRing|)) 39)
knownInfo called with (|has| R (|CommutativeRing|))
knownInfo called with T
calling 9 with T   ((|RetractableTo| E) T 42)
...
=============================================================================

(DEFUN |knownInfo| (|pred|) (format t "knownInfo called with ~S~%"
|pred|) (PROG (|attr| |x| |cat| |a| |vmode| |l| |LETTMP#1| |vv|
|catlist| |u| |ISTMP#1| |name| |ISTMP#2| |op| |ISTMP#3| |sig| |v|
|ww|) (RETURN (SEQ (COND ((BOOT-EQUAL |pred| (QUOTE T)) (QUOTE T))
((|member| |pred| (|get| (QUOTE |$Information|) (QUOTE |special|)
|$e|)) (QUOTE T)) ((AND (PAIRP |pred|) (EQ (QCAR |pred|) (QUOTE OR))
(PROGN (SPADLET |l| (QCDR |pred|)) (QUOTE T))) (PROG (#0=#:G4026)
(SPADLET #0# NIL) (RETURN (DO ((#1=#:G4032 NIL #0#) (#2=#:G4033 |l|
(CDR #2#)) (|u| NIL)) ((OR #1# (ATOM #2#) (PROGN (SETQ |u| (CAR #2#))
NIL)) #0#) (SEQ (EXIT (SETQ #0# (OR #0# (progn (format t "calling 1
with ~S~%" |u|) (|knownInfo| |u|)))))))))) ((AND (PAIRP |pred|) (EQ
(QCAR |pred|) (QUOTE AND)) (PROGN (SPADLET |l| (QCDR |pred|)) (QUOTE
T))) (PROG (#3=#:G4040) (SPADLET #3# (QUOTE T)) (RETURN (DO
((#4=#:G4046 NIL (NULL #3#)) (#5=#:G4047 |l| (CDR #5#)) (|u| NIL))
((OR #4# (ATOM #5#) (PROGN (SETQ |u| (CAR #5#)) NIL)) #3#) (SEQ (EXIT
(SETQ #3# (AND #3# (progn (format t "calling 2 with ~S~%" |u|)
(|knownInfo| |u|)))))))))) ((AND (PAIRP |pred|) (EQ (QCAR |pred|)
(QUOTE |or|)) (PROGN (SPADLET |l| (QCDR |pred|)) (QUOTE T))) (PROG
(#6=#:G4054) (SPADLET #6# NIL) (RETURN (DO ((#7=#:G4060 NIL #6#)
(#8=#:G4061 |l| (CDR #8#)) (|u| NIL)) ((OR #7# (ATOM #8#) (PROGN (SETQ
|u| (CAR #8#)) NIL)) #6#) (SEQ (EXIT (SETQ #6# (OR #6# (progn (format
t "calling 3 wqith ~S~%" |u|) (|knownInfo| |u|)))))))))) ((AND (PAIRP
|pred|) (EQ (QCAR |pred|) (QUOTE |and|)) (PROGN (SPADLET |l| (QCDR
|pred|)) (QUOTE T))) (PROG (#9=#:G4068) (SPADLET #9# (QUOTE T))
(RETURN (DO ((#10=#:G4074 NIL (NULL #9#)) (#11=#:G4075 |l| (CDR #11#))
(|u| NIL)) ((OR #10# (ATOM #11#) (PROGN (SETQ |u| (CAR #11#)) NIL))
#9#) (SEQ (EXIT (SETQ #9# (AND #9# (progn (format t "calling 4 with
~S~%" |u|) (|knownInfo| |u|)))))))))) ((AND (PAIRP |pred|) (EQ (QCAR
|pred|) (QUOTE ATTRIBUTE)) (PROGN (SPADLET |ISTMP#1| (QCDR |pred|))
(AND (PAIRP |ISTMP#1|) (PROGN (SPADLET |name| (QCAR |ISTMP#1|))
(SPADLET |ISTMP#2| (QCDR |ISTMP#1|)) (AND (PAIRP |ISTMP#2|) (EQ (QCDR
|ISTMP#2|) NIL) (PROGN (SPADLET |attr| (QCAR |ISTMP#2|)) (QUOTE
T))))))) (SPADLET |v| (|compForMode| |name| |$EmptyMode| |$e|)) (COND
((NULL |v|) (|stackSemanticError| (CONS (QUOTE |can't find category of
|) (CONS |name| NIL)) NIL)) ((QUOTE T) (SPADLET |LETTMP#1|
(|compMakeCategoryObject| (CADR |v|) |$e|)) (SPADLET |vv| (CAR
|LETTMP#1|)) (COND ((NULL |vv|) (|stackSemanticError| (CONS (QUOTE
|can't make category of |) (CONS |name| NIL)) NIL)) ((|member| |attr|
(ELT |vv| 2)) (QUOTE T)) ((SPADLET |x| (|assoc| |attr| (ELT |vv| 2)))
(progn (format t "calling 5 with ~S~%" (cadr |x|)) (|knownInfo| (CADR
|x|)))) ((QUOTE T) NIL))))) ((AND (PAIRP |pred|) (EQ (QCAR |pred|)
(QUOTE |has|)) (PROGN (SPADLET |ISTMP#1| (QCDR |pred|)) (AND (PAIRP
|ISTMP#1|) (PROGN (SPADLET |name| (QCAR |ISTMP#1|)) (SPADLET |ISTMP#2|
(QCDR |ISTMP#1|)) (AND (PAIRP |ISTMP#2|) (EQ (QCDR |ISTMP#2|) NIL)
(PROGN (SPADLET |cat| (QCAR |ISTMP#2|)) (QUOTE T))))))) (COND ((AND
(PAIRP |cat|) (EQ (QCAR |cat|) (QUOTE ATTRIBUTE)) (PROGN (SPADLET |a|
(QCDR |cat|)) (QUOTE T))) (progn (format t "calling 6 with ~S~%" (CONS
(QUOTE ATTRIBUTE) (CONS |name| |a|))) (|knownInfo| (CONS (QUOTE
ATTRIBUTE) (CONS |name| |a|))))) ((AND (PAIRP |cat|) (EQ (QCAR |cat|)
(QUOTE SIGNATURE)) (PROGN (SPADLET |a| (QCDR |cat|)) (QUOTE T)))
(progn (format t "calling 7 with ~S~%" (CONS (QUOTE SIGNATURE) (CONS
|name| |a|))) (|knownInfo| (CONS (QUOTE SIGNATURE) (CONS |name|
|a|))))) ((AND (PAIRP |name|) (EQ (QCAR |name|) (QUOTE |Union|))) NIL)
((QUOTE T) (SPADLET |v| (|compForMode| |name| |$EmptyMode| |$e|))
(COND ((NULL |v|) (|stackSemanticError| (CONS (QUOTE |can't find
category of |) (CONS |name| NIL)) NIL)) ((QUOTE T) (SPADLET |vmode|
(CADR |v|)) (COND ((BOOT-EQUAL |cat| |vmode|) (QUOTE T)) ((AND (PAIRP
|vmode|) (EQ (QCAR |vmode|) (QUOTE |Join|)) (PROGN (SPADLET |l| (QCDR
|vmode|)) (QUOTE T)) (|member| |cat| |l|)) (QUOTE T)) ((QUOTE T)
(SPADLET |LETTMP#1| (|compMakeCategoryObject| |vmode| |$e|)) (SPADLET
|vv| (CAR |LETTMP#1|)) (SPADLET |catlist| (ELT |vv| 4)) (COND ((NULL
|vv|) (|stackSemanticError| (CONS (QUOTE |can't make category of |)
(CONS |name| NIL)) NIL)) ((|member| |cat| (CAR |catlist|)) (QUOTE T))
((AND (SPADLET |u| (|assoc| |cat| (CADR |catlist|))) (progn (format t
"calling 8 with ~S~%" (cadr |u|)) (|knownInfo| (CADR |u|)))) (QUOTE
T)) ((PROG (#12=#:G4082) (SPADLET #12# NIL) (RETURN (DO ((#13=#:G4089
NIL #12#) (#14=#:G4090 (CADR |catlist|) (CDR #14#)) (|u| NIL)) ((OR
#13# (ATOM #14#) (PROGN (SETQ |u| (CAR #14#)) NIL)) #12#) (SEQ (EXIT
(COND ((progn (format t "calling 9 with ~S ~S~%" (cadr |u|) |u|)
(|knownInfo| (CADR |u|))) (SETQ #12# (OR #12# (let ((foo (|AncestorP|
|cat| (LIST (CAR |u|))))) (format t "foo is ~S, ~S ~S~%" foo |cat|
(list (car |u|))) foo) ))))))))) (QUOTE T)) ((QUOTE T) NIL)))))))))
((AND (PAIRP |pred|) (EQ (QCAR |pred|) (QUOTE SIGNATURE)) (PROGN
(SPADLET |ISTMP#1| (QCDR |pred|)) (AND (PAIRP |ISTMP#1|) (PROGN
(SPADLET |name| (QCAR |ISTMP#1|)) (SPADLET |ISTMP#2| (QCDR |ISTMP#1|))
(AND (PAIRP |ISTMP#2|) (PROGN (SPADLET |op| (QCAR |ISTMP#2|)) (SPADLET
|ISTMP#3| (QCDR |ISTMP#2|)) (AND (PAIRP |ISTMP#3|) (PROGN (SPADLET
|sig| (QCAR |ISTMP#3|)) (QUOTE T))))))))) (SPADLET |v| (|get| |op|
(QUOTE |modemap|) |$e|)) (DO ((#15=#:G4102 |v| (CDR #15#)) (|w| NIL))
((OR (ATOM #15#) (PROGN (SETQ |w| (CAR #15#)) NIL)) NIL) (SEQ (EXIT
(PROGN (SPADLET |ww| (CDAR |w|)) (SEQ (COND ((AND (BOOT-EQUAL (LENGTH
|ww|) (LENGTH |sig|)) (|SourceLevelSubsume| |ww| |sig|)) (COND
((BOOT-EQUAL (CAADR |w|) (QUOTE T)) (EXIT (RETURN (QUOTE
T))))))))))))) ((QUOTE T) NIL))))))
=============================================================================

Take care,

root <address@hidden> writes:

> Camm,
> 
> btw, your CC list is wrong. You reference address@hidden not
> address@hidden
> 
> > 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 :-)
> 
> DEBUGGING HINTS:
> 
> 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
> subdirectory.
> 
> You can drop into lisp by typing:
> )fin
> and return to the Axiom prompt by typing:
> (restart)
> 
> You can issue any lisp command (e.g. call the function foo) thus:
> )lisp (foo)
> 
> RECURSION ISSUE:
> 
> 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:
> 
> 1
> )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.
> 
> INFINITE LOOP ISSUE:
> 
> 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. 
> 
> If
> (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.
> 
> Tim
> address@hidden
> address@hidden
> 
> 
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

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