anchor.diff:                      then mk_imp U.mk_iff phi1 phi2
                       else mk_imp U.mk_imp phi1 phi2 in
                   let guard = U.mk_conj (p_guard base_prob) impl in
  +                def_check_closed_in (p_loc orig) "ref.1" (List.map fst (p_scope orig)) (p_guard base_prob);
  +                def_check_closed_in (p_loc orig) "ref.2" (List.map fst (p_scope orig)) impl;
                   let wl = solve_prob orig (Some guard) [] wl in
                   solve env (attempt [base_prob] wl)
                in
  
positive.code:                 if debug env <| Options.Other "Rel"
                  then BU.print1 "Adding subproblems for arguments: %s\n"
                                     (Print.list_to_string (prob_to_string env) subprobs);
                  let formula = U.mk_conj_l (List.map p_guard subprobs) in
                  let wl = solve_prob orig (Some formula) [] wl in
                  solve env (attempt subprobs wl)
  
negative.code:         | [] -> lg
          | _ -> S.mk_Tm_app lg (List.map (fun (x, i) -> S.bv_to_name x, i) scope) None lg.pos
      in
      let prob =
          //logical guards are always squashed;
          //their range is intentionally dummy
          {
               pid=next_pid();
               lhs=lhs;
               relation=rel;
               rhs=rhs;
               element=elt;
               logical_guard=lg;
               logical_guard_uvar=(scope, ctx_uvar);
               reason=reason::p_reason orig;
               loc=p_loc orig;
               rank=None;
          }
      in
      (prob, wl)
  
  let mk_t_problem wl scope orig lhs rel rhs elt reason =
    def_check_prob (reason ^ ".arg_t") orig;
    let p, wl = mk_problem wl scope orig lhs rel rhs elt reason in
    def_check_prob (reason ^ ".mk_t") (TProb p);
    TProb p, wl
  
  let mk_c_problem wl scope orig lhs rel rhs elt reason =
    def_check_prob (reason ^ ".arg_c") orig;
    let p, wl = mk_problem wl scope orig lhs rel rhs elt reason in
    def_check_prob (reason ^ ".mk_c") (CProb p);
    CProb p, wl
  
  let new_problem wl env lhs rel rhs (subject:option<bv>) loc reason =
  