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

MLflowで学ぶMLOpsことはじめ
MLflowで学ぶMLOpsことはじめMLflowで学ぶMLOpsことはじめ
MLflowで学ぶMLOpsことはじめKenichi Sonoda
 
高速な倍精度指数関数expの実装
高速な倍精度指数関数expの実装高速な倍精度指数関数expの実装
高速な倍精度指数関数expの実装MITSUNARI Shigeo
 
C++でCプリプロセッサを作ったり速くしたりしたお話
C++でCプリプロセッサを作ったり速くしたりしたお話C++でCプリプロセッサを作ったり速くしたりしたお話
C++でCプリプロセッサを作ったり速くしたりしたお話Kinuko Yasuda
 
Pythonによる黒魔術入門
Pythonによる黒魔術入門Pythonによる黒魔術入門
Pythonによる黒魔術入門大樹 小倉
 
【DL輪読会】"Masked Siamese Networks for Label-Efficient Learning"
【DL輪読会】"Masked Siamese Networks for Label-Efficient Learning"【DL輪読会】"Masked Siamese Networks for Label-Efficient Learning"
【DL輪読会】"Masked Siamese Networks for Label-Efficient Learning"Deep Learning JP
 
RSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjpRSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjpsonickun
 
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版Masahiro Nagano
 
君はyarn.lockをコミットしているか?
君はyarn.lockをコミットしているか?君はyarn.lockをコミットしているか?
君はyarn.lockをコミットしているか?Teppei Sato
 
配送ルート最適化の為のAI開発の今と未来
配送ルート最適化の為のAI開発の今と未来配送ルート最適化の為のAI開発の今と未来
配送ルート最適化の為のAI開発の今と未来Yosuke Takada
 
[B23] PostgreSQLのインデックス・チューニング by Tomonari Katsumata
[B23] PostgreSQLのインデックス・チューニング by Tomonari Katsumata[B23] PostgreSQLのインデックス・チューニング by Tomonari Katsumata
[B23] PostgreSQLのインデックス・チューニング by Tomonari KatsumataInsight Technology, Inc.
 
例外設計における大罪
例外設計における大罪例外設計における大罪
例外設計における大罪Takuto Wada
 
冬のLock free祭り safe
冬のLock free祭り safe冬のLock free祭り safe
冬のLock free祭り safeKumazaki Hiroki
 
20180613 [TensorFlow分散学習] Horovodによる分散学習の実装方法と解説
20180613 [TensorFlow分散学習] Horovodによる分散学習の実装方法と解説20180613 [TensorFlow分散学習] Horovodによる分散学習の実装方法と解説
20180613 [TensorFlow分散学習] Horovodによる分散学習の実装方法と解説LeapMind Inc
 
Node.js Native ESM への道 〜最終章: Babel / TypeScript Modules との闘い〜
Node.js Native ESM への道  〜最終章: Babel / TypeScript Modules との闘い〜Node.js Native ESM への道  〜最終章: Babel / TypeScript Modules との闘い〜
Node.js Native ESM への道 〜最終章: Babel / TypeScript Modules との闘い〜Teppei Sato
 
TensorFlow XLAは、 中で何をやっているのか?
TensorFlow XLAは、 中で何をやっているのか?TensorFlow XLAは、 中で何をやっているのか?
TensorFlow XLAは、 中で何をやっているのか?Mr. Vengineer
 
Gocon2017:Goのロギング周りの考察
Gocon2017:Goのロギング周りの考察Gocon2017:Goのロギング周りの考察
Gocon2017:Goのロギング周りの考察貴仁 大和屋
 

What's hot (20)

MLflowで学ぶMLOpsことはじめ
MLflowで学ぶMLOpsことはじめMLflowで学ぶMLOpsことはじめ
MLflowで学ぶMLOpsことはじめ
 
高速な倍精度指数関数expの実装
高速な倍精度指数関数expの実装高速な倍精度指数関数expの実装
高速な倍精度指数関数expの実装
 
C++でCプリプロセッサを作ったり速くしたりしたお話
C++でCプリプロセッサを作ったり速くしたりしたお話C++でCプリプロセッサを作ったり速くしたりしたお話
C++でCプリプロセッサを作ったり速くしたりしたお話
 
Map
MapMap
Map
 
Pythonによる黒魔術入門
Pythonによる黒魔術入門Pythonによる黒魔術入門
Pythonによる黒魔術入門
 
【DL輪読会】"Masked Siamese Networks for Label-Efficient Learning"
【DL輪読会】"Masked Siamese Networks for Label-Efficient Learning"【DL輪読会】"Masked Siamese Networks for Label-Efficient Learning"
【DL輪読会】"Masked Siamese Networks for Label-Efficient Learning"
 
RSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjpRSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjp
 
いつやるの?Git入門
いつやるの?Git入門いつやるの?Git入門
いつやるの?Git入門
 
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版
 
君はyarn.lockをコミットしているか?
君はyarn.lockをコミットしているか?君はyarn.lockをコミットしているか?
君はyarn.lockをコミットしているか?
 
機械学習と主成分分析
機械学習と主成分分析機械学習と主成分分析
機械学習と主成分分析
 
配送ルート最適化の為のAI開発の今と未来
配送ルート最適化の為のAI開発の今と未来配送ルート最適化の為のAI開発の今と未来
配送ルート最適化の為のAI開発の今と未来
 
[B23] PostgreSQLのインデックス・チューニング by Tomonari Katsumata
[B23] PostgreSQLのインデックス・チューニング by Tomonari Katsumata[B23] PostgreSQLのインデックス・チューニング by Tomonari Katsumata
[B23] PostgreSQLのインデックス・チューニング by Tomonari Katsumata
 
例外設計における大罪
例外設計における大罪例外設計における大罪
例外設計における大罪
 
冬のLock free祭り safe
冬のLock free祭り safe冬のLock free祭り safe
冬のLock free祭り safe
 
20180613 [TensorFlow分散学習] Horovodによる分散学習の実装方法と解説
20180613 [TensorFlow分散学習] Horovodによる分散学習の実装方法と解説20180613 [TensorFlow分散学習] Horovodによる分散学習の実装方法と解説
20180613 [TensorFlow分散学習] Horovodによる分散学習の実装方法と解説
 
Java8でRDBMS作ったよ
Java8でRDBMS作ったよJava8でRDBMS作ったよ
Java8でRDBMS作ったよ
 
Node.js Native ESM への道 〜最終章: Babel / TypeScript Modules との闘い〜
Node.js Native ESM への道  〜最終章: Babel / TypeScript Modules との闘い〜Node.js Native ESM への道  〜最終章: Babel / TypeScript Modules との闘い〜
Node.js Native ESM への道 〜最終章: Babel / TypeScript Modules との闘い〜
 
TensorFlow XLAは、 中で何をやっているのか?
TensorFlow XLAは、 中で何をやっているのか?TensorFlow XLAは、 中で何をやっているのか?
TensorFlow XLAは、 中で何をやっているのか?
 
Gocon2017:Goのロギング周りの考察
Gocon2017:Goのロギング周りの考察Gocon2017:Goのロギング周りの考察
Gocon2017:Goのロギング周りの考察
 

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
 
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
 
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
 
Matlab differential
Matlab differentialMatlab differential
Matlab differential
 

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

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
 
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
 
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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
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
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
"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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 

Recently uploaded (20)

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
 
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
 
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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
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
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
"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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 

「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