comp.lang.ada
 help / color / mirror / Atom feed
From: Eric Hughes <eric.eh9@gmail.com>
Subject: Re: Ada.Strings.Bounded
Date: Wed, 16 Apr 2008 07:40:32 -0700 (PDT)
Date: 2008-04-16T07:40:32-07:00	[thread overview]
Message-ID: <611360e0-595c-43a7-b5cb-137a278ec0c1@s13g2000prd.googlegroups.com> (raw)
In-Reply-To: g0h6sr1pyq67.vixepl474n4k$.dlg@40tude.net

On Apr 16, 2:16 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> Universal_Integer is merely an integer type.

OK, now you're just wrong.  Wrong, that is, assuming that by "integer
type" you mean an "integer type as defined by Ada" and not some other
notion of "integer type".  I've never seen you to acknowledge any
other kind of type here, so I believe I'm making that assumption in
good faith.

Suppose there existed some single and specific Ada integer type M
which is the same type as universal_integer.  All non-modular integer
types are defined by ranges (see 3.5.4 "Integer Types").  Since M is a
scalar type, the lower bound is M'First and the upper bound is M'Last
(see 3.5).  Since M is an integer type, it is declarable.  Let 'm' be
an integer literal by which the upper bound of M can be declared.  By
the premise, 'm' is an expression of universal_integer.  By my
previous proof about universal_integer, the expression 'm+1' is also a
universal_integer.  But 'm+1' is not a member of M.  Thus M cannot be
a type for universal_integer.

Now you'll come right back and cite things that aren't in the language
specification: specific compilers and specific programs.  Were you to
insist upon citing these, it would be tantamount to saying the
standard isn't actually normative, that instead practice is
normative.  But then I'd believe that you don't know the meaning of
the word "normative".

But I'll address them anyway, to forestall confusion.

Let's start with programs.  Take a the entire source code of any
program.  It's finite.  For that body of code, there's a
universal_integer expression of greatest absolute value.  Call it
'n'.  Declare the type
    type Large_Enough_Integer is range -n .. n ;
By assumption, every universal_integer that appears in that program is
a member of Large_Enough_Integer.  Furthermore, every integer type has
bounds that are members of Large_Enough_Integer.  Thus every integer
value that could ever be in that program has a value that's a member
of Large_Enough_Integer.  But Large_Enough_Integer is not the same as
universal_integer, because the value of 'n+1' is not in
Large_Enough_Integer and it is in universal_integer.  Thus, what's
true is the following predicate:
   For every program P,
   there exists an integer type N,
   for all executions E of P,
   for all times T within E,
   for all variables X within P,
   the value of X at time T within E is a value of N.

This predicate does not make N into universal_integer.  What it says
is that there's a relativized version of universal_integer which is
just barely adequate for every program.  But universal_integer is NOT
defined on a program-by-program basis.  It's defined for the language
as a whole.  For each program, there's a large-enough type, but that
type is not universal_integer.  It's supremum_integer_for_program_P.

The case for compilers is rather more subtle.  Let's dispose of the
easy case first.  Suppose there's some internal limit on the size of
integer types that a compiler accepts; call the type at that limit
'supremum_compilable_integer'.  Then that compiler does not accept
programs P where supremum_integer_for_program_P won't fit into
supremum_compilable_integer.  Now 'supremum_compilable_integer+1' is
also a universal_integer, but one that this compiler does not accept.
Now there's no requirement that a compiler be able to handle every
universal_integer in order to be a conformant compiler.  Such a
requirement would be impossible to satisfy, because it would require
an execution size that was unbounded, even though the compiler itself
could be bounded.  Hence for this case too, there's a relativized
version of universal_integer that applies to the compiler, but that
type isn't universal_integer either.

For a compiled program with an internally limited compiler, then, we
have the following sketch of potential type relationships:
    supremum_compilable_integer --> supremum_integer_for_program_P -->
root_integer
I didn't put universal_integer in there, though, because it's not a
type in the same sense that these others are.

