$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
不動点コンビネータって何ぞ #TechLunch
Search
Livesense Inc.
PRO
April 23, 2014
Technology
0
160
不動点コンビネータって何ぞ #TechLunch
2012/02/15(水) @ Livesense TechLunch
発表者:春日 太志
Livesense Inc.
PRO
April 23, 2014
Tweet
Share
More Decks by Livesense Inc.
See All by Livesense Inc.
27新卒_総合職採用_会社説明資料
livesense
PRO
0
1.5k
27新卒_Webエンジニア職採用_会社説明資料
livesense
PRO
0
5.3k
株式会社リブセンス・転職会議 採用候補者様向け資料
livesense
PRO
0
130
株式会社リブセンス 会社説明資料(報道関係者様向け)
livesense
PRO
0
1.6k
データ基盤の負債解消のためのリプレイス
livesense
PRO
0
510
26新卒_総合職採用_会社説明資料
livesense
PRO
0
12k
株式会社リブセンス会社紹介資料 / Invent the next common.
livesense
PRO
2
48k
26新卒_Webエンジニア職採用_会社説明資料
livesense
PRO
1
13k
中途セールス職_会社説明資料
livesense
PRO
0
280
Other Decks in Technology
See All in Technology
たまに起きる外部サービスの障害に備えたり備えなかったりする話
egmc
0
380
AWSの新機能をフル活用した「re:Inventエージェント」開発秘話
minorun365
2
370
まだ間に合う! Agentic AI on AWSの現在地をやさしく一挙おさらい
minorun365
17
2.3k
1人1サービス開発しているチームでのClaudeCodeの使い方
noayaoshiro
2
560
2025年 開発生産「可能」性向上報告 サイロ解消からチームが能動性を獲得するまで/ 20251216 Naoki Takahashi
shift_evolve
PRO
2
210
Agent Skillsがハーネスの垣根を超える日
gotalab555
5
3.5k
Knowledge Work の AI Backend
kworkdev
PRO
0
110
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
2
180
アプリにAIを正しく組み込むための アーキテクチャ── 国産LLMの現実と実践
kohju
0
190
マイクロサービスへの5年間 ぶっちゃけ何をしてどうなったか
joker1007
18
7.4k
Building Serverless AI Memory with Mastra × AWS
vvatanabe
0
320
Featured
See All Featured
Designing for Performance
lara
610
69k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
65
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
160
We Are The Robots
honzajavorek
0
120
WCS-LA-2024
lcolladotor
0
380
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
0
290
Producing Creativity
orderedlist
PRO
348
40k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
1.9k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
0
250
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
41
Building an army of robots
kneath
306
46k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Transcript
@bar_̲row 2012年年02⽉月15⽇日 不不動点コンビネータ って何ぞ? Livesense Inc. 1
⽬目次 Livesense Inc. 2 1. 解説ブログ記事の紹介 2. 呼び⽅方⼀一覧 3. 不不動点とは
4. 不不動点コンビネータとは 5. Y-‐‑‒Combinator とは 6. Y-‐‑‒Combinator を Common Lisp で
1-‐‑‒1. 解説ブログ記事の紹介 Livesense Inc. 3 Y コンビネータって何? -‐‑‒IT戦記-‐‑‒ id:amachang http://d.hatena.ne.jp/amachang/20080124/1201199469
TuringとChurchの狭間で -‐‑‒404 Blog Not Found-‐‑‒ @dankogai http://blog.livedoor.jp/dankogai/archives/50458503.html
1-‐‑‒2. 解説ブログの紹介 Livesense Inc. 4 ラムダ計算とチューリングマシンの違い –きしだのはてな-‐‑‒ id:nowokay http://d.hatena.ne.jp/nowokay/20090413
2. 呼び⽅方⼀一覧 Livesense Inc. 5 ・不不動点コンビネータ ・不不動点結合⼦子(fixed point combinator) ・不不動点演算⼦子(fixed
point operator) ・パラドキシカル結合⼦子(paradoxical combinator)
3. 不不動点とは Livesense Inc. 6 0と1は f(x) = x^2 の不不動点
f(x) = x を満たす x ⼀一階関数の不不動点は第⼀一級値 first-‐‑‒order function first-‐‑‒class value ⾼高階関数の不不動点は関数
4. 不不動点コンビネータとは Livesense Inc. 7 関数の不不動点を求める⾼高階関数 任意の関数fの不不動点pを返す関数g p = g(f)
f(p) = p f(g(f)) = g(f)
5-‐‑‒1. Y-‐‑‒Combinator とは Livesense Inc. 8 型なしラムダ計算の不不動点コンビネータの⼀一つ Haskell Brooks Curry
1900/09/12 – 1982/09/01 Y Combinator LLC ある関数を与えるとそれを再帰する関数を返す関数
5-‐‑‒2. Y-‐‑‒Combinator とは Livesense Inc. 9 Y g = (λf.(λx.f(x
x))(λx.f(x x))) g = (λx.g(x x))(λx.g(x x)) = (λy.g(y y))(λx.g(x x)) = g((λx.g(x x))(λx.g(x x))) = g(Y g) Y = λf.(λx.f(x x))(λx.f(x x))
6-‐‑‒1. Y-‐‑‒Combinator を Common Lisp で Livesense Inc. 10 //
֊Λฦ͢ Javascript ؔྫʢ෭࡞༻͋Γʣ var hoge = function (n) { return (n == 1) ? 1 : n * arguments.callee(n - 1); }; hoge(3); // => 6 var fuga = function f(n) { return (n == 1) ? 1 : n * f(n - 1); }; fuga(3); // => 6
6-‐‑‒2. Y-‐‑‒Combinator を Common Lisp で Livesense Inc. 11 //
Javascript Ͱ࣮ͨ͠ Y Combinator var Y = function (f) { return (function (g) { return function (m) { return f(g(g))(m); }; })(function (g) { return function (m) { return f(g(g))(m); }; }); };
6-‐‑‒3. Y-‐‑‒Combinator を Common Lisp で Livesense Inc. 12 //
֊ܭࢉͰ Y Combinator Λ͏ Y(function (fact) { return function (n) { return (n == 1) ? 1 : n * fact(n - 1); }; })(3); // => 6 // Y-Combinator ؔΛҾͰͤΔΑ͏ʹϥοϓ͢Εɺ // ແ໊͚ؔͩͰಈ͘͜ͱʹͳΓ·͢ɻ
6-‐‑‒4. Y-‐‑‒Combinator を Common Lisp で Livesense Inc. 13 ;
֊Λฦ͢ (defun fact (n) (if (= n 1) 1 (* n (fact (- n 1))))) これを無名再帰まで持っていく...
6-‐‑‒5. Y-‐‑‒Combinator を Common Lisp で Livesense Inc. 14 ;
֊Λฦ͢ (funcall ((lambda (f) ((lambda (g) (lambda (m) (funcall (funcall f (funcall g g)) m))) (lambda (g) (lambda (m) (funcall (funcall f (funcall g g)) m))))) (lambda (fact) (lambda (n) (if (= n 1) 1 (* n (funcall fact (- n 1))))))) 3)