Lec01_SciOfPgm_Prop_Logic

Lec01_SciOfPgm_Prop_Logic - CS 536 Notes: About Science of...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 536 Notes: About Science of Programming Lecture 1, Mon Aug 23, 2010 A. Why Course guidelines are important. Active learning is the style well be using in the class. Understanding what Science of Programming is is important. Reviewing/overviewing logic is necessary because well be using it in the course. B. Outcomes At the end of today, you should Know how the course will be structured and graded. Have practiced some of the techniques well be using in class. Know what Science of Programming is about and how it differs from and is related to program testing. Understand what a propositional formula is, how to write them, how to tell whether one is a tautology or contradiction using truth tables, and see a basic set of logical rules for transforming propositions. C. Introduction and Welcome The course webpages are at http://www.cs.iit.edu/~cs536 The home page includes news and the calendar of lectures, coursework, and tests. Theres a Course Plan page that discusses the textbook, the course topics, course structure, and grading, collaboration, disability, and ethics policies. D. Active Learning Education research shows that students learn better when they are active participants in class, compared to passive listeners of lectures. This active kind of learning includes obvious things like answering questions in class, but it also includes team activities and quick feedback to the instructor. Youll need to put more effort into class, but youll learn more/better/faster. E. So What Is Science of Programming Anyway? Science of Programming is about program verification . Program verification aims to get reliable programs by proving properties about the program. Harder to do this by writing programs and then proving them correct. In practice, its better to reason about programs as we write them. Distinguish program verification from program testing. Illinois Institute of Technology Lecture 1 Notes CS 536: Science of Programming - 1 of 8 - James Sasaki, 2010 In testing, we run a program and verify that it behaves correctly. F. Neither Reasoning or Testing is Better Than the Other In real life, we need both testing and reasoning; neither is always better than the other. Testing is a reality check on reasoning: We want to test because our reasoning might be wrong. Reasoning needs to be done to find good test cases (and avoid bad ones). Usually there exist a large/infinite number of test cases; we want to concentrate on important ones. Simple example of using reasoning to generate test cases: Take the statement if (x >= 0) z := z+x; (:= means assignment) Say our specification is If z c before the statement, then z > c after the statement. Write this for now as /* z >= c */ if (x >= 0) z := z+x; else ++z; /* z > c */ What are good test cases? x equal to 0? 1? -1? How about 2, 3, 4, 5, .... ?...
View Full Document

This note was uploaded on 04/17/2011 for the course CS 536 taught by Professor Cs536 during the Fall '08 term at Illinois Tech.

Page1 / 8

Lec01_SciOfPgm_Prop_Logic - CS 536 Notes: About Science of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online