Graph rewriting for the π-calculus