SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
(Kinokkory@shiatsumat)
C
int
double
char
T T*
T const T
Haskell
C++ /
Java / Python
↔
↔
1+1=?
1+1=2
1
1
2
“1” “ 1 ”
“+” “
”
“1” “2” “+” “=”
Coq
Inductive Nat:Set :=
| O : Nat
| S : Nat -> Nat.
Nat (0 )
S
(1+)
0, 1, 2, 3, ... O, S O,
S (S O), S (S (S O)), ...
Fixpoint Plus(m n:Nat):Nat :=
match m with
| O => n
| S m' => S (Plus m' n)
end.
Infix + := Plus.
0+n=n,
(1+m’)+n=1+(m’+n)
Theorem OnePlusOneEqualsTwo:
S O + S O = S (S O).
Proof.
simpl.
reflexivity.
Qed.
1+1=2
......
Lemma reduce_lemma :
forall ctx (ctx' : seq (term * typ)) t ty,
typing ([seq Some p.2 | p <- ctx'] ++ ctx) t ty ->
Forall (fun p => reducible ctx p.1 p.2) ctx' ->
reducible ctx (substitute_seq 0 [seq p.1 | p <- ctx'] t) ty.
Proof.
move => ctx ctx' t ty; elim: t ty ctx ctx'.
- move => /= n ty ctx ctx'.
rewrite /substitute_seqv typvar_seqindex subn0 size_map shiftzero.
elim: ctx' n => [| c' ctx' IH []] /=.
- move => n H _; rewrite nth_nil subn0.
apply CR3 => //.
- by constructor.
- move => t' H0; inversion H0.
- by case => H [H0 H1]; rewrite H.
- by move => n H [H0 H1]; apply IH.
- move => tl IHtl tr IHtr ty ctx ctx' H H0.
inversion H; subst => {H}.
case: (IHtl (tyfun ty1 ty) ctx ctx') => //= H1 H2; split; auto.
apply typapp with ty1 => //.
apply subject_substitute_seq => //.
by rewrite drop0; move: H0; apply Forall_impl => p [].
- move => t IHt ty ctx ctx' H H0.
inversion H; subst => {H} /=.
apply abstraction_lemma.
- constructor.
apply subject_substitute_seq => //.
by rewrite /= drop0; move: H0; apply Forall_impl => p [].
- move => t2 ctx2 H H1.
rewrite substitute_seq_cons_eq.
apply (IHt ty2 ctx2 ((t2, ty1) :: ctx')) => /=.
- move: H3; apply ctxleq_preserves_typing.
move: H; apply (ctxleq_appl (Some ty1 :: _)).
- split => //.
move: H0; apply Forall_impl => p.
by apply ctxleq_preserves_reducibility.
Qed.
Theorem typed_term_is_snorm : forall ctx t ty, typing ctx t ty ->
SNorm t.
Proof.
move => ctx t ty H.
apply (@CR1 ctx t ty).
move: (@reduce_lemma ctx [::] t ty H) => /=.
by rewrite substitute_seq_nil_eq; apply.
Qed.
Theorem monad_bind_assoc
: forall{t1 t2 t3:TypeWithEquality}
(ma:TWE_Type (m t1))
(k:TWE_Type (t1 -> m t2)%TypeWithEquality)
(h:TWE_Type (t2 -> m t3)%TypeWithEquality),
TWE_Equality (m t3)
(AWE_Arrow (AWE_Arrow bindM ma)
(Build_ArrowWithEquality (fun x => AWE_Arrow (AWE_Arrow bindM (AWE_Arrow k x)) h)
(fun (x y : TWE_Type t1) (Hxy : TWE_Equality t1 x y) =>
AWE_Compat bindM
(AWE_Arrow k x)
(AWE_Arrow k y)
(AWE_Compat k x y Hxy)
h
h
(Equivalence_Reflexive(Equivalence:=TWE_Equivalence _) h)
)
)
)
(AWE_Arrow (AWE_Arrow bindM (AWE_Arrow (AWE_Arrow bindM ma) k)) h).
Proof.
intros.
intros x y H.
unfold bindM,returnM; simpl.
apply (AWE_Compat ma).
simpl.
intros x0 y0 H0.
assert (HEql: TWE_Equality _ (AWE_Arrow k x0) (AWE_Arrow k y0)).
apply (AWE_Compat k).
apply H0.
apply HEql.
simpl.
intros x1 y1 H1.
assert (HEql2: TWE_Equality _ (AWE_Arrow h x1) (AWE_Arrow h y1)).
apply (AWE_Compat h).
apply H1.
apply HEql2.
apply H.
Qed.
End ContinuationMonadBase.
Module FContinuationMonadBaseBase <:HasReturnType.
Definition ReturnType : TypeWithEquality := TypeWithEquality_eq False.
End FContinuationMonadBaseBase.
Module FContinuationMonadBase := FContinuationMonadBaseBase <+ ContinuationMonadBase.
Maybe
Coq
型理論 なんて自分には関係ないと思っているあなたへ
型理論 なんて自分には関係ないと思っているあなたへ
型理論 なんて自分には関係ないと思っているあなたへ
型理論 なんて自分には関係ないと思っているあなたへ
型理論 なんて自分には関係ないと思っているあなたへ

Contenu connexe

Tendances

Function presentation
Function presentationFunction presentation
Function presentationjamil sadiq
 
Rolle's theorem, mean value theorem
Rolle's theorem, mean value theoremRolle's theorem, mean value theorem
Rolle's theorem, mean value theoremTarun Gehlot
 
AP Calculus December 10, 2008
AP Calculus December 10, 2008AP Calculus December 10, 2008
AP Calculus December 10, 2008Darren Kuropatwa
 
Formal methods 8 - category theory (last one)
Formal methods   8 - category theory (last one)Formal methods   8 - category theory (last one)
Formal methods 8 - category theory (last one)Vlad Patryshev
 
5.7 rolle's thrm & mv theorem
5.7 rolle's thrm & mv theorem5.7 rolle's thrm & mv theorem
5.7 rolle's thrm & mv theoremdicosmo178
 
Linked list int_data_fdata
Linked list int_data_fdataLinked list int_data_fdata
Linked list int_data_fdataSamsil Arefin
 
딥러닝 교육 자료 #2
딥러닝 교육 자료 #2딥러닝 교육 자료 #2
딥러닝 교육 자료 #2Ashal aka JOKER
 
Intermediate Microeconomic Theory Midterm 2 "Cheat Sheet"
Intermediate Microeconomic Theory Midterm 2 "Cheat Sheet"Intermediate Microeconomic Theory Midterm 2 "Cheat Sheet"
Intermediate Microeconomic Theory Midterm 2 "Cheat Sheet"Laurel Ayuyao
 
A Formal Model and an Algorithm for Generating the Permutations of a Multiset
A Formal Model and an Algorithm for Generating the Permutations of a MultisetA Formal Model and an Algorithm for Generating the Permutations of a Multiset
A Formal Model and an Algorithm for Generating the Permutations of a MultisetVincenzo De Florio
 
A Numeric Algorithm for Generating Permutations in Lexicographic Order with a...
A Numeric Algorithm for Generating Permutations in Lexicographic Order with a...A Numeric Algorithm for Generating Permutations in Lexicographic Order with a...
A Numeric Algorithm for Generating Permutations in Lexicographic Order with a...Afshin Tiraie
 
Statistics for Economics Final Exam Cheat Sheet
Statistics for Economics Final Exam Cheat SheetStatistics for Economics Final Exam Cheat Sheet
Statistics for Economics Final Exam Cheat SheetLaurel Ayuyao
 
Lesson20 Tangent Planes Slides+Notes
Lesson20   Tangent Planes Slides+NotesLesson20   Tangent Planes Slides+Notes
Lesson20 Tangent Planes Slides+NotesMatthew Leingang
 

Tendances (20)

Rolles theorem
Rolles theoremRolles theorem
Rolles theorem
 
Function presentation
Function presentationFunction presentation
Function presentation
 
Faster Python, FOSDEM
Faster Python, FOSDEMFaster Python, FOSDEM
Faster Python, FOSDEM
 
Roll's theorem
Roll's theoremRoll's theorem
Roll's theorem
 
Jan 2012 HUG: RHadoop
Jan 2012 HUG: RHadoopJan 2012 HUG: RHadoop
Jan 2012 HUG: RHadoop
 
Rolle's theorem, mean value theorem
Rolle's theorem, mean value theoremRolle's theorem, mean value theorem
Rolle's theorem, mean value theorem
 
AP Calculus December 10, 2008
AP Calculus December 10, 2008AP Calculus December 10, 2008
AP Calculus December 10, 2008
 
Formal methods 8 - category theory (last one)
Formal methods   8 - category theory (last one)Formal methods   8 - category theory (last one)
Formal methods 8 - category theory (last one)
 
2010 calculusmvt3.2
2010 calculusmvt3.22010 calculusmvt3.2
2010 calculusmvt3.2
 
5.7 rolle's thrm & mv theorem
5.7 rolle's thrm & mv theorem5.7 rolle's thrm & mv theorem
5.7 rolle's thrm & mv theorem
 
Linked list int_data_fdata
Linked list int_data_fdataLinked list int_data_fdata
Linked list int_data_fdata
 
딥러닝 교육 자료 #2
딥러닝 교육 자료 #2딥러닝 교육 자료 #2
딥러닝 교육 자료 #2
 
Intermediate Microeconomic Theory Midterm 2 "Cheat Sheet"
Intermediate Microeconomic Theory Midterm 2 "Cheat Sheet"Intermediate Microeconomic Theory Midterm 2 "Cheat Sheet"
Intermediate Microeconomic Theory Midterm 2 "Cheat Sheet"
 
A Formal Model and an Algorithm for Generating the Permutations of a Multiset
A Formal Model and an Algorithm for Generating the Permutations of a MultisetA Formal Model and an Algorithm for Generating the Permutations of a Multiset
A Formal Model and an Algorithm for Generating the Permutations of a Multiset
 
A Numeric Algorithm for Generating Permutations in Lexicographic Order with a...
A Numeric Algorithm for Generating Permutations in Lexicographic Order with a...A Numeric Algorithm for Generating Permutations in Lexicographic Order with a...
A Numeric Algorithm for Generating Permutations in Lexicographic Order with a...
 
Statistics for Economics Final Exam Cheat Sheet
Statistics for Economics Final Exam Cheat SheetStatistics for Economics Final Exam Cheat Sheet
Statistics for Economics Final Exam Cheat Sheet
 
Integrals
IntegralsIntegrals
Integrals
 
Mean value theorem
Mean value theoremMean value theorem
Mean value theorem
 
Tangent plane
Tangent planeTangent plane
Tangent plane
 
Lesson20 Tangent Planes Slides+Notes
Lesson20   Tangent Planes Slides+NotesLesson20   Tangent Planes Slides+Notes
Lesson20 Tangent Planes Slides+Notes
 

En vedette

ホモトピー型理論入門
ホモトピー型理論入門ホモトピー型理論入門
ホモトピー型理論入門k h
 
自動定理証明の紹介
自動定理証明の紹介自動定理証明の紹介
自動定理証明の紹介Masahiro Sakai
 
証明プログラミング超入門
証明プログラミング超入門証明プログラミング超入門
証明プログラミング超入門Kyoko Kadowaki
 
SAT/SMTソルバの仕組み
SAT/SMTソルバの仕組みSAT/SMTソルバの仕組み
SAT/SMTソルバの仕組みMasahiro Sakai
 
証明プログラミング入門2
証明プログラミング入門2証明プログラミング入門2
証明プログラミング入門2Kyoko Kadowaki
 
An introduction to call-by-push-value
An introduction to call-by-push-valueAn introduction to call-by-push-value
An introduction to call-by-push-valuek h
 
AngularJS勉強会「そもそもwebって」@ツクロア勉強会(2015.09.10)
AngularJS勉強会「そもそもwebって」@ツクロア勉強会(2015.09.10)AngularJS勉強会「そもそもwebって」@ツクロア勉強会(2015.09.10)
AngularJS勉強会「そもそもwebって」@ツクロア勉強会(2015.09.10)tomonari takahashi
 
2SAT(充足可能性問題)の解き方
2SAT(充足可能性問題)の解き方2SAT(充足可能性問題)の解き方
2SAT(充足可能性問題)の解き方Tsuneo Yoshioka
 
Android Hacks - 合宿 Activity
Android Hacks - 合宿 ActivityAndroid Hacks - 合宿 Activity
Android Hacks - 合宿 ActivityMasanori Ohkawara
 
Ta plスライド第4章
Ta plスライド第4章Ta plスライド第4章
Ta plスライド第4章Kyoko Kadowaki
 
ネット検索をしなくなる時代
ネット検索をしなくなる時代ネット検索をしなくなる時代
ネット検索をしなくなる時代Masakazu Mito
 
Intoduction to Homotopy Type Therory
Intoduction to Homotopy Type TheroryIntoduction to Homotopy Type Therory
Intoduction to Homotopy Type TheroryJack Fox
 
AngularJSで業務システムUI部品化
AngularJSで業務システムUI部品化AngularJSで業務システムUI部品化
AngularJSで業務システムUI部品化Toshio Ehara
 
Agda による型推論器の定式化
Agda による型推論器の定式化Agda による型推論器の定式化
Agda による型推論器の定式化Kyoko Kadowaki
 
AngularJSとD3.jsによるインタラクティブデータビジュアライゼーション
AngularJSとD3.jsによるインタラクティブデータビジュアライゼーションAngularJSとD3.jsによるインタラクティブデータビジュアライゼーション
AngularJSとD3.jsによるインタラクティブデータビジュアライゼーションYosuke Onoue
 

En vedette (20)

ホモトピー型理論入門
ホモトピー型理論入門ホモトピー型理論入門
ホモトピー型理論入門
 
自動定理証明の紹介
自動定理証明の紹介自動定理証明の紹介
自動定理証明の紹介
 
証明プログラミング超入門
証明プログラミング超入門証明プログラミング超入門
証明プログラミング超入門
 
SAT/SMTソルバの仕組み
SAT/SMTソルバの仕組みSAT/SMTソルバの仕組み
SAT/SMTソルバの仕組み
 
証明プログラミング入門2
証明プログラミング入門2証明プログラミング入門2
証明プログラミング入門2
 
An introduction to call-by-push-value
An introduction to call-by-push-valueAn introduction to call-by-push-value
An introduction to call-by-push-value
 
Create twitter-ios-app
Create twitter-ios-appCreate twitter-ios-app
Create twitter-ios-app
 
AngularJS勉強会「そもそもwebって」@ツクロア勉強会(2015.09.10)
AngularJS勉強会「そもそもwebって」@ツクロア勉強会(2015.09.10)AngularJS勉強会「そもそもwebって」@ツクロア勉強会(2015.09.10)
AngularJS勉強会「そもそもwebって」@ツクロア勉強会(2015.09.10)
 
2SAT(充足可能性問題)の解き方
2SAT(充足可能性問題)の解き方2SAT(充足可能性問題)の解き方
2SAT(充足可能性問題)の解き方
 
Android Hacks - 合宿 Activity
Android Hacks - 合宿 ActivityAndroid Hacks - 合宿 Activity
Android Hacks - 合宿 Activity
 
Earth Day 2014
Earth Day 2014Earth Day 2014
Earth Day 2014
 
Ta plスライド第4章
Ta plスライド第4章Ta plスライド第4章
Ta plスライド第4章
 
ネット検索をしなくなる時代
ネット検索をしなくなる時代ネット検索をしなくなる時代
ネット検索をしなくなる時代
 
SIAMSEAS2015
SIAMSEAS2015SIAMSEAS2015
SIAMSEAS2015
 
Hott_1
Hott_1Hott_1
Hott_1
 
Intoduction to Homotopy Type Therory
Intoduction to Homotopy Type TheroryIntoduction to Homotopy Type Therory
Intoduction to Homotopy Type Therory
 
AngularJSで業務システムUI部品化
AngularJSで業務システムUI部品化AngularJSで業務システムUI部品化
AngularJSで業務システムUI部品化
 
PPL2016-9-3
PPL2016-9-3PPL2016-9-3
PPL2016-9-3
 
Agda による型推論器の定式化
Agda による型推論器の定式化Agda による型推論器の定式化
Agda による型推論器の定式化
 
AngularJSとD3.jsによるインタラクティブデータビジュアライゼーション
AngularJSとD3.jsによるインタラクティブデータビジュアライゼーションAngularJSとD3.jsによるインタラクティブデータビジュアライゼーション
AngularJSとD3.jsによるインタラクティブデータビジュアライゼーション
 

Similaire à 型理論 なんて自分には関係ないと思っているあなたへ

High-Performance Haskell
High-Performance HaskellHigh-Performance Haskell
High-Performance HaskellJohan Tibell
 
I wrote the following change it to having a header, main and cpp fi.pdf
I wrote the following change it to having a header, main and cpp fi.pdfI wrote the following change it to having a header, main and cpp fi.pdf
I wrote the following change it to having a header, main and cpp fi.pdfrishteygallery
 
3. convolution fourier
3. convolution fourier3. convolution fourier
3. convolution fourierskysunilyadav
 
Numerical Method Assignment
Numerical Method AssignmentNumerical Method Assignment
Numerical Method Assignmentashikul akash
 
Compilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMCompilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMLinaro
 
Fins equation & lumped heat capacity system
Fins equation & lumped heat capacity systemFins equation & lumped heat capacity system
Fins equation & lumped heat capacity systemN/A
 
LINEAR SYSTEMS
LINEAR SYSTEMSLINEAR SYSTEMS
LINEAR SYSTEMSJazzieJao1
 
Gentle Introduction to Functional Programming
Gentle Introduction to Functional ProgrammingGentle Introduction to Functional Programming
Gentle Introduction to Functional ProgrammingSaurabh Singh
 
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)Maho Nakata
 
Use the same variable names and write the function F - Force(x-ks-kc-l.pdf
Use the same variable names and write the function F - Force(x-ks-kc-l.pdfUse the same variable names and write the function F - Force(x-ks-kc-l.pdf
Use the same variable names and write the function F - Force(x-ks-kc-l.pdfacteleshoppe
 
Matlab assignment
Matlab assignmentMatlab assignment
Matlab assignmentRutvik
 
Variations on the method of Coleman-Chabauty
Variations on the method of Coleman-ChabautyVariations on the method of Coleman-Chabauty
Variations on the method of Coleman-Chabautymmasdeu
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Codemotion
 
Declare Your Language: Transformation by Strategic Term Rewriting
Declare Your Language: Transformation by Strategic Term RewritingDeclare Your Language: Transformation by Strategic Term Rewriting
Declare Your Language: Transformation by Strategic Term RewritingEelco Visser
 
Rosser's theorem
Rosser's theoremRosser's theorem
Rosser's theoremWathna
 
International journal of engineering and mathematical modelling vol2 no3_2015_2
International journal of engineering and mathematical modelling vol2 no3_2015_2International journal of engineering and mathematical modelling vol2 no3_2015_2
International journal of engineering and mathematical modelling vol2 no3_2015_2IJEMM
 

Similaire à 型理論 なんて自分には関係ないと思っているあなたへ (20)

High-Performance Haskell
High-Performance HaskellHigh-Performance Haskell
High-Performance Haskell
 
I wrote the following change it to having a header, main and cpp fi.pdf
I wrote the following change it to having a header, main and cpp fi.pdfI wrote the following change it to having a header, main and cpp fi.pdf
I wrote the following change it to having a header, main and cpp fi.pdf
 
3. convolution fourier
3. convolution fourier3. convolution fourier
3. convolution fourier
 
Numerical Method Assignment
Numerical Method AssignmentNumerical Method Assignment
Numerical Method Assignment
 
Compilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMCompilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVM
 
Fins equation & lumped heat capacity system
Fins equation & lumped heat capacity systemFins equation & lumped heat capacity system
Fins equation & lumped heat capacity system
 
LINEAR SYSTEMS
LINEAR SYSTEMSLINEAR SYSTEMS
LINEAR SYSTEMS
 
Gentle Introduction to Functional Programming
Gentle Introduction to Functional ProgrammingGentle Introduction to Functional Programming
Gentle Introduction to Functional Programming
 
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
 
residue
residueresidue
residue
 
stochastic processes assignment help
stochastic processes assignment helpstochastic processes assignment help
stochastic processes assignment help
 
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
 
Use the same variable names and write the function F - Force(x-ks-kc-l.pdf
Use the same variable names and write the function F - Force(x-ks-kc-l.pdfUse the same variable names and write the function F - Force(x-ks-kc-l.pdf
Use the same variable names and write the function F - Force(x-ks-kc-l.pdf
 
Matlab assignment
Matlab assignmentMatlab assignment
Matlab assignment
 
A Note on TopicRNN
A Note on TopicRNNA Note on TopicRNN
A Note on TopicRNN
 
Variations on the method of Coleman-Chabauty
Variations on the method of Coleman-ChabautyVariations on the method of Coleman-Chabauty
Variations on the method of Coleman-Chabauty
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...
 
Declare Your Language: Transformation by Strategic Term Rewriting
Declare Your Language: Transformation by Strategic Term RewritingDeclare Your Language: Transformation by Strategic Term Rewriting
Declare Your Language: Transformation by Strategic Term Rewriting
 
Rosser's theorem
Rosser's theoremRosser's theorem
Rosser's theorem
 
International journal of engineering and mathematical modelling vol2 no3_2015_2
International journal of engineering and mathematical modelling vol2 no3_2015_2International journal of engineering and mathematical modelling vol2 no3_2015_2
International journal of engineering and mathematical modelling vol2 no3_2015_2
 

Plus de Yusuke Matsushita

Plus de Yusuke Matsushita (11)

NPC April Fool's Contest 2014 累乗数
NPC April Fool's Contest 2014 累乗数NPC April Fool's Contest 2014 累乗数
NPC April Fool's Contest 2014 累乗数
 
Haskell Lecture 2
Haskell Lecture 2Haskell Lecture 2
Haskell Lecture 2
 
Haskell Lecture 1
Haskell Lecture 1Haskell Lecture 1
Haskell Lecture 1
 
ドロネー三角形分割
ドロネー三角形分割ドロネー三角形分割
ドロネー三角形分割
 
関数型プログラミングのすゝめ
関数型プログラミングのすゝめ関数型プログラミングのすゝめ
関数型プログラミングのすゝめ
 
C#への招待
C#への招待C#への招待
C#への招待
 
Modeling Concurrent Computing
Modeling Concurrent ComputingModeling Concurrent Computing
Modeling Concurrent Computing
 
Programmers, be a Wikipedian
Programmers, be a WikipedianProgrammers, be a Wikipedian
Programmers, be a Wikipedian
 
OpenMPI入門
OpenMPI入門OpenMPI入門
OpenMPI入門
 
確率解析計算
確率解析計算確率解析計算
確率解析計算
 
プログラミング・パラダイム
プログラミング・パラダイムプログラミング・パラダイム
プログラミング・パラダイム
 

Dernier

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Dernier (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

型理論 なんて自分には関係ないと思っているあなたへ

  • 3.
  • 5.
  • 6.
  • 7.
  • 8.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. 1+1=?
  • 15. 1+1=2
  • 16.
  • 17. 1 1 2
  • 18. “1” “ 1 ” “+” “ ”
  • 20. Coq
  • 21. Inductive Nat:Set := | O : Nat | S : Nat -> Nat. Nat (0 ) S (1+) 0, 1, 2, 3, ... O, S O, S (S O), S (S (S O)), ...
  • 22. Fixpoint Plus(m n:Nat):Nat := match m with | O => n | S m' => S (Plus m' n) end. Infix + := Plus. 0+n=n, (1+m’)+n=1+(m’+n)
  • 23. Theorem OnePlusOneEqualsTwo: S O + S O = S (S O). Proof. simpl. reflexivity. Qed. 1+1=2
  • 24. ...... Lemma reduce_lemma : forall ctx (ctx' : seq (term * typ)) t ty, typing ([seq Some p.2 | p <- ctx'] ++ ctx) t ty -> Forall (fun p => reducible ctx p.1 p.2) ctx' -> reducible ctx (substitute_seq 0 [seq p.1 | p <- ctx'] t) ty. Proof. move => ctx ctx' t ty; elim: t ty ctx ctx'. - move => /= n ty ctx ctx'. rewrite /substitute_seqv typvar_seqindex subn0 size_map shiftzero. elim: ctx' n => [| c' ctx' IH []] /=. - move => n H _; rewrite nth_nil subn0. apply CR3 => //. - by constructor. - move => t' H0; inversion H0. - by case => H [H0 H1]; rewrite H. - by move => n H [H0 H1]; apply IH. - move => tl IHtl tr IHtr ty ctx ctx' H H0. inversion H; subst => {H}. case: (IHtl (tyfun ty1 ty) ctx ctx') => //= H1 H2; split; auto. apply typapp with ty1 => //. apply subject_substitute_seq => //. by rewrite drop0; move: H0; apply Forall_impl => p []. - move => t IHt ty ctx ctx' H H0. inversion H; subst => {H} /=. apply abstraction_lemma. - constructor. apply subject_substitute_seq => //. by rewrite /= drop0; move: H0; apply Forall_impl => p []. - move => t2 ctx2 H H1. rewrite substitute_seq_cons_eq. apply (IHt ty2 ctx2 ((t2, ty1) :: ctx')) => /=. - move: H3; apply ctxleq_preserves_typing. move: H; apply (ctxleq_appl (Some ty1 :: _)). - split => //. move: H0; apply Forall_impl => p. by apply ctxleq_preserves_reducibility. Qed. Theorem typed_term_is_snorm : forall ctx t ty, typing ctx t ty -> SNorm t. Proof. move => ctx t ty H. apply (@CR1 ctx t ty). move: (@reduce_lemma ctx [::] t ty H) => /=. by rewrite substitute_seq_nil_eq; apply. Qed.
  • 25. Theorem monad_bind_assoc : forall{t1 t2 t3:TypeWithEquality} (ma:TWE_Type (m t1)) (k:TWE_Type (t1 -> m t2)%TypeWithEquality) (h:TWE_Type (t2 -> m t3)%TypeWithEquality), TWE_Equality (m t3) (AWE_Arrow (AWE_Arrow bindM ma) (Build_ArrowWithEquality (fun x => AWE_Arrow (AWE_Arrow bindM (AWE_Arrow k x)) h) (fun (x y : TWE_Type t1) (Hxy : TWE_Equality t1 x y) => AWE_Compat bindM (AWE_Arrow k x) (AWE_Arrow k y) (AWE_Compat k x y Hxy) h h (Equivalence_Reflexive(Equivalence:=TWE_Equivalence _) h) ) ) ) (AWE_Arrow (AWE_Arrow bindM (AWE_Arrow (AWE_Arrow bindM ma) k)) h). Proof. intros. intros x y H. unfold bindM,returnM; simpl. apply (AWE_Compat ma). simpl. intros x0 y0 H0. assert (HEql: TWE_Equality _ (AWE_Arrow k x0) (AWE_Arrow k y0)). apply (AWE_Compat k). apply H0. apply HEql. simpl. intros x1 y1 H1. assert (HEql2: TWE_Equality _ (AWE_Arrow h x1) (AWE_Arrow h y1)). apply (AWE_Compat h). apply H1. apply HEql2. apply H. Qed. End ContinuationMonadBase. Module FContinuationMonadBaseBase <:HasReturnType. Definition ReturnType : TypeWithEquality := TypeWithEquality_eq False. End FContinuationMonadBaseBase. Module FContinuationMonadBase := FContinuationMonadBaseBase <+ ContinuationMonadBase. Maybe
  • 26.
  • 27. Coq