Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Structured program theorem
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Application to Cobol== {{More citations needed section|date=August 2013}} 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. #Identify the [[basic block]]s in the procedure. #Assign a unique [[Label (programming language)|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. #Break the procedure into its basic blocks. #For each block that is the destination of only one exit path, reconnect that block to that exit path. #Declare a new variable in the procedure (called L for reference). #On each remaining unconnected exit path, add a statement that sets L to the label value on that path. #Combine the resulting programs into a selection statement that executes the program with the entry path label indicated by L #Construct a loop that executes this selection statement as long as L is not 0. #Construct a sequence that initializes L to 1 and executes the loop. This construction can be improved by converting some cases of the selection statement into subprocedures.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)