let rec solve_xor_eqns_choices unif_nonstd (no_solution : bool)
(std_ls,xor_eqns,rem_ls,fv,ctr) (var_identif : t_partition) vi_ctrs
: (int list * int list) list -> t_subst =
function
| choice::choices ->
(try
(* If we find a solution for this choice of theory indices, we do not
* need to check other choices of variable indices, because they would
* only lead to equivalent solutions. *)
solve_xor_eqns unif_nonstd
(std_ls,xor_eqns,rem_ls,fv,ctr)
var_identif vi_ctrs choice
with
| Invalid_Var_Identif ->
(* Trying this choice of theory indices failed. Try the others. *)
solve_xor_eqns_choices unif_nonstd no_solution
(std_ls,xor_eqns,rem_ls,fv,ctr)
var_identif vi_ctrs choices
| No_Solution ->
(* No solution for this choice of theory indices, try the other
* ones, but remember, that at least one failed with No_Solution. *)
solve_xor_eqns_choices unif_nonstd true
(std_ls,xor_eqns,rem_ls,fv,ctr)
var_identif vi_ctrs choices
)
| [] ->
(* If at least one choice failed with No_Solution, then raise
* No_Solution.
* If all choices failed with Invalid_Var_Identif, then raise
* Invalid_Var_Identif. *)
if no_solution then
raise No_Solution
else
raise Invalid_Var_Identif