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.

However, given sufficient computing resources, it is possible to perform the<br />

unification of A(X) with A(1), A(2) <strong>and</strong> A(3) in parallel (vide fig. 22.9 ). Such<br />

concurrent unification of A(X) with OR- clauses A(1), A(2) <strong>and</strong> A(3) is called<br />

OR-parallelism. The prime difficulty with OR- parallelism, with respect to the<br />

last example, is the propagation of the correct bindings of variables to P(X).<br />

This, however, calls for some knowledge about the existence of P(3) as a head<br />

of some clauses. Perhaps, by maintaining concurrency of AND as well as ORparallelism<br />

with the help of synchronization signals, this could be made<br />

possible in future PROLOG machines.<br />

Fig. 22.9: Demonstrating the concurrent resolution of a clause with<br />

three OR clauses.<br />

c) Stream Parallelism<br />

2<br />

main ←b, c, d , P(1).<br />

main ← A (X), P(X).<br />

Stream parallelism occurs in PROLOG, when the literals pass a stream of<br />

variable bindings to other literals, each of which is operated on concurrently.<br />

Literals producing the variable bindings are called producers, while the<br />

literals that use these bound values of variables are called consumers. As an<br />

example, consider the following logic program :<br />

1. main ← Int (N), Test (N), Print(N).<br />

2. Int (0) ←<br />

3. Int (N) ← Int ( M ), N is M + 1.<br />

main ←e, f, g, P (2).<br />

main← h, i, P (3).<br />

In the above program, Int (N) produces the value of N, which is passed<br />

on to Test (N) <strong>and</strong> Print (N) in succession. However, the procedure for Test<br />

(N) <strong>and</strong> Print(N) may be executed with old bindings of N, while new<br />

bindings of N may be generated concurrently for alternative solutions. Such<br />

parallelism is referred to as Stream Parallelism. Stream parallelism has<br />

3<br />

4

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

Saved successfully!

Ooh no, something went wrong!