Typechecking protocols with Mungo and StMungo: A session type toolchain for Java
- 1. University of Cyprus
- 2. University of Glasgow
- 3. University of Glasgow/University of Edinburgh
Description
Static typechecking is an important feature of many standard programming languages. However, static typing focuses on data rather than communication, and therefore does not help programmers correctly implement communication protocols in distributed systems. The theory of session types provides a basis for tackling this problem; we use it to develop two tools that support static typechecking of communication protocols in Java. The first tool, Mungo, extends Java with typestate definitions, which allow classes to be associated with state machines defining permitted sequences of method calls: for example, communication methods. The second tool, StMungo, takes a session type describing a communication protocol, and generates a typestate specification of the permitted sequences of messages in the protocol. Protocol implementations can be validated by Mungo against their typestate definitions and then compiled with a standard Java compiler. The result is a toolchain for static typechecking of communication protocols in Java. We formalise and prove soundness of the typestate inference system used by Mungo, and show that our toolchain can be used to typecheck a client for the standard Simple Mail Transfer Protocol (SMTP).
Files
KDPG17.pdf
Files
(246.1 kB)
Name | Size | Download all |
---|---|---|
md5:8e19b5d90e2c8af738a688746ed1de14
|
246.1 kB | Preview Download |