From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!lll-winken!lll-crg.llnl.gov!daven From: daven@lll-crg.llnl.gov (Dave Nelson) Newsgroups: comp.lang.ada Subject: Re: Type NATURAL isn't Message-ID: <9072@lll-winken.llnl.gov> Date: 24 Jun 88 17:50:55 GMT References: <8806231808.AA15365@spp3.SPP> Sender: usenet@lll-winken.llnl.gov Reply-To: daven@lll-crg.llnl.gov.UUCP (Dave Nelson) Organization: Lawrence Livermore National Laboratory List-Id: 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