SlideShare a Scribd company logo
1 of 140
Download to read offline
A Task Engine for Incremental Name and Type
Analysis
Gabriƫl Konat
Spoofax Language Workbench
size
Spoofax Language Workbench
Name and Type Analysis
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
Name Analysis
Assign to each reference its corresponding deļ¬nition
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
Name Analysis
Assign to each reference its corresponding deļ¬nition
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
Name Analysis
Assign to each reference its corresponding deļ¬nition
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
Name Analysis
Assign to each reference its corresponding deļ¬nition
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
Name Analysis
Assign to each reference its corresponding deļ¬nition
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
Name Analysis
Assign to each reference its corresponding deļ¬nition
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
Type Analysis
Assign a type to each expression
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
Type Analysis
float
Assign a type to each expression
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
Type Analysis
Assign a type to each expression
float
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
B
Type Analysis
Assign a type to each expression
float
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
B
float
Type Analysis
Assign a type to each expression
float
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
B
float
float
Type Analysis
Assign a type to each expression
float
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
float
B
float
float
Type Analysis
Assign a type to each expression
float
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
float
B
int
float
float
Type Analysis
Assign a type to each expression
float
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
float
B
int
float
float
float
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
float m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
float
B
int
float
float
float
float
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
float
B
int
float
float
int
float
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
float
B
int
float
float
int
int
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
int
float
float
int
return m()
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
return 1 + b.f
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
B
int
int
return m()
float
float
float
Incremental
Name and Type Analysis
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
return 1 + b.f
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
int
float
float
int
return m()
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
return 1 + b.f
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
int
float
float
int
return m()
1. Caching
Reuse analysis results from previous analysis
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
return 1 + b.f
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
int
float
float
int
return m()
2. Change detection
Which part of the program has changed?
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
return 1 + b.f
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
int
float
float
int
return m()
3. Invalidation & propagation
Which calculations are affected by a change?
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
int
float
float
4. Dependency tracking
What are the dependencies between calculations?
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
What are the dependencies between calculations?
4. Dependency tracking
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
How to (re-)schedule invalidated calculations?
5. Scheduling
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
f
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
Caching
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
Change Detection
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
Invalidation
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
Propagation
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
Propagation
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
Propagation
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
Scheduling
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
Scheduling
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
float int
float
Scheduling
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
int
float
Scheduling
int
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
float
B
int
int
Scheduling
int
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.f;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
int
B
int
int
Scheduling
int
i
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.i;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
int
B
int
int
Scheduling
int
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.i;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
int
B
int
int
int
Tasks
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.i;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
int
B
int
int
int
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.i;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
int
B
int
int
int
Units of computation ...
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.i;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
int
B
int
int
int
... with cacheable results ...
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.i;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
int
B
int
int
int
... and dependencies on each other
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.i;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
int
int
B
int
int
int
resolve class A resolve class B
resolve method m resolve field b
resolve field i
Name resolution
tasks
class C : A {	
!
int n() {	
return m();	
}	
}
class A {	
!
B b;	
!
int m;	
!
int m() {	
return 1 + b.i;	
}	
}
class B {	
!
int i;	
!
float f;	
!
int m() {	
return 0;	
}	
}
resolve class A resolve class B
resolve method m resolve field b
resolve field i
calc type of m()
calc type of i
calc type of b
calc type of b.i
calc type of 1 + b.i
calc type of 0
Name resolution
tasks
Typing tasks
Name and Type Analysis
Name and Type Analysis
with Tasks
class B {	
int i; 	
float f;	
}
class A {	
B b;	
float m() { return 1 + b.i; }	
}
class B {	
int i; 	
float f;	
}
class A {	
B b;	
float m() { return 1 + b.i; }	
}
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
class A {	
B b;	
float m() { return 1 + b.i; }	
}
Facts
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
class A {	
B b;	
float m() { return 1 + b.i; }	
}
Facts
Tasks
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
class A {	
B b;	
float m() { return 1 + b.i; }	
}
Facts
Tasks
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
Facts
Tasks
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
Facts
Tasks
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B1
Facts
Tasks
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B1 2
Facts
Tasks
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B1 2
3Facts
Tasks
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B1 2
4
3Facts
Tasks
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B1
5
2
4
3Facts
Tasks
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B1
6
5
2
4
3Facts
Tasks
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B1
6
5
7
2
4
3Facts
Tasks
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B1
6
5
7
2
4
3
8
Facts
Tasks
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B1
6
5
7
2
4
3
8
Facts
Tasks
define class A
Incremental	

Name and Type Analysis	

