anchor.diff:      mlog (fun _ -> BU.print2 "+++Rewrite %s : %s\n" (Print.bv_to_string bv) (Print.term_to_string bv.sort)) (fun _ ->
       match split_env bv (goal_env goal) with
       | None -> fail "binder not found in environment"
  -    | Some (e0, bvs) -> begin
  +    | Some (e0, bv, bvs) -> begin
           match destruct_eq bv.sort with
           | Some (x, e) ->
           (match (SS.compress x).n with
  
positive.code:                         (Env.all_binders (goal_env goal) |> List.length |> string_of_int)) (fun () ->
      match split_env bv (goal_env goal) with
      | None -> fail "Cannot clear; binder not in environment"
      | Some (e', bvs) ->
          let rec check bvs =
              match bvs with
              | [] -> ret ()
  
negative.code:         | None -> None
          end
  
  let split_env (bvar : bv) (e : env) : option<(env * bv * list<bv>)> =
      let rec aux e =
          match Env.pop_bv e with
          | None -> None
          | Some (bv', e') ->
              if S.bv_eq bvar bv'
              then Some (e', bv', [])
              else map_opt (aux e') (fun (e'', bv, bvs) -> (e'', bv, bv'::bvs ))
      in
      map_opt (aux e) (fun (e', bv, bvs) -> (e', bv, List.rev bvs))
  
  let push_bvs e bvs =
      List.fold_left (fun e b -> Env.push_bv e b) e bvs
  
  let subst_goal (b1 : bv) (b2 : bv) (s:list<subst_elt>) (g:goal) : option<goal> =
      map_opt (split_env b1 (goal_env g)) (fun (e0, b1, bvs) ->
          let s1 bv = { bv with sort = SS.subst s bv.sort } in
          let bvs = List.map s1 bvs in
          let new_env = push_bvs e0 (b2::bvs) in
  