

![0_image_0.png](0_image_0.png)

IFCSP-SCHEME(P,W ho,W hat,**W hen**)
Q ← P0

![0_image_1.png](0_image_1.png)

,s1,pref1 ← BBE(P, 0, W ho, W hat,W hen, smax, prefmax)
′

preference value. Function **nextV ariable**, applied to the 1-completion of the IFCSP,
returns the next variable to be assigned. The algorithm then assigns a value to this variable. If the Boolean function **nextV alue** returns true (if there is a value in the domain), we select a value for **currentV ar** according to the value of parameter **W ho**.

Function **U pperBound** computes an upper bound on the preference of any completion of the current partial assignment: the minimum over the preferences of the constraints involving only variables that have already been instantiated.

If When=tree, elicitation is handled by procedure Elicit@**tree**, and takes place only at the end of the search over the 1-completion. The user is not involved in the value assignment steps within the search. At the end of the search, if a solution is found, the user is asked either to reveal all the preferences of the incomplete tuples in the solution (if What=all), or only the worst one among them (if What=worst). If such a preference is better than the best found so far, BBE is called recursively with the new best solution and preference.

If When=branch, BB is performed only once. The user may be asked to choose the next value for the current variable being instantiated. Preference elicitation, which is handled by function Elicit@**branch**, takes place during search, whenever all variables have been instantiated and the user can be asked either to reveal the preferences of all the incomplete tuples in the assignment (What=all), or the worst preference among those of the incomplete tuples of the assignment (What=worst). In both cases the information gathered is sufficient to test such a preference value against the current lower bound.