comp.lang.ada
 help / color / mirror / Atom feed
* GNAT and Dimension Checking
@ 2012-07-01  5:53 AdaMagica
  2012-07-01  6:25 ` Nasser M. Abbasi
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: AdaMagica @ 2012-07-01  5:53 UTC (permalink / raw)


I see that GNAT now has added packages System.Dim.* for dimension checking. However I cannot find any other documentation about these packages, neither in GNAT_UG nor in GNAT_RM.

Is there any?



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-01  5:53 GNAT and Dimension Checking AdaMagica
@ 2012-07-01  6:25 ` Nasser M. Abbasi
  2012-07-01 10:44   ` yogeshwarsing
  2012-07-01 15:18 ` AdaMagica
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 17+ messages in thread
From: Nasser M. Abbasi @ 2012-07-01  6:25 UTC (permalink / raw)


On 7/1/2012 12:53 AM, AdaMagica wrote:
> I see that GNAT now has added packages System.Dim.* for dimension checking.
>However I cannot find any other documentation about these packages,
>neither in GNAT_UG nor in GNAT_RM.
>
> Is there any?
>

did some googling, some links I found are

"Performing Dimensionality Analysis in GNAT"
http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Performing-Dimensionality-Analysis-in-GNAT.html

"Performing Dimensionality Analysis in GNAT"
http://docs.adacore.com/gnat-unw-docs/html/gnat_ugn_28.html

"[Ada] Documentation for GNAT dimensionality checking system"
http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26036.html

ps. The ads file for this package is s-sim.ads in the sources.

--Nasser





^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-01  6:25 ` Nasser M. Abbasi
@ 2012-07-01 10:44   ` yogeshwarsing
  2012-07-02 20:42     ` Anh Vo
  0 siblings, 1 reply; 17+ messages in thread
From: yogeshwarsing @ 2012-07-01 10:44 UTC (permalink / raw)
  Cc: nma

This feature is rather limited though. For example one cannot do conversions. If you have to work with an "irregular" unit, you will have to do the conversion yourself e.g.

with System.Dim.MKS; use System.Dim.Mks;
with System.Dim.Mks_IO; use System.Dim.Mks_IO;
with Text_IO; use Text_IO;

procedure Free_Fall3 is
       subtype Acceleration is Mks_Type
       with Dimension => ("m/s^2", Meter => 1, Second => -2, others => 0);
       G : constant acceleration := 127137.6 * km/(hour ** 2) ;
       T : Time := 10.0/3600.0 * hour;
       Distance : length;

     begin
       Put ("Gravitational constant: ");
       Put (G, Aft => 2, Exp => 0); Put_Line ("");
       Put ("Time: ");
       Put (T, fore => 4, Aft => 4, Exp => 0); Put_Line ("");
       Distance := 0.5 * G * T ** 2;
       Put ("distance travelled in 10 seconds (or 10/3600 hour) of free fall ");
       Put (Distance, fore => 4, Aft => 4, Exp => 0);
       Put_Line ("");
end Free_Fall3; 

You will still get the outputs in the default MKS units. So basically, it is just checking if your dimensions are right.


And I do not think that you are able to deal with record constructs such as

 type Motion_Parameter is
       record
         Radius: Length := 0.0 * m;
         Speed : Velocity := 0.0 * m/s;
         Time_Step    : Time :=  0.0 * s;
         Number_Of_Revolutions : Float := 0.0;
       end record;

since Motion_Parameter will need to have a specific dimension in terms of MKS and having different MKS units in the record structure makes this impossible.

YC



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-01  5:53 GNAT and Dimension Checking AdaMagica
  2012-07-01  6:25 ` Nasser M. Abbasi
@ 2012-07-01 15:18 ` AdaMagica
  2012-07-01 15:47   ` yogeshwarsing
  2012-07-06 10:47 ` AdaMagica
  2012-07-08 10:33 ` AdaMagica
  3 siblings, 1 reply; 17+ messages in thread
From: AdaMagica @ 2012-07-01 15:18 UTC (permalink / raw)


Thanks for the chapter - I just overlooked it.

The documentation, though, is rather terse. It doesn't tell you the syntax of the aspect clauses nor anything else than the most basic things.

