axiom-developer
[Top][All Lists]

## [Axiom-developer] Re: EXPR POLY INT

 From: Martin Rubey Subject: [Axiom-developer] Re: EXPR POLY INT Date: Tue, 15 Jun 2004 17:28:38 +0000

```William Sit writes:
> Just to keep the post by Martin in context. Here're the related exchanges:

Oops, thanks a lot William.

> > When saying f4()\$TEST, the former gets called (twice, once for f3 too):
> > The first time x is %A %A and y is %A and x /\$Rep y gives %A / %A, the
> > second time,
>
> you meant x /\$Rep y gives %A, not "%A / %A"?

Well, /\$REP is called two times, once in /\$EXPR calculating the result of f3,
then again in /\$EXPR calculating the result of f4. Curiously, it "works" the
first time, but not the second time.

Good news: I now know how to find out which function gets called! I said

cd axiom--release--1--patch-12/int/algebra/
grep "(DEFUN [^ ]*;/;" */* | less

to get a list of all functions "/", this list I massaged in emacs to
(trace |...|) the functions
and )lib the libraries,

AFTER calling f4()\$TEST once. (Otherwise trace will answer that the function is
.)

So this is what I get:

(10) -> f4()\$TEST

1> (|EXPR;/;3\$;14| ((1 #<vector 08f189f4> (1 0 1 %A (1 0 . 1))) 0 0 . 1) ((1
#<vector 08f189f4> (1 0 0 . 1)) 0 0 . 1) #<vector 09038e38>)
2> (|FIELD-;/;3S;11| ((1 #<vector 08f189f4> (1 0 1 %A (1 0 . 1))) 0 0 . 1)
((1 #<vector 08f189f4> (1 0 0 . 1)) 0 0 . 1) #<vector 08f182bc>)
<2 (|FIELD-;/;3S;11| ((0 1 %A (1 0 . 1)) 0 0 . 1))
<1 (|EXPR;/;3\$;14| ((0 1 %A (1 0 . 1)) 0 0 . 1))
1> (|EXPR;/;3\$;14| ((0 1 %A (1 0 . 1)) 0 0 . 1) ((1 #<vector 08f189f4> (1 0 0
. 1)) 0 0 . 1) #<vector 09038e38>)
2> (|FIELD-;/;3S;11| ((0 1 %A (1 0 . 1)) 0 0 . 1) ((1 #<vector 08f189f4> (1
0 0 . 1)) 0 0 . 1) #<vector 08f182bc>)
<2 (|FIELD-;/;3S;11| ((0 1 %A (1 0 . 1)) 1 #<vector 08f189f4> (1 0 0 . 1)))
<1 (|EXPR;/;3\$;14| ((0 1 %A (1 0 . 1)) 1 #<vector 08f189f4> (1 0 0 . 1)))

1> (|OUTFORM;/;3\$;59| %A %A #<vector 091c3284>)
<1 (|OUTFORM;/;3\$;59| ("/" %A %A))
%A
(10)  --
%A
Type: Expression Polynomial Integer

(11) -> a::EXPR INT/a

1> (|EXPR;/;3\$;14| ((1 #<vector 08c95ce8> (1 0 . 1)) 0 . 1) ((1 #<vector
08c95ce8> (1 0 . 1)) 0 . 1) #<vector 09007d58>)
2> (|FIELD-;/;3S;11| ((1 #<vector 08c95ce8> (1 0 . 1)) 0 . 1) ((1 #<vector
08c95ce8> (1 0 . 1)) 0 . 1) #<vector 08c951f8>)
<2 (|FIELD-;/;3S;11| ((0 . 1) 0 . 1))
<1 (|EXPR;/;3\$;14| ((0 . 1) 0 . 1))

(11)  1

I was rather astonished to see that the FIELD version of / is called.

More tomorrow.

Martin

```