comp.lang.ada
 help / color / mirror / Atom feed
* Type NATURAL isn't
@ 1988-06-23 18:08 Scott Simpson
  1988-06-24 14:45 ` Dennis Doubleday
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Scott Simpson @ 1988-06-23 18:08 UTC (permalink / raw)


Can anybody explain why the LRM declares NATURAL as
    
    subtype NATURAL is INTEGER range 0..INTEGER'LAST;

Natural numbers start at 1!  Any mathematician would assume it
to be the same declaration as POSITIVE.  A better solution would
be
    subtype WHOLE is INTEGER range 0..INTEGER'LAST;

You might argue that I could make the declarations

    subtype WHOLE is NATURAL;
    subtype NATURAL is STANDARD.NATURAL range 1..INTEGER'LAST;

but then any Ada programmer who reads my code will get thoroughly
confused.  I talked to my boss, Frank Belz, and he said that when Ada
was being developed, a number of people complained that they thought
of natural numbers as starting at zero so they made the language that
way.  This is clearly incorrect.
	Scott Simpson
	TRW Space and Defense Sector
	...{decvax,ihnp4,ucbvax}!trwrb!simpson  (UUCP)
	trwrb!simpson@trwind.trw.com		(Internet)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Type NATURAL isn't
  1988-06-23 18:08 Type NATURAL isn't Scott Simpson
@ 1988-06-24 14:45 ` Dennis Doubleday
  1988-06-27 15:49   ` Larry Woods
  1988-06-24 17:50 ` Dave Nelson
  1988-06-25  0:06 ` Steven Ryan
  2 siblings, 1 reply; 7+ messages in thread
From: Dennis Doubleday @ 1988-06-24 14:45 UTC (permalink / raw)


In article <8806231808.AA15365@spp3.SPP> simpson@spp3.UUCP (Scott Simpson) writes:
>Can anybody explain why the LRM declares NATURAL as
>    
>    subtype NATURAL is INTEGER range 0..INTEGER'LAST;
>
>Natural numbers start at 1!  Any mathematician would assume it
>to be the same declaration as POSITIVE.

I've never heard this before.  The first two books I took off my
bookshelf both define the set N of natural numbers as
{0,1,2,3...}.  These books are "Computability, Complexity, and
Languages" by Martin D. Davis and Elaine J. Weyuker, and "Discrete
Mathemetical Structures with Applications to Computer Science" by J.P.
Tremblay and R. Manohar.  Is there disagreement over the definition of
the set of natural numbers?



-- 
Dennis Doubleday                       dd@sei.cmu.edu
Software Engineering Institute         (412)268-5873
Carnegie Mellon University
Pittsburgh, PA 15213

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Type NATURAL isn't
  1988-06-23 18:08 Type NATURAL isn't Scott Simpson
  1988-06-24 14:45 ` Dennis Doubleday
@ 1988-06-24 17:50 ` Dave Nelson
  1988-06-28 17:15   ` stt
  1988-06-25  0:06 ` Steven Ryan
  2 siblings, 1 reply; 7+ messages in thread
From: Dave Nelson @ 1988-06-24 17:50 UTC (permalink / raw)


In article <8806231808.AA15365@spp3.SPP> simpson@spp3.UUCP (Scott Simpson) writes:
>Can anybody explain why the LRM declares NATURAL as
>    
>    subtype NATURAL is INTEGER range 0..INTEGER'LAST;
>
>Natural numbers start at 1!  Any mathematician would assume it
>to be the same declaration as POSITIVE.  A better solution would
>be
>    subtype WHOLE is INTEGER range 0..INTEGER'LAST;
>
>You might argue that I could make the declarations
>
>    subtype WHOLE is NATURAL;
>    subtype NATURAL is STANDARD.NATURAL range 1..INTEGER'LAST;
>
>but then any Ada programmer who reads my code will get thoroughly
>confused.  I talked to my boss, Frank Belz, and he said that when Ada
>was being developed, a number of people complained that they thought
>of natural numbers as starting at zero so they made the language that
>way.  This is clearly incorrect.
>	Scott Simpson
>	TRW Space and Defense Sector
>	...{decvax,ihnp4,ucbvax}!trwrb!simpson  (UUCP)
>	trwrb!simpson@trwind.trw.com		(Internet)
>
One mustn't be so dogmatic about such things!  Speaking for any and all
mathematicians ;-), definitions differ.  For instance, in
van der Waerden's "Algebra", 7th edition, New York: Ungar, 1970, p 3, we see

"We presume that the reader is familiar with the set of natural numbers
(positive integers),

	1, 2, 3, ...,

as well as [the usual stuff about Peano's postulates] ... ."

However, in Lang's "Real Analysis", Reading: Addison-Wesley, 1969, p 4, we see

"We denote by Z+ the set of positive integers (integers > 0), ...
We denote by N the set of natural numbers (integers >= 0)."

Just to show that it's not a battle between the analysts and algebraists,
we see that Halmos, in "Naive Set Theory", New York: Van Nostrand, 1960,
p 44, states:

"A natural number is, by definition, an element of the minimal successor set
omega.  This definition is the rigorous counterpart of the intuitive
description according to which they consist of 0, 1, 2, 3, 'and so on.' "

It doesn't really matter, as long as you define your terms.  And that's just
what the Ada people did.

Dave Nelson

(defrocked mathematician, who has finally found a use for those
old math texts stored in a musty bookcase in his office).

daven (Dave Nelson)
arpa:  daven @ lll-crg.llnl.gov
uucp:  ...{seismo,gymble,mordor,sun,lll-lcc}!lll-crg!daven

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Type NATURAL isn't
  1988-06-23 18:08 Type NATURAL isn't Scott Simpson
  1988-06-24 14:45 ` Dennis Doubleday
  1988-06-24 17:50 ` Dave Nelson
@ 1988-06-25  0:06 ` Steven Ryan
  2 siblings, 0 replies; 7+ messages in thread
