Implementing the π-Calculus in Java.
Liwu Li · The Journal of Object Technology · 2005
Mobile communicating systems are ubiquitous in the modern world.The π-calculus proposed by Milner et al [Milner et al. 1992] sets a theoretical foundation for modeling mobile communicating systems such as the Internet, in which links can be sent from processes to processes and a process can use a received link to interact with another process.Here, we present a language named π-language for programming π-calculus processes and a compiler named pi2j for translating the π-programs to Java code, which can be compiled with the Java compiler to JVM bytecode and, then, executed on the Java Virtual Machine.Thus, we implement the π-calculus in the Java language.We present an ASCII-based language called π-language for coding π-calculus process expressions.Using keywords in ASCII to denote the Greek leters and other non-Implementing the π-Calculus in Java 158 J OURNAL OF OBJECT TECHNOLOGY V OL. 4, NO. 2ASCII symbols, the π-language represents π-calculus process expressions faithfully.Its grammar improves the syntactic rules of the π-calculus by eliminating ambiguities in the syntax rules of the π-calculus.We can compile the translated π-calculus process expressions into Java to explore the multithreading and synchronization mechanism of Java.We describe the Java concurrent classes that we developed to support the communication mechanism of the π-calculus.Based on the Java classes, we present a compiler named pi2j to translate the so-called π-programs into the Java language.Then, we can compile and run the Java code that implements π-calculus process expressions.This paper is organized as follows.The next section introduces the π-calculus as specified in [Milner 1999;Sangiorgi and Walker 2001].In Section 3, we briefly introduce the multithreading and synchronization constructs of the Java language, which are used to implement the π-calculus.We present the π-language for coding π-calculus process expressions in Section 4. We describe the various Java objects that support the dynamic communication mechanism of the π-calculus in Section 5.The compiler pi2j attached with the paper is described in Section 6.This paper is concluded in Section 7.The π-Calculus