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

检查HAL程序的模式

Checking modes of HAL programs

Maria Garcia de la Banda, Warwick Harvey, Kim Marriott, Peter J. Stuckey, Bart Demoen

摘要:

最近的约束逻辑编程(CLP)语言,如HAL和水星,需要类型,模式和谓词的确定性声明。这些信息允许生成有效的目标代码,并在编译时检测许多错误。不幸的是,这种语言的模式检查很困难。其中一个主要原因是,对于每个谓词模式声明,编译器需要适当地重新排序谓词定义中的文字。由于需要处理复杂的实例化(与类型声明和高阶谓词交互)和求解器变量的自动初始化,任务变得更加复杂。在这里,我们定义了强类型CLP语言的模式检查,需要重新排序的子句体文字。此外,我们展示了如何通过使用相应的多态类型来处理多态模式的简单情况。

英文摘要:

Recent constraint logic programming (CLP) languages, such as HAL and Mercury, 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 appropriately re-order literals in the predicate's definition. The task is further complicated by the need to handle complex instantiations (which interact with type declarations and higher-order predicates) and automatic initialization of solver variables. Here we define mode checking for strongly typed CLP languages which require reordering of clause body literals. In addition, we show how to handle a simple case of polymorphic modes by using the corresponding polymorphic types.

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

↑