VHDL Issue Number: 0116 Classification: Language Definition Problem Language Version: VHDL-87 Summary: Wording with regard to the termination of loop statements is ambiguous. Related Issues: None. Relevant LRM Sections: 8.8 Key Words and Phrases: Loop statement Current Status: ISAC-Approved 1076-1993 Disposition: Closed (All Issues Completely Addressed) Disposition Rationale: section 8.9 of VHDL93 corrects this issue. Superseded By: N/A ----------------------- Date Submitted: 1989/06/21 Author of Submission: Ken Scott Author's Affiliation: Vantage Analysis Systems, Inc. Author's Post Address: 42840 Christy St., Suite 201 Fremont, CA 94538 Author's Phone Number: (415) 659-0901 Author's Fax Number: Author's Net Address: N/A ----------------------- Date Analyzed: 1991/04/01 Author of Analysis: chuck swart (cswart@mentor.com) Revision Number: $Revision: 1.7 $ Date Last Revised: $Date: 1995/05/13 19:34:42 $ Description of Problem ---------------------- In the third paragraph of chapter 8.8, there is a statement which is a correct statement, but is misleading: "Execution of the loop statement is complete when the loop is left as a consequence of the execution of a next statement, an exit statement, or a return statement." In the context of the sentence preceding it, it appears to still be talking about loops without iteration schemes. Such loops can NEVER be left as a result of the execution of a 'next' statement. If is it attempting to describe all the ways in which to leave a loop, it should also mention the completion of the iteration scheme for the loop as an option. All in all, the sentence is open to many different interpretations. It would be wise to make it more specific. Proposed Resolution ------------------- Break paragraph 3 into two separate paragraphs. So that the reader is not mislead into thinking that the 2nd sentence relates in any way to the first. VASG-ISAC Analysis & Rationale ------------------------------ The paragraph in question reads: "A loop statement without an iteration scheme specifies repeated execution of the sequence of statements. Execution of the loop statement is complete when the loop is left as a consequence of the execution of a next statement, an exit statement, or a return statement." This paragraph was adopted from the Ada LRM. The first statement is taken literally from Ada. The corresponding second sentence in the Ada LRM reads: "Execution of the loop statement is complete when the loop is left as a consequence of the execution of an exit statement, or as a consequence of some other transfer of control (see 5.1)." The annotated Ada LRM does not make any note of the fact that the second sentence is not directly related to the first. It is not clear just why the second sentence was changed from the original Ada. Perhaps it was an attempt to clarify the sentence by explicitly listing those statements which cause transfer of control. In any event, the author raises two points, both of which are correct. 1. The two sentences of the third paragraph of chapter 8.8 are only loosely connected. The second sentence contains references to concepts which do not apply to iteration schemes. Therefore, it makes sense to break paragraph three into two separate paragraphs. 2. The second sentence is not complete as stated. (It appears that the corresponding sentence in Ada is also incomplete.) Indeed, a loop statement can be left as a result of completion of the iteration scheme. VASG-ISAC Recommendation for IEEE Std 1076-1987 ----------------------------------------------- Adopt the proposed solution. Read paragraph three of section 8.8 as if each of the two sentences were a separate paragraph. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- Re-word the sentence starting "Execution of the loop statement is complete...." to reflect the fact that execution is complete either if the statement contains an iteration scheme and the iteration scheme completes, or when the loop is left as a consequence of the execution of a next statement, an exit statement, or a return statement.