継続計算に対する仮想機械の導出 定理証明系Coqを使った各種継続計算の性質の証明 対称 λ 計算 shift/resetを含む部分評価器の実装 MinCamlコンパイラ,Caml Lightにおけるshift/resetの実装 証明木(ほか)の可視化 お茶大情報科学科の時間割自動作成 『四則演算インタプリタを作ろう!』 四則演算インタープリタをつくりましょう 末尾呼び出し(tail call)と継続渡し形式(Continuation Passing Style) lexer(字句解析器)と parser(構文解析器)の作成 (サンプルコード) 局所変数の導入 関数(closure)の追加 大域脱出(exit)の追加 再帰関数の追加 FelleisenのCオペレータ リストの追加 Promptの導入 control/prompt から shift/reset への拡張 対称 λ 計算 Coq
第二回 「末尾呼び出し(tail call)と継続渡し形式(Continuation Passing Style)」 継続とは何ぞということをなんとなくでもいいので把握しておきましょう! というのが今回の内容です。 (継続の話に入る前に、まずは末尾呼び出しの話をします。) 階乗を求める関数 fac は次のように書けます。 let rec fac n = if n = 0 then 1 else n * fac (n - 1) これを実行、例えば fac 3 等とすると、 fac 3 -> 3 * fac 2 -> 3 * (2 * fac 1) -> 3 * (2 * (1 * fac 0)) -> 3 * (2 * (1 * 1)) -> 3 * (2 * 1) -> 3 * 2 -> 6 といった感じで計算が進みます。 このプログラムは再帰の度にスタックを使っています。 つまり、fac
Introduction to Delimited Continuations Typing Printf Printf Kenichi Asai Ochanomizu University April 13, 2008 Outline of the talk ◮ times (introduction) (1) in Direct Style with exception (2) in Continuation-Passing Style (CPS) ◮ sprintf (3) in Continuation-Passing Style (CPS) (4) in Direct Style with shift/reset ◮ Related Work / Summary (1) Times: Direct Style Multiply elements of a given list:
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く