Independent and-parallelism is characterized by the fact that only subgoals which do not share any unbound variable at run-time are entitled to parallel execution. The condition guarantees that they will not affect each other's execution--removing the need of introducing any form of synchronization during parallel execution. The only synchronization activity required is a barrier placed at the end of the parallel part of the execution, needed to switch back to a sequential execution once all the parallel subgoals are completed.
Various steps are required in the exploitation of independent and-parallelism:
Granted that allowing the user to supply information about the subgoals can only improve the execution, the most attractive solution is based on a compromise between compile-time analysis and run-time analysis--compromise which is necessary, since
The solution, originally proposed by DeGroot [29] and successively
elaborated by Hermenegildo and others [58, 94, 46],
consists of generating at compile-time (through abstract interpretation techniques
[79]) some conditional annotations (named Conditional
Graph Expressions (CGE)), which identify potential independent subgoals and the
conditions under which the independence is guaranteed. A CGE has the form
( conditions
G
&
& G
),
where
are some simple tests on the instantiation status of some variables,
and G
,
, G
are the potentially independent subgoals. At run-time,
whenever a CGE is encountered, the
are evaluated and, if the evaluation is
successful, the subgoals G
,
, G
are executed in parallel. The
symbol ``&'' is used to denote a parallel conjunction (i.e., the subgoals connected by
& can be run in parallel), while ``,'' will be maintained to represent sequential
conjunction.
Systems exploiting independent and-parallelism have been successfully implemented; the most relevant proposals are &-Prolog [55], APEX [72], and &ACE [46].