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: 103376,e6cf7d66027047db X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!f19g2000vbf.googlegroups.com!not-for-mail From: roderick.chapman@googlemail.com Newsgroups: comp.lang.ada Subject: Re: Newbie question: SPARK verification condition on member of private record Date: Thu, 2 Apr 2009 11:09:44 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 216.1.176.121 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1238695788 11229 127.0.0.1 (2 Apr 2009 18:09:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 2 Apr 2009 18:09:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f19g2000vbf.googlegroups.com; posting-host=216.1.176.121; posting-account=HCzrEgkAAABSfGsTnv-u5wET6EzuneVi User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:4406 Date: 2009-04-02T11:09:44-07:00 List-Id: I concur with Phil. It's almost _always_ better to write aggregate expressions and use the array/record update notation in postconditions than using field-by-field assignments and equalities. e.g. Do write A := T'(X, Y, Z); Don't write A.F1 := X; A.F2 := Y; A.F3 := Z; Also...for just A.F1 := X; the correct post-condition would be --# post A = A~[F1 => X]; which defines the final value of the whole object, rather than --# post A.F1 = X; which defines the final value of A.F1 but leaves the other 2 fields unspecified. Further explanation of all this in the "Generation of VCs" manual. - Rod Chapman, SPARK Team