06.03.2013 Views

Artificial Intelligence and Soft Computing: Behavioral ... - Arteimi.info

Artificial Intelligence and Soft Computing: Behavioral ... - Arteimi.info

Artificial Intelligence and Soft Computing: Behavioral ... - Arteimi.info

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The SLD tree for the above Logic Program is presented in fig. 6.5. Let<br />

us now explain the importance of the CUT predicate in fig. 6.5. For all<br />

predicates preceding CUT, if unifiable with other clauses, then CUT is<br />

automatically satisfied. Further, if any of the predicates preceding CUT are not<br />

unifiable, then backtracking occurs to the parent of that clause for finding<br />

alternative paths. However, suppose all predicates preceding CUT are unifiable<br />

<strong>and</strong> any of the predicates following CUT in the clause are not unifiable. Under<br />

this circumstance, backtracking occurs to the root of the SLD tree <strong>and</strong> the<br />

control attempts to find alternative solutions from the root.<br />

← !,E,C<br />

4<br />

1<br />

← B, C<br />

← A<br />

When CUT is encountered<br />

← D,!,E,C on backtracking, search is<br />

7 resumed here.<br />

← E, C This part of sub-tree with root<br />

← B,C is not searched because<br />

of the CUT.<br />

Failed<br />

Sub-tree<br />

Literals preceding CUT are unifiable with the same literals in the head of other clauses. So, ! is<br />

automatically satisfied. Since ← E, C cannot be resolved with any more clauses, the control<br />

returns to the root of the tree ← A for generating alternative solution.<br />

Fig. 6.5: Controlling backtracking by using CUT.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!