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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c42dbf68f5320193 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-09 13:58:31 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!cyclone.socal.rr.com!cyclone3.kc.rr.com!news3.kc.rr.com!twister.socal.rr.com.POSTED!not-for-mail Message-ID: <3CDAE30B.CFFB6F29@san.rr.com> From: Darren New X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Generation of permutations References: <5ee5b646.0205041652.63032ba6@posting.google.com> <3CDAB578.6F32339D@san.rr.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 09 May 2002 20:58:30 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1020977910 66.75.151.160 (Thu, 09 May 2002 13:58:30 PDT) NNTP-Posting-Date: Thu, 09 May 2002 13:58:30 PDT Organization: RoadRunner - West Xref: archiver1.google.com comp.lang.ada:23803 Date: 2002-05-09T20:58:30+00:00 List-Id: Stephen Leake wrote: > > Darren New writes: > > > Right. So? The question is not whether it's possible to look at one > > program and decide what it does. The question is whether it's possible > > to write a program to look at all programs and decide whether or not > > they sort. > > That's _your_ question. The question _I_ was addressing, as posed by > TMoran, was "Is the sequence of instructions emitted by GNAT when it > compiles bubble sort a program that sorts it's input". Well, I was addressing the "misinterpretation" claim. I don't think anyone claimed that the instructions emitted by compiling a bubble sort don't sort the list. I thought TMoran was saying that he was surprised that sorting was recursively undecidable since he can prove a bubble sort does indeed sort. But that's not what "recursively undecidable" means. I was addressing this: -------- > > but to determine whether a set of instructions constitutes a general > > sorting algorithm is obviously recursively undecidable. > So the set of instructions emitted by Gnat when it compiles bubble sort > code may or may not constitute a general sorting algorithm, and whether > it does or not is undecidable? I learn something new every day. --------- That's a misinterpretation of what "general sorting algorithm" and "recursively undecidable" means. Hence, that you're asking a different question is kind of ... irrelevant, and therefore not addressed. Everything you said was correct, except for any implication that it relates to undecidability. > You have to be careful in newsgroup discussions to pay attention to > the question the poster is asking, and not assume they are talking > about what you are talking about ! Well, you said "it doesn't sound like a misinterpretation to me". I was explaining how the second part of the quote between the lines there is a misinterpretation of the first part. > Ok. So what Tom Moran and I were missing was the notion that A _must_ > be allowed to vary over _all_ instruction sequences, not just _a > particular_ instruction sequence. That's an extremely important > distinction, and it was _not_ clear in Robert's original post, > although I can see how he thought it was implied. Correct. It's easy to prove that (say) a bubble sort does indeed sort. It's impossible to reliably determine if a given set of instructions (i.e., one given to you, not one chosen by you) does indeed sort an arbitrary list of numbers. "A given set of instructions" means whatever set I give you, not one that you get to pick. This is normal math-speak, so I'm not surprised that it was considered implied. Consider function square(a : double) return double is return a * a; end square; -- (assuming I got the syntax right) This "squares a given number". I.e., it squares whatever number you give it. If it doesn't work for any number you give it, then it doesn't "square a given number", at least in normal math-speak. > I agree that this is a trivial question. That's why Tom Moran was > surprised at Robert's response. (we are way lost in he said/she said > at this point :). I think so. I think the original point was that a slow-sort can't be implemented by generating random instruction sets until you find one that is a sort program, because you can't tell if any arbitrary randomly-generated set of instructions is a sort or not. Sure, if you design the code to be a sort, you can tell it's a sort, and even prove it's a sort, but you can't generate programs at random and say anything in particular about them. -- Darren New San Diego, CA, USA (PST). Cryptokeys on demand. The 90/10 rule of toothpaste: the last 10% of the tube lasts as long as the first 90%.