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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: SPARK: missing case value Date: Sat, 10 Oct 2015 11:10:48 +0200 Organization: A noiseless patient Spider Message-ID: References: <87twq09ke2.fsf@theworld.com> <8ea6wfytssdg.1ake0jrn1irc8.dlg@40tude.net> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 10 Oct 2015 09:08:47 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="10ca66458083610b89918ee8fea6489c"; logging-data="14473"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7lGvjCCFtuFVUqHgsB7FWxBvUTQLomzc=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: <8ea6wfytssdg.1ake0jrn1irc8.dlg@40tude.net> Cancel-Lock: sha1:7F3OlWImM6LFrsuPR3mrXUlBj0w= Xref: news.eternal-september.org comp.lang.ada:27961 Date: 2015-10-10T11:10:48+02:00 List-Id: On 09.10.15 23:01, Dmitry A. Kazakov wrote: > On Fri, 9 Oct 2015 22:29:21 +0200, Georg Bauhaus wrote: > >> A precondition states conditionality of proper execution. > > You said that. That's what clauses of contracts do: they state conditions. "Don't touch it or it'll …!". > Proper execution should be unconditional to the program > state. Otherwise it is called 'bug'. Yes, of course! If a contract is violated, that's the work of a bug.(*) > Ergo, precondition, especially a > dynamic one, is a method of introducing bugs. A precondition is also used as a method of detecting bugs, preconditions usually being checked. (Yes, they can be incorrect if their authors have made a mistake. I understand that, also, not all theorem provers are prefect, so everything we do is a method of introducing bugs.) Which bugs? Notably, failures to make some earlier post-conditions true. Seemingly, post-conditions are not usually checked. Programs can respond to failure reports, programmers can respond, too, taking new knowledge into account, or exploring different paths. >> [dynamic being more than static] > No idea what this was supposed to mean. Dynamic predicates may express conditions that the compiler cannot show to always be true, the compiler reflecting some state of the art. A predicate may be known or assumed to be true and yet the compiler cannot decide this. Should the compiler reject known truths? Or should it just perform the test at run-time if you tell it to do so? __ (*) "should …" above seems to imply the ideal situation of universally correct programs. This seems wishful thinking. At the risk of repeating old stuff, some designs are built on top of conjectures. Also, unforeseen program states are pretty normal in many programs, and not all of them will necessarily make the programs miss their stated goals.