Open ngeiswei opened 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.
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.