let backtrack (candidates: candidates) : unit =
begin
match candidates.cd_preselected with
| None -> ()
| Some (candidate, _, _) ->
if Context_unifier.is_raw_context_unifier_invalid candidate.ca_raw_context_unifier then
candidates.cd_preselected <- None
else
failwith "Selection_assert.backrack: preselected"
end;
candidates.cd_lookahead <- Selection_lookahead.create Const.max_assert_lookahead;
Selection_lookahead.backtrack candidates.cd_lookahead_exceeding;
retract_valid_min candidates;
retract_valid_max candidates;
backtrack_forgotten candidates;
backtrack_exceeding candidates;
clear_unprocessed candidates