All in all it looks promising - it's a very clever way to use the new aspects.

What I found out:

  G : constant acceleration := 127137.6 * km/(hour ** 2);
  Put (Sqrt (G), Aft => 2, Exp => 0); Put_Line ("");
yields 3.13 m**(1/2).s**(-1), so it handles fractional powers (at least 1/2).

Math functions except sqrt need dimensionless parameters.
However, sin (t, t0) should be allowed as long as t and t0 have the same dimension. It is not. Also arctan (x, y) is only allowed for dimensionless parameters.

We'll see how it turns out when applied to more complicated formulae, especially with those where parts have fractional dimensions (in SI, there are no items with fractional units, but intermediate ones do).

CGS cannot do without fractions.

Perhaps with some refinement, this could be a theme for Ada 2020 :-)
------------------
PS: Anyone interested in dimensional arithmetics in Ada should have a look at:

Ada Europe Conference 2003
    Christoph Grein, Dmitry A. Kazakov, Fraser Wilson
    A Survey of Physical Unit Handling Techniques in Ada

The conference proceedings have appeared at Springer-Verlag:

    © Springer-Verlag
    Jean-Pierre Rosen, Alfred Strohmeier (Eds)
    Reliable Software Technologies - Ada-Europe 2003
    8th Ada-Europe International Conference on Reliable Software Technologies
    Toulouse, France, June 16-20, 2003
    Proceedings
    Lecture Notes in Computer Science, Vol. 2655, Springer-Verlag, 2003 

The proceedings are also available at Springer-Verlag's web site, but you need to be a subscriber in order to read the full texts:
     http://link.springer.de/link/service/series/0558/tocs/t2655.htm
or
     http://link.springer-ny.com/link/service/series/0558/tocs/t2655.htm

For a quick overview, see
  http://www.christ-usch-grein.homepage.t-online.de/Ada/Dimension.html
where you can also find the full paper.

Have fun :-)



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-01 15:18 ` AdaMagica
@ 2012-07-01 15:47   ` yogeshwarsing
  0 siblings, 0 replies; 17+ messages in thread
From: yogeshwarsing @ 2012-07-01 15:47 UTC (permalink / raw)


On Sunday, July 1, 2012 4:18:37 PM UTC+1, AdaMagica wrote:
> PS: Anyone interested in dimensional arithmetics in Ada should have a look at:
> 
> Ada Europe Conference 2003
>     Christoph Grein, Dmitry A. Kazakov, Fraser Wilson
>     A Survey of Physical Unit Handling Techniques in Ada


Thanks for the link.

YC



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-01 10:44   ` yogeshwarsing
@ 2012-07-02 20:42     ` Anh Vo
  2012-07-02 20:58       ` Adam Beneschan
  0 siblings, 1 reply; 17+ messages in thread
From: Anh Vo @ 2012-07-02 20:42 UTC (permalink / raw)
  Cc: nma

On Sunday, July 1, 2012 3:44:19 AM UTC-7, (unknown) wrote:
> This feature is rather limited though. For example one cannot do conversions. If you have to work with an "irregular" unit, you will have to do the conversion yourself e.g.
> 
> with System.Dim.MKS; use System.Dim.Mks;
> with System.Dim.Mks_IO; use System.Dim.Mks_IO;
> with Text_IO; use Text_IO;
> 
> procedure Free_Fall3 is
>        subtype Acceleration is Mks_Type
>        with Dimension => ("m/s^2", Meter => 1, Second => -2, others => 0);
>        G : constant acceleration := 127137.6 * km/(hour ** 2) ;
>        T : Time := 10.0/3600.0 * hour;
>        Distance : length;
> 
>      begin
>        Put ("Gravitational constant: ");
>        Put (G, Aft => 2, Exp => 0); Put_Line ("");
>        Put ("Time: ");
>        Put (T, fore => 4, Aft => 4, Exp => 0); Put_Line ("");
>        Distance := 0.5 * G * T ** 2;
>        Put ("distance travelled in 10 seconds (or 10/3600 hour) of free fall ");
>        Put (Distance, fore => 4, Aft => 4, Exp => 0);
>        Put_Line ("");
> end Free_Fall3; 

I may be off track here. That is I thought I understood aspect syntax until I browsed to the definition of System.Dim.Mks.Mks_Type type.

  type Mks_Type is new Long_Long_Float
     with
      Dimension_System => (
        (Unit_Name => Meter,    Unit_Symbol => 'm',   Dim_Symbol => 'L'),
        (Unit_Name => Kilogram, Unit_Symbol => "kg",  Dim_Symbol => 'M'),
        (Unit_Name => Second,   Unit_Symbol => 's',   Dim_Symbol => 'T'),
        (Unit_Name => Ampere,   Unit_Symbol => 'A',   Dim_Symbol => 'I'),
        (Unit_Name => Kelvin,   Unit_Symbol => 'K',   Dim_Symbol => "Theta"),
        (Unit_Name => Mole,     Unit_Symbol => "mol", Dim_Symbol => 'N'),
        (Unit_Name => Candela,  Unit_Symbol => "cd",  Dim_Symbol => 'J'));

 Can anyone point me to the ARM 2012 paragraph(s) which supports this syntax in general. Thanks.

Anh Vo 




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-02 20:42     ` Anh Vo
@ 2012-07-02 20:58       ` Adam Beneschan
  2012-07-02 21:51         ` Anh Vo
  0 siblings, 1 reply; 17+ messages in thread
