graph: introduce Phi and ToPhi