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

Re: meta-comment on typing

This page is part of the web mail archives of SRFI 77 from before July 7th, 2015. The new archives for SRFI 77 contain all messages, not just those from before July 7th, 2015.




On Sun, 16 Oct 2005, Per Bothner wrote:

>Your argument hinges on the term "addition", which you don't define,
>so it's meaningless.

Well, I thought most of us learned what addition was in kindergarten,
got negative numbers somewhere in second or third grade, and then got
complex numbers somewhere in junior high.  Seriously, I mean plain,
ordinary, linear addition, the same as anyone who uses the term
unqualified outside of computer science.

Addition, as per the generally accepted definition, is not a modular
operation.  It is transitive, commutative, and reversible.  Modular
addition is transitive and commutative, but it is not reversible;
every modular addition loses information.

> What it really boils down to:
> * Is it wise/useful/desirable to overload operations so
> that different (but in-some-way-related) operations are named
> by the same operation name?

I believe that it is not.

> * Is it wise/useful/desirable overload the operation names for
> standard arithmetic to objects that don't obey all the rules
> of complex number arithmetic?

I believe that it is not.

> * A slightly different question: what is a number?  Is a quantity
> with a dimension a number?  Is a 32-bit unsigned machine integer
> a number?  Is a complex a number?

Both of the first two cases are examples of numbers plus additional
information.  A number with a dimension (such as "42 sunburned pigs")
is a number plus additional information.  A 32-bit machine word is
a bit field which may be interpreted as a particular way of
representing a member of a particular subset of numbers, but it is
not itself a number.  In this case the additional information is
the width including leading zero bits, which is implied by the size
of the representable subset, not by the number represented.

A complex number is more debatable; I think I am willing to call it
a number, but doing so often weirds math in the same way that verbing
nouns weirds language.

> I have no problem with you saying that you don't think my idea
> is a good idea.  (I'm not sure it is myself - probably not for R6RS.)
> But I don't think you have basis for calling t "dead wrong".

Well, I think that any operation that can take two positive arguments
and produce a negative result is not addition.

It fails to follow at least one of the basic properties of addition,
reversibility.

For example, if I know that I added something to 27 and got -32,
reversibility means I should be able to uniquely determine what was
added to 27; under the rules of linear addition, it would have to be
-59, not any positive number.  But with modular addition, it could be
either of two numbers, -59 and ($MODULUS - 59), so modular addition
isn't reversible like linear additon.

There are several other properties of linear addition that fail for
modular addition, too, but I won't go into them just now, because any
one of them is actually enough for me to consider something to be a
different operation.  I think that calling a nonreversible operation
"addition" without further qualifiers, is, in fact, dead wrong.
Sorry, but I truly believe that's just a statement of the mathematical
facts.  And yes, there are similar objections to overloading
multiplication, etc, with modular analogues.

				Bear