1% BEGIN LICENSE BLOCK
2% Version: CMPL 1.1
3%
4% The contents of this file are subject to the Cisco-style Mozilla Public
5% License Version 1.1 (the "License"); you may not use this file except
6% in compliance with the License.  You may obtain a copy of the License
7% at www.eclipse-clp.org/license.
8% 
9% Software distributed under the License is distributed on an "AS IS"
10% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
11% the License for the specific language governing rights and limitations
12% under the License. 
13% 
14% The Original Code is  The ECLiPSe Constraint Logic Programming System. 
15% The Initial Developer of the Original Code is  Cisco Systems, Inc. 
16% Portions created by the Initial Developer are
17% Copyright (C) 1995 - 2006 Cisco Systems, Inc.  All Rights Reserved.
18% 
19% Contributor(s): Joachim Schimpf, ECRC
20% 
21% END LICENSE BLOCK
22%
23% @(#)umsparutil.tex	1.1 95/10/24 
24%
25% Joachim Schimpf
26%
27
28\section{Parallel Utilities}
29\label{chapparutil}
30
31This library contains parallel versions of common sequential predicates.
32It is loaded using
33\begin{quote}
34\begin{verbatim}
35:- lib(par_util).
36\end{verbatim}
37\end{quote}
38and it currently contains the following predicates:
39
40\begin{description}
41\item[par_member(?Element, +List)]
42\index{par_member/2}
43Parallel version of \bipref{member/2}{../bips/lib/lists/member-2.html}, i.e.\ selects elements from the
44given list in parallel. Note that it cannot work backwards and generate
45lists like \bipref{member/2}{../bips/lib/lists/member-2.html} can, the list must be a proper list.
46
47\item[par_delete(?Element, ?List, ?Rest)]
48\index{par_delete/3}
49Parallel version of \bipref{delete/3}{../bips/lib/lists/delete-3.html}.
50
51\item[par_between(+From, +To, ?I)]
52\index{par_between/3}
53Parallel version of \bipref{between/3}{../bips/lib/util/between-3.html}. Generates integers between {\it From} and
54{\it To} in parallel. See also \bipref{fork/2}{../bips/kernel/control/fork-2.html}, on which it is based.
55
56\item[par_maplist(+Pred, +In, ?Out)]
57\index{par_maplist/3}
58Parallel version of \bipref{maplist/3}{../bips/lib/apply_macros/maplist-3.html}.
59The semantics is not exactly the same as \bipref{maplist/3}{../bips/lib/apply_macros/maplist-3.html}: It does not work
60backwards and it does not cope with aliasing between the {\it In} and
61the {\it Out} list, since it is implemented on top of \bipref{findall/3}{../bips/kernel/allsols/findall-3.html}.
62There will only be a performance gain if the mapping predicate does
63enough computation to make the overhead pay off.
64
65\item[Goal1 \& Goal2]
66\index{\&/2}
67Parallel AND operator implemented on top of OR-parallelism.
68This will only pay off for sufficiently coarse-grained
69computations in {\it Goal1} and {\it Goal2}.
70
71\end{description}
72
73