From: Adam Beneschan @ 2012-07-02 20:58 UTC (permalink / raw)


On Monday, July 2, 2012 1:42:04 PM UTC-7, Anh Vo wrote:
> On Sunday, July 1, 2012 3:44:19 AM UTC-7, (unknown) wrote:

> 
>   type Mks_Type is new Long_Long_Float
>      with
>       Dimension_System => (
>         (Unit_Name => Meter,    Unit_Symbol => 'm',   Dim_Symbol => 'L'),
>         (Unit_Name => Kilogram, Unit_Symbol => "kg",  Dim_Symbol => 'M'),
>         (Unit_Name => Second,   Unit_Symbol => 's',   Dim_Symbol => 'T'),
>         (Unit_Name => Ampere,   Unit_Symbol => 'A',   Dim_Symbol => 'I'),
>         (Unit_Name => Kelvin,   Unit_Symbol => 'K',   Dim_Symbol => "Theta"),
>         (Unit_Name => Mole,     Unit_Symbol => "mol", Dim_Symbol => 'N'),
>         (Unit_Name => Candela,  Unit_Symbol => "cd",  Dim_Symbol => 'J'));
> 
>  Can anyone point me to the ARM 2012 paragraph(s) which supports this syntax in general. Thanks.

13.1.1(38): "Implementations may support implementation-defined aspects. The aspect_specification for an implementation-defined aspect may use an implementation-defined syntax for the aspect_definition, and may follow implementation-defined legality and semantics rules."

                          -- Adam



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-02 20:58       ` Adam Beneschan
@ 2012-07-02 21:51         ` Anh Vo
  0 siblings, 0 replies; 17+ messages in thread
From: Anh Vo @ 2012-07-02 21:51 UTC (permalink / raw)


On Monday, July 2, 2012 1:58:41 PM UTC-7, Adam Beneschan wrote:
> On Monday, July 2, 2012 1:42:04 PM UTC-7, Anh Vo wrote:
> > On Sunday, July 1, 2012 3:44:19 AM UTC-7, (unknown) wrote:
> 
> > 
> >   type Mks_Type is new Long_Long_Float
> >      with
> >       Dimension_System => (
> >         (Unit_Name => Meter,    Unit_Symbol => 'm',   Dim_Symbol => 'L'),
> >         (Unit_Name => Kilogram, Unit_Symbol => "kg",  Dim_Symbol => 'M'),
> >         (Unit_Name => Second,   Unit_Symbol => 's',   Dim_Symbol => 'T'),
> >         (Unit_Name => Ampere,   Unit_Symbol => 'A',   Dim_Symbol => 'I'),
> >         (Unit_Name => Kelvin,   Unit_Symbol => 'K',   Dim_Symbol => "Theta"),
> >         (Unit_Name => Mole,     Unit_Symbol => "mol", Dim_Symbol => 'N'),
> >         (Unit_Name => Candela,  Unit_Symbol => "cd",  Dim_Symbol => 'J'));
> > 
> >  Can anyone point me to the ARM 2012 paragraph(s) which supports this syntax in general. Thanks.
> 
> 13.1.1(38): "Implementations may support implementation-defined aspects. The aspect_specification for an implementation-defined aspect may use an implementation-defined syntax for the aspect_definition, and may follow implementation-defined legality and semantics rules."
> 
>                           -- Adam

