首页> 外文期刊>Theory and Practice of Logic Programming >A three-valued semantics for logic programmers
【24h】

A three-valued semantics for logic programmers

机译:逻辑程序员的三值语义

获取原文
获取原文并翻译 | 示例

摘要

This paper describes a simpler way for programmers to reason about the correctness of their code. The study of semantics of logic programs has shown strong links between the model theoretic semantics (truth and falsity of atoms in the programmer's interpretation of a program), procedural semantics (for example, SLD resolution) and fixpoint semantics (which is useful for program analysis and alternative execution mechanisms). Most of this work assumes that intended interpretations are two-valued: a ground atom is true (and should succeed according to, the procedural semantics) or false (and should not succeed). In reality, intended interpretations are less precise. Programmers consider that some atoms "should not occur" or are "ill-typed" or "inadmissible". Programmers don't know and don't care whether such atoms succeed. In this paper we propose a three-valued semantics for (essentially) pure Prolog programs with (ground) negation as failure which reflects this. The semantics of Fitting is similar but only associates the third truth value with non-termination. We provide tools to reason about correctness of programs without the need for unnatural precision or undue restrictions on programming style. As well as theoretical results, we provide a programmer-oriented synopsis. This work has come out of work on declarative debugging, where it has been recognised that inadmissible calls are important.
机译:本文为程序员介绍了一种更简单的方法来推理其代码的正确性。对逻辑程序语义的研究表明,模型理论语义(程序员对程序的解释中原子的真实性和虚假性),过程语义(例如SLD解析)和定点语义(对于程序分析很有用)之间有着紧密的联系。以及其他执行机制)。大部分工作都假定预期的解释是两个值的:一个基本原子为true(应根据过程语义而成功)或false(且不应成功)。实际上,预期的解释不太精确。程序员认为某些原子“不应出现”或“类型错误”或“不允许”。程序员不知道也不在乎这些原子是否成功。在本文中,我们为(本质上)纯Prolog程序提出了一个三值语义,并以(否定)否定为失败,这反映了这一点。 Fitting的语义相似,但仅将第三个真值与非终止相关联。我们提供工具来推理程序的正确性,而无需非自然的精度或对编程风格的不适当限制。除了理论结果,我们还提供了面向程序员的简介。这项工作是在声明式调试的基础上完成的,在该调试中,已经认识到不允许的调用很重要。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号