arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1110.4978cs.LOcs.PL
收藏

逻辑+控制:程序构造与验证

Logic + control: On program construction and verification

Włodzimierz Drabent

摘要:

本文提出了一个例子,形式化推理的语义Prolog程序的实际意义(SAT求解器的豪和国王)。该程序被视为一个带有附加控制的定子句逻辑程序。逻辑程序是通过逐步精化的方法构造的,并与其正确性和完整性证明携手并进。证明是声明性的--它们不引用任何操作语义。逻辑程序构造的每一步都遵循一种系统的方法来构造可证明正确和完整的程序。我们还证明了在最终的Prolog程序中保持了逻辑程序的正确性和完整性。此外,我们证明终止,发生检查自由和非挣扎。我们的例子展示了如何将处理“逻辑”和处理“控制”分开。大多数证明都可以在“逻辑”级别上完成,从任何操作语义中抽象出来。这个例子使用了近似的规格说明;它们在简化逻辑程序的推理中是至关重要的。它还表明,语义保持程序转换的范例可能是不够的。我们建议考虑转换保持正确性和完整性方面的近似规范。

英文摘要:

This paper presents an example of formal reasoning about the semantics of a Prolog program of practical importance (the SAT solver of Howe and King). The program is treated as a definite clause logic program with added control. The logic program is constructed by means of stepwise refinement, hand in hand with its correctness and completeness proofs. The proofs are declarative - they do not refer to any operational semantics. Each step of the logic program construction follows a systematic approach to constructing programs which are provably correct and complete. We also prove that correctness and completeness of the logic program is preserved in the final Prolog program. Additionally, we prove termination, occur-check freedom and non-floundering. Our example shows how dealing with "logic" and with "control" can be separated. Most of the proofs can be done at the "logic" level, abstracting from any operational semantics. The example employs approximate specifications; they are crucial in simplifying reasoning about logic programs. It also shows that the paradigm of semantics-preserving program transformations may be not sufficient. We suggest considering transformations which preserve correctness and completeness with respect to an approximate specification.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