From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: My new post on dev.to about SPARK Date: Fri, 10 Jul 2020 06:17:21 +0200 Organization: Adalog Message-ID: References: <8e5d14a5-0311-4005-9655-951e8a274929o@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Fri, 10 Jul 2020 04:17:22 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="7976ce4c556d1d077396dbbe40d7d253"; logging-data="28291"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dy6lacSjWwMt3dXqD5hOg" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cancel-Lock: sha1:XaMy+BznbJnUhyu1sggW3ttTuVY= In-Reply-To: Content-Language: fr Xref: reader01.eternal-september.org comp.lang.ada:59420 List-Id: > mockturtle writes: >> https://dev.to/pinotattari/proving-the-correctness-of-a-binary-search-procedure-with-spark-ada-34id > Hmmm.. The following O(N**2) function: function Is_Sorted (Table : Array_Type) return Boolean is (for all L in Table'Range => (for all M in Table'Range => (if L > M then Table (L) > Table (M)))) with Ghost; can be changed to a O(N) function: function Is_Sorted (Table : Array_Type) return Boolean is (for all L in Table'First .. Table'Last -1 => Table (L) < Table (L+1)) with Ghost; -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr