Constraint-based mode analysis of mercury

Constraint-based mode analysis of mercury
复制标题

基于约束的汞模式分析

DOI:
10.1145/571157.571169
复制
发表时间:
2002
影响因子:
2
通讯作者:
Peter James Stuckey
Peter James Stuckey
中科院分区:
物理与天体物理3区
文献类型:
--
作者:
D. Overton;Z. Somogyi;Peter James Stuckey

文献摘要

被引文献

相似文献

最近的逻辑编程语言,如Mercus和HAL,要求对谓词进行类型、模式和确定性声明。该信息允许生成高效的目标代码并在编译时检测许多错误。不幸的是,在这种语言中进行模式检查很困难。其中一个主要原因是,对于每个谓词模式声明,编译器需要决定过程的哪些部分绑定哪些变量,以及应该如何对谓词定义中的合取进行重新排序以强制执行此行为。当前的模式检查系统限制可能使用的模式,因为它们不跟踪混叠信息,并且由于推断不执行重新排序,因此仅具有有限的推断模式的能力。在本文中,我们开发了一个关于水星的模式推理系统,其基础是将每个谓词映射到一个布尔约束系统,该系统描述了它的变量可以产生在哪里。这允许我们处理现有系统不支持的程序。
Recent logic programming languages, such as Mercury and HAL, require type, mode and determinism declarations for predicates. This information allows the generation of efficient target code and the detection of many errors at compile-time. Unfortunately, mode checking in such languages is difficult. One of the main reasons is that, for each predicate mode declaration, the compiler is required to decide which parts of the procedure bind which variables, and how conjuncts in the predicate definition should be re-ordered to enforce this behaviour. Current mode checking systems limit the possible modes that may be used because they do not keep track of aliasing information, and have only a limited ability to infer modes, since inference does not perform reordering. In this paper we develop a mode inference system for Mercury based on mapping each predicate to a system of Boolean constraints that describe where its variables can be produced. This allows us handle programs that are not supported by the existing system.