Mungo

A research topic for typechecking protocols in object oriented languages

Download tools

What is Mungo?

Mungo is a research topic for adding usage-protocols to Java-like languages, and verifying that they are adhered to i.e. that methods are called in the correct order. It is based on the notion of typestate describing non-uniform objects, where the availability of methods to be called depends on the state of the object. Hence, the typestate defines an object protocol. A number of tools has been developed within this topic. One such tool is a Java frontend tool that at statically verifies that the protocol is followed at runtime.

Consider the typestate below, that models the protocol of a file. Initially only the open method can be called. Afterwards we can check if data is available in the file, and there is, read it. Otherwise the file can only be closed.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
typestate FileProtocol {
		Init =	{
				Status open(): <OK: Open, ERROR: end>
			}

		Open =	{
				BooleanEnum hasNext(): <TRUE: Read, FALSE: Close>,
				void close(): end
			}

		Read =	{
				void read(): Open
			}

		Close =	{
				void close(): end
			}
}

Read More

Tools

The research project has resulted in a number of tools.

The following video shows how the StMungo and Mungo toolchain work together to statically typecheck the Simple Mail Transfer Protocol (SMTP), and communicate with the gmail server.

Read more

Meet the Team

Current Members

Avatar

Ornela Dardha

University of Glasgow

Assistant Professor

Avatar

Simon Gay

University of Glasgow

Head of School of Computing Science

Avatar

Mathias Jakobsen

University of Glasgow

PhD Student

Avatar

João Mota

NOVA School of Science and Technology

MSc Student

Avatar

António Ravara

NOVA School of Science and Technology

Associate Professor

Avatar

André Trindade

NOVA School of Science and Technology

MSc Student

Past Members

Avatar

Dimitrios Kouzapas

University of Cyprus

Research Associate

Avatar

Roly Perera

The Alan Turing Institute

Senior Research Software Engineer

Avatar

Laura Voinea

University of Kent School of Computing

Research Associate

Tutorial

*

Scala-Mungo

Tutorial session and exercises for the Scala Mungo implementation

Mungo with Behavioural Separation

We illustrate the Mungo prototype with support for behavioural separation, and shows how behavioural separation helps writing more concise protocols

Adder Protocol

We illustrate the toolchain by means of an adder protocol example, which models a client requesting two numbers to be added by a server.

Bookstore

We illustrate the toolchain by means of a bookstore (two-buyer) example, which models two buyers coordinationg to buy a book from a seller.

Travel Agency

We illustrate the toolchain by means of a travel agency example, which models the process of booking a flight through a university travel agent.

DisCoTec Tutorial

This tutorial gives a more in depth overview of the [St]Mungo toolchain through several examples. It has been first presented as part of the DisCoTec 2020 tutorial series.

Contact

  • School of Computing Science, University of Glasgow, Sir Alwyn Williams Building, 18 Lilybank Gardens, Glasgow, Strathclyde, G12 8RZ