Ah I got it now. Thanks very much Adam.

Anh Vo



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-01  5:53 GNAT and Dimension Checking AdaMagica
  2012-07-01  6:25 ` Nasser M. Abbasi
  2012-07-01 15:18 ` AdaMagica
@ 2012-07-06 10:47 ` AdaMagica
  2012-07-08  1:50   ` Robert A Duff
  2012-07-08 10:33 ` AdaMagica
  3 siblings, 1 reply; 17+ messages in thread
From: AdaMagica @ 2012-07-06 10:47 UTC (permalink / raw)


I would like to invite all of you interested in dimensional algebra to a lively discussion about the findings in packages provided by GNAT.

I played around a bit and here are mine.

  GNAT Dimension_System Findings
==================================

Very clever use of the new aspect facilty.
Should be considered for standardisation in next Ada generation.

Currently very poorly documented.

There are a few minor problems and some (in my honest opinion) more severe
ones in output.

The following is based on the (Gaussian) CGS system.

  type CGS_Gauss is new Long_Long_Float
    with Dimension_System => ((Centimeter, "cm"),
                              (Gram      , 'g'),
                              (Second    , 's'));

  package CGS_Gauss_IO is new System.Dim.Float_IO (CGS_Gauss);
  use CGS_Gauss_IO;

  subtype Length is CGS_Gauss
    with Dimension => ("cm",
                       Centimeter => 1,
                       others     => 0);

  subtype Mass is CGS_Gauss
    with Dimension => ("g",
                       Gram   => 1,
                       others => 0);

  subtype Time is CGS_Gauss
    with Dimension => ("s",
                       Second => 1,
                       others => 0);

  cm: constant Length := 1.0;
  g : constant Mass   := 1.0;
  s : constant Time   := 1.0;

0. The syntax of aspects Dimension_System and Dimension is not documented.
--------------------------------------------------------------------------
It might seem obvious, but documentation is needed nevertheless.

In Dimension_System, up to 7 base dimensions may be defined (more lead to
a compilation error, less are tolerated).

1. How to define objects for dimensions without name?
-----------------------------------------------------
Imagine you have some charge, but not defined a subtype Charge.

   Q: CGS_Gauss := 40.0 * cm**(3/2)*g**(1/2)/s;  -- ???

This fails with
   dimensions mismatch in object declaration
   object type is dimensionless
   object expression has dimensions (3/2, 1/2, -1)

It's no problem to define the subtype

   subtype Charge is CGS_Gauss
     with Dimension => ("esu",
                        Centimeter => 3/2,
                        Gram       => 1/2,
                        Second     => -1);

and then write

   Q: Charge := 40.0 * cm**(3/2)*g**(1/2)/s;

but it is often the case that some intermediate value has to be stored
with an unnamed dimension. Very inconvenient if you have to locally
define a subtype for this.

** Dimension should be taken from the initial expression! **

2. Obviously GNAT can handle fractional dimensions.
---------------------------------------------------
This is very comfortable.

  Q: Charge := 40.0 * cm**(3/2)*g**(1/2)/s;
  R: Length := 10.0 * cm;
  
  Put (Q**2/R**2   , Aft => 2, Exp => 0);                    New_Line;
  Put (Q**2/R**2   , Aft => 2, Exp => 0, Symbols => "dyn");  New_Line;
  Put ((Q/R)**(5/7), Aft => 2, Exp => 0);                    New_Line;

  16.00 cm.g.s**(-2)
   2.69 cm**(5/14).g**(5/14).s**(-5/7)

However, I cannot find where

   function (Left: Dim_Type; Right: Rational) return Dim_Type;

is defined, let alone the type Rational.

The definition of Rational is flawed.

Don't write

  (8.0*cm)**(1/3+2/3)

this has the value 1. This, howver, is correct:

  (8.0*cm)**((1+2)/(5-2)) = 8.0*cm

(Admittedly, who would write such nonsense? Dimension checking is only done
for static expressions.)

Ahem - be careful:

  8.0**(1/3)     = 1
  8.0**(1/3)*cm  = 2.0*cm
 (8.0*cm)**(1/3) = 2.0*cm**(1/3)

You need a dimensioned value to give the correct result:

  One: constant CGS_Gauss := 1.0;  -- dimension 1, i.e. "dimensionless"
  8.0**(1/3)*One = 2.0

(In SI, results never have fractional dimensions, but intermediate values
may. So this is important also for SI.)

3. System.Dim.Float_IO is only output.
--------------------------------------
Values are correctly output with their dimension, very nice.

However, the name Float_IO is a lie, there is no dimensional input.

Input would be hard to achieve with the output syntax as produced now because
how to determine whether a dimension to read follows a number or not since
there is a separating space. We would need a multiplication sign instead.

  Put (Q**2/R**2, Aft => 2, Exp => 0);

results in

  16.00 cm.g.s**(-2)                     <=== How to read this back in?

Also the exponent in an output like 1.0 m**2.s could be taken as the
floating point number 2.0 when trying to read it in again (in input, missing
fore or aft is allowed).

Compare with

  16.00*cm.g.s**(-2)                     <=== This is dimensioned.

So checking the input for syntactic and semantic correctness is not easy.

Adding a symbol for the output is not checked! You can write any nonsense.

  Put (Q**2/R**2, Aft => 2, Exp => 0, Symbols => "dyn");  New_Line;
  Put (Q**2/R**2, Aft => 2, Exp => 0, Symbols => "m/s");  New_Line;
  16.00dyn                               <=== space missing (dyn undefined)!
  16.00m/s                               <=== nonsense!

  R: Length := 10.0 * cm;
  Put (R, Aft => 2, Exp => 0);                   New_Line;
  Put (R, Aft => 2, Exp => 0, Symbols => "km");  New_Line;
  10.00 cm                               <=== OK
  10.00km                                <=== Surprise, surprise!

This behaviour is apt to lead to confusion and program bugs!

4. Mathematics is included!
===========================

   package Math is new Ada.Numerics.Generic_Elementary_Functions (CGS_Gauss);
   use Math;

Any function requires dimensionless parameters and returns a dimensionless
result, except Sqrt, which correcly calculates the root of the dimension.

However:

  function Sin (X, Cycle : Float_Type'Base) return Float_Type'Base;

(Cos, Tan, Cot) should allow dimensioned parameters when both have the same
dimension.

  function Arcsin (X, Cycle : Float_Type'Base) return Float_Type'Base;

(Arccos) should request X dimensionless and the return value should be
dimensioned like Cycle.

   function Arctan (Y: Float_Type'Base;
                    X: Float_Type'Base := 1.0[;
                    Cycle : Float_Type'Base]) return Float_Type'Base;

(Arccot) should allow X and Y with the same dimension [and be dimensioned
like Cycle].

------------------------------------------

Any thoughts, other nice features or awkward shortcomings?



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-06 10:47 ` AdaMagica
@ 2012-07-08  1:50   ` Robert A Duff
  0 siblings, 0 replies; 17+ messages in thread
From: Robert A Duff @ 2012-07-08  1:50 UTC (permalink / raw)


AdaMagica <christ-usch.grein@t-online.de> writes:

> Currently very poorly documented.
>
> There are a few minor problems and some (in my honest opinion) more severe
> ones in output.

AdaCore won't do anything about the problems unless you send them
to report@adacore.com.

- Bob



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-01  5:53 GNAT and Dimension Checking AdaMagica
                   ` (2 preceding siblings ...)
  2012-07-06 10:47 ` AdaMagica
@ 2012-07-08 10:33 ` AdaMagica
  2012-07-08 11:37   ` Dmitry A. Kazakov
                     ` (2 more replies)
  3 siblings, 3 replies; 17+ messages in thread
