[Top][All Lists]

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

RE: [Axiom-developer] StepThrough

From: C Y
Subject: RE: [Axiom-developer] StepThrough
Date: Wed, 2 Nov 2005 11:11:18 -0800 (PST)

--- Bill Page <address@hidden> wrote:
> > How does one define what the "initial element" is in any
> > particular domain?
> According to the documentation:
> 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 the latter part is what Martin doesn't care for? 

> So 'init()$SomeDomain' is not required to be uniquely defined.

But it is presumably supposed to return something - a random starting
point, perhaps?

> 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'.

So the question becomes should the starting point be specifically
specified for each domain, even if there is no advantage to any
particular choice?

> > 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.

OK.  So all integers in theory have a unique representation and this
can be arrived at, even if in practice there are limits to the size of
the integers the computer can handle?
> > 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.


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

Hmm. OK, so Floats are in fact a subset of Reals.  

Hmm.  Could we say that all Floats are representable by an integer
multiplied by ten raised to an integer power?

> > > 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.

OK.  Do we actually want to provide this?
> > > 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.

Hmm. Well, it's a start anyway.

> > 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. 

Oh, don't worry.  But while I might not have to know everything I
certainly need to know something! 

I'm intrigued by an idea which I mentioned above and which had actually
occurred to me once before - are all numbers representible in a
computer actually integers multiplied by powers of ten?  If so, is the
whole notion of floating point computation in a computer reducible to
integer calculations in scientific notation?

> 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.

What, no head banging? ;-).  I'll give it a shot and see what happens.

> > > 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.

I was right - it should have been obvious. ;-)  I just wasn't thinking
about the limits of the type Float (which are actually universal to all
digital computers) - any finite digitial representation of real numbers
restricts the available numbers to a subset, and so next can actually
be defined as the next Float representible in the computer's Float
domain, which is a small number but does not approach zero at all
closely.  A step is meaningless in a continuum, but any numerical
domain a computer can work with is going to be discrete.  It's just
workable because the approximation is usually "good enough."  For
physical problems with measurement error bars, it might even be
provably good enough - for example, if we can represent length
descriptions to and just below the Heisenberg uncertainty limit we can
represent any measurement of length to any precision that the laws of
nature allow.  (I wonder if someone has done that...)


Yahoo! Mail - PC Magazine Editors' Choice 2005

reply via email to

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