Instructor: Sorin Lerner

Slides:



Advertisements
Similar presentations
1 Verification by Model Checking. 2 Part 1 : Motivation.
Advertisements

Copyright 2000 Cadence Design Systems. Permission is granted to reproduce without modification. Introduction An overview of formal methods for hardware.
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Advanced Compiler Design CSE 231 Instructor: Sorin Lerner.
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture 05.
Automated Soundness Proofs for Dataflow Analyses and Transformations via Local Rules Sorin Lerner* Todd Millstein** Erika Rice* Craig Chambers* * University.
Advanced Formal Methods Mads Dam KTH/CSC Course 2D1453,
What’s left in the course. The course in a nutshell Logics Techniques Applications.
Applied Automated Theorem Proving CSE 291 Instructor: Sorin Lerner.
Proof-system search ( ` ) Interpretation search ( ² ) Main search strategy DPLL Backtracking Incremental SAT Natural deduction Sequents Resolution Main.
Automatically Proving the Correctness of Compiler Optimizations Sorin Lerner Todd Millstein Craig Chambers University of Washington.
Advanced Compilers CSE 231 Instructor: Sorin Lerner.
Advanced Compilers CSE 231 Instructor: Sorin Lerner.
Software Reliability Methods Sorin Lerner. Software reliability methods: issues What are the issues?
Advanced Compilers CSE 231 Instructor: Sorin Lerner.
Administrative stuff On Thursday, we will start class at 11:10, and finish at 11:55 This means that each project will get a 10 minute presentation + 5.
From last time S1: l := new Cons p := l S2: t := new Cons *p := t p := t l p S1 l p tS2 l p S1 t S2 l t S1 p S2 l t S1 p S2 l t S1 p L2 l t S1 p S2 l t.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
Have Your Verified Compiler And Extend It Too Zachary Tatlock Sorin Lerner UC San Diego.
VeriML DARPA CRASH Project Progress Report Antonis Stampoulis October 5 th, 2012 A language-based, dependently-typed, user-extensible approach to proof.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
An overview of Coq Xinyu Feng USTC Erasmus Mundus NordSecMob Scholar at DTU.
Verification & Validation By: Amir Masoud Gharehbaghi
SAFE KERNEL EXTENSIONS WITHOUT RUN-TIME CHECKING George C. Necula Peter Lee Carnegie Mellon U.
Course topics Representing programs Analyzing and transforming programs Applications of these techniques.
Proving Optimizations Correct using Parameterized Program Equivalence University of California, San Diego Sudipta Kundu Zachary Tatlock Sorin Lerner.
Cs498dm Software Testing Darko Marinov January 24, 2012.
CPSC 121: Models of Computation REVIEW. Course Learning Outcomes You should be able to: – model important problems so that they are easier to discuss,
Requirements Specification
Buffer Overflows Incomplete Access Control
Chapter 7. Propositional and Predicate Logic
Formal Methods: Model Checkers and Theorem Provers
Advanced Compiler Design
CSc 1302 Principles of Computer Science II
Types for Programs and Proofs
How Many Ways Can 945 Be Written as the Difference of Squares?
Testing the Software with Blinders on
By Dr. Abdulrahman H. Altalhi
Introduction CSE 1310 – Introduction to Computers and Programming
Autonomous Cyber-Physical Systems: Course Introduction
Jared Davis CyberTrust Meeting March 1, 2006
Algorithm and Ambiguity
Advanced Compilation and Automatic Programming
Symbolic Implementation of the Best Transformer
Lecture 5 Floyd-Hoare Style Verification
IS 2935: Developing Secure Systems
Programming Languages 2nd edition Tucker and Noonan
Prof. Jason Eisner MWF 3-4pm (sometimes 3-4:15)
An overview of Coq Xinyu Feng USTC.
Programming in JavaScript
CSCE 489- Problem Solving Programming Strategies Spring 2018
CS 220: Discrete Structures and their Applications
Programming.
Algorithm and Ambiguity
PHYS 202 Intro Physics II Catalog description: A continuation of PHYS 201 covering the topics of electricity and magnetism, light, and modern physics.
Programming in JavaScript
Topics in Formal Reasoning for Cyber-Physical Systems
Chapter 7. Propositional and Predicate Logic
Department of Computer Science Abdul Wali Khan University Mardan
Search techniques.
Advanced Compiler Design
Applying Use Cases (Chapters 25,26)
Computer Science 340 Software Design & Testing
Chapter 7 Software Testing.
Programming Languages 2nd edition Tucker and Noonan
Follow-up of MoU objectives
An overview of Coq.
Presentation transcript:

Instructor: Sorin Lerner Applied Automated Theorem Proving Instructor: Sorin Lerner 1

Some history The field of automated theorem proving started in the 1960s SAT and reduction to SAT (early 60s) Resolution (Robinson 1965) Lots of enthusiasm, and many early efforts Was considered originally part of AI In the 70s some of the original excitement settles down, with the realization that “interesting” theorems are hard to prove automatically. 2

Over the next three decades Many large theorem proving systems are born Boyer-Moore (1971) NuPrl (1985) Isabelle (1989) Coq (1989) PVS (1992) Simplify (1990s) The list of theorems proven automatically/semi- automatically grows 3

On the math side 1976: Appel and Haken prove the four color theorem using a program that performs a gigantic case analysis. First use of a program (essentially a simple “theorem prover”) to solve an open problem in math. The proof was controversial and attracted a lot of criticism. Other open problems have since been solved using theorem provers. 4

On the verification side And this is just one theorem prover! 5

And yet… In 1979, DeMillo, Lipton and Perlis, in a now famous paper, argue that software verification is doomed. Why? Too hard to verify by hand Too hard to verify automatically Nobody will check your verifications anyway As opposed to math, where a proof becomes a proof only after it has been validated by the community 6

And then… the internet happens Amount of code exposed to malicious attacks skyrockets Vulnerabilities are widely exploited And are worthy of the NYTimes front page At the same time, state of the art improves Result: technological readiness + increased cost of bugs leads to a renewed interest in software verification, and the use of analysis techniques and/or theorem provers to verify software 7

Recent uses of theorem provers ESC/Java: pre- and post-condition checker for Java ESC/Java is a tool to check that the pre-condition of a method implies the post-condition of the method. Underneath the covers, ESC/Java uses a fully automated theorem prover. SLAM and BLAST: verifying C software SLAM and BLAST verify that C programs adhere to API usage rules, such as “a lock can be released only if it was previously acquired”, or “a file can be written to only if it was previously opened”. SLAM and BLAST use theorem provers to perform predicate abstraction. 8

Recent uses of theorem provers Verisoft: end-to-end correctness This porject uses interactive theorem provers to show the correctness of the software itself, but also of all the artifacts needed to execute the software (e.g. hardware and compiler). Compcert: certified compiler implement compiler in theorem prover and interactively prove correct PEC: automatically proving compilers correct PEC is a language for writing compiler optimizations that can be proven correct automatically using a theorem prover. 9

This course Learn about ATPs and ATP techniques, with an eye toward understanding how to use them in parctice Look at recent successful uses of theorem provers, and try to learn from them Understand how ATP techniques work, and what the tradeoffs are between techniques Understand how ATP techniques can be applied in the broader context of reasoning about systems Apply what you’ve learned in a course project 10

Course topics Search techniques Handling Applications semantic domain, proof domain Handling equality, quantifiers, induction, decision procedures Applications ESC/Java, SLAM, Rhodium, proof carrying code Understanding how all of the above interrelate 11

Course work Low credit option: 1 credit Attend class, participate in discussions; graded S/U Medium credit option: 2 credits Also read papers, write paper reviews; graded S/U High credit option: 4 credits Also work on the course project 12

Course work I would really encourage you to take the course for 4 credits the project is the funnest part! If you are busy, there are many ways to make the project still work combine with your current research project combine with a project from another class I would like to meet with each of you one-on-one for 5-10 mins, just to get a feeling for what you’re interested in 13

Course project, part I: mini-project Given a problem, you are asked to encode it in two theorem provers Written report stating what worked, what didn’t, and what the differences were between the various theorem provers Due April 20th (3 weeks from today) 14

Course project, part two: the real thing Groups of at most two Apply theorem proving technology to a problem of your choice start thinking about topics now Milestones: project proposal mid-term presentation to the class 2 meetings throughout the quarter with me final presentation to the class 15

Course pre-requisites Undergrad level logic We won’t be doing any hardcore math… But we will talk about predicate logic, first order logic, and proofs by induction Some familiarity with functional programming mini-project will require you to write some LISP code Both of the above are usually covered in a standard undergrad cs curriculum Talk to me if you think you don’t have the pre- requisites 16

What is an automated theorem prover? ATP output input 17

Input: Example theorems Pythagoras theorem: Given a right triangle with sides A B and C, where C is the hypotenuse, then C2 = A2 + B2 Fundamental theorem of arithmetic: Any whole number bigger than 1 can be represented in exactly one way as a product of primes 18

Input: Example theorems Pythagoras theorem: Given a right triangle with sides A B and C, where C is the hypotenuse, then C2 = A2 + B2 Fundamental theorem of arithmetic: Any whole number bigger than 1 can be represented in exactly one way as a product of primes 19

Input 1: Theorem Theorem must be stated in formal logic self-contained no hidden assumptions Many different kinds of logics (first order logic, higher order logic, linear logic, temporal logic) Different from theorems as stated in math theorems in math are informal mathematicians find the formal details too cumbersome 20

Input 2: Human assistance Some ATPs require human assistance e.g.: programmer gives hints a priori, or interacts with ATP using a prompt The harder the theorem, the more human assistance is required Hardest theorems to prove are “mathematically interesting” theorems (eg: Fermat’s last theorem) In this course, will be dealing with theorems about software artifacts – mathematically uninteresting, but practically useful. 21

Output Can be as simple as a yes/no answer May include proofs and/or counter-examples These are formal proofs, not what mathematicians refer to as proofs Proofs in math are informal “validated” by peer review meant to convey a message, an intuition of how the proof works -- for this purpose the formal details are too cumbersome 22

Output: meaning of the answer If the theorem prover says “yes” to a formula, what does that tell us? Soudness: theorem prover says yes implies formula is correct Subject to bugs in the Trusted Computing Base (TCB) Broad defn of TCB: part the system that must be correct in order to ensure the intended guarantee TCB may include the whole theorem prover Or it may include only a proof checker Does it include the human-provided hints? 23

Output: meaning of the answer If the theorem prover says “no” to a formula, what does that tell us? Completeness: formula is correct implies theorem prover says yes Or, equivalently, theorem prover says no implies formula incorrect Again, as before, subject to bugs in the TCB 24

Output: meaning of the answer A sound and complete ATP is essentially a decision procedure for the input logic. For expressive logics, cannot be sound and complete Consider the theorem: “My program is free of buffer overruns”. Do we want soundness? Completeness? 25

Output: meaning of the answer ATPs first strive for soundness, and then for completeness if possible Many ATPs are incomplete: “no” answer doesn’t provide any information Many subtle variants refutation complete complete semi-algorithm 26

For Thursday Read DeMillo, Lipton and Perlis Read Moore’s talk from Zurich 05 Very high level, easy read. No need to write reviews. We will discuss these papers, and then we will start talking about logics, and how to encode problems in logics 27