计算机科学 > 程序设计语言
[提交于 2023年9月25日]
标题:While Loops in Coq
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:While loops are present in virtually all imperative programming languages. They are important both for practical reasons (performing a number of iterations not known in advance) and theoretical reasons (achieving Turing completeness). In this paper we propose an approach for incorporating while loops in an imperative language shallowly embedded in the Coq proof assistant. The main difficulty is that proving the termination of while loops is nontrivial, or impossible in the case of non-termination, whereas Coq only accepts programs endowed with termination proofs. Our solution is based on a new, general method for defining possibly non-terminating recursive functions in Coq. We illustrate the approach by proving termination and partial correctness of a program on linked lists.
提交历史
来自:EPTCS[v1] 2023年9月25日 星期一 01:15:58 UTC