{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


Lec01_SciOfPgm_Prop_Logic - Illinois Institute of...

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

View Full Document Right Arrow Icon
CS 536 Notes: About Science of Programming Lecture 1, Mon Aug 23, 2010 A. Why Course guidelines are important. Active learning is the style we’ll be using in the class. Understanding what Science of Programming is is important. Reviewing/overviewing logic is necessary because we’ll 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 we’ll be using in class. Know what Science of Programming is about and how it di ff ers 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. There’s 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. You’ll need to put more e ff ort into class, but you’ll learn more/better/faster. E. So What Is Science of Programming Anyway? •Science of Programming is about program veri fi cation . Program veri fi cation 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, it’s better to reason about programs as we write them. Distinguish program veri fi cation from program testing. Illinois Institute of Technology Lecture 1 Notes CS 536: Science of Programming - 1 of 8 - © James Sasaki, 2010
Background image of page 1

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

View Full Document Right Arrow Icon
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 fi nd good test cases (and avoid bad ones). Usually there exist a large/in fi nite 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 speci fi cation 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, .... ?
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 8

Lec01_SciOfPgm_Prop_Logic - Illinois Institute of...

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

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