Code from the LambdaPi paper http://www.andres-loeh.de/LambdaPi/LambdaPi.pdf