问题描述
我需要在某些 Prolog 问题中使用前向链接器.我想避免使用原版元解释器从头开始实现它(但如果没有其他选项可用,我将不得不这样做),因为使用元解释器执行此操作会很慢,而且我我确信应该有一些好的实现.有人知道 YAP 或 SWI Prolog 是否包含本机且高效的前向链接器吗?如果是这种情况,将不胜感激如何安装/使用它的指针.
I need to use a forward chainer in certain Prolog problem. I would like to avoid to implement it my self from scratch with a vanilla meta-interpreter (but that is what I will have to do if no other option is available) since doing this with a meta-interpreter will be slow, and also I am sure that some good implementations should be around.Does someone know if YAP or SWI Prolog includes a native and efficient forward chainer ?. If that is the case, a pointer to how to install it/use it would be greatly appreciated.
如果这两个 Prolog 引擎上没有可用的本地前向链接器,有人可以向我推荐一个基于 vanilla 元解释器的好的开源实现,我可以将其用作外部 Prolog 库吗?
In case no native forward chainer is available on these two Prolog engines, could someone recommend me a good open source implementation based on a vanilla meta-interpreter that I could use as an external Prolog library ?
提前致谢.
推荐答案
YAP 和 SWI 都包含约束处理规则的实现 - http://dtai.cs.kuleuven.be/projects/CHR/ - 这是一个前向链规则系统.
YAP and SWI both include an implementation of Constraint Handling Rules - http://dtai.cs.kuleuven.be/projects/CHR/ - which is a forward-chaining rule system.
我无法谈论它在您的特定问题上的表现,但众所周知,CHR 是高效的(请参阅 CHR 网站上链接的论文).
I cannot speak to its performance with respect to your particular problem, but CHR is known to be efficient (see the papers linked from the CHR site).
CHR 还具有 Java、Haskell 和 C 实现,因此如果您以后需要更好的性能,您可以轻松地将规则移植到其中一种语言.
CHR also has Java, Haskell, and C implementations, so you could easily port your rules to one of those languages if you need better performance later on.
这篇关于YAP Prolog 中的正向链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!