Function cp::Span(globalActivity, activityBinding, subActivity)


The function cp::Span(g,i,a_i) returns 1 if activity \(g\) and activities \(a_i\) are all not present, or if the begin of present activity \(g\) is equal to the first present activity \(a_i\) and the end of activity \(g\) is equal to the end of the last present activity \(a_i\). The function cp::Span(g,i,a_i) is equivalent to

\[g\texttt{.Present} = 0 \Leftrightarrow \forall i: a_i\texttt{.Present} = 0\]


\[\begin{split}g\texttt{.Present} = 1 \Leftrightarrow \left\{ \begin{array}{l} \exists i|a_i\texttt{.Present} \\ g\texttt{.Begin} = \min_{i|a_i\texttt{.Present}} a_i\texttt{.Begin} \\ g\texttt{.End} = \max_{i|a_i\texttt{.Present}} a_i\texttt{.End} \end{array} \right.\end{split}\]

This function is typically used in scheduling problems to split an activity into sub activities.

        globalActivity,   ! (input) an expression
        activityBinding,  ! (input) an index domain
        subActivity       ! (input) an expression



An expression resulting in an activity.


An index domain that specifies and possibly limits the scope of indices. This argument follows the syntax of the index domain argument of iterative operators.


An expression resulting in an activity. The result is a vector with an element for each possible value of the indices in index domain activityBinding.

Return Value

This function returns 1 if the above condition is satisfied, 0 otherwise. When the index domain i is empty this function will return an error.

See also

The functions cp::Alternative and cp::Synchronize.