SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
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)

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Kürzlich hochgeladen (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

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)