UP | HOME

Bachelor/Master Thesis Topics

Here is a collection of theses topics that I would be happy to help advise in collaboration with Robbert Krebbers. Feel free contact me to find out more if you have any questions.

The topics I enumerate here are ideas that we find interesting to look into, but would of course be influenced by your interests and background as well.

: I am currently open to advising students


OPEN Deriving Evaluation Contexts using Rocq-Elpi   rocq elpi

Programming language semantics are simplified by distinguishing between the core computational rules of a language (function applications, arithmetic operations, memory primitives, etc.) from "structural" rules that for instance define rules for evaluating sub-expressions.

Sub-expression evaluation rules

To ensure that the right argument of an arithmetic operation \(\otimes\) is evaluated before the left, you would have to define two rules for evaluating underneath operations in as such \[ \frac{e_2 \to_\mathrm{step} e_2'}{(e_1 \otimes e_2) \to_\mathrm{step} (e_1 \otimes e_2')} \qquad \frac{e_1 \to_\mathrm{step} e_1'}{(e_1 \otimes v_2) \to_\mathrm{step} (e_1' \otimes v_2)} \qquad \frac{}{(v_1 \otimes v_2) \to_\mathrm{step} [\![ v_1 \otimes v_2 ]\!]}. \]

This ensures by construction that \(e_1\) cannot take any steps, before \(e_2\) has been reduced to a value.

To avoid the busywork of applying the same construction to all expressions with a defined order of evaluation, one can instead take a two-level approach of having \(\mathrm{base}\) steps that operate on expressions of the right form that is then lifted to our indented language semantics \(\mathrm{step}\): \[ \frac{K[e] \to_\mathrm{base} K[e']}{e \to_\mathrm{step} e'} \qquad \frac{}{(v_1 \otimes v_2) \to_\mathrm{base} [\![ v_1 \otimes v_2 ]!]}, \] where \(K\) is an "evaluation context", i.e. an expression with exactly one hole \(\square\) at the point where the next evaluation step will be taken. For instance, \((f x) \otimes \square\) is a evaluation context according to the above rules, whereas \((f \square) \otimes x\) is not.

For a further discussion on this, see the course notes to the Program Verification course.

Rocq-Elpi is a plugin for the Rocq prover that allows for meta-programming in a dialect of λProlog (which in turn is descended from the "logic programming" language Prolog, extended with types and higher-order unification). Rocq-Elpi has access to the (Higher-Order) abstract syntax of Rocq, allowing it both manipulate and generate terms.

Goals

In practice, such as when mechanizing language semantics (for instance in the Iris framework), writing out the rules for sub-expression evaluation quickly becomes annoying.

The idea is to investigate utilizing Rocq-Elpi to automatically derive evaluation contexts in a user-friendly manner.

Prerequisites

It is not expected that you have any prior experience with Elpi, or even Prolog. To get a taste of how logic programming in general looks like, consider taking a look at Markus Triska's "The Power of Prolog". Some basic experience with Rocq would be preferred. Examples for how Rocq-Elpi is used can be found in the reference manual.

OPEN DSL for Specifying Symbolic Execution Tactics   rocq iris

When using a mechanized program logic to verify an algorithm or data structure, a rule that would specify the weakest precondition for a "store" operation in a language with memory references might look like \[ \ell \mapsto \mathop{x -\!\!\ast} \mathrm{WP} \quad \ell \gets y \quad \{v \ldotp v = \mathtt{()} \ast \ell \mapsto y \}. \]

In a pen-and-paper setting it is intuitive that this rule is applicable to a program like \[ x \gets 2 + !y; \mathsf{let}\; y \;:=\; !x - 2 \;\mathsf{in}\; y + !x, \] assuming that \(x\) and \(y\) are valid locations. Specifically assuming \(y \mapsto a\) and \(x \mapsto b\) for some \(a\) and \(b\), it stands to reason that \(\mathrm{WP} \dots \{v, v = 2a + 2 \ast x \mapsto 2 + a \ast y \mapsto a \ast x \mapsto a + 2\}\) ought to be provable.

This is not the case for a proof assistant, as the rule given above assumes that the entire expression underneath the weakest precondition is a single store operation and that the post-condition is specifically of the form \(v = \mathtt{()} \ast \ell \mapsto y\). This is to say that before applying the rule, various structural rules have to first be applied to mold the goal into the right form. Most of the time, there is only one obvious approach, which the system could figure out automatically.

Goals

To make these kinds of primitive rules usable in a real-world setting, the rules must be made more flexible so as to do the right thing and take care of the obvious steps insofar it is possible. For instance, the HeapLang tactics in Iris framework include this kind of automation, but this effort has to be replicated for every language you instantiate the framework with.

This topic would begin by investigating common patterns in projects that use Iris and trying to come up with common patterns that could be generalized. Using this information, one could imagine coming up with a DSL that would generate tactics/lemmas from a declarative specification of

  • How expressions should change
  • What parameters the rule takes
  • What side conditions the rule has (does it depend on something in the context, how will the context be modified, etc.)

Prerequisites

Experience with Rocq and Rocq metaprogramming would be strongly preferred. Prior exposure to Iris and separation logic in general would be appreciated, but is not assumed.

IDEA Deriving an Indentation Grammar from Print Grammar for Emacs   rocq lisp

The Rocq parser can be dynamically extended during runtime, allowing for the introduction of flexible notation (even including binding constructs). The entire grammar can be introspected using Print Grammar vernacular command.

The downside of this is that in a more powerful editor like Emacs that has support for structural editing (i.e. the editor is aware of syntactic constructs in the language and can use these to improve navigation, selection and text manipulation) it is not possible to give a static set of rules on how to parse a file.

I would be interested in figuring out if it would be feasible to translate the grammar of Rocq dynamically into something that Emacs can handle. The hopefully easiest approach would be to see if the dumped grammar can be reduced to a operator precedence grammar that the SMIE framework of Emacs can handle to automatically generate indentation and navigation commands. As operator precedence grammars are not as expressive as full context free grammars, this will likely need a few extensions to get working.

This project would likely not be interesting to anyone who doesn't use Emacs, but extensive experience with programming in Lisp isn't assumed either. If the project can be completed, the final result could be merged into Proof General.

IDEA An Incremental Approach to Compiler Verification   rocq scheme

presents an approach of implementing a compiler in multiple steps, not going through the traditional compiler pipeline, but taking on more and more interesting fragments of a language.

describes how to implement a compiler (Compcert) with a formal proof that the translation is semantics preserving.

It would be interesting to investigate if these two approaches can be merged. In all likelihood, the translation wouldn't go from a high-level language to a real-world computer architecture, but at least to an idealized computer architecture or intermediate compiler representation.


Author: Philip Kaludercic

Created: 2026-12-02 Wed 15:03

Emacs 31.1 (Org mode 9.8.7)

Validate