comp.lang.ada
 help / color / mirror / Atom feed
From: Marius Amado Alves <amado.alves@netcabo.pt>
To: comp.lang.ada@ada-france.org
Subject: Re: Float to String
Date: Wed, 10 Nov 2004 17:28:55 +0000
Date: 2004-11-10T17:28:55+00:00	[thread overview]
Message-ID: <mailman.90.1100107739.10401.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <1hmyhi3g3ogfq.gdvw6tkdvemq.dlg@40tude.net>

> The first question: what makes you believe that zero should be always
> included? It might be needed if unary minus is required to be closed. See
> the point? The numeric model is driven by the operations applied, their
> accuracy and requirement to be closed on the domain set. But there is no
> good reason why 0-x as an operation should be any better than, say, 1/x.
> The latter, BTW would lead you directly to floating point representations.
> If we consider other various operations we will come to interval
> arithmetic, for which the very idea of a singular value (and so "precision
> of a value") becomes meaningless.

Ok, you're right. And implementing an order relation (required by the 
design of Mneson) with the three fixed point types I found myself 
replicating a floating point device so I'm reverting to a floating point 
type as the 'universal' real type!

> So the second question: do you have have ADT in your database?

In one word, no. In more words: Mneson supports ADT through its graph 
data model. Arbitrarily complex data structures are represented by 
graphs. Vertices are either basic values (integer, real, string) or 
valueless. Links are directed and untyped (unlabelled) at the base 
level. Support to represent complex structures including typed links 
exist. ADTs can be build on top of this level. Correspondence with Ada 
types, however, is supposed to occur more at the base level. I'm using 
Ada as a systems programming language only. Of course the ADTs of the 
system itself are represented in Ada. And these and others can be linked 
with Mneson graphs. I'm working on it now.

Unless you were asking about the ADTs that represent Mneson. In that 
case yes, of course they exist. For example a working graph is 
represented by an instantiation of this package:

    generic
       with function To_Vertex (Value : String) return Vertex is <>;
       with function To_Vertex (Value : Integer_64) return Vertex is <>;
       with function Valueless_Vertex
         (Number : Serial_Number) return Vertex is <>;
       with function New_Serial_Number return Serial_Number is <>;
       with function New_Vertex return Vertex is <>;
       with function Value (X : Vertex) return Integer_64 is <>;
       with function Value (X : Vertex) return String is <>;
       with function Length (X : Vertex) return Natural is <>;
       with function Slice
         (X : Vertex; Low : Positive; High : Natural) return String is <>;
       with procedure Connect (Source, Target : Vertex) is <>;
       with procedure Disconnect (Source, Target : Vertex) is <>;
       with procedure Disconnect_From_Targets (Source : Vertex) is <>;
       with procedure Disconnect_From_Sources (Target : Vertex) is <>;
       with procedure Disconnect (X : Vertex) is <>;
       with procedure Reconnect
         (Source, Target, New_Target : Vertex) is <>;
       with procedure Inv_Reconnect
         (Target, Source, New_Source : Vertex) is <>;
       with function Connected
         (Source, Target : Vertex) return Boolean is <>;
       with function Connected (Source : Vertex) return Boolean is <>;
       with function Inv_Connected (Target : Vertex) return Boolean is <>;
       with procedure For_Each_Target
         (Source : Vertex; Process : Process_Vertex) is <>;
       with procedure For_Each_Source
         (Target : Vertex; Process : Process_Vertex) is <>;
       with procedure For_Each_Link (Process : Process_Link) is <>;
       with procedure For_Each_Common_Target
         (Source_1, Source_2 : Vertex; Process : Process_Vertex) is <>;
       with function Is_Integer_64 (X : Vertex) return Boolean is <>;
       with function Is_String (X : Vertex) return Boolean is <>;
       with function Is_Valueless (X : Vertex) return Boolean is <>;
       with function Img (X : Vertex) return String is <>;
       with function Val (Img : String) return Vertex is <>;
    package Work is end;






  reply	other threads:[~2004-11-10 17:28 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-08 17:06 Float to String Pascal Obry
2004-11-08 18:29 ` Jean-Pierre Rosen
2004-11-08 19:03 ` Jeffrey Carter
2004-11-08 20:13 ` David C. Hoos
2004-11-08 20:18 ` David C. Hoos
2004-11-09  0:40   ` John B. Matthews
2004-11-09  5:24     ` David C. Hoos, Sr.
2004-11-08 21:29 ` Nick Roberts
2004-11-09 17:58   ` Peter Hermann
2004-11-10  9:38     ` Peter Hermann
2004-11-10 12:12       ` Larry Kilgallen
2004-11-09  8:39 ` Dmitry A. Kazakov
2004-11-09 18:17   ` Pascal Obry
2004-11-10  8:53     ` Dmitry A. Kazakov
2004-11-10 11:15       ` Samuel Tardieu
2004-11-10 14:35         ` Dmitry A. Kazakov
2004-11-10 15:00         ` Peter Hermann
2004-11-10 15:35         ` Marius Amado Alves
2004-11-10 16:35           ` Dmitry A. Kazakov
2004-11-10 17:28             ` Marius Amado Alves [this message]
2004-11-11 15:25               ` Dmitry A. Kazakov
2004-11-11 16:40                 ` Marius Amado Alves
2004-11-11 18:31                   ` Dmitry A. Kazakov
2004-11-11 22:27                     ` Marius Amado Alves
2004-11-12 12:19                       ` Dmitry A. Kazakov
2004-11-12 14:55                         ` Marius Amado Alves
2004-11-10  5:05 ` Steve
2004-11-10 15:37   ` Pascal Obry
2004-11-10 16:29     ` Alex R. Mosteo
2004-11-10 16:48       ` Pascal Obry
2004-11-10 18:02         ` Marius Amado Alves
2004-11-10 19:40           ` Jeffrey Carter
2004-11-10 21:04             ` Marius Amado Alves
2004-11-11  3:33     ` Steve
2004-11-11  7:51       ` tmoran
2004-11-11 12:32         ` Pascal Obry
2004-11-11 15:53           ` David C. Hoos, Sr.
2004-11-11 16:17             ` Pascal Obry
2004-11-11 17:36             ` Jeffrey Carter
2004-11-12  0:01               ` David C. Hoos, Sr.
2004-11-12  0:30                 ` Jeffrey Carter
2004-11-11 12:30       ` Pascal Obry
2004-11-13 16:37 ` Ginduskina
2004-11-13 18:41   ` Björn Lundin
2004-11-13 16:39 ` Ginduskina
2004-11-13 16:49   ` Simon Wright
2004-11-13 16:53   ` David C. Hoos, Sr.
2004-11-13 16:55   ` Pascal Obry
replies disabled

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