arisa@pllab.is.ocha.ac.jp asai@is.ocha.ac.jp shift / reset CPS shift / reset CPS CPS 1 [3, 5] goto try/catch raise call/cc [17] control/prompt [8], shift/reset [5] control/prompt, shift/reset call/cc (continuationpassing style : CPS) call/cc [9] CPS shift/reset CPS SECD [12] shift/reset Danvy [7] SECD direct style CPS SECD bisimulation Ager [2] CPS CEK shift/reset Danvy [4] Danvy SECD CEK shift/reset Ager [1] [10] backquote unquote λ Ager shift/reset
shift/reset [13] 2 shift / reset shift reset k call/cc reset shift k shift (...) k 1 + shift(fun k -> 2 * (k 3)) k 2 * (1 + 3) 8 reset shift reset (...) shift 1 + reset(4 + shift(fun k -> 2 * (k 3))) 4 k 1 + (2 * (4 + 3)) 15 1 reset shift 3 CPS syntax t ::= x λx. t t 0 t 1 shift(t) reset(t) shift reset [x, t, e] shift [c] v ::= [x, t, e] [c] OCaml 1 (* *) 2 type t = Var of string (* *) 3 Fun of string * t (* *) 4 App of t * t (* *) 5 Shift of t (* shift *) 6 Reset of t (* reset *) 7 (* *) 8 type v = VFun of string * t * e (* *) 9 VCont of c (* *) 10 (* *) 11 and e = ( string * v) list 12 (* *) 13 and c = ( v -> v) x v get(x, e) e x v shift/reset eval1 [6] 1 (* id : v -> v *) 2 let id x = x 3 4 (* eval : t * e * c -> v *) 5 let rec eval (t, e, c) = match t with 6 Var (x) -> c ( get (x, e)) 7 Fun (x, t) -> c ( VFun (x, t, e)) 8 App (t0, t1) -> eval (t1, e, ( fun v1 9 -> eval (t0, e, ( fun v0 10 -> ( match v0 with 11 ( VFun (x, t, e )) -> eval (t, (x, v1) :: e, c) 12 ( VCont (c )) -> c (c v1) ))))) 13 Shift (t) -> eval (t, e, ( fun v 14 -> ( match v with 15 ( VFun (x, t, e )) -> eval (t, (x, VCont (c)) :: e, id) 16 ( VCont (c )) -> c ( VCont (c ))) )) 17 Reset (t) -> c ( eval (t, e, id )) 18 19 (* eval1 : t -> v *) 20 let eval1 t = eval (t, [], id)
CPS shift/reset 13 16 shift 17 reset shift VCont(c) Shift t reset id shift shift/reset shift/reset 4 CPS eval1 shift/reset 12, 17 eval1 CPS eval2 1 type v = (* *) (* *) 2 and e = (* *) (* *) 3 and c = ((v * d) -> v) (* *) 4 and d = ( v -> v) eval2 1 (* cid : v * d -> v *) 2 (* did : v -> v *) 3 let cid (v, d) = d v 4 let did x = x 5 6 (* eval : t * e * c * d -> v *) 7 let rec eval (t, e, c, d) = match t with 8 Var (x) -> c ( get (x, e), d) 9 Fun (x, t) -> c ( VFun (x, t, e), d) 10 App (t0, t1) 11 -> eval (t1, e, ( fun (v1, d1) 12 -> eval (t0, e, ( fun (v0, d0) 13 -> ( match v0 with 14 ( VFun (x, t, e )) -> eval (t, (x, v1) :: e, c, d0) 15 ( VCont (c )) -> c (v1, ( fun v -> c (v, d0 ))))), d1 )), d) 16 Shift ( t) 17 -> eval (t, e, ( fun (v, d ) 18 -> ( match v with 19 ( VFun (x, t, e )) -> eval (t, (x, VCont (c)) :: e, cid, d ) 20 ( VCont (c )) -> c ( VCont (c), d ))), d) 21 Reset (t) -> eval (t, e, cid, ( fun v -> c (v, d ))) 22 23 (* eval2 : t -> v *) 24 let eval2 t = eval (t, [], cid, did ) eval1 CPS c CPS c d CPS 4.1 (CPS [16]). t eval1 eval2 t eval1 CPS t eval2 5 eval2 CPS eval2 [16] eval3 (OCaml fun ) (apply run * )
eval2 Shift OCaml fun 16 20 fun body c c eval2 c Shift fun c fun body 1 type v = (* *) (* *) 2 and e = (* *) (* *) 3 (* *) 4 and c = CApp1 of t * e * c (* A p p fun *) 5 CApp0 of v * c (* A p p fun *) 6 CShift of c (* S h i f t fun *) 7 CReset (* c id *) 8 and d = DRun of c * d (* R e s e t d fun *) 9 DReset (* d id *) eval2 fun 1 (* run_c : c * v * d -> v *) 2 let rec run_c (c, v, d) = match c with 3 CApp1 (t, e, c ) -> eval (t, e, CApp0 (v, c ), d) 4 CApp0 (v, c ) -> ( match v with 5 VFun (x, t, e ) -> eval (t, (x, v ) :: e, c, d) 6 VCont (c ) -> run_c (c, v, DRun (c, d ))) 7 CShift (c ) -> ( match v with 8 VFun (x, t, e ) -> eval (t, (x, VCont (c )) :: e, CReset, d) 9 VCont (c ) -> run_c (c, VCont (c ), d)) 10 CReset -> run_d (d, v) 11 (* run_d : d * v -> v *) 12 and run_d (d, v) = match d with 13 DRun (c, d ) -> run_c (c, v, d ) 14 DReset -> v fun eval2 8 Var c c eval3 Var run c (c, get(x, e), d) d eval3 1 (* cid : c *) 2 (* did : d *) 3 let cid = CReset 4 let did = DReset 5 6 (* eval : t * e * c * d -> v *) 7 let rec eval (t, e, c, d) = match t with 8 Var (x) -> run_c (c, get (x, e), d) 9 Fun (x, t) -> run_c (c, VFun (x, t, e), d) 10 App (t0, t1) -> eval (t1, e, CApp1 (t0, e, c), d) 11 Shift (t) -> eval (t, e, CShift (c), d) 12 Reset (t) -> eval (t, e, cid, DRun (c, d)) 13 14 (* eval3 : t -> v *) 15 let eval3 t = eval (t, [], cid, did ) OCaml fun 5.1 ( [16] ).
t eval2 eval3 t eval2 t eval3 6 eval3 eval3 c eval4 c c c c. eval3 c head c tail c. eval4 1: eval3 eval4 eval3 c CApp1, CApp0, CShift c c c c c tail c CReset d c d 1 (* *) 2 type v = VFun of string * t * e 3 VCont of c list (* c c list *) 4 and e = (* *) (* *) 5 (* *) 6 and c = CApp1 of t * e (* c c *) 7 CApp0 of v (* c CReset *) 8 CShift (* *) 9 and d = DRun of c list (* d d *) eval4 1 (* identity function *) 2 (* cid : c list *) 3 (* did : d list *) 4 let cid = [] 5 let did = [] 6 7 (* eval : t * e * c list * d list -> v *) 8 let rec eval (t, e, c, d) = match t with 9 Var (x) -> run_c (c, get (x, e), d) 10 Fun (x, t) -> run_c (c, VFun (x, t, e), d) 11 App (t0, t1) -> eval (t1, e, CApp1 (t0, e) :: c, d) 12 Shift ( t) -> eval (t, e, CShift :: c, d) 13 Reset ( t) -> eval (t, e, cid, DRun ( c) :: d) 14 15 (* run_c : c list * v * d list -> v *)
16 and run_c (c, v, d) = match c with 17 CApp1 (t, e ) :: c -> eval (t, e, CApp0 (v) :: c, d) 18 CApp0 (v ) :: c -> ( match v with 19 VFun (x, t, e ) -> eval (t, (x, v ) :: e, c, d) 20 VCont (c ) -> run_c (c, v, DRun (c ) :: d)) 21 CShift :: c -> ( match v with 22 VFun (x, t, e ) -> eval (t, (x, VCont (c )) :: e, cid, d) 23 VCont (c ) -> run_c (c, VCont (c ), d)) 24 [] -> run_d (d, v) 25 26 (* run_d : d list * v -> v *) 27 and run_d (d, v) = match d with 28 DRun (c ) :: d -> run_c (c, v, d ) 29 [] -> v 30 31 (* eval4 : t -> v *) 32 let eval4 t = eval (t, [], cid, did ) c c list d d list 11, 12, 17 eval3 eval4 13 CReset (cid) Reset DRun(c) d list reset c d d shift/reset reset shift reset shift eval3 eval4 eval3 eval4 eval3 eval4 6.1 ( ). t eval3 eval4 t eval3 t eval4 7 7.1 eval4 CApp0 v eval5 c list 1 (* *) 2 type v = VFun of string * t * e 3 VCont of (c list ) * s (* c list *) 4 (* *) 5 and s = v list (* *) 6 and e = (* *) (* *) 7 (* *) 8 and c = CApp1 of t * e 9 CApp0 (* *) 10 CShift 11 and d = DRun of (c list ) * s (* c list *)
CApp0(v) v v CApp0 c list (c list) * s VCont DRun s run c run d run c run d eval5 1 (* cid : c list *) 2 (* did : d list *) 3 let cid = [] 4 let did = [] 5 6 (* eval : t * s * e * c * d -> v *) 7 let rec eval (t, s, e, c, d) = match t with 8 Var ( x) -> run_c (c, get (x, e) :: s, d) 9 Fun (x, t) -> run_c (c, VFun (x, t, e) :: s, d) 10 App (t0, t1) -> eval (t1, s, e, CApp1 (t0, e) :: c, d) 11 Shift ( t) -> eval (t, s, e, CShift :: c, d) 12 Reset (t) -> eval (t, [], e, cid, DRun (c, s) :: d) 13 14 (* run_c : c * s * d -> v *) 15 and run_c (c, s, d) = match c with 16 CApp1 (t, e ) :: c -> eval (t, s, e, CApp0 :: c, d) 17 CApp0 :: c -> 18 ( match s with 19 VFun (x, t, e ) :: v :: s -> eval (t, s, (x, v ) :: e, c, d) 20 VCont (c, s ) :: v :: s -> run_c (c, v :: s, DRun (c, s ) :: d)) 21 CShift :: c -> 22 ( match s with 23 VFun (x, t, e ) :: s -> eval (t, [], (x, VCont (c, s )) :: e, cid, d) 24 VCont (c, s ) :: s -> run_c (c, VCont (c, s ) :: s, d)) 25 [] -> run_d (d, s) 26 27 (* run_d : d * s -> v *) 28 and run_d (d, s) = match (d, s) with 29 ( DRun (c, s ) :: d, v :: s ) -> run_c (c, v :: s, d ) 30 ([], v :: s ) -> v 31 32 (* eval5 : t -> v *) 33 let eval5 t = eval (t, [], [], cid, did ) s 8, 9 eval4 20, 24, 29 VCont DRun 29, 30 (s ) 7.2 eval4 eval5 eval4 eval5 bisimulation bisimulation 7.1 (bisimulation [14]). P Q P, Q bisimulation P P P Q Q P Q Q Q Q Q P P P Q P
bisimulation eval4 eval5 eval4 9 eval Var(x) run c (c, get(x, e), d) Var(x), e 4, c 4, d 4 c 4, get(x, e 4 ), d 4 eval, run c, run d run d t, e, c, d, c, v, d, d, v, v eval4 2 t t, [], [], [] Var(x), e, c, d c, get(x, e), d Fun(x, t), e, c, d c, VFun(x, t, e), d App(t0, t1), e, c, d t1, e, CApp1(t0, e) :: c, d Shift(t), e, c, d t, e, CShift :: c, d Reset(t), e, c, d t, e, [], DRun(c) :: d CApp1(t, e) :: c, v, d t, e, CApp0(v) :: c, d CApp0(v) :: c, VFun(x, t, e), d t, (x, v) :: e, c, d CApp0(v) :: c, VCont(c ), d c, v, DRun(c) :: d CShift :: c, VFun(x, t, e), d t, (x, VCont(c)) :: e, [], d CShift :: c, VCont(c ), d c, VCont(c), d [], v, d d, v DRun(c ) :: d, v c, v, d [], v v 2: eval4 eval5 t, s, e, c, d, c, s, d, d, s, v 3 t t, [], [], [], [] Var(x), s, e, c, d c, get(x, e) :: s, d Fun(x, t), s, e, c, d c, VFun(x, t, e) :: s, d App(t0, t1), s, e, c, d t1, s, e, CApp1(t0, e) :: c, d Shift(t), s, e, c, d t, s, e, CShift :: c, d Reset(t), s, e, c, d t, [], e, [], DRun(c, s) :: d CApp1(t, e) :: c, s, d t, s, e, CApp0 :: c, d CApp0 :: c, VFun(x, t, e) :: v :: s, d t, s, (x, v) :: e, c, d CApp0 :: c, VCont(c, s ) :: v :: s, d c, v :: s, DRun(c, s) :: d CShift :: c, VFun(x, t, e) :: s, d t, [], (x, VCont(c, s)) :: e, [], d CShift :: c, VCont(c, s ) :: s, d c, VCont(c, s) :: s, d [], s, d d, s DRun(c, s ) :: d, v :: s c, v :: s, d [], v :: s v 3: eval5 eval4 eval5 bisimulation eval4 eval5 eval4 eval5 eval4 c 4 eval5 s c 5 = s c 4 = s s c 5 c 4 s c 5 = s eval4 eval5
7.2 ( = s ). eval4 S 4 eval5 S 5 t, e 4, c 4, d 4 S 4, c 4, v 4, d 4 S 4, t, s, e 5, c 5, d 5 S 5, c 5, v 5 :: s, d 5 S 5 = s (i) c 4 = [], s = [], c 5 = [] c 4 = s s c 5 (ii) c 4 = s s c 5, e 4 = s e 5 c 4 = CApp1 4 (t, e 4 ) :: c 4, c 5 = CApp1 5 (t, e 5 ) :: c 5 c 4 = s s c 5 (iii) c 4 = s s c 5, v 4 = s v 5 c 4 = CApp0 4 (v 4 ) :: c 4, c 5 = CApp0 5 :: c 5 c 4 = s (v 5 :: s) c 5 (iv) c 4 = s s c 5 c 4 = CShift 4 :: c 4, c 5 = CShift 5 :: c 5 c 4 = s s c 5 c 4 = s s c 5 VCont 4 (c 4 ) = s VCont 5 (s, c 5 ), DRun 4 (c 4 ) = s DRun 5 (c 5, s) = s 7.2 (iii) c 4 CApp0 4 (v 4 ) v 4 c 5 CApp0 5 v 5 s = s eval4 eval5 s bisimulation 7.1 ( bisimulation). c 4 = s s c 5, e 4 = s e 5, d 4 = s d 5, v 4 = s v 5 t, e 4, c 4, d 4 s t, s, e 5, c 5, d 5 c 4 = s s c 5, d 4 = s d 5, v 4 = s v 5 c 4, v 4, d 4 s c 5, v 5 :: s, d 5 d 4 = s d 5, v 4 = s v 5 d 4, v 4 s d 5, v 5 :: s v 4 = s v 5 v 4 s v 5 s bisimulation. P S 4, Q S 5 P s Q P eval4 P Q eval5 Q P s Q Q Q eval5 Q P eval4 P P s Q P [11] eval4 eval5 bisimulation 7.2 ( ). t eval4 eval5 ( t eval4 v 4 eval5 v 5 v 4 = s v 5 ) Biernacka [4] Danvy [7] shift/reset eval5
8 8.1 eval5 c e (10 ) c list eval6 CApp1 1 (* *) 2 type v = VFun of string * t * e 3 VCont of ( c list ) * s 4 VEnv of e (* *) 5 and s = (* *) (* *) 6 and e = (* *) (* *) 7 (* *) 8 and c = CApp1 of t (* *) 9 CApp0 10 CShift 11 and d = (* *) CApp1 e VEnv(e) CApp1 eval6 1 (* cid : c list *) 2 (* did : d list *) 3 let cid = [] 4 let did = [] 5 6 (* eval : t * s * e * c list * d list -> v *) 7 let rec eval (t, s, e, c, d) = match t with 8 Var ( x) -> run_c (c, get (x, e) :: s, d) 9 Fun (x, t) -> run_c (c, VFun (x, t, e) :: s, d) 10 App (t0, t1) -> eval (t1, VEnv (e) :: s, e, CApp1 (t0) :: c, d) 11 Shift ( t) -> eval (t, s, e, CShift :: c, d) 12 Reset (t) -> eval (t, [], e, CReset :: [], DRun (c, s) :: d) 13 14 (* run_c : c list * s * d -> v *) 15 and run_c (c, s, d) = match c with 16 CApp1 (t ) :: c -> 17 ( match s with 18 v :: VEnv (e ) :: s -> eval (t, v :: s, e, CApp0 :: c, d)) 19 CApp0 :: c -> 20 ( match s with 21 VFun (x, t, e ) :: v :: s -> eval (t, s, (x, v ) :: e, c, d) 22 VCont (c, s ) :: v :: s -> run_c (c, v :: s, DRun (c, s ) :: d)) 23 CShift :: c -> 24 ( match s with 25 VFun (x, t, e ) :: s 26 -> eval (t, [], (x, VCont (c, s )) :: e, CReset :: [], d) 27 VCont (c, s ) :: s -> run_c (c, VCont (c, s ) :: s, d)) 28 CReset :: _ -> run_d (d, s) 29 30 (* run_d : d list * s -> v *) 31 and run_d (d, s) = match (d, s) with 32 ( DRun (c, s ) :: d, v :: s ) -> run_c (c, v :: s, d ) 33 ( DReset :: _, v :: s ) -> v 34 35 (* eval6 : t -> v *) 36 let eval6 t = eval (t, [], [], cid, did ) App 10 VEnv t1
t1 CApp1(t0) t1 16 18 (t) 8.2 eval5 eval, run c, run d run d t, s, e, c, d, c, s, d, d, s, v eval5 7.2 eval6 t, s, e, c, d, c, s, d, d, s, v 4 t t, [], [], [], [] Var(x), s, e, c, d c, get(x, e) :: s, d Fun(x, t), s, e, c, d c, VFun(x, t, e) :: s, d App(t0, t1), s, e, c, d t1, VEnv(e) :: s, e, CApp1(t0) :: c, d Shift(t), s, e, c, d t, s, e, CShift :: c, d Reset(t), s, e, c, d t, [], e, [], DRun(c, s) :: d CApp1(t) :: c, v :: VEnv(e) :: s, d t, v :: s, e, CApp0 :: c, d CApp0 :: c, VFun(x, t, e) :: v :: s, d t, s, (x, v) :: e, c, d CApp0 :: c, VCont(c, s ) :: v :: s, d c, v :: s, DRun(c, s) :: d CShift :: c, VFun(x, t, e) :: s, d t, [], (x, VCont(c, s)) :: e, [], d CShift :: c, VCont(c, s ) :: s, d c, VCont(c, s) :: s, d [], s, d d, s DRun(c, s ) :: d, v :: s c, v :: s, d [], v :: s v 4: eval6 bisimulation eval5 eval6 eval5 c eval6 eval5 s 5, c 5, eval6 s 6, c 6 c 5 s 6, c 6 s 5 c 5 = e s 6 c 6 = e eval5 eval6 8.1 ( = e ). eval5 S 5 eval6 S 6 t, s 5, e 5, c 5, d 5 S 5, c 5, v 5 :: s 5, d 5 S 5, t, s 6, e 6, c 6, d 6 S 6, c 6, v 6 :: s 6, d 6 S 6 = e (i) s 5 = [], c 5 = [], s 6 = [], c 6 = [] s 5 c 5 = e s 6 c 6 (ii) s 5 c 5 = e s 6 c 6 e 5 = e e 6 c 5 = CApp1 5 (t, e 5 ) :: c 5, c 6 = CApp1 6 (t) :: c 6 s 5 c 5 = e (VEnv(e 6 ) :: s 6 ) c 6 (iii) s 5 c 5 = e s 6 c 6 c 5 = CApp0 5 :: c 5, c 6 = CApp0 6 :: c 6 (v 5 :: s 5 ) c 5 = e (v 6 :: s 6 ) c 6
(iv) s 5 c 5 = e s 6 c 6 c 5 = CShift 5 :: c 5, c 6 = CShift 6 :: c 6 s 5 c 5 = e s 6 c 6 s 5 c 5 = e s 6 c 6 VCont 5 (c 5, s 5 ) = e VCont 6 (c 6, s 6 ), DRun 5 (c 5, s 5 ) = e DRun 6 (c 6, s 6 ) = e 8.1 (ii) c 5 CApp1 5 (t, e 5 ) c 6 CApp1 6 (t) VEnv(e 6 ) s 6 = e eval5 eval6 bisimulation 8.1 ( bisimulation). s 5 c 5 = e s 6 c 6, e 5 = e e 6, d 5 = e d 6, v 5 = e v 6 t, s 5, e 5, c 5, d 5 e t, s 6, e 6, c 6, d 6 s 5 c 5 = e s 6 c 6, d 5 = e d 6, v 5 = e v 6 c 5, v 5 :: s 5, d 5 e c 6, v 6 :: s 6, d 6 d 5 = e d 6, v 5 = e v 6 d 5, v 5 :: s 5 e d 6, v 6 :: s 6 v 5 = e v 6 v 5 e v 6 e bisimulation. P S 5, Q S 6 P s Q P eval5 P Q eval6 Q P s Q Q Q eval6 Q P eval5 P P s Q P 7.1 [11] eval5 eval6 bisimulation 8.2 ( ). t eval5 eval6 ( t eval5 v 5 eval6 v 6 v 5 = e v 6 ) CPS 3 Danvy shift/reset 9 eval6 4 t, s, e, c, d Landin SECD [12] shift/reset t1 t0
t1 shift/reset s@d ( s d append ) @ shift reset CShift VCont [13] shift shift/reset shift s v v VCont(c, s) VCont index 10 shift/reset CPS CPS t, s, e, c, d shift/reset Landin SECD shift/reset shift/reset shift reset shift/reset shift/reset Ager [1] i i shift/reset shift/reset [1] M. S. Ager, D. Biernacki, O. Danvy, and J. Midtgaard: From Interpreter to Compiler and Virtual Machine: A Functional Derivation, Technical Report RS-03-14, BRICS, Aarhus, Denmark (March 2003).
[2] M. S. Ager, D. Biernacki, O. Danvy, and J. Midtgaard: A Functional Correspondence between Evaluators and Abstract Machines, Technical Report RS-03-13, BRICS, Aarhus, Denmark (March 2003). [3] K. Asai, and Y. Kameyama: Polymorphic Delimited Continuations, Proceedings of the Fifth Asian Symposium on Programming Languages and Systems (APLAS 07), LNCS 4807, pp. 239 254 (November 2007). [4] M. Biernacka, D. Biernacki, and O. Danvy An Operational Foundation for Deliminated Continuations in the CPS Hierarchy, Logical Methods in Computer Science, Vol. 1 (2:5), pp. 1-39 (November 2005). [5] O. Danvy, and A. Filinski: A Functional Abstraction of Typed Contexts, Technical Report 89/12, DIKU, University of Copenhagen (July 1989). [6] O. Danvy, and A. Filinski: Abstracting Control, Proceedings of the 1990 ACM Conference on Lisp and Functional Programming, pp. 151 160 (June 1990). [7] O. Danvy, and K. Millikin: A Rational Deconstruction of Landin s J Operator, Technical Report RS- 06-17, BRICS, Aarhus, Denmark (December 2006). [8] M. Felleisen: The Theory and Practice of First-Class Prompts, Conference Record of the 15th Annual ACM Symposium on Principles of Programming Languages, pp. 180 190 (January 1988). [9] A. Filinski: Representing Monads, Conference Record of the 21st Annual ACM Symposium on Principles of Programming Languages, pp. 446 457 (January 1994). [10] A. Igarashi and M. Iwaki: Deriving Compilers and Virtual Machines for a Multi-Level Languages, Proceedings of the Fifth Asian Symposium on Programming Languages and Systems (APLAS 07), LNCS 4807, pp. 206 221 (November 2007). [11] OCHA-IS 08-3 (February 2009). [12] P. J. Landin: The mechanical evaluation of expressions, The Computer Journal, Vol. 6, No. 4, pp. 308 320, (1964). [13] MinCaml shift/reset 11 (March 2009). [14] R. Milner: Communication and Concurrency Prentice Hall International Series in Computer Science, (1995). [15] G. D. Plotkin: Call-by-name, call-by-value, and the λ-calculus, Theoretical Computer Science, Vol. 1, No. 2, pp. 125 159 (December 1975). [16] J. C. Reynolds: Definitional Interpreters for Higher-Order Programming Languages, Proceedings of the ACM National Conference, Vol. 2, pp. 717 740, (August 1972), reprinted in Higher-Order and Symbolic Computation, Vol. 11, No. 4, pp. 363 397, Kluwer Academic Publishers (December 1998). [17] M. Sperber, R. K. Dybvig, M. Flatt, A. van Straaten: Revised 6 report on the algorithmic language Scheme, http://www.r6rs.org/ (2007).