with Tasks
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
define class A
i
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
define class A
f
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
define class A
f
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
define class A
f
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field b
calc type of b
calc type of 1
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
define class A
f
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
define class A
f
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
1
define class A
f
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
2
1
define class A
f
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
2
1
3
define class A
f
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
2
1
3 4
define class A
f
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
2
1
3 4
define class A
f
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
float f;
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
type of i is int
define field i
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
type of i is int
define field i
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
type of i is int
define field i
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
type of i is int
define field i
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
1
type of i is int
define field i
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
2
1
type of i is int
define field i
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
2
1
3
type of i is int
define field i
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
2
1
3 4
type of i is int
define field i
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
type of i is int
define field i
class B {	
int i; 	
float f;	
}
define class B
resolve field f
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.f
calc type of f
calc type of b.f
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.f; }	
}
resolve class B
define class A
Evaluation
Subject language
Subject application
Feb 2010 - 4 ļ¬les - 3139 lines of code
3 years later - 55 ļ¬les - 8991 lines of code
0
3
6
9
12
15
0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340
Time(s)
Revision
Parse Collect Evaluate
0
1
2
3
4
5
0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340
Time(s)
Revision
Parse Collect Evaluate
full, non-incremental analysis
0
3
6
9
12
15
0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340
Time(s)
Revision
Parse Collect Evaluate
0
1
2
3
4
5
0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340
Time(s)
Revision
Parse Collect Evaluate
0
3
6
9
12
15
0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340
Time(s)
Revision
Parse Collect Evaluate
0
1
2
3
4
5
0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340
Time(s)
Revision
Parse Collect Evaluate
full, non-incremental analysis
incremental analysis
0
0.3
0.6
0.9
1.2
1.5
0 20 40 60 80 100 120
Time(s)
Revision
Parse Collect Evaluate
single-ļ¬le changes
0
0.3
0.6
0.9
1.2
1.5
0 20 40 60 80 100 120
Time(s)
Revision
Parse Collect Evaluate
single-ļ¬le changes
responsive enough for interactive usage in IDE
Fact and Taks
Collection
type of i is int
define field i
define field f
type of f is float
class B {	
int i; 	
float f;	
}
define class B
resolve field i
resolve field b
calc type of b
calc type of 1
calc type of 1 + b.i
calc type of i
calc type of b.i
define field b
define method m
type of b is B
type of m is float
class A {	
B b;	
float m() { return 1 + b.i; }	
}
resolve class B
define class A
Fact and Task Collection
Class("Point", [	
Field("x"),	
Field("y"),	
Func("print", [	
Print(VarRef("x")),	
Print(VarRef("y"))	
])	
])
Class("Point", [	
Field("x"),	
Field("y"),	
Func("print", [	
Print(VarRef("x")),	
Print(VarRef("y"))	
])	
])
def-site:	
Class(x, _) -> <store-def(|"Class")> x	
scope-site:	
Class(_, _) -> <scope> ["Var", "Func"]	
!
def-site: 	
Field(x) -> <store-def(|"Var")> x	
!
def-site:	
Func(x, _) -> <store-def(|"Func")> x	
scope-site:	
Func(_, _) -> <scope> ["Var"]	
!
ref-site: 	
VarRef(v) -> <create-lookup-task(|"Var", 	
ā€¦fact-dependenciesā€¦)> v	
!
analyse = 	
topdown(def-site; scope-site);	
bottomup(ref-site);	
execute-tasks
Fact and Task Collection
Class("Point", [	
Field("x"),	
Field("y"),	
Func("print", [	
Print(VarRef("x")),	
Print(VarRef("y"))	
])	
])
def-site:	
Class(x, _) -> <store-def(|"Class")> x	
scope-site:	
Class(_, _) -> <scope> ["Var", "Func"]	
!
def-site: 	
Field(x) -> <store-def(|"Var")> x	
!
def-site:	
Func(x, _) -> <store-def(|"Func")> x	
scope-site:	
Func(_, _) -> <scope> ["Var"]	
!
ref-site: 	
VarRef(v) -> <create-lookup-task(|"Var", 	
ā€¦fact-dependenciesā€¦)> v	
!
analyse = 	
topdown(def-site; scope-site);	
bottomup(ref-site);	
execute-tasks
Fact and Task Collection
Class("Point", [	
Field("x"),	
Field("y"),	
Func("print", [	
Print(VarRef("x")),	
Print(VarRef("y"))	
])	
])
def-site:	
Class(x, _) -> <store-def(|"Class")> x	
scope-site:	
Class(_, _) -> <scope> ["Var", "Func"]	
!
def-site: 	
Field(x) -> <store-def(|"Var")> x	
!
def-site:	
Func(x, _) -> <store-def(|"Func")> x	
scope-site:	
Func(_, _) -> <scope> ["Var"]	
!
ref-site: 	
VarRef(v) -> <create-lookup-task(|"Var", 	
ā€¦fact-dependenciesā€¦)> v	
!
analyse = 	
topdown(def-site; scope-site);	
bottomup(ref-site);	
execute-tasks
Fact and Task Collection
Class("Point", [	
Field("x"),	
Field("y"),	
Func("print", [	
Print(VarRef("x")),	
Print(VarRef("y"))	
])	
])
def-site:	
Class(x, _) -> <store-def(|"Class")> x	
scope-site:	
Class(_, _) -> <scope> ["Var", "Func"]	
!
def-site: 	
Field(x) -> <store-def(|"Var")> x	
!
def-site:	
Func(x, _) -> <store-def(|"Func")> x	
scope-site:	
Func(_, _) -> <scope> ["Var"]	
!
ref-site: 	
VarRef(v) -> <create-lookup-task(|"Var", 	
ā€¦fact-dependenciesā€¦)> v	
!
analyse = 	
topdown(def-site; scope-site);	
bottomup(ref-site);	
execute-tasks
Fact and Task Collection
Class("Point", [	
Field("x"),	
Field("y"),	
Func("print", [	
Print(VarRef("x")),	
Print(VarRef("y"))	
])	
])
def-site:	
Class(x, _) -> <store-def(|"Class")> x	
scope-site:	
Class(_, _) -> <scope> ["Var", "Func"]	
!
def-site: 	
Field(x) -> <store-def(|"Var")> x	
!
def-site:	
Func(x, _) -> <store-def(|"Func")> x	
scope-site:	
Func(_, _) -> <scope> ["Var"]	
!
ref-site: 	
VarRef(v) -> <create-lookup-task(|"Var", 	
ā€¦fact-dependenciesā€¦)> v	
!
analyse = 	
topdown(def-site; scope-site);	
bottomup(ref-site);	
execute-tasks
Implementation not
concerned with:
Fact and Task Collection
Class("Point", [	
Field("x"),	
Field("y"),	
Func("print", [	
Print(VarRef("x")),	
Print(VarRef("y"))	
])	
])
def-site:	
Class(x, _) -> <store-def(|"Class")> x	
scope-site:	
Class(_, _) -> <scope> ["Var", "Func"]	
!
def-site: 	
Field(x) -> <store-def(|"Var")> x	
!
def-site:	
Func(x, _) -> <store-def(|"Func")> x	
scope-site:	
Func(_, _) -> <scope> ["Var"]	
!
ref-site: 	
VarRef(v) -> <create-lookup-task(|"Var", 	
ā€¦fact-dependenciesā€¦)> v	
!
analyse = 	
topdown(def-site; scope-site);	
bottomup(ref-site);	
execute-tasks
Implementation not
concerned with:
Incrementality
Fact and Task Collection
Class("Point", [	
Field("x"),	
Field("y"),	
Func("print", [	
Print(VarRef("x")),	
Print(VarRef("y"))	
])	
])
def-site:	
Class(x, _) -> <store-def(|"Class")> x	
scope-site:	
Class(_, _) -> <scope> ["Var", "Func"]	
!
def-site: 	
Field(x) -> <store-def(|"Var")> x	
!
def-site:	
Func(x, _) -> <store-def(|"Func")> x	
scope-site:	
Func(_, _) -> <scope> ["Var"]	
!
ref-site: 	
VarRef(v) -> <create-lookup-task(|"Var", 	
ā€¦fact-dependenciesā€¦)> v	
!
analyse = 	
topdown(def-site; scope-site);	
bottomup(ref-site);	
execute-tasks
Implementation not
concerned with:
Incrementality
Execution order
Fact and Task Collection
Class("Point", [	
Field("x"),	
Field("y"),	
Func("print", [	
Print(VarRef("x")),	
Print(VarRef("y"))	
])	
])
def-site:	
Class(x, _) -> <store-def(|"Class")> x	
scope-site:	
Class(_, _) -> <scope> ["Var", "Func"]	
!
def-site: 	
Field(x) -> <store-def(|"Var")> x	
!
def-site:	
Func(x, _) -> <store-def(|"Func")> x	
scope-site:	
Func(_, _) -> <scope> ["Var"]	
!
ref-site: 	
VarRef(v) -> <create-lookup-task(|"Var", 	
ā€¦fact-dependenciesā€¦)> v	
!
analyse = 	
topdown(def-site; scope-site);	
bottomup(ref-site);	
execute-tasks
Implementation not
concerned with:
Incrementality
Execution order
Analysis is described in
terms of tasks
Fact and Task Collection
Declarative Name Analysis Speciļ¬cation
Class(x, _):	
	 defines Class x	
	 scopes Var, Func	
	 	
