...
首页> 外文期刊>Theory and Practice of Logic Programming >A structured alternative to Prolog with simple compositional semantics
【24h】

A structured alternative to Prolog with simple compositional semantics

机译:具有简单组成语义的Prolog的结构化替代方案

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

摘要

Prolog's very useful expressive power is not captured by traditional logic programming semantics, due mainly to the cut and goal and clause order. Several alternative semantics have been put forward, exposing operational details of the computation state. We propose instead to redesign Prolog around structured alternatives to the cut and clauses, keeping the expressive power and computation model but with a compositional denotational semantics over much simpler states-just variable bindings. This considerably eases reasoning about programs, by programmers and tools such as a partial evaluator, with safe unfolding of calls through predicate definitions. An if-then-else across clauses replaces most uses of the cut, but the cut's full power is achieved by an until construct. Disjunction, conjunction and until, along with unification, are the primitive goal types with a compositional semantics yielding sequences of variable-binding solutions. This extends to programs via the usual technique of a least fixpoint construction. A simple interpreter for Prolog in the alternative language, and a definition of until in Prolog, establish the identical expressive power of the two languages. Many useful control constructs are derivable from the primitives, and the semantic framework illuminates the discussion of alternative ones. The formalisation rests on a term language with variable abstraction as in the 2-calculus. A clause is an abstraction on the call arguments, a continuation, and the local variables. It can be inclusive or exclusive, expressing a local case bound to a continuation by either a disjunction or an if-then-else. Clauses are open definitions, composed (and closed) with simple functional application (β-reduction). This paves the way for a simple account of flexible module composition mechanisms. Cube, a concrete language with the exposed principles, has been implemented on top of a Prolog engine and successfully used to build large real-world applications.
机译:Prolog非常有用的表达能力没有被传统的逻辑编程语义所捕获,这主要是由于切割,目标和从句顺序所致。提出了几种替代语义,公开了计算状态的操作细节。相反,我们建议围绕cut和子句的结构化替代方案重新设计Prolog,保留表达能力和计算模型,但在更简单的状态(可变绑定)上具有组成指称语义。通过谓词定义可以安全地展开调用,从而极大地简化了程序员和工具(例如部分求值器)对程序的推理。 if-then-else跨子句替代了cut的大多数用法,但是cut的全部功能是通过直到构造来实现的。析取,连词以及直到统一是具有组合语义的原始目标类型,产生组合变量解的序列。这通过最小定点构造的常规技术扩展到程序。 Prolog用替代语言的简单解释器以及Prolog中的直到的定义建立了两种语言相同的表达能力。许多有用的控制结构都可以从原语派生而来,语义框架阐明了对替代结构的讨论。形式化依赖于具有变量抽象的术语语言(如2演算)。子句是对调用参数,延续和局部变量的抽象。它可以是包容性的或排他性的,表示通过析取或if-then-else绑定到延续的局部案例。子句是开放定义,由简单的功能应用(β归约)组成(和封闭)。这为简单说明灵活的模块组成机制铺平了道路。多维数据集是一种具有公开原理的具体语言,已在Prolog引擎上实现,并已成功用于构建大型实际应用程序。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号