Theoretical Foundations of Computer Science