Torben Ęgidius Mogensen

A picture of me
photo: Thomas Arnbo

Scientific work

I am associate professor (lektor) at DIKU, being a part of the TOPPS group (Theory and Practice of Programming Languages).

I am also "studieleder" (director of studies) for computer science at the University of Copenhagen.

I'm working with automatic program analysis and transformation (in particular partial evaluation and program semi-inversion), compiler technology (in particular for functional languages), domain-specific languages and occasionally dabble in algorithms, complexity, automata theory, fractals and graphics.

Here is a link to an outdated list of my scientific publications. Some of these are available online through the TOPPS bibliography.

In autumn 2011 Springer Verlag published my textbook Introduction to Compiler Design. This book is based on material used in the undergraduate compilers course at DIKU.

An earlier version of this material (and some extra material) can be found in my self-published textbook Basics of Compiler Design, which will not be updated anymore and is only avaiable electronically through the link above.

Partial evaluation in action

Here is a picture illustrating partial evaluation:

The partial evaluator PE takes a two-input program P and a value x for one of the arguments to P. It then produces a specialized one-input program Px.

The picture was produced by a ray-tracer which was itself specialized to the particular scene using a partial evaluator.

Application of CS to fun and games

I have made a domain-specific language "Troll" for defining die-roll methods and calculating their probabilities. More information at the Troll homepage.

I have also made a generator of planet maps. See more at the Planet page.

Just fun and games

I have made a guide for making braided Christmas hearts, like the one shown below.


There are also specific instructions for a Venus-symbol heart.


A have designed a Fantasy role-playing game called Remnants of a Golden Age. It is a development of an earlier game I developed called Dark Coast.

Inspired by one of my favourite games Britannia, I have made a Fantasy board game called Hy Breasil.

When the study structure at DIKU was revised, I made a variant of Hare and Tortoise based on the new structure. The resulting game is Studiespillet. In Danish.

Ages ago, on a challenge of designing a Chess variant on a board with exactly 39 positions, I made a very minimalistic hexagonal Chess variant.


Torben Mogensen
DIKU, University of Copenhagen, Universitetsparken 5, DK-2100 København Ø
Mobile phone: (+45) 21849672  Fax: (+45) 35321401