Programs That Eat Programs

Programs That Eat Programs

Software GR Feb 24, 2015

Michael Bernstein

February 24, 2015

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

67 slides
  1. Programs That Eat Programs Michael R. Bernstein February 24th, 2015

    Software GR, Grand Rapids, MI w michaelrbernste.in t @mrb_bk
  2. 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
  3. 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(σ)

More Decks by Michael Bernstein

Other Decks in Technology