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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example 6.5, presented below, illustrates how unnecessary search in SLD trees<br />

can be avoided by placing CUT statements in the Logic Program.<br />

← P (X, b)<br />

1 2<br />

← Q (X, Y), P (Y, b) ϕ<br />

(X = b) Success<br />

1<br />

2<br />

← Q (X, Y), Q (Y, U), P(U, b) ← Q(X,b) 3<br />

Success<br />

1 2<br />

←Q (X, Y), Q (Y, U), Q (U, V), P(V, b) ← Q(X,Y),Q(Y,b)<br />

1 2<br />

infinite<br />

Fig. 6.4: An infinite SLD tree.<br />

ϕ<br />

(X =<br />

Example 6.5: Consider the Logic Program, where “!” denotes the CUT<br />

predicate.<br />

1) A ← B, C<br />

...<br />

4) B ← D, !, E<br />

...<br />

7) D ←<br />

<strong>and</strong> Goal: ← A

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

Saved successfully!

Ooh no, something went wrong!