Haskell for Imperative Programmers #41 - Formal Verification (using Isabelle)

  Рет қаралды 6,494

Philipp Hagenlocher

Philipp Hagenlocher

Күн бұрын

Пікірлер: 24
@romanuslureaus2176
@romanuslureaus2176 3 жыл бұрын
This Haskell series is a godsend: clear and concise. Question: Do you write a script for each video, or is everything improvised?
@philipphagenlocher
@philipphagenlocher 3 жыл бұрын
Thank you! Most of my videos are improvised. Videos that are very definition heavy (like the videos on category theory, algebra, proofs) are scripted because I don't want to get anything wrong. Longer videos (like this one) that are just showcasing something would take ages to script ;) Ofcourse I'm thinking of what I want to say beforehand and also have some cuts in the recording but otherwise it's just me rambling!
@romanuslureaus2176
@romanuslureaus2176 3 жыл бұрын
@@philipphagenlocher I'm honestly surprised because everything you say comes so clear and precise. I started learning some Haskell for a university course and your Haskell videos have been a great supplementary material. Thanks :-) Btw you should consider uploading your videos to Odysee (odysee.com/). Would love to see you there. Anyway... keep the great job you're doing!
@TheRedbeardster
@TheRedbeardster 2 жыл бұрын
Thank you very much! A lot of specifiec features here remind me some features in Lean4.
@callanmcgill
@callanmcgill 3 жыл бұрын
Really huge fan of seeing this in your overview and the general effort you put into these videos both in terms of production and of the content included. I wonder how you came across Isabelle? Did you use it in university/ are you a graduate student or did you just learn about it for fun?
@yecinemegdiche3202
@yecinemegdiche3202 3 жыл бұрын
I'm in the same university as Phillip, and it's taught and maintained by the chair of logic and computation at the department of informatics at the TUM. So yeah, there's a big chance TUM students who are interested in functional programming will find their way to Isabelle, since there's a course about "Functional Data Structures" that uses Isabelle/HOL to formalize and implement purely functional structures
@philipphagenlocher
@philipphagenlocher 3 жыл бұрын
Thanks so much for the kind words! Yecines reply pretty much summed it up! I came across Isabelle in the aforementioned "Functional Data Structures" lecture. Since most of my studies are revolving around software verification this topic was near and dear to my heart! :P
@gabrielmachado5708
@gabrielmachado5708 3 жыл бұрын
I began your series last week. I'm still at lesson 15 but I swear I will get here hahah.
@philipphagenlocher
@philipphagenlocher 3 жыл бұрын
Slow and steady ;)
@Fanaro
@Fanaro 3 жыл бұрын
@@philipphagenlocher Nope, put it on 2x and hope for the best.
@gungunpanda8135
@gungunpanda8135 3 жыл бұрын
Thank for your effort!
@FelipeBalbi
@FelipeBalbi 3 жыл бұрын
This is such a great overview of proof assistants in general, thank you for producing this. One small question though: at around 1:11:50, where you define sortedT_values_set, isn’t it redundant to have both lv and rv test for equality too? I mean, wouldn’t it be enough to have lv v? Or do you really need both subtrees to include equality test too?
@philipphagenlocher
@philipphagenlocher 3 жыл бұрын
Thanks so much! The definition of sortedT_values_set HAS to include the equality, otherwise our statement is incorrect. Isabelle can check that with the "nitpick" command: l = Leaf r = Node Leaf a1 Leaf t = Node Leaf a1 (Node Leaf a1 Leaf) v = a1 Here we have a possible counterexample if we only check for "rv > v". The problem is, that we make no assumption about HOW the tree was built in the sortedT_values_set lemma (we never specified that insert is the only function allowed to insert values into the tree). Another counterexample would be any balanced tree that only contains one unique value one hundred times. The inorder traversel would still be considered sorted, thus the tree would be considered sorted. TL;DR: We need the equality because our lemma assumes the tree to be sorted. Sortedness (the way we defined it) allows for this equality on the right subtree.
@FelipeBalbi
@FelipeBalbi 3 жыл бұрын
@@philipphagenlocher Thanks for the extra information :-)
@mlliarm
@mlliarm 2 жыл бұрын
Amazing video. I'm interested bin formal verification of computer programs. I know that for programs written in strongly typed languages this is something pretty mainstream. Do you know what happens with dynamic typed languages? I've found a related PhD, but I was hoping for something more perhaps. Keep up the good work!
@gourabghosh5574
@gourabghosh5574 3 жыл бұрын
Okay I have seen first 6-7 videos of this playlist as haskell is in our syllabus. I want to know how haskell is useful? Why should we learn haskell instead of python, java, etc? Is this only for some fun and challenge to solve every problem by recursion or it can also do something important which other languages can't do?
@philipphagenlocher
@philipphagenlocher 3 жыл бұрын
The answer depends on what you want to do with a programming language. Haskell is not as popular in the industry as languages such as C, C++, Python, Java, etc. So if you want to learn a programming language in order to apply it in an industrial context, Haskell should not be your first choice. However, Haskell is unique in MANY ways. It is one of the few "purely" functional programming languages and is the only language (as far as I know) that uses lazy evaluation efficiently as its default evaluation strategy. Thus, Haskell is fundamentally different from other languages and forces you to think differently about how you structure programs and how you think about program correctness. That's why Haskell is primarily used for teaching and research. So if you are interested in the theory of programming and functional programming in particular, learning Haskell can "open your eyes" on many different concepts in a way that no other language could. Personally I also feel that Haskell allows for cleaner definitions of data structures and algorithms which leads to fewer bugs and overall nicer code... But that's just personal preference ;)
@enderger5308
@enderger5308 3 жыл бұрын
Hi, First off, this series is great. It finally helped Monads click for me and is quite enjoyable. Anyway, I would love to see a few topics covered: 1. Cabal (specifically, the non-project variant) 2. Finding usable libraries in Hackage.
@miguelmattos4356
@miguelmattos4356 3 жыл бұрын
Thank you a lot for the classes! Extremely good :D Is there any way to import haskell code to Isabelle?
@philipphagenlocher
@philipphagenlocher 3 жыл бұрын
Thank you! As far as I know there is no automatic way of converting Haskell to Isabelle HOL but I might be mistaken. :P
@halbgefressen9768
@halbgefressen9768 2 жыл бұрын
However, there is an Isabelle/Haskell module which you may want to have a look at.
@Fanaro
@Fanaro 3 жыл бұрын
But how exactly does Isabelle do all this? Are there limitations? How the hell can a program prove anything from type theory? (I don't actually know if it uses type theory, that's just a guess)
@philipphagenlocher
@philipphagenlocher 3 жыл бұрын
Isabelle uses a wide selection of different methods. I'm no expert when it comes to the internals but what I do know is that Isabelle uses logical resolution and tableaux proving for it's standard prove-procedure. Additionally, sledgehammer invokes SMT- and resolution-based provers for brute-forcing. Isabelle is capable of proving our programs because of the large background theories it contains. At it's core it only understands basic logic. All the other concepts have been formalized in Isabelle itself, thus they are considered proven and can be used for logical resolution. There are MANY limitations. Without our input, Isabelle is absolutely incapable of proving almost any program. We can tell Isabelle to do an induction proof but (as far as I know) there is no reliable way of doing that automatically. The proof is still the users job, Isabelle just fills in the details and checks wether our steps are correct! Still, it is a monumental task and sometimes I am surprised myself what Isabelle and other programs like it can do. :)
@brydust
@brydust Жыл бұрын
Hi. I've worked on Isabelle for about a year now... have you got any resources for verification of imperative programs via Isabelle ?
Haskell for Imperative Programmers #42 - QuickSpec
35:15
Philipp Hagenlocher
Рет қаралды 3,1 М.
Haskell for Imperative Programmers #30 - Software Transactional Memory (STM)
24:15
MY HEIGHT vs MrBEAST CREW 🙈📏
00:22
Celine Dept
Рет қаралды 55 МЛН
How I Turned a Lolipop Into A New One 🤯🍭
00:19
Wian
Рет қаралды 11 МЛН
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 11 МЛН
Seja Gentil com os Pequenos Animais 😿
00:20
Los Wagners
Рет қаралды 29 МЛН
"Super Haskell": an introduction to Agda by André Muricy
1:10:07
Func Prog Sweden
Рет қаралды 5 М.
Automated Mathematical Proofs - Computerphile
18:02
Computerphile
Рет қаралды 92 М.
Haskell for Imperative Programmers #33 - Parallelism
56:39
Philipp Hagenlocher
Рет қаралды 8 М.
Correctness proofs of distributed systems with Isabelle/HOL
1:58:09
Martin Kleppmann
Рет қаралды 10 М.
Haskell for Imperative Programmers #17 - Monads
14:43
Philipp Hagenlocher
Рет қаралды 62 М.
Haskell for Imperative Programmers #28 - Concurrency & Threads
26:12
Philipp Hagenlocher
Рет қаралды 14 М.
Haskell for Imperative Programmers #39 - Induction Proofs
13:29
Philipp Hagenlocher
Рет қаралды 8 М.
Haskell for Imperative Programmers #40 - Termination Proofs
15:59
Philipp Hagenlocher
Рет қаралды 3,3 М.
Just enough C to have fun
39:29
Kay Lack
Рет қаралды 54 М.
MY HEIGHT vs MrBEAST CREW 🙈📏
00:22
Celine Dept
Рет қаралды 55 МЛН