SlideShare a Scribd company logo
1 of 50
2011/05/14 Boost.




Frama-C

  mzp /




          1
mzp /

        SE



> ocaml-nagoya
> ProofCafe
>       Scala

                 2
2/26   Ruby   02




       4
Reject




    5
Reject



   →




       5
@bleis             bf                           SQL

@sunflat     Amazon EC2

@yoya     PHP: ZendEngine

@terurou    CommonJS

@nari3     GC

@mallowlabs     AsakusaSattelite

@yoshihiro503                 Coq

@mzp

@wof_moriguchi F#

@keigoi     ocamljs     ocaml android   (       )

@osiire    GADT

@kaizen_nagoya                          XYZ

@dico_leque       Meta-objective Lisp

                                            6
@bleis             bf                           SQL

@sunflat     Amazon EC2

@yoya     PHP: ZendEngine

@terurou    CommonJS

@nari3     GC

@mallowlabs     AsakusaSattelite

@yoshihiro503                 Coq

@mzp                                                  !
@wof_moriguchi F#

@keigoi     ocamljs     ocaml android   (       )

@osiire    GADT

@kaizen_nagoya                          XYZ

@dico_leque       Meta-objective Lisp

                                            7
RubyKaigi2011




      8
!
:min()
min()

        2




        ←

            11
template


     ≦                                 OK

     >           (structual subtype)

template <class T>
T min(T x, T y) {
  return (x <= y) ? x : y;
}
                       12
auto concept Le<class T> {
  bool operator<=(T, T);
}

template <class T> requires Le<T>
T min(T x, T y) {
  return x <= y ? x : y;
}

                    13
// int
BOOST_CHECK_EQUAL( min(1, 2), 1 );
BOOST_CHECK_EQUAL( min(2, 1), 1 );
BOOST_CHECK_EQUAL( min(3, 3), 3 );

// dobule
BOOST_CHECK_EQUAL( min(1., 2.), 1. );
BOOST_CHECK_EQUAL( min(2., 1.), 1. );
                      14
...

3




    ←

        15
1

     min

               ≦                OK

template <class T> requires Le<T>
T min3(T x, T y, T z) {
  return min(x, min(y, z));
}
                   16
// int
BOOST_CHECK_EQUAL( min3(1, 2,3), 1 );
BOOST_CHECK_EQUAL( min3(2, 1,3), 1 );
BOOST_CHECK_EQUAL( min3(3, 2,1), 1 );

// dobule
BOOST_CHECK_EQUAL( min3(1., 2.,4.), 1. );
BOOST_CHECK_EQUAL( min3(2., 1.,4.), 1. );
                      17
..
“       ”: int   int

