SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
Agda

  @erutuf13
data               : Set where
       @erutuf13                 :    ->
                                 :    ->
       Haskell     Agda Coq       :    ->
• AoPa(Algebra of Programming in Agda)

        (          )


Agda


(                            )
Agda . . .

multS : (m n : N) -> m + m * n == m * S n
multS O _ = eqrefl
multS (S m) n =
   eqtrans (eqsuc (plusassoc m n (m * n)))
  (eqtrans (eqsuc
    (eqplus’ (m + n) (n + m) (m * n) (pluscomm m n)))
  (eqtrans (eqsuc (eqsym (plusassoc n m (m * n))))
  (eqsuc (eqplus (m + m * n) (m * S n) n (multS m n)))))
Agda . . .

multS : (m n : N) -> m + m * n == m * S n
multS O _ = eqrefl
multS (S m) n =
   eqtrans (eqsuc (plusassoc m n (m * n)))
  (eqtrans (eqsuc
    (eqplus’ (m + n) (n + m) (m * n) (pluscomm m n)))
  (eqtrans (eqsuc (eqsym (plusassoc n m (m * n))))
  (eqsuc (eqplus (m + m * n) (m * S n) n (multS m n)))))
eqtrans : {A : Set} {n m l : A}
   -> n == m -> m == l -> n == l




  Algebraic Reasoning        !
multS (S m) n =
    proof
        S m + S m * n
    ==[ eqrefl ]
        S (m + n + m * n)
    ==[ eqsuc (plusassoc m n (m *   n)) ]
        S ((m + n) + m * n)
    ==[ eqsuc (eqplus’ (m + n) (n   + m) (m * n)
            (pluscomm m n)) ]
        S ((n + m) + m * n)
    ==[ eqsuc (eqsym (plusassoc n   m (m * n))) ]
        S (n + m + m * n)
    ==[ eqsuc (eqplus (m + m * n)   (m * S n) n
            (multS m n)) ]
        S (n + m * S n)
    ==[ eqrefl ]
        S m * S n
    qed
==
data _IsEqualTo_ A : Set (x y : A) : Set1 where
    relTo : (x=y : x == y) -> x IsEqualTo y

proof_ : forall A : Set x y : A
    -> x IsEqualTo y -> x == y
proof relTo x=y = x=y

_==[_]_ : forall A : Set y z : A -> (x : A)
    -> x == y -> y IsEqualTo z -> x IsEqualTo z
_ ==[ x=y ] relTo y=z = relTo (eqtrans x=y y=z)

_qed : forall A : Set -> (x : A) -> x IsEqualTo x
_qed _ = relTo eqrefl

          proof_ < _qed = _==[_]_
Relation.Binary.PreorderReasoning
(          )


Algebra of Programming
•
•




•
•
(* - )


isort-der : ∃(λf → ordered? ◦ permute ⊒ fun   f)
isort-der : ∃ (λf → ordered?        permute ⊒ fun f )
isort-der = ( ,
      (⊒-begin
       ⊒ ⟨ -monotonic-r permute-is-fold ⟩
            ordered?      perm
       ⊒ ⟨ ⊒-refl ⟩
            ordered?      foldR combine nil
       ⊒ ⟨ foldR-fusion-⊒ ordered? ins-step ins-base ⟩
            foldR (fun (uncurry insert)) nil
       ⊒ ⟨ foldR-to-foldr insert [] ⟩
            fun (foldr insert [])
       ⊒ ■))

isort : List Val -> List Val
isort = proj1 isort-der
Algebra of Programming




   Algebra of Programming Style      (      )


isort           AoPA (Algebra of Programming in Agda)

Contenu connexe

Tendances

Introduccio al calculo vectorial
Introduccio  al calculo vectorialIntroduccio  al calculo vectorial
Introduccio al calculo vectorialEDESMITCRUZ1
 
12 derivatives and integrals of inverse trigonometric functions x
12 derivatives and integrals of inverse trigonometric functions x12 derivatives and integrals of inverse trigonometric functions x
12 derivatives and integrals of inverse trigonometric functions xmath266
 
