Michael Bernstein
February 24, 2015
1.3k

# Programs That Eat Programs

Software GR Feb 24, 2015

## Michael Bernstein

February 24, 2015

## Transcript

1. Programs That
Eat Programs
Michael R. Bernstein
February 24th, 2015
Software GR, Grand Rapids, MI
w michaelrbernste.in
t @mrb_bk

2. I’m Obsessed

3. I’m Obsessed

4. I’m Obsessed

5. I have a podcast

6. Static analysis is
my day job

7. I live in College
Park, Maryland

8. Programs That
Eat Programs

9. Programs That
Eat Programs

10. What Is A Program?

11. Programs

12. Math

13. Math is Cool

14. “Introduction to
Lattices and Order”
Davey & Priestley

15. “Ordered Sets and Complete
Lattices: A Primer for
Computer Science”
Priestley

16. A ______
is a _______
with a _______

17. Partial Order

18. Set Theory

19. Partially Ordered Sets

20. Lattices

21. Monotonicity

22. Galois Connections

23. Very Cool Math

24. “Principles of
Program Analysis”
Nielson, Nielson
& Hankin

25. What Is A Program?

26. Programs That
Eat Programs

27. How Do You Eat One?

28. Interpreters

29. “Essentials of
Programming
Languages”
Friedman & Wand

30. “Abstracting Abstract
Machines”
Van Horn and Might

31. From a concrete interpreter
to an abstract interpreter

32. type Σ = (Exp,Env,Store,Kont)
type Env = Var :-> Addr
data Storable = Clo (Lambda, Env)
type Store = Addr :-> Storable
data Kont = Mt |
Ar (Exp,Env,Kont) |
Fn (Lambda,Env,Kont)

33. step :: Σ -> Σ
step (Ref x, ρ, σ, κ) = (Lam lam, ρ', σ, κ)
where Clo (lam, ρ') = σ!(ρ!x)
step (f :@ e, ρ, σ, κ) = (f, ρ, σ, Ar(e, ρ, κ))
step (Lam lam,ρ,σ,Ar(e, ρ', κ)) = (e, ρ', σ, Fn(lam, ρ, κ))
step (Lam lam,ρ,σ,Fn(x :=> e, ρ', κ)) =
(e, ρ' // [x ==> a'], σ // [a' ==> Clo (lam, ρ)], κ)
where a' = alloc(σ)

34. Static Analysis

35. As long as we’ve been
writing programs, we’ve been
writing programs to analyze
our programs

36. As long as we’ve been
writing programs, we’ve been
writing programs that eat
programs

37. What Do We Hope
To Learn?

38. State space exploration

39. Soundness

40. “In Defense of
Soundiness: A
Manifesto”
Livshits, Sridharan,et. al.

41. Soundiness

42. Higher-Order PLs

43. Practicality

44. Semantics Matter!

45. Brakeman - Rails Security
Scanner

46. The Future

47. SMT Solvers

48. Why write code and then
generate proofs when you
could write proofs and
generate code?

49. Takeaways

50. Works Cited
https://gist.github.com/mrb/e015c37e2b851be2b6ae

51. Thank You
w michaelrbernste.in
t @mrb_bk