From: AdaMagica @ 2012-07-08 10:33 UTC (permalink / raw)


On Sunday, July 8, 2012 3:50:51 AM UTC+2, Robert A Duff wrote:
> AdaMagica writes:
> 
> > Currently very poorly documented.
> >
> > There are a few minor problems and some (in my honest opinion) more severe
> > ones in output.
> 
> AdaCore won't do anything about the problems unless you send them
> to report@adacore.com.
> 
> - Bob

I do not want to post "problems" to AdaCore before some discussion in CLA. Perhaps others think differently or have other ideas. And if this is ever going to be standardised, it should be heavily discussed as an AI. Just collecting opinions here.

What astonishes me is that there are so few responses. Every now and then in the past, it seemed there were urgent requests for physical unit checking, and now that an ingenious proposal is there, there is dead silence.



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-08 10:33 ` AdaMagica
@ 2012-07-08 11:37   ` Dmitry A. Kazakov
  2012-07-08 14:13     ` AdaMagica
  2012-07-08 18:47   ` Jacob Sparre Andersen
  2012-07-09  8:20   ` Martin
  2 siblings, 1 reply; 17+ messages in thread
From: Dmitry A. Kazakov @ 2012-07-08 11:37 UTC (permalink / raw)


On Sun, 8 Jul 2012 03:33:10 -0700 (PDT), AdaMagica wrote:

> What astonishes me is that there are so few responses. Every now and then
> in the past, it seemed there were urgent requests for physical unit
> checking, and now that an ingenious proposal is there, there is dead
> silence.

I guess that most of these were made for the sake of argument rather than
out of concrete need. Actually, static-only dimension checks have almost no
use for engineering. Scientific computations might be different, however
require more than just dimensioned scalars, e.g. dimensioned vectors,
matrices etc. I think they just choose a units system and don't care about
dimension analysis.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-08 11:37   ` Dmitry A. Kazakov
@ 2012-07-08 14:13     ` AdaMagica
  0 siblings, 0 replies; 17+ messages in thread
From: AdaMagica @ 2012-07-08 14:13 UTC (permalink / raw)
  Cc: mailbox

On Sunday, July 8, 2012 1:37:16 PM UTC+2, Dmitry A. Kazakov wrote:
> On Sun, 8 Jul 2012 03:33:10 -0700 (PDT), AdaMagica wrote:
> 
> > What astonishes me is that there are so few responses. Every now and then
> > in the past, it seemed there were urgent requests for physical unit
> > checking, and now that an ingenious proposal is there, there is dead
> > silence.
> 
> I guess that most of these were made for the sake of argument rather than
> out of concrete need. Actually, static-only dimension checks have almost no
> use for engineering. Scientific computations might be different, however
> require more than just dimensioned scalars, e.g. dimensioned vectors,
> matrices etc. I think they just choose a units system and don't care about
> dimension analysis.
> 
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

This has always been my suspicion, which I've put down at several places. I guess this is not worth all the time AdaCore has spent on this.

But perhaps AdaCore have a different view on this. *They* know what *their* customers want and need.



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-08 10:33 ` AdaMagica
  2012-07-08 11:37   ` Dmitry A. Kazakov
@ 2012-07-08 18:47   ` Jacob Sparre Andersen
  2012-07-09 11:06     ` AdaMagica
  2012-07-09  8:20   ` Martin
  2 siblings, 1 reply; 17+ messages in thread
