A well-formed program is defined as a program in which loops and if statements are properly nested and can be entered only at their beginning. A corresponding definition is given for a well-formed flowchart. It is shown that a program is well formed if and only if it can be written with if, repeat, and multi-level exit statements for sequence control. It is also shown that if, while, and repeat statements with single-level exit do not suffice. It is also shown that any flowchart can be converted to a well-formed flowchart by node splitting. Practical implications are discussed.
The Latest from CACM
Shape the Future of Computing
ACM encourages its members to take a direct hand in shaping the future of the association. There are more ways than ever to get involved.
Get InvolvedCommunications of the ACM (CACM) is now a fully Open Access publication.
By opening CACM to the world, we hope to increase engagement among the broader computer science community and encourage non-members to discover the rich resources ACM has to offer.
Learn More
Join the Discussion (0)
Become a Member or Sign In to Post a Comment