comptheory: The Diagonalization Method