15.08.2013 Views

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Contents<br />

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii<br />

This Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii<br />

Course Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii<br />

Course Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii<br />

Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii<br />

Recorded Syllabus for 2012/13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v<br />

1 Getting Started with “<strong>General</strong> <strong>Computer</strong> <strong>Science</strong>” 1<br />

1.1 Overview over the Course . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1<br />

1.2 Administrativa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3<br />

1.2.1 Grades, Credits, Retaking . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3<br />

1.2.2 Homeworks, Submission, and Cheating . . . . . . . . . . . . . . . . . . . . . 4<br />

1.2.3 Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7<br />

2 Motivation and Introduction 9<br />

2.1 What is <strong>Computer</strong> <strong>Science</strong>? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9<br />

2.2 <strong>Computer</strong> <strong>Science</strong> by Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10<br />

2.3 Other Topics in <strong>Computer</strong> <strong>Science</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />

2.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />

I Representation and Computation 19<br />

3 Elementary Discrete Math 21<br />

3.1 Mathematical Foundations: Natural Numbers . . . . . . . . . . . . . . . . . . . . . 21<br />

3.2 Reasoning about Natural Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 23<br />

3.3 Defining Operations on Natural Numbers . . . . . . . . . . . . . . . . . . . . . . . 26<br />

3.4 Talking (and writing) about Mathematics . . . . . . . . . . . . . . . . . . . . . . . 29<br />

3.5 Naive Set Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31<br />

3.6 Relations and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34<br />

4 Computing with Functions over Inductively Defined Sets 39<br />

4.1 Standard ML: Functions as First-Class Objects . . . . . . . . . . . . . . . . . . . . 39<br />

4.2 Inductively Defined Sets and Computation . . . . . . . . . . . . . . . . . . . . . . . 48<br />

4.3 Inductively Defined Sets in SML . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52<br />

5 A Theory of SML: Abstract Data Types and Term Languages 55<br />

5.1 Abstract Data Types and Ground Constructor Terms . . . . . . . . . . . . . . . . 55<br />

5.2 A First Abstract Interpreter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57<br />

5.3 Substitutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59<br />

5.4 A Second Abstract Interpreter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61<br />

5.5 Evaluation Order and Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . 63<br />

vii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!