anchor.diff:        let ae = 
           match ae with 
           | AEApply (x, es, [t], [et]) -> AEOp (Uop (UIs x), es, t, et)
  -        | _ -> err ("expect apply expression") in
  +        | _ -> err ("'UIs' should be converted to 'EApply' first before typechecking") in
  +      ([t], ae, s)
  +    | EOp (Uop (UCustom op), l) ->
  +      let p = lookup_proc env (Operator op) in
  +      let e = EApply (attrs_get_id (Reserved "alias") p.attrs, l) in
  +      let (t, ae, s) = infer_exp_one env e expected_typ in
  +      let ae = 
  +        match ae with 
  +        | AEApply (x, es, [t], [et]) -> AEOp (Uop (UCustom op), es, t, et)
  +        | _ -> err ("'UCustom' should be converted to 'EApply' first before typechecking") in
         ([t], ae, s)
       | EOp (Uop op, _) ->
  -      err ("unsupported Uop")
  +      err (sprintf  "unsupported Uop '%A' in typechecker" op)
       | EOp (Bop op, [e1; e2]) when isArithmeticOp op ->
         // op in {+, -, *, /, %} 
         let tv = next_type_var() in
  
positive.code:     let e = EApply (Id "tuple", es) in
      match (t, et) with
      | (TTuple xs, TTuple ys) -> 
        List.iter2 (fun t1 t2 -> if (not (typ_equal t1 t2)) then err "tuple types do not match") xs ys;
        List.iter (fun t -> if (not (kind_equal (resolve_type env t) (KType bigint.Zero))) then err "Only 'Type0' is allowed in tuple") xs;
        e
      | _ -> err ("tuple type expected")
    | AEApply (x, aes, ts, ets) ->
      let es = List.map (fun ae -> subst_exp env s ae) aes  in
      let t = List.map (fun t -> substitute env s t) ts in 
  
negative.code:     | BMul -> [l1*l2; h1*l2; l1*h2; h1*h2]
      | BDiv when (l2 > bigint.Zero) || (h2 < bigint.Zero) -> [l1/l2; h1/l2; l1/h2; h1/h2]
      | BMod when (l2 > bigint.Zero) || (h2 < bigint.Zero) -> [bigint.Zero; (abs l2)-bigint.One; (abs h2)-bigint.One]
      | _ -> err (sprintf "cannot find new bound for '(%A, %A) %A (%A, %A)'" l1 h1 op l2 h2) in
    (List.min s, List.max s)
  
  let unify_int_bound (t1:typ) (t2:typ) (op:bop): typ option =
  