On 11/15/2006 01:55 PM, Page, Bill wrote:
I tried writing:

  test(a:Fraction UnivariatePolynomial(x, F)):Fraction
UnivariatePolynomial(x, F) ==
    elt(a,1$Fraction(UnivariatePolynomial(x,
F)))$UnivariatePolynomial(x, F)

but Aldor continues to insist that there is no such elt that
returns Fraction UnivariatePolynomial(x, F). Perhaps it is a
compiler bug?

I cannot say whether that is a bug or not. I just tend to say it is.
When I started with Axiom, I always wondered about the "elt". Now I interpret it as abbreviation of "element" whose meaning is similar to extracting the n-th element of an array. So why not replacing "elt" by the "." in the form given below?

#include "axiom.as"

P ==> UnivariatePolynomial(x,F);
Q ==> Fraction P;

TestEval(x: Symbol, F: Field): with {
        test1: Q -> Q;
        test2: Q -> Q;
} == add {
        import from P;
        test1(a: Q): Q == a.(1$Q);
        test2(a: Q): Q == elt(a, 1$Q);
}

If you remove test2. That code compiles

F ==> Fraction Integer
P ==> UP(x, F)
Q ==> Fraction P
p1: P := x + 3
p2: P := x+4
q: Q := p1/p2
)co eval.as
T ==> TestEval(x, F)
test1(q)$T

(8) ->
        4
   (8)  -
        5
           Type: Fraction UnivariatePolynomial(x,Fraction Integer)

The interesting part is when one simply writes ...

        test1(a: Q): Q == a.1;

The error message will be...

)set compiler args "-O -Fasy -Fao -Flsp -laxiom -Mno-Aldor_W_WillObsolete -DAxiom -Y $AXIOM/algebra -mno-abbrev"
)co eval.as

"eval.as", line 11:         test1(a: Q): Q == a.1;
                    ...........................^
[L11 C28] #1 (Error) There are 2 meanings for the operator `apply'.
Meaning 1: (Fraction(UnivariatePolynomial(x, F) pretend IntegralDomain), Fraction(UnivariatePolynomial(x, F) pretend IntegralDomain)) -> Fraction(UnivariatePolynomial(x, F) pretend IntegralDomain) Meaning 2: (Fraction(UnivariatePolynomial(x, F)), UnivariatePolynomial(x, F) pretend SetCategory) -> Fraction(UnivariatePolynomial(x, F)) pretend Type

Ooops, "." is translated to "apply". Well, that is the usual translation in Aldor. But since HyperDoc finds only one apply with 2 arguments and there the first artument must be a Matrix, it seems that libaxiom.al does not reflect the SPAD source code in a 1-1 manner. It is still reasonable if we consider elt = apply, but I don't know where this translation happened. I could not find it in Broadbery's code that builds libaxiom.al. And so I am not even sure about whether elt=apply actually holds. I am certainly missing something.

That compiling test2 fails is certainly in connection with elt=apply. Who knows...

Ralf


_______________________________________________
Axiom-developer mailing list
Axiom-developer@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to