ure
ure copied to clipboard
add api to extract inference trace
Sometimes it is useful to have graph or tree for inference. Like source -> rule -> rule -> rule -> result
Usecases:
- theorem proving
- planning
The backward chainer already somewhat supports that, i.e. the user can pass an auxiliary atomspace where the trace is stored. This is for instance used in the inference control meta-learning experiment https://github.com/opencog/opencog/tree/master/examples/pln/inference-control-learning
For more info on how to do that see (help cog-bc).
Regarding the forward chainer, the C++ code does some of that, but they are no scheme bindings for it. It could be added, although keep in mind that I eventually intend to merge the forward chainer into the backward chainer code (but that may far in the future, although I hope not).
I found that forward chainer also writes some trace into current atomspace, though it is not possible to find how all premises became satisfied for current rule application.
No inference control meta-learning experiments have been attempted with the forward chainer yet, so trace support is lacking.
The following constitute a start of an API to extract FC traces
https://github.com/ngeiswei/reasoning-bio-as-xp/blob/6006874a9918b29510080d5ef43ffc5b7fc809e4/bio-as-utils.scm#L348-L479
It just needs some work and being moved to the URE.