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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cbd507df3efa824b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-31 02:22:00 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!news.iac.net!news-out.cwix.com!newsfeed.cwix.com!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Rod Chapman Newsgroups: comp.lang.ada Subject: Re: Help with Atomic_Components and whole array assignment Date: Wed, 31 Jan 2001 10:09:22 GMT Organization: Deja.com Message-ID: <958o8f$vem$1@nnrp1.deja.com> References: <94h55t$9a1$1@nnrp1.deja.com> <94hml1$o64$1@nnrp1.deja.com> <94hno6$p8s$1@nnrp1.deja.com> <3A76E455.AABF2490@averstar.com> NNTP-Posting-Host: 193.114.91.187 X-Article-Creation-Date: Wed Jan 31 10:09:22 2001 GMT X-Http-User-Agent: Mozilla/4.73 [en] (WinNT; U) X-Http-Proxy: 1.0 PROXY, 1.0 x51.deja.com:80 (Squid/1.1.22) for client 193.114.91.187 X-MyDeja-Info: XMYDJUIDr_c_chapman Xref: supernews.google.com comp.lang.ada:4746 Date: 2001-01-31T10:09:22+00:00 List-Id: In article <3A76E455.AABF2490@averstar.com>, Tucker Taft wrote: > I don't agree with Robert on this. Have you tried writing it > as a loop rather than an aggregate assignment. Of course, but that would usually be considered bad style in SPARK. The assignment A := A_Type'(others => 0); has information flow "derives A from ;" (i.e. the final value of A is derived from "nothing" - a constant - which is probably what you wanted and expected) The compound statement for I in A'Range loop A(I) := 0; end loop; has information flow "derives A from A", which is significantly different. Proof of partial correctness is also affected - proving --# post A = A_Type'(others => 0); is trivial in the first case, but rather harder in the latter, so we nearly always prefer the aggregate. Our device driver is a fine example of where we (justifiably) bend the rules... :-) - Rod Sent via Deja.com http://www.deja.com/