Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Coq で証明付き Web アプリを作る #adf2015

B4bd460c2e559d6c151c0541f2d3f719?s=47 Shohei Yasutake
March 29, 2015
800

Coq で証明付き Web アプリを作る #adf2015

B4bd460c2e559d6c151c0541f2d3f719?s=128

Shohei Yasutake

March 29, 2015
Tweet

Transcript

  1. Coq Ͱূ໌෇͖ Web ΞϓϦΛ࡞Δ @amutake @amutake_s

  2. Coq? • ఆཧূ໌ࢧԉܥͷͻͱͭ • ؔ਺Λॻ͍ͯɺͦͷؔ਺ͷੑ࣭Λূ໌Ͱ͖Δ • ྫ: forall l :

    list A, reverse (reverse l) = l. • Coq ୯ମͰϓϩάϥϜͷ࣮ߦ͸Ͱ͖ͳ͍͕ɺ OCaml, Haskell, Scheme ʹม׵Մೳ
  3. OCaml, Haskell, Scheme ʹม׵Մೳ

  4. → Coq Ͱ΋ Web ΞϓϦ͕ ࡞ΕΔʂ(΍ͬͨʔʂ)

  5. ࡞Γํᶃ • ෭࡞༻Λىؔ͜͢਺͸ Coq Ͱ͸ఆٛͰ͖ͳ͍ͷͰɺ७ਮͳ ෦෼͚ͩΛ Coq Ͱ࡞ͬͯɺ͏·͍͜ͱ OCaml ͱ࿈ܞ͢Δ

  6. ࡞Γํᶄ • Coq ͷ΄͏͸ Request -> Response ͷؔ ਺Λ࡞Δ͚ͩ

  7. ࡞Γํᶅ (Coq Λ஌͍ͬͯΔਓ޲͚) • Ͳ͏ͯ͠΋෭࡞༻Λىؔ͜͢਺͕࢖͍͍ͨ৔ ߹͸ Parameter (ܕ͚ͩͰ࣮ମ͕ະఆٛͳ஋) ͳͲΛ࢖͍ɺOCaml ͷؔ਺Λࢦఆ͢Δ

    Parameter read_file : string -> option string. Extract Constant read_file => “MyModule.read_file”.
  8. ࣮༻ྫ (clarus/coq-chick-blog) • https://github.com/clarus/coq-chick-blog • Coq ੡ϒϩάΤϯδϯ • http://coq-blog.clarus.me/ ←

    ͜ͷϒϩά Coq (͔Βม׵͞Εͨ OCaml) Ͱಈ͍ͯΔ
  9. Ͳ͜Λূ໌͢Δͷ • ূ໌͍ͨ͠ਓ͸ͳΜ͔ద౰ʹ͢Ε͹͍͍Μ͡Ό ͳ͍Ͱ͠ΐ͏͔ • clarus/coq-chick-blog Ͱ͸ɺʮϩάΠϯ͠ ͍ͯͳ͍৔߹͸هࣄΛฤूͰ͖ͳ͍ʯΈͨ ͍ͳ͜ͱΛূ໌͍ͯ͠Δ

  10. ࠓޙͷ՝୊ɾ·ͱΊ • ϥΠϒϥϦԽ͍ͨ͠ • OCaml ͷ෦෼͸͍͍ͩͨڞ௨ • Request -> Response

    ͚ͩॻ͚͹ಈ͘Α͏ʹ͍ͨ͠ • Coq ָ͍͠ͷͰ࢖ͬͯΈ͍ͯͩ͘͞ʂ • ͓͢͢Ίॳ৺ऀ޲͚: http://proofcafe.org/sf/
  11. ༨ஊ: @clarus ͞ΜͭΑ͍ • Coq Λ Real World Ͱ࢖͑ΔΑ͏ʹ͠Α͏ͱ͍ͯ͠Δਓ (Inria

    ͷ PhD student) • ࠷ۙ͸ io γϦʔζ (io, io-system, io-system-ocaml, …) Λ࡞͍ͬͯΔ • Coq ্Ͱ IO Effect Λදݱ͢ΔϥΠϒϥϦ܈ (coq-chick-blog ͷதͰ ࢖͍ͬͯΔ IO ෦෼ΛϥΠϒϥϦͱͯ͠੾Γग़ͨ͠΋ͷͬΆ͍) • OCaml ίʔυΛॻ͔ͣʹ Coq Λม׵ͯͦ͠ͷ··࣮ߦͰ͖ͨΓ • 3೔લ͸ Coq ͷόάΛ͍ͭͯ೚ҙͷ໋୊Λূ໌Ͱ͖ΔϥΠϒϥϦΛެ։͠ ͯͨ