anchor.diff:        let r = is_C (fst (List.hd args)) in
         if r then begin
           if not (List.for_all (fun (h, _) -> is_C h) args) then
  -          failwith "not a C (A * C)";
  +          raise_error (Error_UnexpectedDM4FType,
  +                         BU.format1 "Not a C-type (A * C): %s" (Print.term_to_string t))
  +                      t.pos;
           true
         end else begin
           if not (List.for_all (fun (h, _) -> not (is_C h)) args) then
  -          failwith "not a C (C * A)";
  +          raise_error (Error_UnexpectedDM4FType,
  +                         BU.format1 "Not a C-type (C * A): %s" (Print.term_to_string t))
  +                      t.pos;
           false
         end
     | Tm_arrow (binders, comp) ->
         begin match nm_of_comp comp with
         | M t ->
             if (is_C t) then
  -            failwith "not a C (C -> C)";
  +            raise_error (Error_UnexpectedDM4FType,
  +                           BU.format1 "Not a C-type (C -> C): %s" (Print.term_to_string t))
  +                        t.pos;
             true
         | N t ->
             // assert (List.exists is_C binders) ==> is_C comp
  
positive.code:           in
            let (rel0,rels) =
                match List.mapi (fun i (t, q) -> mk_stronger t (project i x) (project i y)) args with
                    | [] -> failwith "Impossible : Empty application when creating stronger relation in DM4F"
                    | rel0 :: rels -> rel0, rels
            in
            List.fold_left U.mk_conj rel0 rels
  
negative.code:                 (U.mk_app y [ S.as_arg (S.bv_to_name a2) ]))
              in
              mk_forall a1 (mk_forall a2 body)
      | Tm_arrow (binder :: binders, comp) ->
          (* split away the first binder and recurse, so we fall in the case above *)
          let t = { t with n = Tm_arrow ([ binder ], S.mk_Total (U.arrow binders comp)) } in
          mk_rel t x y
      | Tm_arrow ([], _) ->
          failwith "impossible: arrow with empty binders"
      | _ ->
          (* TODO: assert that this is a base type. *)
          (* BU.print2 "base, x=%s, y=%s\n" (Print.term_to_string x) (Print.term_to_string y); *)
  