opencog / ure

Unified Rule Engine. Graph rewriting system for the AtomSpace. Used as reasoning engine for OpenCog.
Other
54 stars 32 forks source link

Memoize unification to speed up URE #19

Open ngeiswei opened 5 years ago

ngeiswei commented 5 years ago

One source of computational overhead in the URE is the unification between rule conclusions and targets when going backward, or rule premises and sources when going forward.

Often the same unification operation is carried over. Add to that, unification is stateless. Thus is a perfect candidate for memoization.

ngeiswei commented 5 years ago

Some more precisions, the calls to be memoized are https://github.com/opencog/atomspace/blob/master/opencog/rule-engine/backwardchainer/ControlPolicy.cc#L119 for the backward chainer, and https://github.com/opencog/atomspace/blob/master/opencog/rule-engine/forwardchainer/ForwardChainer.cc#L313 for the forward chainer.