From: Jacob Sparre Andersen @ 2012-07-08 18:47 UTC (permalink / raw)


AdaMagica wrote:

> What astonishes me is that there are so few responses. Every now and
> then in the past, it seemed there were urgent requests for physical
> unit checking, and now that an ingenious proposal is there, there is
> dead silence.

Some of us are patiently waiting for Ludovic et al. to merge the
relevant patches into the Debian GNAT packages.

I find it interesting that AdaCore seem to have found a general solution
to the problem, but for the moment I manage fine with a slightly
modified version of Macks and statically generated checks.

Greetings,

Jacob
-- 
"War does not determine who is right - only who is left."
                                         -- Bertrand Russell



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-08 10:33 ` AdaMagica
  2012-07-08 11:37   ` Dmitry A. Kazakov
  2012-07-08 18:47   ` Jacob Sparre Andersen
@ 2012-07-09  8:20   ` Martin
  2012-07-09 11:19     ` AdaMagica
  2 siblings, 1 reply; 17+ messages in thread
From: Martin @ 2012-07-09  8:20 UTC (permalink / raw)


On Sunday, July 8, 2012 11:33:10 AM UTC+1, AdaMagica wrote:
> On Sunday, July 8, 2012 3:50:51 AM UTC+2, Robert A Duff wrote:
> > AdaMagica writes:
> > 
> > > Currently very poorly documented.
> > >
> > > There are a few minor problems and some (in my honest opinion) more severe
> > > ones in output.
> > 
> > AdaCore won't do anything about the problems unless you send them
> > to report@adacore.com.
> > 
> > - Bob
> 
> I do not want to post "problems" to AdaCore before some discussion in CLA. Perhaps others think differently or have other ideas. And if this is ever going to be standardised, it should be heavily discussed as an AI. Just collecting opinions here.
> 
> What astonishes me is that there are so few responses. Every now and then in the past, it seemed there were urgent requests for physical unit checking, and now that an ingenious proposal is there, there is dead silence.


Or perhaps because it's the weekend and the start of the holiday season (at least it is here...)!!!

I'll have a look at your points this evening and try a few things out asap.

I really like the idea of attempting this analysis via aspects. I remember you had a few examples of why Tucker's attempt via signature packages came up short, are many of the same issues present in the aspect solution?

-- Martin



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-08 18:47   ` Jacob Sparre Andersen
@ 2012-07-09 11:06     ` AdaMagica
  0 siblings, 0 replies; 17+ messages in thread
From: AdaMagica @ 2012-07-09 11:06 UTC (permalink / raw)


On Sunday, July 8, 2012 8:47:07 PM UTC+2, Jacob Sparre Andersen wrote:
> I find it interesting that AdaCore seem to have found a general solution
> to the problem, but for the moment I manage fine with a slightly
> modified version of Macks and statically generated checks.

Interesting that you are using Macks. Fraser Wilson's blancaleoni site has long been removed.



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: GNAT and Dimension Checking
  2012-07-09  8:20   ` Martin
