Safety Beyond Types

Safety Beyond Types
Writing Correct Software with Leon
Régis Blanc @regbla
EPFL, LARA
型を超えた安全 - Leon で正しいソフトウェアを書く
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
静的コード解析を行いコードの正しさを証明する
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
}
}
}
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
}
}
}
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 コードの静的検証、コード合成、終了チェッカ、自動プログラム修復
Demo!
デモの時間
Main Limitations
● Object-oriented programming and subtyping
● Floating-point arithmetic
● Uniqueness constraint for mutable objects
● Custom standard library
● Verification is fundamentally undecidable
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
Thanks!
Any Questions?
1 of 9

Recommended

Scala On Android by
Scala On AndroidScala On Android
Scala On AndroidAkshay Dashrath
376 views22 slides
Intro++ to C# by
Intro++ to C#Intro++ to C#
Intro++ to C#Pixelles / Rebecca Cohen-Palacios
734 views15 slides
Under the hood of scala implicits (Scala eXchange 2014) by
Under the hood of scala implicits (Scala eXchange 2014)Under the hood of scala implicits (Scala eXchange 2014)
Under the hood of scala implicits (Scala eXchange 2014)Alexander Podkhalyuzin
883 views30 slides
Odersky week1 notes by
Odersky week1 notesOdersky week1 notes
Odersky week1 notesDoug Chang
307 views13 slides
Gnu octave by
Gnu octave Gnu octave
Gnu octave Milad Nourizade
164 views18 slides
Python l3 by
Python l3Python l3
Python l3Aishwarya Deshmukh
30 views11 slides

More Related Content

What's hot

9781111530532 ppt ch14 by
9781111530532 ppt ch149781111530532 ppt ch14
9781111530532 ppt ch14Terry Yoast
874 views33 slides
Lisp by
LispLisp
LispFraboni Ec
778 views23 slides
Pa1 session 2 by
Pa1 session 2 Pa1 session 2
Pa1 session 2 aiclub_slides
105 views44 slides
LISP: Input And Output by
LISP: Input And OutputLISP: Input And Output
LISP: Input And OutputDataminingTools Inc
3.6K views30 slides
Gentle Introduction To Lisp by
Gentle Introduction To LispGentle Introduction To Lisp
Gentle Introduction To LispDamien Garaud
1K views27 slides
Data structures and algorithms by
Data structures and algorithmsData structures and algorithms
Data structures and algorithmsHoang Nguyen
406 views102 slides

What's hot(15)

9781111530532 ppt ch14 by Terry Yoast
9781111530532 ppt ch149781111530532 ppt ch14
9781111530532 ppt ch14
Terry Yoast874 views
Gentle Introduction To Lisp by Damien Garaud
Gentle Introduction To LispGentle Introduction To Lisp
Gentle Introduction To Lisp
Damien Garaud1K views
Data structures and algorithms by Hoang Nguyen
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
Hoang Nguyen406 views
Lisp Programming Languge by Yaser Jaradeh
Lisp Programming LangugeLisp Programming Languge
Lisp Programming Languge
Yaser Jaradeh2.9K views
Code Analysis-run time error prediction by NIKHIL NAWATHE
Code Analysis-run time error predictionCode Analysis-run time error prediction
Code Analysis-run time error prediction
NIKHIL NAWATHE723 views
Formal methods Project Report for the support of slides uploaded by Shoaib Haseeb
Formal methods Project Report for the support of slides uploaded Formal methods Project Report for the support of slides uploaded
Formal methods Project Report for the support of slides uploaded
Shoaib Haseeb457 views
Operators and Control Statements in Python by RajeswariA8
Operators and Control Statements in PythonOperators and Control Statements in Python
Operators and Control Statements in Python
RajeswariA8264 views
AI Programming language (LISP) by SURBHI SAROHA
AI Programming language (LISP)AI Programming language (LISP)
AI Programming language (LISP)
SURBHI SAROHA365 views
Headache from using mathematical software by PVS-Studio
Headache from using mathematical softwareHeadache from using mathematical software
Headache from using mathematical software
PVS-Studio30 views
Introduction to CLIPS Expert System by Motaz Saad
Introduction to CLIPS Expert SystemIntroduction to CLIPS Expert System
Introduction to CLIPS Expert System
Motaz Saad31.9K views

