Content deleted Content added
Line 19:
To avoid confusion between various notions of reducibility to structured programs, it's important to note that McCabe's paper briefly discusses and then operates in the context of a 1973 paper by [[S. Rao Kosaraju]], which gave a refinement (or alternative view) of the [[structured program theorem]]. The seminal 1966 paper of Böhm and Jacopini showed that all programs can be [re]written using only structured programming constructs, (aka the D structures: sequence, if-then-else, and while-loop), however, in transforming a random program into a structured program additional variables may need to be introduced (and used in the tests) and some code may be duplicated.<ref name="WattFindlay2004">{{cite book|author1=David Anthony Watt|author2=William Findlay|title=Programming language design concepts|year=2004|publisher=John Wiley & Sons|isbn=978-0-470-85320-7|pages=228}}</ref>
In their paper, Böhm and Jacopini conjectured, but did not prove that it was necessary to introduce such additional variables for certain kinds of non-structured programs in order to transform them into structured programs.<Ref name="K">{{cite journal|title=Analysis of structured programs|author=S. Rao Kosaraju|journal=J. Computer and System Sciences
McCabe notes in his paper that in view of Kosaraju's results, he intended to find a way to capture the essential properties of non-structured programs in terms of their control flow graphs.<ref name="mccabe76"/>{{rp|315}} He proceeds by first identifying the control flow graphs corresponding to the smallest non-structured programs (these include branching into a loop, branching out of a loop, and their if-then-else counterparts) which he uses to formulate a theorem analogous to [[Kuratowski's theorem]], and thereafter he introduces his notion of essential complexity in order to give a scale answer ("measure of the structureness of a program" in his words) rather than a yes/no answer to the question of whether a program's control flow graph is structured or not.<ref name="mccabe76"/>{{rp|315}} Finally, the notion of reduction used by McCabe to shrink the CFG is not the same as Kosaraju's notion of reducing flowcharts. The reduction defined on the CFG does not know or care about the program's inputs, it is simply a [[graph transformation]].<ref>McCabe footnotes the two definitions of on pages 315 and 317.</ref>
|