SlideShare une entreprise Scribd logo
1  sur  72
Télécharger pour lire hors ligne
Theorem Proving for All
Niki Vazou
+
Haskell
Refinement Types
=
take :: [a] -> Int -> [a]
> take [1,2,3] 2
> [1,2]
Haskell
> take [1,2,3] 500
> ???
take :: [a] -> Int -> [a]
Haskell
Refinement Types
take :: xs:[a] -> {i:Int | i < len xs} -> [a]
> take [1,2,3] 500
> Refinement Type Error!
take :: xs:[a] -> {i:Int | i < len xs} -> [a]
II. Application: Speed up Parsing
III. Expressiveness: Theorem Proving
I. Static Checks: Fast & Safe CodeStatic Checks
Expressiveness
I. Static Checks: Fast & Safe CodeStatic Checks
Buffer overread in OpenSSL. 2015
The Heartbleed Bug
in
module Data.Text where
take :: t:Text -> i:Int -> Text
> take "hat" 500
> *** Exception: Out Of Bounds!
take :: t:Text -> i:Int -> Text
take i t | i < len t
= Unsafe.takeWord16 i t
take i t
= error “Out Of Bounds!”
take :: t:Text -> i:Int -> Text
take t i | i < len t
= Unsafe.take t i
take t i
= error “Out Of Bounds!”
Runtime Checks
Safe, but slow!
take :: t:Text -> i:Int -> Text
take i t | i < len t
= Unsafe.takeWord16 i t
take i t
= error “Out Of Bounds!”
take :: t:Text -> i:Int -> Text
take t i | i < len t
= Unsafe.take t i
take t i
= error “Out Of Bounds!”
No Checks
Fast, but unsafe!
No Checks
> take "hat" 500
> “hat584562594SOHNUL…
Overread
take :: t:Text -> i:Int -> Text
take i t | i < len t
= Unsafe.takeWord16 i t
take i t
= error “Out Of Bounds!”
take :: t:Text -> i:Int -> Text
take t i | i < len t
= Unsafe.take t i
take t i
= error “Out Of Bounds!”
take :: t:Text -> i:Int -> Text
take i t | i < len t
= Unsafe.takeWord16 i t
take i t
= error “Out Of Bounds!”
take :: t:Text -> i:Int -> Text
take t i | i < len t
= Unsafe.take t i
take t i
= error “Out Of Bounds!”
i < len t
Static Checks
take :: t:Text -> i:Int -> Text
take i t | i < len t
= Unsafe.takeWord16 i t
take i t
= error “Out Of Bounds!”
take :: t:Text -> i:Int -> Text
take t i | i < len t
= Unsafe.take t i
take t i
= error “Out Of Bounds!”
Static Checks
take :: t:Text -> i:{i < len t} -> Texti < len t
take :: t:Text -> i:Int -> Text
take i t | i < len t
= Unsafe.takeWord16 i t
take i t
= error “Out Of Bounds!”
take :: t:Text -> i:Int -> Text
take t i | i < len t
= Unsafe.take t i
take t i
= error “Out Of Bounds!”
Static Checks
take :: t:Text -> i:{i < len t} -> Texti < len t
Static Checks
take :: t:Text -> i:Int -> Text
take i t | i < len t
= Unsafe. = error “Out Of Bounds!”
take :: t:Text -> i:{i < len t} -> Text
take t i
= Unsafe.take t i
take :: t:Text -> i:Int -> Text
take i t | i < len t
= Unsafe. = error “Out Of Bounds!”
take :: t:Text -> i:{i < len t} -> Text
take t i
= Unsafe.take t i
Static Checks
> take "hat" 500
Type Error
OK
Error
Code
Checks valid arguments, under facts.
Refinement Types
take :: t:Text -> {v | v < len t} -> Text
heartbleed = let x = "hat"
in take x 500
Checks valid arguments, under facts.
len x = 3 => v = 500 => v < len x
len x = 3 => v = 500 => v < len x
take :: t:Text -> {v | v < len t} -> Text
heartbleed = let x = "hat"
in take x 500
Checks valid arguments, under facts.
len x = 3 => v = 500 => v < len x
take :: t:Text -> {v | v < len t} -> Text
heartbleed = let x = "hat"
in take x 500
Checks valid arguments, under facts.
len x = 3 => v = 500 => v < len x
take :: t:Text -> {v | v < len t} -> Text
heartbleed = let x = "hat"
in take x 500
Checks valid arguments, under facts.
len x = 3 => v = 500 => v < len x
take :: t:Text -> {v | v < len t} -> Text
heartbleed = let x = "hat"
in take x 500
Checks valid arguments, under facts.
len x = 3 => v = 500 => v < len x
take :: t:Text -> {v | v < len t} -> Text
heartbleed = let x = "hat"
in take x 500
Checks valid arguments, under facts.
len x = 3 => v = 500 => v < len x
take :: t:Text -> {v | v < len t} -> Text
heartbleed = let x = "hat"
in take x 500
Checks valid arguments, under facts.
SMT-
query
len x = 3 => v = 500 => v < len x
take :: t:Text -> {v | v < len t} -> Text
heartbleed = let x = "hat"
in take x 500
Checks valid arguments, under facts.
SMT-
invalid
len x = 3 => v = 500 => v < len x
take :: t:Text -> {v | v < len t} -> Text
heartbleed = let x = "hat"
in take x 500
Checks valid arguments, under facts.
Checker reports Error
len x = 3 => v = 500 => v < len x
take :: t:Text -> {v | v < len t} -> Text
heartbleed = let x = "hat"
in take x 500
Checks valid arguments, under facts.
Checker reports Error
Checker reports Error
len x = 3 => v = 500 => v < len x
take :: t:Text -> {v | v < len t} -> Text
heartbleed = let x = "hat"
in take x 500
Checks valid arguments, under facts.
2
2
OK SMT-
valid
Checks valid arguments, under facts.
Static Checks
OK
Error
Code
I. Static Checks: Fast & Safe Code
II. Application: Speed up Parsing
III. Expressiveness: Theorem Proving
Static Checks
II. Application: Speed up Parsing
III. Expressiveness: Theorem Proving
I. Static Checks: Fast & Safe CodeStatic Checks
Application: Speed up Parsing
II. Application: Speed up ParsingApplication: Speed up Parsing
DEMO
Provably Correct & Faster Code!
Application: Speed up Parsing
SMT-Automatic Verification
SMT-Automatic Verification
How expressive can we get?
II. Application: Speed up Parsing
III. Expressiveness: Theorem Proving
I. Static Checks: Fast & Safe CodeStatic Checks
Expressiveness
III. Expressiveness: Theorem ProvingExpressiveness
Proof is in pen-and-paper :(
reverse [x]
— applying reverse on [x]
= reverse [] ++ [x]
— applying reverse on []
= [] ++ [x]
— applying ++ on [] and [x]
= [x]
QED
Theorem: For any x,
Proof.
reverse [x] = [x]
reverse [x]
— applying reverse on [x]
= reverse [] ++ [x]
— applying reverse on []
= [] ++ [x]
— applying ++ on [] and [x]
= [x]
QED
Proof is not machine checked.
Theorem: For any x, reverse [x] = [x]
Proof.
reverse [x]
— obviously!
= [x]
QED
Proof is not machine checked.
Theorem: For any x, reverse [x] = [x]
Proof.
Proof is not machine checked.
reverse [x]
— applying reverse on [x]
= reverse [] ++ [x]
— applying reverse on []
= [] ++ [x]
— applying ++ on [] and [x]
= [x]
QED
Theorem: For any x, reverse [x] = [x]
Check it with Liquid Haskell!
Proof.
Theorems as Refinement Types
Theorem:
For any x, reverse [x] = [x]
x:a ! { v:() | reverse [x] = [x] }
Refinement Type:
SMT equality
x:a ! { reverse [x] = [x] }
Theorems as Refinement Types
Theorem:
For any x, reverse [x] = [x]
Refinement Type:
Proof.
reverse [x]
— applying reverse on [x]
= reverse [] ++ [x]
— applying reverse on []
= [] ++ [x]
— applying ++ on [] and [x]
= [x]
QED
x:a ! { reverse [x] = [x] }
How to connect theorem with proof?
Proofs are programs
Theorems are types
— Curry & Howard
reverse [x]
— applying reverse on [x]
= reverse [] ++ [x]
— applying reverse on []
= [] ++ [x]
— applying ++ on [] and [x]
= [x]
QED
Proof as a Haskell function
singletonP :: x:a ! { reverse [x] = [x] }x:a ! { reverse [x] = [x] }
singletonP x
=
— applying ++ on [] and [x]
==. [x]
*** QED
reverse [x]
— applying reverse on [x]
= reverse [] ++ [x]
— applying reverse on []
= [] ++ [x]
— applying ++ on [] and [x]
= [x]
QED
singletonP x
= reverse [x]
— applying reverse on [x]
==. reverse [] ++ [x]
— applying reverse on []
==. [] ++ [x]
— applying ++ on [] and [x]
==. [x]
*** QED
Proof as a Haskell function
singletonP :: x:a ! { reverse [x] = [x] }x:a ! { reverse [x] = [x] }
reverse [x]
— applying reverse on [x]
= reverse [] ++ [x]
— applying reverse on []
= [] ++ [x]
— applying ++ on [] and [x]
= [x]
QED
singletonP x
= reverse [x]
— applying reverse on [x]
==. reverse [] ++ [x]
— applying reverse on []
==. [] ++ [x]
— applying ++ on [] and [x]
==. [x]
*** QED
singletonP :: x:a ! { reverse [x] = [x] }
How to encode equality?
x:a ! { reverse [x] = [x] }
Equational Operator in (Liquid) Haskell
(==.) :: x:a -> y:{ a | x = y }
-> {v:a | v = x && v = y }
x ==. y = y
checks both arguments are equal
returns 2nd argument,
to continue the proof!
reverse [x]
— applying reverse on [x]
= reverse [] ++ [x]
— applying reverse on []
= [] ++ [x]
— applying ++ on [] and [x]
= [x]
QED
singletonP x
= reverse [x]
— applying reverse on [x]
===. reverse [] ++ [x]
— applying reverse on []
==. [] ++ [x]
— applying ++ on [] and [x]
==. [x]
*** QED
singletonP :: x:a ! { reverse [x] = [x] }x:a ! { reverse [x] = [x] }
reverse [x]
— applying reverse on [x]
= reverse [] ++ [x]
— applying reverse on []
= [] ++ [x]
— applying ++ on [] and [x]
= [x]
QED
singletonP x
= reverse [x]
— applying reverse on [x]
===. reverse [] ++ [x]
— applying reverse on []
==. [] ++ [x]
— applying ++ on [] and [x]
==. [x]
*** QED
singletonP :: x:a ! { reverse [x] = [x] }x:a ! { reverse [x] = [x] }
reverse [x]
— applying reverse on [x]
= reverse [] ++ [x]
— applying reverse on []
= [] ++ [x]
— applying ++ on [] and [x]
= [x]
QED
singletonP x
= reverse [x]
— applying reverse on [x]
===. reverse [] ++ [x]
— applying reverse on []
==. [] ++ [x]
— applying ++ on [] and [x]
==. [x]
*** QED
singletonP :: x:a ! { reverse [x] = [x] }
How to encode QED?
x:a ! { reverse [x] = [x] }
Define QED as data constuctor…
(***) :: a -> QED -> ()
_ *** QED = ()
data QED = QED
… that casts anything into a proof
(i.e., a unit value).
reverse [x]
— applying reverse on [x]
= reverse [] ++ [x]
— applying reverse on []
= [] ++ [x]
— applying ++ on [] and [x]
= [x]
QED
singletonP x
= reverse [x]
— applying reverse on [x]
===. reverse [] ++ [x]
— applying reverse on []
==. [] ++ [x]
— applying ++ on [] and [x]
==. [x]
*** QED
singletonP :: x:a ! { reverse [x] = [x] }
Theorem Proving in Haskell
x:a ! { reverse [x] = [x] }
singletonP :: x:a ! { reverse [x] = [x] }
Theorems are Types
Theorem Application is Function Call
singletonP 1 :: { reverse [1] = [1] }
x:a ! { reverse [x] = [x] }
singletonP1 :: { reverse [1] = [1] }
singletonP1
= reverse [1]
? singletonP 1
==. [1]
*** QED
Theorem Application is Function Call
(?) :: a -> () -> a
x ? _ = x
Reasoning about Haskell Programs in Haskell!
Equational operators (==., ?, QED, ***)
Theorem Proving for All
let us encode proofs as Haskell functions
checked by Liquid Haskell.
How to encode inductive proofs?
Theorem Proving for All
Reasoning about Haskell Programs in Haskell!
Theorem: For any list x, reverse (reverse x) = x.
Proof.
involutionP []
= reverse (reverse [])
— applying inner reverse
= reverse []
— applying reverse
= []
QED
involutionP (x:xs)
= reverse (reverse (x:xs))
— applying inner reverse
= reverse (reverse xs ++ [x])
— distributivity on (reverse xs) [x]
= reverse [x] ++ reverse (reverse xs)
— involution on xs
= reverse [x] ++ xs
— singleton on x
= [x] ++ xs
— applying ++
= x:([] ++ xs)
— applying ++
= (x:xs)
QED
Base Case: Inductive Case:
Theorem: For any list x, reverse (reverse x) = x.
Proof.
involutionP []
= reverse (reverse [])
— applying inner reverse
= reverse []
— applying reverse
= []
QED
involutionP (x:xs)
= reverse (reverse (x:xs))
— applying inner reverse
= reverse (reverse xs ++ [x])
— distributivity on (reverse xs) [x]
= reverse [x] ++ reverse (reverse xs)
— involution on xs
= reverse [x] ++ xs
— singleton on x
= [x] ++ xs
— applying ++
= x:([] ++ xs)
— applying ++
= (x:xs)
QED
Base Case: Inductive Case:
Step 1: Define a recursive function!
Step 1: Define a recursive function!
Proof.
involutionP []
== reverse (reverse [])
— applying inner reverse
= reverse []
— applying reverse
= []
QED
involutionP (x:xs)
== reverse (reverse (x:xs))
— applying inner reverse
= reverse (reverse xs ++ [x])
— distributivity on (reverse xs) [x]
= reverse [x] ++ reverse (reverse xs)
— involution on xs
= reverse [x] ++ xs
— singleton on x
= [x] ++ xs
— applying ++
= x:([] ++ xs)
— applying ++
= (x:xs)
QED
Step 2: Use equational operators
Theorem: For any list x, reverse (reverse x) = x.
Proof.
involutionP []
==.=reverse (reverse [])
— applying inner reverse
==. reverse []
— applying reverse
==. []
*** QED
involutionP (x:xs)
==. reverse (reverse (x:xs))
— applying inner reverse
==. reverse (reverse xs ++ [x])
— distributivity on (reverse xs) [x]
==. reverse [x] ++ reverse (reverse xs)
— involution on xs
==. reverse [x] ++ xs
— singleton on x
==. [x] ++ xs
— applying ++
==. x:([] ++ xs)
— applying ++
==. (x:xs)
*** QED
Step 3: Lemmata are function calls!Step 2: Use equational operators
Theorem: For any list x, reverse (reverse x) = x.
Proof.
Step 3: Lemmata are function calls!
involutionP []
==.=reverse (reverse [])
— applying inner reverse
==. reverse []
— applying reverse
==. []
*** QED
involutionP (x:xs)
==. reverse (reverse (x:xs))
— applying inner reverse
==. reverse (reverse xs ++ [x])
? distributivityP (reverse xs) [x]
==. reverse [x] ++ reverse (reverse xs)
? involutionP xs
==. reverse [x] ++ xs
? singletonP x
==. [x] ++ xs
— applying ++
==. x:([] ++ xs)
— applying ++
==. (x:xs)
*** QED
Theorem: For any list x, reverse (reverse x) = x.
Proof.
involutionP []
==.=reverse (reverse [])
— applying inner reverse
==. reverse []
— applying reverse
==. []
*** QED
involutionP (x:xs)
==. reverse (reverse (x:xs))
— applying inner reverse
==. reverse (reverse xs ++ [x])
? distributivityP (reverse xs) [x]
==. reverse [x] ++ reverse (reverse xs)
? involutionP xs
==. reverse [x] ++ xs
? singletonP x
==. [x] ++ xs
— applying ++
==. x:([] ++ xs)
— applying ++
==. (x:xs)
*** QED
Note: Inductive hypothesis is recursive call!
Theorem: For any list x, reverse (reverse x) = x.
Proof.
involutionP []
==.=reverse (reverse [])
— applying inner reverse
==. reverse []
— applying reverse
==. []
*** QED
involutionP (x:xs)
==. reverse (reverse (x:xs))
— applying inner reverse
==. reverse (reverse xs ++ [x])
? distributivityP (reverse xs) [x]
==. reverse [x] ++ reverse (reverse xs)
? involutionP xs
==. reverse [x] ++ xs
? singletonP x
==. [x] ++ xs
— applying ++
==. x:([] ++ xs)
— applying ++
==. (x:xs)
*** QED
Question: Is the proof well founded?
Theorem: For any list x, reverse (reverse x) = x.
Used to encode pen-and-pencil proofs
https://bit.ly/2yjvJo3
“Theorem Proving for All”, Haskell’18
and function optimizations.
“LWeb: Information Flow Security for
Multi-Tier Web Applications”, POPL’19
https://bit.ly/2EcyDAh
Used to encode pen-and-pencil proofs
or even sophisticated security proofs.
“Liquidate your assets”
https://bit.ly/2Ht3uIG
Used to encode pen-and-pencil proofs
or encode resource analysis.
To be presented at IMDEA:
by Martin Handley
Tue March 19 @10.45
Used to encode pen-and-pencil proofs
But, proof interaction is missing.
II. Application: Speed up Parsing
III. Expressiveness: Theorem Proving
I. Static Checks: Fast & Safe Code
Thanks!
Theorem Proving for All
@nikivazou

Contenu connexe

Tendances

Derivatives of Trigonometric Functions, Part 2
Derivatives of Trigonometric Functions, Part 2Derivatives of Trigonometric Functions, Part 2
Derivatives of Trigonometric Functions, Part 2Pablo Antuna
 
String in .net
String in .netString in .net
String in .netLarry Nung
 
The Ring programming language version 1.6 book - Part 38 of 189
The Ring programming language version 1.6 book - Part 38 of 189The Ring programming language version 1.6 book - Part 38 of 189
The Ring programming language version 1.6 book - Part 38 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88Mahmoud Samir Fayed
 
関数潮流(Function Tendency)
関数潮流(Function Tendency)関数潮流(Function Tendency)
関数潮流(Function Tendency)riue
 
The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30Mahmoud Samir Fayed
 
Mx/G(a,b)/1 With Modified Vacation, Variant Arrival Rate With Restricted Admi...
Mx/G(a,b)/1 With Modified Vacation, Variant Arrival Rate With Restricted Admi...Mx/G(a,b)/1 With Modified Vacation, Variant Arrival Rate With Restricted Admi...
Mx/G(a,b)/1 With Modified Vacation, Variant Arrival Rate With Restricted Admi...IJRES Journal
 
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語ikdysfm
 
Program Language - Fall 2013
Program Language - Fall 2013 Program Language - Fall 2013
Program Language - Fall 2013 Yun-Yan Chi
 
Some properties of two-fuzzy Nor med spaces
Some properties of two-fuzzy Nor med spacesSome properties of two-fuzzy Nor med spaces
Some properties of two-fuzzy Nor med spacesIOSR Journals
 
The Chain Rule, Part 1
The Chain Rule, Part 1The Chain Rule, Part 1
The Chain Rule, Part 1Pablo Antuna
 
The Ring programming language version 1.5.2 book - Part 24 of 181
The Ring programming language version 1.5.2 book - Part 24 of 181The Ring programming language version 1.5.2 book - Part 24 of 181
The Ring programming language version 1.5.2 book - Part 24 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 16 of 88
The Ring programming language version 1.3 book - Part 16 of 88The Ring programming language version 1.3 book - Part 16 of 88
The Ring programming language version 1.3 book - Part 16 of 88Mahmoud Samir Fayed
 
Recurrent Networks and LSTM deep dive
Recurrent Networks and LSTM deep diveRecurrent Networks and LSTM deep dive
Recurrent Networks and LSTM deep diveAlex Kalinin
 
Dirac demo (quantum mechanics with C++). Please note: There is a problem with...
Dirac demo (quantum mechanics with C++). Please note: There is a problem with...Dirac demo (quantum mechanics with C++). Please note: There is a problem with...
Dirac demo (quantum mechanics with C++). Please note: There is a problem with...Russell Childs
 

Tendances (20)

Derivatives of Trigonometric Functions, Part 2
Derivatives of Trigonometric Functions, Part 2Derivatives of Trigonometric Functions, Part 2
Derivatives of Trigonometric Functions, Part 2
 
String in .net
String in .netString in .net
String in .net
 
Apuntes clojure
Apuntes clojureApuntes clojure
Apuntes clojure
 
Oh Composable World!
Oh Composable World!Oh Composable World!
Oh Composable World!
 
The Ring programming language version 1.6 book - Part 38 of 189
The Ring programming language version 1.6 book - Part 38 of 189The Ring programming language version 1.6 book - Part 38 of 189
The Ring programming language version 1.6 book - Part 38 of 189
 
The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88
 
関数潮流(Function Tendency)
関数潮流(Function Tendency)関数潮流(Function Tendency)
関数潮流(Function Tendency)
 
The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30
 
Mx/G(a,b)/1 With Modified Vacation, Variant Arrival Rate With Restricted Admi...
Mx/G(a,b)/1 With Modified Vacation, Variant Arrival Rate With Restricted Admi...Mx/G(a,b)/1 With Modified Vacation, Variant Arrival Rate With Restricted Admi...
Mx/G(a,b)/1 With Modified Vacation, Variant Arrival Rate With Restricted Admi...
 
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語
 
Millionways
MillionwaysMillionways
Millionways
 
kan r_ifels
kan r_ifelskan r_ifels
kan r_ifels
 
Program Language - Fall 2013
Program Language - Fall 2013 Program Language - Fall 2013
Program Language - Fall 2013
 
Some properties of two-fuzzy Nor med spaces
Some properties of two-fuzzy Nor med spacesSome properties of two-fuzzy Nor med spaces
Some properties of two-fuzzy Nor med spaces
 
The Chain Rule, Part 1
The Chain Rule, Part 1The Chain Rule, Part 1
The Chain Rule, Part 1
 
The Ring programming language version 1.5.2 book - Part 24 of 181
The Ring programming language version 1.5.2 book - Part 24 of 181The Ring programming language version 1.5.2 book - Part 24 of 181
The Ring programming language version 1.5.2 book - Part 24 of 181
 
The Ring programming language version 1.3 book - Part 16 of 88
The Ring programming language version 1.3 book - Part 16 of 88The Ring programming language version 1.3 book - Part 16 of 88
The Ring programming language version 1.3 book - Part 16 of 88
 
Recurrent Networks and LSTM deep dive
Recurrent Networks and LSTM deep diveRecurrent Networks and LSTM deep dive
Recurrent Networks and LSTM deep dive
 
Dirac demo (quantum mechanics with C++). Please note: There is a problem with...
Dirac demo (quantum mechanics with C++). Please note: There is a problem with...Dirac demo (quantum mechanics with C++). Please note: There is a problem with...
Dirac demo (quantum mechanics with C++). Please note: There is a problem with...
 
Digital Electronics
Digital ElectronicsDigital Electronics
Digital Electronics
 

Similaire à Liquid Haskell: Theorem Proving for All

Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and ScalaFolding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and ScalaPhilip Schwarz
 
Ruslan Shevchenko - Property based testing
Ruslan Shevchenko - Property based testingRuslan Shevchenko - Property based testing
Ruslan Shevchenko - Property based testingIevgenii Katsan
 
SEC5261_SAT_Week08_Spring22.pdf
SEC5261_SAT_Week08_Spring22.pdfSEC5261_SAT_Week08_Spring22.pdf
SEC5261_SAT_Week08_Spring22.pdfNishaVatwani
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...Philip Schwarz
 
Lecture01a correctness
Lecture01a correctnessLecture01a correctness
Lecture01a correctnessSonia Djebali
 
Beyond xUnit example-based testing: property-based testing with ScalaCheck
Beyond xUnit example-based testing: property-based testing with ScalaCheckBeyond xUnit example-based testing: property-based testing with ScalaCheck
Beyond xUnit example-based testing: property-based testing with ScalaCheckFranklin Chen
 
Introduction to idris
Introduction to idrisIntroduction to idris
Introduction to idrisConor Farrell
 
Data Handling.pdf
Data Handling.pdfData Handling.pdf
Data Handling.pdfMILANOP1
 
Constraint Programming in Haskell
Constraint Programming in HaskellConstraint Programming in Haskell
Constraint Programming in HaskellDavid Overton
 
Model-Driven Software Development - Static Analysis & Error Checking
Model-Driven Software Development - Static Analysis & Error CheckingModel-Driven Software Development - Static Analysis & Error Checking
Model-Driven Software Development - Static Analysis & Error CheckingEelco Visser
 
Pure Laziness: An Exploration of Haskell
Pure Laziness: An Exploration of HaskellPure Laziness: An Exploration of Haskell
Pure Laziness: An Exploration of HaskellMitchell Vitez
 
2.6 more computations of derivatives
2.6 more computations of derivatives2.6 more computations of derivatives
2.6 more computations of derivativesmath265
 
[CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter
[CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter [CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter
[CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter PROIDEA
 
Torturing the PHP interpreter
Torturing the PHP interpreterTorturing the PHP interpreter
Torturing the PHP interpreterLogicaltrust pl
 
5.1 anti derivatives
5.1 anti derivatives5.1 anti derivatives
5.1 anti derivativesmath265
 
Use of quantifiers
Use of quantifiersUse of quantifiers
Use of quantifiersLakshmi R
 
Think sharp, write swift
Think sharp, write swiftThink sharp, write swift
Think sharp, write swiftPascal Batty
 

Similaire à Liquid Haskell: Theorem Proving for All (20)

Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and ScalaFolding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala
 
Ruslan Shevchenko - Property based testing
Ruslan Shevchenko - Property based testingRuslan Shevchenko - Property based testing
Ruslan Shevchenko - Property based testing
 
SEC5261_SAT_Week08_Spring22.pdf
SEC5261_SAT_Week08_Spring22.pdfSEC5261_SAT_Week08_Spring22.pdf
SEC5261_SAT_Week08_Spring22.pdf
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
 
Lecture01a correctness
Lecture01a correctnessLecture01a correctness
Lecture01a correctness
 
Beyond xUnit example-based testing: property-based testing with ScalaCheck
Beyond xUnit example-based testing: property-based testing with ScalaCheckBeyond xUnit example-based testing: property-based testing with ScalaCheck
Beyond xUnit example-based testing: property-based testing with ScalaCheck
 
Introduction to idris
Introduction to idrisIntroduction to idris
Introduction to idris
 
Data Handling.pdf
Data Handling.pdfData Handling.pdf
Data Handling.pdf
 
Constraint Programming in Haskell
Constraint Programming in HaskellConstraint Programming in Haskell
Constraint Programming in Haskell
 
Model-Driven Software Development - Static Analysis & Error Checking
Model-Driven Software Development - Static Analysis & Error CheckingModel-Driven Software Development - Static Analysis & Error Checking
Model-Driven Software Development - Static Analysis & Error Checking
 
Pure Laziness: An Exploration of Haskell
Pure Laziness: An Exploration of HaskellPure Laziness: An Exploration of Haskell
Pure Laziness: An Exploration of Haskell
 
Elm: give it a try
Elm: give it a tryElm: give it a try
Elm: give it a try
 
2.6 more computations of derivatives
2.6 more computations of derivatives2.6 more computations of derivatives
2.6 more computations of derivatives
 
Reactive x
Reactive xReactive x
Reactive x
 
[CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter
[CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter [CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter
[CONFidence 2016] Mateusz Kocielski - Torturing the PHP interpreter
 
Torturing the PHP interpreter
Torturing the PHP interpreterTorturing the PHP interpreter
Torturing the PHP interpreter
 
5.1 anti derivatives
5.1 anti derivatives5.1 anti derivatives
5.1 anti derivatives
 
Use of quantifiers
Use of quantifiersUse of quantifiers
Use of quantifiers
 
Python
PythonPython
Python
 
Think sharp, write swift
Think sharp, write swiftThink sharp, write swift
Think sharp, write swift
 

Plus de Facultad de Informática UCM

¿Por qué debemos seguir trabajando en álgebra lineal?
¿Por qué debemos seguir trabajando en álgebra lineal?¿Por qué debemos seguir trabajando en álgebra lineal?
¿Por qué debemos seguir trabajando en álgebra lineal?Facultad de Informática UCM
 
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...Facultad de Informática UCM
 
DRAC: Designing RISC-V-based Accelerators for next generation Computers
DRAC: Designing RISC-V-based Accelerators for next generation ComputersDRAC: Designing RISC-V-based Accelerators for next generation Computers
DRAC: Designing RISC-V-based Accelerators for next generation ComputersFacultad de Informática UCM
 
Tendencias en el diseño de procesadores con arquitectura Arm
Tendencias en el diseño de procesadores con arquitectura ArmTendencias en el diseño de procesadores con arquitectura Arm
Tendencias en el diseño de procesadores con arquitectura ArmFacultad de Informática UCM
 
Introduction to Quantum Computing and Quantum Service Oriented Computing
Introduction to Quantum Computing and Quantum Service Oriented ComputingIntroduction to Quantum Computing and Quantum Service Oriented Computing
Introduction to Quantum Computing and Quantum Service Oriented ComputingFacultad de Informática UCM
 
Inteligencia Artificial en la atención sanitaria del futuro
Inteligencia Artificial en la atención sanitaria del futuroInteligencia Artificial en la atención sanitaria del futuro
Inteligencia Artificial en la atención sanitaria del futuroFacultad de Informática UCM
 
Design Automation Approaches for Real-Time Edge Computing for Science Applic...
 Design Automation Approaches for Real-Time Edge Computing for Science Applic... Design Automation Approaches for Real-Time Edge Computing for Science Applic...
Design Automation Approaches for Real-Time Edge Computing for Science Applic...Facultad de Informática UCM
 
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...Facultad de Informática UCM
 
Fault-tolerance Quantum computation and Quantum Error Correction
Fault-tolerance Quantum computation and Quantum Error CorrectionFault-tolerance Quantum computation and Quantum Error Correction
Fault-tolerance Quantum computation and Quantum Error CorrectionFacultad de Informática UCM
 
Cómo construir un chatbot inteligente sin morir en el intento
Cómo construir un chatbot inteligente sin morir en el intentoCómo construir un chatbot inteligente sin morir en el intento
Cómo construir un chatbot inteligente sin morir en el intentoFacultad de Informática UCM
 
Automatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPCAutomatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPCFacultad de Informática UCM
 
Hardware/software security contracts: Principled foundations for building sec...
Hardware/software security contracts: Principled foundations for building sec...Hardware/software security contracts: Principled foundations for building sec...
Hardware/software security contracts: Principled foundations for building sec...Facultad de Informática UCM
 
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...Facultad de Informática UCM
 
Redes neuronales y reinforcement learning. Aplicación en energía eólica.
Redes neuronales y reinforcement learning. Aplicación en energía eólica.Redes neuronales y reinforcement learning. Aplicación en energía eólica.
Redes neuronales y reinforcement learning. Aplicación en energía eólica.Facultad de Informática UCM
 
Challenges and Opportunities for AI and Data analytics in Offshore wind
Challenges and Opportunities for AI and Data analytics in Offshore windChallenges and Opportunities for AI and Data analytics in Offshore wind
Challenges and Opportunities for AI and Data analytics in Offshore windFacultad de Informática UCM
 

Plus de Facultad de Informática UCM (20)

¿Por qué debemos seguir trabajando en álgebra lineal?
¿Por qué debemos seguir trabajando en álgebra lineal?¿Por qué debemos seguir trabajando en álgebra lineal?
¿Por qué debemos seguir trabajando en álgebra lineal?
 
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
 
DRAC: Designing RISC-V-based Accelerators for next generation Computers
DRAC: Designing RISC-V-based Accelerators for next generation ComputersDRAC: Designing RISC-V-based Accelerators for next generation Computers
DRAC: Designing RISC-V-based Accelerators for next generation Computers
 
uElectronics ongoing activities at ESA
uElectronics ongoing activities at ESAuElectronics ongoing activities at ESA
uElectronics ongoing activities at ESA
 
Tendencias en el diseño de procesadores con arquitectura Arm
Tendencias en el diseño de procesadores con arquitectura ArmTendencias en el diseño de procesadores con arquitectura Arm
Tendencias en el diseño de procesadores con arquitectura Arm
 
Formalizing Mathematics in Lean
Formalizing Mathematics in LeanFormalizing Mathematics in Lean
Formalizing Mathematics in Lean
 
Introduction to Quantum Computing and Quantum Service Oriented Computing
Introduction to Quantum Computing and Quantum Service Oriented ComputingIntroduction to Quantum Computing and Quantum Service Oriented Computing
Introduction to Quantum Computing and Quantum Service Oriented Computing
 
Computer Design Concepts for Machine Learning
Computer Design Concepts for Machine LearningComputer Design Concepts for Machine Learning
Computer Design Concepts for Machine Learning
 
Inteligencia Artificial en la atención sanitaria del futuro
Inteligencia Artificial en la atención sanitaria del futuroInteligencia Artificial en la atención sanitaria del futuro
Inteligencia Artificial en la atención sanitaria del futuro
 
Design Automation Approaches for Real-Time Edge Computing for Science Applic...
 Design Automation Approaches for Real-Time Edge Computing for Science Applic... Design Automation Approaches for Real-Time Edge Computing for Science Applic...
Design Automation Approaches for Real-Time Edge Computing for Science Applic...
 
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
 
Fault-tolerance Quantum computation and Quantum Error Correction
Fault-tolerance Quantum computation and Quantum Error CorrectionFault-tolerance Quantum computation and Quantum Error Correction
Fault-tolerance Quantum computation and Quantum Error Correction
 
Cómo construir un chatbot inteligente sin morir en el intento
Cómo construir un chatbot inteligente sin morir en el intentoCómo construir un chatbot inteligente sin morir en el intento
Cómo construir un chatbot inteligente sin morir en el intento
 
Automatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPCAutomatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPC
 
Type and proof structures for concurrency
Type and proof structures for concurrencyType and proof structures for concurrency
Type and proof structures for concurrency
 
Hardware/software security contracts: Principled foundations for building sec...
Hardware/software security contracts: Principled foundations for building sec...Hardware/software security contracts: Principled foundations for building sec...
Hardware/software security contracts: Principled foundations for building sec...
 
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
 
Do you trust your artificial intelligence system?
Do you trust your artificial intelligence system?Do you trust your artificial intelligence system?
Do you trust your artificial intelligence system?
 
Redes neuronales y reinforcement learning. Aplicación en energía eólica.
Redes neuronales y reinforcement learning. Aplicación en energía eólica.Redes neuronales y reinforcement learning. Aplicación en energía eólica.
Redes neuronales y reinforcement learning. Aplicación en energía eólica.
 
Challenges and Opportunities for AI and Data analytics in Offshore wind
Challenges and Opportunities for AI and Data analytics in Offshore windChallenges and Opportunities for AI and Data analytics in Offshore wind
Challenges and Opportunities for AI and Data analytics in Offshore wind
 

Dernier

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Dernier (20)

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Liquid Haskell: Theorem Proving for All

  • 1. Theorem Proving for All Niki Vazou
  • 3. take :: [a] -> Int -> [a] > take [1,2,3] 2 > [1,2] Haskell
  • 4. > take [1,2,3] 500 > ??? take :: [a] -> Int -> [a] Haskell
  • 5. Refinement Types take :: xs:[a] -> {i:Int | i < len xs} -> [a]
  • 6. > take [1,2,3] 500 > Refinement Type Error! take :: xs:[a] -> {i:Int | i < len xs} -> [a]
  • 7. II. Application: Speed up Parsing III. Expressiveness: Theorem Proving I. Static Checks: Fast & Safe CodeStatic Checks Expressiveness
  • 8. I. Static Checks: Fast & Safe CodeStatic Checks
  • 9. Buffer overread in OpenSSL. 2015 The Heartbleed Bug
  • 10. in
  • 11. module Data.Text where take :: t:Text -> i:Int -> Text > take "hat" 500 > *** Exception: Out Of Bounds!
  • 12. take :: t:Text -> i:Int -> Text take i t | i < len t = Unsafe.takeWord16 i t take i t = error “Out Of Bounds!” take :: t:Text -> i:Int -> Text take t i | i < len t = Unsafe.take t i take t i = error “Out Of Bounds!” Runtime Checks Safe, but slow!
  • 13. take :: t:Text -> i:Int -> Text take i t | i < len t = Unsafe.takeWord16 i t take i t = error “Out Of Bounds!” take :: t:Text -> i:Int -> Text take t i | i < len t = Unsafe.take t i take t i = error “Out Of Bounds!” No Checks Fast, but unsafe!
  • 14. No Checks > take "hat" 500 > “hat584562594SOHNUL… Overread take :: t:Text -> i:Int -> Text take i t | i < len t = Unsafe.takeWord16 i t take i t = error “Out Of Bounds!” take :: t:Text -> i:Int -> Text take t i | i < len t = Unsafe.take t i take t i = error “Out Of Bounds!”
  • 15. take :: t:Text -> i:Int -> Text take i t | i < len t = Unsafe.takeWord16 i t take i t = error “Out Of Bounds!” take :: t:Text -> i:Int -> Text take t i | i < len t = Unsafe.take t i take t i = error “Out Of Bounds!” i < len t Static Checks
  • 16. take :: t:Text -> i:Int -> Text take i t | i < len t = Unsafe.takeWord16 i t take i t = error “Out Of Bounds!” take :: t:Text -> i:Int -> Text take t i | i < len t = Unsafe.take t i take t i = error “Out Of Bounds!” Static Checks take :: t:Text -> i:{i < len t} -> Texti < len t
  • 17. take :: t:Text -> i:Int -> Text take i t | i < len t = Unsafe.takeWord16 i t take i t = error “Out Of Bounds!” take :: t:Text -> i:Int -> Text take t i | i < len t = Unsafe.take t i take t i = error “Out Of Bounds!” Static Checks take :: t:Text -> i:{i < len t} -> Texti < len t
  • 18. Static Checks take :: t:Text -> i:Int -> Text take i t | i < len t = Unsafe. = error “Out Of Bounds!” take :: t:Text -> i:{i < len t} -> Text take t i = Unsafe.take t i
  • 19. take :: t:Text -> i:Int -> Text take i t | i < len t = Unsafe. = error “Out Of Bounds!” take :: t:Text -> i:{i < len t} -> Text take t i = Unsafe.take t i Static Checks > take "hat" 500 Type Error
  • 20. OK Error Code Checks valid arguments, under facts. Refinement Types
  • 21. take :: t:Text -> {v | v < len t} -> Text heartbleed = let x = "hat" in take x 500 Checks valid arguments, under facts. len x = 3 => v = 500 => v < len x
  • 22. len x = 3 => v = 500 => v < len x take :: t:Text -> {v | v < len t} -> Text heartbleed = let x = "hat" in take x 500 Checks valid arguments, under facts.
  • 23. len x = 3 => v = 500 => v < len x take :: t:Text -> {v | v < len t} -> Text heartbleed = let x = "hat" in take x 500 Checks valid arguments, under facts.
  • 24. len x = 3 => v = 500 => v < len x take :: t:Text -> {v | v < len t} -> Text heartbleed = let x = "hat" in take x 500 Checks valid arguments, under facts.
  • 25. len x = 3 => v = 500 => v < len x take :: t:Text -> {v | v < len t} -> Text heartbleed = let x = "hat" in take x 500 Checks valid arguments, under facts.
  • 26. len x = 3 => v = 500 => v < len x take :: t:Text -> {v | v < len t} -> Text heartbleed = let x = "hat" in take x 500 Checks valid arguments, under facts.
  • 27. len x = 3 => v = 500 => v < len x take :: t:Text -> {v | v < len t} -> Text heartbleed = let x = "hat" in take x 500 Checks valid arguments, under facts. SMT- query
  • 28. len x = 3 => v = 500 => v < len x take :: t:Text -> {v | v < len t} -> Text heartbleed = let x = "hat" in take x 500 Checks valid arguments, under facts. SMT- invalid
  • 29. len x = 3 => v = 500 => v < len x take :: t:Text -> {v | v < len t} -> Text heartbleed = let x = "hat" in take x 500 Checks valid arguments, under facts. Checker reports Error
  • 30. len x = 3 => v = 500 => v < len x take :: t:Text -> {v | v < len t} -> Text heartbleed = let x = "hat" in take x 500 Checks valid arguments, under facts. Checker reports Error
  • 31. Checker reports Error len x = 3 => v = 500 => v < len x take :: t:Text -> {v | v < len t} -> Text heartbleed = let x = "hat" in take x 500 Checks valid arguments, under facts. 2 2 OK SMT- valid
  • 32. Checks valid arguments, under facts. Static Checks OK Error Code
  • 33. I. Static Checks: Fast & Safe Code II. Application: Speed up Parsing III. Expressiveness: Theorem Proving Static Checks
  • 34. II. Application: Speed up Parsing III. Expressiveness: Theorem Proving I. Static Checks: Fast & Safe CodeStatic Checks Application: Speed up Parsing
  • 35. II. Application: Speed up ParsingApplication: Speed up Parsing DEMO
  • 36. Provably Correct & Faster Code! Application: Speed up Parsing SMT-Automatic Verification
  • 38. II. Application: Speed up Parsing III. Expressiveness: Theorem Proving I. Static Checks: Fast & Safe CodeStatic Checks Expressiveness
  • 39. III. Expressiveness: Theorem ProvingExpressiveness
  • 40. Proof is in pen-and-paper :( reverse [x] — applying reverse on [x] = reverse [] ++ [x] — applying reverse on [] = [] ++ [x] — applying ++ on [] and [x] = [x] QED Theorem: For any x, Proof. reverse [x] = [x]
  • 41. reverse [x] — applying reverse on [x] = reverse [] ++ [x] — applying reverse on [] = [] ++ [x] — applying ++ on [] and [x] = [x] QED Proof is not machine checked. Theorem: For any x, reverse [x] = [x] Proof.
  • 42. reverse [x] — obviously! = [x] QED Proof is not machine checked. Theorem: For any x, reverse [x] = [x] Proof.
  • 43. Proof is not machine checked. reverse [x] — applying reverse on [x] = reverse [] ++ [x] — applying reverse on [] = [] ++ [x] — applying ++ on [] and [x] = [x] QED Theorem: For any x, reverse [x] = [x] Check it with Liquid Haskell! Proof.
  • 44. Theorems as Refinement Types Theorem: For any x, reverse [x] = [x] x:a ! { v:() | reverse [x] = [x] } Refinement Type: SMT equality
  • 45. x:a ! { reverse [x] = [x] } Theorems as Refinement Types Theorem: For any x, reverse [x] = [x] Refinement Type:
  • 46. Proof. reverse [x] — applying reverse on [x] = reverse [] ++ [x] — applying reverse on [] = [] ++ [x] — applying ++ on [] and [x] = [x] QED x:a ! { reverse [x] = [x] } How to connect theorem with proof?
  • 47. Proofs are programs Theorems are types — Curry & Howard
  • 48. reverse [x] — applying reverse on [x] = reverse [] ++ [x] — applying reverse on [] = [] ++ [x] — applying ++ on [] and [x] = [x] QED Proof as a Haskell function singletonP :: x:a ! { reverse [x] = [x] }x:a ! { reverse [x] = [x] } singletonP x = — applying ++ on [] and [x] ==. [x] *** QED
  • 49. reverse [x] — applying reverse on [x] = reverse [] ++ [x] — applying reverse on [] = [] ++ [x] — applying ++ on [] and [x] = [x] QED singletonP x = reverse [x] — applying reverse on [x] ==. reverse [] ++ [x] — applying reverse on [] ==. [] ++ [x] — applying ++ on [] and [x] ==. [x] *** QED Proof as a Haskell function singletonP :: x:a ! { reverse [x] = [x] }x:a ! { reverse [x] = [x] }
  • 50. reverse [x] — applying reverse on [x] = reverse [] ++ [x] — applying reverse on [] = [] ++ [x] — applying ++ on [] and [x] = [x] QED singletonP x = reverse [x] — applying reverse on [x] ==. reverse [] ++ [x] — applying reverse on [] ==. [] ++ [x] — applying ++ on [] and [x] ==. [x] *** QED singletonP :: x:a ! { reverse [x] = [x] } How to encode equality? x:a ! { reverse [x] = [x] }
  • 51. Equational Operator in (Liquid) Haskell (==.) :: x:a -> y:{ a | x = y } -> {v:a | v = x && v = y } x ==. y = y checks both arguments are equal returns 2nd argument, to continue the proof!
  • 52. reverse [x] — applying reverse on [x] = reverse [] ++ [x] — applying reverse on [] = [] ++ [x] — applying ++ on [] and [x] = [x] QED singletonP x = reverse [x] — applying reverse on [x] ===. reverse [] ++ [x] — applying reverse on [] ==. [] ++ [x] — applying ++ on [] and [x] ==. [x] *** QED singletonP :: x:a ! { reverse [x] = [x] }x:a ! { reverse [x] = [x] }
  • 53. reverse [x] — applying reverse on [x] = reverse [] ++ [x] — applying reverse on [] = [] ++ [x] — applying ++ on [] and [x] = [x] QED singletonP x = reverse [x] — applying reverse on [x] ===. reverse [] ++ [x] — applying reverse on [] ==. [] ++ [x] — applying ++ on [] and [x] ==. [x] *** QED singletonP :: x:a ! { reverse [x] = [x] }x:a ! { reverse [x] = [x] }
  • 54. reverse [x] — applying reverse on [x] = reverse [] ++ [x] — applying reverse on [] = [] ++ [x] — applying ++ on [] and [x] = [x] QED singletonP x = reverse [x] — applying reverse on [x] ===. reverse [] ++ [x] — applying reverse on [] ==. [] ++ [x] — applying ++ on [] and [x] ==. [x] *** QED singletonP :: x:a ! { reverse [x] = [x] } How to encode QED? x:a ! { reverse [x] = [x] }
  • 55. Define QED as data constuctor… (***) :: a -> QED -> () _ *** QED = () data QED = QED … that casts anything into a proof (i.e., a unit value).
  • 56. reverse [x] — applying reverse on [x] = reverse [] ++ [x] — applying reverse on [] = [] ++ [x] — applying ++ on [] and [x] = [x] QED singletonP x = reverse [x] — applying reverse on [x] ===. reverse [] ++ [x] — applying reverse on [] ==. [] ++ [x] — applying ++ on [] and [x] ==. [x] *** QED singletonP :: x:a ! { reverse [x] = [x] } Theorem Proving in Haskell x:a ! { reverse [x] = [x] }
  • 57. singletonP :: x:a ! { reverse [x] = [x] } Theorems are Types Theorem Application is Function Call singletonP 1 :: { reverse [1] = [1] } x:a ! { reverse [x] = [x] }
  • 58. singletonP1 :: { reverse [1] = [1] } singletonP1 = reverse [1] ? singletonP 1 ==. [1] *** QED Theorem Application is Function Call (?) :: a -> () -> a x ? _ = x
  • 59. Reasoning about Haskell Programs in Haskell! Equational operators (==., ?, QED, ***) Theorem Proving for All let us encode proofs as Haskell functions checked by Liquid Haskell.
  • 60. How to encode inductive proofs? Theorem Proving for All Reasoning about Haskell Programs in Haskell!
  • 61. Theorem: For any list x, reverse (reverse x) = x. Proof. involutionP [] = reverse (reverse []) — applying inner reverse = reverse [] — applying reverse = [] QED involutionP (x:xs) = reverse (reverse (x:xs)) — applying inner reverse = reverse (reverse xs ++ [x]) — distributivity on (reverse xs) [x] = reverse [x] ++ reverse (reverse xs) — involution on xs = reverse [x] ++ xs — singleton on x = [x] ++ xs — applying ++ = x:([] ++ xs) — applying ++ = (x:xs) QED Base Case: Inductive Case:
  • 62. Theorem: For any list x, reverse (reverse x) = x. Proof. involutionP [] = reverse (reverse []) — applying inner reverse = reverse [] — applying reverse = [] QED involutionP (x:xs) = reverse (reverse (x:xs)) — applying inner reverse = reverse (reverse xs ++ [x]) — distributivity on (reverse xs) [x] = reverse [x] ++ reverse (reverse xs) — involution on xs = reverse [x] ++ xs — singleton on x = [x] ++ xs — applying ++ = x:([] ++ xs) — applying ++ = (x:xs) QED Base Case: Inductive Case: Step 1: Define a recursive function!
  • 63. Step 1: Define a recursive function! Proof. involutionP [] == reverse (reverse []) — applying inner reverse = reverse [] — applying reverse = [] QED involutionP (x:xs) == reverse (reverse (x:xs)) — applying inner reverse = reverse (reverse xs ++ [x]) — distributivity on (reverse xs) [x] = reverse [x] ++ reverse (reverse xs) — involution on xs = reverse [x] ++ xs — singleton on x = [x] ++ xs — applying ++ = x:([] ++ xs) — applying ++ = (x:xs) QED Step 2: Use equational operators Theorem: For any list x, reverse (reverse x) = x.
  • 64. Proof. involutionP [] ==.=reverse (reverse []) — applying inner reverse ==. reverse [] — applying reverse ==. [] *** QED involutionP (x:xs) ==. reverse (reverse (x:xs)) — applying inner reverse ==. reverse (reverse xs ++ [x]) — distributivity on (reverse xs) [x] ==. reverse [x] ++ reverse (reverse xs) — involution on xs ==. reverse [x] ++ xs — singleton on x ==. [x] ++ xs — applying ++ ==. x:([] ++ xs) — applying ++ ==. (x:xs) *** QED Step 3: Lemmata are function calls!Step 2: Use equational operators Theorem: For any list x, reverse (reverse x) = x.
  • 65. Proof. Step 3: Lemmata are function calls! involutionP [] ==.=reverse (reverse []) — applying inner reverse ==. reverse [] — applying reverse ==. [] *** QED involutionP (x:xs) ==. reverse (reverse (x:xs)) — applying inner reverse ==. reverse (reverse xs ++ [x]) ? distributivityP (reverse xs) [x] ==. reverse [x] ++ reverse (reverse xs) ? involutionP xs ==. reverse [x] ++ xs ? singletonP x ==. [x] ++ xs — applying ++ ==. x:([] ++ xs) — applying ++ ==. (x:xs) *** QED Theorem: For any list x, reverse (reverse x) = x.
  • 66. Proof. involutionP [] ==.=reverse (reverse []) — applying inner reverse ==. reverse [] — applying reverse ==. [] *** QED involutionP (x:xs) ==. reverse (reverse (x:xs)) — applying inner reverse ==. reverse (reverse xs ++ [x]) ? distributivityP (reverse xs) [x] ==. reverse [x] ++ reverse (reverse xs) ? involutionP xs ==. reverse [x] ++ xs ? singletonP x ==. [x] ++ xs — applying ++ ==. x:([] ++ xs) — applying ++ ==. (x:xs) *** QED Note: Inductive hypothesis is recursive call! Theorem: For any list x, reverse (reverse x) = x.
  • 67. Proof. involutionP [] ==.=reverse (reverse []) — applying inner reverse ==. reverse [] — applying reverse ==. [] *** QED involutionP (x:xs) ==. reverse (reverse (x:xs)) — applying inner reverse ==. reverse (reverse xs ++ [x]) ? distributivityP (reverse xs) [x] ==. reverse [x] ++ reverse (reverse xs) ? involutionP xs ==. reverse [x] ++ xs ? singletonP x ==. [x] ++ xs — applying ++ ==. x:([] ++ xs) — applying ++ ==. (x:xs) *** QED Question: Is the proof well founded? Theorem: For any list x, reverse (reverse x) = x.
  • 68. Used to encode pen-and-pencil proofs https://bit.ly/2yjvJo3 “Theorem Proving for All”, Haskell’18 and function optimizations.
  • 69. “LWeb: Information Flow Security for Multi-Tier Web Applications”, POPL’19 https://bit.ly/2EcyDAh Used to encode pen-and-pencil proofs or even sophisticated security proofs.
  • 70. “Liquidate your assets” https://bit.ly/2Ht3uIG Used to encode pen-and-pencil proofs or encode resource analysis. To be presented at IMDEA: by Martin Handley Tue March 19 @10.45
  • 71. Used to encode pen-and-pencil proofs But, proof interaction is missing.
  • 72. II. Application: Speed up Parsing III. Expressiveness: Theorem Proving I. Static Checks: Fast & Safe Code Thanks! Theorem Proving for All @nikivazou