axiom-developer
[Top][All Lists]
Advanced

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

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


From: Page, Bill
Subject: RE: [Axiom-developer] Eval in Axiom/Aldor
Date: Wed, 15 Nov 2006 07:55:12 -0500

Ralf, 

On Wednesday, November 15, 2006 7:14 AM you wrote:
> 
> >> And I cant compile Martin one, maybe I should not assume that
> >> a Field is an INTDOM ...
> 
> > No it not necessary to assume that a Field is an INTDOM.
> 
> But it is true.
> 
> Field(): Category == Join(EuclideanDomain,UniqueFactorizationDomain,
>    DivisionRing) with ...
> EuclideanDomain(): Category == PrincipalIdealDomain with ...
> PrincipalIdealDomain(): Category == GcdDomain with ...
> GcdDomain(): Category == IntegralDomain with ...
>

You are right. I was not clear. I meant it is not necessary to
assume it *as an additional assumption* since it is true by
Axiom's definition of Field. But it is irrelevant to this problem.
 
> > I also don't understand Martin's workaround since Fraction does
> > not export elt with this signature.
> 
> But ...
> 
> UnivariatePolynomial(x:Symbol, R:Ring):
>    UnivariatePolynomialCategory(R) with ...
> 
> UnivariatePolynomialCategory(R:Ring): Category ==
>      ...
>      if R has IntegralDomain then
>          Eltable(Fraction %, Fraction %)
>          elt  : (Fraction %, Fraction %) -> Fraction %
>               ++ elt(a,b) evaluates the fraction of univariate 
> polynomials \spad{a}
>               ++ with the distinguished variable replaced by b.
> 
> So Martin's suggestion does not sound so wrong to me.
> 

Yes. However as I said, Fraction UnivariatePolynomial(x,F) does
not export elt so the workaround cannot work as it was written.

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?

In any case, isn't it strange that UnivariatePolynomialCategory
should be Eltable(Fraction %, Fraction %)? What is Fraction doing
in that definition of UnivariatePolynomial(x, F)?

Note the presence of

eval : (%,UnivariatePolynomial(x,Fraction
Integer),UnivariatePolynomial(x,Fraction Integer)) -> %

in the example below. This is the eval that I used in my version.

(1) -> F:=FRAC INT

   (1)  Fraction Integer
                                                     Type: Domain

(2) -> F has Field

   (2)  true
                                                     Type: Boolean

(3) -> F has IntegralDomain

   (3)  true
                                                     Type: Boolean

(4) -> UP(x,FRAC INT) has Eltable(FRAC UP(x,FRAC INT),FRAC UP(x,FRAC
INT))

   (4)  true
                                                     Type: Boolean

(5) -> )sh Fraction UnivariatePolynomial(x,FRAC INT)
 Fraction UnivariatePolynomial(x,Fraction Integer) is a domain
constructor.
 Abbreviation for Fraction is FRAC
 This constructor is exposed in this frame.
 Issue )edit C:/Program
Files/axiom/mnt/windows/../../src/algebra/FRAC.spad to s
ee algebra source code for FRAC

------------------------------- Operations
--------------------------------

 ?*? : (Fraction Integer,%) -> %       ?*? : (Integer,%) -> %
...
 euclideanSize : % -> NonNegativeInteger
 eval : (%,Equation UnivariatePolynomial(x,Fraction Integer)) -> %
 eval : (%,List Equation UnivariatePolynomial(x,Fraction Integer)) -> %
 eval : (%,List Symbol,List UnivariatePolynomial(x,Fraction Integer)) ->
%
 eval : (%,List UnivariatePolynomial(x,Fraction Integer),List
UnivariatePolynomial(x,Fraction Integer)) -> %
 eval : (%,Symbol,UnivariatePolynomial(x,Fraction Integer)) -> %
 eval : (%,UnivariatePolynomial(x,Fraction
Integer),UnivariatePolynomial(x,Fraction Integer)) -> %
 expressIdealMember : (List %,%) -> Union(List %,"failed")
...
 wholePart : % -> UnivariatePolynomial(x,Fraction Integer)

-----------

Regards,
Bill Page.




reply via email to

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