Applied Automated Theorem Proving CSE 291 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?
Challenges in increasing tool support for programming K. Rustan M. Leino Microsoft Research, Redmond, WA, USA 23 Sep 2004 ICTAC Guiyang, Guizhou, PRC joint.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Advanced Compiler Design CSE 231 Instructor: Sorin Lerner.
VIDE als voortzetting van Cocktail SET Seminar 11 september 2008 Dr. ir. Michael Franssen.
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,
PROOF TRANSLATION AND SMT LIB CERTIFICATION Yeting Ge Clark Barrett SMT 2008 July 7 Princeton.
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
What’s left in the course. The course in a nutshell Logics Techniques Applications.
ESC Java. Static Analysis Spectrum Power Cost Type checking Data-flow analysis Model checking Program verification AutomatedManual ESC.
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.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
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.
Review: forward E { P } { P && E } TF { P && ! E } { P 1 } { P 2 } { P 1 || P 2 } x = E { P } { \exists … }
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Using Decision Procedures for Program Verification Christopher Lynch Clarkson University.
Describing Syntax and Semantics
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
Introduction to Software Engineering CS-300 Fall 2005 Supreeth Venkataraman.
ECI 2007: Specification and Verification of Object- Oriented Programs Lecture 0.
Automated Theorem Proving Arnon Avron Mooly Sagiv Based on a presentations by Jonathan Aldrich,Sorin Lerner.
MCA –Software Engineering Kantipur City College. Topics include  Formal Methods Concept  Formal Specification Language Test plan creation Test-case.
Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.
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.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
Martin Henz and Aquinas Hobor School of Computing National University of Singapore.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
1 New Development Techniques: New Challenges for Verification and Validation Mats Heimdahl Critical Systems Research Group Department of Computer Science.
Extended Static Checking for Java  ESC/Java finds common errors in Java programs: null dereferences, array index bounds errors, type cast errors, race.
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.
Reasoning about programs March CSE 403, Winter 2011, Brun.
Certifying Intermediate Programming Zhaopeng Li
Use Cases CS 6961 – Lecture 4 Nathan Dykman. Neumont UniversityCS Lecture 102 Administration Homework 1 is due –Still reviewing the proposal, but.
CSE Winter 2008 Introduction to Program Verification January 15 tautology checking.
Verification & Validation By: Amir Masoud Gharehbaghi
From Hoare Logic to Matching Logic Reachability Grigore Rosu and Andrei Stefanescu University of Illinois, USA.
SAFE KERNEL EXTENSIONS WITHOUT RUN-TIME CHECKING George C. Necula Peter Lee Carnegie Mellon U.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
Complexity 24-1 Complexity Andrei Bulatov Interactive Proofs.
Course topics Representing programs Analyzing and transforming programs Applications of these techniques.
#1 Make sense of problems and persevere in solving them How would you describe the problem in your own words? How would you describe what you are trying.
Cs498dm Software Testing Darko Marinov January 24, 2012.
Advanced Compiler Design
Instructor: Sorin Lerner
Introduction CSE 1310 – Introduction to Computers and Programming
Jared Davis CyberTrust Meeting March 1, 2006
Lecture 5 Floyd-Hoare Style Verification
IS 2935: Developing Secure Systems
Programming Languages 2nd edition Tucker and Noonan
An overview of Coq Xinyu Feng USTC.
Programming.
Advanced Compiler Design
Chapter 7 Software Testing.
Programming Languages 2nd edition Tucker and Noonan
An overview of Coq.
Presentation transcript:

Applied Automated Theorem Proving CSE 291 Instructor: Sorin Lerner

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.

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

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.

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

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

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

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.

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.

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

Course topics Search techniques –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

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

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

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 20 th (3 weeks from today)

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

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

What is an automated theorem prover? ATP input output

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

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

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

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.

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

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?

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

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?

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

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