anchor.diff:            let s = "__proj" + t + "__item__" + f in
             let e = EApply (Id s, [e]) in
             infer_exp_one env e expected_typ
  -        | _ -> err ("unknown field type") in
  +        | _ -> err (sprintf "unknown field type %A for field %s" t1 (err_id x)) in
         let ae = 
           match ae with 
           | AEApply (x, es, [t], [et]) -> AEOp (FieldOp x, es, t, et)
  -        | _ -> err ("expect apply expression") in
  +        | _ -> err ("'FieldOp' should be converted to 'EApply' before typechecking") in
         ([t], ae, s)
       | EOp (FieldUpdate x, [e1; e2]) -> 
         let (t1, _, _) = infer_exp_one env e1 None in
  
positive.code:   let neg = function | Int i -> Int -i | Inf -> NegInf | NegInf -> Inf in
    match t with 
    | TInt (b1, b2) -> TInt (neg b1, neg b2)
    | _ -> err ("expect int type")
  
  let bnd_equal b1 b2 =
    match (b1, b2) with 
  
negative.code: let bind (m:substitutions) (x:id) (t:typ): substitutions =
    match t with
    | TVar (y, k) -> if (x=y) then m else Map.add x t m
    | _ -> if occurs x t then err ("circular type constraint" + err_id x + " " + string_of_type t) else Map.add x t m
  
  let unify_lower_bound l1 l2 =
    match (l1, l2) with 
    | (Int i1, Int i2) -> if i1 < i2 then Int i2 else Int i2
    | (NegInf, _) | (_, NegInf) -> NegInf
    | _ -> err (sprintf "cannot unify integer lower bound %A %A" l1 l2)
  
  let unify_upper_bound l1 l2 =
    match (l1, l2) with 
    | (Int i1, Int i2) -> if i1 > i2 then Int i2 else Int i2
    | (Inf, _) | (_, Inf) -> Inf
    | _ -> err (sprintf "cannot unify integer upper bound %A %A" l1 l2)
  
  let bind_typ (m:substitutions) (s:typ) (t:typ):substitutions =
    match s with
  