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

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
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
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
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
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
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
 
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
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

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