Taylor Polynomials and Series
Taylor Polynomials and SeriesTaylor Polynomials and Series
Taylor Polynomials and SeriesMatthew Leingang
 
Measure and integration
Measure and integrationMeasure and integration
Measure and integrationPrakash Dabhi
 
Measure and Integration
Measure and IntegrationMeasure and Integration
Measure and IntegrationPrakash Dabhi
 
10CSL67 CG LAB PROGRAM 4
10CSL67 CG LAB PROGRAM 410CSL67 CG LAB PROGRAM 4
10CSL67 CG LAB PROGRAM 4Vanishree Arun
 
8 arc length and area of surfaces x
8 arc length and area of surfaces x8 arc length and area of surfaces x
8 arc length and area of surfaces xmath266
 
Parent Functions
Parent FunctionsParent Functions
Parent FunctionsVLB10525
 
Day 1 examples u1f13
Day 1 examples u1f13Day 1 examples u1f13
Day 1 examples u1f13jchartiersjsd
 
Day 1 examples u1f13
Day 1 examples u1f13Day 1 examples u1f13
Day 1 examples u1f13jchartiersjsd
 
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
 
PYTHON. AM CALL Pricing Trees
PYTHON. AM CALL Pricing TreesPYTHON. AM CALL Pricing Trees
PYTHON. AM CALL Pricing TreesTianqi Huang, CFA
 

Tendances (20)

The wave function
The wave functionThe wave function
The wave function
 
Introduccio al calculo vectorial
Introduccio  al calculo vectorialIntroduccio  al calculo vectorial
Introduccio al calculo vectorial
 
Clojure to Slang
Clojure to SlangClojure to Slang
Clojure to Slang
 
12 derivatives and integrals of inverse trigonometric functions x
12 derivatives and integrals of inverse trigonometric functions x12 derivatives and integrals of inverse trigonometric functions x
12 derivatives and integrals of inverse trigonometric functions x
 
Taylor Polynomials and Series
Taylor Polynomials and SeriesTaylor Polynomials and Series
Taylor Polynomials and Series
 
Ch06 3
Ch06 3Ch06 3
Ch06 3
 
Maths in english
Maths in englishMaths in english
Maths in english
 
Measure and integration
Measure and integrationMeasure and integration
Measure and integration
 
Measure and Integration
Measure and IntegrationMeasure and Integration
Measure and Integration
 
10CSL67 CG LAB PROGRAM 4
10CSL67 CG LAB PROGRAM 410CSL67 CG LAB PROGRAM 4
10CSL67 CG LAB PROGRAM 4
 
Probability part 3
Probability part 3Probability part 3
Probability part 3
 
8 arc length and area of surfaces x
8 arc length and area of surfaces x8 arc length and area of surfaces x
8 arc length and area of surfaces x
 
Parent Functions
Parent FunctionsParent Functions
Parent Functions
 
Array presentation
Array presentationArray presentation
Array presentation
 
Day 1 examples u1f13
Day 1 examples u1f13Day 1 examples u1f13
Day 1 examples u1f13
 
Day 1 examples u1f13
Day 1 examples u1f13Day 1 examples u1f13
Day 1 examples u1f13
 
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)
 
PYTHON. AM CALL Pricing Trees
PYTHON. AM CALL Pricing TreesPYTHON. AM CALL Pricing Trees
PYTHON. AM CALL Pricing Trees
 
Aa1
Aa1Aa1
Aa1
 
Parent Function Project
Parent Function ProjectParent Function Project
Parent Function Project
 

Similaire à Agda であそぼ

Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語ikdysfm
 
Implement the following sorting algorithms Bubble Sort Insertion S.pdf
Implement the following sorting algorithms  Bubble Sort  Insertion S.pdfImplement the following sorting algorithms  Bubble Sort  Insertion S.pdf
Implement the following sorting algorithms Bubble Sort Insertion S.pdfkesav24
 
Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)stasimus
 
