Eliminating go to's while preserving program structure

Author:

Ramshaw Lyle1

Affiliation:

1. Digital Equipment Corp. Systems Research Center, Palo Alto, CA

Abstract

Suppose we want to eliminate the local go to statements of a Pascal program by replacing them with multilevel loop exit statements. The standard ground rules for eliminating go to's require that we preserve the flow graph of the program, but they allow us to completely rewrite the control structures that glue together the program's atomic tests and actions. The go to's can be eliminated from a program under those ground rules if and only if the flow graph of that program has the graph-theoretic property named reducibility. This paper considers a stricter set of ground rules, introduced by Peterson, Kasami, and Tokura, which demand that we preserve the program's original control structures, as well as its flow graph, while we eliminate its go to's. In particular, we are allowed to delete the go to statements and the labels that they jump to and to insert various exit statements and labeled repeat-endloop pairs for them to jump out of. But we are forbidden to change the rest of the program text in any way. The critical issue that determines whether go to's can be eliminated under these stricter rules turns out to be the static order of the atomic tests and actions in the program text. This static order can be encoded in the program's flow graph by augmenting it with extra edges. It can then be shown that the reducibility of a program's augmented flow graph, augmenting edges and all, is a necessary and sufficient condition for the eliminability of go to's from that program under the stricter rules.

Publisher

Association for Computing Machinery (ACM)

Subject

Artificial Intelligence,Hardware and Architecture,Information Systems,Control and Systems Engineering,Software

Reference22 articles.

1. An Algorithm for Structuring Flowgraphs

2. BAKER B. S. AND KOSARAJU S. R. A comparison of multilevel break and next statements. Z/c'~t ~ 3 (July !979) 10.1145/322139.322151 BAKER B. S. AND KOSARAJU S. R. A comparison of multilevel break and next statements. Z/c'~t ~ 3 (July !979) 10.1145/322139.322151

3. Flow diagrams, turing machines and languages with only two formation rules

4. Letters to the editor: go to statement considered harmful

5. On folk theorems

Cited by 41 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. An Algorithm for Partial Elimination of Jumps in an Object-Oriented Dataflow Language;Proceedings of the 2023 7th International Conference on Computer Science and Artificial Intelligence;2023-12-08

2. Beyond Relooper: recursive translation of unstructured control flow to structured control flow (functional pearl);Proceedings of the ACM on Programming Languages;2022-08-29

3. VP_TT: A value propagation based equivalence checker for testability transformations;IET Software;2021-01-26

4. BrowserVM: Running Unmodified Operating Systems and Applications in Browsers;2020 IEEE International Conference on Web Services (ICWS);2020-10

5. Guarded Kleene algebra with tests: verification of uninterpreted programs in nearly linear time;Proceedings of the ACM on Programming Languages;2020-01

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3