Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ラムダ計算に基づいた純粋関数型言語の実装~ラスト~ #TechLunch
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Livesense Inc.
PRO
April 23, 2014
Technology
200
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ラムダ計算に基づいた純粋関数型言語の実装~ラスト~ #TechLunch
20110713(水) @ Livesense TechLunch
発表者:塩足 拓也
Livesense Inc.
PRO
April 23, 2014
Transcript
16 slides
ラムダ計算に基づいた純粋関数型 言語の実装 2011/07/13 Takuya Shiotari ~ラスト~
Agenda Review(Digest) • Lambda Calculus • Bound Variable and
Free Variable • Reduction Rule Definition • Beta Reduction • Alpha conversion Implementation
Review(Lambda calculus) 関数の定義と実行を抽象化した計算モデル <expr> ::= <identifier> | (“λ” <identifier> “.”
<expr>) | (<expr> <expr>) 変数 ラムダ抽象 関数適用
Review(Bound Variable and Free Variable) 束縛変数(Bound Variable) ラムダ抽象によって束縛(bound)された変数 自由変数(Free Variable)
ラムダ抽象によって束縛(bound)されていない変数 FV(x) = {x}, where x is a variable FV(λx.M) = FV(M) \ {x} FV(M N) = FV(M) ∪ FV(N)
Review(Reduction Rule) α-conversion β-reduction 束縛変数は自由変数やその他の束縛変数と重複しないように名前 を書き換える ラムダ計算の式を実行すること
Definition • 構文だけ定義しても意味が無い • それが何を意味するかを定義する必要がある
Definition(Beta Reduction) 関数λx.M1に引数M2を適用したら、、、 (λx.M1) M2 → [M2/x]M1 まず、xにM2が代入され、、、 それから関数の中身であるM1が実行されるはず Definition
(R-Beta)
Definition(Beta Reduction) Example 1. (λx.x) y → [y/x] x →
y 2. (λx.λy.x) z → [z/x] λy.x → λy.z 3. (λx.x)(λy.y) → [λy.y/x] x → λy.y 4. (λa.b)cd → ?
Definition(Beta Reduction) M1 → M1' M1 M2 → M1' M2 Definition
(R-App1) R-Betaは適用される関数がλ抽象の形になっているこ とを要求 今回は適用される関数が(λa.b)cという関数適用の形 をしている そこで、また新たな変換規則を導入、、、
Definition(Beta Reduction) (λa.b)cd → (λa.b)c → [c/a] b → b
R-Beta (λa.b)cd → bd R-App1 bd →
Definition(Beta Reduction) M2 → M2' M1 M2 → M1 M2' Definition
(R-App2) 同様の理由で関数適用M1 M2において引数M2 を簡約する規則も必要
Definition(Beta Reduction) Question? λ抽象λx.eにおいてeを簡約する、以下の規 則は必要? M → M' λx.M → λx.M'
Definition (R-Abs)
Definition(Alpha Conversion) (λx.λy.xy)y → [y/x] λy.xy → λy.y y •
1番目・2番目のyと3番目のyは別々の変数 • 別々の変数なのに同一視してしまったため、誤った簡約 を行ってしまった • 1番目・2番目のyは仮引数なので、名前は何でも良い (置き換え可能) • 簡約する前に、名前を置き換える (λx.λy.xy)y → (λx.λy'.xy')y → λy'.y y' この名前置き換えのことをα変換という
Definition(Alpha Conversion) [M2/x] y = [M2/x] (λy.M) = λy'.[M2/x]([y'/y] M)
[M2/x] (M M') = ([M2/x] e) ([M2 / x] M') Definition M2 (x == y)の場合 y (x != y)の場合
Implementation そーす
Next Time...
More Decks by Livesense Inc.
See All by Livesense Inc.
新規商品の開発におけるAIの活用 〜挑戦は人間にしかできない〜
livesense
PRO
0
35
味覇で作るパスタが美味い - 20261001_yabaubuki.dev
livesense
PRO
0
210
Rubyはただの⾔語に⾮ず
livesense
PRO
0
620
28新卒_Webエンジニア職採用_会社説明資料
livesense
PRO
0
190
27新卒_総合職採用_会社説明資料
livesense
PRO
0
7.9k
27新卒_Webエンジニア職採用_会社説明資料
livesense
PRO
0
13k
株式会社リブセンス・転職会議 採用候補者様向け資料
livesense
PRO
0
620
株式会社リブセンス 会社説明資料(報道関係者様向け)
livesense
PRO
1
1.8k
データ基盤の負債解消のためのリプレイス
livesense
PRO
0
750
Other Decks in Technology
See All in Technology
メディアアートを〈拡張〉する——器官学と個体化論を手がかりに
_kotobuki_
0
260
AWS Blocksで AIエージェント作れるの知ってます?
kmiya84377
1
170
RAGの改善を速く回すための評価基盤
yosukeyoshida
6
3.6k
Agent Routerで作るマルチテナント 推論基盤 #CNDW2026 / Building Multi-Tenant Inference Platform with Agent Router #CNDW2026
everpeace
5
610
Webメール開発を大幅に変えたJMAPというゲームチェンジャー
tascript
5
2k
Well, that’s weird…
csswizardry
1
210
AWS Well-Arhitected Frameworkセキュリティの柱 について
miu_crescent
PRO
2
260
PHPで家庭用ゲーム機の専用コントローラーをMIDIデバイスとして扱ってみる
wind111
0
200
クラウドでも使えるNetApp -現場目線での設計とクラウドバックアップの活用
ryutakondo
1
330
常時稼働エージェントの作り方(Claude公式ブログを資料化)
minorun365
PRO
20
29k
AIエージェントのアーキテクチャ設計
nsatoh
0
550
信頼性を犠牲にせず、PR マージからデプロイまで人の介入を完全にゼロにするまでの道のり
knwoop
4
2.1k
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
210k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
RailsConf 2023
tenderlove
30
1.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
470
Odyssey Design
rkendrick25
PRO
3
970
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7.1k
The Pragmatic Product Professional
lauravandoore
37
7.5k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
570
The Cult of Friendly URLs
andyhume
79
7.1k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.5k