let p_shared pool tau term f =
  if is_atomic term then f term else
    let x = fresh pool tau in
    p_let x term (f (e_var x))