Similar to Safety Beyond Types

Meet scala by
Meet scalaMeet scala
Meet scalaWojciech Pituła
317 views23 slides
Леонид Шевцов «Clojure в деле» by
Леонид Шевцов «Clojure в деле»Леонид Шевцов «Clojure в деле»
Леонид Шевцов «Clojure в деле»DataArt
420 views21 slides
Real Time Big Data Management by
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data ManagementAlbert Bifet
1.3K views67 slides
Introduction to-scala by
Introduction to-scalaIntroduction to-scala
Introduction to-scalaHamid Jafarian
146 views76 slides
Functional Programming With Scala by
Functional Programming With ScalaFunctional Programming With Scala
Functional Programming With ScalaKnoldus Inc.
802 views30 slides
Functional programming with Scala by
Functional programming with ScalaFunctional programming with Scala
Functional programming with ScalaNeelkanth Sachdeva
1.1K views35 slides

Similar to Safety Beyond Types(20)

Леонид Шевцов «Clojure в деле» by DataArt
Леонид Шевцов «Clojure в деле»Леонид Шевцов «Clojure в деле»
Леонид Шевцов «Clojure в деле»
DataArt420 views
Real Time Big Data Management by Albert Bifet
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data Management
Albert Bifet1.3K views
Functional Programming With Scala by Knoldus Inc.
Functional Programming With ScalaFunctional Programming With Scala
Functional Programming With Scala
Knoldus Inc.802 views
Functional Programming by Yuan Wang
Functional ProgrammingFunctional Programming
Functional Programming
Yuan Wang609 views
Drd secr final1_3 by Devexperts
Drd secr final1_3Drd secr final1_3
Drd secr final1_3
Devexperts506 views
Searching techniques with progrms by Misssaxena
Searching techniques with progrmsSearching techniques with progrms
Searching techniques with progrms
Misssaxena175 views
Functions In Scala by Knoldus Inc.
Functions In Scala Functions In Scala
Functions In Scala
Knoldus Inc.2.2K views
Ti1220 Lecture 7: Polymorphism by Eelco Visser
Ti1220 Lecture 7: PolymorphismTi1220 Lecture 7: Polymorphism
Ti1220 Lecture 7: Polymorphism
Eelco Visser1.2K views
Dynamic data race detection in concurrent Java programs by Devexperts
Dynamic data race detection in concurrent Java programsDynamic data race detection in concurrent Java programs
Dynamic data race detection in concurrent Java programs
Devexperts2.7K views
Lecture 5: Functional Programming by Eelco Visser
Lecture 5: Functional ProgrammingLecture 5: Functional Programming
Lecture 5: Functional Programming
Eelco Visser1.1K views
(How) can we benefit from adopting scala? by Tomasz Wrobel
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?
Tomasz Wrobel1.1K views
TMPA-2017: Static Checking of Array Objects in JavaScript by Iosif Itkin
TMPA-2017: Static Checking of Array Objects in JavaScriptTMPA-2017: Static Checking of Array Objects in JavaScript
TMPA-2017: Static Checking of Array Objects in JavaScript
Iosif Itkin810 views
9781111530532 ppt ch09 by Terry Yoast
9781111530532 ppt ch099781111530532 ppt ch09
9781111530532 ppt ch09
Terry Yoast890 views

More from scalaconfjp

脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~ by
脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~
脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~scalaconfjp
112 views50 slides
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会 by
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会scalaconfjp
72 views20 slides
GraalVM Overview Compact version by
GraalVM Overview Compact versionGraalVM Overview Compact version
GraalVM Overview Compact versionscalaconfjp
2K views70 slides
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by... by
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...scalaconfjp
842 views37 slides
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視... by
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...scalaconfjp
224 views16 slides
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau by
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan GoyeauScala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeauscalaconfjp
318 views79 slides

More from scalaconfjp(20)

脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~ by scalaconfjp
脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~
脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~
scalaconfjp112 views
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会 by scalaconfjp
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会
scalaconfjp72 views
GraalVM Overview Compact version by scalaconfjp
GraalVM Overview Compact versionGraalVM Overview Compact version
GraalVM Overview Compact version
scalaconfjp2K views
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by... by scalaconfjp
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
scalaconfjp842 views
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視... by scalaconfjp
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...
scalaconfjp224 views
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau by scalaconfjp
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan GoyeauScala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau
scalaconfjp318 views
Functional Object-Oriented Imperative Scala / 関数型オブジェクト指向命令型 Scala by Sébasti... by scalaconfjp
Functional Object-Oriented Imperative Scala / 関数型オブジェクト指向命令型 Scala by Sébasti...Functional Object-Oriented Imperative Scala / 関数型オブジェクト指向命令型 Scala by Sébasti...
Functional Object-Oriented Imperative Scala / 関数型オブジェクト指向命令型 Scala by Sébasti...
scalaconfjp323 views
Scala ♥ Graal by Flavio Brasil by scalaconfjp
Scala ♥ Graal by Flavio BrasilScala ♥ Graal by Flavio Brasil
Scala ♥ Graal by Flavio Brasil
scalaconfjp315 views
Introduction to GraphQL in Scala by scalaconfjp
Introduction to GraphQL in ScalaIntroduction to GraphQL in Scala
Introduction to GraphQL in Scala
scalaconfjp721 views
Reactive Kafka with Akka Streams by scalaconfjp
Reactive Kafka with Akka StreamsReactive Kafka with Akka Streams
Reactive Kafka with Akka Streams
scalaconfjp681 views
Reactive microservices with play and akka by scalaconfjp
Reactive microservices with play and akkaReactive microservices with play and akka
Reactive microservices with play and akka
scalaconfjp2K views
Scalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメント by scalaconfjp
Scalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメントScalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメント
Scalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメント
scalaconfjp810 views
DWANGO by ドワンゴ by scalaconfjp
DWANGO by ドワンゴDWANGO by ドワンゴ
DWANGO by ドワンゴ
scalaconfjp636 views
OCTOPARTS by M3, Inc. by scalaconfjp
OCTOPARTS by M3, Inc.OCTOPARTS by M3, Inc.
OCTOPARTS by M3, Inc.
scalaconfjp1.2K views
Try using Aeromock by Marverick, Inc. by scalaconfjp
Try using Aeromock by Marverick, Inc.Try using Aeromock by Marverick, Inc.
Try using Aeromock by Marverick, Inc.
scalaconfjp1.2K views
統計をとって高速化する
Scala開発 by CyberZ,Inc. by scalaconfjp
統計をとって高速化する
Scala開発 by CyberZ,Inc.統計をとって高速化する
Scala開発 by CyberZ,Inc.
統計をとって高速化する
Scala開発 by CyberZ,Inc.
scalaconfjp963 views
Short Introduction of Implicit Conversion by TIS, Inc. by scalaconfjp
Short Introduction of Implicit Conversion by TIS, Inc.Short Introduction of Implicit Conversion by TIS, Inc.
Short Introduction of Implicit Conversion by TIS, Inc.
scalaconfjp550 views
ビズリーチ x ScalaMatsuri by BIZREACH, Inc. by scalaconfjp
ビズリーチ x ScalaMatsuri  by BIZREACH, Inc.ビズリーチ x ScalaMatsuri  by BIZREACH, Inc.
ビズリーチ x ScalaMatsuri by BIZREACH, Inc.
scalaconfjp907 views
sbt, past and future / sbt, 傾向と対策 by scalaconfjp
sbt, past and future / sbt, 傾向と対策sbt, past and future / sbt, 傾向と対策
sbt, past and future / sbt, 傾向と対策
scalaconfjp4.5K views
The Evolution of Scala / Scala進化論 by scalaconfjp
The Evolution of Scala / Scala進化論The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論
scalaconfjp5.2K views

