anchor.diff:          //            (Print.args_to_string [last_arg_rhs]);
           let (Flex (t_lhs, u_lhs, _lhs_args)) = lhs in
           let lhs', lhs'_last_arg, wl =
  -              let t_last_arg = env.type_of_well_typed ({env with lax=true; use_bv_sorts=true; expected_typ=None}) (fst last_arg_rhs) in
  +              let t_last_arg = env.type_of_well_typed_tot_or_gtot_term ({env with lax=true; use_bv_sorts=true; expected_typ=None}) (fst last_arg_rhs) in
                 //FIXME: this may be an implicit arg ... fix qualifier
                 //AR: 07/20: note the type of lhs' is t_last_arg -> t_res_lhs
                 let _, lhs', wl =
  
positive.code:     imps, b
    
  let resolve_implicits' env is_tac g =
    let must_total =
      if is_tac then false
      else (not env.phase1 && not env.lax) in
  
    let rec unresolved ctx_u =
      match (Unionfind.find ctx_u.ctx_uvar_head) with
      | Some r ->
  
negative.code:                                     (rel_to_string problem.relation)
                                      (Print.comp_to_string c2) in
           let c1, c2 = N.ghost_to_pure env c1, N.ghost_to_pure env c2 in
           let univ_subprobs, wl_univs = [], wl in
             // let c1_univs, c2_univs =
             //   (U.comp_to_comp_typ_nouniv c1).comp_univs,
             //   (U.comp_to_comp_typ_nouniv c2).comp_univs in
             // if List.length c1_univs = List.length c2_univs
             // then
             //   List.fold_left2 (fun (univ_sub_probs, wl) u1 u2 ->
             //     let p, wl = sub_prob wl
             //       (S.mk (S.Tm_type u1) Range.dummyRange)
             //       EQ
             //       (S.mk (S.Tm_type u2) Range.dummyRange)
             //       "effect universes" in
             //     univ_sub_probs@[p], wl) ([], wl) c1_univs c2_univs
             // else [], wl in
           match c1.n, c2.n with
           | GTotal (t1, _), Total (t2, _) when (Env.non_informative env t2) ->
             let tprob = TProb (problem_using_guard orig t1 problem.relation t2 None "result type") in
             solve env (attempt (univ_subprobs@[tprob]) wl_univs)
  
           | GTotal _, Total _ ->
             giveup env (Thunk.mkv "incompatible monad ordering: GTot </: Tot")  orig
  
           | Total  (t1, _), Total  (t2, _)
           | GTotal (t1, _), GTotal (t2, _) -> //rigid-rigid 1
             let tprob = TProb (problem_using_guard orig t1 problem.relation t2 None "result type") in
             solve env (attempt (univ_subprobs@[tprob]) wl_univs)
  
           | Total  (t1, _), GTotal (t2, _) when problem.relation = SUB ->
             let tprob = TProb (problem_using_guard orig t1 problem.relation t2 None "result type") in
             solve env (attempt (univ_subprobs@[tprob]) wl_univs)
  
           | Total  (t1, _), GTotal (t2, _) ->
             giveup env (Thunk.mkv "GTot =/= Tot") orig
  
           | GTotal _, Comp _
           | Total _,  Comp _ ->
             solve_c env ({problem with lhs=mk_Comp <| Env.comp_to_comp_typ env c1}) wl
  
           | Comp _, GTotal _
           | Comp _, Total _ ->
             solve_c env ({problem with rhs=mk_Comp <| Env.comp_to_comp_typ env c2}) wl
  
           | Comp _, Comp _ ->
              if (U.is_ml_comp c1 && U.is_ml_comp c2)
              || (U.is_total_comp c1 && U.is_total_comp c2)
              || (U.is_total_comp c1 && U.is_ml_comp c2 && problem.relation=SUB)
              then
                let tprob = TProb (problem_using_guard orig (U.comp_result c1) problem.relation (U.comp_result c2) None "result type") in
                solve env (attempt (univ_subprobs@[tprob]) wl_univs)
              else let c1_comp = Env.comp_to_comp_typ env c1 in
                   let c2_comp = Env.comp_to_comp_typ env c2 in
                   if problem.relation=EQ
  