anchor.diff:    | Some x -> f x
     | None -> d
   
  -(* We memoize the normal form of variables in the environment, in
  - * order to implement call-by-need and avoid an exponential explosion,
  - * but we take care to only reuse memoized values when the cfg has not
  - * changed. The main reason is normalization requests, which can "grow"
  - * the set of allowed computations steps, and hence we may memoize
  - * something during the request that is used outside of it. This will
  - * essentially make it invalid. See issue #2155 in Github.
  - *
  - * We compare the cfg with physical equality, so it has to be the
  - * exact same object in memory. See read_memo and set_memo below. *)
  -type cfg_memo<'a> = memo<(Cfg.cfg * 'a)>
  -
   type closure =
  -  | Clos of env * term * cfg_memo<(env * term)> * bool //memo for lazy evaluation; bool marks whether or not this is a fixpoint
  +  | Clos of env * term * memo<(env * term)> * bool //memo for lazy evaluation; bool marks whether or not this is a fixpoint
     | Univ of universe                               //universe terms do not have free variables
     | Dummy                                          //Dummy is a placeholder for a binder when doing strong reduction
   and env = list<(option<binder>*closure)>
  
positive.code:                     let memo = BU.mk_ref None in
                      let rec_env = (None, Clos(env, fix_f_i, memo, true))::rec_env in
                      rec_env, memo::memos, i + 1) (snd lbs) (env, [], 0) in
              let _ = List.map2 (fun lb memo -> memo := Some (cfg, (rec_env, lb.lbdef))) (snd lbs) memos in //tying the knot
              let body_env = List.fold_right (fun lb env -> (None, Clos(rec_env, lb.lbdef, BU.mk_ref None, false))::env)
                                 (snd lbs) env in
              norm cfg body_env stack body
  
negative.code: 
  let head_of t = let hd, _ = U.head_and_args' t in hd
  
  let set_memo cfg (r:memo<'a>) (t:'a) =
    if cfg.memoize_lazy then
      match !r with
      | Some _ -> failwith "Unexpected set_memo: thunk already evaluated"
      | None -> r := Some t
  
  let closure_to_string = function
      | Clos (env, t, _, _) -> BU.format2 "(env=%s elts; %s)" (List.length env |> string_of_int) (Print.term_to_string t)
  