HIP/SLEEK11 HIP/SLEEK :Automatic Verification and Specification Inference System Wei-Ngan Chin & Asankhaya Sharma Dept of Computer Science National University.

Slides:



Advertisements
Similar presentations
A Framework for describing recursive data structures Kenneth Roe Scott Smith.
Advertisements

Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Automated Verification with HIP and SLEEK Asankhaya Sharma.
Synthesis, Analysis, and Verification Lecture 04c Lectures: Viktor Kuncak VC Generation for Programs with Data Structures “Beyond Integers”
Automated Verification with HIP and SLEEK Asankhaya Sharma.
Semantics Static semantics Dynamic semantics attribute grammars
Automated Verification with HIP and SLEEK Asankhaya Sharma.
Automated Software Verification with a Permission-Based Logic 20 th June 2014, Zürich Malte Schwerhoff, ETH Zürich.
1 Symbolic Execution for Model Checking and Testing Corina Păsăreanu (Kestrel) Joint work with Sarfraz Khurshid (MIT) and Willem Visser (RIACS)
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,
1 University of Toronto Department of Computer Science © 2001, Steve Easterbrook Lecture 10: Formal Verification Formal Methods Basics of Logic first order.
Formal Specification and Verification. Specifications Imprecise specifications can cause serious problems downstream Lots of interpretations even with.
CS 355 – Programming Languages
Concepts of Programming Languages 1 Describing Syntax and Semantics Brahim Hnich Högskola I Gävle
Temporal Logic of Actions (TLA) Leslie Lamport
Software Reliability Methods Sorin Lerner. Software reliability methods: issues What are the issues?
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.
Extensible Untrusted Code Verification Robert Schneck with George Necula and Bor-Yuh Evan Chang May 14, 2003 OSQ Retreat.
90-723: Data Structures and Algorithms for Information Processing Copyright © 1999, Carnegie Mellon. All Rights Reserved. Lecture 8: Recursion Data Structures.
Proving termination conditions Name Country, City, University Omer Subasi Turkey, Istanbul, Koc University Anton Dergunov
Cristian Gherghina Joint work with: Wei-Ngan Chin, Razvan Voicu, Quang Loc Le Florin Craciun, Shengchao Qin TexPoint fonts used in EMF. Read the TexPoint.
CUTE: A Concolic Unit Testing Engine for C Technical Report Koushik SenDarko MarinovGul Agha University of Illinois Urbana-Champaign.
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.
Automatic Verification of Pointer Programs using Grammar-based Shape Analysis Hongseok Yang Seoul National University (Joint Work with Oukseh Lee and Kwangkeun.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
Refinement Type Inference via Horn Constraint Optimization Kodai Hashimoto and Hiroshi Unno (University of Tsukuba, Japan)
1 Dependable Software via Automated Verification Huu Hai Nguyen(NUS) Cristina David(NUS) Shengchao Qin(Durham, UK) Wei-Ngan Chin(NUS)
CS 363 Comparative Programming Languages Semantics.
Computer Science School of Computing Clemson University Discrete Math and Reasoning about Software Correctness Joseph E. Hollingsworth
Viper A Verification Infrastructure for Permission-Based Reasoning 1 st March 2015, ECOOP’15 PC Meeting, Zurich Uri Juhasz, Ioannis Kassios, Peter Müller,
© Andrew IrelandDependable Systems Group On the Scalability of Proof Carrying Code for Software Certification Andrew Ireland School of Mathematical & Computer.
Refinements to techniques for verifying shape analysis invariants in Coq Kenneth Roe GBO Presentation 9/30/2013 The Johns Hopkins University.
Viper A Verification Infrastructure for Permission-Based Reasoning 24 th March 2015, JML Workshop, Leiden Uri Juhasz, Ioannis Kassios, Peter Müller, Milos.
A Certifying Compiler and Pointer Logic Zhaopeng Li Software Security Lab. Department of Computer Science and Technology, University of Science and Technology.
Cristian Gherghina 1, Cristina David 1, Shengchao Qin 2, Wei-Ngan Chin 1 1 National University of Singapore 2 University of Teesside Structured Specifications.
BY OKAY ASLAN CMPE 516 FAULT TOLERANT COMPUTING A Formal Object-Oriented Analysis for Software Reliability: Design for Verification.
Verifying Safety Policies with Size Properties and Alias Controls Wei Ngan Chin 1,2, Siau-Cheng Khoo 1, Shengchao Qin 3, Corneliu Popeea 1, Huu Hai Nguyen.
Symbolic Execution with Abstract Subsumption Checking Saswat Anand College of Computing, Georgia Institute of Technology Corina Păsăreanu QSS, NASA Ames.
1 Automated Verification via Separation Logic Cristian Gherghina (NUS, Singapore) Cristina David(NUS, Singapore) Shengchao Qin(Durham, UK) Wei-Ngan Chin(NUS,
Code-Carrying Theory Aytekin Vargun Rensselaer Polytechnic Institute.
1 / 48 Formal a Language Theory and Describing Semantics Principles of Programming Languages 4.
Beyond Reachability: Shape Abstraction in the presence of Pointer Arithmetic Hongseok Yang (Queen Mary, University of London) (Joint work with Dino Distefano,
Model Checking for Simple Java Programs Taehoon Lee, Gihwon Kwon Department of Computer Science Kyonggi University, Korea IWFST, Shanghai, China,
Automated Verification with HIP and SLEEK Asankhaya Sharma.
Lightweight Support for Magic Wands in an Automatic Verifier Malte Schwerhoff and Alexander J. Summers 10 th July 2015, ECOOP, Prague.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
Formal Methods in Software Engineering1 Today’s Agenda  Mailing list  Syllabus  Introduction.
CUTE: A Concolic Unit Testing Engine for C Koushik SenDarko MarinovGul Agha University of Illinois Urbana-Champaign.
Research Heaven, West Virginia 1 Translation Validation of Compilers for Model-based Programming Supratik Mukhopadhyay Research Heaven,
Functional Verification I Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture Notes 21.
Putting Static Analysis to Work for Verification A Case Study Tal Lev-Ami Thomas Reps Mooly Sagiv Reinhard Wilhelm.
Mostly-Automated Verification of Low-Level Programs in Computational Separation Logic Adam Chlipala Harvard University PLDI 2011.
A Resource-based Logic for Termination and Non-Termination Proofs Ton Chanh Le Cristian Gherghina Aquinas Hobor Wei-Ngan Chin National University of Singapore.
Spring 2017 Program Analysis and Verification
Functional Programming
COSC 5V90 Functional Programming and Interactive Theorem Proving
Weakest Precondition of Unstructured Programs
A Verification Infrastructure for Permission-based Reasoning
Joint work with Yong Li, Xinyu Feng, Zhong Shao and Yu Zhang
Automating Induction for Solving Horn Clauses
A Framework for describing recursive data structures
Relatively Complete Refinement Type System for Verification of Higher-Order Non-deterministic Programs Hiroshi Unno (University of Tsukuba) Yuki Satake.
Formal Methods in software development
Formal Methods in software development
Verified Subtyping with Traits and Mixins
Functional Verification II
CUTE: A Concolic Unit Testing Engine for C
Presentation transcript:

HIP/SLEEK11 HIP/SLEEK :Automatic Verification and Specification Inference System Wei-Ngan Chin & Asankhaya Sharma Dept of Computer Science National University of Singapore

HIP/SLEEK 22 Proposition Design and build software that is correct by construction (with respect to specification) Type System  Separation Logic

3 HIP/SLEEK

44 Features of HIP/SLEEK Can specify complex data structures to support symbolic verification. (i) expressive (shapes+size, term) (ii) automation (with inference) (iii) modular (better reuse) (iv) scalable (proof slicing)

HIP/SLEEK 55 Overall System code verifier (HIP) separation logic prover (SLEEK) Pre/Post Predicates Lemmas Code range of pure provers … Omega, MONA, Isabelle, Coq, SMT, Redlog, MiniSAT, Mathematica Under development since 2006 (180K lines of Ocaml).

HIP/SLEEK 66 Topics Expressivity Separation Logic (VMCAI07,POPL08) Immutability (OOPSLA11) Structured Spec (FM11) Termination & Resources Concurrency Automation Specification Inference

HIP/SLEEK 77 Expressivity

HIP/SLEEK 88 Acyclic Linked-List list(self)  self=null  9 r. self  node(_, r)  list(r) Example of Acyclic List : list(x) x null data node { int val; node next } pointer to memory spatial conjunction

HIP/SLEEK 99 Syntactic Abbreviation list(self)  self=null  9 r. self  node(_, r)  list(r) list   self=null  self::node  _, r   r::list  implicit existential instantiation

HIP/SLEEK 10 Method – append two lists void append(node x, node y) { if (x.next==null) x.next=y; else append(x.next,y); } requires x::list<> * y::list<> & x!=null ensures x::list<> ; Shape Specification for memory safety

HIP/SLEEK 11 A different append of two lists void append(ref node x, node y) { if (x==null) x=y; else append(x.next,y); } requires x::list<> * y::list<> ensures x’::list<> ;

HIP/SLEEK 12.. with Size ll  n   self=null Æ n=0  9 r. self  node  _, r   r::ll  n-1  inv n ¸ 0 x::ll  5  x null parameter on length of linked list

HIP/SLEEK 13 Method – append two lists void append(node x, node y) { if (x.next==null) x.next=y; else append(x.next, y); } requires x::ll * y::ll & x!=null ensures x::ll ;

HIP/SLEEK 14 … with Size & Bag list  n,B   self=null Æ n=0 Æ B={ }  9 v,r,B1. self::node  v, r   r::list  n-1,B1  Æ B={v} [ B1 inv n ¸ 0 & n=|B|

HIP/SLEEK 15 … with Bag & Sortedness lsort  n,B   self=null Æ B={ } Æ n=0  9 r. self::node  v, r   r::lsort  n-1,B1  Æ B={v} [ B1 Æ 8 x 2 B1. v · x inv n ¸ 0 Other properties, such as sequences, maps, may also be used if they can be handled by automated prover.

HIP/SLEEK 16 Append Method void append(node x, node y) { if (x.next==null) x.next=y; else append(x.next,y); } requires x::list * y::list & x  null ensures x::list ; requires x::lsort * y::lsort & x  null & 8 a 2 B1. 8 b 2 B2. a · b ensures x::lsort ;

HIP/SLEEK 17 Termination Specifications Ongoing Work

HIP/SLEEK 18 A Loop while (x>0) { x=x+y; } What spec to give to this loop? void loop(ref int x, int y) { if (x>0) { x = x+y; loop(x,y); } } First, convert it to a tail-recursive function: what spec to give?

HIP/SLEEK 19 Use of Case Spec Three scenarios : void loop(ref int x, int y) { if (x>0) { x = x+y; loop(x,y); } } case { x ≤ 0 -> ensures x  0 -> case { y ≥ 0 -> ensures y  0 -> ensures } x’=x ; false; y  x’ ≤ 0 ; base case non-terminating recursive but terminating

HIP/SLEEK 20.. with temporal annotations Three scenarios : void loop(ref int x, int y) { if (x>0) { x = x+y; loop(x,y); } } case { x ≤ 0 -> requires Term[] ensures x’=x; x  0 -> case { y ≥ 0 -> requires Loop ensures false; y  0 -> requires Term[x] ensures y  x’ ≤ 0; } temporal constraints

HIP/SLEEK 21 Specification Inference Ongoing Work

Modular Shape Inference int length(node x) infer [H,G] requires H(x) ensures G(x) { if (x==null) return 0; else node p = x.next; return (1 + length(p)); } HIP/SLEEK 22

Modular Shape Inference //POST (1) H(x) & x= null => G(x) //BIND (2) H(x) & x!= null => x::node * HP(p) //PRE-REC (3) HP(p) => H(p) //POST (4) x::node * G(p) => G(x) HIP/SLEEK 23

Modular Shape Inference H(x) == emp * x= null \/ x::node * H(p) G(x) ==emp * x= null \/ x::node * G(p) HIP/SLEEK 24

HIP/SLEEK 25 Automation SLEEK + Demo

HIP/SLEEK 26 Automated Verification int length(node x) requires x::ll ensures x::ll & res=n { if (x==null) return 0; // x=null & n = 0 & res = 0 |- x::ll & res = n else node p = x.next; // x::ll & x!=null |- x::node // x::node * q::ll & x!=null & p = q |- p::ll return (1 + length(p)); // x::node * p::ll & x!=null & res = 1 + n – 1 |- x::ll & res = n }

HIP/SLEEK 27 SLEEK : SL Entailment chEcKer checkentail x=null |- x::ll. checkentail x::node *q::ll |- x::ll. checkentail x::ll & n>2 |- x::node. n=0 n=3 q::ll & n>2

HIP/SLEEK 28 May and Must Errors checkentail x::ll |- x::node.  may failure checkentail x::ll & n>2 |- x=null.  must failure Demo

HIP/SLEEK 29 Desired Targets Verify/Analyze your favorite programs Imperative Programs Heap-based Data Structures Recursion Concurrency Generic and Higher-Order Programs

HIP/SLEEK 30 Conclusion Hardware community has accepted verification. Verified software is our future for high- assurance and reliable software. Many challenges still on scalability, automation, expressivity, concurrency and inference, higher-order programs.