当前位置: X-MOL 学术Sci. Comput. Program. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Loop invariance with break and continue
Science of Computer Programming ( IF 1.5 ) Pub Date : 2021-05-21 , DOI: 10.1016/j.scico.2021.102679
Wei Chen

This paper presents a formal approach to program derivation using break and continue statements within a loop. We define the break and continue semantics under the framework of weakest precondition. The underpinning theory centers around a miraculous statement re-discovered to model those jump statements in a novel manner. Our focus is on introducing break and continue within a loop to derive a program hand in hand with its correctness. With break and continue so defined, we can naturally incorporate them into the well-known loop invariance theorem. Several program derivation case studies conducted in the paper show that non-trivial programs using those jump statements can be effectively and formally derived without knowing details of underlying formalism. Those case studies should provide convincing evidence that there is no distinction between deriving programs with or without the jump statements but using the jump statements to solve certain types of problems can make the work much simpler and the result more comprehensible.



中文翻译:

break循环不变性并继续

本文提出了一种在循环中使用breakcontinue语句进行程序派生的正式方法。我们在最弱前提条件的框架下定义中断继续语义。基础理论围绕一个奇迹般的陈述而重新发现,该陈述以新颖的方式为那些跳跃陈述建模。我们的重点是引入中断并在循环中继续进行,以与正确性并行地得出程序。随着休息继续如此定义后,我们自然可以将它们合并到众所周知的循环不变性定理中。本文中进行的几个程序派生案例研究表明,使用这些跳转语句的非平凡程序可以在不了解底层形式主义细节的情况下有效而正式地派生。这些案例研究应提供令人信服的证据,即在使用或不使用跳转语句的派生程序之间没有区别,但是使用跳转语句解决某些类型的问题可以使工作更简单,结果也更容易理解。

更新日期:2021-05-25
down
wechat
bug