Erklärung CPS-Transformation

Spezifikation (Vorsicht, enthält Typfehler - welche?):

    eval env x          (\ y -> k2 (k1 y)) 
=?= eval env (cps x k1) k2

Wiederholung CPS-Interpreter:

type Cont = Val -> Action Val
eval :: Env -> Exp -> Cont -> Action Val
eval env x = \ k -> case x of
    ConstInt i -> ... ; Plus a b -> ...
CPS-Transformator:
type Cont = ExpValue -> Transform Exp
cps :: Exp -> Cont -> Transform Exp
cps x = \ m -> case x of
    ConstInt i -> ... ; Plus a b -> ...



Johannes Waldmann 2012-01-30