Nat, List and Option Monoids - from scratch - Combining and Folding - an example
Nat, List and Option Monoids -from scratch -Combining and Folding -an exampleNat, List and Option Monoids -from scratch -Combining and Folding -an example
Nat, List and Option Monoids - from scratch - Combining and Folding - an examplePhilip Schwarz
 
[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ
[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ
[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQProvectus
 
An example of R code for Data visualization
An example of R code for Data visualizationAn example of R code for Data visualization
An example of R code for Data visualizationLiang (Leon) Zhou
 
Nat, List and Option Monoids - from scratch - Combining and Folding - an example
Nat, List and Option Monoids -from scratch -Combining and Folding -an exampleNat, List and Option Monoids -from scratch -Combining and Folding -an example
Nat, List and Option Monoids - from scratch - Combining and Folding - an examplePhilip Schwarz
 
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxImplementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxEleanor McHugh
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and ScalaFolding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and ScalaPhilip Schwarz
 
Truth, deduction, computation lecture g
Truth, deduction, computation   lecture gTruth, deduction, computation   lecture g
Truth, deduction, computation lecture gVlad Patryshev
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...Philip Schwarz
 
関数潮流(Function Tendency)
関数潮流(Function Tendency)関数潮流(Function Tendency)
関数潮流(Function Tendency)riue
 
Data structure 8.pptx
Data structure 8.pptxData structure 8.pptx
Data structure 8.pptxSajalFayyaz
 
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...Philip Schwarz
 
S1 3 derivadas_resueltas
S1 3 derivadas_resueltasS1 3 derivadas_resueltas
S1 3 derivadas_resueltasjesquerrev1
 
100derivadasresueltasyosoytuprofe
100derivadasresueltasyosoytuprofe100derivadasresueltasyosoytuprofe
100derivadasresueltasyosoytuprofeJavier Rangel
 
S1 3 derivadas_resueltas
S1 3 derivadas_resueltasS1 3 derivadas_resueltas
S1 3 derivadas_resueltasjesquerrev1
 

Similaire à Agda であそぼ (20)

Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語
 
Implement the following sorting algorithms Bubble Sort Insertion S.pdf
Implement the following sorting algorithms  Bubble Sort  Insertion S.pdfImplement the following sorting algorithms  Bubble Sort  Insertion S.pdf
Implement the following sorting algorithms Bubble Sort Insertion S.pdf
 
Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)
 
Nat, List and Option Monoids - from scratch - Combining and Folding - an example
Nat, List and Option Monoids -from scratch -Combining and Folding -an exampleNat, List and Option Monoids -from scratch -Combining and Folding -an example
Nat, List and Option Monoids - from scratch - Combining and Folding - an example
 
[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ
[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ
[Expert Fridays] Александр Чичигин - Как перестать бояться и полюбить COQ
 
An example of R code for Data visualization
An example of R code for Data visualizationAn example of R code for Data visualization
An example of R code for Data visualization
 
Nat, List and Option Monoids - from scratch - Combining and Folding - an example
Nat, List and Option Monoids -from scratch -Combining and Folding -an exampleNat, List and Option Monoids -from scratch -Combining and Folding -an example
Nat, List and Option Monoids - from scratch - Combining and Folding - an example
 
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxImplementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 redux
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and ScalaFolding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
 
Intro To Agda
Intro To AgdaIntro To Agda
Intro To Agda
 
Truth, deduction, computation lecture g
Truth, deduction, computation   lecture gTruth, deduction, computation   lecture g
Truth, deduction, computation lecture g
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
 
関数潮流(Function Tendency)
関数潮流(Function Tendency)関数潮流(Function Tendency)
関数潮流(Function Tendency)
 
Data structure 8.pptx
Data structure 8.pptxData structure 8.pptx
Data structure 8.pptx
 
Random Variable
Random Variable Random Variable
Random Variable
 
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
 
01 FUNCTIONS.pptx
01 FUNCTIONS.pptx01 FUNCTIONS.pptx
01 FUNCTIONS.pptx
 
S1 3 derivadas_resueltas
S1 3 derivadas_resueltasS1 3 derivadas_resueltas
S1 3 derivadas_resueltas
 
100derivadasresueltasyosoytuprofe
100derivadasresueltasyosoytuprofe100derivadasresueltasyosoytuprofe
100derivadasresueltasyosoytuprofe
 
S1 3 derivadas_resueltas
S1 3 derivadas_resueltasS1 3 derivadas_resueltas
S1 3 derivadas_resueltas
 

Dernier

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Dernier (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Agda であそぼ

  • 2. data : Set where @erutuf13 : -> : -> Haskell Agda Coq : ->
  • 3. • AoPa(Algebra of Programming in Agda) ( ) Agda ( )
  • 4. Agda . . . multS : (m n : N) -> m + m * n == m * S n multS O _ = eqrefl multS (S m) n = eqtrans (eqsuc (plusassoc m n (m * n))) (eqtrans (eqsuc (eqplus’ (m + n) (n + m) (m * n) (pluscomm m n))) (eqtrans (eqsuc (eqsym (plusassoc n m (m * n)))) (eqsuc (eqplus (m + m * n) (m * S n) n (multS m n)))))
  • 5. Agda . . . multS : (m n : N) -> m + m * n == m * S n multS O _ = eqrefl multS (S m) n = eqtrans (eqsuc (plusassoc m n (m * n))) (eqtrans (eqsuc (eqplus’ (m + n) (n + m) (m * n) (pluscomm m n))) (eqtrans (eqsuc (eqsym (plusassoc n m (m * n)))) (eqsuc (eqplus (m + m * n) (m * S n) n (multS m n)))))
  • 6. eqtrans : {A : Set} {n m l : A} -> n == m -> m == l -> n == l Algebraic Reasoning !
  • 7. multS (S m) n = proof S m + S m * n ==[ eqrefl ] S (m + n + m * n) ==[ eqsuc (plusassoc m n (m * n)) ] S ((m + n) + m * n) ==[ eqsuc (eqplus’ (m + n) (n + m) (m * n) (pluscomm m n)) ] S ((n + m) + m * n) ==[ eqsuc (eqsym (plusassoc n m (m * n))) ] S (n + m + m * n) ==[ eqsuc (eqplus (m + m * n) (m * S n) n (multS m n)) ] S (n + m * S n) ==[ eqrefl ] S m * S n qed
  • 8. ==
  • 9. data _IsEqualTo_ A : Set (x y : A) : Set1 where relTo : (x=y : x == y) -> x IsEqualTo y proof_ : forall A : Set x y : A -> x IsEqualTo y -> x == y proof relTo x=y = x=y _==[_]_ : forall A : Set y z : A -> (x : A) -> x == y -> y IsEqualTo z -> x IsEqualTo z _ ==[ x=y ] relTo y=z = relTo (eqtrans x=y y=z) _qed : forall A : Set -> (x : A) -> x IsEqualTo x _qed _ = relTo eqrefl proof_ < _qed = _==[_]_
  • 11. ( ) Algebra of Programming
  • 13. (* - ) isort-der : ∃(λf → ordered? ◦ permute ⊒ fun f)
  • 14. isort-der : ∃ (λf → ordered? permute ⊒ fun f ) isort-der = ( , (⊒-begin ⊒ ⟨ -monotonic-r permute-is-fold ⟩ ordered? perm ⊒ ⟨ ⊒-refl ⟩ ordered? foldR combine nil ⊒ ⟨ foldR-fusion-⊒ ordered? ins-step ins-base ⟩ foldR (fun (uncurry insert)) nil ⊒ ⟨ foldR-to-foldr insert [] ⟩ fun (foldr insert []) ⊒ ■)) isort : List Val -> List Val isort = proj1 isort-der
  • 15. Algebra of Programming Algebra of Programming Style ( ) isort AoPA (Algebra of Programming in Agda)