Advanced Formal Methods Mads Dam KTH/CSC Course 2D1453, 2006-07.

Slides:



Advertisements
Similar presentations
Applying Machine Learning to Automatic Theorem Proving The Nature of the Research The aim of my research is to use machine learning techniques to detect.
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Individual Position Slides: Jonathan Katz (University of Maryland) (Apologies I can’t be here in person)
Static and User-Extensible Proof Checking Antonis StampoulisZhong Shao Yale University POPL 2012.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
© Chinese University, CSE Dept. Software Engineering / Software Engineering Topic 1: Software Engineering: A Preview Your Name: ____________________.
Prof Fateman CS 164 Lecture 371 Review: Programming Languages and Compilers CS AM MWF 10 Evans.
VIDE als voortzetting van Cocktail SET Seminar 11 september 2008 Dr. ir. Michael Franssen.
Department of Mathematical Sciences The University of Texas at El Paso 1 Program Assessment Presentation May 15, 2009 Joe Guthrie Helmut Knaust.
Software Reliability CIS 640 Adapted from the lecture notes by Doron Pelel (
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture 05.
Introduction to CS170. CS170 has multiple sections Each section has its own class websites URLs for different sections: Section 000:
Applied Automated Theorem Proving CSE 291 Instructor: Sorin Lerner.
CS/CMPE 535 – Machine Learning Outline. CS Machine Learning (Wi ) - Asim LUMS2 Description A course on the fundamentals of machine.
The Semantic Web Week 1 Module Content + Assessment Lee McCluskey, room 2/07 Department of Computing And Mathematical Sciences Module.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Towards a HOL Framework for the Deductive Analysis of Hybrid Control Systems ADPM’2000 Norbert Völker University of Essex, England.
COMP152 Object-Oriented Programming and Data Structures Spring 2011.
1 Software Engineering--Introduction. 2 1.Syllabus, grading, schedule--class + lab--will all be on 2.Contact.
Describing Syntax and Semantics
2G1516/2G1521 Formal Methods2004 Mads Dam IMIT, KTH 1 Formal Methods Mads.
Slides 00 1 Advanced Logics Part 1: Lambda Calculus and Type Theory Lecturer: Lim Yohanes Stefanus Part 2: Modal Logic Lecturer: Gregory Wheeler.
Overview of the MS Program Jan Prins. The Computer Science MS Objective – prepare students for advanced technical careers in computing or a related field.
Teaching Teaching Discrete Mathematics and Algorithms & Data Structures Online G.MirkowskaPJIIT.
VeriML DARPA CRASH Project Progress Report Antonis Stampoulis October 5 th, 2012 A language-based, dependently-typed, user-extensible approach to proof.
CS 21a: Intro to Computing I Department of Information Systems and Computer Science Ateneo de Manila University.
Computer Network Fundamentals CNT4007C
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
Computer Networks CEN 5501C Spring, 2008 Ye Xia (Pronounced as “Yeh Siah”)
Introduction to Algorithms Jiafen Liu Sept
CAS- 734 (Presentation -1) By : Vasudha Kapil
20-753: Fundamentals of Web Programming 1 Lecture 1: Introduction Fundamentals of Web Programming Lecture 1: Introduction.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
Overview of Formal Methods. Topics Introduction and terminology FM and Software Engineering Applications of FM Propositional and Predicate Logic Program.
1 Dept of Information and Communication Technology Creating Objects in Flexible Authorization Framework ¹ Dep. of Information and Communication Technology,
Proof-Carrying Code & Proof-Carrying Authentication Stuart Pickard CSCI 297 June 2, 2005.
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
An overview of Coq Xinyu Feng USTC Erasmus Mundus NordSecMob Scholar at DTU.
Course Overview and Road Map Computability and Logic.
Lecture Introduction to Proofs 1.7 Proof Methods and Strategy.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.
CEN First Lecture CEN 4010 Introduction to Software Engineering Instructor: Masoud Sadjadi
Textbook C for Scientists and Engineers © Prentice Hall 1997 Available at NUS CO-OP at S$35.10.
Data Structures and Algorithms in Java AlaaEddin 2012.
Computer Networks CNT5106C
Course: Software Engineering – Design I IntroductionSlide Number 1 What is a specification Description of a (computer) system, which:  is precise;  defines.
URL: by Wishnu Prasetya Course on Program Verification 2015/2016.
Frederico Araujo CS6362 – Fall 2010 Automated Theorem Proving.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
IS 2620: Developing Secure Systems Formal Verification/Methods Lecture 9 March 15, 2012.
Course Overview Stephen M. Thebaut, Ph.D. University of Florida Software Engineering.
Copyright 1999 G.v. Bochmann ELG 7186C ch.1 1 Course Notes ELG 7186C Formal Methods for the Development of Real-Time System Applications Gregor v. Bochmann.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
CS140 – Computer Programming 1 Course Overview First Semester – Fall /1438 – 2016/2017 CS140 - Computer Programming 11.
Sub-fields of computer science. Sub-fields of computer science.
PhD at CSE: Overview CSE department offers Doctoral degree in the Computer Science (CS) or Computer Engineering areas (CpE) at both MS to PhD and BS to.
Computer Network Fundamentals CNT4007C
Instructor: Sorin Lerner
CS 21a: Intro to Computing I
Advanced Compilation and Automatic Programming
IS 2935: Developing Secure Systems
An overview of Coq Xinyu Feng USTC.
Automata and Formal Languages
Principles of Programming Languages
Introduction to Proofs Proof Methods and Strategy
Type Systems for Programming Languages
CS533 Concepts of Operating Systems Class 1
An overview of Coq.
Presentation transcript:

Advanced Formal Methods Mads Dam KTH/CSC Course 2D1453,

Prerequisites Undergraduate logic and discrete maths CS literacy Some functional programming experience useful –The theorem prover Isabelle is programming in SML –Some SML programming may be needed for course projects Semantics and formal methods advisable

Course Structure Lectures –Initial six scheduled, more when needed Hand-in assignments Course project –Formalize a theory and prove some theorems about it in Isabelle Presentation at final workshop –Course projects –Accompanied by written report Final take home exam –Details to be determined Reading –Slides, web, references on course page

Requirements Hand-in assignments How? Course project presentation and report Take home exam How? Course grade determined by exam Agreed? Graduate students: By agreement

Course Committee - Kursnämnd NN1: NN2: NN3:

Practicalities Course web Essential – updated without warning Registration: Please sign up with Name Program and year Personnummer contact Special wishes or interests?

What is a Theorem Prover? Theorem prover InputOutput Theorem Model, or theory User guidance Yes/no Proof Proof state Counterexample Automated theorem prover: –Read first order logic sentence, crunch, answer yes or no or fail to terminate, maybe produce counterexample Interactive theorem prover: –Formalize problem in theory, guide theorem prover in proof search, automate when possible, output is proof (or failure)

What is a Theorem? Theorem: A formalizable statement which is provable on the basis of explicit, formalizable assumptions Pythagoras theorem: In a right triangle with sides A, B, C where C is hypotenuse, C 2 = A 2 +B 2 –Theorem in the theory of geometry Fundamental theorem of arithmetic: A whole number bigger than 1 can be uniquely represented as a product of primes –Theorem in the theory of arithmetic

What is a Theorem? Theorem: The program ”x:=n ; while x > 0 do x=x-1 od” terminates –Theorem in the theory of while program execution Some fictive theorem of Java bytecode verification: After passing the Java bytecode verifier (version x.y.z, this and that implementation) programs written in the Java Virtual Machine language are guaranteed to be type safe –Theorem in the theory of JVM classfile execution

Formalized Theorems Theorems are stated in a formal logic –Self-contained –No hidden assumptions Many different logics are possible –Propositional logic, first order logic, higher order logic, type theory, linear logic, temporal logic, epistemic logic,... Not mathematical theorems –Theorems in math are informal –Mathematicians are happy with informal statements and proofs

Formalized Proofs Proofs are formal objects, subject to manipulation Not mathematical proofs Proofs in math are –Informal –Validated by ”peer review” Same role as code inspection in software engineering –Meant to convey a message – how the proof works –Formal details are too cumbersome

So Why Bother? The problem itself rather than the maths is interesting Want to know e.g.: –Does program P deadlock? –Is programming language L type safe? –Does API A guarantee release of keys only to properly authorized users? Proofs may be huge, boring and repetitive, and not likely to be examined by peers Formalizing gives a chance to leave the mechanics to the machine –Proof manipulation and proof recognition We can carry on with the interesting bits: –Formalization and proof search

Automated or Interactive proof? The two are obviously related, and yet not Automated theorem proving: –Use: Posing questions small/easy enough to be tractable –Technology: Algorithms and semi-algorithms Interactive theorem proving: –Use: Formal modelling and proof search –Technology: Proof representation and manipulation But of course the two are tightly related –Pointless to do algorithmic work by hand This course: Mainly interactive theorem proving –At least initially

Some History 1929: M. Presburger shows that linear arithmetic is decidable 60’s: Field of automated theorem proving starts –SAT – boolean satisfiability solving –Resolution (Robinson, 1965) –Lots of enthusiasm 70’s: Reality sinks in –Complexity theory, hard problems –Difficult to prove ”interesting” theorems 70’s – present: Many theorem proving systems built –Otter, Boyer-Moore, NuPrl, isabelle, Coq, PVS, ESC/Java and simplify,...

In Maths 1976: Appel and Haken proves four colour conjecture Splits proof into about 1500 cases examined by computer plus manual part First use of programs to solve open problem in math –Highly controversial at the time Since then other open problems in math have been settled 2004: Werner and Gonthier formalizes and proves four colour conjecture in CoQ –Eliminates need to trust Appel and Haken’s program –Instead need to trust CoQ higher order dependent type theory and its kernel implementation

Current Situation Software issues gain importance –Internet – ease of downloading executable code, ease of attacks –Java etc. – code mobility –Increased public awareness of computer security issues New interest in software verification –Automated and interactive program verification –Protocols –Language generics: Compilers, type systems, bytecode verifiers But the decidability and complexity bounds remain...

What We’ll Do in the Course Theoretical underpinnings –Lambda calculus –Type systems –Proof systems, natural deduction –Some theorem proving –Some decision procedures, probably Isabelle –Getting you started –Some Isabelle specifics –Assignments mix pen and paper + Isabelle Projects –Formalize some theory and prove things about it –Security protocols, a machine model, a type system

Isabelle Generic proof assistant Developed by Larry Paulson at Cambridge and Tobias Nipkow at Munich –Lots of other contributors Main instantiations are HOL and ZF URL: isabelle.in.tum.de Several layers: –Proof General: User interface –HOL, ZF: Object logics –Isabelle: Generic proof assistant –Standard ML: Programming language –All layers can be accessed

Homework Look up the course page for papers by Hoare, Moore, Demillo et al. Visit the Isabelle site, download and install if needed Browse the documentation Familiarize yourself with the tool. Look through the preview at the overview page. Start reading the Isabelle tutorial, work through sections 2.1 and 2.2 to do a first example.