Field(x):	
	 defines Var x	
	 	
Func(x, _):	
	 defines Func x	
	 scopes Var	
	 	
VarRef(x):	
	 refers to Var x
NaBL
Declarative Name Analysis Speciļ¬cation
Class(x, _):	
	 defines Class x	
	 scopes Var, Func	
	 	
Field(x):	
	 defines Var x	
	 	
Func(x, _):	
	 defines Func x	
	 scopes Var	
	 	
VarRef(x):	
	 refers to Var x
NaBL
Specify name analysis in terms of:	

Deļ¬nitions	

Namespaces	

Scopes	

References	

Imports
Declarative Name Analysis Speciļ¬cation
Class(x, _):	
	 defines Class x	
	 scopes Var, Func	
	 	
Field(x):	
	 defines Var x	
	 	
Func(x, _):	
	 defines Func x	
	 scopes Var	
	 	
VarRef(x):	
	 refers to Var x
NaBL def-site:	
Class(x, _) -> <store-def(|"Class")> x	
scope-site:	
Class(_, _) -> <scope> ["Var", "Func"]	
!
def-site: 	
Field(x) -> <store-def(|"Var")> x	
!
def-site:	
Func(x, _) -> <store-def(|"Func")> x	
scope-site:	
Func(_, _) -> <scope> ["Var"]	
!
ref-site: 	
VarRef(v) -> <create-lookup-task(|"Var", 	
ā€¦fact-dependenciesā€¦)> v	
!
analyse = 	
topdown(def-site; scope-site);	
bottomup(ref-site);	
execute-tasks
Generates
Declarative Name Analysis Speciļ¬cation
Class(x, _):	
	 defines Class x	
	 scopes Var, Func	
	 	
Field(x):	
	 defines Var x	
	 	
Func(x, _):	
	 defines Func x	
	 scopes Var	
	 	
VarRef(x):	
	 refers to Var x
NaBL def-site:	
Class(x, _) -> <store-def(|"Class")> x	
scope-site:	
Class(_, _) -> <scope> ["Var", "Func"]	
!
def-site: 	
Field(x) -> <store-def(|"Var")> x	
!
def-site:	
Func(x, _) -> <store-def(|"Func")> x	
scope-site:	
Func(_, _) -> <scope> ["Var"]	
!
ref-site: 	
VarRef(v) -> <create-lookup-task(|"Var", 	
ā€¦fact-dependenciesā€¦)> v	
!
analyse = 	
topdown(def-site; scope-site);	
bottomup(ref-site);	
execute-tasks
Generates
resolve Var x
define Var x
define Class Point
define Var y
define Func print
resolve Var y
Declarative Type System Speciļ¬cation
True() : Bool()	
False() : Bool()	
!
And(x, y) : Bool()	
where x : x-ty	
and y : y-ty	
and x-ty == Bool()	
else error 	
"Expected bool"	
and y-ty == Bool()	
else error 	
"Expected bool"
TS
Declarative Type System Speciļ¬cation
True() : Bool()	
False() : Bool()	
!
And(x, y) : Bool()	
where x : x-ty	
and y : y-ty	
and x-ty == Bool()	
else error 	
"Expected bool"	
and y-ty == Bool()	
else error 	
"Expected bool"
TS
Specify type system in terms of:	

Type rules	

Relations	

Error messages
Declarative Type System Speciļ¬cation
True() : Bool()	
False() : Bool()	
!
And(x, y) : Bool()	
where x : x-ty	
and y : y-ty	
and x-ty == Bool()	
else error 	
"Expected bool"	
and y-ty == Bool()	
else error 	
"Expected bool"
TS
create-type-task(|ctx) :	
True() -> <task-create-id(|ctx,[x16])> x16	
where 	
x16 := <type-is(|ctx)> Bool()	
!
create-type-task(|ctx) :	
False() -> <task-create-id(|ctx,[x17])> x17	
where 	
x17 := <type-is(|ctx)> Bool()	
!
create-type-task(|ctx) :	
And(x, y) -> <task-create-id(|ctx,[x7])> x7	
where 	
x-ty := <type-task(|ctx)> x;	
y-ty := <type-task(|ctx);	
eq38 := <type-match(|ctx, Bool());	
<task-create-error-on-failure(|ctx, eq38, "Expected bool")> x;	
eq39 := <type-match(|ctx, Bool())	
<task-create-error-on-failure(|ctx, eq39, "Expected bool")> y;	
x7 := <type-is(|ctx); task-create-id(|ctx, [eq39])> Bool()
Generates
Expressivity of Declarative Speciļ¬cations
Minus(x, y)	
+ Mul(x, y)	
+ Div(x, y)	
+ Mod(x, y) : ty	
where x : x-ty	
and y : y-ty	
and x-ty <is: Numerical() 	
else error "Expected numerical" on x	
and y-ty <is: Numerical() 	
else error "Expected numerical" on y	
and <promote-bin> (x-ty, y-ty) => ty
ClassDec(acc, ctx, mod*, c, tp*, None(), _, body):	
defines Type c	
of access acc	
of context ctx	
of modifiers mod*	
of type-parameters tp*	
of kind Class()	
of type RefType(TypeName(c), None())	
implicitly defines ImplicitField "this" 	
	 of type RefType(TypeName(c), None())	
