首页> 外文会议>Functional and Logic Programming >Well-Typed Logic Programs Are not Wrong
【24h】

Well-Typed Logic Programs Are not Wrong

机译:逻辑良好的程序没有错

获取原文

摘要

We consider prescriptive type systems for logic programs (as in Goedel or Mercury). In such systems, the typing is static, but it guarantees an operational property: if a program is "well-typed", then all derivations starting in a "well-typed" query are again "well-typed". This property has been called subject reduction. We show that this property can also be phrased as a property of the proof-theoretic semantics of logic programs, thus abstracting from the usual operational (top-down) semantics. This proof-theoretic view leads us to questioning a condition which is usually considered necessary for subject reduction, namely the head condition. It states that the head of each clause must have a type which is a variant (and not a proper instance) of the declared type. We provide a more general condition, thus reestablishing a certain symmetry between heads and body atoms. The condition ensures that in a derivation, the types of two unified terms are themselves unifiable. We discuss possible implications of this result. We also discuss the relationship between the head condition and polymorphic recursion, a concept known in functional programming.
机译:我们考虑用于逻辑程序的规定类型系统(如Goedel或Mercury)。在这样的系统中,类型化是静态的,但是它保证了操作性:如果程序是“良好类型”的,则所有从“良好类型”查询开始的派生都将再次“良好类型”。此属性被称为主题缩减。我们表明,该属性也可以表述为逻辑程序的证明理论语义的属性,从而从通常的操作(自上而下)语义中抽象出来。这种证明理论的观点使我们质疑一个通常被认为是减少主体的必要条件,即头部条件。它声明每个子句的头必须具有一个类型,该类型是声明的类型的变体(而不是适当的实例)。我们提供了一个更一般的条件,从而在头部和身体原子之间重新建立了一定的对称性。该条件确保在推导中,两个统一术语的类型本身是不可确定的。我们讨论了该结果的可能含义。我们还讨论了头部条件与多态递归之间的关系,这种关系在函数式编程中是众所周知的。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号