Tracing sharing in an imperative pure calculus