Solving Computations. Viktor Kuncak. PhD MIT,

Size: px
Start display at page:

Download "Solving Computations. Viktor Kuncak. PhD MIT,"

Transcription

1 Solving Computations Viktor Kuncak PhD MIT, 2007 School of Computer and Communication Sciences Laboratory for Automated Reasoning and Analysis 1

2 GOAL Help people construct software that does what they expect. My methodology is to develop mathematical models and theorems (theory) algorithms based on the theory tools for computer-aided software construction 2

3 Software is everywhere. But does it do what we expect? For more examples, see Lecture 1 of my M.Sc. course Synthesis, Analysis, and Verification

4 Computer-Aided Software Construction Software verification (Jahob, Udita, Phantm, Leon) specification software verifier correctness constraint constraint solver solutions are counterexamples Software synthesis (Comfusy, Regsy, Kaplan) correct error input specification constraint solver software solutions are programs (or program outputs) 4

5 Underlying technique: Constraint Solving Constraint C(x,y) e.g. x + y > 2 x < y a computable mathematical function (program) with discrete domain (e.g. pair of integers) returns 0 (false) or 1 (true) C : N 2 {0,1} Given x,y we can directly compute C(x,y). But, given x, how to find y such that C(x,y) holds? Wanted: "Gaussian elimination" for programs. 5

6 Constraint solving algorithms enable: Checking assertions while program runs: C(x,y) Verifying that program meets spec: x y. C(x,y) Falsifying: producing a counterexample when verification fails: find x,y such that C(x,y) Computing: find any (or, least) value that satisfies a given constraint: find y such that C(x,y) Generating tests to exercise program behavior: enumerate/sample y such that C(x,y) Synthesis: solving symbolically for all inputs to obtain program that is correct by construction find f such that x. C(x,f(x)) 6

7 Highlights 1) Constraints on multisets and sizes: Optimal complexity through sparse encoding into disjunctive integer linear programs (JAR 06, CADE 07, VMCAI 08, CAV 08, VMCAI 10,CSL'10,VMCAI 11) 2) Constraints with recursive functions on trees Decidable extensions of term algebra (POPL 10, SAS 11, POPL 12) 3) Complete Functional Synthesis Constructive quantifier elimination techniques (PLDI'10,FMCAD'10,CACM'12,POPL'12,IJCAR'12) 7

8 Constraints on Multisets def removeduplicates(i: Bag): Bag = var W = I // Working bag var duplicateexists = false var R = empty // Resulting bag invariant (duplicateexists W R I) W R I while (W empty) val elem = selectone(w) W = W - {elem} if (elem R) duplicateexists = true else R = R {elem} assert duplicateexists R < I R Verification constraint: W R I W R I R < I Solutions to its negation indicate errors, proof of their absence - correctness. Multiset m is a function m: E {0,1,2,...} E unknown (infinite space) (m 1 m 2 )(e)= m 1 (e) + m 2 (e) m = Σe E m(e) Gave optimal constraint solving algorithm. Techniques used: - introduced extension of integer linear arithmetic (LIA*) - reduced MAPA to this extension - semilinear set characterization of solution space of PA formulas - bounds on solution sizes - sparsity theorems by Eisenbrand 8

9 Calculus of Data Structures (VMCAI'10) tree multiset elements treesize 7 msetsize setsize 3 setof Supports operations on data types and homomorphisms between them. Showed decidability, optimal complexity, gave algorithm, implemented. Adding maps - decidable; injective ones - undecidable (Hilbert's 10th) set

10 Verification Using Constraints with Recursive Functions (POPL'10, SAS'11) Adding arbitrary recursive functions yields Turing-complete, unsolvable constraints We identified a useful sub-class of recursive functions preserves decidability Implemented a verification tool: Found and corrected errors during code development Proved automatically that, for all inputs red-black tree implements a set and maintains height invariants associative list has correct read-over-write property insertion sort returns sorted list, of identical content amortized queue implements balanced queue Benchmark LoC #Funs. #VCs. Time (s) ListOperations AssociativeList InsertionSort RedBlackTrees PropLogic AmortizedQueue VSComp

11 program and properties in Scala (accessible) we find counterexamples and proofs fast

12 Use in industry Filtering highly confidential information: In the context of a project to reason about a domain specific language called Guardol for XML message processing applications [ the] procedure has allowed us to prove a number of interesting things [ ], so I'm extremely grateful for it. Michael Whalen Rockwell Collins 12

