Mathematical Foundations for CS