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,DIET_1 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7e60c1d99ae3ffa1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-13 07:33:22 PST From: "Ira Baxter" Newsgroups: comp.lang.ada References: Subject: Re: Announce: The Ultimate SI Units Cracker Date: Fri, 13 Sep 2002 09:34:20 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 NNTP-Posting-Host: t1-30.realtime.net Message-ID: <3d81f731@giga.realtime.net> X-Trace: giga.realtime.net 1031927601 t1-30.realtime.net (13 Sep 2002 09:33:21 -0500) Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!giga.realtime.net!not-for-mail Xref: archiver1.google.com comp.lang.ada:28928 Date: 2002-09-13T09:34:20-05:00 List-Id: > And what's most unsatisfactory is that despite all these overloadings, you > cannot get > > function "**" (Base: SI_Unit; Exp: Rational) return SI_Unit; > The solution being discussed here appears to be a runtime solution, with runtime space consumption and time for checking. (These are probably modest). And, no errors will be detected unless the actual erroring computation is exercised. The comp.fortran.lang newsgroup had quite a nice discussion about this kind of mechanism for Fortran90 in the last year. One issue that came up was that there were limits to the check that could be done, as their scheme was to add a 32-bit tag word to each value containing an encoded version of the SI type for each value. Since a code word of fixed size can't encode every possible polynomial over SI units, they couldn't check every computation (however, they could check the most common ones, which is a pretty good engineering solution). It strikes me that the "ultimate" SI Units Checker (Cracker? odd name) is one that is implemented as a static analysis rather than a dynamic analysis. Advantages would be no runtime impact, full diagnosis of errors before runtime, without exercising the code, and no constraints on what could be checked. To do this, you need what amounts to the Ada compiler front end, munged to include unit declarations on data, complete with units checking. One might be able to implement this with ASIS and a pile of procedural code. One could also implement this with our DMS Software Reengineering Toolkit, which can be obtained with an Ada front-end. DMS also provides attribute evaluation, which makes it easy to propagate information (such as units information) around the abstract syntax tree and symbolic expression construction/simplification/matching. which would make it easy to encode and check arbitrary SI units polynomials. See http://www.semdesigns.com/Products/DMS/DMSToolkit.html. Left to our own devices long enough, we may do this ourselves. But we're more likely to do Fortran90 or (heaven help us) C++, because of their popularity in the supercomputing community. -- Ira Baxter, Ph.D. CTO Semantic Designs www.semdesigns.com 512-250-1018