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,2e71cf22768a124d X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Assertions (was: Re: next "big" language?? (disagree)) Date: 1996/06/24 Message-ID: #1/1 X-Deja-AN: 161831368 references: <4ql1fv$5ss@goanna.cs.rmit.EDU.AU> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-06-24T00:00:00+00:00 List-Id: In article <4ql1fv$5ss@goanna.cs.rmit.EDU.AU>, Dale Stanbrough wrote: >...Can anyone think of a better >name (pragma Declare(x) is not available in Ada) than "Fact"? pragma Assume? Actually, I don't see a need for these two separate pragmas. We can have: pragma Assert(...); and: pragma Suppress(Assertion_Check); pragma Assert(...); for these two cases. Note that in *both* of these cases, the compiler can optimize the following code based on the asserted "fact". These pragmas are really no different from constraint checks, which may or may not be suppressed, and which can, of course, affect the behavior of the program. The third case that Robert mentioned -- an assertion that cannot affect the behavior of the program in any way -- is quite impossible to define in language terms. It very well might be a useful thing, though. - Bob