From: Steven Ryan @ 1988-06-25  0:06 UTC (permalink / raw)


In article <8806231808.AA15365@spp3.SPP> simpson@spp3.UUCP (Scott Simpson) writes:
>Natural numbers start at 1!  Any mathematician would assume it
>to be the same declaration as POSITIVE.

Number theory which deals with the properties of natural numbers starts at
zero. Before appealing to a mathematical definition, be aware some people use
natural to refer to {0,1,2,...} and others use {1,2,3,...} and whole as
{0,1,2,...}. Whatever the authour finds useful.

A word means what I say means, nothing more or less.
                   - H Dumpty

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Type NATURAL isn't
  1988-06-24 14:45 ` Dennis Doubleday
@ 1988-06-27 15:49   ` Larry Woods
  1988-06-28 20:05     ` Walter E. Pohl
  0 siblings, 1 reply; 7+ messages in thread
From: Larry Woods @ 1988-06-27 15:49 UTC (permalink / raw)


According to Webster's Seventh New Collegiate Dictionary:

   natural number: the number 1 or any number (as 3, 12, 432)
   obtained by repeatedly adding 1 to this number.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Type NATURAL isn't
  1988-06-24 17:50 ` Dave Nelson
@ 1988-06-28 17:15   ` stt
  0 siblings, 0 replies; 7+ messages in thread
From: stt @ 1988-06-28 17:15 UTC (permalink / raw)



In most high school mathematics texts, "Natural" starts at 1.
I think once you get into most grad schools, zero has been given
full "natural" status.  "Whole" numbers included all of the
positive and negative integers in at least one text.
And for many friends of 2's complement notation, "positive"
includes zero.

Probably the right names for the STANDARD
integer subtypes would have been:
  "Zero_Dot_Dot_Integer_Tic_Last"
and
  "One_Dot_Dot_Integer_Tic_Last"

Tucker Taft
Intermetrics, Inc.
Cambridge, MA  02138

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Type NATURAL isn't
  1988-06-27 15:49   ` Larry Woods
@ 1988-06-28 20:05     ` Walter E. Pohl
  0 siblings, 0 replies; 7+ messages in thread
From: Walter E. Pohl @ 1988-06-28 20:05 UTC (permalink / raw)



	When I was in junior high or something, I was told that the Whole
numbers went from 0 to infinity, and the naturals from 1 to infinity.
	In contemporary math usage, this is WRONG WRONG WRONG.  In all the
math courses I've taken in college, and all the math books I've read (and I
mean college-level or above), the whole numbers are never mentioned, and the
naturals go from 0 to infinity.  Now, I'm sure there are exceptions, but I 
think that this is enough evidence to support the decision of the ADA developersto call this type natural

				Walt
				Wpohl@hvrunix

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1988-06-28 20:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1988-06-23 18:08 Type NATURAL isn't Scott Simpson
1988-06-24 14:45 ` Dennis Doubleday
1988-06-27 15:49   ` Larry Woods
1988-06-28 20:05     ` Walter E. Pohl
1988-06-24 17:50 ` Dave Nelson
1988-06-28 17:15   ` stt
1988-06-25  0:06 ` Steven Ryan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox