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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ebc5bf96039d7210 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!out02a.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!uns-out.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Very confused by Ada tasking, can not explain the execution outcome. References: <023de8e6-ce28-4a97-8103-ff855289a795@b30g2000prf.googlegroups.com> <898a5f1d-75f7-4f66-a241-440e9c225454@z66g2000hsc.googlegroups.com> <48b927f8$0$17330$426a74cc@news.free.fr> From: Stephen Leake Date: Sun, 31 Aug 2008 09:37:20 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:IZdc8XaRi/7SJanm+CRQOQ/U2yg= MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 4936e48ba96e5c74cf41808969 Xref: g2news1.google.com comp.lang.ada:1846 Date: 2008-08-31T09:37:20-04:00 List-Id: Damien Carbonne writes: > climber.cui@gmail.com a �crit : >> Thank you Jim for modifying the program and making it work. I saw how >> you modify the guarding conditions for the procedures. In fact, the >> conditions are fine by themselves, because i wrote the same program in >> Java. However, the modified program is working now. It indeed reminds >> me that Ada probably follows the 'strict evaluation' rule when it >> comes to the boolean expressions, so in >> if Next=1 and State=0 and D> Ada probably would evaluate all the predicates connect by logical >> AND, but as soon as D=N is reached, array index for Needs(_) would go >> out of bound (because Needs is defined to be array(0..N-1) of >> boolean). I am just guessing here. > > Use "and then" instead of "and" to obtain what Java does with "and" : > --> if Next=1 and then State=0 and then D