anchor.diff:          (t, (AE_Loc (loc, ae), t, None))
         with err -> locErr loc err
     | EVar (x, _) ->
  -      let (t, info) = lookup_id env x in
  +      let (t, info) = lookup_id_or_fun env u x in
         let () =
           match (env.inline_only, info) with
           | (false, _) -> ()
  
positive.code:   | TVar _ -> t
    | TBool _ -> t
    | TInt _ -> t
    | TTuple ts -> t
    | TFun (ts, t) -> t
    | TDependent x ->
        let (_, x) = lookup_name env x true in
        TDependent x
  
negative.code:   u_unify u None;
    let es = List.map (subst_exp env u.u_substs) aes in
    let prets = List.map (fun (_, t, _, _, _) -> t) p.prets in
    let subt = subst_typ u.u_substs in
    let tRet = match prets with | [] -> None | [t] -> Some (subt t) | _  -> Some (subt (TTuple prets)) in
    let targs = List.map subt pi.p_targs in
    SAssign (xs, EApply (evar p.pname, Some targs, es, tRet))
  
  let rec tc_stmt (env:env) (s:stmt):stmt =
    // TODO: need typing rules for statements
  