≦        :x≦y          z≦w           (x,z) ≦
(y,w)

                       &'(           !"#"$




    ←                        !"#%$           !%#"$



                       )*(           !%#%$

                       19
“       ”: int   int

≦        :x≦y          z≦w           (x,z) ≦
(y,w)

                       &'(           !"#"$




    ←                        !"#%$           !%#"$



                       )*(           !%#%$

                       19
≦                      OK ←




>       :x≦x

>       :x≦y   y≦z   x≦z

↑

               20
>   ≦ bool
     min,min3

↑



                21
...
...
Frama-C[1]
C



> Value Analysis, Effects Analysis, etc




                        24
C → Why →

>   Alt-Ergo:         ←

>   Coq:          ←

>   ...and more

        ACSL

>   ACSL = ANSI/ISO C Specification Language



!"#$#%&                   '()                 *+,%-"./


                           25
                                               00&/1
: abs()

     abs      :         0

     ACSL


//@ ensures result >= 0;
int abs (int i) {
  return i < 0 ? -i : i;
}
                   26
$ frama-c -jessie abs.c




                     27
$ frama-c -jessie abs.c




                     27
$ frama-c -jessie abs.c




                     27
$ frama-c -jessie abs.c




                !

                     27
$ frama-c -jessie abs.c




                          INT_MIN

                !

                     27
requires

          INT_MIN


//@ requires i > -2147483648;
//@ ensures result >= 0;
int abs (int i) {
  return i < 0 ? -i : i;

                    28
29
Frama-C
    C++
C C++

>         Frama-C




           30
: LE
     ≦                        → LE

    >C          ACSL




/*@ axiomatic order {
  predicate LE(T x, T y);
} */
                       31
Frama-C

     min,min3 C++                     Frama-C


     T                      → void*

                      →

     >


typedef void* T;
bool leq(T x, T y) { return true; }

                       32
leq
    leq       :              LE

    > leq(x,y) true     LE(x,y)

    > leq(x,y) false        LE(y, x)

/*@ ensures
 (¥result == true ==> LE(x,y)) &&
 (¥result == false ==> LE(y,x)); */
bool leq(T x, T y){ ... }
                       33
min

      leq         min

                             x,y


/*@ ensures LE(¥result, x) &&
       LE(¥result, y); */
T min(T x,T y){ return leq(x,y) ? x : y; }
                        34
→




35
LE(y_0_0, y_0_0)

LE(y,y)




          36
/*@ axiomatic order {
 predicate LE(T x, T y);
 axiom refl : ¥forall T x; LE(x,x);




                           ←
                      37
min3
     min3        :          x,y,z


/*@ ensures
 LE(result, x) &&
 LE(result, y) &&
 LE(result, z); */
T min3(T x,T y,T z){
 return min(x, min(y,z));
                     38
39
>       Coq
    →



              LE(        , min(y,z))
              LE(min(y,z), y)

              LE(        , y)
                    40
/*@ axiomatic order {
 predicate LE(T x, T y);
 axiom refl : ¥forall T x; LE(x,x);
 axiom trans: forall T x,T y,T z;
  LE(x,y) ==> LE(y,z) ==> LE(x,z);




                         ←
                    41
Frama-C


      min,min3



                 42
:ProofSummit


9/25(   ) 10:00    17:00

                       @

http://bit.ly/proofsummit
Coq,Agda2



                  43

More Related Content

What's hot

暗号技術の実装と数学
暗号技術の実装と数学暗号技術の実装と数学
暗号技術の実装と数学MITSUNARI Shigeo
 
やはりお前らのMVCは間違っている
やはりお前らのMVCは間違っているやはりお前らのMVCは間違っている
やはりお前らのMVCは間違っているKoichi Tanaka
 
こわくない Git
こわくない Gitこわくない Git
こわくない GitKota Saito
 
エンジニアの個人ブランディングと技術組織
エンジニアの個人ブランディングと技術組織エンジニアの個人ブランディングと技術組織
エンジニアの個人ブランディングと技術組織Takafumi ONAKA
 
遺伝的アルゴリズム (Genetic Algorithm)を始めよう!
遺伝的アルゴリズム(Genetic Algorithm)を始めよう!遺伝的アルゴリズム(Genetic Algorithm)を始めよう!
遺伝的アルゴリズム (Genetic Algorithm)を始めよう!Kazuhide Okamura
 
世界一わかりやすいClean Architecture
世界一わかりやすいClean Architecture世界一わかりやすいClean Architecture
世界一わかりやすいClean ArchitectureAtsushi Nakamura
 
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」Ken'ichi Matsui
 
「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)
「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)
「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)parrotstudio
 
モジュールの凝集度・結合度・インタフェース
モジュールの凝集度・結合度・インタフェースモジュールの凝集度・結合度・インタフェース
モジュールの凝集度・結合度・インタフェースHajime Yanagawa
 
深層学習フレームワークにおけるIntel CPU/富岳向け最適化法
深層学習フレームワークにおけるIntel CPU/富岳向け最適化法深層学習フレームワークにおけるIntel CPU/富岳向け最適化法
深層学習フレームワークにおけるIntel CPU/富岳向け最適化法MITSUNARI Shigeo
 
オブジェクト指向できていますか?
オブジェクト指向できていますか?オブジェクト指向できていますか?
オブジェクト指向できていますか?Moriharu Ohzu
 
「世界モデル」と関連研究について
「世界モデル」と関連研究について「世界モデル」と関連研究について
「世界モデル」と関連研究についてMasahiro Suzuki
 
組み込み入門
組み込み入門組み込み入門
組み込み入門Yuki Suga
 
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」Takuto Wada
 
15分でわかる(範囲の)ベイズ統計学
15分でわかる(範囲の)ベイズ統計学15分でわかる(範囲の)ベイズ統計学
15分でわかる(範囲の)ベイズ統計学Ken'ichi Matsui
 
Optunaを使ったHuman-in-the-loop最適化の紹介 - 2023/04/27 W&B 東京ミートアップ #3
Optunaを使ったHuman-in-the-loop最適化の紹介 - 2023/04/27 W&B 東京ミートアップ #3Optunaを使ったHuman-in-the-loop最適化の紹介 - 2023/04/27 W&B 東京ミートアップ #3
Optunaを使ったHuman-in-the-loop最適化の紹介 - 2023/04/27 W&B 東京ミートアップ #3Preferred Networks
 
Djangoフレームワークの紹介
Djangoフレームワークの紹介Djangoフレームワークの紹介
Djangoフレームワークの紹介Shinya Okano
 
グラフィカルモデル入門
グラフィカルモデル入門グラフィカルモデル入門
グラフィカルモデル入門Kawamoto_Kazuhiko
 

What's hot (20)

暗号技術の実装と数学
暗号技術の実装と数学暗号技術の実装と数学
暗号技術の実装と数学
 
Marp Tutorial
Marp TutorialMarp Tutorial
Marp Tutorial
 
やはりお前らのMVCは間違っている
やはりお前らのMVCは間違っているやはりお前らのMVCは間違っている
やはりお前らのMVCは間違っている
 
こわくない Git
こわくない Gitこわくない Git
こわくない Git
 
エンジニアの個人ブランディングと技術組織
エンジニアの個人ブランディングと技術組織エンジニアの個人ブランディングと技術組織
エンジニアの個人ブランディングと技術組織
 
遺伝的アルゴリズム (Genetic Algorithm)を始めよう!
遺伝的アルゴリズム(Genetic Algorithm)を始めよう!遺伝的アルゴリズム(Genetic Algorithm)を始めよう!
遺伝的アルゴリズム (Genetic Algorithm)を始めよう!
 
世界一わかりやすいClean Architecture
世界一わかりやすいClean Architecture世界一わかりやすいClean Architecture
世界一わかりやすいClean Architecture
 
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
 
「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)
「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)
「再代入なんて、あるわけない」 ~ふつうのプログラマが関数型言語を知るべき理由~ (Gunma.web #5 2011/05/14)
 
モジュールの凝集度・結合度・インタフェース
モジュールの凝集度・結合度・インタフェースモジュールの凝集度・結合度・インタフェース
モジュールの凝集度・結合度・インタフェース
 
深層学習フレームワークにおけるIntel CPU/富岳向け最適化法
深層学習フレームワークにおけるIntel CPU/富岳向け最適化法深層学習フレームワークにおけるIntel CPU/富岳向け最適化法
深層学習フレームワークにおけるIntel CPU/富岳向け最適化法
 
オブジェクト指向できていますか?
オブジェクト指向できていますか?オブジェクト指向できていますか?
オブジェクト指向できていますか?
 
「世界モデル」と関連研究について
「世界モデル」と関連研究について「世界モデル」と関連研究について
「世界モデル」と関連研究について
 
プログラムを高速化する話
プログラムを高速化する話プログラムを高速化する話
プログラムを高速化する話
 
組み込み入門
組み込み入門組み込み入門
組み込み入門
 
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
 
15分でわかる(範囲の)ベイズ統計学
15分でわかる(範囲の)ベイズ統計学15分でわかる(範囲の)ベイズ統計学
15分でわかる(範囲の)ベイズ統計学
 
Optunaを使ったHuman-in-the-loop最適化の紹介 - 2023/04/27 W&B 東京ミートアップ #3
Optunaを使ったHuman-in-the-loop最適化の紹介 - 2023/04/27 W&B 東京ミートアップ #3Optunaを使ったHuman-in-the-loop最適化の紹介 - 2023/04/27 W&B 東京ミートアップ #3
Optunaを使ったHuman-in-the-loop最適化の紹介 - 2023/04/27 W&B 東京ミートアップ #3
 
Djangoフレームワークの紹介
Djangoフレームワークの紹介Djangoフレームワークの紹介
Djangoフレームワークの紹介
 
グラフィカルモデル入門
グラフィカルモデル入門グラフィカルモデル入門
グラフィカルモデル入門
 

Similar to 「Frama-Cによるソースコード検証」 (mzp)

Gentle Introduction to Functional Programming
Gentle Introduction to Functional ProgrammingGentle Introduction to Functional Programming
Gentle Introduction to Functional ProgrammingSaurabh Singh
 
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)François Sarradin
 
Sparse Matrix and Polynomial
Sparse Matrix and PolynomialSparse Matrix and Polynomial
Sparse Matrix and PolynomialAroosa Rajput
 
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...Mozaic Works
 
Compilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMCompilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMLinaro
 
Write Python for Speed
Write Python for SpeedWrite Python for Speed
Write Python for SpeedYung-Yu Chen
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manualUma mohan
 
Yoyak ScalaDays 2015
Yoyak ScalaDays 2015Yoyak ScalaDays 2015
Yoyak ScalaDays 2015ihji
 
C Code and the Art of Obfuscation
C Code and the Art of ObfuscationC Code and the Art of Obfuscation
C Code and the Art of Obfuscationguest9006ab
 
C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0Yaser Zhian
 
Truth, deduction, computation lecture g
Truth, deduction, computation   lecture gTruth, deduction, computation   lecture g
Truth, deduction, computation lecture gVlad Patryshev
 
Halide tutorial 2019
Halide tutorial 2019Halide tutorial 2019
Halide tutorial 2019Champ Yen
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate CompilersFunctional Thursday
 
Current Score – 0 Due Wednesday, November 19 2014 0400 .docx
Current Score  –  0 Due  Wednesday, November 19 2014 0400 .docxCurrent Score  –  0 Due  Wednesday, November 19 2014 0400 .docx
Current Score – 0 Due Wednesday, November 19 2014 0400 .docxfaithxdunce63732
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuacionesNatalia
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuacionesNatalia
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxssuser3cbb4c
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonakaptur
 

Similar to 「Frama-Cによるソースコード検証」 (mzp) (20)

Gentle Introduction to Functional Programming
Gentle Introduction to Functional ProgrammingGentle Introduction to Functional Programming
Gentle Introduction to Functional Programming
 
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)
 
Sparse Matrix and Polynomial
Sparse Matrix and PolynomialSparse Matrix and Polynomial
Sparse Matrix and Polynomial
 
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
 
Compilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMCompilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVM
 
Write Python for Speed
Write Python for SpeedWrite Python for Speed
Write Python for Speed
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
Yoyak ScalaDays 2015
Yoyak ScalaDays 2015Yoyak ScalaDays 2015
Yoyak ScalaDays 2015
 
C Code and the Art of Obfuscation
C Code and the Art of ObfuscationC Code and the Art of Obfuscation
C Code and the Art of Obfuscation
 
C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0
 
Truth, deduction, computation lecture g
Truth, deduction, computation   lecture gTruth, deduction, computation   lecture g
Truth, deduction, computation lecture g
 
Halide tutorial 2019
Halide tutorial 2019Halide tutorial 2019
Halide tutorial 2019
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
 
Vcs16
Vcs16Vcs16
Vcs16
 
Stop Monkeys Fall
Stop Monkeys FallStop Monkeys Fall
Stop Monkeys Fall
 
Current Score – 0 Due Wednesday, November 19 2014 0400 .docx
Current Score  –  0 Due  Wednesday, November 19 2014 0400 .docxCurrent Score  –  0 Due  Wednesday, November 19 2014 0400 .docx
Current Score – 0 Due Wednesday, November 19 2014 0400 .docx
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptx
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
 

More from Hiroki Mizuno

TypeSafe OSの試み
TypeSafe OSの試みTypeSafe OSの試み
TypeSafe OSの試みHiroki Mizuno
 
OCamlでWebアプリケーションを作るn個の方法
OCamlでWebアプリケーションを作るn個の方法OCamlでWebアプリケーションを作るn個の方法
OCamlでWebアプリケーションを作るn個の方法Hiroki Mizuno
 
#NGK2012B Excelによる設計書について
#NGK2012B Excelによる設計書について#NGK2012B Excelによる設計書について
#NGK2012B Excelによる設計書についてHiroki Mizuno
 
Scala基礎勉強会: Featherweight Scalaの紹介および型付け規則の決定可能性について
Scala基礎勉強会: Featherweight Scalaの紹介および型付け規則の決定可能性についてScala基礎勉強会: Featherweight Scalaの紹介および型付け規則の決定可能性について
Scala基礎勉強会: Featherweight Scalaの紹介および型付け規則の決定可能性についてHiroki Mizuno
 
Coq for Moblie Phone @ ML名古屋
Coq for Moblie Phone @ ML名古屋Coq for Moblie Phone @ ML名古屋
Coq for Moblie Phone @ ML名古屋Hiroki Mizuno
 
Darcs紹介@20120423-scmbc
Darcs紹介@20120423-scmbcDarcs紹介@20120423-scmbc
Darcs紹介@20120423-scmbcHiroki Mizuno
 
Gallinaによる証明駆動開発の魅力
Gallinaによる証明駆動開発の魅力Gallinaによる証明駆動開発の魅力
Gallinaによる証明駆動開発の魅力Hiroki Mizuno
 
CoqによるMsgPackの証明
CoqによるMsgPackの証明CoqによるMsgPackの証明
CoqによるMsgPackの証明Hiroki Mizuno
 
20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会Hiroki Mizuno
 
Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02Hiroki Mizuno
 
証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議Hiroki Mizuno
 
Coqによる証明駆動開発
Coqによる証明駆動開発Coqによる証明駆動開発
Coqによる証明駆動開発Hiroki Mizuno
 
NGK忘年会 2010 / CoqからRubyへ
NGK忘年会 2010 / CoqからRubyへNGK忘年会 2010 / CoqからRubyへ
NGK忘年会 2010 / CoqからRubyへHiroki Mizuno
 
From Coq to Ruby / CoqからRubyへ
From Coq to Ruby / CoqからRubyへFrom Coq to Ruby / CoqからRubyへ
From Coq to Ruby / CoqからRubyへHiroki Mizuno
 
OCamlAPISearchの紹介
OCamlAPISearchの紹介OCamlAPISearchの紹介
OCamlAPISearchの紹介Hiroki Mizuno
 

More from Hiroki Mizuno (20)

TypeSafe OSの試み
TypeSafe OSの試みTypeSafe OSの試み
TypeSafe OSの試み
 
OCamlでWebアプリケーションを作るn個の方法
OCamlでWebアプリケーションを作るn個の方法OCamlでWebアプリケーションを作るn個の方法
OCamlでWebアプリケーションを作るn個の方法
 
#NGK2012B Excelによる設計書について
#NGK2012B Excelによる設計書について#NGK2012B Excelによる設計書について
#NGK2012B Excelによる設計書について
 
Scala基礎勉強会: Featherweight Scalaの紹介および型付け規則の決定可能性について
Scala基礎勉強会: Featherweight Scalaの紹介および型付け規則の決定可能性についてScala基礎勉強会: Featherweight Scalaの紹介および型付け規則の決定可能性について
Scala基礎勉強会: Featherweight Scalaの紹介および型付け規則の決定可能性について
 
Java基礎
Java基礎Java基礎
Java基礎
 
Sml#探検隊
Sml#探検隊Sml#探検隊
Sml#探検隊
 
どこでもCoq
どこでもCoqどこでもCoq
どこでもCoq
 
Coq for Moblie Phone @ ML名古屋
Coq for Moblie Phone @ ML名古屋Coq for Moblie Phone @ ML名古屋
Coq for Moblie Phone @ ML名古屋
 
Darcs紹介@20120423-scmbc
Darcs紹介@20120423-scmbcDarcs紹介@20120423-scmbc
Darcs紹介@20120423-scmbc
 
Gallinaによる証明駆動開発の魅力
Gallinaによる証明駆動開発の魅力Gallinaによる証明駆動開発の魅力
Gallinaによる証明駆動開発の魅力
 
CoqによるMsgPackの証明
CoqによるMsgPackの証明CoqによるMsgPackの証明
CoqによるMsgPackの証明
 
20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会20110424 action scriptを使わないflash勉強会
20110424 action scriptを使わないflash勉強会
 
Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02Coq to Rubyによる証明駆動開発@名古屋ruby会議02
Coq to Rubyによる証明駆動開発@名古屋ruby会議02
 
証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議証明駆動開発のたのしみ@名古屋reject会議
証明駆動開発のたのしみ@名古屋reject会議
 
Coqによる証明駆動開発
Coqによる証明駆動開発Coqによる証明駆動開発
Coqによる証明駆動開発
 
NGK忘年会 2010 / CoqからRubyへ
NGK忘年会 2010 / CoqからRubyへNGK忘年会 2010 / CoqからRubyへ
NGK忘年会 2010 / CoqからRubyへ
 
From Coq to Ruby / CoqからRubyへ
From Coq to Ruby / CoqからRubyへFrom Coq to Ruby / CoqからRubyへ
From Coq to Ruby / CoqからRubyへ
 
SacalaZa #1
SacalaZa #1SacalaZa #1
SacalaZa #1
 
CoqUn2010
CoqUn2010CoqUn2010
CoqUn2010
 
OCamlAPISearchの紹介
OCamlAPISearchの紹介OCamlAPISearchの紹介
OCamlAPISearchの紹介
 

Recently uploaded

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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Recently uploaded (20)

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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

「Frama-Cによるソースコード検証」 (mzp)

  • 2. mzp / SE > ocaml-nagoya > ProofCafe > Scala 2
  • 3.
  • 4. 2/26 Ruby 02 4
  • 5. Reject 5
  • 6. Reject → 5
  • 7. @bleis bf SQL @sunflat Amazon EC2 @yoya PHP: ZendEngine @terurou CommonJS @nari3 GC @mallowlabs AsakusaSattelite @yoshihiro503 Coq @mzp @wof_moriguchi F# @keigoi  ocamljs ocaml android ( ) @osiire GADT @kaizen_nagoya XYZ @dico_leque Meta-objective Lisp 6
  • 8. @bleis bf SQL @sunflat Amazon EC2 @yoya PHP: ZendEngine @terurou CommonJS @nari3 GC @mallowlabs AsakusaSattelite @yoshihiro503 Coq @mzp ! @wof_moriguchi F# @keigoi  ocamljs ocaml android ( ) @osiire GADT @kaizen_nagoya XYZ @dico_leque Meta-objective Lisp 7
  • 10. !
  • 11.
  • 12. :min() min() 2 ← 11
  • 13. template ≦ OK > (structual subtype) template <class T> T min(T x, T y) { return (x <= y) ? x : y; } 12
  • 14. auto concept Le<class T> { bool operator<=(T, T); } template <class T> requires Le<T> T min(T x, T y) { return x <= y ? x : y; } 13
  • 15. // int BOOST_CHECK_EQUAL( min(1, 2), 1 ); BOOST_CHECK_EQUAL( min(2, 1), 1 ); BOOST_CHECK_EQUAL( min(3, 3), 3 ); // dobule BOOST_CHECK_EQUAL( min(1., 2.), 1. ); BOOST_CHECK_EQUAL( min(2., 1.), 1. ); 14
  • 16. ... 3 ← 15
  • 17. 1 min ≦ OK template <class T> requires Le<T> T min3(T x, T y, T z) { return min(x, min(y, z)); } 16
  • 18. // int BOOST_CHECK_EQUAL( min3(1, 2,3), 1 ); BOOST_CHECK_EQUAL( min3(2, 1,3), 1 ); BOOST_CHECK_EQUAL( min3(3, 2,1), 1 ); // dobule BOOST_CHECK_EQUAL( min3(1., 2.,4.), 1. ); BOOST_CHECK_EQUAL( min3(2., 1.,4.), 1. ); 17
  • 19. ..
  • 20. ”: int int ≦ :x≦y z≦w (x,z) ≦ (y,w) &'( !"#"$ ← !"#%$ !%#"$ )*( !%#%$ 19
  • 21. ”: int int ≦ :x≦y z≦w (x,z) ≦ (y,w) &'( !"#"$ ← !"#%$ !%#"$ )*( !%#%$ 19
  • 22. OK ← > :x≦x > :x≦y y≦z x≦z ↑ 20
  • 23. > ≦ bool min,min3 ↑ 21
  • 24. ...
  • 25. ...
  • 26.
  • 27. Frama-C[1] C > Value Analysis, Effects Analysis, etc 24
  • 28. C → Why → > Alt-Ergo: ← > Coq: ← > ...and more ACSL > ACSL = ANSI/ISO C Specification Language !"#$#%& '() *+,%-"./ 25 00&/1
  • 29. : abs() abs : 0 ACSL //@ ensures result >= 0; int abs (int i) { return i < 0 ? -i : i; } 26
  • 30. $ frama-c -jessie abs.c 27
  • 31. $ frama-c -jessie abs.c 27
  • 32. $ frama-c -jessie abs.c 27
  • 33. $ frama-c -jessie abs.c ! 27
  • 34. $ frama-c -jessie abs.c INT_MIN ! 27
  • 35. requires INT_MIN //@ requires i > -2147483648; //@ ensures result >= 0; int abs (int i) { return i < 0 ? -i : i; 28
  • 36. 29
  • 37. Frama-C C++ C C++ > Frama-C 30
  • 38. : LE ≦ → LE >C ACSL /*@ axiomatic order { predicate LE(T x, T y); } */ 31
  • 39. Frama-C min,min3 C++ Frama-C T → void* → > typedef void* T; bool leq(T x, T y) { return true; } 32
  • 40. leq leq : LE > leq(x,y) true LE(x,y) > leq(x,y) false LE(y, x) /*@ ensures (¥result == true ==> LE(x,y)) && (¥result == false ==> LE(y,x)); */ bool leq(T x, T y){ ... } 33
  • 41. min leq min x,y /*@ ensures LE(¥result, x) && LE(¥result, y); */ T min(T x,T y){ return leq(x,y) ? x : y; } 34
  • 44. /*@ axiomatic order { predicate LE(T x, T y); axiom refl : ¥forall T x; LE(x,x); ← 37
  • 45. min3 min3 : x,y,z /*@ ensures LE(result, x) && LE(result, y) && LE(result, z); */ T min3(T x,T y,T z){ return min(x, min(y,z)); 38
  • 46. 39
  • 47. > Coq → LE( , min(y,z)) LE(min(y,z), y) LE( , y) 40
  • 48. /*@ axiomatic order { predicate LE(T x, T y); axiom refl : ¥forall T x; LE(x,x); axiom trans: forall T x,T y,T z; LE(x,y) ==> LE(y,z) ==> LE(x,z); ← 41
  • 49. Frama-C min,min3 42
  • 50. :ProofSummit 9/25( ) 10:00 17:00 @ http://bit.ly/proofsummit Coq,Agda2 43

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n