13 Step beyond: Executing Specifications (POPL'12) def insert(x : Int, t : Tree) = choose(t1:tree => balanced(t1) && content(t1) = content(t) ++ Set(x)) def remove(x : Int, t : Tree) = choose(t1:tree => balanced(t1) && content(t1) = content(t) Set(x)) The biggest expected payoff: declarative knowledge is more reusable Received interest to use such language in research (UCLA) and teaching (Rice University).

14 Faster code: Software synthesis def secondstotime (totalseconds : Int) : Int = choose((h: Int, m: Int, s: Int) ( h * m * 60 + s == totalseconds && h 0 && m 0 && m < 60 && s 0 && s < 60)).find def secondstotime (totalseconds : Int) : Int = t1 = totalseconds div 3600 t2 = totalseconds * t1 t3 = t2 div 60 t4 = totalseconds * t1-60 * t3 (t1, t3, t4) This approach could have avoided e.g. freeze bug in Microsoft Zune. 14

15 Properties of Synthesis Algorithm For every formula in linear integer arithmetic synthesis algorithm terminates produces the most general precondition (assertion saying when result exists) generated code always gives correct values whenever correct values exist; reports when they do not exist If there are multiple or no solutions for some parameters, the algorithm detects this Extended to arithmetic pattern matching Extended to sets with cardinalities Handling bitwise operations (FMCAD'10, IJCAR'12) 15

16 Foreword to the Research Highlights Article in the Communications of the ACM I predict that as we identify more such restricted languages and integrate them into generalpurpose (Turing-complete) languages, we will make programming more productive and programs more reliable. Rastislav Bodik Associate Professor, UC Berkeley 16

17 certified moon computations found security bugs in web applications found bugs in Java compilers and IDEs

18 Doctoral Students Eva Darulová Tihomir Gvero Hossein Hojjat Etienne Kneuss Giuliano Losa (w/ Rachid Guerraoui) Andrej Spielmann (w/ Christoph Koch) Philippe Suter graduating in 2012, joining IBM Research, NY Ruzica Piskac, graduated 2011, now tenure-track faculty member at the Max-Planck Institute 18

19 Future Work Implicit Programming As announced in early June 2012 this research is funded with a million EUR Starting ERC grant from the European Research Council (Remark: total funding of around 3.8 million CHF so far) 19

20 Problem: Programming is hard, because computation is given explicitly (how) Claim: We can make it easier, if we support implicit computation (what) 20

21 human intentions Implicit Programming GAP 21

22 human intentions IMPRO 22

23 1) Synthesis Procedures = compiler for specifications constraint between inputs and outputs (from a decidable class) computable function from inputs to outputs Numeric domains: linear integers, reals (PLDI 10, OOPSLA 11) Symbolic domains: Calculus of Data Structures (VMCAI 10,CSL 10) 23

24 2) Empowering Users Application customization: modify an application through feedback on its behavior, e.g. Change layout/text/parameters Change the order of actions Programming by demonstration: learning Development assistance tools Synthesis of code snippets: Ambiguous input handling Programs that are almost correct (repair) Specifications written in natural language Prototype language under development Revisit a combination of NLP and PL techniques 24

25 Interactive Synthesis within an IDE 25

26 Interactive Synthesis within an IDE - working on technology transfer to Typesafe startup of Martin Odersky

27 Implicit Programming Human-friendly and verification-friendly computation Programming with implicit specifications Synthesis procedures: compile implicit specs into code Build on advances in SAT and decision procedures SMT Quantifier elimination, partial evaluation, modularity Deploy specifications into programming languages Just-in-time synthesis for efficiency Strengthening specifications using static analysis Validation of code containing implicit computation Help developers construct specifications Run-time application customization and manipulation Programming assistance tools Ambiguous inputs as specification source 27

28 Related Efforts April 2012: U.S. National Science Foundation awarded 10 million USD Expedition grant: Computer-Augmented Program Engineering Leader: Rajeev Alur from UPenn Participanting universities: Cornell, MIT, Rice, Berkeley, UCLA, UIUC, Maryland, Michigan, UPenn COST (Networking) Action IC0901 that I am chairing is one of few activities in Europe supporting this area countries 6% acceptance rate in 2009 when it was approved Established work groups on: standardization of languages, decision procedures, verification, and synthesis Supported and co-organized 1 st summer school on synthesis 28

29 Further Activities at EPFL Member of doctoral admissions committee Participated in two NNCR pre-proposals Member of EcoCloud center (Babak Falsafi) Teaching, last median student evaluation: Compiler Construction (BSc, 5.0) Synthesis, Analysis, and Verification (MSc, 6.0) Automated grading infrastructure relevant for online courses CTI Projects and tech transfer planned 29

30 Conclusions Theory, algorithms, and tools for software construction Communications of the ACM Research Highlight; Best papers Working with 7 doctoral students Graduated one doctoral student, Ruzica Piskac she is now tenure-track faculty at a peer institution Philippe Suter graduating, joining top research lab (IBM, US) Raised 3.8 million, including 1.7 million CHF ERC starting grant Released tools that help construct reliable software Technology transfer with Typesafe startup of Martin Odersky Also collaborations with Guerraoui, Koch; Atienza, Eisenbrand Teaching at BSc, MSc, PhD level (future: online courses) Chair of COST Action gathering 20 countries, PC chair, keynotes

Laboratory for Automated Reasoning and Analysis

Laboratory for Automated Reasoning and Analysis http://lara.epfl.ch Laboratory for Automated Reasoning and Analysis Viktor Kuncak Assistant Professor, IC a project: http://javaverification.org ongoing class: http://richmodels.org/lat Spring, will be

More information

Your Wish is my Command

Your Wish is my Command Your Wish is my Command Viktor Kunčak School of Computer and Communication Sciences Laboratory for Automated Reasoning and Analysis http://lara.epfl.ch wish human effort Command(program) compilation 11011001

More information

Synthesis using Variable Elimination

Synthesis using Variable Elimination Synthesis using Variable Elimination Viktor Kuncak EPF Lausanne http://lara.epfl.ch/w/impro Implicit Programming at All Levels Opportunities for implicit programming in Development within an IDE InSynth

More information

