Structured Program Theorem - Application To Cobol

Application To Cobol

In the 1980s IBM researcher Harlan Mills oversaw the development of the COBOL Structuring Facility, which applied a structuring algorithm to COBOL code. Mills's transformation involved the following steps for each procedure.

  1. Identify the basic blocks in the procedure.
  2. Assign a unique label to each block's entry path, and label each block's exit paths with the labels of the entry paths they connect to. Use 0 for return from the procedure and 1 for the procedure's entry path.
  3. Break the procedure into its basic blocks.
  4. For each block that is the destination of only one exit path, reconnect that block to that exit path.
  5. Declare a new variable in the procedure (called L for reference).
  6. On each remaining unconnected exit path, add a statement that sets L to the label value on that path.
  7. Combine the resulting programs into a selection statement that executes the program with the entry path label indicated by L
  8. Construct a loop that executes this selection statement as long as L is not 0.
  9. Construct a sequence that initializes L to 1 and executes the loop.

Note that this construction can be improved by converting some cases of the selection statement into subprocedures.

Read more about this topic:  Structured Program Theorem

Famous quotes containing the words application to and/or application:

    The receipt to make a speaker, and an applauded one too, is short and easy.—Take of common sense quantum sufficit, add a little application to the rules and orders of the House, throw obvious thoughts in a new light, and make up the whole with a large quantity of purity, correctness, and elegancy of style.
    Philip Dormer Stanhope, 4th Earl Chesterfield (1694–1773)

    It is known that Whistler when asked how long it took him to paint one of his “nocturnes” answered: “All of my life.” With the same rigor he could have said that all of the centuries that preceded the moment when he painted were necessary. From that correct application of the law of causality it follows that the slightest event presupposes the inconceivable universe and, conversely, that the universe needs even the slightest of events.
    Jorge Luis Borges (1899–1986)