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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1e5c102037393131 X-Google-Attributes: gid103376,public From: dale@cs.rmit.edu.au (Dale Stanbrough) Subject: Re: Assertions Date: 1999/05/17 Message-ID: #1/1 X-Deja-AN: 478661118 References: <3736D243.1EEBF1AB@globalnet.co.uk> <3736F549.E3DDCDEB@pwfl.com> <7h83lc$rd$1@nnrp1.deja.com> <3739CECA.6A49865B@averstar.com> <1999May12.163911.1@eisner.decus.org> <373c862b@eeyore.callnetuk.com> X-Complaints-To: abuse@cs.rmit.edu.au X-Trace: emu.cs.rmit.edu.au 926906555 650 144.205.16.58 (17 May 1999 02:02:35 GMT) Organization: RMIT NNTP-Posting-Date: 17 May 1999 02:02:35 GMT Newsgroups: comp.lang.ada Date: 1999-05-17T02:02:35+00:00 List-Id: Nick Roberts wrote: " 1. There's no reason why the compiler should not be able to assume that any assertion's condition holds true" But of course there is the rub - I certainly don't want this to be true -all the time-. I want some assertions to be genuinely tested, while others to be used as an adjunct to the type system (and thus the compiler can use it for optimisation purposes). E.g. an assertion that a cached bill-of-materials total cost is indeed the sum of all it's line items is something i want checked, whereas an assertion that "this pointer is a linear pointer type" (i think that's the notation that Henry Baker uses to describe linear dynamic data structures) would be a useful way to give info to the compiler, but extremely expensive (if indeed possible) to test. Dale