Merge branch 'theory-rewrite'