计算机科学 > 程序设计语言
[提交于 2025年4月10日]
标题:The nature of loops in programming
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:In program semantics and verification, reasoning about loops is complicated by the need to produce two separate mathematical arguments: an invariant, for functional properties (ignoring termination); and a variant, for termination (ignoring functional properties). A single and simple definition is possible, removing this split. A loop is just the limit (a variant of the reflexive transitive closure) of a Noetherian (well-founded) relation. To prove the loop correct there is no need to devise an invariant and a variant; it suffices to identify the relation, yielding both partial correctness and termination. The present note develops the (small) theory and applies it to standard loop examples and proofs of their correctness.
提交历史
来自:Bertrand Meyer[v1] 2025年4月10日 星期四 20:58:55 UTC