let compute_remainder_states (raw_context_unifier: raw_context_unifier) (subst: subst) : bool array =
  (* no map function as the arrays have a different order *)
  let remainder_states =
    Array.make (Array.length raw_context_unifier.rcu_context_partners) false
  in

    for i = 0 to Array.length raw_context_unifier.rcu_space.cus_input_partners - 1 do
      let input_index =
        raw_context_unifier.rcu_space.cus_input_partners.(i).ip_index
      in
      let context_partner =
        raw_context_unifier.rcu_context_partners.(input_index)
      in
        remainder_states.(input_index) <-
          not context_partner.cp_empty_remainder
          ||
          is_remainder
          subst
          context_partner.cp_element
          input_index
    done;

    remainder_states