comp.lang.ada
 help / color / mirror / Atom feed
From: "Ira Baxter" <idbaxter@semdesigns.com>
Subject: Re: Announce: The Ultimate SI Units Cracker
Date: Fri, 13 Sep 2002 09:34:20 -0500
Date: 2002-09-13T09:34:20-05:00	[thread overview]
Message-ID: <3d81f731@giga.realtime.net> (raw)
In-Reply-To: mailman.1031893204.31270.comp.lang.ada@ada.eu.org

> And what's most unsatisfactory is that despite all these overloadings, you
> cannot get
>
>   function "**" (Base: SI_Unit; Exp: Rational) return SI_Unit;
>  <other complaints edited out>

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.

<plug>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.
</plug>

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






  reply	other threads:[~2002-09-13 14:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-13  4:53 Announce: The Ultimate SI Units Cracker Grein, Christoph
2002-09-13 14:34 ` Ira Baxter [this message]
2002-09-13 20:50   ` Stephen Leake
2002-09-16 10:22   ` Fraser Wilson
2002-09-13 15:41 ` Wes Groleau
  -- strict thread matches above, loose matches on Subject: below --
2002-09-13  5:34 Grein, Christoph
2002-09-12 11:59 Grein, Christoph
2002-09-12 11:51 Grein, Christoph
2002-09-12  8:11 Grein, Christoph
2002-09-12 10:14 ` Preben Randhol
2002-09-12 10:50 ` Jeffrey Creem
2002-09-12 14:06 ` Wes Groleau
2002-09-12 17:06   ` Randy Brukardt
2002-09-13 15:20     ` Wes Groleau
2002-09-13 20:54       ` Randy Brukardt
2002-09-13 22:09   ` Dmitry A.Kazakov
2002-09-13 15:26     ` Wes Groleau
2002-09-15  6:21       ` Dmitry A.Kazakov
2002-09-15  0:24         ` Mark Biggar
2002-09-16  1:35           ` Dmitry A.Kazakov
replies disabled

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