To: J3 J3/20-116 From: Robert Corbett Subject: Edits for SIMPLE procedures Date: 2020-February-26 References: 18-007r1, 19-201r1 Introduction ------------ This paper contains edits for SIMPLE procedures (US 15). The requirements, specifications and syntax for SIMPLE procedures are in paper 19-201r1. The edits are with respect to 18-007r1. Edits ----- "Introduction", bullet item "Program units and procedures", page xiv Insert "A procedure can be specified to be a SIMPLE procedure; a SIMPLE procedure does not define nonlocal variables and references nonlocal variables only via its dummy arguments." 3.112.5+, following "pure procedure", page 16:12+ Insert "simple procedure procedure declared or defined to be SIMPLE (15.7+)" 7.5.7.3 "Type-bound procedure overriding", paragraph 2, page 82:15+ After the second bullet item, insert " * If the overridden type-bound procedure is simple then the overriding one shall also be simple." 10.2.2.4 "Procedure pointer assignment", paragraph 3, page 167:7 Replace "not pure and" with "not pure, the pointer target may be simple even if the pointer object is not simple, and" The edited text is "If the pointer object has an explicit interface, its characteristics shall be the same as the pointer target except that the pointer target may be pure even if the pointer object is not pure, the pointer target may be simple even if the pointer object is not simple, and the pointer target may be an elemental intrinsic procedure even if the pointer object is not elemental." 15.3.1 "Characteristics of procedures", paragraph 1, page 290:10 Replace "pure, whether" with "pure, whether it is simple, whether" The edited text is "The characteristics of a procedure are the classification of the procedure as a function or subroutine, whether it is pure, whether it is simple, whether it is elemental, whether it has the BIND attribute, the characteristics of its dummy arguments, and the characteristics of its function result if it is a function." 15.4.2.2 "Explicit interface", paragraph 1 following list item (2), page 291:22+ Insert " (2+) the procedure is used in a context that requires it to be simple (15.7+), 15.4.3.2 "Interface block", paragraph 7, page 293:35 Replace "defined to be pure." with "defined to be pure and the interface may specify a a procedure that is not simple even if the procedure is defined to be simple." 15.4.3.6 "Procedure declaration statement", paragraph 7, page 299:37 Replace "is not pure \obs{and}" with "is not pure, initial-proc-target may be simple even if procedure-entity-name is not simple, \obs{and}" 15.5.2.9 "Actual arguments associated with dummy procedure entities", paragraph 1, page 309:4 Replace "is not pure \obs{and}" with "is not pure, a simple effective argument may be associated with a dummy argument that is not simple, \obs{and}" 15.6.2.1 "General", at the end of the rule for "prefix-spec", page 317:19+ Insert " <> SIMPLE". 15.6.2.1 "General", following constraint C1544, page 317:21+ Insert "C1544+ (R1526) A prefix shall not specify both SIMPLE and IMPURE." 15.6.2.1 "General", paragraph 4, page 317:39 Replace "If the prefix-spec PURE appears," with "If the prefix-spec PURE or the prefix-spec SIMPLE appears," 15.6.2.1 "General", paragraph 4, page 317:40 Insert "If the prefix-spec SIMPLE appears, the subprogram is a simple subprogram and shall meet the additional constraints of 15.7+." at the end of the paragraph. 15.6.2.6 "ENTRY statement, paragraph 12, page 322:15-16 Replace the paragraph with "\obs{The keywords PURE, IMPURE, and SIMPLE are not used in an ENTRY statement. Instead, the procedure defined by an ENTRY statement is pure if and only if the subprogram is a pure subprogram and is simple if and only if the subprogram is a simple subprogram.}. 15.7 "Pure procedures", paragraph 1, page 323:31-324:3 Replace the paragraph with "A pure procedure is * an intrinsic procedure (16.1), if it is specified to be pure or simple, * a module procedure in an intrinsic module, if it is specified to be pure or simple, * a procedure defined by a pure subprogram, * a dummy procedure that has been specified to be PURE or SIMPLE, * a procedure pointer that has been specified to be PURE or SIMPLE, * a type-bound procedure that is bound to a pure procedure, or * \obs{a statement function that references only pure functions and does not contain the designator of a variable with the VOLATILE attribute.}" 15.7 "Pure procedures", paragraph 2, page 324:4 Replace "has the prefix-spec PURE or" with "has the prefix-spec PURE or the prefix-spec SIMPLE, or" 15.7+ "Simple procedures" (follows "Pure procedures"), page 325:9- Insert "15.7+ Simple procedures A simple procedure is * an intrinsic procedure (16.1), if it is specified to be simple, * a module procedure, if it is specified to be simple, * a procedure defined by a simple subprogram, * a dummy procedure that has been specified to be SIMPLE, * a procedure pointer that has been specified to be SIMPLE, * a type-bound procedure that is bound to a simple procedure, or * \obs{a statement function defined in a simple subprogram}. A simple procedure is also a pure procedure and is subject to the constraints for pure procedures (15.7). A simple procedure can also be an elemental procedure. A simple subprogram is a subprogram that has the prefix-spec SIMPLE. The following additional constraints apply to simple subprograms. C1599a The specification-part of a simple subprogram shall specify that all of its dummy procedures are simple. C1599b If a procedure that is not an intrinsic procedure, a module procedure of an intrinsic module, \obs{or a statement function} is used in a context that requires it to be simple, then its interface shall be explicit in the scope of that use. The interface shall specify that the procedure is simple. C1599c All internal subprograms in a simple subprogram shall be simple. C1599d A simple subprogram shall not contain a designator of a variable that is host associated with a variable in the host of the subprogram or use associated with a module variable unless the designator is part of a specification inquiry (10.1.11). C1599e A simple subprogram shall not contain a reference to a variable in a common block. C1599f A specification inquiry in a simple subprogram that is not a constant expression shall not depend on a variable that is not a local entity of the subprogram or a construct entity or statement entity of a construct or statement contained in the subprogram. C1599g Any procedure referenced in a simple subprogram shall be simple." 16.1 "Classes of intrinsic procedures", paragraph 2, page 327:11-12 Replace "All standard intrinsic functions are pure." with "All standard intrinsic functions are simple." 16.1 "Classes of intrinsic procedures", paragraph 5, page 327:17-18 Replace "MVBITS, are pure." with "MVBITS, are simple." 16.1 "Classes of intrinsic procedures", paragraph 5,page 327:18 Replace "No other standard intrinsic subroutine is pure." with "No other standard intrinsic subroutine is pure or simple." 16.9.137 "MOVE_ALLOC...", Paragraph 2, page 396:35 Replace "pure" with simple". 16.10.1 "General", paragraph 2, page 426:30 Replace "pure" with "simple". 17.2 "Derived types, constants, and operators defined in the modules", paragraph 3, page 434:27 Replace "pure" with "simple". 17.2. "Derived types, constants, and operators defined in the modules", paragraph 3, page 434:29 Replace "pure" with "simple". 17.10 "Summary of procedures", paragraph 3, page 440:10-11 Replace "PS indicates ... , and" with " S indicates that the procedure is an impure subroutine, SS indicates that the procedure is a simple subroutine, and" 17.10 "Summary of procedures", Table 17.3, page 441 Replace the two occurrences of "PS" with "SS". 17.11.1 "General", paragraph 1, page 441:4 Replace "pure" with "simple". 17.11.35 "IEEE_SET_FLAG ...", paragraph 2, page 455:13 Replace "Pure" with "simple" 17.11.36 "IEEE_SET_HALTING_MODE ...", paragraph 2, page 455:25 Replace "Pure" with "Simple". 18.2.3.1 "General", paragraph 1, page 469:27 Replace "pure" with "simple". 18.2.3.4 "C_F_PROCPOINTER ...", paragraph 2, page 472:16 Replace "Pure" with "Simple".