axiom-developer
[Top][All Lists]
Advanced

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

RE: [Axiom-developer] StepThrough


From: Bill Page
Subject: RE: [Axiom-developer] StepThrough
Date: Wed, 2 Nov 2005 13:11:37 -0500

On November 2, 2005 9:59 AM C Y wrote:
>...
> --- Martin Rubey <address@hidden> wrote:
> > 
> > Currently, there is a category StepThrough defined in 
> > catdef.spad. It is used only in very few places, and as
> > I noted in 
> > 
> > http://wiki.axiom-developer.org/220StepThroughIsBraindead
> > 
> > it is brain-dead.
> 
> ... 
> How does one define what the "initial element" is in any
> particular domain?

According to the documentation:

http://wiki.axiom-developer.org/axiom--test--1/src/algebra/CatdefSpad

StepThrough denotes:

"A class of objects which can be 'stepped through'.
Repeated applications of \spadfun{nextItem} is guaranteed never to
return duplicate items and only return "failed" after exhausting
all elements of the domain.
This assumes that the sequence starts with \spad{init()}.
For infinite domains, repeated application \spadfun{nextItem}
is not required to reach all possible domain elements
starting from any initial element."

-------

So 'init()$SomeDomain' is not required to be uniquely defined.
It can in principle be any member of the domain. But some
choices might be more convenient then others because of the
requirements of 'nextItem'.

> How do you define what element comes "after" another element?

Since all representable members of a domain must have some
finite representation (i.e. internally represented by some
finite pattern of bits), so every member can be sorted in
at least this way with respect to all other members. In specific
cases, other orderings may be more convenient.

> I suppose Positive Real [sic] Integers would be obvious -
> init()->0, after that comes 1, etc., but you suggest "Float"
> should have StepThrough implemented? I have absolutely no idea
> what "next" means in this instance.  I suppose initial element
> would be 0.0 - is the element "after" this element 0.1?  0.0001?
> Clearly I'm missing something fundamental but I'm not sure what.

You should take a look at how 'nextItem' is defined in the
current Axiom source.

http://wiki.axiom-developer.org/axiom--test--1/src/algebra/FrontPage/searchw
iki?expr=nextItem

See for example:

http://wiki.axiom-developer.org/axiom--test--1/src/algebra/FmodSpad
http://wiki.axiom-developer.org/axiom--test--1/src/algebra/FfcatSpad
http://wiki.axiom-developer.org/axiom--test--1/src/algebra/FractionSpad

In Axiom 'Float' is not the same as the 'Real' number system.
For more details recall the discussion with William Sit about
Infinite Floats:

http://wiki.axiom-developer.org/RealNumbers

> 
> > What it really should do is to implement the notion of a
> > countable set. I was surprised at first, but this can be
> > effectively implemented.
> 
> I'll have to read up on the idea of a countable set.

In Axiom the natural representation of a countable set is
via a 'Stream'. If instead of 'nextItem' (or in addition to
it) every domain provided a stream, say 'memberOf', then
one would be able to write something like:

  (1) -> memberOf()$Integer

   [0,1,-1,2,-2, ... ]

                            Type: Stream Integer

Mathematically and logically speaking such domains are very
important for 'diagonalization' kind of proofs, e.g. that there
are the same number of Integers as there are PositiveIntegers.

>  
> > So, maybe you would like to do this. You will probably learn
> > a *lot* about axiom rather quickly, since you will have to
> > implement nextItem and prevItem for many domains, and you
> > will have to document what it is used for in those few where
> > it is already used, i.e., GENPGCD and in PFBRU.

As far as I know there is no operation of 'prevItem' anywhere
in Axiom and implementing it in addition to 'nextItem' or
'memberOf' might be challenging in some peculiar cases.

> 
> Sounds interesting, but I'd have to be comfortable first with
> what StepThrough is supposed to achieve, and I'm obviously
> missing some critical pieces.

Clifford! Just get started. :) You don't have to know everything
in order to proceed. Do something. Try something. And continue
to ask questions. I often find programming is like that: The
more time I spend thinking about it, the less motivation remains
to actually do something concrete. But once I get started, it
(usually) just flows. At some point I can stop programming
and starting thinking again ... :) And the cycle repeats.

>  
> > I have already working code for fraction.spad, so if you
> > are interested, I'll send you the details.

I am not sure what Martin means here about working code for
'fraction.spad' since it seems to me that it already has
some working code for 'StepThrough', but I would encourage
him to put something in the SandBox on the Axiom wiki so that
you can start to play with it.

> 
> I'd be interested certainly, but I need some background first.
> (BTY, this is why I said earlier I was unlikely to make any
> spectacular mathematical contributions. ;-)  Undoubtedly this
> should be obvious to me.)
> 

Now don't be self-deprecating, Grasshopper. :) I don't see
why you should assume that it "should be obvious to me".
Many obvious things are hardly worth doing.

Regards,
Bill Page.






reply via email to

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