Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PPL2016-9-3
Search
Kyoko KADOWAKI
March 08, 2016
Science
0
540
PPL2016-9-3
Agda による定式化された型推論器の拡張と改良
Kyoko KADOWAKI
March 08, 2016
Tweet
Share
Other Decks in Science
See All in Science
240510 COGNAC LabChat
kazh
0
130
Transformers are Universal in Context Learners
gpeyre
0
490
LIMEを用いた判断根拠の可視化
kentaitakura
0
320
Machine Learning for Materials (Lecture 5)
aronwalsh
0
660
All-in-One Bioinformatics Platform Realized with Snowflake ~ From In Silico Drug Discovery, Disease Variant Analysis, to Single-Cell RNA-seq
ktatsuya
0
220
Machine Learning for Materials (Lecture 9)
aronwalsh
0
200
Science of Scienceおよび科学計量学に関する研究論文の俯瞰可視化_LT版
hayataka88
0
900
General Parasitology
uni_of_nomi
0
120
Science of Scienceおよび科学計量学に関する研究論文の俯瞰可視化_ポスター版
hayataka88
0
120
非同期コミュニケーションの構造 -チャットツールを用いた組織における情報の流れの設計について-
koisono
0
130
Machine Learning for Materials (Lecture 2)
aronwalsh
0
710
ベイズのはなし
techmathproject
0
270
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
Building Your Own Lightsaber
phodgson
102
6k
GraphQLの誤解/rethinking-graphql
sonatard
66
9.9k
Making the Leap to Tech Lead
cromwellryan
132
8.9k
Teambox: Starting and Learning
jrom
132
8.7k
Happy Clients
brianwarren
97
6.7k
What's in a price? How to price your products and services
michaelherold
243
12k
Speed Design
sergeychernyshev
24
570
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
790
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Thoughts on Productivity
jonyablonski
67
4.3k
Transcript
Agda ʹΑΔఆࣜԽ͞Εͨܕਪ ثͷ֦ுͱվྑ ͓ͷਫঁࢠେֶɹ߳ࢠɹઙҪ݈Ұ
1͡Ίʹ •ݚڀ֓ཁ •ݚڀഎܠ •ຊݚڀͷߩݙ •ൃදͷྲྀΕ
ݚڀ֓ཁ w"HEBΛ༻͍ͯɺఆࣜԽ͞ΕͨܕਪثʹHFOFSJD QSPHSBNNJOHෆ੍ࣜͳͲͷςΫχοΫΛ༻ ͍ͯɺ࣮Λ؆໌ʹ͠ɺߏจͷ֦ுΛ؆୯ʹͨ͠ wHFOFSJDQSPHSBNNJOH wෆ੍ࣜ
Agda ʹ͍ͭͯ wґଘܕΛ༻͍Δ͜ͱͷͰ͖Δɺఆཧূ໌ࢧԉγες Ϝ͓Αͼϓϩάϥϛϯάݴޠ w)BTLFMMͳͲʹจ๏͕ࣅ͍ͯΔ
ґଘܕ(Dependent Types) wʹґଘ͢ΔܕΛͭ͘Δ͜ͱ͕Ͱ͖Δܕ wྫ7FDOܕ OJOUܕͷ ͕͞OͷϕΫτϧΛ ܕͷϨϕϧͰ දݱ͍ͯ͠Δ wྫ͑ɺ0$BNMͷϦετͰ͕͞ܕϨϕϧͰࢦ
ఆͰ͖ͳ͍ MFOHUIؔͳͲͰऔΓग़͢͜ͱ͕ඞཁ
ఆࣜԽ ೖྗʢܕແ͠ݴޠʣ ग़ྗʢܕ͖ݴޠʣ ܕਪ n = 1 let f x
= match x with 0 -> “zero” | _ -> “not zero” n : int n = 1 f : int -> string f x = match x with …
ܕ ఆࣜԽ ೖྗʢܕແ͠ݴޠʣ ग़ྗʢܕ͖ݴޠʣ ܕਪ n : int f :
int -> string
ܕ ఆࣜԽ ೖྗʢܕແ͠ݴޠʣ ग़ྗʢܕ͖ݴޠʣ ܕਪ n : int f :
int -> string ݕূػߏ νΣοΫ ᶃ
ఆࣜԽ ೖྗʢܕແ͠ݴޠʣ ग़ྗʢܕ͖ݴޠʣ ܕਪ ܕΛফڈ ܕແ͠ݴޠ ಉ͡Ͱ͋Δ͜ͱΛอূ͢Δ
ݚڀഎܠ wܕਪΛ͢ΔʹVOJpDBUJPOͷػߏ͕ඞཁ͕ͩɺ ී௨ʹ࣮͢Δͱมͷॻ͖͑ͳͲ͕ඞཁͰɺ "HEBͰͰ͖ͳ͍ wͦ͜Ͱ.D#SJEFܕมͷΛົʹཧ͢Δܗ ͰVOJpDBUJPOͷػߏΛQVSFGVODUJPOBMʹ࣮ݱͨ͠ w͜ΕʹΑΓɺ"HEBͰܕਪثΛͭ͘Δ͕ग़དྷ ͨ
ຊݚڀͷߩݙ w.D#SJEF͕ࣔͨ͠VOJpDBUJPOͷػߏ<.D#SJEF >Λ֦ு͠ɺ୯ ҰԽͰ͖͍ͯΔূ໌ฦ͢ܗͰఆࣜԽͨ͠ʢ11-ʣ w͜ͷVOJpDBUJPOͷػߏΛͱʹͯ͠ɺ"HEBͰఆࣜԽ͞Εͨܕਪث Λ࣮ͨ͠ʢ11-ʣ w͜ͷܕਪثʹෆ੍ࣜΛಋೖ͢Δ͜ͱͰܕมΛࢦఆ͢Δͷ Έͷ࣮ΑΓ؆୯ʹ࣮͢Δํ๏Λࣔ͠ɺͦΕΛܕنଇͷܗͰఆ ࣜԽͨ͠ wVOJpDBUJPOͷػߏΛHFOFSJDQSPHSBNNJOHʹΑΓҙͷܕʹ
֦ு͠ɺܕͷ֦ுΛ؆୯ʹͨ͠ wܕਪͷ݁ՌɺಘΒΕͨܕ͖߲͔ΒܕΛऔΓআ͘ͱݩͷ߲͕ಘ ΒΕΔ͜ͱূ໌ͨ͠ wܕਪͷ֦ுͷྫͱͯ͠ɺΛಋೖͨ͠
ࠓͷίϯςϯπ ͡Ίʹ VOJpDBUJPO ܕఆٛ HFOFSJDQSPHSBNNJOHͱෆ੍ࣜ ܕਪ ·ͱΊ
2 unification •McBrideʹΑΔख๏ •unificationͷఆࣜԽ
McBride ʹΑΔ unification ͷػߏ McBrideɺܕมΛ༗ݶू߹Ͱදݱ͢Δख๏Ͱఀࢭੑ͕໌ Β͔ͳ unificationΛ࣮ݱͨ͠ ܕН B B
B N ܕมͷू߹ ࠷େͰNݸ ༗ݶू߹ pOJUFTFU N
McBride ʹΑΔ unification ͷػߏ ܕН B JOU B
N N ܕมೖʹΑΓ۩ମԽʢ۩ମతͳܕʹͳΔʣՄೳੑ͕͋Δ
ܕUBˠ BˠB B B B ܕUBˠ BˠJOU B
JOU B
ܕUBˠ BˠB B B B ܕUBˠ BˠJOU B
JOU B VOJpDBUJPO BJOU B JOU B
ܕUBˠ BˠB B B B ܕUBˠ BˠJOU B
JOU B VOJpDBUJPO BJOU B JOU B ❌ ۩ମԽ͞ΕͨܕΛू߹͔Βআ
ܕUBˠ BˠB B B B ܕUBˠ BˠJOU B
JOU B VOJpDBUJPO BJOU B B Bˠ BˠJOU ܕมͷ͕͔֬ʹݮ͍ͬͯΔ
ܕUBˠ BˠB B B B ܕUBˠ BˠJOU B
JOU B VOJpDBUJPO BJOU B B Bˠ BˠJOU ܕมͷ͕͔֬ʹݮ͍ͬͯΔ ܕม͕۩ମԽ͞ΕΔͨͼʹɺ۩ମԽ͞Ε͍ͯͳ͍ܕมͷ ͕ͻͱͭݮΔ
ܕUBˠ BˠB B B B ܕUBˠ BˠJOU B
JOU B VOJpDBUJPO BJOU B B Bˠ BˠJOU ܕมͷ͕͔֬ʹݮ͍ͬͯΔ ܕม͕۩ମԽ͞ΕΔͨͼʹɺ۩ମԽ͞Ε͍ͯͳ͍ܕมͷ ͕ͻͱͭݮΔ ఀࢭੑ͕໌Β͔
unificationͷఆࣜԽ wઌ΄Ͳࣔͨ͠ख๏ͰɺVOJpDBUJPOΛ"HEB্Ͱ࣮Ͱ͖ͨ wܕਪثΛఆࣜԽ͢Δʹz͔֬ʹVOJGZ͞Ε͍ͯΔzূ໌ Λฦ͢͜ͱඞཁ ɹࣜʹ͢ΔͱTVCTUМUTVCTUМU ʮೖͨ͠ޙͷܕ͕͔֬ʹಉҰʯ wVOJpDBUJPOͷؔΛ֦ுͯ͠ɺ͜ͷূ໌Λฦ͢Α͏ʹ͠ ͨʢ11-ʣ
3 ܕఆٛ •ܕɺܕஅɺ߲ •ຊݚڀʹ͓͚Δಛघͳදݱ
ܕఆٛ ߲
ܕఆٛ ߲ N൪ͷܕม ؔܕ
ܕఆٛ ߲ ม ϥϜμந ؔద༻
ܕஅ ਪنଇ
ܕஅ ਪنଇ ʮܕڥϵͷͱͰɺ߲.ͷܕНʹͳΔʯ
ܕஅ ਪنଇ
ܕਪͷಛघͳදݱ ܕΛܭࢉͯ͠ग़ྗ͢ΔͨΊͷنଇ
ܕਪͷಛघͳදݱ ೖྗ ग़ྗ
ܕਪͷಛघͳදݱ ᶃ߲.ͱ ܕมΛ࠷େͰNݸͭܕڥϵ͕ೖྗ͞ΕΔ
ܕਪͷಛघͳදݱ ᶄ৽͍͠ܕม͕ܕਪதʹN``NݸׂΓͯΒΕΔ
ܕਪͷಛघͳදݱ ᶅܕมͷΛN`ݸ·ͰݮΒ͢ೖ͕ಘΒΕΔ
ܕਪͷಛघͳදݱ ᶇܕมͷ͕N`·ͰݮͬͨܕН͕ฦͬͯ͘Δ
unification ͷಛघͳදݱ ܕНͱНΛಉ͡ʹ͢Δ VOJGZ͢Δ ೖМΛಘΔ
unification ͷಛघͳදݱ ೖྗ ग़ྗ
unification ͷಛघͳදݱ ܕมΛ࠷େͰN``ݸ࣋ͭܕН ͱН ܕมΛN``ݸ͔ΒN`ݸ·ͰݮΒ͢ೖМʹΑͬͯ VOJpDBUJPO ୯ҰԽ ͞ΕΔ
4 generic programmingͱ ෆ੍ࣜ •generic programming •ෆ੍ࣜ
generic programming wී௨ܕΛίϯετϥΫλͰఆٛ͢Δ w͜ͷ߹ɺܕΛૢ࡞͢Δؔʹ͓͍ͯɺܕΛ࠶࣮͢Δͨ ͼʹύλʔϯϚονΛ࠶࣮͢Δඞཁ͕͋Δ wܕΛHFOFSJDʹੜ͢Δ͜ͱͰɺύλʔϯϚονͷ࠶࣮ Λආ͚ɺϢʔβ͕ࢦఆͨ͠ҙͷܕΛ࠶࣮ͳ͘ਪͰ͖ ΔΑ͏ʹͳΔ wຊݚڀͰɺ3FHVMBS</PPSUΒ >ΛݩʹHFOFSJDͳ
ܕΛ࣮ͨ͠
generic programming ͷߏจ $POT 'TU 4OE Λ૿͍ͨ͠ͱ͖ɺ ੵܕΛՃ͢Δඞཁ͕༗Δ
generic programming ͜ͷΑ͏ʹܕΛ૿ͯ͠ɺ VOJpDBUJPOܕʹؔ͢Δิͷ࣮Λมߋ͢Δඞཁ͕ͳ͍
generic programming ߏจΛ૿͢ͱ͖ɺ ߏจͦͷͷͷܕਪʹूதͰ͖Δ
generic programming ܕΛ#/'ͷΑ͏ͳܗͰදݱ͢Δ
generic programming ܕΛ#/'ͷΑ͏ͳܗͰදݱ͢Δ
generic programming ܕΛ#/'ͷΑ͏ͳܗͰදݱ͢Δ
generic programming ܕΛ#/'ͷΑ͏ͳܗͰදݱ͢Δ
generic programming ܕΛ#/'ͷΑ͏ͳܗͰදݱ͢Δ
generic programming ܕΛ#/'ͷΑ͏ͳܗͰදݱ͢Δ ͜ΕͰɺܕͷදݱ͕Ͱ͖ͨ
generic programming ۩ମతͳܕͷදݱ
generic programming දݱͷҙຯΛ༩͍͑ͯΔ
generic programming ࣗࣗΛ༩͑Δ͜ͱͰ࠶ؼ͢Δ
generic programming ࠶ؼΛด͡ΔͨΊͷܕ
generic programming ࠶ؼΛด͡ΔͨΊͷܕ
generic programming ࠶ؼΛด͡ΔͨΊͷܕ
generic programming ҙʹେ͖͍ܕΛදݱͰ͖Δ
ෆ੍ࣜ ܕਪΛ࣮͢ΔࡍɺҎલN``ΛݫີʹܕʹΈ ࠐΜͰ͍ͨ
ෆ੍ࣜ ͨͱ͑-BNTΛܕਪ͢Δͱ͖ N``/BU N``DPVOUT ϵ`$YUN`` ϵʜ
ෆ੍ࣜ ͨͱ͑-BNTΛܕਪ͢Δͱ͖ N``JOU N``DPVOUT ϵ`$YUN`` ϵʜ ܕͷϨϕϧͰܕΛ߹Θͤͯূ໌͠ͳ͍ͱ͍͚ͳ͘ͳΔ
ෆ੍ࣜ N``N≤N`Λຬ͍ͨͯ͠ΕΑ͘ɺ۩ମతͳ Ҏޙ࣋ͪา͘ඞཁ͕ͳ͍ ΘΓʹN≤N``ͱ͍͏ূ໌Λ࣋ͪา͘
5 ܕਪ • ؔఆٛ • ܕਪͷྫ - ؔద༻ -
ؔఆٛ ೖྗ TNݸͷܕมΛͭXFMMTDPQFEUFSN ϵܕڥ ग़ྗ N⒌⒌ N⒌ࣗવ N≤N⒌⒌N≤N⒌⒌Ͱ͋Δ͜ͱͷূ໌ МN⒌⒌ݸͷܕมΛ࣋ͭܕΛN⒌ݸͷܕมΛ࣋ͭܕʹ͢Δೖ Нਪ݁Ռͷܕ
Xਪ͞ΕͨXFMMUZQFEUFSNɻܕมΛN⒌ݸͭ FSBTFX㲇Tฦ͞ΕͨXFMMUZQFEUFSNT͔ΒܕใΛআͨ͠ͷ͕ɺ ͱͷXFMMTDPQFEUFSNͱ͍͠ͱ͍͏ূ໌ JOGFS
ؔఆٛ ೖྗ TNݸͷܕมΛͭXFMMTDPQFEUFSN ϵܕڥ .BZCF ग़ྗ N⒌⒌ N⒌ࣗવ N≤N⒌⒌N≤N⒌⒌Ͱ͋Δ͜ͱͷূ໌ МN⒌⒌ݸͷܕมΛ࣋ͭܕΛN⒌ݸͷܕมΛ࣋ͭܕʹ͢Δೖ
Нਪ݁Ռͷܕ Xਪ͞ΕͨXFMMUZQFEUFSNɻܕมΛN⒌ݸͭ FSBTFX㲇Tฦ͞ΕͨXFMMUZQFEUFSNT͔ΒܕใΛআͨ͠ͷ͕ɺ ͱͷXFMMTDPQFEUFSNͱ͍͠ͱ͍͏ূ໌ JOGFS
ؔఆٛ ೖྗ TNݸͷܕมΛͭXFMMTDPQFEUFSN ϵܕڥ .BZCF ग़ྗ N⒌⒌ N⒌ࣗવ N≤N⒌⒌N≤N⒌⒌Ͱ͋Δ͜ͱͷূ໌ МN⒌⒌ݸͷܕมΛ࣋ͭܕΛN⒌ݸͷܕมΛ࣋ͭܕʹ͢Δೖ
Нਪ݁Ռͷܕ Xਪ͞ΕͨXFMMUZQFEUFSNɻܕมΛN⒌ݸͭ FSBTFX㲇Tฦ͞ΕͨXFMMUZQFEUFSNT͔ΒܕใΛআͨ͠ͷ͕ɺ ͱͷXFMMTDPQFEUFSNͱ͍͠ͱ͍͏ূ໌ JOGFS OPUIJOH͕ฦΔܕΤϥʔͰ͋Δ
ؔఆٛ ίʔυͰ͜ͷΑ͏ʹͳΔʢࢀߟʣ
ܕਪͷྫ (App) "QQTTͷܕਪ TΛܕਪ͠ɺМͱНΛಘΔ ϵʹМΛࢪ্ͨ͠ͰTΛܕਪ͠ɺМͱНΛಘΔ ННˠЌ Ќ৽͍͠ܕม ͱͳΔΑ͏VOJGZ͠ ޭͨ͠ΒМΛಘΔ
ฦ͞ΕΔܕЌͱͳΔ
ܕਪͷྫ (App) "QQTTͷܕਪ TΛܕਪ͠ɺМͱНΛಘΔ ϵʹМΛࢪ্ͨ͠ͰTΛܕਪ͠ɺМͱНΛಘΔ ННˠЌ Ќ৽͍͠ܕม ͱͳΔΑ͏VOJGZ͠ ޭͨ͠ΒМΛಘΔ
ฦ͞ΕΔܕЌͱͳΔ
ܕਪͷྫ (App) "QQTTͷܕਪ TΛܕਪ͠ɺМͱНΛಘΔ ϵʹМΛࢪ্ͨ͠ͰTΛܕਪ͠ɺМͱНΛಘΔ ННˠЌ Ќ৽͍͠ܕม ͱͳΔΑ͏VOJGZ͠ ޭͨ͠ΒМΛಘΔ
ฦ͞ΕΔܕЌͱͳΔ
ܕਪͷྫ (App) "QQTTͷܕਪ TΛܕਪ͠ɺМͱНΛಘΔ ϵʹМΛࢪ্ͨ͠ͰTΛܕਪ͠ɺМͱНΛಘΔ ННˠЌ Ќ৽͍͠ܕม ͱͳΔΑ͏VOJGZ͠ ޭͨ͠ΒМΛಘΔ
ฦ͞ΕΔܕЌͱͳΔ
ܕਪͷྫ (App) TΛܕਪ͠ɺМͱНΛಘΔɻ ϵʹМΛࢪ্ͨ͠ͰTΛܕਪ͠ɺМͱНΛಘΔɻ
ܕਪͷྫ (App) TΛܕਪ͠ɺМͱНΛಘΔɻ ϵʹМΛࢪ্ͨ͠ͰTΛܕਪ͠ɺМͱНΛಘΔɻ
ܕਪͷྫ (App) TΛܕਪ͠ɺМͱНΛಘΔɻ ϵʹМΛࢪ্ͨ͠ͰTΛܕਪ͠ɺМͱНΛಘΔɻ
ܕਪͷྫ (App) ϵʹМΛࢪ্ͨ͠ͰTΛܕਪ͠ɺМͱНΛಘΔɻ ННˠЌ Ќ৽͍͠ܕม ͱͳΔΑ͏VOJGZ͠
ܕਪͷྫ (App) ϵʹМΛࢪ্ͨ͠ͰTΛܕਪ͠ɺМͱНΛಘΔɻ ННˠЌɹɹɹɹͱͳΔΑ͏VOJGZ͠ N`൪ͷܕมΛ৽͘͠औΓग़͢
ܕਪͷྫ (App) ННˠЌɹɹɹɹͱͳΔΑ͏VOJGZ͠ ޭͨ͠ΒМΛಘΔ
ܕਪͷྫ (App) ННˠЌɹɹɹɹͱͳΔΑ͏VOJGZ͠ ޭͨ͠ΒМΛಘΔ
ܕਪͷྫ (App) "QQͷܕنଇΛద༻͢Δɻ
"QQͷܕنଇΛద༻͢Δɻ
ܕਪͷྫ (App) "QQͷܕنଇΛద༻͢Δɻ ඞཁͳೖ
ܕਪͷྫ (App) "QQͷܕنଇΛద༻͢Δɻ ͳΔೖМΛฦ͍ͨ͠
ܕਪͷྫ (App) "QQͷܕنଇΛద༻͢Δɻ ͳΔೖМΛฦ͍ͨ͠
ܕਪͷྫ (App)
ܕਪͷྫ (App) ଞͷߏจ 'TU 4OEͳͲ ʹؔͯ͠ಉ༷ʹূ໌Ͱ͖Δ
·ͱΊ wܕมΛͰͳ͘ෆࣜΛ༻͍ͯදݱ͢Δํࣜʹ վྑ͠ɺ·ͨܕఆٛΛHFOFSJDQSPHSBNNJOHͷߟ ͑ํΛऔΓೖΕͯΑΓҰൠతʹվྑ͢Δ͜ͱͰɺܕ ਪثʹ͓͚ΔTZOUBYͷ֦ுͱূ໌ͷ؆ུԽΛ࣮ ݱͨ͠ wιʔείʔυHJUIVCDPNLEYVJOGFSBHEB "HEB߹ܭߦ
ࠓޙͷ՝ wߏจͷ֦ு ଟ૬ͷ-FUจͳͲ 1PMZ1<+BOTTPOΒ >*OEFYFE'VODUPST<-ÖIΒ >ͳͲܕύϥϝλΛѻ͑ΔͷΛ͏ඞཁ͕͋Δ wશੑͷূ໌ ܕ͕͔ͭͳ͍߹