Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Programs That Eat Programs

Programs That Eat Programs

Software GR Feb 24, 2015

Michael Bernstein

February 24, 2015
Tweet

More Decks by Michael Bernstein

Other Decks in Technology

Transcript

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

    View full-size slide

  2. I’m Obsessed

    View full-size slide

  3. I’m Obsessed

    View full-size slide

  4. I’m Obsessed

    View full-size slide

  5. I have a podcast

    View full-size slide

  6. Static analysis is
    my day job

    View full-size slide

  7. I live in College
    Park, Maryland

    View full-size slide

  8. Programs That
    Eat Programs

    View full-size slide

  9. Programs That
    Eat Programs

    View full-size slide

  10. What Is A Program?

    View full-size slide

  11. Math is Cool

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  14. A ______
    is a _______
    with a _______

    View full-size slide

  15. Partial Order

    View full-size slide

  16. Partially Ordered Sets

    View full-size slide

  17. Monotonicity

    View full-size slide

  18. Galois Connections

    View full-size slide

  19. Very Cool Math

    View full-size slide

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

    View full-size slide

  21. What Is A Program?

    View full-size slide

  22. Programs That
    Eat Programs

    View full-size slide

  23. How Do You Eat One?

    View full-size slide

  24. Interpreters

    View full-size slide

  25. “Essentials of
    Programming
    Languages”
    Friedman & Wand

    View full-size slide

  26. “Abstracting Abstract
    Machines”
    Van Horn and Might

    View full-size slide

  27. From a concrete interpreter
    to an abstract interpreter

    View full-size slide

  28. 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)
    type Addr = Int

    View full-size slide

  29. 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(σ)

    View full-size slide

  30. Static Analysis

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  33. What Do We Hope
    To Learn?

    View full-size slide

  34. State space exploration

    View full-size slide

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

    View full-size slide

  36. Higher-Order PLs

    View full-size slide

  37. Practicality

    View full-size slide

  38. Semantics Matter!

    View full-size slide

  39. Brakeman - Rails Security
    Scanner

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  42. Thank You
    w michaelrbernste.in
    t @mrb_bk

    View full-size slide