University of Virginia Computer Science CS150: Computer Science, Fall 2005 (none) 21 October 2005

## CS150 Notes 25 (21 October 2005)

#### Upcoming Schedule

• By today: Read rest of GEB part I (Chapters 2-4 and 6-9, in addition to Chapters 1 and 5 you have already read). See the study guide questions on Notes 18. I recommend reading a chapter every few days rather than trying to read it all just before October 21.
• (Ideally as soon as possible) Read GEB, Aria with Diverse Variations and Chapter 13. This chapter proves that the halting problem is not decidable, and introduces the Church-Turing Thesis (which we will explore more in later classes). You will not be assigned to read Chapter XIV, but it goes into more depth on Gödel's proof and is recommended.
• Monday, 31 October: Problem Set 6
Notes
Halting Problem Input: a procedure P (described by a Scheme program), and the input to that procedure
Output: true if applying P to input halts (finishes execution), false otherwise.

```(define (halts? procedure input) ...?...)
```
Why is it nonsensical to define contradict-halts?

Malicious Code Problem

Input: a procedure P
Output: true if P is would do something bad, false otherwise.

Assume we have a precise definition of what something bad means (for example, format your hard drive).

Is the malicious code problem decidable?

```(define (halts? P input)
(is-virus? `(begin ((vaccinate P) input)
virus-code)))
```
Where (vaccinate P) evaluates to P with all file writing commands replaced with empty commands (to make sure (is-virus? P input) is false.

Is it possible to write a virus scanner that detects all malicious code? (tricky, think carefully)