axiom-developer
[Top][All Lists]

RE: [Axiom-developer] Question concerning types...

 From: Bill Page Subject: RE: [Axiom-developer] Question concerning types... Date: Tue, 19 Sep 2006 12:25:07 -0400

On September 19, 2006 11:21 AM Ralf Hemmecke wrote:
>
> http://wiki.axiom-developer.org/public/TheUnknownInComputerAlgebra.pdf
>
> Ah, by the way, I've read the paper and did not find it particularly
> useful. What they do is a bit too complicated in my eyes.
>
>  > )abbrev domain PUNINT PureUnknownInteger
>  > PureUnknownInteger (D,BasicUnknown):Ring == Implementation where
>  >     D:IntegerNumberSystem
>  >     BasicUnknown:List Symbol
>  >   Implementation ==> LocalAlgebra (Polynomial D,D,D) with
>  >     "/" : ($,D) ->$
>  >     ++ a/n computes the expression whose value is a/n if it
>  >     ++ is actually an unknown integer
>

Complicated? As far as I can see this is about a simple as it could
be.

Although there does appear to be some code missing from the paper.
This code does not compile as it is.

> It is certainly a wrong design to implement indefinite integers as
> polynomials.
>
> Why?
>
> Suppose you have a nice algebra library and you want the system
> to understand indefinite objects, then you are certainly not
> going to add any function to existing domains or wrap one (and
> actually ALL) domains with a domain constructor "Indefinite". No.
> It should be completely transparent.

I am not really sure I understand what you mean by "transparent" -
particularly in to the context of SPAD/Aldor. For the most part the
type system of SPAD/ALDOR is not "transparent" by design. One must
specify (almost) all types for these compilers. Unlike Haskell, for
example, type inference in Aldor is very limited.

Polynomials are necessarily involved in the definition of the
LocalAlgebra. Your argument is not an argument against using a
LocalAlgebra as an implementation of indefinite integers.

> The goal is to type
>
> n: Integer;
>
> and not
>
> n: Indefinite(Integer);
>
> Either the interpreter or some layer between interpreter and library
> code should take care about indefinite objects.
>

This could be easily achieved in the Axiom interpreter but I don't
think it makes any sense in the compiler. In the compiler you must
write:

n: Indefinite(Integer)

(or the equivalent) because of the semantics associated with

n: Integer

in a static strongly typed language.

> I very much believe that this requires reflection from SPAD/Aldor.
>

Why? I do not see reflection as essential in a statically typed
language.

Regards,
Bill Page.