A wp Characterization of Jump Statements

被引:0
作者
Chen, Wei [1 ]
机构
[1] VMware Inc, Palo Alto, CA 94304 USA
来源
2021 INTERNATIONAL SYMPOSIUM ON THEORETICAL ASPECTS OF SOFTWARE ENGINEERING (TASE 2021) | 2021年
关键词
goto statement; break statement; continue statement; weakest precondition; predicate transformer; axiomatic semantics; formal method; proof rules; SEMANTICS; LOGIC;
D O I
10.1109/TASE52547.2021.00019
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
In this paper we present a formal characterization of goto statements in terms of Dijkstra's weakest precondition model. We show that the goto semantics so defined captures the nature of goto statements and even applies when jumping into program constructs like alternation and repetition. With this formal definition of goto, we can characterize break and continue statements in a loop, and prove a new form of the traditional loop invariance theorem, which works with break and continue statements and has a special instance for an invariance theorem about goto statements. We, in turn, take this invariance theorem for goto statements as a basis and generalize it, although not as straightforward as hoped, to treat the multiple sequentially composed labels, which can cover essentially all scenarios.
引用
收藏
页码:15 / 22
页数:8
相关论文
共 16 条
[1]  
[Anonymous], 1989, PREDICATE CALCULUS P
[2]   PROOF RULES FOR GOTOS [J].
ARBIB, MA ;
ALAGIC, S .
ACTA INFORMATICA, 1979, 11 (02) :139-148
[3]   A Program Logic for Bytecode [J].
Bannwart, Fabian ;
Mueller, Peter .
ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2005, 141 (01) :255-273
[4]  
Chen W., P 15 INT S THEOR ASP
[5]   Loop invariance with break and continue [J].
Chen, Wei .
SCIENCE OF COMPUTER PROGRAMMING, 2021, 209
[6]  
Clint M., 1972, Acta Informatica, V1, P214, DOI 10.1007/BF00288686
[7]   CONSTRUCTIVE VERSIONS OF TARSKI FIXED-POINT THEOREMS [J].
COUSOT, P ;
COUSOT, R .
PACIFIC JOURNAL OF MATHEMATICS, 1979, 82 (01) :43-57
[8]   GOTO STATEMENTS - SEMANTICS AND DEDUCTION SYSTEMS [J].
DEBRUIN, A .
ACTA INFORMATICA, 1981, 15 (04) :385-424
[9]  
Dijkstra E.W., 1985, 45AEWD901A AVG
[10]   GO TO STATEMENT CONSIDERED HARMFUL [J].
DIJKSTRA, EW .
COMMUNICATIONS OF THE ACM, 1968, 11 (03) :147-&