Suppose I have a process that informally does this
int count = 0 forever do receive x on some channel c; count += x; output count on some channel d;
(here ";" means sequential composition -- so P ; Q means do P, and then do Q)
I know how to implement the sequential composition in the pi-calculus -- that was answered in another question here. I also think I know how to model a state variable like count in the pi-calculus.
But what I can't seem to encode in the pi-calculus is the infinite loop. To do that I would either need recursive process definitions, or use replication somehow. But I can't work out the correct way to use replication here -- because I can't work out what process I am replicating (since the use of state means the process being replicated is different every time).
Any help would be great.