comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.tsoh+bauhaus@maps.futureapps.de>
Subject: Re: Ada Interfaces and the Liskov Substitution Principle
Date: Wed, 30 May 2007 15:18:27 +0200
Date: 2007-05-30T15:18:25+02:00	[thread overview]
Message-ID: <1180531107.16197.30.camel@kartoffel> (raw)
In-Reply-To: <cb1jpulo7dok$.1voakie5wr69g.dlg@40tude.net> <Pine.LNX.4.64.0705232101220.20072@th.informatik.uni-mannheim.de> <1179953657.839272.160320@a26g2000pre.googlegroups.com> <f32d9o$fi9$1@jacob-sparre.dk> <1179991769.376381.252010@m36g2000hse.googlegroups.com> <12h6mi42jcha0.7f9vfsnihjwr$.dlg@40tude.net> <1180003336.1163.29.camel@kartoffel> <83abvs7sa9.fsf@hod.lan.m-e-leypold.de> <465aa5ba$0$23147$9b4e6d93@newsspool1.arcor-online.net> <qa3sb6w0a0n9.i2vpzirsrrfc.dlg@40tude.net> <465b6606$0$10188$9b4e6d93@newsspool4.arcor-online.net> <i3klun83mxpk.kwz6ot6mqpd1.dlg@40tude.net> <1180445634.5664.23.camel@kartoffel> <39viqigjwhrb$.gz67xvpinyjr.dlg@40tude.net> <465c9077$0$23135$9b4e6d93@newsspool1.arcor-online.net> <cb1jpulo7dok$.1voakie5wr69g.dlg@40tude.net>

On Wed, 2007-05-30 at 09:53 +0200, Dmitry A. Kazakov wrote:

> > OK. So why should a normal programmer like me consider it a cost effective
> > idea to try to construct a proven mathematical model for my daily work?
> 
> Why are you sure that your daily work isn't based on such models? You could
> use them unconsciously.

Hm. If you are suggesting that we have a working model of unconscious
mathematics, then in a sense, empirical programming science would
try to observe its working patterns then.


> The point one is - how would you enjoy the
> "spinal programming" model of things you do care? The second point is - why
> to program anything we don't care?

I'm assuming programmers who work carefully.
Let them be guided by principles. The principles need not
be the best thing since sliced bread only because they have
been described standard math terms.


> >>> What I want is the mathematics of program models, more than programming
> >>> to satisfy mathematics. BTW, what is the best suited mathematical
> >>> structure that (minimally) describes the loop
> >>>
> >>>    while k < 100 loop
> >>>      k := Integer'succ(k);
> >>>    end loop;
> >> 
> >> Ordered set, mathematical induction etc.
> > 
> > Uhm, can we have less than a group?
> 
> Yes, as you don't mention the operation of.

I mean, what mathematical model (such as LSP) is helpful in describing
this particular loop, such that the math of the model rules out writing
   k := k + 1;
for example? I would start with a model that isn't originally inspired
by mathematics (because higher math typically frowns upon operations,
that is, the things that computers do).
My vague model has loop invariants, loop termination,
and the fact that the type Integer happens to include a successor
function in its interface.  Now, the type Integer offers much
more than that, e.g. "*". Still, it seems reasonable to start from
the mathematical structure that maps to a type like Integer,
even when I do not need either of the inverse,
the neutral element, or commutativity, which Integer types have
(mostly), among other things.


> >>> and how does it help?
> >> 
> >> A lot. For example it can tell the code reviewer that the above program is
> >> equivalent to:
> >> 
> >>     if k < 100 then
> >>       k := 100;
> >>    end if;
> > 
> > Making assumptions about k ... This is how mathematics can make us prefer
> > default perspectives by moving all important points of view behind Formal
> > Mountains. The above change wouldn't have helped at all, on the contrary,
> > 
> >    for k'Address use ...;
> > 
> > What's the mathematics of that, then?
> 
> That k is a pair of functions mapping the system state to the value of k
> and reverse:
> 
>    Get_k : S -> Integer
>    Set_k : S x Integer -> S 

That's not a mathematical model. It is a pair of functions that
can be mapped to some aspects of how k is supposedly operating,
when amended with sequencing. I bet that few programmers writing
the above loop will have functions in mind that map from and to
world state.

> Thank you for making my point! What mathematics makes here is all the rest,
> which could well be incomputable. Consider k a hardware random generator.
> You could not describe it in any programming language, but you can in the
> language of probability theory.

