Type Checking in COOL (II)
Lecture 10
Prof. Aiken CS 143 Lecture 10
1
Lecture Outline
Type systems and their expressiveness
Type checking with SELF_TYPE in COOL
Error recovery in semantic analysis
2/11/2013
CS 154
Self-Reference,
Computability,
and Logic
Wednesday (2/13)
Midterm in class
Well allow one double-sided page of notes
Midterm will cover everything up to and including last
Wednesdays
2/6/2013
CS 154
Rices Theorem,
the Recursion Theorem,
and the Fixed-Point Theorem
Next Wednesday (2/13)
Midterm in class
Today: instead of a new homework,
youll get a practice midterm
Midterm will cov
2/5/2013
CS 154
Reductions, Undecidability,
and the Post Correspondence
Problem
A Concrete Undecidable Problem
ATM = cfw_ (M, w) | M is a TM that accepts string w
Theorem: ATM is recognizable but NOT
Pick up homeworks
At the entrance of Gates 4th floor B Wing
1
Definition: A Turing Machine is a 7-tuple
T = (Q, , , , q0, qaccept, qreject), where:
Q is a finite set of states
is the input alphabet,
CS 154
A Universal Theory of Data
Compression:
Kolmogorov Complexity
KOLMOGOROV DIRECTIONS
1
No homework
coming out today!
The Church-Turing Thesis:
Everyones
Intuitive Notion = Turing Machines
of Alg
CS 154
Time Complexity,
P and NP
Complexity Theory
What can and cant be computed with limited
resources on computation,
such as time, space, and so on
Captures many of the significant issues in
practi
CS 154
NP-Completeness
Cook-Levin Theorem:
Every A in NP has a polynomial time reduction to 3SAT
For every A in NP, A is decided by some
nondeterministic nk time Turing machine N
We gave a generic way
3/6/2013
CS 154
coNP and Friends
Definition: coNP = cfw_ L | L NP
What does a coNP computation look like?
A co-nondeterministic machine
has multiple computation paths,
and has the following behavior:
CS 154
NP-Completeness
and the Cook-Levin Theorem
Computer scientist wins Canada's top science prize
Stephen Cook wins $1M Gerhard Herzberg Medal
1
New homework out today
Where to pick up midterms?
P
Definitions
Program analysis
Discovering facts about programs.
Introduction to Static Analysis
Dynamic analysis
Program analysis using program executions.
CS295
Lecture 10
Static analysis
Program a
The Question
Most software is buggy
Some of it is extremely buggy
Type Qualifiers
But tools dont find most bugs
CS295
Lecture 13
Prof. Aiken CS295 Lecture 13
Why?
Prof. Aiken CS295 Lecture 13
1
Th
CSci 243 Lab
Weilin Wang
September 1, 2012
1
Table Environment:
PROBLEM. Give the truth table for F (p q ) p.
SOLUTION:
p
T
T
F
F
2
Table
q
T
F
T
F
1: Truth table
p p q F
F
T
T
F
F
F
T
T
F
T
T
F
Array
5/23/2011
Recall
We looked at dynamic race detection
Static Race Detection
Lecture 17
CS 295
Prof. Aiken
CS 295
Now well look at static race detection
Historically much less popular
Probably becau
8 Turing Machines
The question of what computers can do/solve, or equivalently, what languages can be dened/recognized by any
computational device whatsoever.
8.1 Problems that computers cannot solve
Saturn
Lecture 4
CS357
Profs. Aiken, Barrett & Dill CS357 Lecture 4
1
Goals
Scale to the largest programs
Be precise
path-sensitive & context-sensitive
model most operations exactly
Back in 2004,
Top-Down Parsing
and
Intro to Bottom-Up Parsing
Lecture 7
Prof. Aiken CS 143 Lecture 7
1
Predictive Parsers
Like recursive-descent but parser can
predict which production to use
By looking at the ne
Overview of Semantic Analysis
Lecture 9
Prof. Aiken CS 143 Lecture 9
1
Midterm Thursday
In class
SCPD students come to campus for the exam
Material through lecture 8
Open note
Laptops OK, but no
Run-time Environments
Lecture 11
Profs. Aiken CS 143 Lecture 11
1
Status
We have covered the front-end phases
Lexical analysis
Parsing
Semantic analysis
Next are the back-end phases
Optimization
CS 154
PSPACE
VOTE VOTE VOTE
On piazza, for your favorite
number of cheat sheets
Poll closes on Tuesday
1
Its a close race
VOTE VOTE VOTE
For your favorite course on
automata and complexity
Please com