anchor.diff:    | Tm_refine(x, _) ->
       bind_opt (universe_of_well_typed_term env x.sort) (fun u_x ->
       Some (mk_tm_type u_x))
  +
  +  (* Not doing anything smart with these, so we don't even associate
  +   * them appropriately. *)
  +  (* | Tm_app({n=Tm_constant Const_reify}, a::hd::rest) *)
  +  (* | Tm_app({n=Tm_constant (Const_reflect _)}, a::hd::rest) *)
  +
  +  (* Unary operators. Explicitly curry extra arguments *)
  +  | Tm_app({n=Tm_constant Const_range_of}, a::hd::rest) ->
  +    let rest = hd::rest in //no 'as' clauses in F* yet, so we need to do this ugliness
  +    let unary_op, _ = U.head_and_args t in
  +    let head = mk (Tm_app(unary_op, [a])) None (Range.union_ranges unary_op.pos (fst a).pos) in
  +    let t = mk (Tm_app(head, rest)) None t.pos in
  +    type_of_well_typed_term env t
  +
  +  (* Binary operators *)
  +  | Tm_app({n=Tm_constant Const_set_range_of}, a1::a2::hd::rest) ->
  +    let rest = hd::rest in //no 'as' clauses in F* yet, so we need to do this ugliness
  +    let unary_op, _ = U.head_and_args t in
  +    let head = mk (Tm_app(unary_op, [a1; a2])) None (Range.union_ranges unary_op.pos (fst a1).pos) in
  +    let t = mk (Tm_app(head, rest)) None t.pos in
  +    type_of_well_typed_term env t
  +
  +  | Tm_app({n=Tm_constant Const_range_of}, [_]) ->
  +    Some (t_range)
  +
  +  | Tm_app({n=Tm_constant Const_set_range_of}, [(t, _); _]) ->
  +    type_of_well_typed_term env t
   
     | Tm_app(hd, args) ->
       let t_hd = type_of_well_typed_term env hd in
  
positive.code:   | Tm_uinst({n=Tm_fvar fv}, us) ->
      bind_opt (Env.try_lookup_and_inst_lid env us fv.fv_name.v) (fun (t, _) ->
      Some t)
  
    | Tm_constant sc ->
      Some (tc_constant env t.pos sc)
  
negative.code: *)
  let rec type_of_well_typed_term (env:env) (t:term) : option<typ> =
    let mk_tm_type u = S.mk (Tm_type u) None t.pos in
    let t = SS.compress t in
    match t.n with
    | Tm_delayed _
    | Tm_bvar _ -> failwith "Impossible"
  
  