anchor.diff:      let lid = qual (current_module env) id in
       find_in_module env lid k_global_def k_not_found
   
  +let lid_is_curmod env lid =
  +  match env.curmodule with
  +  | None -> false
  +  | Some m -> lid_equals lid m
  +
   let module_is_defined env lid =
  -    (match env.curmodule with
  -     | None -> false
  -     | Some m -> lid_equals lid (current_module env)) ||
  +    lid_is_curmod env lid ||
       List.existsb (fun x -> lid_equals lid (fst x)) env.modules
   
   let resolve_module_name env lid (honor_ns: bool) : option<lident> =
  
positive.code:       match (Subst.compress e).n with
        | Tm_fvar fv -> Some fv.fv_name.v
        | _ -> None
  
  let try_lookup_lid_no_resolve (env: env) l =
    let env' = {env with scope_mods = [] ; exported_ids=empty_exported_id_smap; includes=empty_include_smap }
  
negative.code:     | _ -> ()
      end
  
  let is_open env lid open_kind =
    List.existsb (function
                  | Open_module_or_namespace (ns, k) -> k = open_kind && lid_equals lid ns
                  | _ -> false) env.scope_mods
  
  let namespace_is_open env lid =
    is_open env lid Open_namespace
  
  let module_is_open env lid =
    lid_is_curmod env lid || is_open env lid Open_module
  
  // FIXME this could be faster (module_is_open and namespace_is_open are slow)
  let shorten_module_path env ids is_full_path =
    let rec aux revns id =
      let lid = FStar.Ident.lid_of_ns_and_id (List.rev revns) id in
      if namespace_is_open env lid
  