SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
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)

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
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
 
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
 
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
 
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
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Último (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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...
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
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...
 
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
 
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...
 
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
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

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)