scopes TypeParam, Field, ImplicitField, 	
Method, Constructor
NaBL TS
Expressivity of Declarative Speciļ¬cations
Can specify name and type analysis of Java 3
Minus(x, y)	
+ Mul(x, y)	
+ Div(x, y)	
+ Mod(x, y) : ty	
where x : x-ty	
and y : y-ty	
and x-ty <is: Numerical() 	
else error "Expected numerical" on x	
and y-ty <is: Numerical() 	
else error "Expected numerical" on y	
and <promote-bin> (x-ty, y-ty) => ty
ClassDec(acc, ctx, mod*, c, tp*, None(), _, body):	
defines Type c	
of access acc	
of context ctx	
of modifiers mod*	
of type-parameters tp*	
of kind Class()	
of type RefType(TypeName(c), None())	
implicitly defines ImplicitField "this" 	
	 of type RefType(TypeName(c), None())	
scopes TypeParam, Field, ImplicitField, 	
Method, Constructor
NaBL TS
Demo
Future Work
Technical Evaluation Research
optimization of
fact & task
collection
Technical Evaluation Research
optimization of
fact & task
collection
parallelization
Technical Evaluation Research
optimization of
fact & task
collection
parallelization
more languages
Technical Evaluation Research
optimization of
fact & task
collection
parallelization
more languages
other analyses &
transformations
Technical Evaluation Research
optimization of
fact & task
collection
parallelization
more languages
other analyses &
transformations
granularity
Technical Evaluation Research
optimization of
fact & task
collection
parallelization
more languages
other analyses &
transformations
granularity
caching
Guido H.Wachsmuth
Vlad A.Vergu
Danny M. Groenewegen
EelcoVisser
Acknowledgements
Name Binding Language (NaBL) [Konat. SLE ā€™12]
Task Engine for Incremental Name and Type Analysis [Wachsmuth. SLE ā€™13]
Augusto Passalaqua
Eduardo S. Amorim
Pierre Neron

More Related Content

Viewers also liked

Yr 8 nha trang camping email
Yr 8 nha trang camping emailYr 8 nha trang camping email
Yr 8 nha trang camping emailEd
Ā 
Greenpeace
GreenpeaceGreenpeace
GreenpeaceTheo Gomes
Ā 
Detailsweppics
DetailsweppicsDetailsweppics
DetailsweppicsDetails64
Ā 
Art+motion+3d
Art+motion+3dArt+motion+3d
Art+motion+3dorlando_soto
Ā 
Evaluation
EvaluationEvaluation
EvaluationAdella1
Ā 
S.k. teiksma
S.k. teiksmaS.k. teiksma
S.k. teiksmadacoteka
Ā 
hvjesxdfghjngtgvhbnm
hvjesxdfghjngtgvhbnmhvjesxdfghjngtgvhbnm
hvjesxdfghjngtgvhbnmAdella1
Ā 
Where do you get all those coupons
Where do you get all those couponsWhere do you get all those coupons
Where do you get all those couponspublixcouponqueen
Ā 
Spanish Art. 1- Intro; Prehistory
Spanish Art. 1- Intro; PrehistorySpanish Art. 1- Intro; Prehistory
Spanish Art. 1- Intro; PrehistoryJ Luque
Ā 
Stephen Bohane: Encouraging Businesses
Stephen Bohane: Encouraging BusinessesStephen Bohane: Encouraging Businesses
Stephen Bohane: Encouraging BusinessesPartner to Succeed
Ā 
Music Magazine Analysis
Music Magazine AnalysisMusic Magazine Analysis
Music Magazine Analysisbenjichandra
Ā 
Magazine Advert Construction
Magazine Advert Construction Magazine Advert Construction
Magazine Advert Construction benjichandra
Ā 
Location
LocationLocation
LocationAdella1
Ā 
Construction for music video
Construction for music videoConstruction for music video
Construction for music videoAdella1
Ā 
Final
FinalFinal
FinalAdella1
Ā 
kljiouht65drsetryuio;l
kljiouht65drsetryuio;lkljiouht65drsetryuio;l
kljiouht65drsetryuio;lAdella1
Ā 
Ontario Integrated Accessibility Regulation - FINAL - June 3, 2011
Ontario Integrated Accessibility Regulation - FINAL - June 3, 2011Ontario Integrated Accessibility Regulation - FINAL - June 3, 2011
Ontario Integrated Accessibility Regulation - FINAL - June 3, 2011Accessibil-IT Inc.
Ā 
Nervous and endocrine system
Nervous and endocrine systemNervous and endocrine system
Nervous and endocrine systemsherrymariani
Ā 

Viewers also liked (20)

