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

Ciao clp(FD)库。Prolog的模块化CLP扩展

The Ciao clp(FD) Library. A Modular CLP Extension for Prolog

Emilio Jesús Gallego Arias, Rémy Haemmerlé, Manuel V. Hermenegildo, José F. Morales

摘要:

我们提出了一个新的免费库约束逻辑编程有限域,包括与Ciao Prolog系统。该库完全用Prolog编写,利用Ciao的模块系统和代码转换功能,以实现高度模块化设计而不影响性能。我们描述了每个模块化组件的接口,实现和设计原理。该库满足几个设计目标:高水平的模块化,允许单个组件被不同版本替换;高效率,与其他FD实现竞争;玻璃盒方法,因此用户可以在不同级别指定新的约束;以及Prolog实现,以简化与Ciao代码分析组件的集成。核心是建立在两个小的库,实现整数范围和闭包。最重要的是,定义了一个有限域变量数据类型,根据范围的变化来处理约束的重新执行。这三个库构成了我们所说的库的FD内核。这个FD内核又用于实现几个更高级别的有限域约束,使用索引指定。这一层与一个标签模块一起构成了我们所称的\emph{the FD solver}。最后一级集成了CLP(FD)范式与我们的FD求解器。这是通过使用属性变量和从clp(FD)语言到求解器提供的约束集的编译器来实现的。应该注意的是,库的用户被鼓励在这些级别中的任何一个上工作,只要看起来方便:从编写新的范围模块到通过编写新的索引来丰富FD约束集。

英文摘要:

We present a new free library for Constraint Logic Programming over Finite Domains, included with the Ciao Prolog system. The library is entirely written in Prolog, leveraging on Ciao's module system and code transformation capabilities in order to achieve a highly modular design without compromising performance. We describe the interface, implementation, and design rationale of each modular component. The library meets several design goals: a high level of modularity, allowing the individual components to be replaced by different versions; high-efficiency, being competitive with other FD implementations; a glass-box approach, so the user can specify new constraints at different levels; and a Prolog implementation, in order to ease the integration with Ciao's code analysis components. The core is built upon two small libraries which implement integer ranges and closures. On top of that, a finite domain variable datatype is defined, taking care of constraint reexecution depending on range changes. These three libraries form what we call the FD kernel of the library. This FD kernel is used in turn to implement several higher-level finite domain constraints, specified using indexicals. Together with a labeling module this layer forms what we name \emph{the FD solver}. A final level integrates the clp(FD) paradigm with our FD solver. This is achieved using attributed variables and a compiler from the clp(FD) language to the set of constraints provided by the solver. It should be noted that the user of the library is encouraged to work in any of those levels as seen convenient: from writing a new range module to enriching the set of FD constraints by writing new indexicals.

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

↑