The work carried out during the project towards its objectives was motivated by three case studies.
Resources in effectful programs: As the control flow of effectful programs can often be highly non-trivial, ensuring that programs use their resources correctly (e.g. that one does not read from a previously closed file) is consequently also non-trivial. For this, the project identified that simple (sub)set-based type-and-effect systems can provide a lightweight approach for specifying and controlling how programs use resources. Based on this idea, the project developed programming abstractions to model resources using runners (also known as comodels) of algebraic effects, which intuitively are a denotational account of small state-manipulating virtual machines. The end result was a core lambda-calculus for resource management in effectful languages with a strong guarantee that the resource finalisation code (e.g. file closing) is run once. These results have been published at a major programming languages conference (ESOP), and presented at seminars and workshops. This work also resulted in a prototype programming language implementation of the core calculus and an embedding of it as a library in Haskell.
Asynchrony and algebraic effects: While algebraic effects cover a wide range of computational effects, their operational treatment has always been synchronous. Namely, when an algebraic operation call is executed, its continuation is blocked until some implementation of this operation returns a value. To this end, the project identified that the different phases of the execution of an algebraic operation call can be decoupled into separate programming abstractions. The result was a core lambda-calculus formalising these ideas, whose type-and-effect system is based on generalising the simple (sub)set-based account of effect typing to a domain-theoretic variant, in which the effect information can recursively also describe the possible effects of suspended computations, e.g. of yet to be executed interrupt handlers. These results have been published at a major programming languages conference (POPL), with an extended journal version currently in preparation, and they have been presented at seminars and workshops. This part of the project also resulted in a prototype programming language implementation of the core calculus and the mechanisation of its metatheory in Agda.
Extending F* with a concurrent separation logic: In collaboration with the researchers at Microsoft Research and elsewhere who are behind the refinement- and dependently typed programming language F*, the project contributed towards developing and embedding a core concurrent separation logic, SteelCore, in F*. This embedding is based on representing SteelCore computations using indexed action trees in F*, and by proving the soundness of the resulting program logic by giving these action trees a nondeterministic stateful semantics based on F*'s existing monotonic state effect. As a result, one can now use F* to write and verify type-level separation logic (and refinement-typed) specifications for concurrent programs. These results have been published at a major programming languages conference (ICFP), and have been consequently incorporated and absorbed into F*'s libraries.