Yr 8 nha trang camping email
Yr 8 nha trang camping emailYr 8 nha trang camping email
Yr 8 nha trang camping email
Ā 
Greenpeace
GreenpeaceGreenpeace
Greenpeace
Ā 
Detailsweppics
DetailsweppicsDetailsweppics
Detailsweppics
Ā 
Art+motion+3d
Art+motion+3dArt+motion+3d
Art+motion+3d
Ā 
Portfolio geert jan_kraan.key
Portfolio geert jan_kraan.keyPortfolio geert jan_kraan.key
Portfolio geert jan_kraan.key
Ā 
Evaluation
EvaluationEvaluation
Evaluation
Ā 
S.k. teiksma
S.k. teiksmaS.k. teiksma
S.k. teiksma
Ā 
hvjesxdfghjngtgvhbnm
hvjesxdfghjngtgvhbnmhvjesxdfghjngtgvhbnm
hvjesxdfghjngtgvhbnm
Ā 
Where do you get all those coupons
Where do you get all those couponsWhere do you get all those coupons
Where do you get all those coupons
Ā 
Spanish Art. 1- Intro; Prehistory
Spanish Art. 1- Intro; PrehistorySpanish Art. 1- Intro; Prehistory
Spanish Art. 1- Intro; Prehistory
Ā 
Stephen Bohane: Encouraging Businesses
Stephen Bohane: Encouraging BusinessesStephen Bohane: Encouraging Businesses
Stephen Bohane: Encouraging Businesses
Ā 
Music Magazine Analysis
Music Magazine AnalysisMusic Magazine Analysis
Music Magazine Analysis
Ā 
Magazine Advert Construction
Magazine Advert Construction Magazine Advert Construction
Magazine Advert Construction
Ā 
My pictures
My picturesMy pictures
My pictures
Ā 
Location
LocationLocation
Location
Ā 
Construction for music video
Construction for music videoConstruction for music video
Construction for music video
Ā 
Final
FinalFinal
Final
Ā 
kljiouht65drsetryuio;l
kljiouht65drsetryuio;lkljiouht65drsetryuio;l
kljiouht65drsetryuio;l
Ā 
Ontario Integrated Accessibility Regulation - FINAL - June 3, 2011
Ontario Integrated Accessibility Regulation - FINAL - June 3, 2011Ontario Integrated Accessibility Regulation - FINAL - June 3, 2011
Ontario Integrated Accessibility Regulation - FINAL - June 3, 2011
Ā 
Nervous and endocrine system
Nervous and endocrine systemNervous and endocrine system
Nervous and endocrine system
Ā 

Similar to A Task Engine for Name and Type Analysis

Similar to A Task Engine for Name and Type Analysis (6)

Domain-Specific Type Systems
Domain-Specific Type SystemsDomain-Specific Type Systems
Domain-Specific Type Systems
Ā 
Chapter 5.ppt
Chapter 5.pptChapter 5.ppt
Chapter 5.ppt
Ā 
C++ polymorphism
C++ polymorphismC++ polymorphism
C++ polymorphism
Ā 
Fun with Kotlin
Fun with KotlinFun with Kotlin
Fun with Kotlin
Ā 
Running Free with the Monads
Running Free with the MonadsRunning Free with the Monads
Running Free with the Monads
Ā 
Revision1 C programming
Revision1 C programmingRevision1 C programming
Revision1 C programming
Ā 

Recently uploaded

%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
Ā 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
Ā 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
Ā 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
Ā 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
Ā 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
Ā 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
Ā 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
Ā 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
Ā 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
Ā 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
Ā 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
Ā 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
Ā 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
Ā 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
Ā 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
Ā 
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøDelhi Call girls
Ā 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
Ā 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
Ā 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
Ā 

Recently uploaded (20)

%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
Ā 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
Ā 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
Ā 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
Ā 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
Ā 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
Ā 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
Ā 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Ā 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Ā 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Ā 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
Ā 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
Ā 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
Ā 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Ā 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
Ā 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
Ā 
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
Ā 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
Ā 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
Ā 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
Ā 

