[Top][All Lists]

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

Re: [Axiom-developer] Eval in Axiom/Aldor

From: Ralf Hemmecke
Subject: Re: [Axiom-developer] Eval in Axiom/Aldor
Date: Tue, 14 Nov 2006 00:26:50 +0100
User-agent: Thunderbird (X11/20061025)

Hi Antoine,

I don't know whether this is the right way to go, but at least it compiles and it might let you go further.


Replace "eval(a, x, 1)" by

    z: SingletonAsOrderedSet := create();
    eval(numer a, z, 1)/eval(denom a, z, 1);

Maybe you can make that shorter. In particular the numer/denom part is perhaps too much, but that is what I have found to work, ehm compile.

Now, don't ask me how to relate x and z. The reason why I have introduced that z lies in the definition of UP. It is not defined as PolynomialCategory as such, but the code says...

UnivariatePolynomial(x:Symbol, R:Ring):
  UnivariatePolynomialCategory(R) with

and there you already see that in a category default, you have no chance of seeing the x.

But then it says...

UnivariatePolynomialCategory(R:Ring): Category ==
 Join(PolynomialCategory(R, NonNegativeInteger, SingletonAsOrderedSet),

which let me to define z as the only element of SingletonAsOrderedSet.

Maybe that helps a bit.


On 11/13/2006 11:44 PM, Antoine Hersen wrote:

I am having some issue with the eval function, any ideas ?
I have reduced my problem to the simplest form.
It is making me crazy !!!

Because UP, which is a PolynomialCat, has InnerEvalable

PolynomialCategory(R:Ring, E:OrderedAbelianMonoidSup, VarSet:OrderedSet):
        Category ==
  Join(PartialDifferentialRing VarSet, FiniteAbelianMonoidRing(R, E),
       Evalable %, InnerEvalable(VarSet, R),
       InnerEvalable(VarSet, %), RetractableTo VarSet,
       FullyLinearlyExplicitRingOver R)

What am I missing ?

Prog :

#include " <>"

TestEval( x:Symbol , F:Field): with {}
== add {

    import from UnivariatePolynomial(x,F) ;
    import from Fraction UnivariatePolynomial(x,F) ;

test(a:Fraction UnivariatePolynomial(x,F)):Fraction UnivariatePolynomial(x,F) == {
        eval(a, x, 1)

And here his the error message :

aldor -M no-abbrev -O -Fasy -Fao -Flsp -laxiom -Mno-AXL_W_WillObsolete -DAxiom -Y $AXIOM/algebra <>
#1 (Warning) Deprecated message prefix: use `ALDOR_' instead of `_AXL'
" <>", line 11:                 eval(a, x, 1)
[L11 C17] #2 (Error) No one possible return type satisfies the context type.
  These possible return types were rejected:
          -- Fraction(UnivariatePolynomial(x, F))
The context requires an expression of type Fraction(UnivariatePolynomial(x, F)).
The following could be suitable if imported:
eval: (Fraction(UnivariatePolynomial(x, F)), Symbol pretend SetCategory, UnivariatePolynomial(x, F) pretend Type) -> Fraction(UnivariatePolynomial(x, F)) from Fraction(UnivariatePolynomial(x, F)), if UnivariatePolynomial(x, F) has InnerEvalable(Symbol, UnivariatePolynomial(x, F))


Antoine Hersen


Axiom-developer mailing list

reply via email to

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