Synthesizing Computable Functions from Relations. Viktor Kuncak. EPFL Laboratory for Automated Reasoning and Analysis

Synthesizing Computable Functions from Relations. Viktor Kuncak. EPFL Laboratory for Automated Reasoning and Analysis Synthesizing Computable Functions from Relations Viktor Kuncak EPFL Laboratory for Automated Reasoning and Analysis http://lara.epfl.ch http://leon.epfl.ch wish requirement formalization From your wish

More information

Automating Construction of Provably Correct Software Viktor Kuncak

Automating Construction of Provably Correct Software Viktor Kuncak Your Wish is my Command Automating Construction of Provably Correct Software Viktor Kuncak EPFL School of Computer and Communication Sciences Laboratory for Automated Reasoning and Analysis http://lara.epfl.ch

More information

Implicit Programming

Implicit Programming Implicit Programming Viktor Kuncak EPF Lausanne http://lara.epfl.ch/w/impro Joint work with Ruzica Piskac Philippe Suter Tihomir Gvero Mikaël Mayer Ali Sinan Köksal EPFL Sebastien Vasey Barbara Jobstmann

More information

Software Construction using Executable Constraints

Software Construction using Executable Constraints Software Construction using Executable Constraints Presented by: Viktor Kuncak joint work with: Ali Sinan Köksal, Ruzica Piskac, and Philippe Suter Swiss Federal Institute of Technology Lausanne (EPFL)

More information

doi: / Software Synthesis Procedures By Viktor Kuncak, Mikaël Mayer, Ruzica Piskac, and Philippe Suter

doi: / Software Synthesis Procedures By Viktor Kuncak, Mikaël Mayer, Ruzica Piskac, and Philippe Suter doi:10.1145/2076450.2076472 Software Synthesis Procedures By Viktor Kuncak, Mikaël Mayer, Ruzica Piskac, and Philippe Suter Abstract Automated synthesis of program fragments from specifications can make

More information

ExCAPE. Expeditions in Computer Augmented Program Engineering

ExCAPE. Expeditions in Computer Augmented Program Engineering ExCAPE Expeditions in Computer Augmented Program Engineering Rajeev Alur, Ras Bodik, Jeff Foster, Bjorn Hartmann, Lydia Kavraki, Hadas Kress-Gazit, Stephane Lafortune, Boon Loo, P. Madhusudan, Milo Martin,

More information

On Interactive Synthesis of Code Snippets

On Interactive Synthesis of Code Snippets On Interactive Synthesis of Code Snippets Tihomir Gvero, Viktor Kuncak, and Ruzica Piskac firstname.lastname@epfl.ch Swiss Federal Institute of Technology (EPFL), Switzerland Abstract. We describe a tool

More information

ARGO - Automated Reasoning GrOup

ARGO - Automated Reasoning GrOup Filip Marić Faculty of Mathematics, University of Belgrade 30. 3. 2013. Overview 1 About our group 2 SAT/SMT solving 3 ATP in geometry 4 Formalizations in ITP 5 Software verification tools 6 Applications

More information

Compiler Construction 2011, Lecture 2

Compiler Construction 2011, Lecture 2 http://lara.epfl.ch http://tiny.cc/compilers Drawing Hands M.C. Escher, 1948 Compiler Construction 2011, Lecture 2 Staff: Viktor Kuncak Lectures Etienne Kneuss and Philippe Suter {labs Eva Darulova and

More information

Counterexample-Driven Genetic Programming

Counterexample-Driven Genetic Programming Counterexample-Driven Genetic Programming Iwo Błądek, Krzysztof Krawiec Institute of Computing Science, Poznań University of Technology Poznań, 12.12.2017 I. Błądek, K. Krawiec Counterexample-Driven Genetic

More information

Proofs and Counterexamples for Java Programs

Proofs and Counterexamples for Java Programs http://lara.epfl.ch Proofs and Counterexamples for Java Programs Viktor Kuncak Laboratory for Automated Reasoning and Analysis School of Computer and Communication Sciences École Polytechnique Fédérale

More information

VS 3 : SMT Solvers for Program Verification

VS 3 : SMT Solvers for Program Verification VS 3 : SMT Solvers for Program Verification Saurabh Srivastava 1,, Sumit Gulwani 2, and Jeffrey S. Foster 1 1 University of Maryland, College Park, {saurabhs,jfoster}@cs.umd.edu 2 Microsoft Research, Redmond,

More information

Static Program Analysis Part 1 the TIP language

Static Program Analysis Part 1 the TIP language Static Program Analysis Part 1 the TIP language http://cs.au.dk/~amoeller/spa/ Anders Møller & Michael I. Schwartzbach Computer Science, Aarhus University Questions about programs Does the program terminate

More information

EECS 219C: Formal Methods Syntax-Guided Synthesis (selected/adapted slides from FMCAD 13 tutorial by R. Alur) Sanjit A. Seshia EECS, UC Berkeley

EECS 219C: Formal Methods Syntax-Guided Synthesis (selected/adapted slides from FMCAD 13 tutorial by R. Alur) Sanjit A. Seshia EECS, UC Berkeley EECS 219C: Formal Methods Syntax-Guided Synthesis (selected/adapted slides from FMCAD 13 tutorial by R. Alur) Sanjit A. Seshia EECS, UC Berkeley Solving SyGuS Is SyGuS same as solving SMT formulas with

More information

Runtime Checking for Program Verification Systems

