Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Safety Beyond Types

228 views

Published on

http://2017.scalamatsuri.org/

Published in: Software
  • Be the first to comment

  • Be the first to like this

Safety Beyond Types

  1. 1. Safety Beyond Types Writing Correct Software with Leon Régis Blanc @regbla EPFL, LARA 型を超えた安全 - Leon で正しいソフトウェアを書く
  2. 2. The Leon Verification System ● Verifier for a subset of Scala ● Analyzes code statically – If issue detected: display an example that can trigger the problem – Otherwise, proves the absence of certain errors ● Open source project, developed at EPFL – Main contributions from LARA group 静的コード解析を行いコードの正しさを証明する
  3. 3. def binarySearch( a: Array[Int], left: Int, right: Int, x: Int ): Int = { require(left >= 0 && right < a.length) if(left > right) -1 else { val m = (left + right)/2 val element = a(m) if(x < element) { binarySearch(a, left, m-1, x) } else if(x > element) { binarySearch(a, m+1, right, x) } else { m } } }
  4. 4. def binarySearch( a: Array[Int], left: Int, right: Int, x: Int ): Int = { require(left >= 0 && right < a.length) if(left > right) -1 else { val m = (left + right)/2 //assert(m >= 0 && m < a.length) val element = a(m) if(x < element) { //assert(left >= 0 && m-1 < a.length) binarySearch(a, left, m-1, x) } else if(x > element) { //assert(m+1 >= 0 && right < a.length) binarySearch(a, m+1, right, x) } else { m } } }
  5. 5. Leon's Capabilities ● Static verification of Scala code: – Validity of assertions – Ensure absence of some runtime errors – Ensure contract for each function ● Code synthesis Automatically generate valid code given some spec ● Termination checker ● Automated program repair Leon の機能 Scala コードの静的検証、コード合成、終了チェッカ、自動プログラム修復
  6. 6. Demo! デモの時間
  7. 7. Main Limitations ● Object-oriented programming and subtyping ● Floating-point arithmetic ● Uniqueness constraint for mutable objects ● Custom standard library ● Verification is fundamentally undecidable
  8. 8. Get Leon ● Try it online yourself: https://leon.epfl.ch/ ● Open source on GitHub: https://github.com/epfl-lara/leon ● Get in touch if you want to know more: – Email: regwblanc@gmail.com – Twitter: @regbla – GitHub: regb
  9. 9. Thanks! Any Questions?

×