@ 2012-07-09 11:19     ` AdaMagica
  0 siblings, 0 replies; 17+ messages in thread
From: AdaMagica @ 2012-07-09 11:19 UTC (permalink / raw)


On Monday, July 9, 2012 10:20:53 AM UTC+2, Martin wrote:

> I really like the idea of attempting this analysis via aspects.
> I remember you had a few examples of why Tucker's attempt via
> signature packages came up short, are many of the same issues
> present in the aspect solution?

See Ada95 Issue 324 for Tucker's packages and discussion.

No, all those problems with the combinatorial explosion of functions are gone with this really ingenious use of aspects.

The method keeps a record of the (possibly fractional) dimension of each item at compile-time just like my packages at http://www.christ-usch-grein.homepage.t-online.de/Ada/SI.html do at run-time. It's very easy to use and dimensioned literals look nice.



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-07-09 11:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-01  5:53 GNAT and Dimension Checking AdaMagica
2012-07-01  6:25 ` Nasser M. Abbasi
2012-07-01 10:44   ` yogeshwarsing
2012-07-02 20:42     ` Anh Vo
2012-07-02 20:58       ` Adam Beneschan
2012-07-02 21:51         ` Anh Vo
2012-07-01 15:18 ` AdaMagica
2012-07-01 15:47   ` yogeshwarsing
2012-07-06 10:47 ` AdaMagica
2012-07-08  1:50   ` Robert A Duff
2012-07-08 10:33 ` AdaMagica
2012-07-08 11:37   ` Dmitry A. Kazakov
2012-07-08 14:13     ` AdaMagica
2012-07-08 18:47   ` Jacob Sparre Andersen
2012-07-09 11:06     ` AdaMagica
2012-07-09  8:20   ` Martin
2012-07-09 11:19     ` AdaMagica

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