Talk:Structured program theorem

Is the Cobol stuff part of the theorem?
 * No. It's a later development that someone thought was interesting enough to add here, although I don't find it particularly so myself. A brief look at the literature shows that there have been a lot of proposals for automatically transforming unstructured programs into structured ones. I don't know why that particular approach on Cobol programs is important. It probably isn't... 188.27.81.64 (talk) 21:46, 14 July 2014 (UTC)

Inter-procedural version of Kosaraju's hierarchy and exception handling
Possible title of a paper, except I'm not going to write it. ;-/ The Kosaraju hierarcy and in fact the original Böhm-Jacopini theorem apply to whole programs. They don't even in fact try to have a notion of functions, procedures etc. But for the Kosaraju hierarchy in particular, many languages, including C & Java have a limitation that you can't break out of a function and propagate the break into the caller (not without encoding some kind of error value in the result or using an additional variable). Sure you can merge all your functions into one, but that would suck from a practical programming perspective, although highly optimizing compilers like Intel's basically do this behind the scene when they do whole program optimization. That aside, I think that exceptions serve as non-local breaks propagating through activation records and thus syntactically out of the function where they are thrown into some arbitrary other function, so in that sense exceptions (and their handlers) provide the inter-procedural extension of Kosaraju's result to real-life programs that are organized in functions etc. I wasn't able to find any paper in this direction though, so this is just my vague WP:OR idea. 188.27.81.64 (talk) 21:46, 14 July 2014 (UTC)