SlideShare a Scribd company logo
1 of 17
Download to read offline
Proof Summit 2011


                   Coq
                          @tmiya

                     September 25,2011




@tmiya : Coq   ,                         1
@tmiya_    SIer
               2007    LL Spirit       Coq
                 • Coq
                 •           Haskell         Scala
               2009                 Agda
                 •          @yoshihiro503            bool   Prop

                 • =⇒ Coq
               2010 2       @kencoba                               Formal
               Methods Forum
                 •
                 •                 ProofCafe
                      :       Coq


@tmiya : Coq          ,                                                     2
Coq

               User Contribution




@tmiya : Coq      ,                3
— @kinaba   d. y. d.




@tmiya : Coq   ,                          4
(regular expression)

                             ∅

                                                      "a"     "b"     ...

               L1 , L2                                  {xy |x ∈ L1 , y ∈ L2 }

               L1 , L2                              L1 ∪ L2
               L                        0
                 ∪ {x|x ∈ L} ∪ {xx|x ∈ L} ∪ . . .




@tmiya : Coq             ,                                                       5
”Derivatives of Regular Expressions”, Janusz Brzozowski, Journal
      of the ACM 1964.
      R(s) :         s             R
                              {
                                ν(R)        (s = ””)
                      R(s) =
                                (∂a R)(s ) (s = a :: s )

               ν(R) = R
               ∂a R =      R         a
                          NFA                       R         a
              ∂a R
      ”Yacc is Dead” (http://arxiv.org/abs/1010.5023)
          2011                   Brzozowski


@tmiya : Coq        ,                                                    6
R        ν(R)                       ∂a R
                    ∅        false                         ∅
                              true                 {       ∅
                                                          (c = a)
               "c"           false
                                        {            ∅ (c = a)
                                          (∂a R)S            (ν(R) = false)
               RS        ν(R) ∧ ν(S)
                                          (∂a R)S + (∂a S) (ν(R) = true)
               R +S      ν(R) ∨ ν(S)               (∂a R) + (∂a S)
                 R∗         true                      (∂a R)R ∗

                         ⇒             d(fg ) = f (dg ) + (df )g


@tmiya : Coq    ,                                                             7
(1/4)

                    30
      Inductive RegExp : Set :=    (*                   *)
      | Empty : RegExp     (*      *)
      | Eps : RegExp    (*         *)
      | Char : ascii -> RegExp    (*       *)
      | Cat : RegExp -> RegExp -> RegExp    (*         *)
      | Or : RegExp -> RegExp -> RegExp    (*         *)
      | Star : RegExp -> RegExp    (*            *)
      Notation "a ++ b" := (Cat a b).
      Notation "a || b" := (Or a b).




@tmiya : Coq   ,                                             8
(2/4)



      Fixpoint nu(re:RegExp):bool :=
      match re with
      | Empty => false
      | Eps => true
      | Char c => false
      | Cat r s => (nu r && nu s)%bool
      | Or r s => (nu r || nu s)%bool
      | Star r => true
      end.




@tmiya : Coq   ,                         9
(3/4)
      Fixpoint derive(a:ascii)(re:RegExp):RegExp :=
      match re with
      | Empty => Empty
      | Eps => Empty
      | Char c => match (ascii_dec c a) with
       | left _ => Eps
       | right _ => Empty
       end
      | Cat r s => match (nu r) with
        | true => ((derive a r) ++ s) || (derive a s)
        | false => (derive a r) ++ s
        end
      | Or r s => (derive a r) || (derive a s)
      | Star r => (derive a r) ++ (Star r)
      end.
      Notation "re / a" := (derive a re).

@tmiya : Coq   ,                                        10
(4/4)



      Fixpoint matches (re:RegExp)(s:string) : bool :=
      match s with
      | EmptyString => nu re
      | String a w => matches (re / a) w
      end.
      Notation "re ~= s" := (matches re s) (at level 60).




@tmiya : Coq   ,                                            11
Kleene

Kleene
      ”A Completeness Theorem for Kleene Algebras and the Algebra of
      Regular Events,” D. Kozen (1994)
                                    ∅ 0        1
                 •   x + (y + z) = (x + y ) + z, x(yz) = (xy )z :
                 •   x +y =y +z :
                 •   x(y + z) = xy + xz, (x + y )z = xz + yz :
                 •   x + 0 = 0 + x = x, 1x = x1 = x :
                 •   x0 = 0x = 0 :
               x +x =x :
               Kleene-star                    (x ≤ y ⇔ x + y = y )
                 • 1 + xx ∗ ≤ x ∗ , 1 + x ∗ x ≤ x ∗
                 • x + yz ≤ z ⇒ y ∗ x ≤ z
                 • x + yz ≤ y ⇒ xy ∗ ≤ z
                                    Kleene
                          :
                          :
@tmiya : Coq          ,                                                12
Kleene

          (1/3)
               Brzozowski                                          Kleene
                                                    Coq
                 •       1500
                 •

                                                                    Setoid
                                =⇒ setoid_rewrite         tactic
                 •                           Brzozowski            Coq

                 •

                     Kleene
                 • ”A tactic for deciding Kleene algebras”
                 •


@tmiya : Coq         ,                                                       13
Kleene

          (2/3)

                                               Coq

                 •
                                          induction re.
                 • Or         Cat, Star
                 • =⇒      induction s.




               Lemma divide_Cat : forall s r’ r’’, (r’ ++ r’’) ~== s ->
                 {s’:string & {s’’:string | s = (s’ ++ s’’)%string /
                 r’ ~== s’ / r’’ ~== s’’ }}.



@tmiya : Coq         ,                                                    14
Kleene

          (3/3)

                                     + +rr ∗ = r ∗
               +   +r ∗ r   =   r∗
               • r∗                   r              =⇒ r ∗

                 Lemma Star_to_list : forall s r, (Star r) ~== s ->
                   {ss:list string |
                     forallb (fun s => r ~= s) ss = true /
                     concat_list_string ss = s /
                     forallb (fun s => bneq_empty_string s) ss = true }.
               • s
               • refine (induction_ltof2 string str_length _ _).
                         Setoid



@tmiya : Coq         ,                                               15
User Contribution

Coq User Contribution
      INRIA    The Coq User’s Contributions
        1. Makefile
               • Make
                 -R . RegExp
                 Char.v
                 ...
                 RegExp.v
                   (Coqdoc                 )
               • $ coq_makefile -f Make -o Makefile
               • $ make clean all all-gal.pdf html
               • $ tar -cf RegExp.tar Makefile *.v
         2. tar                      upload
         3. Coq user contributions            submit
               •                              Coq
                   LGPL

@tmiya : Coq       ,                                   16
Brzozowski                    (   )

                                       Kleene

               Coq
               INRIA     User contribution




@tmiya : Coq         ,                               17

More Related Content

What's hot

Class 18: Measuring Cost
Class 18: Measuring CostClass 18: Measuring Cost
Class 18: Measuring CostDavid Evans
 
Calculus II - 16
Calculus II - 16Calculus II - 16
Calculus II - 16David Mao
 
Modern C++ Lunch and Learn
Modern C++ Lunch and LearnModern C++ Lunch and Learn
Modern C++ Lunch and LearnPaul Irwin
 
GECon2017_Cpp a monster that no one likes but that will outlast them all _Ya...
GECon2017_Cpp  a monster that no one likes but that will outlast them all _Ya...GECon2017_Cpp  a monster that no one likes but that will outlast them all _Ya...
GECon2017_Cpp a monster that no one likes but that will outlast them all _Ya...GECon_Org Team
 
GECon 2017: C++ - a Monster that no one likes but that will outlast them all
GECon 2017: C++ - a Monster that no one likes but that will outlast them allGECon 2017: C++ - a Monster that no one likes but that will outlast them all
GECon 2017: C++ - a Monster that no one likes but that will outlast them allYauheni Akhotnikau
 
Calculus II - 15
Calculus II - 15Calculus II - 15
Calculus II - 15David Mao
 
Organizing Numerical Theories using Axiomatic Type Classes
Organizing Numerical Theories using Axiomatic Type ClassesOrganizing Numerical Theories using Axiomatic Type Classes
Organizing Numerical Theories using Axiomatic Type ClassesLawrence Paulson
 
Otter 2014-12-08-02
Otter 2014-12-08-02Otter 2014-12-08-02
Otter 2014-12-08-02Ruo Ando
 
証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議Hiroki Mizuno
 
Cinemàtica directa e inversa de manipulador
Cinemàtica directa e inversa de manipuladorCinemàtica directa e inversa de manipulador
Cinemàtica directa e inversa de manipuladorc3stor
 
D言語をたまには真面目に紹介してみる
D言語をたまには真面目に紹介してみるD言語をたまには真面目に紹介してみる
D言語をたまには真面目に紹介してみるN Masahiro
 
Generating and Analyzing Events
Generating and Analyzing EventsGenerating and Analyzing Events
Generating and Analyzing Eventsztellman
 

What's hot (13)

Class 18: Measuring Cost
Class 18: Measuring CostClass 18: Measuring Cost
Class 18: Measuring Cost
 
Calculus II - 16
Calculus II - 16Calculus II - 16
Calculus II - 16
 
Modern C++ Lunch and Learn
Modern C++ Lunch and LearnModern C++ Lunch and Learn
Modern C++ Lunch and Learn
 
GECon2017_Cpp a monster that no one likes but that will outlast them all _Ya...
GECon2017_Cpp  a monster that no one likes but that will outlast them all _Ya...GECon2017_Cpp  a monster that no one likes but that will outlast them all _Ya...
GECon2017_Cpp a monster that no one likes but that will outlast them all _Ya...
 
GECon 2017: C++ - a Monster that no one likes but that will outlast them all
GECon 2017: C++ - a Monster that no one likes but that will outlast them allGECon 2017: C++ - a Monster that no one likes but that will outlast them all
GECon 2017: C++ - a Monster that no one likes but that will outlast them all
 
Calculus II - 15
Calculus II - 15Calculus II - 15
Calculus II - 15
 
Organizing Numerical Theories using Axiomatic Type Classes
Organizing Numerical Theories using Axiomatic Type ClassesOrganizing Numerical Theories using Axiomatic Type Classes
Organizing Numerical Theories using Axiomatic Type Classes
 
Otter 2014-12-08-02
Otter 2014-12-08-02Otter 2014-12-08-02
Otter 2014-12-08-02
 
証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議
 
Cinemàtica directa e inversa de manipulador
Cinemàtica directa e inversa de manipuladorCinemàtica directa e inversa de manipulador
Cinemàtica directa e inversa de manipulador
 
D言語をたまには真面目に紹介してみる
D言語をたまには真面目に紹介してみるD言語をたまには真面目に紹介してみる
D言語をたまには真面目に紹介してみる
 
Integralion Formulae 1
Integralion Formulae 1Integralion Formulae 1
Integralion Formulae 1
 
Generating and Analyzing Events
Generating and Analyzing EventsGenerating and Analyzing Events
Generating and Analyzing Events
 

Similar to Proofsummit2011a

Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02Hiroki Mizuno
 
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...Alex Pruden
 
「Frama-Cによるソースコード検証」 (mzp)
「Frama-Cによるソースコード検証」 (mzp)「Frama-Cによるソースコード検証」 (mzp)
「Frama-Cによるソースコード検証」 (mzp)Hiroki Mizuno
 
MLIP - Chapter 4 - Image classification and CNNs
MLIP - Chapter 4 - Image classification and CNNsMLIP - Chapter 4 - Image classification and CNNs
MLIP - Chapter 4 - Image classification and CNNsCharles Deledalle
 
T. Popov - Drinfeld-Jimbo and Cremmer-Gervais Quantum Lie Algebras
T. Popov - Drinfeld-Jimbo and Cremmer-Gervais Quantum Lie AlgebrasT. Popov - Drinfeld-Jimbo and Cremmer-Gervais Quantum Lie Algebras
T. Popov - Drinfeld-Jimbo and Cremmer-Gervais Quantum Lie AlgebrasSEENET-MTP
 
Relaxation methods for the matrix exponential on large networks
Relaxation methods for the matrix exponential on large networksRelaxation methods for the matrix exponential on large networks
Relaxation methods for the matrix exponential on large networksDavid Gleich
 
Hecke Operators on Jacobi Forms of Lattice Index and the Relation to Elliptic...
Hecke Operators on Jacobi Forms of Lattice Index and the Relation to Elliptic...Hecke Operators on Jacobi Forms of Lattice Index and the Relation to Elliptic...
Hecke Operators on Jacobi Forms of Lattice Index and the Relation to Elliptic...Ali Ajouz
 
Engr 371 final exam april 2010
Engr 371 final exam april 2010Engr 371 final exam april 2010
Engr 371 final exam april 2010amnesiann
 
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
 
Cosmological Perturbations and Numerical Simulations
Cosmological Perturbations and Numerical SimulationsCosmological Perturbations and Numerical Simulations
Cosmological Perturbations and Numerical SimulationsIan Huston
 
Elliptical curve cryptography
Elliptical curve cryptographyElliptical curve cryptography
Elliptical curve cryptographyBarani Tharan
 
The Persistent Homology of Distance Functions under Random Projection
The Persistent Homology of Distance Functions under Random ProjectionThe Persistent Homology of Distance Functions under Random Projection
The Persistent Homology of Distance Functions under Random ProjectionDon Sheehy
 
Joel Spencer – Finding Needles in Exponential Haystacks
Joel Spencer – Finding Needles in Exponential Haystacks Joel Spencer – Finding Needles in Exponential Haystacks
Joel Spencer – Finding Needles in Exponential Haystacks Yandex
 
Trilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operatorsTrilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operatorsVjekoslavKovac1
 
Unit 1-logic
Unit 1-logicUnit 1-logic
Unit 1-logicraksharao
 

Similar to Proofsummit2011a (20)

Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02
 
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
zkStudyClub: PLONKUP & Reinforced Concrete [Luke Pearson, Joshua Fitzgerald, ...
 
「Frama-Cによるソースコード検証」 (mzp)
「Frama-Cによるソースコード検証」 (mzp)「Frama-Cによるソースコード検証」 (mzp)
「Frama-Cによるソースコード検証」 (mzp)
 
MLIP - Chapter 4 - Image classification and CNNs
MLIP - Chapter 4 - Image classification and CNNsMLIP - Chapter 4 - Image classification and CNNs
MLIP - Chapter 4 - Image classification and CNNs
 
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
 
Ch01
Ch01Ch01
Ch01
 
T. Popov - Drinfeld-Jimbo and Cremmer-Gervais Quantum Lie Algebras
T. Popov - Drinfeld-Jimbo and Cremmer-Gervais Quantum Lie AlgebrasT. Popov - Drinfeld-Jimbo and Cremmer-Gervais Quantum Lie Algebras
T. Popov - Drinfeld-Jimbo and Cremmer-Gervais Quantum Lie Algebras
 
0802 ch 8 day 2
0802 ch 8 day 20802 ch 8 day 2
0802 ch 8 day 2
 
Relaxation methods for the matrix exponential on large networks
Relaxation methods for the matrix exponential on large networksRelaxation methods for the matrix exponential on large networks
Relaxation methods for the matrix exponential on large networks
 
Taylor problem
Taylor problemTaylor problem
Taylor problem
 
Hecke Operators on Jacobi Forms of Lattice Index and the Relation to Elliptic...
Hecke Operators on Jacobi Forms of Lattice Index and the Relation to Elliptic...Hecke Operators on Jacobi Forms of Lattice Index and the Relation to Elliptic...
Hecke Operators on Jacobi Forms of Lattice Index and the Relation to Elliptic...
 
Engr 371 final exam april 2010
Engr 371 final exam april 2010Engr 371 final exam april 2010
Engr 371 final exam april 2010
 
C4 January 2012 QP
C4 January 2012 QPC4 January 2012 QP
C4 January 2012 QP
 
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
 
Cosmological Perturbations and Numerical Simulations
Cosmological Perturbations and Numerical SimulationsCosmological Perturbations and Numerical Simulations
Cosmological Perturbations and Numerical Simulations
 
Elliptical curve cryptography
Elliptical curve cryptographyElliptical curve cryptography
Elliptical curve cryptography
 
The Persistent Homology of Distance Functions under Random Projection
The Persistent Homology of Distance Functions under Random ProjectionThe Persistent Homology of Distance Functions under Random Projection
The Persistent Homology of Distance Functions under Random Projection
 
Joel Spencer – Finding Needles in Exponential Haystacks
Joel Spencer – Finding Needles in Exponential Haystacks Joel Spencer – Finding Needles in Exponential Haystacks
Joel Spencer – Finding Needles in Exponential Haystacks
 
Trilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operatorsTrilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operators
 
Unit 1-logic
Unit 1-logicUnit 1-logic
Unit 1-logic
 

More from tmiya

Coq Tutorial at Proof Summit 2011
Coq Tutorial at Proof Summit 2011Coq Tutorial at Proof Summit 2011
Coq Tutorial at Proof Summit 2011tmiya
 
Typeclass
TypeclassTypeclass
Typeclasstmiya
 
Coq Tutorial
Coq TutorialCoq Tutorial
Coq Tutorialtmiya
 
RegExp20110305
RegExp20110305RegExp20110305
RegExp20110305tmiya
 
Coq setoid 20110129
Coq setoid 20110129Coq setoid 20110129
Coq setoid 20110129tmiya
 
Coq Party 20101127
Coq Party 20101127Coq Party 20101127
Coq Party 20101127tmiya
 
Maude20100719
Maude20100719Maude20100719
Maude20100719tmiya
 
Formal methods20100529
Formal methods20100529Formal methods20100529
Formal methods20100529tmiya
 
Coq 20100208a
Coq 20100208aCoq 20100208a
Coq 20100208atmiya
 

More from tmiya (9)

Coq Tutorial at Proof Summit 2011
Coq Tutorial at Proof Summit 2011Coq Tutorial at Proof Summit 2011
Coq Tutorial at Proof Summit 2011
 
Typeclass
TypeclassTypeclass
Typeclass
 
Coq Tutorial
Coq TutorialCoq Tutorial
Coq Tutorial
 
RegExp20110305
RegExp20110305RegExp20110305
RegExp20110305
 
Coq setoid 20110129
Coq setoid 20110129Coq setoid 20110129
Coq setoid 20110129
 
Coq Party 20101127
Coq Party 20101127Coq Party 20101127
Coq Party 20101127
 
Maude20100719
Maude20100719Maude20100719
Maude20100719
 
Formal methods20100529
Formal methods20100529Formal methods20100529
Formal methods20100529
 
Coq 20100208a
Coq 20100208aCoq 20100208a
Coq 20100208a
 

Recently uploaded

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Recently uploaded (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
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...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Proofsummit2011a

  • 1. Proof Summit 2011 Coq @tmiya September 25,2011 @tmiya : Coq , 1
  • 2. @tmiya_ SIer 2007 LL Spirit Coq • Coq • Haskell Scala 2009 Agda • @yoshihiro503 bool Prop • =⇒ Coq 2010 2 @kencoba Formal Methods Forum • • ProofCafe : Coq @tmiya : Coq , 2
  • 3. Coq User Contribution @tmiya : Coq , 3
  • 4. — @kinaba d. y. d. @tmiya : Coq , 4
  • 5. (regular expression) ∅ "a" "b" ... L1 , L2 {xy |x ∈ L1 , y ∈ L2 } L1 , L2 L1 ∪ L2 L 0 ∪ {x|x ∈ L} ∪ {xx|x ∈ L} ∪ . . . @tmiya : Coq , 5
  • 6. ”Derivatives of Regular Expressions”, Janusz Brzozowski, Journal of the ACM 1964. R(s) : s R { ν(R) (s = ””) R(s) = (∂a R)(s ) (s = a :: s ) ν(R) = R ∂a R = R a NFA R a ∂a R ”Yacc is Dead” (http://arxiv.org/abs/1010.5023) 2011 Brzozowski @tmiya : Coq , 6
  • 7. R ν(R) ∂a R ∅ false ∅ true { ∅ (c = a) "c" false { ∅ (c = a) (∂a R)S (ν(R) = false) RS ν(R) ∧ ν(S) (∂a R)S + (∂a S) (ν(R) = true) R +S ν(R) ∨ ν(S) (∂a R) + (∂a S) R∗ true (∂a R)R ∗ ⇒ d(fg ) = f (dg ) + (df )g @tmiya : Coq , 7
  • 8. (1/4) 30 Inductive RegExp : Set := (* *) | Empty : RegExp (* *) | Eps : RegExp (* *) | Char : ascii -> RegExp (* *) | Cat : RegExp -> RegExp -> RegExp (* *) | Or : RegExp -> RegExp -> RegExp (* *) | Star : RegExp -> RegExp (* *) Notation "a ++ b" := (Cat a b). Notation "a || b" := (Or a b). @tmiya : Coq , 8
  • 9. (2/4) Fixpoint nu(re:RegExp):bool := match re with | Empty => false | Eps => true | Char c => false | Cat r s => (nu r && nu s)%bool | Or r s => (nu r || nu s)%bool | Star r => true end. @tmiya : Coq , 9
  • 10. (3/4) Fixpoint derive(a:ascii)(re:RegExp):RegExp := match re with | Empty => Empty | Eps => Empty | Char c => match (ascii_dec c a) with | left _ => Eps | right _ => Empty end | Cat r s => match (nu r) with | true => ((derive a r) ++ s) || (derive a s) | false => (derive a r) ++ s end | Or r s => (derive a r) || (derive a s) | Star r => (derive a r) ++ (Star r) end. Notation "re / a" := (derive a re). @tmiya : Coq , 10
  • 11. (4/4) Fixpoint matches (re:RegExp)(s:string) : bool := match s with | EmptyString => nu re | String a w => matches (re / a) w end. Notation "re ~= s" := (matches re s) (at level 60). @tmiya : Coq , 11
  • 12. Kleene Kleene ”A Completeness Theorem for Kleene Algebras and the Algebra of Regular Events,” D. Kozen (1994) ∅ 0 1 • x + (y + z) = (x + y ) + z, x(yz) = (xy )z : • x +y =y +z : • x(y + z) = xy + xz, (x + y )z = xz + yz : • x + 0 = 0 + x = x, 1x = x1 = x : • x0 = 0x = 0 : x +x =x : Kleene-star (x ≤ y ⇔ x + y = y ) • 1 + xx ∗ ≤ x ∗ , 1 + x ∗ x ≤ x ∗ • x + yz ≤ z ⇒ y ∗ x ≤ z • x + yz ≤ y ⇒ xy ∗ ≤ z Kleene : : @tmiya : Coq , 12
  • 13. Kleene (1/3) Brzozowski Kleene Coq • 1500 • Setoid =⇒ setoid_rewrite tactic • Brzozowski Coq • Kleene • ”A tactic for deciding Kleene algebras” • @tmiya : Coq , 13
  • 14. Kleene (2/3) Coq • induction re. • Or Cat, Star • =⇒ induction s. Lemma divide_Cat : forall s r’ r’’, (r’ ++ r’’) ~== s -> {s’:string & {s’’:string | s = (s’ ++ s’’)%string / r’ ~== s’ / r’’ ~== s’’ }}. @tmiya : Coq , 14
  • 15. Kleene (3/3) + +rr ∗ = r ∗ + +r ∗ r = r∗ • r∗ r =⇒ r ∗ Lemma Star_to_list : forall s r, (Star r) ~== s -> {ss:list string | forallb (fun s => r ~= s) ss = true / concat_list_string ss = s / forallb (fun s => bneq_empty_string s) ss = true }. • s • refine (induction_ltof2 string str_length _ _). Setoid @tmiya : Coq , 15
  • 16. User Contribution Coq User Contribution INRIA The Coq User’s Contributions 1. Makefile • Make -R . RegExp Char.v ... RegExp.v (Coqdoc ) • $ coq_makefile -f Make -o Makefile • $ make clean all all-gal.pdf html • $ tar -cf RegExp.tar Makefile *.v 2. tar upload 3. Coq user contributions submit • Coq LGPL @tmiya : Coq , 16
  • 17. Brzozowski ( ) Kleene Coq INRIA User contribution @tmiya : Coq , 17