Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forward chaining in YAP Prolog?

Tags:

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.

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 ?

Thanks in advance.

like image 920
Sergio Avatar asked Dec 28 '22 01:12

Sergio


1 Answers

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.

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 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.

like image 168
Nick Main Avatar answered Jan 18 '23 03:01

Nick Main