University of Leicester


Research Themes in Programming Language Semantics


Syntax and Semantics

The words pi and π can both mean, or denote, the well known irrational number 3.14159263... Syntax is the study of the principles through which words (such as pi), or sentences, of languages are defined. A programming language manual tells you how to construct "syntactically correct" programs. Semantics is the study of meaning. It concerns the relationship between things that "signify", such as pi, and what is "signified", such as 3.14159263... We could have a different relationship: I could tell you that pi means 42. The word "pi" now has a different semantics. Syntax and semantics are at the heart of what we broadly term programming language semantics. You may have written a syntactically correct program, but is the semantics correct? Does it do the right thing? What does the program "mean"?

Research Overview

The broad aim of my research is to study and develop semantic models, principles and theories of programming language syntax. The rationale for doing this is

  • to increase our general knowledge of the foundations of programming and computation; and develop methods for specification, design, verification, and testing, in order to
  • apply such knowledge and methods in understanding and improving existing programming languages and computer systems; and actually develop fundamentally new, and better, programming languages and systems.

I use mathematical tools, including domain theory and category theory, to specify programming language semantics. A particular feature of my work is the use of categorical logic and categorical type theory: in these subjects, roughly speaking, one develops universal principles for giving the semantics of programming logics and type theories in categories with suitable semantic structure. Most of this work is of a theoretical and foundational nature.

I am involved with programs and programming in a broad sense. I work with existing tools such as C#, F#, Haskell, HOL, Isabelle, Java, ML, Python. I sometimes develop and study new systems of computation, programming and reasoning within these frameworks, especially Isabelle HOL.

The descriptions of my work that appear below are intended for the research community, and especiallly for potential PhD students who may be seeking supervision in one of my research themes or related areas.

Research Themes

Categorical Type Theory and Logic

Category theory has played a key role in programming language semantics for many years. The idea that (theories in) both type theory, and logic, correspond to categories with structure is especially important. You will find an account of basic category theory in Categories for Types. The category theory/type theory correspondence, for theories in algebra, higher order functions, second order polymorphic functions, and higher order polymorphic functions, can be found in this book. The idea that one can derive a categorical semantics for a type theory, based on certain assumptions such as the way in which syntactic substitution is modelled by categorical composition, is explored in detail in Deriving Category Theory from Type Theory. Given a category with a specified structure, the corresponding theory is (sometimes) known as its internal language. For an account of the theories that correspond to interaction categories see An Internal Language for Interaction Categories. Since around 1999 there has been considerable interest in the use of nominal techniques to study properties of names. We demonstrate a category theory/type theory correspondence for the nominal lambda calculus and equivariant cartesian closed categories in A Sound and Complete Categorical Semantics for a Nominal Lambda Calculus..

Computer Software for Specifying Semantics

Theorem provers can be used to specify the operational semantics of programming languages; the logic of the system can then be used to verify properties of the language. In Mechanised Operational Semantics via (Co)Induction we code up the semantics of a small functional language, and formally define notions of bisimulation of programs, coinductively, and contextual equivalence, inductively. By making use of Howe's method, we then show that the two notions of semantic equality coincide. This work led us to begin to think about the problems of encoding languages with variable binding. We wanted to combine (co)inductive methods with a formulation of higher order abstract syntax, which was known at the time to present technical difficulties. We developed the Hybrid system in response to these challenges, presented in Combining Higher Order Abstract Syntax with Tactical Theorem Proving and (Co)Induction and discuss alternative methodologies in A Comparison of Formalizations of the Meta-Theory of a Language with Variable Bindings in Isabelle. There is a mathematical model of Hybrid, presented using the theory of logical frameworks. In the paper Representational Adequacy of Hybrid I develop this model, and prove that Hybrid is well-behaved by proving it is representationally adequate. I also give the first detailed proof of the adequacy of locally nameless de Bruijn expressions for the lambda calculus. More recently I worked on a dependently typed version of the Hybrid system

Equational and Operational Semantics

With Andrew Gordon, we solved the problem of how to formally integrate the semantics of Input/Output with higher order functions, by using labelled transition systems. This work continued a theme of using monads (in this case the I/O monad of Plotkin). Our paper A Sound Metalogical Semantics for Input/Output Effects presents a neat operational equivalence of programs which is charaterised by a novel domain-theoretic denotational semantics defined using the minimal invariants of Freyd and Pitts. Some preliminary work appears in Factoring and Adequacy Proof. The CSL results were extended in the paper Relating Operational and Denotational Semantics for Input/Output Effects.
I have also considered the connections between the equations, and operational reductions, of the fixpoint type and of the object calculus. Since the object calculus contains interesting recursion principles, I investigate translations of the fixpoint type into object calculi in Encoding FIX in Object Calculi..
Working with alpha-equivalence is well known to be problematic, and it has been the subject of considerable research in the last decade or so. In α-Equivalence Equalities I study some definitions of alpha-equivalence and show they all coincide, and on the way give some corrections to proofs in the literature. I also study systems of expression contexts up to alpha-equivalence, giving a new definition of such equivalences.

Categorical Gluing

Gluing is a categorical construction that has its origins in topological Artin gluing. Amongst various applications, it has been used to prove the existence and disjunction properties of intuitionistic logic, and also the conservativity of various type theory extensions. Freyd pioneered these proofs, and refered to his construction as sconing. In On Fixpoint Objects and Gluing Constructions it was shown that extensions of equational theories over nat, fix, +, x, T are all conservative at ground type. The gluing construction that I define is a novel variation of the functional sconing methods of Freyd; functions are replaced by (categorical) logical relations that are more powerful than sconing, yet at the same time easier to manipulate. Recently I have been thinking about formulating a version of gluing that involves categories of nominal sets. Since this requires some results about the Yoneda lemma for nominal sets, our findings appear in a dedicated paper The Yoneda Lemma and Cartesian Closure in the FM-World.

Fixpoint Types for Computational Monads

In my thesis, Programming Metalogics with a Fixpoint Type, I further developed the theory of computational monads due to Moggi by studying the notion of a fixpoint type fix, first presented in New Foundations for Fixpoint Computations, with a complete account in New Foundations for Fixpoint Computations:FIX Hyperdoctrines and the FIX Logic. An equational theory with types nat, fix, +, x, T is presented in which all endofunctions of type have fixpoints. Such theories are shown to have classifying categories (FIX-categories). A modal predicate logic is defined, expressing properties of terms, with predicates that express properties of computation terms. This logic was used to analyse the static and dynamic semantics of languages similar to PCF, and the results, mainly concerning computational adequacy, appear in Computational Adequacy of the FIX-Logic. A dependent type theory with a universal type was also developed, in which fixpoints of equations over types ("domain equations for recursive types") can be obtained as fixpoints of equations over terms ("ordinary equations") Recursive Types via Fixpoint Objects.

Author: Roy Crole (R.Crole at, T: +44 (0)116 252 3404 .
© University of Leicester March 2018. Last modified: 21st March 2018, 10:19:39
Informatics Web Maintainer. This document has been approved by the Head of Department.