1

Given a goal to be solved by swi-prolog, I would like to know how prolog arrive to the solution

I tried to use "told" or "tell". Also searching in the docs of swi-prolog, but I couldn't find the answer.

Example:

Rules:

life_form(X) :- animal(X).
animal(X) :- dog(X).

Facts:

cat(coco).
dog(max).

If you now type ?- life_form(max). you get true, but I also want to know how prolog arrive to this conclusion, that is:

dog(max)  ->  animal(max)  -> life_form(max)

Without debugging. Just to ask prolog for an explanation. It sound to me it has to be something like this in prolog.

false
  • 10,264
  • 13
  • 101
  • 209
joe2310
  • 29
  • 6
  • Possible duplicate of [How to get Prolog to explain your result beyond the true statement](https://stackoverflow.com/questions/30649801/how-to-get-prolog-to-explain-your-result-beyond-the-true-statement) – Jens Classen Aug 01 '19 at 18:11

0 Answers0