Hi everyone! I’m Sean, and I think Prolog is really cool. I am helping to make a deductive database and think Prolog is a great tool for the job.
I have an unusual requirement, though. I don’t just need to be able to query facts, but also query for the deduction path Prolog took to get to a fact. So basically, I want to see what Prolog’s derivation steps were: each rule that it took which helped it get toward the goal. (Not the ones that failed and it just backtracked out of, but the ones that actually helped it get to the goal).
I can implement this in Prolog myself, but I’d assume it would be much more elegant and fast if the interpreter did it. I know the interpreter has a trace function—is there any way to perhaps use that to get a derivation of some fact?