0
$\begingroup$

I am trying to understand this program and the respective forest. This is from the book Logic,Programming and Prolog by Ulf Nilsson.

enter image description here

enter image description here

Question:

  • In the main tree, why from ←off_gound(a) can you derive ⧠ ?

  • In the main tree, why was chosed on(b,a) first instead of on(c,b)?

Could someone please explain this?

Thank you so much in advance.

$\endgroup$
2
  • $\begingroup$ Can you give more details on your second question? I don't see where on(b,a) is chosen in the main tree. I'm assuming the main tree is the big one on the left hand side of the figure? $\endgroup$
    – SimonJ
    Sep 25, 2018 at 6:19
  • $\begingroup$ @SimonJ Yes, the main tree is the big one on the left hand side of the figure. on(b,a) is choosen right after the branch splits to be now two branch $\endgroup$
    – Lw. K
    Sep 25, 2018 at 12:10

1 Answer 1

1
$\begingroup$

To answer your first question: SLDNF resolution employs negation as failure to deal with negation.

So from ←$\neg$off_ground(a) we derive ⧠ by trying to derive ←off_ground(a) and failing (i.e. deriving FF). This is done in the upper tree on the right hand side.

$\endgroup$
1
  • $\begingroup$ Will it always be that way right?, I mean if you have FF in a subtree then in the main tree should be ⧠ ? $\endgroup$
    – Lw. K
    Sep 25, 2018 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.