Thank you for making my point! :-) Probability theoretic constructs
can be mapped into executable computer constructs only in very limited
ways, some of them using clever bit shuffling, others relying on
something *outside* the reach of mathematics, such as /dev/random (as
opposed to /dev/urandom). Outside insofar as there is no practical
way of mapping noise to a precise, hence programmable, formula.
This doesn't make them any less useful. 





  parent reply	other threads:[~2007-05-30 13:18 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-23 19:47 Ada Interfaces and the Liskov Substitution Principle Stefan Lucks
2007-05-23 20:32 ` Ludovic Brenta
2007-05-23 22:00   ` Randy Brukardt
2007-05-24  0:56     ` Anh Vo
2007-05-24 18:27     ` Pascal Obry
2007-05-24 18:39       ` Dmitry A. Kazakov
2007-05-24 18:51         ` Pascal Obry
2007-05-24 22:44         ` Randy Brukardt
2007-05-24  6:57   ` Stefan Lucks
2007-05-23 20:54 ` Maciej Sobczak
2007-05-23 21:58   ` Randy Brukardt
2007-05-24  7:29     ` Maciej Sobczak
2007-05-24  8:02       ` Dmitry A. Kazakov
2007-05-24 12:58         ` Maciej Sobczak
2007-05-24 13:42           ` Dmitry A. Kazakov
2007-05-24 22:08           ` Robert A Duff
2007-07-01  1:00             ` David Thompson
2007-05-24 22:58           ` Randy Brukardt
2007-05-25  7:52             ` Maciej Sobczak
2007-05-25  8:21               ` Dmitry A. Kazakov
2007-05-25 20:27                 ` Maciej Sobczak
2007-05-26  7:48                   ` Dmitry A. Kazakov
2007-05-27  8:30                     ` Maciej Sobczak
2007-05-27 10:04                       ` Dmitry A. Kazakov
2007-05-29  8:03                         ` Maciej Sobczak
2007-05-29 13:18                           ` Dmitry A. Kazakov
2007-05-29 13:32                             ` Dmitry A. Kazakov
2007-05-29 15:34                             ` Maciej Sobczak
2007-05-29 17:07                               ` Dmitry A. Kazakov
2007-05-30  7:40                                 ` Maciej Sobczak
2007-05-30  8:43                                   ` Dmitry A. Kazakov
2007-05-30 12:54                                     ` Maciej Sobczak
2007-05-30 13:56                                       ` Dmitry A. Kazakov
2007-05-30 16:49                                         ` vgodunko
2007-05-30 20:52                                         ` Maciej Sobczak
2007-05-31  8:15                                           ` Dmitry A. Kazakov
2007-05-31 13:46                                             ` Maciej Sobczak
2007-06-01  7:29                                               ` Dmitry A. Kazakov
2007-06-01 13:32                                                 ` Maciej Sobczak
2007-06-01 14:53                                                   ` Dmitry A. Kazakov
2007-06-01 20:31                                                     ` Maciej Sobczak
2007-06-02  8:19                                                       ` Dmitry A. Kazakov
2007-06-02 16:49                                                         ` Maciej Sobczak
2007-06-03  7:09                                                           ` Dmitry A. Kazakov
2007-06-03 22:04                                                             ` Maciej Sobczak
2007-06-04  8:08                                                               ` Dmitry A. Kazakov
2007-06-04 17:02                                                                 ` Maciej Sobczak
2007-06-05  8:35                                                                   ` Dmitry A. Kazakov
2007-06-05 22:12                                                                     ` Maciej Sobczak
2007-06-06  8:21                                                                       ` Dmitry A. Kazakov
2007-06-06 14:46                                                                         ` Maciej Sobczak
2007-06-06 15:11                                                                           ` Maciej Sobczak
2007-06-06 15:32                                                                       ` Markus E Leypold
2007-05-24 10:42       ` Georg Bauhaus
2007-05-24 13:41         ` Dmitry A. Kazakov
2007-05-25 16:59         ` Markus E Leypold
2007-05-28  9:52           ` Georg Bauhaus
2007-05-28 11:50             ` Dmitry A. Kazakov
2007-05-28 23:32               ` Georg Bauhaus
2007-05-29 12:05                 ` Dmitry A. Kazakov
2007-05-29 13:33                 ` Georg Bauhaus
2007-05-29 17:29                   ` Dmitry A. Kazakov
2007-05-29 20:46                     ` Georg Bauhaus
2007-05-30  7:53                       ` Dmitry A. Kazakov
2007-05-30 13:18                       ` Georg Bauhaus [this message]
2007-05-31 10:27                         ` Dmitry A. Kazakov
2007-05-31 11:44                         ` Georg Bauhaus
2007-06-01  7:37                           ` Dmitry A. Kazakov
2007-06-01 10:07                             ` Markus E Leypold
2007-06-01 11:41                             ` Georg Bauhaus
2007-06-01 13:07                               ` Dmitry A. Kazakov
2007-05-28 13:47             ` Markus E Leypold
2007-05-28 23:12               ` Georg Bauhaus
2007-05-28 13:56             ` Markus E Leypold
2007-05-28 23:00               ` Georg Bauhaus
2007-05-24  7:39 ` Dmitry A. Kazakov
2007-05-24 11:12   ` Stefan Lucks
2007-05-24 13:56     ` Dmitry A. Kazakov
2007-05-24 14:41       ` Stefan Lucks
2007-05-24 15:46         ` Dmitry A. Kazakov
2007-05-24 15:00       ` Georg Bauhaus
replies disabled

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