© Andrew IrelandDependable Systems Group Invariant Patterns for Program Reasoning Andrew Ireland Dependable Systems Group School of Mathematical & Computer.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

The ideal of program correctness Tony Hoare CAVSeattleAugust 2006.
METAGAMER: An Agent for Learning and Planning in General Games Barney Pell NASA Ames Research Center.
Catching Bugs in Software Rajeev Alur Systems Design Research Lab University of Pennsylvania
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
11111 Functional Program Verification CS 4311 A. M. Stavely, Toward Zero Defect Programming, Addison-Wesley, Y. Cheon and M. Vela, A Tutorial on.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Copyright © 2001 Praxis Critical Systems Limited  New and Exciting Things in the World of SPARK Roderick Chapman Praxis Critical Systems.
The ideal of program correctness Tony Hoare BudapestSeptember 2006.
B. Sharma, S.D. Dhodapkar, S. Ramesh 1 Assertion Checking Environment (ACE) for Formal Verification of C Programs Babita Sharma, S.D.Dhodapkar RCnD, BARC,
SIGAda Copyright © 2001 Praxis Critical Systems Limited  Peter Amey Praxis Critical Systems A Language for Systems not Just Software.
ISBN Chapter 3 Describing Syntax and Semantics.
1/22 Programs : Semantics and Verification Charngki PSWLAB Programs: Semantics and Verification Mordechai Ben-Ari Mathematical Logic for Computer.
Using Programmer-Written Compiler Extensions to Catch Security Holes Authors: Ken Ashcraft and Dawson Engler Presented by : Hong Chen CS590F 2/7/2007.
An Integration of Program Analysis and Automated Theorem Proving Bill J. Ellis & Andrew Ireland School of Mathematical & Computer Sciences Heriot-Watt.
HCSSAS Capabilities and Limitations of Static Error Detection in Software for Critical Systems S. Tucker Taft CTO, SofCheck, Inc., Burlington, MA, USA.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt.
VIDE Integrated Environment for Development and Verification of Programs.
Dynamically Discovering Likely Program Invariants to Support Program Evolution Michael Ernst, Jake Cockrell, William Griswold, David Notkin Presented by.
Automated V&V for High Integrity Systems A Targeted Formal Methods Approach Simon Burton Research Associate Rolls-Royce University Technology Centre University.
Michael Ernst, page 1 Improving Test Suites via Operational Abstraction Michael Ernst MIT Lab for Computer Science Joint.
Dependent Types for Reasoning About Distributed Systems Paul Sivilotti - Ohio State Hongwei Xi - Cincinnati.
Describing Syntax and Semantics
Discrete Structures Chapter 5: Sequences, Mathematical Induction, and Recursion 5.2 Mathematical Induction I [Mathematical induction is] the standard proof.
Lecture 4 Discrete Mathematics Harper Langston. Algorithms Algorithm is step-by-step method for performing some action Cost of statements execution –Simple.
Methods For The Prevention, Detection And Removal Of Software Security Vulnerabilities Jay-Evan J. Tevis Department of Computer Science and Software Engineering.
Mathematics throughout the CS Curriculum Support by NSF #
Towers of Hanoi. Introduction This problem is discussed in many maths texts, And in computer science an AI as an illustration of recursion and problem.
Towards Scalable Modular Checking of User-defined Properties Thomas Ball, MSR Brian Hackett, Mozilla Shuvendu Lahiri, MSR Shaz Qadeer, MSR Julien Vanegue,
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
Is Proof More Cost-Effective Than Testing? Presented by Yin Shi.
© Andrew IrelandDependable Systems Group Proof Automation for the SPARK Approach to High Integrity Ada Andrew Ireland Computing & Electrical Engineering.
© Andrew IrelandDependable Systems Group. © Andrew IrelandDependable Systems Group Proof Automation for the SPARK Approach to High Integrity Ada Andrew.
© Andrew IrelandDependable Systems Group Cooperative Reasoning for Automatic Software Verification Andrew Ireland School of Mathematical & Computer Sciences.
© Andrew IrelandDependable Systems Group ITI Techmedia and Technology Transfer Andrew Ireland Dependable Systems Group School of Mathematical & Computer.
Swarat Chaudhuri Roberto Lublinerman Pennsylvania State University Sumit Gulwani Microsoft Research CAUCHY Continuity analysis of programs.
(On secondment at) Praxis High Integrity Systems Bath Dependable Systems Group School of Mathematical & Computer Sciences Heriot-Watt University Edinburgh.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
© Andrew IrelandDependable Systems Group Cooperative Reasoning for Automatic Software Verification Andrew Ireland Dependable Systems Group School of Mathematical.
Computer Science School of Computing Clemson University Discrete Math and Reasoning about Software Correctness Joseph E. Hollingsworth
© Andrew IrelandDependable Systems Group Cooperative Reasoning for Automatic Software Verification Andrew Ireland School of Mathematical & Computer Sciences.
© Andrew IrelandDependable Systems Group On the Scalability of Proof Carrying Code for Software Certification Andrew Ireland School of Mathematical & Computer.
© Gudmund Grov & Andrew Ireland Dependable Systems Group Planning for System Development Gudmund Grov & Andrew Ireland Dependable Systems Group School.
Bill J. Ellis Dependable Systems Group Heriot-Watt University (Project page: Proving Exception.
High Integrity Ada in a UML and C world Peter Amey, Neil White Presented by Liping Cai.
© Andrew IrelandDependable Systems Group Static Analysis and Program Proof Andrew Ireland School of Mathematical & Computer Sciences Heriot-Watt University.
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.
© Andrew IrelandDependable Systems Group Proof Automation for the SPARK Approach to High Integrity Ada Andrew Ireland Computing & Electrical Engineering.
SPADEase: The Good, the Bad and the Ugly Bill J Ellis Dependable Systems Group School of Mathematical & Computer Sciences Heriot-Watt University Edinburgh.
Compositionality Entails Sequentializability Pranav Garg, P. Madhusudan University of Illinois at Urbana-Champaign.
Version 02U-1 Computer Security: Art and Science1 Correctness by Construction: Developing a Commercial Secure System by Anthony Hall Roderick Chapman.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
© Andrew IrelandGrand Challenges for Computing Research 2004 The Verifying Compiler Andrew Ireland Dependable Systems Group School of Mathematical & Computer.
© Andrew IrelandDependable Systems Group The Use of Patterns to Guide Code Certification: A Proposal Andrew Ireland School of Mathematical & Computer Sciences.
© Andrew IrelandDependable Systems Group Increasing Automation for Exception Freedom Proofs Andrew Ireland School of Mathematical & Computer Sciences Heriot-Watt.
Bill J. Ellis Dependable Systems Group Heriot-Watt University (Project page: Proving Exception.
Rachael Addicott Centre for Public Services Organisations February 2006 School of Management – Methodology and Qualitative Research Methods ANALYSING QUALITATIVE.
Jeremy Nimmer, page 1 Automatic Generation of Program Specifications Jeremy Nimmer MIT Lab for Computer Science Joint work with.
SDN Network Updates Minimum updates within a single switch
SWEN421 – Lecture 3 Building High Integrity Software with SPARK Ada
Proof Carrying Code and Proof Preserving Program Transformations
Matching Logic An Alternative to Hoare/Floyd Logic
State your reasons or how to keep proofs while optimizing code
Levels of Software Assurance in SPARK
Cooperative Reasoning for Automatic Software Verification
AdaCore Technologies for Cyber Security
A Verification Condition Visualizer
Functional Program Verification
Proof Automation for the SPARK Approach to High Integrity Ada
Automatic Software Verification: A Renaissance
Presentation transcript:

© Andrew IrelandDependable Systems Group Invariant Patterns for Program Reasoning Andrew Ireland Dependable Systems Group School of Mathematical & Computer Sciences Heriot-Watt University Edinburgh

© Andrew IrelandDependable Systems Group Outline Context and background The problem Our approach Results and future horizons

© Andrew IrelandDependable Systems Group Investigate the role of proof planning within the SPARK approach to high integrity software EPSRC Critical Systems programme (GR/R24081) Praxis Critical Systems (collaborator) Bill Ellis (Research Associate) Tommy Ingulfsen (Undergraduate Student) Context

© Andrew IrelandDependable Systems Group The SPARK Approach A subset of Ada that eliminates potential ambiguities and insecurities (Praxis Critical Systems) Supports data & information flow analysis and formal verification via code level annotations Supports “correctness-by-construction” and is advocated by US National Cyber Security Partnership (April 2004) Applications include SHOLIS: UK MoD’s first Def Standard project

© Andrew IrelandDependable Systems Group SPARK code Verification conditions Examiner SPADE Simplifier Proofs

© Andrew IrelandDependable Systems Group Failure! SPARK code Verification conditions Examiner SPADE Simplifier

© Andrew IrelandDependable Systems Group SPARK code Verification conditions SPADE Proof Checker Examiner Failure!

© Andrew IrelandDependable Systems Group SPARK code Verification conditions SPADE Proof Checker Examiner

© Andrew IrelandDependable Systems Group SPARK code Verification conditions NuSPADE SPADE Proof Checker Examiner Command file

© Andrew IrelandDependable Systems Group Achievements Partial correctness proofs: prove program correct with respect to a Floyd-Hoare style specification [ MICAI-2004 ] Exception freedom proofs: prove that no exceptions will be raised at runtime, e.g. buffer overflows [ ASE-2003, IFM-2004 ] Proof automation with respect to:

© Andrew IrelandDependable Systems Group Program Reasoning Challenge Long history: Goldstine & von Neumann 1947, Turing 1949, Floyd 1967, Hoare 1969 Strong AI focus dating back to 1970s: Wegbreit, German, Katz & Manna, … Renewed interest: proof carrying code, SLAM (Microsoft), ESC/Java (HP), SPARK (Praxis), Verifying Compiler – UK “grand challenges” in computing (Hoare) Key challenges: proof automation and proof annotations, e.g. loop invariants

© Andrew IrelandDependable Systems Group Investigate the role of proof planning within the SPARK approach to high integrity software NuSPADE program analysis specification analysis proof-failure analysis NuSPADE

© Andrew IrelandDependable Systems Group Proof Planning Use of high-level proof outlines, known as proof plans, to guide proof search Supports middle-out reasoning, i.e. the use of meta variables to delay choice during proof search Automatic proof patching via proof failure analysis, e.g. conjecture generalization, lemma discovery, induction revision, case splitting, loop invariant discovery, fixing faulty conjectures Inductive and non-inductive applications

© Andrew IrelandDependable Systems Group A Broader View Of Proof Planning Proof planning methods + critics Proof checking tactics ConjecturesTheory Invariant Patterns

© Andrew IrelandDependable Systems Group Bubble Sort Example package BubbleSort is Min: constant:= 0; Max: constant:= 9; subtype Index_Type is Integer range Min..Max; type Array_Type is array(Index_Type) of Integer; … procedure Bubble_Sort(Table: in out Array_Type); --# derives Table from Table; --# pre true; --# post Ordered(Table, Min, Max) and --# Perm(Table, Table~); end BubbleSort;

© Andrew IrelandDependable Systems Group Bubble Sort package body BubbleSort is … procedure Bubble_Sort(Table: in out Array_Type)is T: Integer; begin for I in Index_Type range 1..Max loop for J in reverse Index_Type range I..Max loop if Table(J-1) > Table(J) then T:= Table(J-1); Table(J-1):= Table(J); Table(J):= T; end if; end loop; end Bubble_Sort; end BubbleSort;

© Andrew IrelandDependable Systems Group Program Analysis Proof construction properties Proof search properties

© Andrew IrelandDependable Systems Group Specification Analysis Definition Unfolded specification Schematic specification

© Andrew IrelandDependable Systems Group 1.A goal is unprovable within the current proof context and matches the following pattern: 2. Terms T1 and T2 contain a counter variable in common Proof-Failure Pattern T1T2LU

© Andrew IrelandDependable Systems Group Proof patch involves generalizing the goal, i.e. Generalized goal represents an auxiliary invariant Proof Patch

© Andrew IrelandDependable Systems Group Alternative Generalizes T1T2LU

© Andrew IrelandDependable Systems Group Proof-Failure Analysis

© Andrew IrelandDependable Systems Group Outer-Loop Invariant Invariant states that the array table is partitioned into two parts, i.e. all elements in the lower part are less-than-or-equal to those in the upper part Invariant generated via program, specification and proof-failure analysis

© Andrew IrelandDependable Systems Group Industrial focus is on exception freedom proofs, so partial correctness examples drawn mainly from text books Currently exploring the use of external reasoners to support planning and program analysis, e.g. CLP, Simplify (ESC/Java) Building on NuSPADE project: Knowledge transfer project with Praxis (2005) NASA Ames potential collaboration Results & Future Horizons

© Andrew IrelandDependable Systems Group Conclusion Integrated approach to program reasoning, i.e. program, specification and proof-failure analysis Proof planning provides the basis for integration Integration broadens the role of proof planning, i.e. proof planning exploits program knowledge