A compiler, in theory (though certainly not in present practice), is
capable of generating expressions for arbitrarily large integers.
I'll be willing to discuss this case later, after the simpler cases
are properly disposed of.

Eric



  reply	other threads:[~2008-04-16 14:40 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-31 22:44 Untyped Ada? Phaedrus
2008-04-01  0:16 ` Randy Brukardt
2008-04-01  7:19 ` tmoran
2008-04-01  7:44 ` Dmitry A. Kazakov
2008-04-01  8:28 ` Jean-Pierre Rosen
2008-04-01 21:44   ` Phaedrus
2008-04-01 21:51     ` Ludovic Brenta
2008-04-01 17:09 ` Pascal Obry
2008-04-01 22:00   ` Phaedrus
2008-04-02  7:31     ` Dmitry A. Kazakov
2008-04-04 15:16     ` Graham
2008-04-04 16:10       ` Pascal Obry
2008-04-04 21:09         ` Ada.Bounded_Strings Adam Beneschan
2008-04-04 21:15           ` Ada.Strings.Bounded Adam Beneschan
2008-04-05  4:39             ` Ada.Strings.Bounded Gautier
2008-04-05  9:43               ` Ada.Strings.Bounded Pascal Obry
2008-04-05 10:10                 ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-05 11:36                 ` Ada.Strings.Bounded Gautier
2008-04-05 12:14                   ` Ada.Strings.Bounded Pascal Obry
2008-04-06  0:31                     ` Ada.Strings.Bounded Randy Brukardt
2008-04-07 14:57                       ` Ada.Strings.Bounded Adam Beneschan
2008-04-07 15:23                         ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-07 16:34                         ` Ada.Strings.Bounded stefan-lucks
2008-04-07 17:34                           ` Ada.Strings.Bounded (see below)
2008-04-12 18:50                 ` Ada.Strings.Bounded Eric Hughes
2008-04-12 19:46                   ` Ada.Strings.Bounded Georg Bauhaus
2008-04-13 16:53                     ` Ada.Strings.Bounded Eric Hughes
2008-04-13 20:10                       ` Ada.Strings.Bounded Robert A Duff
2008-04-13 23:52                         ` Ada.Strings.Bounded Eric Hughes
2008-04-14  8:00                           ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-14 15:25                             ` Ada.Strings.Bounded Eric Hughes
2008-04-14 18:36                               ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-15  1:39                                 ` Ada.Strings.Bounded Eric Hughes
2008-04-12 21:09                   ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-13 16:31                     ` Ada.Strings.Bounded Eric Hughes
2008-04-13 20:02                       ` Ada.Strings.Bounded Robert A Duff
2008-04-13 23:20                         ` Ada.Strings.Bounded Eric Hughes
2008-04-14  9:07                           ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-14 15:50                             ` Ada.Strings.Bounded Eric Hughes
2008-04-14 18:52                               ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-15  2:07                                 ` Ada.Strings.Bounded Eric Hughes
2008-04-15  8:02                                   ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-15 14:20                                     ` Ada.Strings.Bounded Eric Hughes
2008-04-15 15:23                                       ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-16  2:51                                         ` Ada.Strings.Bounded Eric Hughes
2008-04-16  8:00                                           ` Ada.Strings.Bounded Dmitry A. Kazakov
     [not found]                                     ` <bc3a8b4e-63fe-47a6-b10b-7056f6d7d586@w5g2000prd.googlegroups.com>
2008-04-15 14:58                                       ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-16  2:46                                         ` Ada.Strings.Bounded Eric Hughes
2008-04-16  8:16                                           ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-16 14:40                                             ` Eric Hughes [this message]
2008-04-16 18:28                                               ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-21  0:44                                                 ` Ada.Strings.Bounded Eric Hughes
2008-04-21 14:08                                                   ` Ada.Strings.Bounded Robert A Duff
2008-04-21 16:35                                                     ` Ada.Strings.Bounded Eric Hughes
2008-04-21 18:04                                                       ` Ada.Strings.Bounded Robert A Duff
2008-04-22  0:19                                                         ` Ada.Strings.Bounded Eric Hughes
2008-04-22  0:49                                                           ` Ada.Strings.Bounded Adam Beneschan
2008-04-22  1:02                                                             ` Ada.Strings.Bounded Adam Beneschan
2008-04-22 15:30                                                               ` Ada.Strings.Bounded Eric Hughes
2008-04-22 16:08                                                                 ` Ada.Strings.Bounded Robert A Duff
2008-04-22 15:25                                                             ` Ada.Strings.Bounded Eric Hughes
2008-04-22 15:54                                                               ` Ada.Strings.Bounded Robert A Duff
2008-04-22 15:41                                                           ` Ada.Strings.Bounded Robert A Duff
2008-04-22 17:49                                                             ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-22 18:26                                                               ` Ada.Strings.Bounded Samuel Tardieu
2008-04-22 18:59                                                                 ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-22 18:47                                                             ` Ada.Strings.Bounded Eric Hughes
2008-04-22 19:19                                                               ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-22 19:41                                                               ` Ada.Strings.Bounded Robert A Duff
2008-04-22 22:55                                                                 ` Ada.Strings.Bounded Eric Hughes
2008-04-23  6:40                                                                   ` Ada.Strings.Bounded christoph.grein
2008-04-23  6:54                                                                     ` Ada.Strings.Bounded christoph.grein
2008-04-23 10:42                                                                 ` Ada.Strings.Bounded Georg Bauhaus
2008-04-23 12:32                                                                   ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-23 12:52                                                                   ` Ada.Strings.Bounded christoph.grein
2008-04-23 13:34                                                                     ` Ada.Strings.Bounded Georg Bauhaus
2008-04-23 15:12                                                                   ` Ada.Strings.Bounded Adam Beneschan
2008-04-23 15:36                                                                     ` Ada.Strings.Bounded (see below)
2008-04-23 17:09                                                                     ` Ada.Strings.Bounded Ray Blaak
2008-04-24  0:29                                                                   ` Ada.Strings.Bounded Randy Brukardt
2008-04-22 20:15                                                               ` Ada.Strings.Bounded Adam Beneschan
2008-04-23 13:14                                                                 ` Ada.Strings.Bounded Peter Hermann
2008-04-23 14:40                                                                   ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-23 15:03                                                                     ` Ada.Strings.Bounded Adam Beneschan
2008-04-22 19:56                                                             ` Ada.Strings.Bounded Adam Beneschan
2008-04-21 18:50                                                       ` Ada.Strings.Bounded Dmitry A. Kazakov
2008-04-22  0:31                                                         ` Ada.Strings.Bounded Eric Hughes
2008-04-14 15:11                   ` Ada.Strings.Bounded Adam Beneschan
2008-04-14 16:09                     ` Ada.Strings.Bounded Eric Hughes
2008-04-14 18:13                       ` Ada.Strings.Bounded Georg Bauhaus
2008-04-15  1:35                         ` Ada.Strings.Bounded Eric Hughes
2008-04-15 20:33                           ` Ada.Strings.Bounded Georg Bauhaus
2008-04-16  3:11                             ` Ada.Strings.Bounded Eric Hughes
2008-04-04 23:35           ` Ada.Bounded_Strings Robert A Duff
2008-04-05  1:46             ` Ada.Bounded_Strings Adam Beneschan
2008-04-05  4:55               ` Ada.Bounded_Strings Randy Brukardt
2008-04-05  7:30                 ` Ada.Bounded_Strings Dmitry A. Kazakov
2008-04-06  0:44                   ` Ada.Bounded_Strings Randy Brukardt
2008-04-04 16:18       ` Untyped Ada? Adam Beneschan
2008-04-04 16:32       ` DScott
2008-04-04 17:38       ` Dmitry A. Kazakov
2008-04-04 18:52         ` Georg Bauhaus
2008-04-05  8:07           ` Dmitry A. Kazakov
2008-04-04 19:14         ` Graham
2008-04-04 21:06           ` tmoran
2008-04-05  8:44           ` Dmitry A. Kazakov
2008-04-12 16:50       ` Eric Hughes
2008-04-04 18:02     ` adaworks
replies disabled

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