Mathematical foundations for computer science