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-07 08:34:28 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.columbus.rr.com!cyclone3.kc.rr.com!news3.kc.rr.com!twister.socal.rr.com.POSTED!not-for-mail Message-ID: <3CD7F418.64E29243@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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 07 May 2002 15:34:28 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1020785668 66.75.151.160 (Tue, 07 May 2002 08:34:28 PDT) NNTP-Posting-Date: Tue, 07 May 2002 08:34:28 PDT Organization: RoadRunner - West Xref: archiver1.google.com comp.lang.ada:23652 Date: 2002-05-07T15:34:28+00:00 List-Id: tmoran@acm.org wrote: > Testing each of the successful programs against all possible combinations > of three letters from 'a' .. 'c', 9 of the programs successfully sorted > all combinations, ie, were general routines capable of sorting any > input data in their universe. I've seen this done to come up with the most efficient/shortest FORTRAN library routines. Basically, the program iterated through all possible machine code sets, starting with the shortest, until it found an instruction sequence that did the right thing. The researchers found (for example) a 2-instruction sequence that gives you the SIGN function (a<0 -> -1, a=0 -> 0, a>0 -> +1) that was totally unintuitive. (It involved, IIRC, a shift and a subtract or some such.) It was written up either in SIGPLAN or CACM about 10 years ago or so, IIRC. An interesting article. -- 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%.