Recently uploaded

Software testing company in India.pptx by
Software testing company in India.pptxSoftware testing company in India.pptx
Software testing company in India.pptxSakshiPatel82
7 views9 slides
Citi TechTalk Session 2: Kafka Deep Dive by
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Diveconfluent
17 views60 slides
What Can Employee Monitoring Software Do?​ by
What Can Employee Monitoring Software Do?​What Can Employee Monitoring Software Do?​
What Can Employee Monitoring Software Do?​wAnywhere
21 views11 slides
A first look at MariaDB 11.x features and ideas on how to use them by
A first look at MariaDB 11.x features and ideas on how to use themA first look at MariaDB 11.x features and ideas on how to use them
A first look at MariaDB 11.x features and ideas on how to use themFederico Razzoli
45 views36 slides
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)... by
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...Deltares
9 views34 slides
Consulting for Data Monetization Maximizing the Profit Potential of Your Data... by
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...Flexsin
15 views10 slides

Recently uploaded(20)

Software testing company in India.pptx by SakshiPatel82
Software testing company in India.pptxSoftware testing company in India.pptx
Software testing company in India.pptx
SakshiPatel827 views
Citi TechTalk Session 2: Kafka Deep Dive by confluent
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
confluent17 views
What Can Employee Monitoring Software Do?​ by wAnywhere
What Can Employee Monitoring Software Do?​What Can Employee Monitoring Software Do?​
What Can Employee Monitoring Software Do?​
wAnywhere21 views
A first look at MariaDB 11.x features and ideas on how to use them by Federico Razzoli
A first look at MariaDB 11.x features and ideas on how to use themA first look at MariaDB 11.x features and ideas on how to use them
A first look at MariaDB 11.x features and ideas on how to use them
Federico Razzoli45 views
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)... by Deltares
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
Deltares9 views
Consulting for Data Monetization Maximizing the Profit Potential of Your Data... by Flexsin
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Flexsin 15 views
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit... by Deltares
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...
Deltares13 views
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports by Ra'Fat Al-Msie'deen
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
El Arte de lo Possible by Neo4j
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo Possible
Neo4j38 views
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... by Donato Onofri
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Donato Onofri711 views
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove... by Deltares
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
Deltares17 views
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... by Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller38 views
Advanced API Mocking Techniques by Dimpy Adhikary
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking Techniques
Dimpy Adhikary19 views
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm13 views
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t... by Deltares
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
DSD-INT 2023 Thermobaricity in 3D DCSM-FM - taking pressure into account in t...
Deltares9 views
DSD-INT 2023 SFINCS Modelling in the U.S. Pacific Northwest - Parker by Deltares
DSD-INT 2023 SFINCS Modelling in the U.S. Pacific Northwest - ParkerDSD-INT 2023 SFINCS Modelling in the U.S. Pacific Northwest - Parker
DSD-INT 2023 SFINCS Modelling in the U.S. Pacific Northwest - Parker
Deltares9 views

Safety Beyond Types

  • 1. Safety Beyond Types Writing Correct Software with Leon Régis Blanc @regbla EPFL, LARA 型を超えた安全 - Leon で正しいソフトウェアを書く
  • 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. 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. 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. 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 コードの静的検証、コード合成、終了チェッカ、自動プログラム修復
  • 7. Main Limitations ● Object-oriented programming and subtyping ● Floating-point arithmetic ● Uniqueness constraint for mutable objects ● Custom standard library ● Verification is fundamentally undecidable
  • 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