Runtime Checking for Program Verification Systems Runtime Checking for Program Verification Systems Karen Zee, Viktor Kuncak, and Martin Rinard MIT CSAIL Tuesday, March 13, 2007 Workshop on Runtime Verification 1 Background Jahob program verification

More information

Reasoning About Set Comprehensions

Reasoning About Set Comprehensions Reasoning About Set Comprehensions Edmund S L Lam 1 and Iliano Cervesato 1 Carnegie Mellon University sllam@qatarcmuedu, iliano@cmuedu Abstract Set comprehension is a mathematical notation for defining

More information

DEPARTMENT OF COMPUTER SCIENCE

DEPARTMENT OF COMPUTER SCIENCE Department of Computer Science 1 DEPARTMENT OF COMPUTER SCIENCE Office in Computer Science Building, Room 279 (970) 491-5792 cs.colostate.edu (http://www.cs.colostate.edu) Professor L. Darrell Whitley,

More information

Networked Systems. Boon Thau Loo. University of Pennsylvania. NSF ExCAPE Meeting 20 Aug 2013

Networked Systems. Boon Thau Loo. University of Pennsylvania. NSF ExCAPE Meeting 20 Aug 2013 Networked Systems Boon Thau Loo University of Pennsylvania NSF ExCAPE Meeting 20 Aug 2013 Outline Summary (activities over past year) Research highlights Conclusion Year 1 in Retrospect Original proposal

More information

Ruzica Piskac Yale University

Ruzica Piskac Yale University Ruzica Piskac Yale University Why Software Verification? Maiden flight of the Ariane 5 rocket on the 4th of June 1996 The reason for the explosion was a software error Financial loss: $500,000,000 (including

More information

Static program checking and verification

Static program checking and verification Chair of Software Engineering Software Engineering Prof. Dr. Bertrand Meyer March 2007 June 2007 Slides: Based on KSE06 With kind permission of Peter Müller Static program checking and verification Correctness

More information

Syntax-Guided Program Synthesis. Rajeev Alur. University of Pennsylvania

Syntax-Guided Program Synthesis. Rajeev Alur. University of Pennsylvania Syntax-Guided Program Synthesis Rajeev Alur University of Pennsylvania 1 Goal: Programming computers easier than communicating with people Can programming be liberated, period. David Harel, IEEE Computer,

More information

Syntax-Guided Program Synthesis. Rajeev Alur

Syntax-Guided Program Synthesis. Rajeev Alur Syntax-Guided Program Synthesis Rajeev Alur University of Pennsylvania 1 Goal: Programming computers easier than communicating with people Can programming be liberated, period. David Harel, IEEE Computer,

More information

Verifying the Safety of Security-Critical Applications

Verifying the Safety of Security-Critical Applications Verifying the Safety of Security-Critical Applications Thomas Dillig Stanford University Thomas Dillig 1 of 31 Why Program Verification? Reliability and security of software is a huge problem. Thomas Dillig

More information

Why3 where programs meet provers

Why3 where programs meet provers Why3 where programs meet provers Jean-Christophe Filliâtre CNRS KeY Symposium 2017 Rastatt, Germany October 5, 2017 history started in 2001, as an intermediate language in the process of verifying C and

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

Abstract Interpretation

Abstract Interpretation Abstract Interpretation Ranjit Jhala, UC San Diego April 22, 2013 Fundamental Challenge of Program Analysis How to infer (loop) invariants? Fundamental Challenge of Program Analysis Key issue for any analysis

More information

Deductive Program Verification with Why3, Past and Future

Deductive Program Verification with Why3, Past and Future Deductive Program Verification with Why3, Past and Future Claude Marché ProofInUse Kick-Off Day February 2nd, 2015 A bit of history 1999: Jean-Christophe Filliâtre s PhD Thesis Proof of imperative programs,

More information

Automatic Software Verification

Automatic Software Verification Automatic Software Verification Instructor: Mooly Sagiv TA: Oded Padon Slides from Eran Yahav and the Noun Project, Wikipedia Course Requirements Summarize one lecture 10% one lecture notes 45% homework

More information

On Satisfiability Modulo Computable Functions

On Satisfiability Modulo Computable Functions On Satisfiability Modulo Computable Functions EPFL-REPORT-161285 Philippe Suter, Ali Sinan Köksal, and Viktor Kuncak École Polytechnique Fédérale de Lausanne (EPFL), Switzerland {firstname.lastname}@epfl.ch

More information

Growing Solver-Aided Languages with ROSETTE

Growing Solver-Aided Languages with ROSETTE Growing Solver-Aided Languages with ROSETTE Emina Torlak & Rastislav Bodik U.C. Berkeley ExCAPE June 10, 2013 solver-aided domain-specific language Solver-aided DSL (SDSL) Noun 1. A high-level language

More information

Functional Synthesis for Linear Arithmetic and Sets

Functional Synthesis for Linear Arithmetic and Sets Software Tools for Technology Transfer manuscript No. (will be inserted by the editor) Functional Synthesis for Linear Arithmetic and Sets Viktor Kuncak, Mikaël Mayer, Ruzica Piskac, Philippe Suter School

More information

Formalization of Incremental Simplex Algorithm by Stepwise Refinement

Formalization of Incremental Simplex Algorithm by Stepwise Refinement Formalization of Incremental Simplex Algorithm by Stepwise Refinement Mirko Spasić, Filip Marić Faculty of Mathematics, University of Belgrade FM2012, 30. August 2012. Overview 1 Introduction 2 Approach

More information

Simply-Typed Lambda Calculus

Simply-Typed Lambda Calculus #1 Simply-Typed Lambda Calculus #2 Back to School What is operational semantics? When would you use contextual (small-step) semantics? What is denotational semantics? What is axiomatic semantics? What

More information

MASTER OF ENGINEERING PROGRAM IN INFORMATION

MASTER OF ENGINEERING PROGRAM IN INFORMATION MASTER OF ENGINEERING PROGRAM IN INFORMATION AND COMMUNICATION TECHNOLOGY FOR EMBEDDED SYSTEMS (INTERNATIONAL PROGRAM) Curriculum Title Master of Engineering in Information and Communication Technology

More information

Rethinking Automated Theorem Provers?

Rethinking Automated Theorem Provers? Rethinking Automated Theorem Provers? David J. Pearce School of Engineering and Computer Science Victoria University of Wellington @WhileyDave http://whiley.org http://github.com/whiley Background Verification:

More information

Abstractions and small languages in synthesis CS294: Program Synthesis for Everyone

Abstractions and small languages in synthesis CS294: Program Synthesis for Everyone Abstractions and small languages in synthesis CS294: Program Synthesis for Everyone Ras Bodik Emina Torlak Division of Computer Science University of California, Berkeley Today Today: we describe why high-level

More information

A Michael Jackson presentation. CSE503: Software Engineering. The following slides are from his keynote at ICSE 1995

A Michael Jackson presentation. CSE503: Software Engineering. The following slides are from his keynote at ICSE 1995 A Michael Jackson presentation CSE503: Software Engineering The following slides are from his keynote at ICSE 1995 David Notkin University of Washington Computer Science & Engineering Spring 2006 1 2 3

More information

Integrating verification in programming languages

Integrating verification in programming languages Integrating verification in programming languages Thomas Jensen, INRIA Seminar INRIA Rennes, 04/11/2015 Collège de France Chaire Algorithmes, machines et langages x / y Types For division to make sense,

More information

From Event-B Models to Dafny Code Contracts

From Event-B Models to Dafny Code Contracts From Event-B Models to Dafny Code Contracts Mohammadsadegh Dalvandi, Michael Butler, Abdolbaghi Rezazadeh Electronic and Computer Science School, University of Southampton Southampton, United Kingdom {md5g11,mjb,ra3}@ecs.soton.ac.uk

More information

Axiomatic Rules. Lecture 18: Axiomatic Semantics & Type Safety. Correctness using Axioms & Rules. Axiomatic Rules. Steps in Proof

Axiomatic Rules. Lecture 18: Axiomatic Semantics & Type Safety. Correctness using Axioms & Rules. Axiomatic Rules. Steps in Proof Lecture 18: Axiomatic Semantics & Type Safety CSCI 131 Fall, 2011 Kim Bruce Axiomatic Rules Assignment axiom: - {P [expression / id]} id := expression {P} - Ex: {a+47 > 0} x := a+47 {x > 0} - {x > 1} x

More information

Let s Unify With Scala Pattern Matching!

Let s Unify With Scala Pattern Matching! Let s Unify With Scala Pattern Matching! Edmund S.L. Lam 1 and Iliano Cervesato 1 Carnegie Mellon University Qatar sllam@qatar.cmu.edu and iliano@cmu.edu Abstract Scala s pattern matching framework supports

More information

Chapter 1. Introduction

Chapter 1. Introduction 1 Chapter 1 Introduction An exciting development of the 21st century is that the 20th-century vision of mechanized program verification is finally becoming practical, thanks to 30 years of advances in

More information

SMT-based Verification of Heap-manipulating Programs

SMT-based Verification of Heap-manipulating Programs SMT-based Verification of Heap-manipulating Programs Ruzica Piskac VTSA 2016 A Motivating Example procedure delete(x: Node) { if (x!= null) { delete(x.next); free(x); } } x null next next next From Hand-Waving

More information

Testing & Symbolic Execution

Testing & Symbolic Execution Testing & Symbolic Execution Software Testing The most common way of measuring & ensuring correctness Input 2 Software Testing The most common way of measuring & ensuring correctness Input Observed Behavior

More information

The SMT-LIB 2 Standard: Overview and Proposed New Theories

The SMT-LIB 2 Standard: Overview and Proposed New Theories 1 / 23 The SMT-LIB 2 Standard: Overview and Proposed New Theories Philipp Rümmer Oxford University Computing Laboratory philr@comlab.ox.ac.uk Third Workshop on Formal and Automated Theorem Proving and

More information

Outline. Introduction. 2 Proof of Correctness. 3 Final Notes. Precondition P 1 : Inputs include

Outline. Introduction. 2 Proof of Correctness. 3 Final Notes. Precondition P 1 : Inputs include Outline Computer Science 331 Correctness of Algorithms Mike Jacobson Department of Computer Science University of Calgary Lectures #2-4 1 What is a? Applications 2 Recursive Algorithms 3 Final Notes Additional

More information

SMT Solvers for Verification and Synthesis. Andrew Reynolds VTSA Summer School August 1 and 3, 2017

SMT Solvers for Verification and Synthesis. Andrew Reynolds VTSA Summer School August 1 and 3, 2017 SMT Solvers for Verification and Synthesis Andrew Reynolds VTSA Summer School August 1 and 3, 2017 Acknowledgements Thanks to past and present members of development team of CVC4: Cesare Tinelli, Clark

More information

Chapter 3 (part 3) Describing Syntax and Semantics

Chapter 3 (part 3) Describing Syntax and Semantics Chapter 3 (part 3) Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings

More information

The design of a programming language for provably correct programs: success and failure

The design of a programming language for provably correct programs: success and failure The design of a programming language for provably correct programs: success and failure Don Sannella Laboratory for Foundations of Computer Science School of Informatics, University of Edinburgh http://homepages.inf.ed.ac.uk/dts

More information

Lecture 4 Searching Arrays

Lecture 4 Searching Arrays Lecture 4 Searching Arrays 15-122: Principles of Imperative Computation (Spring 2018) Frank Pfenning One of the fundamental and recurring problems in computer science is to find elements in collections,

More information

Lecture Notes on Linear Search

Lecture Notes on Linear Search Lecture Notes on Linear Search 15-122: Principles of Imperative Computation Frank Pfenning Lecture 5 January 28, 2014 1 Introduction One of the fundamental and recurring problems in computer science is

More information

6. Hoare Logic and Weakest Preconditions

6. Hoare Logic and Weakest Preconditions 6. Hoare Logic and Weakest Preconditions Program Verification ETH Zurich, Spring Semester 07 Alexander J. Summers 30 Program Correctness There are many notions of correctness properties for a given program

More information

Advances in Programming Languages

Advances in Programming Languages T O Y H Advances in Programming Languages APL4: JML The Java Modeling Language David Aspinall (slides originally by Ian Stark) School of Informatics The University of Edinburgh Thursday 21 January 2010

More information

University of Waterloo Undergraduate Catalog Report Faculty of Mathematics Page No. 1 Run Date 20-AUG-2007 Meeting Number(s) 25

University of Waterloo Undergraduate Catalog Report Faculty of Mathematics Page No. 1 Run Date 20-AUG-2007 Meeting Number(s) 25 Faculty of Mathematics Page No. 1 NEW COURSES (for approval) Computer Science - School of CS 137 ( 0.50 ) LAB, LEC, TST, TUT Programming Principles Review of fundamental programming concepts and their

More information

Why. an intermediate language for deductive program verification

Why. an intermediate language for deductive program verification Why an intermediate language for deductive program verification Jean-Christophe Filliâtre CNRS Orsay, France AFM workshop Grenoble, June 27, 2009 Jean-Christophe Filliâtre Why tutorial AFM 09 1 / 56 Motivations

More information

Cover Page. The handle holds various files of this Leiden University dissertation

Cover Page. The handle   holds various files of this Leiden University dissertation Cover Page The handle http://hdl.handle.net/1887/22891 holds various files of this Leiden University dissertation Author: Gouw, Stijn de Title: Combining monitoring with run-time assertion checking Issue

More information

From Z3 to Lean, Efficient Verification

From Z3 to Lean, Efficient Verification From Z3 to Lean, Efficient Verification Turing Gateway to Mathematics, 19 July 2017 Leonardo de Moura, Microsoft Research Joint work with Nikolaj Bjorner and Christoph Wintersteiger Satisfiability Solution/Model

More information

Lecture 1 Contracts : Principles of Imperative Computation (Fall 2018) Frank Pfenning

Lecture 1 Contracts : Principles of Imperative Computation (Fall 2018) Frank Pfenning Lecture 1 Contracts 15-122: Principles of Imperative Computation (Fall 2018) Frank Pfenning In these notes we review contracts, which we use to collectively denote function contracts, loop invariants,

More information

Scala in Martin Odersky

Scala in Martin Odersky Scala in 2016 - Martin Odersky 2015 was on the quiet side Maturing tools: 2.11.x, IDEs, sbt Steady growth indeed.com jobs google trends In 2016, things will move again Scala 2.12 release Rethinking the

More information

COMPUTER SCIENCE TRIPOS

COMPUTER SCIENCE TRIPOS CST.2011.3.1 COMPUTER SCIENCE TRIPOS Part IB Monday 6 June 2011 1.30 to 4.30 COMPUTER SCIENCE Paper 3 Answer five questions. Submit the answers in five separate bundles, each with its own cover sheet.

More information

Static Program Analysis

Static Program Analysis Static Program Analysis Thomas Noll Software Modeling and Verification Group RWTH Aachen University https://moves.rwth-aachen.de/teaching/ss-18/spa/ Preliminaries Outline of Lecture 1 Preliminaries Introduction

More information

1. [5 points each] True or False. If the question is currently open, write O or Open.

1. [5 points each] True or False. If the question is currently open, write O or Open. University of Nevada, Las Vegas Computer Science 456/656 Spring 2018 Practice for the Final on May 9, 2018 The entire examination is 775 points. The real final will be much shorter. Name: No books, notes,

More information

COSC252: Programming Languages: Semantic Specification. Jeremy Bolton, PhD Adjunct Professor

COSC252: Programming Languages: Semantic Specification. Jeremy Bolton, PhD Adjunct Professor COSC252: Programming Languages: Semantic Specification Jeremy Bolton, PhD Adjunct Professor Outline I. What happens after syntactic analysis (parsing)? II. Attribute Grammars: bridging the gap III. Semantic

More information

Testing. Prof. Clarkson Fall Today s music: Wrecking Ball by Miley Cyrus

Testing. Prof. Clarkson Fall Today s music: Wrecking Ball by Miley Cyrus Testing Prof. Clarkson Fall 2017 Today s music: Wrecking Ball by Miley Cyrus Review Previously in 3110: Modules Specification (functions, modules) Today: Validation Testing Black box Glass box Randomized

More information

Chapter 1: Introduction

Chapter 1: Introduction Chapter 1: Introduction Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Outline The Need for Databases Data Models Relational Databases Database Design Storage Manager Query

More information

ADAM CHLIPALA. Research interests. Education. Refereed conference papers

ADAM CHLIPALA. Research interests. Education. Refereed conference papers 579 Soda Hall Berkeley, CA 94720-1776 USA adamc@cs.berkeley.edu http://www.cs.berkeley.edu/ adamc/ Research interests ADAM CHLIPALA Dependent type systems; interactive theorem proving; type-based programming

More information

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Lecture 19 Tuesday, April 3, 2018 1 Introduction to axiomatic semantics The idea in axiomatic semantics is to give specifications

More information

Incremental Proof Development in Dafny

Incremental Proof Development in Dafny 15-414 Lecture 17 1 Instructor: Matt Fredrikson Incremental Proof Development in Dafny TA: Ryan Wagner In this discussion, we ll see in more detail how to go about proving the total correctness of imperative

More information

Static Analysis and Bugfinding

Static Analysis and Bugfinding Static Analysis and Bugfinding Alex Kantchelian 09/12/2011 Last week we talked about runtime checking methods: tools for detecting vulnerabilities being exploited in deployment. So far, these tools have

More information

Denotational Semantics. Domain Theory

Denotational Semantics. Domain Theory Denotational Semantics and Domain Theory 1 / 51 Outline Denotational Semantics Basic Domain Theory Introduction and history Primitive and lifted domains Sum and product domains Function domains Meaning

More information

Discrete Mathematics Lecture 4. Harper Langston New York University

Discrete Mathematics Lecture 4. Harper Langston New York University Discrete Mathematics Lecture 4 Harper Langston New York University Sequences Sequence is a set of (usually infinite number of) ordered elements: a 1, a 2,, a n, Each individual element a k is called a

More information

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016 University of Nevada, Las Vegas Computer Science 456/656 Fall 2016 The entire examination is 925 points. The real final will be much shorter. Name: No books, notes, scratch paper, or calculators. Use pen

More information

Compiler Construction 2010 (6 credits)

Compiler Construction 2010 (6 credits) http://lara.epfl.ch Drawing Hands M.C. Escher, 1948 Compiler Construction 2010 (6 credits) Staff: Viktor Kuncak Lectures Hossein Hojjat Exercises Philippe Suter {labs} Étienne Kneuss, Ali Sinan Köksal

More information

OpenMath and SMT-LIB

OpenMath and SMT-LIB James, Matthew England, Roberto Sebastiani & Patrick Trentin 1 Universities of Bath/Coventry/Trento/Trento J.H.@bath.ac.uk 17 July 2017 1 Thanks to EU H2020-FETOPEN-2016-2017-CSA project SC 2 (712689)

More information

Computer-Aided Program Design

Computer-Aided Program Design Computer-Aided Program Design Spring 2015, Rice University Unit 1 Swarat Chaudhuri January 22, 2015 Reasoning about programs A program is a mathematical object with rigorous meaning. It should be possible

More information

Software Model Checking. Xiangyu Zhang

Software Model Checking. Xiangyu Zhang Software Model Checking Xiangyu Zhang Symbolic Software Model Checking CS510 S o f t w a r e E n g i n e e r i n g Symbolic analysis explicitly explores individual paths, encodes and resolves path conditions

More information

Smten: Automatic Translation of High-level Symbolic Computations into SMT Queries

Smten: Automatic Translation of High-level Symbolic Computations into SMT Queries Smten: Automatic Translation of High-level Symbolic Computations into SMT Queries Richard Uhler 1 and Nirav Dave 2 1 Massachusetts Institute of Technology, Computer Science and Artificial Intelligence

More information

Softwaretechnik. Program verification. Software Engineering Albert-Ludwigs-University Freiburg. June 30, 2011

Softwaretechnik. Program verification. Software Engineering Albert-Ludwigs-University Freiburg. June 30, 2011 Softwaretechnik Program verification Software Engineering Albert-Ludwigs-University Freiburg June 30, 2011 (Software Engineering) Softwaretechnik June 30, 2011 1 / 28 Road Map Program verification Automatic

More information

Matching Logic A New Program Verification Approach

Matching Logic A New Program Verification Approach Matching Logic A New Program Verification Approach Grigore Rosu and Andrei Stefanescu University of Illinois at Urbana-Champaign (work started in 2009 with Wolfram Schulte at MSR) Usable Verification Relatively

More information

Model Checking. Automatic Verification Model Checking. Process A Process B. when not possible (not AI).

Model Checking. Automatic Verification Model Checking. Process A Process B. when not possible (not AI). Sérgio Campos scampos@dcc.ufmg.br Why? Imagine the implementation of a complex hardware or software system: A 100K gate ASIC perhaps 100 concurrent modules; A flight control system dozens of concurrent

More information

System LAV and Its Applications

System LAV and Its Applications Progress in Decision Procedures: From Formalizations to Applications Belgrade, March 30, 2013. Overview, Viktor Kuncak Development and Evaluation of : an SMT-Based Error Finding Platform. Verified Software:

More information

CS Computable Functions. Reading: Chapter 2

CS Computable Functions. Reading: Chapter 2 CS 242 2012 Computable Functions Reading: Chapter 2 Foundations: Partial,Total Functions Value of an expression may be undefined Undefined operation, e.g., division by zero 3/0 has no value implementation

More information

PLDI 2016 Tutorial Automata-Based String Analysis

PLDI 2016 Tutorial Automata-Based String Analysis PLDI 2016 Tutorial Automata-Based String Analysis Tevfik Bultan, Abdulbaki Aydin, Lucas Bang Verification Laboratory http://vlab.cs.ucsb.edu Department of Computer Science Common Usages of Strings } Input

More information

CSCI 3155: Homework Assignment 3

CSCI 3155: Homework Assignment 3 CSCI 3155: Homework Assignment 3 Spring 2012: Due Monday, February 27, 2012 Like last time, find a partner. You will work on this assignment in pairs. However, note that each student needs to submit a

More information

Deductive Program Verification with Why3

Deductive Program Verification with Why3 Deductive Program Verification with Why3 Jean-Christophe Filliâtre CNRS Mathematical Structures of Computation Formal Proof, Symbolic Computation and Computer Arithmetic Lyon, February 2014 definition

More information

PLDI: U: Type Assisted Synthesis of Recursive Transformers on Algebraic Datatypes

PLDI: U: Type Assisted Synthesis of Recursive Transformers on Algebraic Datatypes PLDI: U: Type Assisted Synthesis of Recursive Transformers on Algebraic Datatypes Jeevana Priya Inala MIT jinala@mit.edu Advisor: Armando Solar-Lezama 1. Problem and Motivation As programming languages

More information

Lecture 1 Contracts. 1 A Mysterious Program : Principles of Imperative Computation (Spring 2018) Frank Pfenning

Lecture 1 Contracts. 1 A Mysterious Program : Principles of Imperative Computation (Spring 2018) Frank Pfenning Lecture 1 Contracts 15-122: Principles of Imperative Computation (Spring 2018) Frank Pfenning In these notes we review contracts, which we use to collectively denote function contracts, loop invariants,

More information

Program Analysis and Code Verification

Program Analysis and Code Verification Program Analysis and Code Verification http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Language Lectures: English Labs: English Homework: Czech/English

More information

CITS5501 Software Testing and Quality Assurance Formal methods

CITS5501 Software Testing and Quality Assurance Formal methods CITS5501 Software Testing and Quality Assurance Formal methods Unit coordinator: Arran Stewart May 1, 2018 1 / 49 Sources Pressman, R., Software Engineering: A Practitioner s Approach, McGraw-Hill, 2005

More information

Tree Interpolation in Vampire

Tree Interpolation in Vampire Tree Interpolation in Vampire Régis Blanc 1, Ashutosh Gupta 2, Laura Kovács 3, and Bernhard Kragl 4 1 EPFL 2 IST Austria 3 Chalmers 4 TU Vienna Abstract. We describe new extensions of the Vampire theorem

More information

GNATprove a Spark2014 verifying compiler Florian Schanda, Altran UK

GNATprove a Spark2014 verifying compiler Florian Schanda, Altran UK 1 GNATprove a Spark2014 verifying compiler Florian Schanda, Altran UK Tool architecture User view Source gnatprove Verdict 2 Tool architecture More detailed view... Source Encoding CVC4 gnat2why gnatwhy3

More information

Second-Order Type Systems

Second-Order Type Systems #1 Second-Order Type Systems Homework 5 Summary Student : 37.9704 Student : 44.4466 ORIGINAL : 50.2442 Student : 50.8275 Student : 50.8633 Student : 50.9181 Student : 52.1347 Student : 52.1633 Student

More information

Programming with Constraint Solvers CS294: Program Synthesis for Everyone

Programming with Constraint Solvers CS294: Program Synthesis for Everyone Programming with Constraint Solvers CS294: Program Synthesis for Everyone Ras Bodik Emina Torlak Division of Computer Science University of California, Berkeley Today Today: we describe four programming

More information

Please consult the Department of Engineering about the Computer Engineering Emphasis.

Please consult the Department of Engineering about the Computer Engineering Emphasis. COMPUTER SCIENCE Computer science is a dynamically growing discipline. ABOUT THE PROGRAM The Department of Computer Science is committed to providing students with a program that includes the basic fundamentals

More information

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010 CS 3512, Spring 2011 Instructor: Doug Dunham Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010 Prerequisites: Calc I, CS2511 Rough course outline:

More information

Verification of Selection and Heap Sort Using Locales

Verification of Selection and Heap Sort Using Locales Verification of Selection and Heap Sort Using Locales Danijela Petrović September 19, 2015 Abstract Stepwise program refinement techniques can be used to simplify program verification. Programs are better

More information

An Evolution of Mathematical Tools

An Evolution of Mathematical Tools An Evolution of Mathematical Tools From Conceptualization to Formalization Here's what we do when we build a formal model (or do a computation): 0. Identify a collection of objects/events in the real world.

More information