A Task Engine for Name and Type Analysis

  • 1. A Task Engine for Incremental Name and Type Analysis GabriĆ«l Konat
  • 4. Name and Type Analysis
  • 5. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } }
  • 6. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } Name Analysis Assign to each reference its corresponding deļ¬nition
  • 7. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } Name Analysis Assign to each reference its corresponding deļ¬nition
  • 8. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } Name Analysis Assign to each reference its corresponding deļ¬nition
  • 9. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } Name Analysis Assign to each reference its corresponding deļ¬nition
  • 10. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } Name Analysis Assign to each reference its corresponding deļ¬nition
  • 11. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } Name Analysis Assign to each reference its corresponding deļ¬nition
  • 12. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } Type Analysis Assign a type to each expression
  • 13. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } Type Analysis float Assign a type to each expression
  • 14. class B { ! int i; ! float f; ! int m() { return 0; } } class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } Type Analysis Assign a type to each expression float
  • 15. class B { ! int i; ! float f; ! int m() { return 0; } } class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } B Type Analysis Assign a type to each expression float
  • 16. class B { ! int i; ! float f; ! int m() { return 0; } } class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } B float Type Analysis Assign a type to each expression float
  • 17. class B { ! int i; ! float f; ! int m() { return 0; } } class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } B float float Type Analysis Assign a type to each expression float
  • 18. class B { ! int i; ! float f; ! int m() { return 0; } } class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } float B float float Type Analysis Assign a type to each expression float
  • 19. class B { ! int i; ! float f; ! int m() { return 0; } } class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } float B int float float Type Analysis Assign a type to each expression float
  • 20. class B { ! int i; ! float f; ! int m() { return 0; } } class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } float B int float float float
  • 21. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! float m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } float B int float float float float
  • 22. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } float B int float float int float
  • 23. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } float B int float float int int
  • 24. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B int float float int return m()
  • 25. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } return 1 + b.f class B { ! int i; ! float f; ! int m() { return 0; } } int B int int return m() float float float
  • 27. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } return 1 + b.f class B { ! int i; ! float f; ! int m() { return 0; } } int float B int float float int return m()
  • 28. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } return 1 + b.f class B { ! int i; ! float f; ! int m() { return 0; } } int float B int float float int return m() 1. Caching Reuse analysis results from previous analysis
  • 29. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } return 1 + b.f class B { ! int i; ! float f; ! int m() { return 0; } } int float B int float float int return m() 2. Change detection Which part of the program has changed?
  • 30. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } return 1 + b.f class B { ! int i; ! float f; ! int m() { return 0; } } int float B int float float int return m() 3. Invalidation & propagation Which calculations are affected by a change?
  • 31. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B int float float 4. Dependency tracking What are the dependencies between calculations?
  • 32. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float What are the dependencies between calculations? 4. Dependency tracking
  • 33. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float How to (re-)schedule invalidated calculations? 5. Scheduling
  • 34. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float
  • 35. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float f
  • 36. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float i
  • 37. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float Caching i
  • 38. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float Change Detection i
  • 39. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float Invalidation i
  • 40. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float Propagation i
  • 41. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float Propagation i
  • 42. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float Propagation i
  • 43. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float Scheduling i
  • 44. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float Scheduling i
  • 45. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B float int float Scheduling i
  • 46. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B int float Scheduling int i
  • 47. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int float B int int Scheduling int i
  • 48. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.f; } } class B { ! int i; ! float f; ! int m() { return 0; } } int int B int int Scheduling int i
  • 49. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.i; } } class B { ! int i; ! float f; ! int m() { return 0; } } int int B int int Scheduling int
  • 50. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.i; } } class B { ! int i; ! float f; ! int m() { return 0; } } int int B int int int
  • 51. Tasks
  • 52. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.i; } } class B { ! int i; ! float f; ! int m() { return 0; } } int int B int int int
  • 53. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.i; } } class B { ! int i; ! float f; ! int m() { return 0; } } int int B int int int Units of computation ...
  • 54. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.i; } } class B { ! int i; ! float f; ! int m() { return 0; } } int int B int int int ... with cacheable results ...
  • 55. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.i; } } class B { ! int i; ! float f; ! int m() { return 0; } } int int B int int int ... and dependencies on each other
  • 56. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.i; } } class B { ! int i; ! float f; ! int m() { return 0; } } int int B int int int resolve class A resolve class B resolve method m resolve field b resolve field i Name resolution tasks
  • 57. class C : A { ! int n() { return m(); } } class A { ! B b; ! int m; ! int m() { return 1 + b.i; } } class B { ! int i; ! float f; ! int m() { return 0; } } resolve class A resolve class B resolve method m resolve field b resolve field i calc type of m() calc type of i calc type of b calc type of b.i calc type of 1 + b.i calc type of 0 Name resolution tasks Typing tasks
  • 58. Name and Type Analysis
  • 59. Name and Type Analysis with Tasks
  • 60. class B { int i; float f; } class A { B b; float m() { return 1 + b.i; } }
  • 61. class B { int i; float f; } class A { B b; float m() { return 1 + b.i; } }
  • 62. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B class A { B b; float m() { return 1 + b.i; } } Facts
  • 63. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B class A { B b; float m() { return 1 + b.i; } } Facts Tasks
  • 64. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B class A { B b; float m() { return 1 + b.i; } } Facts Tasks
  • 65. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } Facts Tasks define class A
  • 66. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B Facts Tasks define class A
  • 67. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B1 Facts Tasks define class A
  • 68. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B1 2 Facts Tasks define class A
  • 69. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B1 2 3Facts Tasks define class A
  • 70. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B1 2 4 3Facts Tasks define class A
  • 71. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B1 5 2 4 3Facts Tasks define class A
  • 72. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B1 6 5 2 4 3Facts Tasks define class A
  • 73. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B1 6 5 7 2 4 3Facts Tasks define class A
  • 74. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B1 6 5 7 2 4 3 8 Facts Tasks define class A
  • 75. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B1 6 5 7 2 4 3 8 Facts Tasks define class A
  • 76. Incremental Name and Type Analysis with Tasks
  • 77. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B define class A
  • 78. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B define class A i
  • 79. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B define class A f
  • 80. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B define class A f
  • 81. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B define class A f
  • 82. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field b calc type of b calc type of 1 define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B define class A f
  • 83. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B define class A f
  • 84. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B 1 define class A f
  • 85. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B 2 1 define class A f
  • 86. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B 2 1 3 define class A f
  • 87. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B 2 1 3 4 define class A f
  • 88. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B 2 1 3 4 define class A f
  • 89. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A
  • 90. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A float f;
  • 91. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A
  • 92. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A
  • 93. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A
  • 94. type of i is int define field i class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A
  • 95. type of i is int define field i class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A
  • 96. type of i is int define field i class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A
  • 97. type of i is int define field i class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A 1
  • 98. type of i is int define field i class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A 2 1
  • 99. type of i is int define field i class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A 2 1 3
  • 100. type of i is int define field i class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A 2 1 3 4
  • 101. type of i is int define field i class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A
  • 102. type of i is int define field i class B { int i; float f; } define class B resolve field f resolve field b calc type of b calc type of 1 calc type of 1 + b.f calc type of f calc type of b.f define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.f; } } resolve class B define class A
  • 106. Feb 2010 - 4 ļ¬les - 3139 lines of code
  • 107. 3 years later - 55 ļ¬les - 8991 lines of code
  • 108. 0 3 6 9 12 15 0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 Time(s) Revision Parse Collect Evaluate 0 1 2 3 4 5 0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 Time(s) Revision Parse Collect Evaluate full, non-incremental analysis
  • 109. 0 3 6 9 12 15 0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 Time(s) Revision Parse Collect Evaluate 0 1 2 3 4 5 0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 Time(s) Revision Parse Collect Evaluate 0 3 6 9 12 15 0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 Time(s) Revision Parse Collect Evaluate 0 1 2 3 4 5 0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 Time(s) Revision Parse Collect Evaluate full, non-incremental analysis incremental analysis
  • 110. 0 0.3 0.6 0.9 1.2 1.5 0 20 40 60 80 100 120 Time(s) Revision Parse Collect Evaluate single-ļ¬le changes
  • 111. 0 0.3 0.6 0.9 1.2 1.5 0 20 40 60 80 100 120 Time(s) Revision Parse Collect Evaluate single-ļ¬le changes responsive enough for interactive usage in IDE
  • 113. type of i is int define field i define field f type of f is float class B { int i; float f; } define class B resolve field i resolve field b calc type of b calc type of 1 calc type of 1 + b.i calc type of i calc type of b.i define field b define method m type of b is B type of m is float class A { B b; float m() { return 1 + b.i; } } resolve class B define class A
  • 114. Fact and Task Collection Class("Point", [ Field("x"), Field("y"), Func("print", [ Print(VarRef("x")), Print(VarRef("y")) ]) ])
  • 115. Class("Point", [ Field("x"), Field("y"), Func("print", [ Print(VarRef("x")), Print(VarRef("y")) ]) ]) def-site: Class(x, _) -> <store-def(|"Class")> x scope-site: Class(_, _) -> <scope> ["Var", "Func"] ! def-site: Field(x) -> <store-def(|"Var")> x ! def-site: Func(x, _) -> <store-def(|"Func")> x scope-site: Func(_, _) -> <scope> ["Var"] ! ref-site: VarRef(v) -> <create-lookup-task(|"Var", ā€¦fact-dependenciesā€¦)> v ! analyse = topdown(def-site; scope-site); bottomup(ref-site); execute-tasks Fact and Task Collection
  • 116. Class("Point", [ Field("x"), Field("y"), Func("print", [ Print(VarRef("x")), Print(VarRef("y")) ]) ]) def-site: Class(x, _) -> <store-def(|"Class")> x scope-site: Class(_, _) -> <scope> ["Var", "Func"] ! def-site: Field(x) -> <store-def(|"Var")> x ! def-site: Func(x, _) -> <store-def(|"Func")> x scope-site: Func(_, _) -> <scope> ["Var"] ! ref-site: VarRef(v) -> <create-lookup-task(|"Var", ā€¦fact-dependenciesā€¦)> v ! analyse = topdown(def-site; scope-site); bottomup(ref-site); execute-tasks Fact and Task Collection
  • 117. Class("Point", [ Field("x"), Field("y"), Func("print", [ Print(VarRef("x")), Print(VarRef("y")) ]) ]) def-site: Class(x, _) -> <store-def(|"Class")> x scope-site: Class(_, _) -> <scope> ["Var", "Func"] ! def-site: Field(x) -> <store-def(|"Var")> x ! def-site: Func(x, _) -> <store-def(|"Func")> x scope-site: Func(_, _) -> <scope> ["Var"] ! ref-site: VarRef(v) -> <create-lookup-task(|"Var", ā€¦fact-dependenciesā€¦)> v ! analyse = topdown(def-site; scope-site); bottomup(ref-site); execute-tasks Fact and Task Collection
  • 118. Class("Point", [ Field("x"), Field("y"), Func("print", [ Print(VarRef("x")), Print(VarRef("y")) ]) ]) def-site: Class(x, _) -> <store-def(|"Class")> x scope-site: Class(_, _) -> <scope> ["Var", "Func"] ! def-site: Field(x) -> <store-def(|"Var")> x ! def-site: Func(x, _) -> <store-def(|"Func")> x scope-site: Func(_, _) -> <scope> ["Var"] ! ref-site: VarRef(v) -> <create-lookup-task(|"Var", ā€¦fact-dependenciesā€¦)> v ! analyse = topdown(def-site; scope-site); bottomup(ref-site); execute-tasks Fact and Task Collection
  • 119. Class("Point", [ Field("x"), Field("y"), Func("print", [ Print(VarRef("x")), Print(VarRef("y")) ]) ]) def-site: Class(x, _) -> <store-def(|"Class")> x scope-site: Class(_, _) -> <scope> ["Var", "Func"] ! def-site: Field(x) -> <store-def(|"Var")> x ! def-site: Func(x, _) -> <store-def(|"Func")> x scope-site: Func(_, _) -> <scope> ["Var"] ! ref-site: VarRef(v) -> <create-lookup-task(|"Var", ā€¦fact-dependenciesā€¦)> v ! analyse = topdown(def-site; scope-site); bottomup(ref-site); execute-tasks Implementation not concerned with: Fact and Task Collection
  • 120. Class("Point", [ Field("x"), Field("y"), Func("print", [ Print(VarRef("x")), Print(VarRef("y")) ]) ]) def-site: Class(x, _) -> <store-def(|"Class")> x scope-site: Class(_, _) -> <scope> ["Var", "Func"] ! def-site: Field(x) -> <store-def(|"Var")> x ! def-site: Func(x, _) -> <store-def(|"Func")> x scope-site: Func(_, _) -> <scope> ["Var"] ! ref-site: VarRef(v) -> <create-lookup-task(|"Var", ā€¦fact-dependenciesā€¦)> v ! analyse = topdown(def-site; scope-site); bottomup(ref-site); execute-tasks Implementation not concerned with: Incrementality Fact and Task Collection
  • 121. Class("Point", [ Field("x"), Field("y"), Func("print", [ Print(VarRef("x")), Print(VarRef("y")) ]) ]) def-site: Class(x, _) -> <store-def(|"Class")> x scope-site: Class(_, _) -> <scope> ["Var", "Func"] ! def-site: Field(x) -> <store-def(|"Var")> x ! def-site: Func(x, _) -> <store-def(|"Func")> x scope-site: Func(_, _) -> <scope> ["Var"] ! ref-site: VarRef(v) -> <create-lookup-task(|"Var", ā€¦fact-dependenciesā€¦)> v ! analyse = topdown(def-site; scope-site); bottomup(ref-site); execute-tasks Implementation not concerned with: Incrementality Execution order Fact and Task Collection
  • 122. Class("Point", [ Field("x"), Field("y"), Func("print", [ Print(VarRef("x")), Print(VarRef("y")) ]) ]) def-site: Class(x, _) -> <store-def(|"Class")> x scope-site: Class(_, _) -> <scope> ["Var", "Func"] ! def-site: Field(x) -> <store-def(|"Var")> x ! def-site: Func(x, _) -> <store-def(|"Func")> x scope-site: Func(_, _) -> <scope> ["Var"] ! ref-site: VarRef(v) -> <create-lookup-task(|"Var", ā€¦fact-dependenciesā€¦)> v ! analyse = topdown(def-site; scope-site); bottomup(ref-site); execute-tasks Implementation not concerned with: Incrementality Execution order Analysis is described in terms of tasks Fact and Task Collection
  • 123. Declarative Name Analysis Speciļ¬cation Class(x, _): defines Class x scopes Var, Func Field(x): defines Var x Func(x, _): defines Func x scopes Var VarRef(x): refers to Var x NaBL
  • 124. Declarative Name Analysis Speciļ¬cation Class(x, _): defines Class x scopes Var, Func Field(x): defines Var x Func(x, _): defines Func x scopes Var VarRef(x): refers to Var x NaBL Specify name analysis in terms of: Deļ¬nitions Namespaces Scopes References Imports
  • 125. Declarative Name Analysis Speciļ¬cation Class(x, _): defines Class x scopes Var, Func Field(x): defines Var x Func(x, _): defines Func x scopes Var VarRef(x): refers to Var x NaBL def-site: Class(x, _) -> <store-def(|"Class")> x scope-site: Class(_, _) -> <scope> ["Var", "Func"] ! def-site: Field(x) -> <store-def(|"Var")> x ! def-site: Func(x, _) -> <store-def(|"Func")> x scope-site: Func(_, _) -> <scope> ["Var"] ! ref-site: VarRef(v) -> <create-lookup-task(|"Var", ā€¦fact-dependenciesā€¦)> v ! analyse = topdown(def-site; scope-site); bottomup(ref-site); execute-tasks Generates
  • 126. Declarative Name Analysis Speciļ¬cation Class(x, _): defines Class x scopes Var, Func Field(x): defines Var x Func(x, _): defines Func x scopes Var VarRef(x): refers to Var x NaBL def-site: Class(x, _) -> <store-def(|"Class")> x scope-site: Class(_, _) -> <scope> ["Var", "Func"] ! def-site: Field(x) -> <store-def(|"Var")> x ! def-site: Func(x, _) -> <store-def(|"Func")> x scope-site: Func(_, _) -> <scope> ["Var"] ! ref-site: VarRef(v) -> <create-lookup-task(|"Var", ā€¦fact-dependenciesā€¦)> v ! analyse = topdown(def-site; scope-site); bottomup(ref-site); execute-tasks Generates resolve Var x define Var x define Class Point define Var y define Func print resolve Var y
  • 127. Declarative Type System Speciļ¬cation True() : Bool() False() : Bool() ! And(x, y) : Bool() where x : x-ty and y : y-ty and x-ty == Bool() else error "Expected bool" and y-ty == Bool() else error "Expected bool" TS
  • 128. Declarative Type System Speciļ¬cation True() : Bool() False() : Bool() ! And(x, y) : Bool() where x : x-ty and y : y-ty and x-ty == Bool() else error "Expected bool" and y-ty == Bool() else error "Expected bool" TS Specify type system in terms of: Type rules Relations Error messages
  • 129. Declarative Type System Speciļ¬cation True() : Bool() False() : Bool() ! And(x, y) : Bool() where x : x-ty and y : y-ty and x-ty == Bool() else error "Expected bool" and y-ty == Bool() else error "Expected bool" TS create-type-task(|ctx) : True() -> <task-create-id(|ctx,[x16])> x16 where x16 := <type-is(|ctx)> Bool() ! create-type-task(|ctx) : False() -> <task-create-id(|ctx,[x17])> x17 where x17 := <type-is(|ctx)> Bool() ! create-type-task(|ctx) : And(x, y) -> <task-create-id(|ctx,[x7])> x7 where x-ty := <type-task(|ctx)> x; y-ty := <type-task(|ctx); eq38 := <type-match(|ctx, Bool()); <task-create-error-on-failure(|ctx, eq38, "Expected bool")> x; eq39 := <type-match(|ctx, Bool()) <task-create-error-on-failure(|ctx, eq39, "Expected bool")> y; x7 := <type-is(|ctx); task-create-id(|ctx, [eq39])> Bool() Generates
  • 130. Expressivity of Declarative Speciļ¬cations Minus(x, y) + Mul(x, y) + Div(x, y) + Mod(x, y) : ty where x : x-ty and y : y-ty and x-ty <is: Numerical() else error "Expected numerical" on x and y-ty <is: Numerical() else error "Expected numerical" on y and <promote-bin> (x-ty, y-ty) => ty ClassDec(acc, ctx, mod*, c, tp*, None(), _, body): defines Type c of access acc of context ctx of modifiers mod* of type-parameters tp* of kind Class() of type RefType(TypeName(c), None()) implicitly defines ImplicitField "this" of type RefType(TypeName(c), None()) scopes TypeParam, Field, ImplicitField, Method, Constructor NaBL TS
  • 131. Expressivity of Declarative Speciļ¬cations Can specify name and type analysis of Java 3 Minus(x, y) + Mul(x, y) + Div(x, y) + Mod(x, y) : ty where x : x-ty and y : y-ty and x-ty <is: Numerical() else error "Expected numerical" on x and y-ty <is: Numerical() else error "Expected numerical" on y and <promote-bin> (x-ty, y-ty) => ty ClassDec(acc, ctx, mod*, c, tp*, None(), _, body): defines Type c of access acc of context ctx of modifiers mod* of type-parameters tp* of kind Class() of type RefType(TypeName(c), None()) implicitly defines ImplicitField "this" of type RefType(TypeName(c), None()) scopes TypeParam, Field, ImplicitField, Method, Constructor NaBL TS
  • 132. Demo
  • 134. Technical Evaluation Research optimization of fact & task collection
  • 135. Technical Evaluation Research optimization of fact & task collection parallelization
  • 136. Technical Evaluation Research optimization of fact & task collection parallelization more languages
  • 137. Technical Evaluation Research optimization of fact & task collection parallelization more languages other analyses & transformations
  • 138. Technical Evaluation Research optimization of fact & task collection parallelization more languages other analyses & transformations granularity
  • 139. Technical Evaluation Research optimization of fact & task collection parallelization more languages other analyses & transformations granularity caching
  • 140. Guido H.Wachsmuth Vlad A.Vergu Danny M. Groenewegen EelcoVisser Acknowledgements Name Binding Language (NaBL) [Konat. SLE ā€™12] Task Engine for Incremental Name and Type Analysis [Wachsmuth. SLE ā€™13] Augusto Passalaqua Eduardo S. Amorim Pierre Neron