From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,39579ad87542da0e X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 X-Received: by 10.180.85.5 with SMTP id d5mr1642238wiz.0.1368583184237; Tue, 14 May 2013 18:59:44 -0700 (PDT) Path: p18ni110061wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.81.MISMATCH!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newspeer1.nac.net!news.astraweb.com!border2.newsrouter.astraweb.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!nrc-news.nrc.ca!News.Dal.Ca!citadel.nobulus.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Seeking for papers about tagged types vs access to subprograms Date: Wed, 08 May 2013 13:08:48 +0200 Organization: Ada @ Home Message-ID: References: <17ceq51ydy3s0.s94miqqzbg5w.dlg@40tude.net> <1vrhb7oc4qbob$.q02vuouyovp5$.dlg@40tude.net> <19lrzzbgm77v6.1dzpgqckptaj6.dlg@40tude.net> <1bfhq7jo34xpi.p8n2vq6yjsea.dlg@40tude.net> NNTP-Posting-Host: 7OQr3E3VjE1ZKDv7Xqqyjg.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.15 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2013-05-08T13:08:48+02:00 List-Id: Le Wed, 08 May 2013 12:23:06 +0200, Dmitry A. Kazakov = a =C3=A9crit: > On Wed, 08 May 2013 11:39:23 +0200, Yannick Duch=C3=AAne (Hibou57) wro= te: > >> But then, an example such as the above would present challenge with >> derived types. > > That is the main question about parallel hierarchies: if you derive or= > constrain one type in the cloud, what happens with other types? Does t= his > produce new types, related or unrelated, constrained or not. I would say there is no general answer without additional informations = about what the whole means, and no language or its compiler can tell it = in = place of the author (or else, you decide in place of the author, and are= = back to what it actually is). And that additional informations is may be= = what needs to be provided (and the basic type system, as it is actually,= = does not allow it), ex. kind of basic axiomatization describing what the= = relations must preserve for the whole to be valid. This axiomatization = could answer two questions, directly: is the system with its new = parameters still valid? indirectly: is the the new system compatible wit= h = other similar systems or the one from which it is derived? Whether or no= t = this axiomatization would be sound, would be the author's responsibility= = (that's why it should be simple, like based on basic relations on discre= te = types and interfaces). Any way, lack of soundness may ends in failure to= = check. A basic idea (more easy to say than to do): reuse things like = pre/post/pragma=E2=80=91assert, but whose purpose is to be statically ch= ecked (if = it's too complicated to be checked, it means it fails, and it is not = deferred to a run=E2=80=91time check). The author would decide what he/s= he wish to = put in these. The language could impose some minimal constraints with ba= se = predefined types (like it already do rather well) so there could be no w= ay = to relax everything. This may looks going too far, but I believe minimal axiomatization = (statically checked) would be nice; not necessarily to prove a program = (another story), but at least to ensure what it is based on (the types a= nd = use of their instances) is valid in some regards. What the program would= = do with it at runtime may be another story and still be a job for SPARK = = and others (too much constraints here, would defeat any achievement). Also to digress but still in some way related, more control on what can = be = done of an instance of a type, toward restricting, permitting to deny th= e = use of some part of an interface, would help to make valid assertions (e= x. = with my issue where I'm lacking a limited access type, if I could restri= ct = to limited access type, I could not only ensure no access is made to a = deallocated storage, but could even have some assertions about aliasing)= . -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity