cs 172: computability and complexity introduction and ...sseshia/172/lectures/slides1.pdf ·...

33
CS 172: Computability and Complexity Introduction and Course Overview Sanjit A. Seshia EECS, UC Berkeley Acknowledgments: L.von Ahn, L. Blum, M. Blum, R. Jhala

Upload: others

Post on 04-Oct-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

CS 172: Computability and Complexity

Introduction and

Course Overview

Sanjit A. Seshia

EECS, UC Berkeley

Acknowledgments: L.von Ahn, L. Blum, M. Blum, R. Jhala

Page 2: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 2

A Problem

Suppose A ⊆⊆⊆⊆ {1, 2, …, 2n}

TRUE or FALSE: There are always two numbers in A such that one divides the other

with |A| = n+1

(work out the answer with proof)

Page 3: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 3

What we’ll do today

• Introduction to course staff and students

• Motivation

• Course logistics

• Basics of proof and finite automata

• A quick survey at the end of class

• Pick up

– course information handout

– survey form

Page 4: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 4

About Me

B.Tech., Computer Sc. & Engg., IIT Bombay

M.S. & Ph.D., Computer Science, Carnegie Mellon University, Pittsburgh

Assistant Professor, EECS, UC BerkeleyOffice: 566 Cory

Page 5: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 5

My Research

Theory Practice

+

Example: Fast satisfiability (SAT) solving used to build a better virus/worm detector

Computational Logic, Algorithms

CAD for VLSI, Computer Security,

Embedded Systems,

Dependability

Page 6: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 6

Class Introductions

• Introduction to Omid Etesami (your GSI)

• and the rest of you…

Page 7: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 7

A 3-Question Course

• Automata Theory:

What are the mathematical models of computation?

• Computability Theory:

What problems can(not) computers solve?

• Complexity Theory:

What makes some problems computationally hard and others easy?

Page 8: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 8

More Succinctly

This course is about models of computation

and the limits of computation

Page 9: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 9

More Succinctly

This course is about models of computation

and the limits of computation

WHY SHOULD WE CARE?

Page 10: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 10

Motivation for this Course

• Relevant for practical applications

• Foundation for theoretical work

• It’s fun!

Page 11: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 11

Page 12: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 12

Model: Free Body Diagram

Why build a model?

Page 13: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 13

Model: Free Body Diagram

Analyzing a model helps us build reliable bridges, in a cost-effective & timely way

Why not do the same for computers?

Page 14: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 14

Programs and Pushdown Automata

• Sequential (single-threaded) programs can be mathematically modeled as “pushdown automata”– E.g., Microsoft’s

Static Driver Verifier

searches for bugs in

device driver code

after creating a

pushdown automaton

model of the program

Page 15: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 15

Programs and Pushdown Automata

• Variants of pushdown automata are even used in modeling structure of RNA!

– This course is not just about computers, it’s

about computation!

Page 16: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 16

Analyzing correctness of computers is hard!

Limits of computation

Page 17: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 17

Theoretically Useful

• Mathematical models of computation give us systematic ways to think about computers

– Independent of how they are implemented

– So the results long outlast the specific

machines (anybody remember VAX machines?

486-based PCs running Windows 95?)

Page 18: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 18

Course Logistics• The course webpage is the definitive

source of information

www.eecs.berkeley.edu/~sseshia/172/

We’ll also use bSpace

• 1 required textbook

• 3 other references

• All 4 under reserve in

Engineering library

Page 19: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 19

Grading & Policies

• 10 homeworks: 30% weightage

• 2 mid-terms: 20% each

• 1 final: 30%

• Homeworks assigned approx. weekly, due in class/drop-box– First homework out next Monday

– No late homeworks

– Must list collaborators and references

• Important! See webpage for course policies

Page 20: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 20

Back to the Problem

Suppose A ⊆⊆⊆⊆ {1, 2, …, 2n}

TRUE or FALSE: There are always two numbers in A such that one divides the other

with |A| = n+1

TRUE

Page 21: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 21

Got Proof?

• Hint #1: the Pigeonhole Principle

If you put 4 pigeons in 3 holes, at least one hole will contain > 1 pigeon

• Hint #2:

Every integer a can be written as a = 2k m, where m is an odd number

Page 22: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 22

Suppose A ⊆⊆⊆⊆ {1, 2, …, 2n}

Write every number in A as a = 2km, where

m is an odd number between 1 and 2n-1

How many odd numbers in {1, …, 2n-1}? n

Since |A| = n+1, there must be two numbers in A with the same odd part (pigeonhole)

with |A| = n+1

Say a1 and a2 have the same odd part m.Then a1 = 2im and a2 = 2jm, so one must

divide the other

Page 23: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 23

This class will emphasize PROOFS

A good proof should be:

Easy to understand

Correct

Page 24: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 24

3-Level Proofs

• Recommendation: Organize your proofs into 3 levels:

1. A one-phrase HINT– E.g., “proof by contradiction”, “the pigeonhole

principle”, etc.

2. A brief one-paragraph PROOF SKETCH

3. The complete proof

This will help you with the proof and also to get partial credit for your approach, even if you get some details wrong

Page 25: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 25

Double Standards?

• During lectures, my proofs might only have the first two levels

– There’s a lot to cover in each class

– I have to keep you awake

– I KNOW that my proofs are correct ☺

Page 26: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 26

More on Proofs & Background

• Read Sipser, Chapter 0

Page 27: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 27

Introduction to

Finite Automata(Finite State Machines)

Page 28: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 28

00,1

00

1

1

1

0111 111

11

1

The machine accepts a string if the process ends in a double circle

Page 29: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 29

00,1

00

1

1

1

start state q0

transitions

accept/final states, F

states, Q

Terminology

Page 30: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 30

Q is the set of states

Σ is the alphabet

δδδδ : Q ×××× Σ → Q is the transition function

q0 ∈∈∈∈ Q is the start state

F ⊆⊆⊆⊆ Q is the set of accept states

A finite automaton is a 5-tuple M = (Q, Σ, δδδδ, q0, F)

L(M) = the language of machine M= set of all strings machine M accepts

Page 31: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 31

00,1

00

1

1

1

q3

q0

q1

q2

M = (Q, Σ, δδδδ, q0, F)What are 1.Q 2. F3. Σ

4. δδδδ

Page 32: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 32

Applications of Finite Automata

• String matching

• Modeling sequential digital circuits

• Embedded controllers in your car

• …

Page 33: CS 172: Computability and Complexity Introduction and ...sseshia/172/lectures/Slides1.pdf · 3-Level Proofs • Recommendation: Organize your proofs into 3 levels: 1. A one-phrase

S. A. Seshia 33

Next Steps

• Read Sipser 1.1 in preparation for next lecture